yt-uikit 0.8.87 → 0.8.89

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.
Files changed (2) hide show
  1. package/dist/esm/index.js +237 -246
  2. package/package.json +1 -1
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i,useLayoutEffect as a,forwardRef as l}from"react";import c,{keyframes as s,css as d}from"styled-components";import p from"react-otp-input";import{IoClose as u,IoChevronDown as m,IoArrowBackCircle as g,IoArrowForwardCircle as x,IoCalendar as f,IoChevronDownOutline as y,IoGiftSharp as b,IoPersonOutline as h,IoWalletOutline as v,IoShareSocialOutline as w,IoGiftOutline as C,IoCreateOutline as E,IoLogoFacebook as k,IoLogoInstagram as T,IoLogoTwitter as S,IoLogoYoutube as $,IoDiamondOutline as B,IoCheckmark as N,IoCopy as I,IoChevronBack as z,IoChevronForward as F}from"react-icons/io5";import{PhoneInput as D}from"react-international-phone";import P,{createPortal as A}from"react-dom";import{FaShoppingCart as _,FaAngleUp as R,FaAngleDown as O,FaChevronRight as L,FaArrowLeft as M,FaChevronDown as V,FaChevronUp as j,FaGift as W,FaRegQuestionCircle as H,FaCheckCircle as q,FaLockOpen as Q,FaPlus as U,FaLock as Y,FaTimes as G,FaCheck as X,FaChevronLeft as Z}from"react-icons/fa";import{RxInfoCircled as K,RxMinus as J}from"react-icons/rx";import{RiDeleteBinLine as ee,RiDeleteBinFill as te,RiCouponLine as ne,RiCloseLine as oe}from"react-icons/ri";import{atom as re,useAtom as ie,useAtomValue as ae,useSetAtom as le}from"jotai";import{atomWithStorage as ce}from"jotai/utils";import se from"currency-symbol-map";import{FaBagShopping as de,FaRegCopy as pe}from"react-icons/fa6";import{TbShoppingBagEdit as ue,TbTrashXFilled as me,TbTrashX as ge}from"react-icons/tb";import{MdChevronLeft as xe,MdChevronRight as fe,MdDiscount as ye,MdClose as be,MdVerified as he}from"react-icons/md";import ve from"canvas-confetti";import{IoMdCheckmark as we,IoIosCart as Ce,IoMdPricetags as Ee,IoMdArrowDropleft as ke,IoMdArrowDropright as Te,IoIosStar as Se,IoIosArrowDown as $e}from"react-icons/io";import{AiFillGift as Be,AiOutlineEdit as Ne}from"react-icons/ai";import{BiSolidTShirt as Ie,BiCube as ze,BiPlus as Fe,BiSearch as De,BiFilterAlt as Pe,BiSortAlt2 as Ae,BiMinus as _e,BiTrash as Re,BiCheck as Oe,BiPencil as Le,BiChevronDown as Me,BiSolidDiscount as Ve}from"react-icons/bi";import{BsCupHotFill as je,BsReceiptCutoff as We,BsInfoCircle as He,BsCheck as qe,BsX as Qe,BsArrowRight as Ue,BsXLg as Ye,BsChevronDown as Ge}from"react-icons/bs";import{PiPercentDuotone as Xe}from"react-icons/pi";import{HiOutlineShoppingBag as Ze,HiTag as Ke}from"react-icons/hi";import{LuZap as Je}from"react-icons/lu";import{GrFormNext as et,GrFormSubtract as tt,GrFormAdd as nt,GrGift as ot}from"react-icons/gr";import{ClipLoader as rt,ScaleLoader as it}from"react-spinners";import{FiLock as at,FiTrash as lt}from"react-icons/fi";import{HiOutlineShoppingBag as ct}from"react-icons/hi2";import{ImCheckboxChecked as st,ImCheckboxUnchecked as dt}from"react-icons/im";import pt from"react-calendar";import ut from"react-modal-image";var mt='<svg width="29" height="23" viewBox="0 0 29 23" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M3.58718 11.5427H14.229V12.9247H3.58718V11.5427Z" fill="#FF4E4E"/>\n<path d="M1.81354 8.08752H10.6818V9.46959H1.81354V8.08752Z" fill="#FF4E4E"/>\n<path d="M26.5737 11.9615L23.9133 7.12431C23.845 6.99997 23.7314 6.89401 23.5865 6.81956C23.4416 6.74511 23.2718 6.70547 23.0983 6.70554H20.4378V5.32348C20.4378 5.1402 20.3444 4.96444 20.1781 4.83484C20.0118 4.70525 19.7862 4.63245 19.551 4.63245H5.36184V6.01451H18.6642V14.6911C18.2601 14.8739 17.9064 15.1173 17.6236 15.4072C17.3408 15.697 17.1345 16.0277 17.0165 16.38H11.4437C11.2278 15.7286 10.7145 15.1609 9.99991 14.7833C9.28533 14.4057 8.41855 14.2441 7.56205 14.3289C6.70554 14.4137 5.91811 14.739 5.34737 15.2438C4.77662 15.7486 4.46173 16.3982 4.46173 17.071C4.46173 17.7438 4.77662 18.3935 5.34737 18.8983C5.91811 19.4031 6.70554 19.7283 7.56205 19.8131C8.41855 19.8979 9.28533 19.7363 9.99991 19.3587C10.7145 18.9812 11.2278 18.4134 11.4437 17.762H17.0165C17.2094 18.3551 17.6506 18.8811 18.2702 19.2569C18.8899 19.6326 19.6526 19.8366 20.4378 19.8366C21.223 19.8366 21.9857 19.6326 22.6054 19.2569C23.2251 18.8811 23.6663 18.3551 23.8592 17.762H25.7587C25.9939 17.762 26.2195 17.6892 26.3858 17.5596C26.5521 17.43 26.6456 17.2543 26.6456 17.071V12.2338C26.6456 12.1402 26.6212 12.0475 26.5737 11.9615ZM8.02231 18.4531C7.67151 18.4531 7.3286 18.372 7.03692 18.2202C6.74525 18.0683 6.51792 17.8524 6.38367 17.5999C6.24943 17.3474 6.21431 17.0695 6.28274 16.8014C6.35118 16.5333 6.5201 16.287 6.76815 16.0937C7.0162 15.9005 7.33223 15.7688 7.67629 15.7155C8.02034 15.6622 8.37696 15.6895 8.70105 15.7942C9.02514 15.8988 9.30215 16.0759 9.49704 16.3032C9.69193 16.5305 9.79595 16.7977 9.79595 17.071C9.79548 17.4374 9.60846 17.7888 9.27594 18.0479C8.94342 18.307 8.49256 18.4527 8.02231 18.4531ZM20.4378 8.0876H22.513L24.4143 11.5428H20.4378V8.0876ZM20.4378 18.4531C20.087 18.4531 19.7441 18.372 19.4524 18.2202C19.1608 18.0683 18.9334 17.8524 18.7992 17.5999C18.6649 17.3474 18.6298 17.0695 18.6983 16.8014C18.7667 16.5333 18.9356 16.287 19.1837 16.0937C19.4317 15.9005 19.7477 15.7688 20.0918 15.7155C20.4358 15.6622 20.7925 15.6895 21.1166 15.7942C21.4406 15.8988 21.7177 16.0759 21.9125 16.3032C22.1074 16.5305 22.2115 16.7977 22.2115 17.071C22.211 17.4374 22.024 17.7888 21.6915 18.0479C21.3589 18.307 20.9081 18.4527 20.4378 18.4531ZM24.8719 16.38H23.8592C23.6638 15.7881 23.2219 15.2634 22.6028 14.8882C21.9836 14.513 21.2222 14.3086 20.4378 14.3069V12.9248H24.8719V16.38Z" fill="#4D4D4D"/>\n</svg>';function gt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}gt('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Space+Grotesk:wght@300..700&display=swap");');gt(".react-international-phone-country-selector{position:relative}.react-international-phone-country-selector-button{display:flex;height:var(--react-international-phone-height, 36px);box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));margin:0;appearance:button;-webkit-appearance:button;background-color:var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));cursor:pointer;text-transform:none;user-select:none}.react-international-phone-country-selector-button:hover{background-color:var(--react-international-phone-country-selector-background-color-hover, whitesmoke)}.react-international-phone-country-selector-button--hide-dropdown{cursor:auto}.react-international-phone-country-selector-button--hide-dropdown:hover{background-color:transparent}.react-international-phone-country-selector-button__button-content{display:flex;align-items:center;justify-content:center}.react-international-phone-country-selector-button__flag-emoji{margin:0 4px}.react-international-phone-country-selector-button__flag-emoji--disabled{opacity:.75}.react-international-phone-country-selector-button__dropdown-arrow{border-top:var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);border-right:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;border-left:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;margin-right:4px;transition:all .1s ease-out}.react-international-phone-country-selector-button__dropdown-arrow--active{transform:rotateX(180deg)}.react-international-phone-country-selector-button__dropdown-arrow--disabled{border-top-color:var(--react-international-phone-disabled-country-selector-arrow-color, #999)}.react-international-phone-country-selector-button--disabled{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));cursor:auto}.react-international-phone-country-selector-button--disabled:hover{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke))}.react-international-phone-flag-emoji{width:var(--react-international-phone-flag-width, 24px);height:var(--react-international-phone-flag-height, 24px);box-sizing:border-box}.react-international-phone-country-selector-dropdown{position:absolute;z-index:1;top:var(--react-international-phone-dropdown-top, 44px);left:var(--react-international-phone-dropdown-left, 0);display:flex;width:300px;max-height:200px;flex-direction:column;padding:4px 0;margin:0;background-color:var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));box-shadow:var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));color:var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));list-style:none;overflow-y:scroll}.react-international-phone-country-selector-dropdown__preferred-list-divider{height:1px;border:none;margin:var(--react-international-phone-dropdown-preferred-list-divider-margin, 0);background:var(--react-international-phone-dropdown-preferred-list-divider-color, var(--react-international-phone-border-color, gainsboro))}.react-international-phone-country-selector-dropdown__list-item{display:flex;min-height:var(--react-international-phone-dropdown-item-height, 28px);box-sizing:border-box;align-items:center;padding:2px 8px}.react-international-phone-country-selector-dropdown__list-item-flag-emoji{margin-right:8px}.react-international-phone-country-selector-dropdown__list-item-country-name{overflow:hidden;margin-right:8px;font-size:var(--react-international-phone-dropdown-item-font-size, 14px);text-overflow:ellipsis;white-space:nowrap}.react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-dropdown-item-dial-code-color, gray);font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item:hover{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));cursor:pointer}.react-international-phone-country-selector-dropdown__list-item--selected,.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);color:var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222))}.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray))}.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke))}.react-international-phone-dial-code-preview{display:flex;align-items:center;justify-content:center;padding:0 8px;border:1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));margin-right:-1px;background-color:var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));color:var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));font-size:var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px))}.react-international-phone-dial-code-preview--disabled{background-color:var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));color:var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666))}.react-international-phone-input-container{display:flex}.react-international-phone-input-container .react-international-phone-country-selector-button{border-radius:var(--react-international-phone-border-radius, 4px);margin-right:-1px;border-bottom-right-radius:0;border-top-right-radius:0}.react-international-phone-input-container .react-international-phone-input{overflow:visible;height:var(--react-international-phone-height, 36px);box-sizing:border-box;padding:0 8px;border:1px solid var(--react-international-phone-border-color, gainsboro);border-radius:var(--react-international-phone-border-radius, 4px);margin:0;background-color:var(--react-international-phone-background-color, white);border-bottom-left-radius:0;border-top-left-radius:0;color:var(--react-international-phone-text-color, #222);font-family:inherit;font-size:var(--react-international-phone-font-size, 13px)}.react-international-phone-input-container .react-international-phone-input:focus{outline:none}.react-international-phone-input-container .react-international-phone-input--disabled{background-color:var(--react-international-phone-disabled-background-color, whitesmoke);color:var(--react-international-phone-disabled-text-color, #666)}\n");const xt=c.div`
1
+ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i,useLayoutEffect as a,forwardRef as l}from"react";import c,{keyframes as s,css as d}from"styled-components";import p from"react-otp-input";import{IoClose as u,IoChevronDown as m,IoArrowBackCircle as g,IoArrowForwardCircle as x,IoCalendar as f,IoChevronDownOutline as y,IoGiftSharp as b,IoPersonOutline as h,IoWalletOutline as v,IoShareSocialOutline as w,IoGiftOutline as C,IoCreateOutline as E,IoLogoFacebook as k,IoLogoInstagram as T,IoLogoTwitter as S,IoLogoYoutube as $,IoDiamondOutline as B,IoCheckmark as N,IoCopy as I,IoChevronBack as z,IoChevronForward as F}from"react-icons/io5";import{PhoneInput as D}from"react-international-phone";import P,{createPortal as A}from"react-dom";import{FaShoppingCart as _,FaAngleUp as R,FaAngleDown as O,FaChevronRight as L,FaArrowLeft as M,FaChevronDown as V,FaChevronUp as j,FaGift as W,FaRegQuestionCircle as H,FaCheckCircle as q,FaLockOpen as Q,FaPlus as U,FaLock as Y,FaTimes as G,FaCheck as X,FaChevronLeft as Z}from"react-icons/fa";import{RxInfoCircled as K,RxMinus as J}from"react-icons/rx";import{RiDeleteBinLine as ee,RiDeleteBinFill as te,RiCouponLine as ne,RiCloseLine as oe}from"react-icons/ri";import{atom as re,useAtom as ie,useAtomValue as ae,useSetAtom as le}from"jotai";import{atomWithStorage as ce}from"jotai/utils";import se from"currency-symbol-map";import{FaBagShopping as de,FaRegCopy as pe}from"react-icons/fa6";import{ClipLoader as ue,ScaleLoader as me}from"react-spinners";import{TbShoppingBagEdit as ge,TbTrashXFilled as xe,TbTrashX as fe}from"react-icons/tb";import{MdChevronLeft as ye,MdChevronRight as be,MdDiscount as he,MdClose as ve,MdVerified as we}from"react-icons/md";import Ce from"canvas-confetti";import{IoMdCheckmark as Ee,IoIosCart as ke,IoMdPricetags as Te,IoMdArrowDropleft as Se,IoMdArrowDropright as $e,IoIosStar as Be,IoIosArrowDown as Ne}from"react-icons/io";import{AiFillGift as Ie,AiOutlineEdit as ze}from"react-icons/ai";import{BiSolidTShirt as Fe,BiCube as De,BiPlus as Pe,BiSearch as Ae,BiFilterAlt as _e,BiSortAlt2 as Re,BiMinus as Oe,BiTrash as Le,BiCheck as Me,BiPencil as Ve,BiChevronDown as je,BiSolidDiscount as We}from"react-icons/bi";import{BsCupHotFill as He,BsReceiptCutoff as qe,BsInfoCircle as Qe,BsCheck as Ue,BsX as Ye,BsArrowRight as Ge,BsXLg as Xe,BsChevronDown as Ze}from"react-icons/bs";import{PiPercentDuotone as Ke}from"react-icons/pi";import{HiOutlineShoppingBag as Je,HiTag as et}from"react-icons/hi";import{LuZap as tt}from"react-icons/lu";import{GrFormNext as nt,GrFormSubtract as ot,GrFormAdd as rt,GrGift as it}from"react-icons/gr";import{FiLock as at,FiTrash as lt}from"react-icons/fi";import{HiOutlineShoppingBag as ct}from"react-icons/hi2";import{ImCheckboxChecked as st,ImCheckboxUnchecked as dt}from"react-icons/im";import pt from"react-calendar";import ut from"react-modal-image";var mt='<svg width="29" height="23" viewBox="0 0 29 23" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M3.58718 11.5427H14.229V12.9247H3.58718V11.5427Z" fill="#FF4E4E"/>\n<path d="M1.81354 8.08752H10.6818V9.46959H1.81354V8.08752Z" fill="#FF4E4E"/>\n<path d="M26.5737 11.9615L23.9133 7.12431C23.845 6.99997 23.7314 6.89401 23.5865 6.81956C23.4416 6.74511 23.2718 6.70547 23.0983 6.70554H20.4378V5.32348C20.4378 5.1402 20.3444 4.96444 20.1781 4.83484C20.0118 4.70525 19.7862 4.63245 19.551 4.63245H5.36184V6.01451H18.6642V14.6911C18.2601 14.8739 17.9064 15.1173 17.6236 15.4072C17.3408 15.697 17.1345 16.0277 17.0165 16.38H11.4437C11.2278 15.7286 10.7145 15.1609 9.99991 14.7833C9.28533 14.4057 8.41855 14.2441 7.56205 14.3289C6.70554 14.4137 5.91811 14.739 5.34737 15.2438C4.77662 15.7486 4.46173 16.3982 4.46173 17.071C4.46173 17.7438 4.77662 18.3935 5.34737 18.8983C5.91811 19.4031 6.70554 19.7283 7.56205 19.8131C8.41855 19.8979 9.28533 19.7363 9.99991 19.3587C10.7145 18.9812 11.2278 18.4134 11.4437 17.762H17.0165C17.2094 18.3551 17.6506 18.8811 18.2702 19.2569C18.8899 19.6326 19.6526 19.8366 20.4378 19.8366C21.223 19.8366 21.9857 19.6326 22.6054 19.2569C23.2251 18.8811 23.6663 18.3551 23.8592 17.762H25.7587C25.9939 17.762 26.2195 17.6892 26.3858 17.5596C26.5521 17.43 26.6456 17.2543 26.6456 17.071V12.2338C26.6456 12.1402 26.6212 12.0475 26.5737 11.9615ZM8.02231 18.4531C7.67151 18.4531 7.3286 18.372 7.03692 18.2202C6.74525 18.0683 6.51792 17.8524 6.38367 17.5999C6.24943 17.3474 6.21431 17.0695 6.28274 16.8014C6.35118 16.5333 6.5201 16.287 6.76815 16.0937C7.0162 15.9005 7.33223 15.7688 7.67629 15.7155C8.02034 15.6622 8.37696 15.6895 8.70105 15.7942C9.02514 15.8988 9.30215 16.0759 9.49704 16.3032C9.69193 16.5305 9.79595 16.7977 9.79595 17.071C9.79548 17.4374 9.60846 17.7888 9.27594 18.0479C8.94342 18.307 8.49256 18.4527 8.02231 18.4531ZM20.4378 8.0876H22.513L24.4143 11.5428H20.4378V8.0876ZM20.4378 18.4531C20.087 18.4531 19.7441 18.372 19.4524 18.2202C19.1608 18.0683 18.9334 17.8524 18.7992 17.5999C18.6649 17.3474 18.6298 17.0695 18.6983 16.8014C18.7667 16.5333 18.9356 16.287 19.1837 16.0937C19.4317 15.9005 19.7477 15.7688 20.0918 15.7155C20.4358 15.6622 20.7925 15.6895 21.1166 15.7942C21.4406 15.8988 21.7177 16.0759 21.9125 16.3032C22.1074 16.5305 22.2115 16.7977 22.2115 17.071C22.211 17.4374 22.024 17.7888 21.6915 18.0479C21.3589 18.307 20.9081 18.4527 20.4378 18.4531ZM24.8719 16.38H23.8592C23.6638 15.7881 23.2219 15.2634 22.6028 14.8882C21.9836 14.513 21.2222 14.3086 20.4378 14.3069V12.9248H24.8719V16.38Z" fill="#4D4D4D"/>\n</svg>';function gt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}gt('@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Space+Grotesk:wght@300..700&display=swap");');gt(".react-international-phone-country-selector{position:relative}.react-international-phone-country-selector-button{display:flex;height:var(--react-international-phone-height, 36px);box-sizing:border-box;align-items:center;justify-content:center;padding:0;border:1px solid var(--react-international-phone-country-selector-border-color, var(--react-international-phone-border-color, gainsboro));margin:0;appearance:button;-webkit-appearance:button;background-color:var(--react-international-phone-country-selector-background-color, var(--react-international-phone-background-color, white));cursor:pointer;text-transform:none;user-select:none}.react-international-phone-country-selector-button:hover{background-color:var(--react-international-phone-country-selector-background-color-hover, whitesmoke)}.react-international-phone-country-selector-button--hide-dropdown{cursor:auto}.react-international-phone-country-selector-button--hide-dropdown:hover{background-color:transparent}.react-international-phone-country-selector-button__button-content{display:flex;align-items:center;justify-content:center}.react-international-phone-country-selector-button__flag-emoji{margin:0 4px}.react-international-phone-country-selector-button__flag-emoji--disabled{opacity:.75}.react-international-phone-country-selector-button__dropdown-arrow{border-top:var(--react-international-phone-country-selector-arrow-size, 4px) solid var(--react-international-phone-country-selector-arrow-color, #777);border-right:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;border-left:var(--react-international-phone-country-selector-arrow-size, 4px) solid transparent;margin-right:4px;transition:all .1s ease-out}.react-international-phone-country-selector-button__dropdown-arrow--active{transform:rotateX(180deg)}.react-international-phone-country-selector-button__dropdown-arrow--disabled{border-top-color:var(--react-international-phone-disabled-country-selector-arrow-color, #999)}.react-international-phone-country-selector-button--disabled{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));cursor:auto}.react-international-phone-country-selector-button--disabled:hover{background-color:var(--react-international-phone-disabled-country-selector-background-color, var(--react-international-phone-disabled-background-color, whitesmoke))}.react-international-phone-flag-emoji{width:var(--react-international-phone-flag-width, 24px);height:var(--react-international-phone-flag-height, 24px);box-sizing:border-box}.react-international-phone-country-selector-dropdown{position:absolute;z-index:1;top:var(--react-international-phone-dropdown-top, 44px);left:var(--react-international-phone-dropdown-left, 0);display:flex;width:300px;max-height:200px;flex-direction:column;padding:4px 0;margin:0;background-color:var(--react-international-phone-dropdown-item-background-color, var(--react-international-phone-background-color, white));box-shadow:var(--react-international-phone-dropdown-shadow, 2px 2px 16px rgba(0, 0, 0, .25));color:var(--react-international-phone-dropdown-item-text-color, var(--react-international-phone-text-color, #222));list-style:none;overflow-y:scroll}.react-international-phone-country-selector-dropdown__preferred-list-divider{height:1px;border:none;margin:var(--react-international-phone-dropdown-preferred-list-divider-margin, 0);background:var(--react-international-phone-dropdown-preferred-list-divider-color, var(--react-international-phone-border-color, gainsboro))}.react-international-phone-country-selector-dropdown__list-item{display:flex;min-height:var(--react-international-phone-dropdown-item-height, 28px);box-sizing:border-box;align-items:center;padding:2px 8px}.react-international-phone-country-selector-dropdown__list-item-flag-emoji{margin-right:8px}.react-international-phone-country-selector-dropdown__list-item-country-name{overflow:hidden;margin-right:8px;font-size:var(--react-international-phone-dropdown-item-font-size, 14px);text-overflow:ellipsis;white-space:nowrap}.react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-dropdown-item-dial-code-color, gray);font-size:var(--react-international-phone-dropdown-item-font-size, 14px)}.react-international-phone-country-selector-dropdown__list-item:hover{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke));cursor:pointer}.react-international-phone-country-selector-dropdown__list-item--selected,.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke);color:var(--react-international-phone-selected-dropdown-item-text-color, var(--react-international-phone-text-color, #222))}.react-international-phone-country-selector-dropdown__list-item--selected .react-international-phone-country-selector-dropdown__list-item-dial-code,.react-international-phone-country-selector-dropdown__list-item--focused .react-international-phone-country-selector-dropdown__list-item-dial-code{color:var(--react-international-phone-selected-dropdown-item-dial-code-color, var(--react-international-phone-dropdown-item-dial-code-color, gray))}.react-international-phone-country-selector-dropdown__list-item--focused{background-color:var(--react-international-phone-selected-dropdown-item-background-color, var(--react-international-phone-selected-dropdown-item-background-color, whitesmoke))}.react-international-phone-dial-code-preview{display:flex;align-items:center;justify-content:center;padding:0 8px;border:1px solid var(--react-international-phone-dial-code-preview-border-color, var(--react-international-phone-border-color, gainsboro));margin-right:-1px;background-color:var(--react-international-phone-dial-code-preview-background-color, var(--react-international-phone-background-color, white));color:var(--react-international-phone-dial-code-preview-text-color, var(--react-international-phone-text-color, #222));font-size:var(--react-international-phone-dial-code-preview-font-size, var(--react-international-phone-font-size, 13px))}.react-international-phone-dial-code-preview--disabled{background-color:var(--react-international-phone-dial-code-preview-disabled-background-color, var(--react-international-phone-disabled-background-color, whitesmoke));color:var(--react-international-phone-dial-code-preview-disabled-text-color, var(--react-international-phone-disabled-text-color, #666))}.react-international-phone-input-container{display:flex}.react-international-phone-input-container .react-international-phone-country-selector-button{border-radius:var(--react-international-phone-border-radius, 4px);margin-right:-1px;border-bottom-right-radius:0;border-top-right-radius:0}.react-international-phone-input-container .react-international-phone-input{overflow:visible;height:var(--react-international-phone-height, 36px);box-sizing:border-box;padding:0 8px;border:1px solid var(--react-international-phone-border-color, gainsboro);border-radius:var(--react-international-phone-border-radius, 4px);margin:0;background-color:var(--react-international-phone-background-color, white);border-bottom-left-radius:0;border-top-left-radius:0;color:var(--react-international-phone-text-color, #222);font-family:inherit;font-size:var(--react-international-phone-font-size, 13px)}.react-international-phone-input-container .react-international-phone-input:focus{outline:none}.react-international-phone-input-container .react-international-phone-input--disabled{background-color:var(--react-international-phone-disabled-background-color, whitesmoke);color:var(--react-international-phone-disabled-text-color, #666)}\n");const xt=c.div`
2
2
  position: absolute;
3
3
  top: 10px;
4
4
  right: 10px;
@@ -392,6 +392,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
392
392
  align-items: ${e=>"vertical"===e.$variant?"initial":"center"};
393
393
  border-radius: ${e=>"vertical"===e.$variant&&"rounded"===e.$cartComponentsCornerType?`${e.$cartComponentsCornerRadius}px`:"0px"};
394
394
  position: relative;
395
+ &:hover {
396
+ transform: scale(1.025);
397
+ }
398
+
399
+ &:hover .yt-cart-product-rec-image {
400
+ opacity: 0.8;
401
+ }
395
402
  `,yn=c.img`
396
403
  height: ${e=>(e.$variant,"auto")};
397
404
  object-fit: cover;
@@ -399,6 +406,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
399
406
  cursor: pointer;
400
407
  border-top-left-radius: ${e=>"vertical"===e.$variant&&"rounded"===e.$cartComponentsCornerType?`${e.$cartComponentsCornerRadius}px`:"0px"};
401
408
  border-top-right-radius: ${e=>"vertical"===e.$variant&&"rounded"===e.$cartComponentsCornerType?`${e.$cartComponentsCornerRadius}px`:"0px"};
409
+ transition: opacity 0.3s ease;
402
410
  `,bn=c.div`
403
411
  display: flex;
404
412
  flex-direction: column;
@@ -423,20 +431,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
423
431
  font-weight: var(-yt-cart-product-rec-price-font-weight, 200);
424
432
  font-size: 13px;
425
433
  margin-left: 4px;
426
- `;c.select`
427
- width: 100%;
428
- padding: 5px;
429
- padding-right: 20px;
430
- appearance: none;
431
- border: none;
432
- outline: none;
433
- border-radius: 0;
434
- font-size: 12px !important;
435
- cursor: pointer;
436
- direction: ltr;
437
- background-image: none !important;
438
- margin-bottom: 0;
439
- `;const wn=c.button`
434
+ `,wn=c.button`
440
435
  min-height: 10px !important;
441
436
  background-image: none !important;
442
437
  display: flex;
@@ -556,11 +551,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
556
551
  @media (max-width: 768px) {
557
552
  font-size: 13px;
558
553
  }
559
- `;c.div`
560
- flex-basis: 100%;
561
- position: relative;
562
- max-width: 100px;
563
- `;const $n=e=>{if(null!=e)return"string"==typeof e&&e.includes("/")?e.split("/").pop():String(e)},Bn=c.div`
554
+ `,$n=e=>{if(null!=e)return"string"==typeof e&&e.includes("/")?e.split("/").pop():String(e)},Bn=c.div`
564
555
  display: flex;
565
556
  align-items: baseline;
566
557
  gap: 4px;
@@ -636,7 +627,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
636
627
  font-size: 10px;
637
628
  line-height: normal;
638
629
  display: flex;
639
- `,Pn=({product:a,addCartItem:l,productRecsCtaButtonText:c,ctaButtonBackgroundColor:s,ctaButtonTextColor:d,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,layout:g,cartComponentsCornerRadius:x,cartComponentsCornerType:f,isVerticalList:y,backgroundColor:b,tertiaryColor:h,tertiaryTextColor:v})=>{const w=ae(Ut),{setLoading:C}=Jt(),E=le(en),k=o(()=>{const e=a?._ytAllowedVariantIds??a?.ytAllowedVariantIds;if(!Array.isArray(e)||0===e.length)return;const t=e.map(e=>$n(e)).filter(e=>Boolean(e));return t.length>0?t:void 0},[a]),T=o(()=>Array.isArray(a?.variants)?a.variants.filter(e=>{if(!k?.length)return!0;const t=$n(e?.id);return!!t&&k.includes(t)}):[],[a,k]),[S,$]=t(!1),[B,N]=t(()=>{const e=T?.[0];return e?$n(e.id):void 0}),[I,z]=t(T?.[0]),F=r(null),D=i(()=>T.find(e=>e.available)??T[0],[T]);n(()=>{if(!T.length)return N(void 0),void z(void 0);if(!(B&&T.some(e=>$n(e?.id)===B))){const e=D();if(e){const t=$n(e.id);N(t),z(e)}}},[T,B,D]),n(()=>{(async()=>{try{if(B){const e=T.find(e=>$n(e?.id)===B);e&&z(e)}}catch(e){console.error("Error getting selected product variant id")}})()},[T,B]);const P=async()=>{C&&C(!0,!0);try{await l(B??$n(T?.[0]?.id)??a?.variants?.[0]?.id,void 0,"productSuggestion",void 0,a?.handle)}catch(e){console.error("yt::error adding recommended item to cart",e)}C&&C(!1,!1)},A=()=>{const e=$n(a?.id),t=k&&k.length>0?k:a?.variants?.map(e=>$n(e.id)).filter(e=>Boolean(e));E({open:!0,variantId:B??$n(T?.[0]?.id)??void 0,handle:a?.handle,freebieSelection:!1,productId:e,allowedVariantIds:t,productRec:!0})},_=m&&T.length>1,R=(a?.title??"").replace(/&#39;/g,"'").replace(/&quot;/g,'"').replace(/&amp;/g,"&");const O=(e,t)=>{let n;n="string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t.featured_image||"/placeholder.svg";return gn(n,"vertical"===g?300:200,85,"webp")},L={flexDirection:"horizontal"===g?"row":"column",width:"horizontal"===g?"325px":"145px",transform:S?"scale(1.025)":"scale(1)",justifyContent:"flex-start",gap:"horizontal"===g?"10px":""},M={width:"horizontal"===g?"100px":"auto",opacity:S?.8:1},V={color:u??"#212529",marginTop:"vertical"===g?"":"0"},j=(()=>{const e=Number(a?.compare_at_price),t=Number(a?.price);if(!e||!t||e<=t)return null;const n=Math.round((e-t)/e*100);return!isFinite(n)||n<=0?null:`${n}% OFF`})();return y?e.createElement(En,{className:"yt-cart-product-rec-vertical-card"},e.createElement(kn,{className:"yt-cart-product-rec-vertical-image",src:O(null,a),onClick:()=>{window.location.href=`${window.location.origin}${a?.url}`}}),e.createElement(Tn,{className:"yt-cart-product-rec-vertical-info"},e.createElement(Sn,{href:`${window.location.origin}${a?.url}`,$primaryTextColor:p},R),e.createElement(Bn,null,e.createElement(Nn,{$secondaryTextColor:u},on(w,w?.currency),un(tn(a?.price,w?.currency))),a?.compare_at_price&&e.createElement(In,null,on(w,w?.currency),un(tn(a?.compare_at_price,w?.currency))),j&&e.createElement(Dn,{$background:h,$color:v},j))),e.createElement(zn,{className:"yt-cart-product-rec-vertical-button",onClick:_?A:P,$ctaButtonBackgroundColor:s,$ctaButtonTextColor:d,$cartComponentsCornerType:f,$cartComponentsCornerRadius:x,style:{width:_?"auto":"36px",padding:_?"0 8px":"0"}},_?e.createElement(ue,null):e.createElement(de,null))):e.createElement(fn,{className:"yt-cart-product-rec-card-container",ref:F,onMouseEnter:()=>$(!0),onMouseLeave:()=>$(!1),style:L,$variant:g??"horizontal",$cartComponentsCornerType:f,$cartComponentsCornerRadius:x,$backgroundColor:b},j&&e.createElement(Fn,{$background:h,$color:v},j),e.createElement(yn,{className:"yt-cart-product-rec-image",src:O(null,a),style:M,$variant:g??"horizontal",$cartComponentsCornerType:f,$cartComponentsCornerRadius:x,onClick:()=>{window.location.href=`${window.location.origin}${a?.url}`}}),e.createElement(bn,{className:"yt-cart-product-rec-info"},e.createElement("div",null,e.createElement(hn,{href:`${window.location.origin}${a?.url}`,style:{color:p??"black"}},R),e.createElement("div",{style:{display:"flex"}},e.createElement(vn,{style:V},on(w,w?.currency),un(tn(a?.price,w?.currency))),e.createElement(Cn,null,Number(a?.compare_at_price)>Number(a?.price)&&e.createElement(e.Fragment,null," ",on(w,w?.currency),un(tn(a?.compare_at_price,w?.currency)))))),e.createElement(wn,{className:"yt-cart-product-rec-button",onClick:_?A:P,id:"yourtoken-product-rec-atc",style:{backgroundColor:s??"#3A4980",color:d??"white",height:"fit-content",marginTop:"auto",marginBottom:"0px"},$variant:g??"horizontal",$cartComponentsCornerType:f,$cartComponentsCornerRadius:x},c??"Add to Cart")))},An=c.div`
630
+ `,Pn=({product:n,addCartItem:r,productRecsCtaButtonText:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l,primaryTextColor:c,secondaryTextColor:s,showVariantSelectionDropdownInProductRecs:d,layout:p,cartComponentsCornerRadius:u,cartComponentsCornerType:m,isVerticalList:g,backgroundColor:x,tertiaryColor:f,tertiaryTextColor:y})=>{const b=ae(Ut),h=le(en),[v,w]=t(!1),C=o(()=>{const e=n?._ytAllowedVariantIds??n?.ytAllowedVariantIds;if(!Array.isArray(e)||0===e.length)return;const t=e.map(e=>$n(e)).filter(e=>Boolean(e));return t.length>0?t:void 0},[n]),E=o(()=>Array.isArray(n?.variants)?n.variants.filter(e=>{if(!C?.length)return!0;const t=$n(e?.id);return!!t&&C.includes(t)}):[],[n,C]),k=o(()=>{var e;if(E.length)return(e=E).find(e=>e?.available)??e[0]},[E]),T=k?.price??n?.price,S=k?.compare_at_price??n?.compare_at_price,$=async()=>{if(!v){w(!0);try{await r($n(k?.id)??$n(E?.[0]?.id)??n?.variants?.[0]?.id,void 0,"productSuggestion",void 0,n?.handle)}catch(e){console.error("yt::error adding recommended item to cart",e)}finally{w(!1)}}},B=()=>{const e=$n(n?.id),t=C&&C.length>0?C:n?.variants?.map(e=>$n(e.id)).filter(e=>Boolean(e));h({open:!0,variantId:$n(k?.id)??$n(E?.[0]?.id)??void 0,handle:n?.handle,freebieSelection:!1,productId:e,allowedVariantIds:t,productRec:!0})},N=d&&E.length>1,I=(n?.title??"").replace(/&#39;/g,"'").replace(/&quot;/g,'"').replace(/&amp;/g,"&");const z=(e,t)=>{let n;n="string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t.featured_image||"/placeholder.svg";return gn(n,"vertical"===p?300:200,85,"webp")},F={flexDirection:"horizontal"===p?"row":"column",width:"horizontal"===p?"325px":"145px",justifyContent:"flex-start",gap:"horizontal"===p?"10px":""},D={width:"horizontal"===p?"100px":"auto"},P={color:s??"#212529",marginTop:"vertical"===p?"":"0"},A=(()=>{const e=Number(S),t=Number(T);if(!e||!t||e<=t)return null;const n=Math.round((e-t)/e*100);return!isFinite(n)||n<=0?null:`${n}% OFF`})();return g?e.createElement(En,{className:"yt-cart-product-rec-vertical-card"},e.createElement(kn,{className:"yt-cart-product-rec-vertical-image",src:z(null,n),onClick:()=>{window.location.href=`${window.location.origin}${n?.url}`}}),e.createElement(Tn,{className:"yt-cart-product-rec-vertical-info"},e.createElement(Sn,{href:`${window.location.origin}${n?.url}`,$primaryTextColor:c},I),e.createElement(Bn,null,e.createElement(Nn,{$secondaryTextColor:s},on(b,b?.currency),un(tn(T,b?.currency))),S&&e.createElement(In,null,on(b,b?.currency),un(tn(S,b?.currency))),A&&e.createElement(Dn,{$background:f,$color:y},A))),e.createElement(zn,{className:"yt-cart-product-rec-vertical-button",onClick:N?B:$,disabled:v,$ctaButtonBackgroundColor:a,$ctaButtonTextColor:l,$cartComponentsCornerType:m,$cartComponentsCornerRadius:u,style:{width:N?"auto":"36px",padding:N?"0 8px":"0"}},v?e.createElement(ue,{color:l??"white",size:14}):N?e.createElement(ge,null):e.createElement(de,null))):e.createElement(fn,{className:"yt-cart-product-rec-card-container",style:F,$variant:p??"horizontal",$cartComponentsCornerType:m,$cartComponentsCornerRadius:u,$backgroundColor:x},A&&e.createElement(Fn,{$background:f,$color:y},A),e.createElement(yn,{className:"yt-cart-product-rec-image",src:z(null,n),style:D,$variant:p??"horizontal",$cartComponentsCornerType:m,$cartComponentsCornerRadius:u,onClick:()=>{window.location.href=`${window.location.origin}${n?.url}`}}),e.createElement(bn,{className:"yt-cart-product-rec-info"},e.createElement("div",null,e.createElement(hn,{href:`${window.location.origin}${n?.url}`,style:{color:c??"black"}},I),e.createElement("div",{style:{display:"flex"}},e.createElement(vn,{style:P},on(b,b?.currency),un(tn(T,b?.currency))),e.createElement(Cn,null,Number(S)>Number(T)&&e.createElement(e.Fragment,null," ",on(b,b?.currency),un(tn(S,b?.currency)))))),e.createElement(wn,{className:"yt-cart-product-rec-button",onClick:N?B:$,id:"yourtoken-product-rec-atc",disabled:v,style:{backgroundColor:a??"#3A4980",color:l??"white",height:"fit-content",marginTop:"auto",marginBottom:"0px"},$variant:p??"horizontal",$cartComponentsCornerType:m,$cartComponentsCornerRadius:u},v?e.createElement(ue,{color:l??"white",size:16}):i??"Add to Cart")))},An=c.div`
640
631
  display: flex;
641
632
  flex-direction: column;
642
633
  row-gap: 8px;
@@ -760,7 +751,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
760
751
  margin-bottom: 4px;
761
752
  }
762
753
  }
763
- `,Yn=({products:o,addCartItem:i,productRecsCtaButtonText:a,ctaButtonBackgroundColor:l,ctaButtonTextColor:c,productRecsTitleText:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,variant:g,cardLayout:x,cartComponentsCornerRadius:f,cartComponentsCornerType:y,backgroundSubdued:b,backgroundColor:h,tertiaryColor:v,tertiaryTextColor:w})=>{const C=r(null);n(()=>{const e=()=>{if(C.current){const e=Array.from(C?.current?.children)?.reduce((e,t)=>e+t?.offsetWidth,0);C.current.style.width=`${e}px`}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[o]);const[E,k]=t(0),T=r(null),S=r(null),$=r(!1),B=()=>{k(e=>{const t=Math.max((I?.length||1)-1,0);return 0===e?t:e-1})},N=()=>{k(e=>e===Math.max((I?.length||1)-1,0)?0:e+1)},I=o?.filter(e=>e&&e.available&&"8627886358748"!==String(e?.id)&&"8627886358748"!==String(e?.product_id)),z=t=>I.map(n=>e.createElement(Pn,{key:n?.id,addCartItem:i,product:n,productRecsCtaButtonText:a,ctaButtonBackgroundColor:l,ctaButtonTextColor:c,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,layout:x,cartComponentsCornerRadius:f,cartComponentsCornerType:y,isVerticalList:"vertical"===t,backgroundColor:h,tertiaryColor:v,tertiaryTextColor:w}));return"vertical"===g?e.createElement(qn,{className:"yt-cart-product-recs-vertical-container"},s&&e.createElement(Qn,{$primaryTextColor:p,$themeColor:d,$backgroundSubdued:b},s),e.createElement(Un,{className:"yt-cart-product-recs-vertical-list"},z("vertical"))):e.createElement(An,{className:"yt-cart-product-recs-container"},e.createElement(_n,{className:"yt-cart-product-recs-title",$primaryTextColor:p??"black",$themeColor:d??"lightgrey",$backgroundSubdued:b},s??"People Also Bought"),"scroll"===g?e.createElement(Rn,{className:"yt-cart-product-recs-scroll"},e.createElement(On,{ref:C},z())):e.createElement(Ln,{className:"yt-cart-product-recs-carousel"},e.createElement(Mn,{onTouchStart:e=>{const t=e.touches[0];T.current=t.clientX,S.current=t.clientY,$.current=!1},onTouchMove:e=>{if(null===T.current||null===S.current)return;const t=e.touches[0],n=t.clientX-T.current,o=t.clientY-S.current;Math.abs(n)>10&&Math.abs(n)>Math.abs(o)&&($.current=!0,e.preventDefault())},onTouchEnd:e=>{if(null===T.current)return;const t=e.changedTouches[0].clientX-T.current;Math.abs(t)>50&&(t<0?N():B()),T.current=null,S.current=null,$.current=!1}},e.createElement(Wn,{onClick:B},e.createElement(xe,null)),e.createElement(Vn,{style:{transform:`translateX(-${E*(100/I.length)}%)`}},z()),e.createElement(Hn,{onClick:N},e.createElement(fe,null)))))};gt('.progress-container {\n --yt-line-border-fill: #3498db;\n --yt-line-border-empty: #e0e0e0;\n display: flex;\n justify-content: space-between;\n position: relative;\n margin-bottom: 30px;\n max-width: 100%;\n width: 350px;\n}\n\n.progress-container::before {\n content: ""; /* Mandatory with ::before */\n background-color: var(--yt-line-border-empty);\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: 4px;\n width: 100%;\n z-index: -1;\n}\n\n.progress {\n background-color: var(--yt-line-border-fill);\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: 4px;\n width: 0%;\n z-index: -1;\n transition: 0.4s ease;\n}');const Gn=e=>100/e,Xn=e=>{switch(e){case 1:case 2:case 3:case 4:default:return 22;case 5:return 17}},Zn=c.div`
754
+ `,Yn=({products:o,addCartItem:i,productRecsCtaButtonText:a,ctaButtonBackgroundColor:l,ctaButtonTextColor:c,productRecsTitleText:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,variant:g,cardLayout:x,cartComponentsCornerRadius:f,cartComponentsCornerType:y,backgroundSubdued:b,backgroundColor:h,tertiaryColor:v,tertiaryTextColor:w})=>{const C=r(null);n(()=>{const e=()=>{if(C.current){const e=Array.from(C?.current?.children)?.reduce((e,t)=>e+t?.offsetWidth,0);C.current.style.width=`${e}px`}};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[o]);const[E,k]=t(0),T=r(null),S=r(null),$=r(!1),B=()=>{k(e=>{const t=Math.max((I?.length||1)-1,0);return 0===e?t:e-1})},N=()=>{k(e=>e===Math.max((I?.length||1)-1,0)?0:e+1)},I=o?.filter(e=>e&&e.available&&"8627886358748"!==String(e?.id)&&"8627886358748"!==String(e?.product_id)),z=t=>I.map(n=>e.createElement(Pn,{key:n?.id,addCartItem:i,product:n,productRecsCtaButtonText:a,ctaButtonBackgroundColor:l,ctaButtonTextColor:c,primaryTextColor:p,secondaryTextColor:u,showVariantSelectionDropdownInProductRecs:m,layout:x,cartComponentsCornerRadius:f,cartComponentsCornerType:y,isVerticalList:"vertical"===t,backgroundColor:h,tertiaryColor:v,tertiaryTextColor:w}));return"vertical"===g?e.createElement(qn,{className:"yt-cart-product-recs-vertical-container"},s&&e.createElement(Qn,{$primaryTextColor:p,$themeColor:d,$backgroundSubdued:b},s),e.createElement(Un,{className:"yt-cart-product-recs-vertical-list"},z("vertical"))):e.createElement(An,{className:"yt-cart-product-recs-container"},e.createElement(_n,{className:"yt-cart-product-recs-title",$primaryTextColor:p??"black",$themeColor:d??"lightgrey",$backgroundSubdued:b},s??"People Also Bought"),"scroll"===g?e.createElement(Rn,{className:"yt-cart-product-recs-scroll"},e.createElement(On,{ref:C},z())):e.createElement(Ln,{className:"yt-cart-product-recs-carousel"},e.createElement(Mn,{onTouchStart:e=>{const t=e.touches[0];T.current=t.clientX,S.current=t.clientY,$.current=!1},onTouchMove:e=>{if(null===T.current||null===S.current)return;const t=e.touches[0],n=t.clientX-T.current,o=t.clientY-S.current;Math.abs(n)>10&&Math.abs(n)>Math.abs(o)&&($.current=!0,e.preventDefault())},onTouchEnd:e=>{if(null===T.current)return;const t=e.changedTouches[0].clientX-T.current;Math.abs(t)>50&&(t<0?N():B()),T.current=null,S.current=null,$.current=!1}},e.createElement(Wn,{onClick:B},e.createElement(ye,null)),e.createElement(Vn,{style:{transform:`translateX(-${E*(100/I.length)}%)`}},z()),e.createElement(Hn,{onClick:N},e.createElement(be,null)))))};gt('.progress-container {\n --yt-line-border-fill: #3498db;\n --yt-line-border-empty: #e0e0e0;\n display: flex;\n justify-content: space-between;\n position: relative;\n margin-bottom: 30px;\n max-width: 100%;\n width: 350px;\n}\n\n.progress-container::before {\n content: ""; /* Mandatory with ::before */\n background-color: var(--yt-line-border-empty);\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: 4px;\n width: 100%;\n z-index: -1;\n}\n\n.progress {\n background-color: var(--yt-line-border-fill);\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n height: 4px;\n width: 0%;\n z-index: -1;\n transition: 0.4s ease;\n}');const Gn=e=>100/e,Xn=e=>{switch(e){case 1:case 2:case 3:case 4:default:return 22;case 5:return 17}},Zn=c.div`
764
755
  display: flex;
765
756
  align-items: center;
766
757
  // padding: 0 10px;
@@ -994,7 +985,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
994
985
  flex-wrap: wrap;
995
986
  text-align: center;
996
987
  }
997
- `,bo=({prefixMessageText:t="You are",suffixMessageText:n="away from",successMessageText:o="Best reward unlocked",...r})=>{const i=(o,r)=>e.createElement(yo,null,t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},o)," ",n&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},n," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},r));let a=-1;const l=void 0!==r.currentCartAmount?r.currentCartAmount:r.cartData?.items_subtotal_price,c=void 0!==r.effectiveQuantityForProgressBar?r.effectiveQuantityForProgressBar:r.cartData?.item_count,s=on(r.cartData,r.cartData?.currency)??"Rs .";if("minimum_order_value"===r.customCartProgressBarCriteria){if(0===l&&r.cartData?.items_subtotal_price>0)return null;for(let e=0;e<r.checkpoints?.length;e++)if(l<r.checkpoints?.[e]?.minimumOrderValue){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},o);const t=r.checkpoints?.[a];return i(`${s}${un((t?.minimumOrderValue-l).toFixed(0))}`,t?.name)}if(0===c&&r.cartData?.item_count>0)return null;for(let e=0;e<r.checkpoints?.length;e++)if(c<r.checkpoints?.[e]?.quantityThreshold){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},o);const d=r.checkpoints?.[a];return i(`${d?.quantityThreshold-c}`,d?.name)},ho=t=>e.createElement(so,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(bo,{...t})),vo=({particleCount:t,spread:o,origin:i,checkpointPosition:a=.5})=>{const l=r(null),c=r(!1);return n(()=>{if(l.current&&!c.current){ve.create(l.current,{resize:!0})({particleCount:10*t,spread:o,origin:{x:1,y:.8}}),c.current=!0}},[t,o,i,a]),e.createElement("canvas",{ref:l,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},wo=({prefixMessageText:o,suffixMessageText:i,successMessageText:a,enableConfetti:l,...c})=>{const{currentCartAmount:s,checkpoints:d,themeColor:p,customCartProgressBarCriteria:u,primaryTextColor:m,effectiveQuantityForProgressBar:g,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}=c,y=ae(Ut),[b,h]=t(!1),[v,w]=t(-1),C=r({});return n(()=>{d?.forEach((e,t)=>{const n=fo(e,0,d??[],y?.item_count,c),o=String(e.couponTemplateId);(C.current[o]||0)<100&&n.progressPercentage>=100&&(w(t),h(!0),setTimeout(()=>h(!1),5e3)),C.current[o]=n.progressPercentage})},[y,d]),e.createElement(e.Fragment,null,e.createElement(ho,{currentCartAmount:s,checkpoints:d,cartData:y,customCartProgressBarCriteria:u,effectiveQuantityForProgressBar:g,themeColor:p,primaryTextColor:m,showMOVForProgressTiers:!1,prefixMessageText:o,suffixMessageText:i,successMessageText:a,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}),e.createElement(po,null,b&&l&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v+1)/(d?.length??1)}),e.createElement(uo,null,e.createElement(co,null,d?.sort((e,t)=>"minimum_order_value"===u?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[xo(u)]&&("minimum_order_value"!==u||1!==e?.[xo(u)]))?.map((...e)=>fo(...e,y?.item_count,c))?.map((t,n)=>e.createElement(mo,{key:t?.couponTemplateId,$numberOfCheckpoints:d?.length??1},e.createElement(go,null,n<d?.length&&e.createElement(lo,{className:"yt-cart-single-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:d?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:x}))))))))},Co=t=>e.createElement(no,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(bo,{...t})),Eo=(t,n,o,r,i)=>{let a;if(a="free_product"===t?ko?.[r]:To?.[t],!a)return e.createElement(we,{style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${Xn(o)}px`,width:"24px",height:"24px",marginLeft:"-2px"}});const l=(()=>{try{if("undefined"==typeof window)return!0;const e=window?.Shopify?.shop||window?.ytapp?.storeDomain;return!!e&&new Set(["h1gvdy-t0.myshopify.com","aayush-new-store.myshopify.com"]).has(e)}catch(e){return!1}})();return e.createElement(a,{style:{padding:"4px",border:"2px solid black",backgroundColor:l?"#000":"white",borderColor:l?"#fff":n,color:l?"#fff":n,borderRadius:"9999px",width:"24px",height:"24px",fontSize:`${Xn(o??3)}px`,marginLeft:"-2px"}})},ko={tshirt:Ie,box:ze,cup:je,gift:Be,emptyCircle:Xe},To={percentage_discount_coupon:ye,amount_discount_coupon:ye,free_delivery:_,free_gift:Be,dummy_coupon:Xe},So=({checkpointWithProgress:t,themeColor:n,checkpointsLength:o,progressBarFreeProductIconType:r,themeTextColor:i,ctaButtonTextColor:a})=>t?.progressPercentage>=100?e.createElement(we,{style:{padding:"4px",border:"2px solid black",backgroundColor:n,color:a,borderColor:n,borderRadius:"9999px",fontSize:`${Xn(o)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):Eo(t?.couponType,"#707070",o,r??"tshirt"),$o=({showMOVForProgressTiers:t,minimumOrderValue:n,customCartProgressBarCriteria:o,cartData:r,quantityThreshold:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l})=>t?e.createElement(to,{$visible:n>1||i>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:a},"minimum_order_value"===o?`${on(r,r?.currency)} ${un(n)}`:`${i} item${i>1?"s":""}`):null,Bo="undefined"!=typeof window?a:n,No=({prefixMessageText:o,suffixMessageText:a,successMessageText:l,enableConfetti:c,...s})=>{const{currentCartAmount:d,checkpoints:p,themeColor:u,themeTextColor:m,customCartProgressBarCriteria:g,primaryTextColor:x,effectiveQuantityForProgressBar:f,progressBarFreeProductIconType:y,ctaButtonBackgroundColor:b,showMOVForProgressTiers:h,ctaButtonTextColor:v}=s,w=ae(Ut),[C,E]=t(!1),[k,T]=t(-1),S=r({}),[$,B]=t(0),[N,I]=t(0),z=r(null),F=r([]);F.current.length=0;const D=i(()=>{if("undefined"==typeof window)return;const e=F.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return B(e=>0!==e?0:e),void I(e=>0!==e?0:e);let t=0;e.forEach(e=>{const n=window.getComputedStyle(e),o=parseFloat(n.lineHeight||""),r=parseFloat(n.fontSize||""),i=Number.isNaN(o)?Number.isNaN(r)?0:1.2*r:o,a=e.getBoundingClientRect(),l=i>0?Math.max(0,a.height-i):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const n=t>1?Math.min(32,Math.round(t+6)):0;B(e=>e!==n?n:e);const o=z.current,r=e[e.length-1];if(!o||!r)return void I(e=>0!==e?0:e);const i=o.getBoundingClientRect(),a=r.getBoundingClientRect(),l=Math.ceil(a.right-i.right),c=l>0?l:0;I(e=>e!==c?c:e)},[]);return Bo(()=>{D()}),n(()=>{if("undefined"==typeof window)return;const e=()=>{D()};window.addEventListener("resize",e);const t=z.current,n="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>D()):null;return n&&t&&n.observe(t),()=>{window.removeEventListener("resize",e),n?.disconnect()}},[D]),n(()=>{s.checkpoints?.forEach((e,t)=>{const n=fo(e,0,s.checkpoints??[],w?.item_count,s),o=String(e.couponTemplateId);(S.current[o]||0)<100&&n.progressPercentage>=100&&(T(t),E(!0),setTimeout(()=>E(!1),5e3)),S.current[o]=n.progressPercentage})},[w,s.checkpoints]),e.createElement(e.Fragment,null,e.createElement(Co,{currentCartAmount:d,checkpoints:s.checkpoints,cartData:w,customCartProgressBarCriteria:s.customCartProgressBarCriteria,effectiveQuantityForProgressBar:s.effectiveQuantityForProgressBar,themeColor:u,primaryTextColor:x,showMOVForProgressTiers:s.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:b,prefixMessageText:o,suffixMessageText:a,successMessageText:l,ctaButtonTextColor:v}),e.createElement(oo,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:s.showMOVForProgressTiers??!1,$rightMarginOffsetPx:N,ref:z},C&&c&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(k+1)/(s.checkpoints?.length??1)}),e.createElement(ro,{$tagWrapOffsetPx:$},e.createElement(Zn,null,s.checkpoints?.sort((e,t)=>"minimum_order_value"===s.customCartProgressBarCriteria?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[xo(s.customCartProgressBarCriteria)])?.map((...e)=>fo(...e,w?.item_count,s))?.map((t,n)=>e.createElement(io,{key:t?.couponTemplateId,$numberOfCheckpoints:s.checkpoints?.length??1},e.createElement(ao,null,n<s.checkpoints?.length&&e.createElement(Jn,{className:"yt-cart-multi-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:s.checkpoints?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:b}),("minimum_order_value"!==s.customCartProgressBarCriteria||t?.minimumOrderValue>1)&&e.createElement(Kn,{$isDummy:t?.isDummyCouponTemplate},e.createElement(eo,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{F.current[n]=e},$isCompleted:t?.progressPercentage>=100,$ctaButtonTextColor:v,$ctaButtonBackgroundColor:b,$primaryTextColor:x,style:{display:s.checkpoints?.length>1?"block":"none"}},t?.name),s.checkpoints?.length>1&&e.createElement(So,{checkpointWithProgress:t,themeColor:b,themeTextColor:m,checkpointsLength:s.checkpoints?.length,progressBarFreeProductIconType:y,ctaButtonTextColor:v}),e.createElement($o,{showMOVForProgressTiers:s.showMOVForProgressTiers,minimumOrderValue:t?.minimumOrderValue,customCartProgressBarCriteria:s.customCartProgressBarCriteria,cartData:w,quantityThreshold:t?.quantityThreshold,ctaButtonBackgroundColor:b,ctaButtonTextColor:v})))))))))},Io=t=>t?.checkpoints&&t.checkpoints.length>0?1===t.checkpoints.length?e.createElement(wo,{...t}):e.createElement(No,{...t}):null,zo=c(c.span`
988
+ `,bo=({prefixMessageText:t="You are",suffixMessageText:n="away from",successMessageText:o="Best reward unlocked",...r})=>{const i=(o,r)=>e.createElement(yo,null,t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},o)," ",n&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},n," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},r));let a=-1;const l=void 0!==r.currentCartAmount?r.currentCartAmount:r.cartData?.items_subtotal_price,c=void 0!==r.effectiveQuantityForProgressBar?r.effectiveQuantityForProgressBar:r.cartData?.item_count,s=on(r.cartData,r.cartData?.currency)??"Rs .";if("minimum_order_value"===r.customCartProgressBarCriteria){if(0===l&&r.cartData?.items_subtotal_price>0)return null;for(let e=0;e<r.checkpoints?.length;e++)if(l<r.checkpoints?.[e]?.minimumOrderValue){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},o);const t=r.checkpoints?.[a];return i(`${s}${un((t?.minimumOrderValue-l).toFixed(0))}`,t?.name)}if(0===c&&r.cartData?.item_count>0)return null;for(let e=0;e<r.checkpoints?.length;e++)if(c<r.checkpoints?.[e]?.quantityThreshold){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},o);const d=r.checkpoints?.[a];return i(`${d?.quantityThreshold-c}`,d?.name)},ho=t=>e.createElement(so,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(bo,{...t})),vo=({particleCount:t,spread:o,origin:i,checkpointPosition:a=.5})=>{const l=r(null),c=r(!1);return n(()=>{if(l.current&&!c.current){Ce.create(l.current,{resize:!0})({particleCount:10*t,spread:o,origin:{x:1,y:.8}}),c.current=!0}},[t,o,i,a]),e.createElement("canvas",{ref:l,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},wo=({prefixMessageText:o,suffixMessageText:i,successMessageText:a,enableConfetti:l,...c})=>{const{currentCartAmount:s,checkpoints:d,themeColor:p,customCartProgressBarCriteria:u,primaryTextColor:m,effectiveQuantityForProgressBar:g,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}=c,y=ae(Ut),[b,h]=t(!1),[v,w]=t(-1),C=r({});return n(()=>{d?.forEach((e,t)=>{const n=fo(e,0,d??[],y?.item_count,c),o=String(e.couponTemplateId);(C.current[o]||0)<100&&n.progressPercentage>=100&&(w(t),h(!0),setTimeout(()=>h(!1),5e3)),C.current[o]=n.progressPercentage})},[y,d]),e.createElement(e.Fragment,null,e.createElement(ho,{currentCartAmount:s,checkpoints:d,cartData:y,customCartProgressBarCriteria:u,effectiveQuantityForProgressBar:g,themeColor:p,primaryTextColor:m,showMOVForProgressTiers:!1,prefixMessageText:o,suffixMessageText:i,successMessageText:a,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}),e.createElement(po,null,b&&l&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v+1)/(d?.length??1)}),e.createElement(uo,null,e.createElement(co,null,d?.sort((e,t)=>"minimum_order_value"===u?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[xo(u)]&&("minimum_order_value"!==u||1!==e?.[xo(u)]))?.map((...e)=>fo(...e,y?.item_count,c))?.map((t,n)=>e.createElement(mo,{key:t?.couponTemplateId,$numberOfCheckpoints:d?.length??1},e.createElement(go,null,n<d?.length&&e.createElement(lo,{className:"yt-cart-single-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:d?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:x}))))))))},Co=t=>e.createElement(no,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(bo,{...t})),Eo=(t,n,o,r,i)=>{let a;if(a="free_product"===t?ko?.[r]:To?.[t],!a)return e.createElement(Ee,{style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${Xn(o)}px`,width:"24px",height:"24px",marginLeft:"-2px"}});const l=(()=>{try{if("undefined"==typeof window)return!0;const e=window?.Shopify?.shop||window?.ytapp?.storeDomain;return!!e&&new Set(["h1gvdy-t0.myshopify.com","aayush-new-store.myshopify.com"]).has(e)}catch(e){return!1}})();return e.createElement(a,{style:{padding:"4px",border:"2px solid black",backgroundColor:l?"#000":"white",borderColor:l?"#fff":n,color:l?"#fff":n,borderRadius:"9999px",width:"24px",height:"24px",fontSize:`${Xn(o??3)}px`,marginLeft:"-2px"}})},ko={tshirt:Fe,box:De,cup:He,gift:Ie,emptyCircle:Ke},To={percentage_discount_coupon:he,amount_discount_coupon:he,free_delivery:_,free_gift:Ie,dummy_coupon:Ke},So=({checkpointWithProgress:t,themeColor:n,checkpointsLength:o,progressBarFreeProductIconType:r,themeTextColor:i,ctaButtonTextColor:a})=>t?.progressPercentage>=100?e.createElement(Ee,{style:{padding:"4px",border:"2px solid black",backgroundColor:n,color:a,borderColor:n,borderRadius:"9999px",fontSize:`${Xn(o)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):Eo(t?.couponType,"#707070",o,r??"tshirt"),$o=({showMOVForProgressTiers:t,minimumOrderValue:n,customCartProgressBarCriteria:o,cartData:r,quantityThreshold:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l})=>t?e.createElement(to,{$visible:n>1||i>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:a},"minimum_order_value"===o?`${on(r,r?.currency)} ${un(n)}`:`${i} item${i>1?"s":""}`):null,Bo="undefined"!=typeof window?a:n,No=({prefixMessageText:o,suffixMessageText:a,successMessageText:l,enableConfetti:c,...s})=>{const{currentCartAmount:d,checkpoints:p,themeColor:u,themeTextColor:m,customCartProgressBarCriteria:g,primaryTextColor:x,effectiveQuantityForProgressBar:f,progressBarFreeProductIconType:y,ctaButtonBackgroundColor:b,showMOVForProgressTiers:h,ctaButtonTextColor:v}=s,w=ae(Ut),[C,E]=t(!1),[k,T]=t(-1),S=r({}),[$,B]=t(0),[N,I]=t(0),z=r(null),F=r([]);F.current.length=0;const D=i(()=>{if("undefined"==typeof window)return;const e=F.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return B(e=>0!==e?0:e),void I(e=>0!==e?0:e);let t=0;e.forEach(e=>{const n=window.getComputedStyle(e),o=parseFloat(n.lineHeight||""),r=parseFloat(n.fontSize||""),i=Number.isNaN(o)?Number.isNaN(r)?0:1.2*r:o,a=e.getBoundingClientRect(),l=i>0?Math.max(0,a.height-i):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const n=t>1?Math.min(32,Math.round(t+6)):0;B(e=>e!==n?n:e);const o=z.current,r=e[e.length-1];if(!o||!r)return void I(e=>0!==e?0:e);const i=o.getBoundingClientRect(),a=r.getBoundingClientRect(),l=Math.ceil(a.right-i.right),c=l>0?l:0;I(e=>e!==c?c:e)},[]);return Bo(()=>{D()}),n(()=>{if("undefined"==typeof window)return;const e=()=>{D()};window.addEventListener("resize",e);const t=z.current,n="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>D()):null;return n&&t&&n.observe(t),()=>{window.removeEventListener("resize",e),n?.disconnect()}},[D]),n(()=>{s.checkpoints?.forEach((e,t)=>{const n=fo(e,0,s.checkpoints??[],w?.item_count,s),o=String(e.couponTemplateId);(S.current[o]||0)<100&&n.progressPercentage>=100&&(T(t),E(!0),setTimeout(()=>E(!1),5e3)),S.current[o]=n.progressPercentage})},[w,s.checkpoints]),e.createElement(e.Fragment,null,e.createElement(Co,{currentCartAmount:d,checkpoints:s.checkpoints,cartData:w,customCartProgressBarCriteria:s.customCartProgressBarCriteria,effectiveQuantityForProgressBar:s.effectiveQuantityForProgressBar,themeColor:u,primaryTextColor:x,showMOVForProgressTiers:s.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:b,prefixMessageText:o,suffixMessageText:a,successMessageText:l,ctaButtonTextColor:v}),e.createElement(oo,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:s.showMOVForProgressTiers??!1,$rightMarginOffsetPx:N,ref:z},C&&c&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(k+1)/(s.checkpoints?.length??1)}),e.createElement(ro,{$tagWrapOffsetPx:$},e.createElement(Zn,null,s.checkpoints?.sort((e,t)=>"minimum_order_value"===s.customCartProgressBarCriteria?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[xo(s.customCartProgressBarCriteria)])?.map((...e)=>fo(...e,w?.item_count,s))?.map((t,n)=>e.createElement(io,{key:t?.couponTemplateId,$numberOfCheckpoints:s.checkpoints?.length??1},e.createElement(ao,null,n<s.checkpoints?.length&&e.createElement(Jn,{className:"yt-cart-multi-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:s.checkpoints?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:b}),("minimum_order_value"!==s.customCartProgressBarCriteria||t?.minimumOrderValue>1)&&e.createElement(Kn,{$isDummy:t?.isDummyCouponTemplate},e.createElement(eo,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{F.current[n]=e},$isCompleted:t?.progressPercentage>=100,$ctaButtonTextColor:v,$ctaButtonBackgroundColor:b,$primaryTextColor:x,style:{display:s.checkpoints?.length>1?"block":"none"}},t?.name),s.checkpoints?.length>1&&e.createElement(So,{checkpointWithProgress:t,themeColor:b,themeTextColor:m,checkpointsLength:s.checkpoints?.length,progressBarFreeProductIconType:y,ctaButtonTextColor:v}),e.createElement($o,{showMOVForProgressTiers:s.showMOVForProgressTiers,minimumOrderValue:t?.minimumOrderValue,customCartProgressBarCriteria:s.customCartProgressBarCriteria,cartData:w,quantityThreshold:t?.quantityThreshold,ctaButtonBackgroundColor:b,ctaButtonTextColor:v})))))))))},Io=t=>t?.checkpoints&&t.checkpoints.length>0?1===t.checkpoints.length?e.createElement(wo,{...t}):e.createElement(No,{...t}):null,zo=c(c.span`
998
989
  display: flex !important;
999
990
  gap: 4px;
1000
991
  `)`
@@ -1005,7 +996,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
1005
996
  width: 100%;
1006
997
  gap: 10px;
1007
998
  margin-top: 16px;
1008
- `;function Do({showLoyaltyCta:n,exploreCTAColor:o="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:i,isUserSignedIn:a=!1,joinNowFunction:l,exploreCtaRedirectLink:c,themeColor:s,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:g,addCartItem:x,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:E="Empty cart Recommendations",backgroundSubdued:k,showEmptyCartRecommendations:T=!1,tertiaryColor:S,tertiaryTextColor:$}){const[B,N]=t(!1),[I,z]=t(null);return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-empty-container",style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},e.createElement("div",{className:"yt-cart-empty-content",style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},e.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},e.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),e.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:S??"#D9D9D9"}),e.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:$??"black"})),e.createElement("span",{className:"yt-cart-empty-title",style:{color:h,fontWeight:"semibold"}},r),i&&e.createElement("span",{className:"yt-cart-empty-description",style:{color:"#929292",fontSize:"14px"}},i),!a&&n&&e.createElement("div",{className:"yt-cart-empty-signin-cta",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},e.createElement(Je,{color:o,fontSize:"14px",strokeWidth:2}),e.createElement(zo,null,e.createElement("span",{className:"yt-cart-empty-signin-link",onClick:l,style:{color:o,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",e.createElement("span",{style:{color:"black"}},"to avail offers"))),d&&d.length>0&&e.createElement(Fo,null,d.map((t,n)=>e.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>z(n),onMouseLeave:()=>z(null),onClick:()=>window.location.href=t.link,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:I===n?s||"#73DABB":"#CACACA30",color:I===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},t.title)))),T&&g&&g.length>0&&x&&e.createElement("div",{className:"yt-cart-empty-recommendations",style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},e.createElement(Yn,{products:g,addCartItem:x,productRecsTitleText:E,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:k,tertiaryColor:S,tertiaryTextColor:$}))),e.createElement("button",{className:"yt-cart-empty-continue-shopping",onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),onClick:()=>window.location.replace(c??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:B?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},e.createElement(Ze,{color:h}),e.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:h,cursor:"pointer"}},"Continue Shopping")))}const Po=ce("gstNumber",""),Ao=ce("gstCompanyName",""),_o=re("");gt("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const Ro=ce("postalCode",void 0);function Oo({checkoutButtonColor:i,checkoutFontSize:a,checkoutFunction:l,discountApplied:c,discountInCheckoutButton:s,discountAmountApplied:d,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:g,applyNoteToCart:x,showNoteOption:f,enableGeoLocationDeliveryRestriction:y,applyPostalCodeAndDeliverySlotToCart:b,enableSlotPicker:h,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:E,checkoutSectionMessageDisplay:k,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:B,cartCheckpoints:N,toggleDecimal:I,disableCheckoutButton:z,checkoutButtonBottomSpacing:F=8,showCheckoutButtonPaymentIcons:D,primaryTextColor:P,hideSubtotalAndBadge:A=!1,showTrustedBadge:_,trustedBadgeData:R}){const O=ae(Ut),L=ae(Po),M=ae(Ao),V=ae(_o),j=ae(Gt),W=ae(Yt),H=ae(Ro),q=ae(Zt),Q=ae(Xt),[U,Y]=t(!1),G=on(O,O?.currency),[X,Z]=t("closed"),K=r(null),[J,ee]=t(!1),te=o(()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),o=parseInt(n.slice(3,5),16),r=parseInt(n.slice(5,7),16),i=9===n.length?parseInt(n.slice(7,9),16):void 0,a=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),s=`#${a.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==i?`${s}${i.toString(16).padStart(2,"0")}`:s}return e}catch{return e}})($,.22),[$]),ne=o(()=>tn(p??0,O?.currency??"INR"),[p,O?.currency]),oe=o(()=>un(I?ne.toFixed(2):ne.toFixed(0)),[ne,I]),re=r(null),ie=r(null),le=r(null),ce=()=>{Z("closing"),setTimeout(()=>{Z("closed")},300)},se=tn(O?.original_total_price,O?.currency),de=o(()=>N?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[N]),pe=o(()=>!(!de||!de.minimumOrderValue)&&se>=de.minimumOrderValue,[de,se]),ue=pe&&de&&de.discountValue||0,me=d?tn(d,O?.currency??"INR"):0,ge=Number((se-me).toFixed(2)),xe=o(()=>{if(!O?.items?.length)return 0;const e=O.items.reduce((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return tn(e,O?.currency)},[O?.items,S]),fe=o(()=>pe?xe+ue:xe,[pe,xe,ue]),ye=o(()=>ne&&ne>0?`Add products worth more than ${G}${oe}`:"",[ne,G,oe]),be=o(()=>O?.items?.length?O.items.reduce((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e,0):0,[O?.items]),he=tn(be,O?.currency??"INR");n(()=>{re.current&&pn(re.current),ie.current&&pn(ie.current),le.current&&pn(le.current)},[i,me,S,he,X,ue]);const ve=o(()=>{const e={};return O?.items?.length?(O.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[O?.items]),we=o(()=>{const e=[];for(const t in ve)if(Object.prototype.hasOwnProperty.call(ve,t)){const n=ve[t],o=tn(n,O?.currency??"INR"),r=xn(t);e.push({title:r,amount:o})}return e},[ve,O?.currency]),Ee=o(()=>{let e=0;return e+=S?me+he:me,pe&&(e+=ue),e},[me,he,S,pe,ue]),ke=async e=>{if(Y(!0),ge<=0)Y(!1);else{if(y){if("standard"!==Q&&(h?!j:!W.isPostalCodeValid))return void Y(!1);if(b)try{"standard"===Q?await b(Q):await b(Q,String(H)||"",q&&h?new Date(q).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}g&&m&&""!==M&&""!==L&&await m(L,M),f&&x&&""!==V&&await x(V),await l(e),Y(!1)}},[Te,Se]=t(!1);n(()=>{Se(ge<=0||(!!z||!!y&&("standard"!==Q&&(h?!j:!W.isPostalCodeValid))))},[W,Q,y,h,j,q,z,ge]);const[$e,Be]=t(!1),Ne=r(null),[Ie,ze]=t("0px");n(()=>{Ne.current&&ze($e?`${Ne.current.scrollHeight}px`:"0px")},[$e,we,pe]);const Fe=()=>{Be(!$e)};n(()=>{function e(e){K.current&&!K.current.contains(e.target)&&ce()}return"open"!==X&&"opening"!==X||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[X]);const De=(t,n="Checkout")=>t?e.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},n),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(et,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):e.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},"Proceed to Checkout"!==n&&e.createElement(Ce,{fontSize:"20px"}),e.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},n));return e.createElement("div",{className:"yt-cart-checkout-section",style:{position:"relative"}},!!E&&E.length>0&&!mn()&&(()=>{const t=k||"ribbon";if("ribbon"===t)return e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:B,marginBottom:A?"0px":"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},E);const n=({children:n})=>e.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"max-content",padding:"0 55px",marginBottom:"4px",position:"bookmark"===t?"absolute":"static",top:"bookmark"===t?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===t?e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:te}),e.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},E),e.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:te}),e.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:te}),e.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},E),e.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:te}),e.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:$}))))})(),(!0===s||"true"===s)&&"closed"!==X&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-checkout-popout-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===X?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ce}),e.createElement("div",{className:"yt-cart-checkout-popout",ref:K,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===X?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},e.createElement("div",{className:"yt-cart-checkout-popout-header",style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},e.createElement("span",null,"Price Summary"),e.createElement("button",{className:"yt-cart-checkout-popout-close",onClick:ce,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),e.createElement("div",{className:"yt-cart-checkout-popout-content",style:{backgroundColor:"white",padding:"10px 1rem 0"}},e.createElement(e.Fragment,null,(S&&he>0||c&&we.length>0||pe&&ue>0)&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},G,un(pe?I?fe.toFixed(2):fe.toFixed(0):I?xe.toFixed(2):xe.toFixed(0)))),(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&he>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?he.toFixed(2):he.toFixed(0)))),pe&&ue>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?ue.toFixed(2):ue.toFixed(0)))),we.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?t.amount.toFixed(2):t.amount.toFixed(0))))),Ee>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},e.createElement("span",null,"Total Savings"),e.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",G,un(I?Ee.toFixed(2):Ee.toFixed(0))))),(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:me>0||S&&he>0||pe&&ue>0?"10px":"0"}},e.createElement("div",{style:{display:"flex",flexDirection:"column"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),e.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),e.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},G,un(I?ge.toFixed(2):ge.toFixed(0)))),e.createElement("div",{style:{display:"flex",background:$,color:B,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},e.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",e.createElement("span",null,G,un(I?Ee.toFixed(2):Ee.toFixed(0)))," ","on your order")),e.createElement("button",{ref:ie,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ke,disabled:Te,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},De(U)))),(!0===s||"true"===s)&&z&&Te&&ye&&e.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},ye),!0===s||"true"===s?e.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${F}px 8px`}},e.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{className:"yt-cart-checkout-save-badge",ref:le,style:{fontSize:"9px",backgroundColor:i,width:"max-content",padding:"2px 8px"}},"Saving ",G,un(I?Ee.toFixed(2):Ee.toFixed(0))),U?e.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):c||pe&&de?e.createElement("div",null,e.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},e.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},G,un(I?ge.toFixed(2):ge.toFixed(0))),(me>0||he>0||pe&&ue>0)&&e.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},G,un(pe?fe.toFixed(0):xe.toFixed(0))))):e.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},G,un(I?ge.toFixed(2):ge.toFixed(0))),S&&he>0||c&&me>0||pe&&ue>0?e.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),Z("opening"),requestAnimationFrame(()=>{Z("open")}),ee(!J)}},"See Details"):e.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),e.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},e.createElement("button",{ref:re,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Te,style:{backgroundColor:i,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(et,{fontSize:"24px"}))):"CHECKOUT"))),_&&!A&&e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}}))):e.createElement(e.Fragment,null,z&&Te&&ye&&e.createElement("div",{className:"yt-cart-checkout-disabled-message",style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},ye),e.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:A?"0px":"10px"}},e.createElement("div",{className:"yt-cart-checkout-breakdown",style:{display:A?"none":"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:P}},(he>0||c&&we.length>0||pe&&ue>0)&&Ee>0&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-subtotal-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-subtotal-label",style:{fontSize:"12px"}},"Subtotal"),e.createElement("span",{className:"yt-cart-subtotal-value",style:{fontSize:"14px"}},G,un(pe?I?fe.toFixed(2):fe.toFixed(0):I?xe.toFixed(2):xe.toFixed(0)))),(me>0||he>0||pe&&ue>0)&&e.createElement("div",{className:"yt-cart-discounts-section",style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},e.createElement("div",{className:"yt-cart-discounts-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-discounts-label",style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",e.createElement("button",{onClick:Fe,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},$e?"Hide details":"See details")),e.createElement("span",{className:"yt-cart-discounts-total",style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",G,un(I?Ee.toFixed(2):Ee.toFixed(0)))),e.createElement("div",{className:"yt-cart-discounts-details",ref:Ne,style:{height:Ie,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:$e?1:0,marginTop:$e?"5px":"0",borderTop:$e?"1px solid #E5E7EB":"none",paddingTop:$e?"5px":"0",fontWeight:"600"}},S&&he>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?he.toFixed(2):he.toFixed(0)))),pe&&ue>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?ue.toFixed(2):ue.toFixed(0)))),we.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?t.amount.toFixed(2):t.amount.toFixed(0))))))),e.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),e.createElement("div",{className:"yt-cart-total-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-total-label",style:{fontSize:"14px",fontWeight:"600"}},"Total"),e.createElement("span",{className:"yt-cart-total-value",style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},G,un(I?ge.toFixed(2):ge.toFixed(0))))),e.createElement("button",{ref:re,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Te,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==X||v?"0":`4px 1rem ${F}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,color:u??"white",textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"closed"!==X?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},De(U,D?"Checkout":"Proceed to Checkout")),_&&!A&&e.createElement("div",{className:"yt-cart-powered-by-badge",style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}})))))}const Lo=c.button`
999
+ `;function Do({showLoyaltyCta:n,exploreCTAColor:o="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:i,isUserSignedIn:a=!1,joinNowFunction:l,exploreCtaRedirectLink:c,themeColor:s,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:g,addCartItem:x,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:E="Empty cart Recommendations",backgroundSubdued:k,showEmptyCartRecommendations:T=!1,tertiaryColor:S,tertiaryTextColor:$}){const[B,N]=t(!1),[I,z]=t(null);return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-empty-container",style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},e.createElement("div",{className:"yt-cart-empty-content",style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},e.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},e.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),e.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:S??"#D9D9D9"}),e.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:$??"black"})),e.createElement("span",{className:"yt-cart-empty-title",style:{color:h,fontWeight:"semibold"}},r),i&&e.createElement("span",{className:"yt-cart-empty-description",style:{color:"#929292",fontSize:"14px"}},i),!a&&n&&e.createElement("div",{className:"yt-cart-empty-signin-cta",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},e.createElement(tt,{color:o,fontSize:"14px",strokeWidth:2}),e.createElement(zo,null,e.createElement("span",{className:"yt-cart-empty-signin-link",onClick:l,style:{color:o,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",e.createElement("span",{style:{color:"black"}},"to avail offers"))),d&&d.length>0&&e.createElement(Fo,null,d.map((t,n)=>e.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>z(n),onMouseLeave:()=>z(null),onClick:()=>window.location.href=t.link,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:I===n?s||"#73DABB":"#CACACA30",color:I===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},t.title)))),T&&g&&g.length>0&&x&&e.createElement("div",{className:"yt-cart-empty-recommendations",style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},e.createElement(Yn,{products:g,addCartItem:x,productRecsTitleText:E,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:k,tertiaryColor:S,tertiaryTextColor:$}))),e.createElement("button",{className:"yt-cart-empty-continue-shopping",onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),onClick:()=>window.location.replace(c??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:B?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},e.createElement(Je,{color:h}),e.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:h,cursor:"pointer"}},"Continue Shopping")))}const Po=ce("gstNumber",""),Ao=ce("gstCompanyName",""),_o=re("");gt("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const Ro=ce("postalCode",void 0);function Oo({checkoutButtonColor:i,checkoutFontSize:a,checkoutFunction:l,discountApplied:c,discountInCheckoutButton:s,discountAmountApplied:d,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:g,applyNoteToCart:x,showNoteOption:f,enableGeoLocationDeliveryRestriction:y,applyPostalCodeAndDeliverySlotToCart:b,enableSlotPicker:h,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:E,checkoutSectionMessageDisplay:k,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:B,cartCheckpoints:N,toggleDecimal:I,disableCheckoutButton:z,checkoutButtonBottomSpacing:F=8,showCheckoutButtonPaymentIcons:D,primaryTextColor:P,hideSubtotalAndBadge:A=!1,showTrustedBadge:_,trustedBadgeData:R}){const O=ae(Ut),L=ae(Po),M=ae(Ao),V=ae(_o),j=ae(Gt),W=ae(Yt),H=ae(Ro),q=ae(Zt),Q=ae(Xt),[U,Y]=t(!1),G=on(O,O?.currency),[X,Z]=t("closed"),K=r(null),[J,ee]=t(!1),te=o(()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),o=parseInt(n.slice(3,5),16),r=parseInt(n.slice(5,7),16),i=9===n.length?parseInt(n.slice(7,9),16):void 0,a=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),s=`#${a.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==i?`${s}${i.toString(16).padStart(2,"0")}`:s}return e}catch{return e}})($,.22),[$]),ne=o(()=>tn(p??0,O?.currency??"INR"),[p,O?.currency]),oe=o(()=>un(I?ne.toFixed(2):ne.toFixed(0)),[ne,I]),re=r(null),ie=r(null),le=r(null),ce=()=>{Z("closing"),setTimeout(()=>{Z("closed")},300)},se=tn(O?.original_total_price,O?.currency),de=o(()=>N?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[N]),pe=o(()=>!(!de||!de.minimumOrderValue)&&se>=de.minimumOrderValue,[de,se]),ue=pe&&de&&de.discountValue||0,me=d?tn(d,O?.currency??"INR"):0,ge=Number((se-me).toFixed(2)),xe=o(()=>{if(!O?.items?.length)return 0;const e=O.items.reduce((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return tn(e,O?.currency)},[O?.items,S]),fe=o(()=>pe?xe+ue:xe,[pe,xe,ue]),ye=o(()=>ne&&ne>0?`Add products worth more than ${G}${oe}`:"",[ne,G,oe]),be=o(()=>O?.items?.length?O.items.reduce((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e,0):0,[O?.items]),he=tn(be,O?.currency??"INR");n(()=>{re.current&&pn(re.current),ie.current&&pn(ie.current),le.current&&pn(le.current)},[i,me,S,he,X,ue]);const ve=o(()=>{const e={};return O?.items?.length?(O.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[O?.items]),we=o(()=>{const e=[];for(const t in ve)if(Object.prototype.hasOwnProperty.call(ve,t)){const n=ve[t],o=tn(n,O?.currency??"INR"),r=xn(t);e.push({title:r,amount:o})}return e},[ve,O?.currency]),Ce=o(()=>{let e=0;return e+=S?me+he:me,pe&&(e+=ue),e},[me,he,S,pe,ue]),Ee=async e=>{if(Y(!0),ge<=0)Y(!1);else{if(y){if("standard"!==Q&&(h?!j:!W.isPostalCodeValid))return void Y(!1);if(b)try{"standard"===Q?await b(Q):await b(Q,String(H)||"",q&&h?new Date(q).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}g&&m&&""!==M&&""!==L&&await m(L,M),f&&x&&""!==V&&await x(V),await l(e),Y(!1)}},[Te,Se]=t(!1);n(()=>{Se(ge<=0||(!!z||!!y&&("standard"!==Q&&(h?!j:!W.isPostalCodeValid))))},[W,Q,y,h,j,q,z,ge]);const[$e,Be]=t(!1),Ne=r(null),[Ie,ze]=t("0px");n(()=>{Ne.current&&ze($e?`${Ne.current.scrollHeight}px`:"0px")},[$e,we,pe]);const Fe=()=>{Be(!$e)};n(()=>{function e(e){K.current&&!K.current.contains(e.target)&&ce()}return"open"!==X&&"opening"!==X||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[X]);const De=(t,n="Checkout")=>t?e.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},n),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(nt,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):e.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},"Proceed to Checkout"!==n&&e.createElement(ke,{fontSize:"20px"}),e.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},n));return e.createElement("div",{className:"yt-cart-checkout-section",style:{position:"relative"}},!!E&&E.length>0&&!mn()&&(()=>{const t=k||"ribbon";if("ribbon"===t)return e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:B,marginBottom:A?"0px":"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},E);const n=({children:n})=>e.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"max-content",padding:"0 55px",marginBottom:"4px",position:"bookmark"===t?"absolute":"static",top:"bookmark"===t?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===t?e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:te}),e.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},E),e.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:te}),e.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:te}),e.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},E),e.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:te}),e.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:$}))))})(),(!0===s||"true"===s)&&"closed"!==X&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-checkout-popout-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===X?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ce}),e.createElement("div",{className:"yt-cart-checkout-popout",ref:K,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===X?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},e.createElement("div",{className:"yt-cart-checkout-popout-header",style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},e.createElement("span",null,"Price Summary"),e.createElement("button",{className:"yt-cart-checkout-popout-close",onClick:ce,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),e.createElement("div",{className:"yt-cart-checkout-popout-content",style:{backgroundColor:"white",padding:"10px 1rem 0"}},e.createElement(e.Fragment,null,(S&&he>0||c&&we.length>0||pe&&ue>0)&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},G,un(pe?I?fe.toFixed(2):fe.toFixed(0):I?xe.toFixed(2):xe.toFixed(0)))),(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&he>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?he.toFixed(2):he.toFixed(0)))),pe&&ue>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?ue.toFixed(2):ue.toFixed(0)))),we.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?t.amount.toFixed(2):t.amount.toFixed(0))))),Ce>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},e.createElement("span",null,"Total Savings"),e.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",G,un(I?Ce.toFixed(2):Ce.toFixed(0))))),(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:me>0||S&&he>0||pe&&ue>0?"10px":"0"}},e.createElement("div",{style:{display:"flex",flexDirection:"column"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),e.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),e.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},G,un(I?ge.toFixed(2):ge.toFixed(0)))),e.createElement("div",{style:{display:"flex",background:$,color:B,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},e.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",e.createElement("span",null,G,un(I?Ce.toFixed(2):Ce.toFixed(0)))," ","on your order")),e.createElement("button",{ref:ie,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:Ee,disabled:Te,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},De(U)))),(!0===s||"true"===s)&&z&&Te&&ye&&e.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},ye),!0===s||"true"===s?e.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${F}px 8px`}},e.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(me>0||S&&he>0||pe&&ue>0)&&e.createElement("div",{className:"yt-cart-checkout-save-badge",ref:le,style:{fontSize:"9px",backgroundColor:i,width:"max-content",padding:"2px 8px"}},"Saving ",G,un(I?Ce.toFixed(2):Ce.toFixed(0))),U?e.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):c||pe&&de?e.createElement("div",null,e.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},e.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},G,un(I?ge.toFixed(2):ge.toFixed(0))),(me>0||he>0||pe&&ue>0)&&e.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},G,un(pe?fe.toFixed(0):xe.toFixed(0))))):e.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},G,un(I?ge.toFixed(2):ge.toFixed(0))),S&&he>0||c&&me>0||pe&&ue>0?e.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),Z("opening"),requestAnimationFrame(()=>{Z("open")}),ee(!J)}},"See Details"):e.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),e.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},e.createElement("button",{ref:re,id:"yt-checkout-button",className:"yt-checkout-button",onClick:Ee,disabled:Te,style:{backgroundColor:i,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(nt,{fontSize:"24px"}))):"CHECKOUT"))),_&&!A&&e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}}))):e.createElement(e.Fragment,null,z&&Te&&ye&&e.createElement("div",{className:"yt-cart-checkout-disabled-message",style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},ye),e.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:A?"0px":"10px"}},e.createElement("div",{className:"yt-cart-checkout-breakdown",style:{display:A?"none":"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:P}},(he>0||c&&we.length>0||pe&&ue>0)&&Ce>0&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-subtotal-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-subtotal-label",style:{fontSize:"12px"}},"Subtotal"),e.createElement("span",{className:"yt-cart-subtotal-value",style:{fontSize:"14px"}},G,un(pe?I?fe.toFixed(2):fe.toFixed(0):I?xe.toFixed(2):xe.toFixed(0)))),(me>0||he>0||pe&&ue>0)&&e.createElement("div",{className:"yt-cart-discounts-section",style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},e.createElement("div",{className:"yt-cart-discounts-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-discounts-label",style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",e.createElement("button",{onClick:Fe,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},$e?"Hide details":"See details")),e.createElement("span",{className:"yt-cart-discounts-total",style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",G,un(I?Ce.toFixed(2):Ce.toFixed(0)))),e.createElement("div",{className:"yt-cart-discounts-details",ref:Ne,style:{height:Ie,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:$e?1:0,marginTop:$e?"5px":"0",borderTop:$e?"1px solid #E5E7EB":"none",paddingTop:$e?"5px":"0",fontWeight:"600"}},S&&he>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?he.toFixed(2):he.toFixed(0)))),pe&&ue>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?ue.toFixed(2):ue.toFixed(0)))),we.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",G,un(I?t.amount.toFixed(2):t.amount.toFixed(0))))))),e.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),e.createElement("div",{className:"yt-cart-total-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-total-label",style:{fontSize:"14px",fontWeight:"600"}},"Total"),e.createElement("span",{className:"yt-cart-total-value",style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},G,un(I?ge.toFixed(2):ge.toFixed(0))))),e.createElement("button",{ref:re,id:"yt-checkout-button",className:"yt-checkout-button",onClick:Ee,disabled:Te,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==X||v?"0":`4px 1rem ${F}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,color:u??"white",textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Te?.5:1,cursor:Te?"not-allowed":"pointer",borderRadius:"closed"!==X?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},De(U,D?"Checkout":"Proceed to Checkout")),_&&!A&&e.createElement("div",{className:"yt-cart-powered-by-badge",style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}})))))}const Lo=c.button`
1009
1000
  background-color: ${e=>e.$ctaButtonBackgroundColor||"#BEB8EC"};
1010
1001
  color: ${e=>e.$ctaButtonTextColor||"black"};
1011
1002
  font-size: 11px;
@@ -1038,7 +1029,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
1038
1029
  `,jo=c(Mo)`
1039
1030
  font-size: 10px;
1040
1031
  color: ${e=>e.color||"#868E96"};
1041
- `,Wo=({cartSigninCTAMainText:t,signinCTAButtonVisible:n=!0,guestLoyaltyPercentage:o,joinNowFunction:r,themeColor:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l,primaryTextColor:c,secondaryTextColor:s,cartComponentsCornerType:d,cartComponentsCornerRadius:p,showCartLevelAltPay:u})=>e.createElement("div",{className:"yt-cart-guest-loyalty-container",style:{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"10px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:u?"0px":"10px",borderBottomRightRadius:u?"0px":"10px",margin:"10px 1rem 6px",border:"1px solid #E8EBED",background:"#00000005"}},e.createElement("div",{className:"yt-cart-guest-loyalty-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}},e.createElement(Vo,{className:"yt-cart-guest-loyalty-text",color:c},t??"Sign-in to avail Reward Points"),e.createElement(jo,{className:"yt-cart-guest-loyalty-text",color:s},"Get"," ",e.createElement("span",{style:{fontWeight:"bold"}},"upto ",o,"% Off")," ","on all orders")),e.createElement(Lo,{className:"yt-cart-guest-loyalty-signin-button",$ctaButtonBackgroundColor:a,$ctaButtonTextColor:l,$cartComponentsCornerType:d,$cartComponentsCornerRadius:p,onClick:r},"Sign in Now"));class Ho extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("FooterSections error:",e,t)}render(){return this.state.hasError?e.createElement("div",{style:{textAlign:"center",marginBottom:"10px",textDecorationLine:"underline",color:"blue",cursor:"pointer"},onClick:()=>window.location.reload()},"Something went wrong. Click here to reload the page"):this.props.children}}const qo=({children:o})=>{const[r,i]=t("0px");return n(()=>{const e=navigator.userAgent.toLowerCase(),t=e.indexOf("brave")>-1,n=/iphone|ipad|ipod/.test(e)&&!window.MSStream,o=e.includes("safari")&&!e.includes("chrome"),r=/android/.test(e);t?i("56px"):n?i(o?"44px":"34px"):r&&i("24px")},[]),e.createElement(Ho,null,e.createElement("div",{className:"yt-cart-footer-container",style:{display:"flex",flexDirection:"column",paddingBottom:"env(safe-area-inset-bottom, 0px)",background:"white",zIndex:999,width:"100%",boxShadow:"rgb(135 135 135 / 45%) 0px -2px 0px 0px",borderRadius:"17px 17px 0px 0px",gap:"10px"}},o))},Qo=()=>{const[o,r]=t(0);return n(()=>{const e=setTimeout(()=>{r(100)},1e3);return()=>clearTimeout(e)},[]),e.createElement("div",{className:"yt-loyalty-cta-progress-bar-container"},e.createElement("div",{className:"yt-loyalty-cta-progress-bar",style:{width:`${o}%`}},"‎"))},Uo=({removeDiscount:n,isDev:o,themeColor:r,ctaButtonBackgroundColor:i,ctaButtonTextColor:a,primaryTextColor:l,secondaryTextColor:c,loyaltyDiscount:s,pointsToBeUsed:d,brandTokenName:p,showCartLevelAltPay:u})=>{const m=ae(Ut),{cartLoading:g,setLoading:x}=Jt(),[f,y]=t(!1),b=g.showLoyaltyCtaLoading,h=tn(s?.total_allocated_amount??0,m?.currency);return b?e.createElement("div",{className:"yt-loyalty-apply-cta-loading-container",style:{marginBottom:u?"0":"1rem"}},e.createElement("span",{style:{fontSize:"13px"}},"Processing points..."),e.createElement(rt,{color:"black",loading:b,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}),e.createElement(Qo,null)):e.createElement("div",{className:"yt-loyalty-cta-applied-container",style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"#FAFAFA",border:"1px solid #E5E7E8",borderRadius:"10px",padding:"12px 16px",margin:"10px 1rem",boxShadow:"0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549)",zIndex:100}},e.createElement("div",{className:"yt-cart-loyalty-applied-content",style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},e.createElement("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.3716 9.64475C16.2849 9.50135 16.239 9.33692 16.239 9.1693C16.239 9.00167 16.2849 8.83724 16.3716 8.69384L16.67 8.20819C16.821 7.96172 16.9167 7.68543 16.9507 7.39837C16.9847 7.1113 16.9561 6.82027 16.8669 6.54532C16.7777 6.27038 16.63 6.01805 16.4339 5.80572C16.2379 5.59339 15.9982 5.42611 15.7313 5.31539L15.2044 5.09696C15.0488 5.03308 14.914 4.92711 14.8152 4.79093C14.7164 4.65474 14.6574 4.49372 14.6448 4.32588L14.6012 3.75431C14.5775 3.46646 14.4919 3.18711 14.3505 2.93534C14.209 2.68358 14.0149 2.46533 13.7814 2.2955C13.5479 2.12567 13.2805 2.00826 12.9975 1.95128C12.7145 1.8943 12.4226 1.89909 12.1416 1.96534L11.5857 2.09713C11.4226 2.13644 11.2518 2.13007 11.0922 2.07869C10.9325 2.02731 10.79 1.93293 10.6804 1.80588L10.3122 1.36901C10.1245 1.14887 9.89139 0.972091 9.62882 0.850869C9.36625 0.729647 9.08052 0.66687 8.79134 0.66687C8.50217 0.66687 8.21644 0.729647 7.95387 0.850869C7.6913 0.972091 7.45814 1.14887 7.27048 1.36901L6.89863 1.80588C6.78907 1.93319 6.64649 2.02775 6.48663 2.07914C6.32677 2.13053 6.15584 2.13675 5.99267 2.09713L5.43671 1.96534C5.15574 1.89909 4.8638 1.8943 4.5808 1.95128C4.29781 2.00826 4.03044 2.12567 3.79695 2.2955C3.56346 2.46533 3.36934 2.68358 3.22786 2.93534C3.08637 3.18711 3.00085 3.46646 2.97714 3.75431L2.93348 4.32588C2.92053 4.49352 2.86128 4.65426 2.76233 4.79015C2.66339 4.92605 2.52866 5.03177 2.37316 5.0955L1.84631 5.31393C1.57905 5.4243 1.33887 5.59134 1.14236 5.80354C0.945839 6.01575 0.79765 6.26807 0.708004 6.54312C0.618359 6.81817 0.58939 7.10939 0.623094 7.39672C0.656799 7.68406 0.752375 7.96066 0.903234 8.20746L1.20158 8.69311C1.28834 8.83651 1.3342 9.00094 1.3342 9.16857C1.3342 9.3362 1.28834 9.50062 1.20158 9.64403L0.903234 10.1355C0.752508 10.3821 0.656925 10.6584 0.623055 10.9455C0.589185 11.2325 0.61783 11.5235 0.707022 11.7984C0.796215 12.0734 0.943839 12.3257 1.13975 12.5381C1.33566 12.7506 1.57521 12.918 1.84195 13.029L2.36879 13.2475C2.52387 13.3107 2.65833 13.4158 2.75715 13.551C2.85597 13.6863 2.91525 13.8464 2.92838 14.0134L2.97204 14.585C2.99511 14.8731 3.08023 15.1527 3.22156 15.4047C3.3629 15.6567 3.55709 15.8751 3.79079 16.0449C4.02449 16.2147 4.29217 16.3318 4.57541 16.3882C4.85865 16.4447 5.15075 16.4391 5.43162 16.3718L5.98757 16.24C6.15078 16.2015 6.32137 16.2083 6.48101 16.2596C6.64064 16.311 6.78327 16.4049 6.89354 16.5313L7.26539 16.9681C7.45339 17.1876 7.68662 17.3638 7.94908 17.4846C8.21153 17.6053 8.497 17.6679 8.78589 17.6679C9.07477 17.6679 9.36024 17.6053 9.62269 17.4846C9.88515 17.3638 10.1184 17.1876 10.3064 16.9681L10.6746 16.5313C10.7848 16.405 10.9273 16.3112 11.0868 16.2599C11.2463 16.2085 11.4167 16.2017 11.5798 16.24L12.1358 16.3718C12.4167 16.4391 12.7088 16.4447 12.992 16.3882C13.2752 16.3318 13.5429 16.2147 13.7766 16.0449C14.0103 15.8751 14.2045 15.6567 14.3458 15.4047C14.4872 15.1527 14.5723 14.8731 14.5954 14.585L14.639 14.0134C14.6523 13.8465 14.7116 13.6866 14.8104 13.5515C14.9093 13.4163 15.0436 13.3113 15.1986 13.2482L15.7255 13.0298C15.8212 12.99 15.9136 12.9428 16.002 12.8885C16.2266 12.7517 16.4221 12.572 16.5772 12.3595C16.7323 12.1471 16.8441 11.9061 16.9061 11.6504C16.968 11.3947 16.979 11.1293 16.9384 10.8694C16.8978 10.6094 16.8063 10.3601 16.6693 10.1355L16.3716 9.64475ZM5.98393 7.35411C5.98393 7.2101 6.02661 7.06933 6.10657 6.94959C6.18653 6.82985 6.30018 6.73653 6.43315 6.68142C6.56611 6.62631 6.71243 6.61189 6.85358 6.63999C6.99474 6.66808 7.1244 6.73743 7.22617 6.83925C7.32794 6.94108 7.39724 7.07082 7.42532 7.21206C7.4534 7.3533 7.43899 7.4997 7.38391 7.63275C7.32884 7.76579 7.23557 7.87951 7.1159 7.95951C6.99623 8.03952 6.85554 8.08222 6.71162 8.08222C6.51862 8.08222 6.33354 8.00551 6.19707 7.86896C6.0606 7.73241 5.98393 7.54722 5.98393 7.35411ZM6.98959 11.7374C6.9397 11.7884 6.88002 11.8288 6.81412 11.8562C6.74822 11.8837 6.67746 11.8974 6.6061 11.8968C6.49941 11.8968 6.39509 11.8653 6.30613 11.8064C6.21718 11.7474 6.14753 11.6636 6.10587 11.5653C6.06421 11.467 6.05237 11.3586 6.07184 11.2537C6.0913 11.1487 6.14121 11.0518 6.21534 10.975L10.5814 6.60634C10.682 6.50598 10.8177 6.44884 10.9596 6.44708C11.1016 6.44531 11.2387 6.49906 11.3417 6.59688C11.4447 6.6947 11.5054 6.82888 11.511 6.97084C11.5166 7.11281 11.4667 7.25137 11.3717 7.35702L11.3513 7.37741L6.98959 11.7374ZM11.0806 11.7148C10.8887 11.7148 10.7044 11.6389 10.5681 11.5036C10.4318 11.3683 10.3545 11.1846 10.353 10.9925V10.9874C10.353 10.8434 10.3956 10.7026 10.4756 10.5829C10.5556 10.4631 10.6692 10.3698 10.8022 10.3147C10.9351 10.2596 11.0814 10.2452 11.2226 10.2733C11.3638 10.3014 11.4934 10.3707 11.5952 10.4725C11.697 10.5744 11.7663 10.7041 11.7943 10.8453C11.8224 10.9866 11.808 11.133 11.7529 11.266C11.6979 11.3991 11.6046 11.5128 11.4849 11.5928C11.3653 11.6728 11.2246 11.7155 11.0806 11.7155",fill:r})),e.createElement("div",{className:"yt-cart-loyalty-applied-details",style:{display:"flex",flexDirection:"column",gap:"4px"}},e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"13px",fontWeight:"bold",color:l??"#000"}},on(m,m?.currency),Number(h?.toFixed(1))??0," Off Coupon Applied!"),e.createElement("span",{className:"yt-loyalty-cta-applied-code-text",style:{fontSize:"9px",color:r??"#EF4444"}},"Code: ",function(e){try{const t=e+"=",n=(()=>{try{return decodeURIComponent(document.cookie)}catch(e){return console.warn("Cookie decode failed, using raw cookie string"),document.cookie}})().split(";");for(let o=0;o<n.length;o++){let r=n[o].trim();if(0===r.indexOf(t)){const n=r.substring(t.length);try{return decodeURIComponent(n)}catch(t){return console.warn(`Failed to decode cookie value for ${e}`),n}}}return""}catch(t){return console.error(`Cookie parsing error for ${e}:`,t),""}}("discount_code")))),e.createElement("div",{className:"yt-cart-loyalty-applied-remove",style:{display:"flex",alignItems:"center",gap:"4px",cursor:"pointer"},onClick:async()=>{x&&x(!0,!1,!1,!0);try{await n()}catch(e){}x&&x(!1,!1,!1,!1)},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)}," ",f?e.createElement(me,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}):e.createElement(ge,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}),e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"8px",color:c??"#6B7280",fontWeight:"600"}},"REMOVE")))},Yo=c.span`
1032
+ `,Wo=({cartSigninCTAMainText:t,signinCTAButtonVisible:n=!0,guestLoyaltyPercentage:o,joinNowFunction:r,themeColor:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l,primaryTextColor:c,secondaryTextColor:s,cartComponentsCornerType:d,cartComponentsCornerRadius:p,showCartLevelAltPay:u})=>e.createElement("div",{className:"yt-cart-guest-loyalty-container",style:{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"10px",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",borderBottomLeftRadius:u?"0px":"10px",borderBottomRightRadius:u?"0px":"10px",margin:"10px 1rem 6px",border:"1px solid #E8EBED",background:"#00000005"}},e.createElement("div",{className:"yt-cart-guest-loyalty-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"4px"}},e.createElement(Vo,{className:"yt-cart-guest-loyalty-text",color:c},t??"Sign-in to avail Reward Points"),e.createElement(jo,{className:"yt-cart-guest-loyalty-text",color:s},"Get"," ",e.createElement("span",{style:{fontWeight:"bold"}},"upto ",o,"% Off")," ","on all orders")),e.createElement(Lo,{className:"yt-cart-guest-loyalty-signin-button",$ctaButtonBackgroundColor:a,$ctaButtonTextColor:l,$cartComponentsCornerType:d,$cartComponentsCornerRadius:p,onClick:r},"Sign in Now"));class Ho extends e.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("FooterSections error:",e,t)}render(){return this.state.hasError?e.createElement("div",{style:{textAlign:"center",marginBottom:"10px",textDecorationLine:"underline",color:"blue",cursor:"pointer"},onClick:()=>window.location.reload()},"Something went wrong. Click here to reload the page"):this.props.children}}const qo=({children:o})=>{const[r,i]=t("0px");return n(()=>{const e=navigator.userAgent.toLowerCase(),t=e.indexOf("brave")>-1,n=/iphone|ipad|ipod/.test(e)&&!window.MSStream,o=e.includes("safari")&&!e.includes("chrome"),r=/android/.test(e);t?i("56px"):n?i(o?"44px":"34px"):r&&i("24px")},[]),e.createElement(Ho,null,e.createElement("div",{className:"yt-cart-footer-container",style:{display:"flex",flexDirection:"column",paddingBottom:"env(safe-area-inset-bottom, 0px)",background:"white",zIndex:999,width:"100%",boxShadow:"rgb(135 135 135 / 45%) 0px -2px 0px 0px",borderRadius:"17px 17px 0px 0px",gap:"10px"}},o))},Qo=()=>{const[o,r]=t(0);return n(()=>{const e=setTimeout(()=>{r(100)},1e3);return()=>clearTimeout(e)},[]),e.createElement("div",{className:"yt-loyalty-cta-progress-bar-container"},e.createElement("div",{className:"yt-loyalty-cta-progress-bar",style:{width:`${o}%`}},"‎"))},Uo=({removeDiscount:n,isDev:o,themeColor:r,ctaButtonBackgroundColor:i,ctaButtonTextColor:a,primaryTextColor:l,secondaryTextColor:c,loyaltyDiscount:s,pointsToBeUsed:d,brandTokenName:p,showCartLevelAltPay:u})=>{const m=ae(Ut),{cartLoading:g,setLoading:x}=Jt(),[f,y]=t(!1),b=g.showLoyaltyCtaLoading,h=tn(s?.total_allocated_amount??0,m?.currency);return b?e.createElement("div",{className:"yt-loyalty-apply-cta-loading-container",style:{marginBottom:u?"0":"1rem"}},e.createElement("span",{style:{fontSize:"13px"}},"Processing points..."),e.createElement(ue,{color:"black",loading:b,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}),e.createElement(Qo,null)):e.createElement("div",{className:"yt-loyalty-cta-applied-container",style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"#FAFAFA",border:"1px solid #E5E7E8",borderRadius:"10px",padding:"12px 16px",margin:"10px 1rem",boxShadow:"0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549)",zIndex:100}},e.createElement("div",{className:"yt-cart-loyalty-applied-content",style:{display:"flex",flexDirection:"row",gap:"10px",alignItems:"center"}},e.createElement("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.3716 9.64475C16.2849 9.50135 16.239 9.33692 16.239 9.1693C16.239 9.00167 16.2849 8.83724 16.3716 8.69384L16.67 8.20819C16.821 7.96172 16.9167 7.68543 16.9507 7.39837C16.9847 7.1113 16.9561 6.82027 16.8669 6.54532C16.7777 6.27038 16.63 6.01805 16.4339 5.80572C16.2379 5.59339 15.9982 5.42611 15.7313 5.31539L15.2044 5.09696C15.0488 5.03308 14.914 4.92711 14.8152 4.79093C14.7164 4.65474 14.6574 4.49372 14.6448 4.32588L14.6012 3.75431C14.5775 3.46646 14.4919 3.18711 14.3505 2.93534C14.209 2.68358 14.0149 2.46533 13.7814 2.2955C13.5479 2.12567 13.2805 2.00826 12.9975 1.95128C12.7145 1.8943 12.4226 1.89909 12.1416 1.96534L11.5857 2.09713C11.4226 2.13644 11.2518 2.13007 11.0922 2.07869C10.9325 2.02731 10.79 1.93293 10.6804 1.80588L10.3122 1.36901C10.1245 1.14887 9.89139 0.972091 9.62882 0.850869C9.36625 0.729647 9.08052 0.66687 8.79134 0.66687C8.50217 0.66687 8.21644 0.729647 7.95387 0.850869C7.6913 0.972091 7.45814 1.14887 7.27048 1.36901L6.89863 1.80588C6.78907 1.93319 6.64649 2.02775 6.48663 2.07914C6.32677 2.13053 6.15584 2.13675 5.99267 2.09713L5.43671 1.96534C5.15574 1.89909 4.8638 1.8943 4.5808 1.95128C4.29781 2.00826 4.03044 2.12567 3.79695 2.2955C3.56346 2.46533 3.36934 2.68358 3.22786 2.93534C3.08637 3.18711 3.00085 3.46646 2.97714 3.75431L2.93348 4.32588C2.92053 4.49352 2.86128 4.65426 2.76233 4.79015C2.66339 4.92605 2.52866 5.03177 2.37316 5.0955L1.84631 5.31393C1.57905 5.4243 1.33887 5.59134 1.14236 5.80354C0.945839 6.01575 0.79765 6.26807 0.708004 6.54312C0.618359 6.81817 0.58939 7.10939 0.623094 7.39672C0.656799 7.68406 0.752375 7.96066 0.903234 8.20746L1.20158 8.69311C1.28834 8.83651 1.3342 9.00094 1.3342 9.16857C1.3342 9.3362 1.28834 9.50062 1.20158 9.64403L0.903234 10.1355C0.752508 10.3821 0.656925 10.6584 0.623055 10.9455C0.589185 11.2325 0.61783 11.5235 0.707022 11.7984C0.796215 12.0734 0.943839 12.3257 1.13975 12.5381C1.33566 12.7506 1.57521 12.918 1.84195 13.029L2.36879 13.2475C2.52387 13.3107 2.65833 13.4158 2.75715 13.551C2.85597 13.6863 2.91525 13.8464 2.92838 14.0134L2.97204 14.585C2.99511 14.8731 3.08023 15.1527 3.22156 15.4047C3.3629 15.6567 3.55709 15.8751 3.79079 16.0449C4.02449 16.2147 4.29217 16.3318 4.57541 16.3882C4.85865 16.4447 5.15075 16.4391 5.43162 16.3718L5.98757 16.24C6.15078 16.2015 6.32137 16.2083 6.48101 16.2596C6.64064 16.311 6.78327 16.4049 6.89354 16.5313L7.26539 16.9681C7.45339 17.1876 7.68662 17.3638 7.94908 17.4846C8.21153 17.6053 8.497 17.6679 8.78589 17.6679C9.07477 17.6679 9.36024 17.6053 9.62269 17.4846C9.88515 17.3638 10.1184 17.1876 10.3064 16.9681L10.6746 16.5313C10.7848 16.405 10.9273 16.3112 11.0868 16.2599C11.2463 16.2085 11.4167 16.2017 11.5798 16.24L12.1358 16.3718C12.4167 16.4391 12.7088 16.4447 12.992 16.3882C13.2752 16.3318 13.5429 16.2147 13.7766 16.0449C14.0103 15.8751 14.2045 15.6567 14.3458 15.4047C14.4872 15.1527 14.5723 14.8731 14.5954 14.585L14.639 14.0134C14.6523 13.8465 14.7116 13.6866 14.8104 13.5515C14.9093 13.4163 15.0436 13.3113 15.1986 13.2482L15.7255 13.0298C15.8212 12.99 15.9136 12.9428 16.002 12.8885C16.2266 12.7517 16.4221 12.572 16.5772 12.3595C16.7323 12.1471 16.8441 11.9061 16.9061 11.6504C16.968 11.3947 16.979 11.1293 16.9384 10.8694C16.8978 10.6094 16.8063 10.3601 16.6693 10.1355L16.3716 9.64475ZM5.98393 7.35411C5.98393 7.2101 6.02661 7.06933 6.10657 6.94959C6.18653 6.82985 6.30018 6.73653 6.43315 6.68142C6.56611 6.62631 6.71243 6.61189 6.85358 6.63999C6.99474 6.66808 7.1244 6.73743 7.22617 6.83925C7.32794 6.94108 7.39724 7.07082 7.42532 7.21206C7.4534 7.3533 7.43899 7.4997 7.38391 7.63275C7.32884 7.76579 7.23557 7.87951 7.1159 7.95951C6.99623 8.03952 6.85554 8.08222 6.71162 8.08222C6.51862 8.08222 6.33354 8.00551 6.19707 7.86896C6.0606 7.73241 5.98393 7.54722 5.98393 7.35411ZM6.98959 11.7374C6.9397 11.7884 6.88002 11.8288 6.81412 11.8562C6.74822 11.8837 6.67746 11.8974 6.6061 11.8968C6.49941 11.8968 6.39509 11.8653 6.30613 11.8064C6.21718 11.7474 6.14753 11.6636 6.10587 11.5653C6.06421 11.467 6.05237 11.3586 6.07184 11.2537C6.0913 11.1487 6.14121 11.0518 6.21534 10.975L10.5814 6.60634C10.682 6.50598 10.8177 6.44884 10.9596 6.44708C11.1016 6.44531 11.2387 6.49906 11.3417 6.59688C11.4447 6.6947 11.5054 6.82888 11.511 6.97084C11.5166 7.11281 11.4667 7.25137 11.3717 7.35702L11.3513 7.37741L6.98959 11.7374ZM11.0806 11.7148C10.8887 11.7148 10.7044 11.6389 10.5681 11.5036C10.4318 11.3683 10.3545 11.1846 10.353 10.9925V10.9874C10.353 10.8434 10.3956 10.7026 10.4756 10.5829C10.5556 10.4631 10.6692 10.3698 10.8022 10.3147C10.9351 10.2596 11.0814 10.2452 11.2226 10.2733C11.3638 10.3014 11.4934 10.3707 11.5952 10.4725C11.697 10.5744 11.7663 10.7041 11.7943 10.8453C11.8224 10.9866 11.808 11.133 11.7529 11.266C11.6979 11.3991 11.6046 11.5128 11.4849 11.5928C11.3653 11.6728 11.2246 11.7155 11.0806 11.7155",fill:r})),e.createElement("div",{className:"yt-cart-loyalty-applied-details",style:{display:"flex",flexDirection:"column",gap:"4px"}},e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"13px",fontWeight:"bold",color:l??"#000"}},on(m,m?.currency),Number(h?.toFixed(1))??0," Off Coupon Applied!"),e.createElement("span",{className:"yt-loyalty-cta-applied-code-text",style:{fontSize:"9px",color:r??"#EF4444"}},"Code: ",function(e){try{const t=e+"=",n=(()=>{try{return decodeURIComponent(document.cookie)}catch(e){return console.warn("Cookie decode failed, using raw cookie string"),document.cookie}})().split(";");for(let o=0;o<n.length;o++){let r=n[o].trim();if(0===r.indexOf(t)){const n=r.substring(t.length);try{return decodeURIComponent(n)}catch(t){return console.warn(`Failed to decode cookie value for ${e}`),n}}}return""}catch(t){return console.error(`Cookie parsing error for ${e}:`,t),""}}("discount_code")))),e.createElement("div",{className:"yt-cart-loyalty-applied-remove",style:{display:"flex",alignItems:"center",gap:"4px",cursor:"pointer"},onClick:async()=>{x&&x(!0,!1,!1,!0);try{await n()}catch(e){}x&&x(!1,!1,!1,!1)},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1)}," ",f?e.createElement(xe,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}):e.createElement(fe,{className:"yt-loyalty-cta-applied-delete-btn",color:"#9CA3AF",fontSize:"16px"}),e.createElement("span",{className:"yt-loyalty-cta-applied-text",style:{fontSize:"8px",color:c??"#6B7280",fontWeight:"600"}},"REMOVE")))},Yo=c.span`
1042
1033
  display: flex !important;
1043
1034
  flex-direction: row;
1044
1035
  align-items: center;
@@ -1072,7 +1063,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
1072
1063
  width: 14px;
1073
1064
  height: 14px;
1074
1065
  }
1075
- `,Zo=({discountAmountOff:t,loyaltyIcon:n,pointsToBeUsed:o,applyDiscount:r,themeColor:i,ctaButtonTextColor:a,ctaButtonBackgroundColor:l,primaryTextColor:c,secondaryTextColor:s,minimumOrderValueToAvailDiscount:d=0,brandTokenName:p,showCartLevelAltPay:u,redemptionMultiplier:m})=>{const g=ae(Ut),{cartLoading:x,setLoading:f}=Jt(),y=0===o||o<0,b="number"==typeof m&&m>0?o*m:o,h=tn(g?.items_subtotal_price,g?.currency);return x.showLoyaltyCtaLoading?e.createElement("div",{className:"yt-loyalty-apply-cta-loading-container",style:{marginBottom:u?"0":"1rem"}},e.createElement("span",{style:{fontSize:"13px"}},"Processing points..."),e.createElement(rt,{color:"black",loading:x?.showLoyaltyCtaLoading,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}),e.createElement(Qo,null)):e.createElement("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",background:"#FAFAFA",border:"1px solid #E5E7E8",margin:"10px 1rem",zIndex:100},className:"yt-loyalty-cta-container"},e.createElement("div",{className:"yt-cart-loyalty-apply-content",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"10px"}},e.createElement("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.3716 9.64475C16.2849 9.50135 16.239 9.33692 16.239 9.1693C16.239 9.00167 16.2849 8.83724 16.3716 8.69384L16.67 8.20819C16.821 7.96172 16.9167 7.68543 16.9507 7.39837C16.9847 7.1113 16.9561 6.82027 16.8669 6.54532C16.7777 6.27038 16.63 6.01805 16.4339 5.80572C16.2379 5.59339 15.9982 5.42611 15.7313 5.31539L15.2044 5.09696C15.0488 5.03308 14.914 4.92711 14.8152 4.79093C14.7164 4.65474 14.6574 4.49372 14.6448 4.32588L14.6012 3.75431C14.5775 3.46646 14.4919 3.18711 14.3505 2.93534C14.209 2.68358 14.0149 2.46533 13.7814 2.2955C13.5479 2.12567 13.2805 2.00826 12.9975 1.95128C12.7145 1.8943 12.4226 1.89909 12.1416 1.96534L11.5857 2.09713C11.4226 2.13644 11.2518 2.13007 11.0922 2.07869C10.9325 2.02731 10.79 1.93293 10.6804 1.80588L10.3122 1.36901C10.1245 1.14887 9.89139 0.972091 9.62882 0.850869C9.36625 0.729647 9.08052 0.66687 8.79134 0.66687C8.50217 0.66687 8.21644 0.729647 7.95387 0.850869C7.6913 0.972091 7.45814 1.14887 7.27048 1.36901L6.89863 1.80588C6.78907 1.93319 6.64649 2.02775 6.48663 2.07914C6.32677 2.13053 6.15584 2.13675 5.99267 2.09713L5.43671 1.96534C5.15574 1.89909 4.8638 1.8943 4.5808 1.95128C4.29781 2.00826 4.03044 2.12567 3.79695 2.2955C3.56346 2.46533 3.36934 2.68358 3.22786 2.93534C3.08637 3.18711 3.00085 3.46646 2.97714 3.75431L2.93348 4.32588C2.92053 4.49352 2.86128 4.65426 2.76233 4.79015C2.66339 4.92605 2.52866 5.03177 2.37316 5.0955L1.84631 5.31393C1.57905 5.4243 1.33887 5.59134 1.14236 5.80354C0.945839 6.01575 0.79765 6.26807 0.708004 6.54312C0.618359 6.81817 0.58939 7.10939 0.623094 7.39672C0.656799 7.68406 0.752375 7.96066 0.903234 8.20746L1.20158 8.69311C1.28834 8.83651 1.3342 9.00094 1.3342 9.16857C1.3342 9.3362 1.28834 9.50062 1.20158 9.64403L0.903234 10.1355C0.752508 10.3821 0.656925 10.6584 0.623055 10.9455C0.589185 11.2325 0.61783 11.5235 0.707022 11.7984C0.796215 12.0734 0.943839 12.3257 1.13975 12.5381C1.33566 12.7506 1.57521 12.918 1.84195 13.029L2.36879 13.2475C2.52387 13.3107 2.65833 13.4158 2.75715 13.551C2.85597 13.6863 2.91525 13.8464 2.92838 14.0134L2.97204 14.585C2.99511 14.8731 3.08023 15.1527 3.22156 15.4047C3.3629 15.6567 3.55709 15.8751 3.79079 16.0449C4.02449 16.2147 4.29217 16.3318 4.57541 16.3882C4.85865 16.4447 5.15075 16.4391 5.43162 16.3718L5.98757 16.24C6.15078 16.2015 6.32137 16.2083 6.48101 16.2596C6.64064 16.311 6.78327 16.4049 6.89354 16.5313L7.26539 16.9681C7.45339 17.1876 7.68662 17.3638 7.94908 17.4846C8.21153 17.6053 8.497 17.6679 8.78589 17.6679C9.07477 17.6679 9.36024 17.6053 9.62269 17.4846C9.88515 17.3638 10.1184 17.1876 10.3064 16.9681L10.6746 16.5313C10.7848 16.405 10.9273 16.3112 11.0868 16.2599C11.2463 16.2085 11.4167 16.2017 11.5798 16.24L12.1358 16.3718C12.4167 16.4391 12.7088 16.4447 12.992 16.3882C13.2752 16.3318 13.5429 16.2147 13.7766 16.0449C14.0103 15.8751 14.2045 15.6567 14.3458 15.4047C14.4872 15.1527 14.5723 14.8731 14.5954 14.585L14.639 14.0134C14.6523 13.8465 14.7116 13.6866 14.8104 13.5515C14.9093 13.4163 15.0436 13.3113 15.1986 13.2482L15.7255 13.0298C15.8212 12.99 15.9136 12.9428 16.002 12.8885C16.2266 12.7517 16.4221 12.572 16.5772 12.3595C16.7323 12.1471 16.8441 11.9061 16.9061 11.6504C16.968 11.3947 16.979 11.1293 16.9384 10.8694C16.8978 10.6094 16.8063 10.3601 16.6693 10.1355L16.3716 9.64475ZM5.98393 7.35411C5.98393 7.2101 6.02661 7.06933 6.10657 6.94959C6.18653 6.82985 6.30018 6.73653 6.43315 6.68142C6.56611 6.62631 6.71243 6.61189 6.85358 6.63999C6.99474 6.66808 7.1244 6.73743 7.22617 6.83925C7.32794 6.94108 7.39724 7.07082 7.42532 7.21206C7.4534 7.3533 7.43899 7.4997 7.38391 7.63275C7.32884 7.76579 7.23557 7.87951 7.1159 7.95951C6.99623 8.03952 6.85554 8.08222 6.71162 8.08222C6.51862 8.08222 6.33354 8.00551 6.19707 7.86896C6.0606 7.73241 5.98393 7.54722 5.98393 7.35411ZM6.98959 11.7374C6.9397 11.7884 6.88002 11.8288 6.81412 11.8562C6.74822 11.8837 6.67746 11.8974 6.6061 11.8968C6.49941 11.8968 6.39509 11.8653 6.30613 11.8064C6.21718 11.7474 6.14753 11.6636 6.10587 11.5653C6.06421 11.467 6.05237 11.3586 6.07184 11.2537C6.0913 11.1487 6.14121 11.0518 6.21534 10.975L10.5814 6.60634C10.682 6.50598 10.8177 6.44884 10.9596 6.44708C11.1016 6.44531 11.2387 6.49906 11.3417 6.59688C11.4447 6.6947 11.5054 6.82888 11.511 6.97084C11.5166 7.11281 11.4667 7.25137 11.3717 7.35702L11.3513 7.37741L6.98959 11.7374ZM11.0806 11.7148C10.8887 11.7148 10.7044 11.6389 10.5681 11.5036C10.4318 11.3683 10.3545 11.1846 10.353 10.9925V10.9874C10.353 10.8434 10.3956 10.7026 10.4756 10.5829C10.5556 10.4631 10.6692 10.3698 10.8022 10.3147C10.9351 10.2596 11.0814 10.2452 11.2226 10.2733C11.3638 10.3014 11.4934 10.3707 11.5952 10.4725C11.697 10.5744 11.7663 10.7041 11.7943 10.8453C11.8224 10.9866 11.808 11.133 11.7529 11.266C11.6979 11.3991 11.6046 11.5128 11.4849 11.5928C11.3653 11.6728 11.2246 11.7155 11.0806 11.7155",fill:i})),e.createElement("div",{className:"yt-cart-loyalty-apply-details",style:{display:"flex",flexDirection:"column"}},e.createElement(Yo,{className:"yt-loyalty-cta-text",$primaryTextColor:c},0===o?"Insufficient Balance":e.createElement(e.Fragment,null,"Apply "," ",e.createElement("img",{src:n,height:"18px",width:"18px",style:{width:"18px",height:"18px"}}),t<0?0:Number(b.toFixed(2))," ",p??"points"," ")),e.createElement("span",{className:"yt-loyalty-cta-info-text",style:{color:i??"#50D1AA",fontSize:"11px"}},0===o?"Place order to earn coins":e.createElement(e.Fragment,null,"Auto Applied on checkout")))),e.createElement(Go,{$insufficientPoints:y,$opacity:h<d?.2:1,onClick:async()=>{if(!(y||h<d)){f&&f(!0,!1,!1,!0);try{await r()}catch(e){}f&&f(!1,!1,!1,!1)}}},e.createElement(Xo,{className:"yt-loyalty-cta-radio-button",$insufficientPoints:y,$opacity:h<d?.2:1})))},Ko=({value:t,handleItemQuantityDecrement:n,handleItemQuantityIncrement:o,isDev:r,themeColor:i,cartComponentsCornerType:a,cartComponentsCornerRadius:l,backgroundSubdued:c})=>e.createElement("form",{className:"yt-cart-quantity-selector-form",style:{marginBottom:"0px",width:"auto",height:"auto"}},e.createElement("div",{className:"yt-cart-quantity-selector",style:{border:"1px solid #dddddd",display:"flex",flexDirection:"row",borderRadius:"rounded"===a?`${l}px`:"8px",overflow:"hidden"}},e.createElement("button",{className:"yt-cart-quantity-decrement qty-selector-decrement-button",onClick:()=>0!==t&&n(),type:"button",style:{backgroundColor:c??cn(i,.1)}},"-"),e.createElement("input",{readOnly:!0,type:"text","aria-describedby":"helper-text-explanation",className:"yt-cart-quantity-input qty-selector-input",style:{textIndent:0,border:0,margin:0,width:"28px",minHeight:"22px !important",fontSize:"14px",padding:0,height:"auto",textAlign:"center",color:"black !important",background:"#ffffff !important"},value:t,required:!0}),e.createElement("button",{onClick:()=>o(),type:"button",id:"increment-button",className:"yt-cart-quantity-increment qty-selector-decrement-button",style:{backgroundColor:c??cn(i,.1)}},"+"))),Jo=re(void 0),er="yt_variant_options",tr="yt-variant-options-updated",nr=e=>e?e.trim().toLowerCase().replace(/[^a-z0-9#]+/g,""):"",or=()=>{if("undefined"==typeof window)return null;let e=null;try{e=window.localStorage.getItem(er)}catch{return null}return(e=>{if(!e)return null;try{const t=JSON.parse(e);if(Array.isArray(t))return{options:t};if(t&&Array.isArray(t.options))return{options:t.options}}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}return null})(e)},rr=(e,t)=>{if(!e||!t)return;const n=nr(t),o=(e=>{if(!e)return null;const t=e.match(/#([0-9a-f]{3,8})/i);return t?`#${t[1]}`.toLowerCase():null})(t);return e.values.find(e=>{const t=nr(e.name);if(n&&t&&t===n)return!0;if(o&&"string"==typeof e.value){if(e.value.trim().toLowerCase()===o)return!0}return!1})},ir=()=>{const[e,o]=t(null);return n(()=>{const e=()=>{const e=or();o(e)};e();const t=(e=>{if("undefined"==typeof window)return()=>{};const t=t=>{t.key&&t.key!==er||e()},n=()=>e();return window.addEventListener("storage",t),window.addEventListener(tr,n),()=>{window.removeEventListener("storage",t),window.removeEventListener(tr,n)}})(e);return()=>{t()}},[]),e},ar=c.div`
1066
+ `,Zo=({discountAmountOff:t,loyaltyIcon:n,pointsToBeUsed:o,applyDiscount:r,themeColor:i,ctaButtonTextColor:a,ctaButtonBackgroundColor:l,primaryTextColor:c,secondaryTextColor:s,minimumOrderValueToAvailDiscount:d=0,brandTokenName:p,showCartLevelAltPay:u,redemptionMultiplier:m})=>{const g=ae(Ut),{cartLoading:x,setLoading:f}=Jt(),y=0===o||o<0,b="number"==typeof m&&m>0?o*m:o,h=tn(g?.items_subtotal_price,g?.currency);return x.showLoyaltyCtaLoading?e.createElement("div",{className:"yt-loyalty-apply-cta-loading-container",style:{marginBottom:u?"0":"1rem"}},e.createElement("span",{style:{fontSize:"13px"}},"Processing points..."),e.createElement(ue,{color:"black",loading:x?.showLoyaltyCtaLoading,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}),e.createElement(Qo,null)):e.createElement("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",background:"#FAFAFA",border:"1px solid #E5E7E8",margin:"10px 1rem",zIndex:100},className:"yt-loyalty-cta-container"},e.createElement("div",{className:"yt-cart-loyalty-apply-content",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"10px"}},e.createElement("svg",{width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.3716 9.64475C16.2849 9.50135 16.239 9.33692 16.239 9.1693C16.239 9.00167 16.2849 8.83724 16.3716 8.69384L16.67 8.20819C16.821 7.96172 16.9167 7.68543 16.9507 7.39837C16.9847 7.1113 16.9561 6.82027 16.8669 6.54532C16.7777 6.27038 16.63 6.01805 16.4339 5.80572C16.2379 5.59339 15.9982 5.42611 15.7313 5.31539L15.2044 5.09696C15.0488 5.03308 14.914 4.92711 14.8152 4.79093C14.7164 4.65474 14.6574 4.49372 14.6448 4.32588L14.6012 3.75431C14.5775 3.46646 14.4919 3.18711 14.3505 2.93534C14.209 2.68358 14.0149 2.46533 13.7814 2.2955C13.5479 2.12567 13.2805 2.00826 12.9975 1.95128C12.7145 1.8943 12.4226 1.89909 12.1416 1.96534L11.5857 2.09713C11.4226 2.13644 11.2518 2.13007 11.0922 2.07869C10.9325 2.02731 10.79 1.93293 10.6804 1.80588L10.3122 1.36901C10.1245 1.14887 9.89139 0.972091 9.62882 0.850869C9.36625 0.729647 9.08052 0.66687 8.79134 0.66687C8.50217 0.66687 8.21644 0.729647 7.95387 0.850869C7.6913 0.972091 7.45814 1.14887 7.27048 1.36901L6.89863 1.80588C6.78907 1.93319 6.64649 2.02775 6.48663 2.07914C6.32677 2.13053 6.15584 2.13675 5.99267 2.09713L5.43671 1.96534C5.15574 1.89909 4.8638 1.8943 4.5808 1.95128C4.29781 2.00826 4.03044 2.12567 3.79695 2.2955C3.56346 2.46533 3.36934 2.68358 3.22786 2.93534C3.08637 3.18711 3.00085 3.46646 2.97714 3.75431L2.93348 4.32588C2.92053 4.49352 2.86128 4.65426 2.76233 4.79015C2.66339 4.92605 2.52866 5.03177 2.37316 5.0955L1.84631 5.31393C1.57905 5.4243 1.33887 5.59134 1.14236 5.80354C0.945839 6.01575 0.79765 6.26807 0.708004 6.54312C0.618359 6.81817 0.58939 7.10939 0.623094 7.39672C0.656799 7.68406 0.752375 7.96066 0.903234 8.20746L1.20158 8.69311C1.28834 8.83651 1.3342 9.00094 1.3342 9.16857C1.3342 9.3362 1.28834 9.50062 1.20158 9.64403L0.903234 10.1355C0.752508 10.3821 0.656925 10.6584 0.623055 10.9455C0.589185 11.2325 0.61783 11.5235 0.707022 11.7984C0.796215 12.0734 0.943839 12.3257 1.13975 12.5381C1.33566 12.7506 1.57521 12.918 1.84195 13.029L2.36879 13.2475C2.52387 13.3107 2.65833 13.4158 2.75715 13.551C2.85597 13.6863 2.91525 13.8464 2.92838 14.0134L2.97204 14.585C2.99511 14.8731 3.08023 15.1527 3.22156 15.4047C3.3629 15.6567 3.55709 15.8751 3.79079 16.0449C4.02449 16.2147 4.29217 16.3318 4.57541 16.3882C4.85865 16.4447 5.15075 16.4391 5.43162 16.3718L5.98757 16.24C6.15078 16.2015 6.32137 16.2083 6.48101 16.2596C6.64064 16.311 6.78327 16.4049 6.89354 16.5313L7.26539 16.9681C7.45339 17.1876 7.68662 17.3638 7.94908 17.4846C8.21153 17.6053 8.497 17.6679 8.78589 17.6679C9.07477 17.6679 9.36024 17.6053 9.62269 17.4846C9.88515 17.3638 10.1184 17.1876 10.3064 16.9681L10.6746 16.5313C10.7848 16.405 10.9273 16.3112 11.0868 16.2599C11.2463 16.2085 11.4167 16.2017 11.5798 16.24L12.1358 16.3718C12.4167 16.4391 12.7088 16.4447 12.992 16.3882C13.2752 16.3318 13.5429 16.2147 13.7766 16.0449C14.0103 15.8751 14.2045 15.6567 14.3458 15.4047C14.4872 15.1527 14.5723 14.8731 14.5954 14.585L14.639 14.0134C14.6523 13.8465 14.7116 13.6866 14.8104 13.5515C14.9093 13.4163 15.0436 13.3113 15.1986 13.2482L15.7255 13.0298C15.8212 12.99 15.9136 12.9428 16.002 12.8885C16.2266 12.7517 16.4221 12.572 16.5772 12.3595C16.7323 12.1471 16.8441 11.9061 16.9061 11.6504C16.968 11.3947 16.979 11.1293 16.9384 10.8694C16.8978 10.6094 16.8063 10.3601 16.6693 10.1355L16.3716 9.64475ZM5.98393 7.35411C5.98393 7.2101 6.02661 7.06933 6.10657 6.94959C6.18653 6.82985 6.30018 6.73653 6.43315 6.68142C6.56611 6.62631 6.71243 6.61189 6.85358 6.63999C6.99474 6.66808 7.1244 6.73743 7.22617 6.83925C7.32794 6.94108 7.39724 7.07082 7.42532 7.21206C7.4534 7.3533 7.43899 7.4997 7.38391 7.63275C7.32884 7.76579 7.23557 7.87951 7.1159 7.95951C6.99623 8.03952 6.85554 8.08222 6.71162 8.08222C6.51862 8.08222 6.33354 8.00551 6.19707 7.86896C6.0606 7.73241 5.98393 7.54722 5.98393 7.35411ZM6.98959 11.7374C6.9397 11.7884 6.88002 11.8288 6.81412 11.8562C6.74822 11.8837 6.67746 11.8974 6.6061 11.8968C6.49941 11.8968 6.39509 11.8653 6.30613 11.8064C6.21718 11.7474 6.14753 11.6636 6.10587 11.5653C6.06421 11.467 6.05237 11.3586 6.07184 11.2537C6.0913 11.1487 6.14121 11.0518 6.21534 10.975L10.5814 6.60634C10.682 6.50598 10.8177 6.44884 10.9596 6.44708C11.1016 6.44531 11.2387 6.49906 11.3417 6.59688C11.4447 6.6947 11.5054 6.82888 11.511 6.97084C11.5166 7.11281 11.4667 7.25137 11.3717 7.35702L11.3513 7.37741L6.98959 11.7374ZM11.0806 11.7148C10.8887 11.7148 10.7044 11.6389 10.5681 11.5036C10.4318 11.3683 10.3545 11.1846 10.353 10.9925V10.9874C10.353 10.8434 10.3956 10.7026 10.4756 10.5829C10.5556 10.4631 10.6692 10.3698 10.8022 10.3147C10.9351 10.2596 11.0814 10.2452 11.2226 10.2733C11.3638 10.3014 11.4934 10.3707 11.5952 10.4725C11.697 10.5744 11.7663 10.7041 11.7943 10.8453C11.8224 10.9866 11.808 11.133 11.7529 11.266C11.6979 11.3991 11.6046 11.5128 11.4849 11.5928C11.3653 11.6728 11.2246 11.7155 11.0806 11.7155",fill:i})),e.createElement("div",{className:"yt-cart-loyalty-apply-details",style:{display:"flex",flexDirection:"column"}},e.createElement(Yo,{className:"yt-loyalty-cta-text",$primaryTextColor:c},0===o?"Insufficient Balance":e.createElement(e.Fragment,null,"Apply "," ",e.createElement("img",{src:n,height:"18px",width:"18px",style:{width:"18px",height:"18px"}}),t<0?0:Number(b.toFixed(2))," ",p??"points"," ")),e.createElement("span",{className:"yt-loyalty-cta-info-text",style:{color:i??"#50D1AA",fontSize:"11px"}},0===o?"Place order to earn coins":e.createElement(e.Fragment,null,"Auto Applied on checkout")))),e.createElement(Go,{$insufficientPoints:y,$opacity:h<d?.2:1,onClick:async()=>{if(!(y||h<d)){f&&f(!0,!1,!1,!0);try{await r()}catch(e){}f&&f(!1,!1,!1,!1)}}},e.createElement(Xo,{className:"yt-loyalty-cta-radio-button",$insufficientPoints:y,$opacity:h<d?.2:1})))},Ko=({value:t,handleItemQuantityDecrement:n,handleItemQuantityIncrement:o,isDev:r,themeColor:i,cartComponentsCornerType:a,cartComponentsCornerRadius:l,backgroundSubdued:c})=>e.createElement("form",{className:"yt-cart-quantity-selector-form",style:{marginBottom:"0px",width:"auto",height:"auto"}},e.createElement("div",{className:"yt-cart-quantity-selector",style:{border:"1px solid #dddddd",display:"flex",flexDirection:"row",borderRadius:"rounded"===a?`${l}px`:"8px",overflow:"hidden"}},e.createElement("button",{className:"yt-cart-quantity-decrement qty-selector-decrement-button",onClick:()=>0!==t&&n(),type:"button",style:{backgroundColor:c??cn(i,.1)}},"-"),e.createElement("input",{readOnly:!0,type:"text","aria-describedby":"helper-text-explanation",className:"yt-cart-quantity-input qty-selector-input",style:{textIndent:0,border:0,margin:0,width:"28px",minHeight:"22px !important",fontSize:"14px",padding:0,height:"auto",textAlign:"center",color:"black !important",background:"#ffffff !important"},value:t,required:!0}),e.createElement("button",{onClick:()=>o(),type:"button",id:"increment-button",className:"yt-cart-quantity-increment qty-selector-decrement-button",style:{backgroundColor:c??cn(i,.1)}},"+"))),Jo=re(void 0),er="yt_variant_options",tr="yt-variant-options-updated",nr=e=>e?e.trim().toLowerCase().replace(/[^a-z0-9#]+/g,""):"",or=()=>{if("undefined"==typeof window)return null;let e=null;try{e=window.localStorage.getItem(er)}catch{return null}return(e=>{if(!e)return null;try{const t=JSON.parse(e);if(Array.isArray(t))return{options:t};if(t&&Array.isArray(t.options))return{options:t.options}}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}return null})(e)},rr=(e,t)=>{if(!e||!t)return;const n=nr(t),o=(e=>{if(!e)return null;const t=e.match(/#([0-9a-f]{3,8})/i);return t?`#${t[1]}`.toLowerCase():null})(t);return e.values.find(e=>{const t=nr(e.name);if(n&&t&&t===n)return!0;if(o&&"string"==typeof e.value){if(e.value.trim().toLowerCase()===o)return!0}return!1})},ir=()=>{const[e,o]=t(null);return n(()=>{const e=()=>{const e=or();o(e)};e();const t=(e=>{if("undefined"==typeof window)return()=>{};const t=t=>{t.key&&t.key!==er||e()},n=()=>e();return window.addEventListener("storage",t),window.addEventListener(tr,n),()=>{window.removeEventListener("storage",t),window.removeEventListener(tr,n)}})(e);return()=>{t()}},[]),e},ar=c.div`
1076
1067
  display: flex;
1077
1068
  flex-wrap: wrap;
1078
1069
  align-items: center;
@@ -1361,7 +1352,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
1361
1352
  padding: 2px 0px 4px 0px;
1362
1353
  border-bottom-left-radius: 8px;
1363
1354
  border-bottom-right-radius: 8px;
1364
- `,Br=({imageUrl:t,overlayText:n,themeColor:o,themeTextColor:r})=>e.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},e.createElement("img",{src:t,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),e.createElement($r,{className:"yt-cart-product-freebie-overlay-text",$themeColor:o,$themeTextColor:r},n)),Nr=({product:o,handleDecrement:i,handleIncrement:a,removeCartItem:l,addCartItem:c,isDev:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:g,showQtySelector:x=!0,themeTextColor:f,showEditOptionOnProducts:y,percentageOff:b,removeFreebieFromCart:h,showDeleteOnFreebies:v,imageAspectSelector:w,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k,backgroundColor:T,showDiscountOnMRP:S,freeLabelText:$})=>{const{setLoading:B}=Jt(),N=ae(Ut),[I,z]=ie(Jo),[F,D]=t(!1),P=le(en),A=ir(),_=!!o.properties?._isYtFreebie,L=!!o.properties?._isStealDeal,M=_&&"number"==typeof o.final_line_price&&o.final_line_price>0&&"number"==typeof o.original_line_price&&o.original_line_price>o.final_line_price;n(()=>{function e(){const e=window.innerWidth;D(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const V=r(null),[j,W]=t(0);n(()=>{let e=null;return V.current&&(e=new ResizeObserver(e=>{e[0]&&W(e[0].contentRect.width)}),e.observe(V.current)),()=>{e&&e.disconnect()}},[]),n(()=>{const e=setTimeout(()=>{V.current&&W(V.current.offsetWidth)},100);return()=>clearTimeout(e)},[]);const H=an(o.product_title,j<200?100:120,j,"","16px"),q=()=>{if(o.line_level_discount_allocations&&o.line_level_discount_allocations.length>0&&o.line_level_discount_allocations[0].discount_application){const e=o.line_level_discount_allocations[0].discount_application.title,t=xn(e);switch(o.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${t})`;case"percentage":case"fixed_amount":return t;default:return""}}};let Q=on(N,N?.currency);const U=["__Added with Frequently Bought Together button","_has_gpo","_y"],Y=o?.options_with_values&&o.options_with_values.filter(e=>"Title"!==e.name).length>0||o?.properties&&Object.keys(o.properties).filter(e=>!U.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).length>0||y,G=j?70/j*100:100,X=q(),Z=X&&(X.length>25||!F)?an(X,G,j,"","10px"):X,K=(()=>{const e=o?.properties?._bundleImage;if(!e||"string"!=typeof e)return;const t=e.trim();return t.length>0?t:void 0})(),J=!!K,ne=(()=>{const e=o?.properties?.itemsInBundle;return"string"!=typeof e?[]:e.split(/,\s*/).map(e=>e.trim()).filter(e=>e.length>0)})(),oe=(()=>{const e=o?.properties?._bundleItems;if("string"==typeof e&&e.trim().length>0)try{const t=JSON.parse(e);if(Array.isArray(t)){const e=t.reduce((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)},0);if(e>0)return e}}catch(e){}let t=0;for(const e of ne){const n=e.match(/^(\d+)\s*x\s*/i);t+=n?parseInt(n[1],10)||0:1}return t})(),re=(()=>{try{const e=Number(o?.compare_at_price),t=Number(o?.quantity)||1;if(Number.isFinite(e)&&e>0)return e*t}catch(e){}return null})(),[ce,se]=t(!0),de=F?"250px":"190px";return e.createElement(ur,{className:"yt-cart-product-card",$hasVariantInfo:Y||J,$backgroundColor:T,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem"}},e.createElement("a",{href:`${window.location.origin}${o.url}`,style:{textDecoration:"none",display:"contents"}},e.createElement(gr,{className:"yt-cart-product-image-wrapper",$isBundle:J},e.createElement(mr,{className:"yt-cart-product-image",$imageAspectSelector:w,$isBundle:J},x?e.createElement("img",{style:{height:"100%",width:"100%",opacity:0===o.quantity?.5:1},src:gn(K??o.image,200,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(o),loading:"lazy"}):e.createElement(Br,{imageUrl:gn(K??o.image??o?.featuredImage?.url??"/placeholder.svg",200,85,"webp"),overlayText:L?"Steal Deal":M||b?"Special Offer":"Free Gift",themeColor:d,themeTextColor:f})),(x||o?.quantity>1)&&e.createElement(xr,{className:"yt-cart-product-quantity-badge"},o.quantity))),e.createElement("div",{className:"yt-cart-product-details",style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},e.createElement("div",{className:"yt-cart-product-header",style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},e.createElement(pr,{className:"yt-cart-product-title",$themeColor:d,$primaryTextColor:p,href:`${window.location.origin}${o.url}`,ref:V},H),e.createElement("div",{className:"yt-cart-product-actions",style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(x||v)&&e.createElement(br,{onClick:x?async()=>{B&&B(!0,!0);try{l&&await l(o.key)}catch(e){}B&&B(!1,!1)}:async()=>{B&&B(!0,!0);try{h&&await h(o.key)}catch(e){}B&&B(!1,!1)}},e.createElement(fr,null,e.createElement(ee,{className:"outline"}),e.createElement(te,{className:"filled"})))))),J?e.createElement("div",{className:"yt-cart-product-bundle-info",style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement("div",{className:"yt-cart-product-bundle-toggle",role:"button",onClick:()=>se(!ce),style:{display:"inline-flex",alignItems:"center",gap:"8px",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"4px 6px",width:"fit-content",cursor:"pointer",userSelect:"none",fontSize:"12px",fontWeight:600,color:u??"#1a1a1a"}},e.createElement("span",null,`Contain ${oe} Items`),ce?e.createElement(R,null):e.createElement(O,null)),ce&&ne.length>0&&e.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:de,width:"fit-content"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:de}},ne.map((t,n)=>e.createElement("div",{key:`${t}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:de},title:t},t))))):Y&&e.createElement("div",{className:"yt-cart-product-variant-info",style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement(ar,{className:"yt-cart-product-variant-container"},o?.options_with_values?.filter(e=>"Title"!==e.name).map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=rr(n,t.value);return"color"===n?.type?.toLowerCase()&&o?e.createElement(lr,{key:t.name,$colorValue:o.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&o?e.createElement(cr,{key:t.name,src:gn(o.value,36,85,"webp"),alt:t.value}):t.value.length>15||t.value.includes("#")?null:e.createElement(yr,{className:"yt-cart-variant-text",key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},t.value)}),o?.properties&&Object.entries(o.properties).filter(([e])=>!U.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).map(([t,n])=>{const o=String(n);return o.includes("#")||(A?.options??[]).some(e=>e.name.trim().toLowerCase()===t.trim().toLowerCase()&&e.values.some(e=>e.name.trim().toLowerCase()===o.trim().toLowerCase()))?null:e.createElement(yr,{key:t,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},o)}),y&&!o?.product_has_only_default_variant&&e.createElement(br,{onClick:()=>{const e=!!o.properties?._isYtFreebie;let t;if(e){const e=o.properties?._yt_allowed_variants;if(e&&"string"==typeof e)try{t=JSON.parse(e)}catch(n){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${o.key}:`,e,n),t=[String(o.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${o.key}. Defaulting to current variant.`),t=[String(o.variant_id)]}P({open:!0,variantId:String(o.variant_id),quantity:o.quantity,handle:o.handle,lineItemKey:o.key,freebieSelection:e,productId:String(o.product_id),allowedVariantIds:t})},style:{display:"flex",alignItems:"center"}},e.createElement(Ne,null))),o?.options_with_values?.filter(e=>"Title"!==e.name&&e.value.length>15).map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());if(rr(n,t.value)&&["color","image"].includes((n?.type??"").toLowerCase()))return null;if(t.value.includes("#"))return null;const o=F?t.value:an(t.value,j?120/j*100:100,j,"","10px");return e.createElement(yr,{key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px",width:"fit-content"}},o)})),e.createElement(hr,{className:"yt-cart-product-bottom-row"},e.createElement("div",{className:"yt-cart-product-pricing-row",style:{display:"flex",flexDirection:F?"row":"column",alignItems:F?"center":"flex-start",gap:F?"0px":"4px"}},e.createElement(vr,{className:"yt-cart-product-price-container"},J?e.createElement(e.Fragment,null,e.createElement(wr,{$primaryTextColor:p},Q,un(tn(o.final_line_price,N?.currency))),re&&re>Number(o.final_line_price)&&S&&e.createElement(Cr,null,Q,un(tn(re,N?.currency)))):e.createElement(wr,{$primaryTextColor:p},0===tn(o.final_line_price,N?.currency)?e.createElement(Sr,{$primaryColor:p,$themeColor:d,$backgroundSubdued:k},$||"FREE"):e.createElement(e.Fragment,null,Q,un(tn(o.final_line_price,N?.currency)))),!J&&(o.compare_at_price&&Number(o.compare_at_price)*o.quantity>Number(o.final_line_price)||!o.compare_at_price&&q()&&o.original_line_price)&&S&&e.createElement(Cr,null,Q,o.compare_at_price?un(tn(Number(o.compare_at_price)*o.quantity,N?.currency)):un(tn(o.original_line_price,N?.currency))),F&&(x||M)&&q()&&e.createElement(kr,{className:"yt-cart-product-discount",$tertiaryColor:m},e.createElement(Ee,{size:14,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},Z))),!F&&(x||M)&&q()&&e.createElement(kr,{className:"yt-cart-product-discount",$tertiaryColor:m},e.createElement(Ee,{size:12,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},Z))),e.createElement(Er,{className:"yt-cart-product-quantity-controls"},x?e.createElement(Ko,{handleItemQuantityDecrement:async()=>{B&&B(!0,!0);try{i&&await i(o.key,o.quantity-1)}catch(e){}B&&B(!1,!1)},handleItemQuantityIncrement:async()=>{B&&B(!0,!0);try{if(a){-1===await a(o.id,o.quantity+1,o.properties)&&(z(o?.key),setTimeout(()=>z(void 0),3e3))}}catch(e){}B&&B(!1,!1)},value:o.quantity,isDev:s,themeColor:d,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k}):!L||M||b?e.createElement("span",{className:"yt-cart-line-item-freebie-badge",style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:g??"#000",borderRadius:"4px"}},M&&o.original_line_price?`${((o.original_line_price-o.final_line_price)/o.original_line_price*100).toFixed(0)}% off`:b&&o?.properties?._isYtFreebie?`${b}% Off`:"Freebie"):null)),I&&I===o?.key&&e.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))},Ir=c.div`
1355
+ `,Br=({imageUrl:t,overlayText:n,themeColor:o,themeTextColor:r})=>e.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},e.createElement("img",{src:t,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),e.createElement($r,{className:"yt-cart-product-freebie-overlay-text",$themeColor:o,$themeTextColor:r},n)),Nr=({product:o,handleDecrement:i,handleIncrement:a,removeCartItem:l,addCartItem:c,isDev:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:g,showQtySelector:x=!0,themeTextColor:f,showEditOptionOnProducts:y,percentageOff:b,removeFreebieFromCart:h,showDeleteOnFreebies:v,imageAspectSelector:w,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k,backgroundColor:T,showDiscountOnMRP:S,freeLabelText:$})=>{const{setLoading:B}=Jt(),N=ae(Ut),[I,z]=ie(Jo),[F,D]=t(!1),P=le(en),A=ir(),_=!!o.properties?._isYtFreebie,L=!!o.properties?._isStealDeal,M=_&&"number"==typeof o.final_line_price&&o.final_line_price>0&&"number"==typeof o.original_line_price&&o.original_line_price>o.final_line_price;n(()=>{function e(){const e=window.innerWidth;D(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const V=r(null),[j,W]=t(0);n(()=>{let e=null;return V.current&&(e=new ResizeObserver(e=>{e[0]&&W(e[0].contentRect.width)}),e.observe(V.current)),()=>{e&&e.disconnect()}},[]),n(()=>{const e=setTimeout(()=>{V.current&&W(V.current.offsetWidth)},100);return()=>clearTimeout(e)},[]);const H=an(o.product_title,j<200?100:120,j,"","16px"),q=()=>{if(o.line_level_discount_allocations&&o.line_level_discount_allocations.length>0&&o.line_level_discount_allocations[0].discount_application){const e=o.line_level_discount_allocations[0].discount_application.title,t=xn(e);switch(o.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${t})`;case"percentage":case"fixed_amount":return t;default:return""}}};let Q=on(N,N?.currency);const U=["__Added with Frequently Bought Together button","_has_gpo","_y"],Y=o?.options_with_values&&o.options_with_values.filter(e=>"Title"!==e.name).length>0||o?.properties&&Object.keys(o.properties).filter(e=>!U.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).length>0||y,G=j?70/j*100:100,X=q(),Z=X&&(X.length>25||!F)?an(X,G,j,"","10px"):X,K=(()=>{const e=o?.properties?._bundleImage;if(!e||"string"!=typeof e)return;const t=e.trim();return t.length>0?t:void 0})(),J=!!K,ne=(()=>{const e=o?.properties?.itemsInBundle;return"string"!=typeof e?[]:e.split(/,\s*/).map(e=>e.trim()).filter(e=>e.length>0)})(),oe=(()=>{const e=o?.properties?._bundleItems;if("string"==typeof e&&e.trim().length>0)try{const t=JSON.parse(e);if(Array.isArray(t)){const e=t.reduce((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)},0);if(e>0)return e}}catch(e){}let t=0;for(const e of ne){const n=e.match(/^(\d+)\s*x\s*/i);t+=n?parseInt(n[1],10)||0:1}return t})(),re=(()=>{try{const e=Number(o?.compare_at_price),t=Number(o?.quantity)||1;if(Number.isFinite(e)&&e>0)return e*t}catch(e){}return null})(),[ce,se]=t(!0),de=F?"250px":"190px";return e.createElement(ur,{className:"yt-cart-product-card",$hasVariantInfo:Y||J,$backgroundColor:T,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem"}},e.createElement("a",{href:`${window.location.origin}${o.url}`,style:{textDecoration:"none",display:"contents"}},e.createElement(gr,{className:"yt-cart-product-image-wrapper",$isBundle:J},e.createElement(mr,{className:"yt-cart-product-image",$imageAspectSelector:w,$isBundle:J},x?e.createElement("img",{style:{height:"100%",width:"100%",opacity:0===o.quantity?.5:1},src:gn(K??o.image,200,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(o),loading:"lazy"}):e.createElement(Br,{imageUrl:gn(K??o.image??o?.featuredImage?.url??"/placeholder.svg",200,85,"webp"),overlayText:L?"Steal Deal":M||b?"Special Offer":"Free Gift",themeColor:d,themeTextColor:f})),(x||o?.quantity>1)&&e.createElement(xr,{className:"yt-cart-product-quantity-badge"},o.quantity))),e.createElement("div",{className:"yt-cart-product-details",style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},e.createElement("div",{className:"yt-cart-product-header",style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},e.createElement(pr,{className:"yt-cart-product-title",$themeColor:d,$primaryTextColor:p,href:`${window.location.origin}${o.url}`,ref:V},H),e.createElement("div",{className:"yt-cart-product-actions",style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(x||v)&&e.createElement(br,{onClick:x?async()=>{B&&B(!0,!0);try{l&&await l(o.key)}catch(e){}B&&B(!1,!1)}:async()=>{B&&B(!0,!0);try{h&&await h(o.key)}catch(e){}B&&B(!1,!1)}},e.createElement(fr,null,e.createElement(ee,{className:"outline"}),e.createElement(te,{className:"filled"})))))),J?e.createElement("div",{className:"yt-cart-product-bundle-info",style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement("div",{className:"yt-cart-product-bundle-toggle",role:"button",onClick:()=>se(!ce),style:{display:"inline-flex",alignItems:"center",gap:"8px",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"4px 6px",width:"fit-content",cursor:"pointer",userSelect:"none",fontSize:"12px",fontWeight:600,color:u??"#1a1a1a"}},e.createElement("span",null,`Contain ${oe} Items`),ce?e.createElement(R,null):e.createElement(O,null)),ce&&ne.length>0&&e.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:de,width:"fit-content"}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:de}},ne.map((t,n)=>e.createElement("div",{key:`${t}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:de},title:t},t))))):Y&&e.createElement("div",{className:"yt-cart-product-variant-info",style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},e.createElement(ar,{className:"yt-cart-product-variant-container"},o?.options_with_values?.filter(e=>"Title"!==e.name).map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=rr(n,t.value);return"color"===n?.type?.toLowerCase()&&o?e.createElement(lr,{key:t.name,$colorValue:o.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&o?e.createElement(cr,{key:t.name,src:gn(o.value,36,85,"webp"),alt:t.value}):t.value.length>15||t.value.includes("#")?null:e.createElement(yr,{className:"yt-cart-variant-text",key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},t.value)}),o?.properties&&Object.entries(o.properties).filter(([e])=>!U.includes(e)&&!e.startsWith("_")&&!e.startsWith("__")).map(([t,n])=>{const o=String(n);return o.includes("#")||(A?.options??[]).some(e=>e.name.trim().toLowerCase()===t.trim().toLowerCase()&&e.values.some(e=>e.name.trim().toLowerCase()===o.trim().toLowerCase()))?null:e.createElement(yr,{key:t,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},o)}),y&&!o?.product_has_only_default_variant&&e.createElement(br,{onClick:()=>{const e=!!o.properties?._isYtFreebie;let t;if(e){const e=o.properties?._yt_allowed_variants;if(e&&"string"==typeof e)try{t=JSON.parse(e)}catch(n){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${o.key}:`,e,n),t=[String(o.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${o.key}. Defaulting to current variant.`),t=[String(o.variant_id)]}P({open:!0,variantId:String(o.variant_id),quantity:o.quantity,handle:o.handle,lineItemKey:o.key,freebieSelection:e,productId:String(o.product_id),allowedVariantIds:t})},style:{display:"flex",alignItems:"center"}},e.createElement(ze,null))),o?.options_with_values?.filter(e=>"Title"!==e.name&&e.value.length>15).map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());if(rr(n,t.value)&&["color","image"].includes((n?.type??"").toLowerCase()))return null;if(t.value.includes("#"))return null;const o=F?t.value:an(t.value,j?120/j*100:100,j,"","10px");return e.createElement(yr,{key:t.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px",width:"fit-content"}},o)})),e.createElement(hr,{className:"yt-cart-product-bottom-row"},e.createElement("div",{className:"yt-cart-product-pricing-row",style:{display:"flex",flexDirection:F?"row":"column",alignItems:F?"center":"flex-start",gap:F?"0px":"4px"}},e.createElement(vr,{className:"yt-cart-product-price-container"},J?e.createElement(e.Fragment,null,e.createElement(wr,{$primaryTextColor:p},Q,un(tn(o.final_line_price,N?.currency))),re&&re>Number(o.final_line_price)&&S&&e.createElement(Cr,null,Q,un(tn(re,N?.currency)))):e.createElement(wr,{$primaryTextColor:p},0===tn(o.final_line_price,N?.currency)?e.createElement(Sr,{$primaryColor:p,$themeColor:d,$backgroundSubdued:k},$||"FREE"):e.createElement(e.Fragment,null,Q,un(tn(o.final_line_price,N?.currency)))),!J&&(o.compare_at_price&&Number(o.compare_at_price)*o.quantity>Number(o.final_line_price)||!o.compare_at_price&&q()&&o.original_line_price)&&S&&e.createElement(Cr,null,Q,o.compare_at_price?un(tn(Number(o.compare_at_price)*o.quantity,N?.currency)):un(tn(o.original_line_price,N?.currency))),F&&(x||M)&&q()&&e.createElement(kr,{className:"yt-cart-product-discount",$tertiaryColor:m},e.createElement(Te,{size:14,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},Z))),!F&&(x||M)&&q()&&e.createElement(kr,{className:"yt-cart-product-discount",$tertiaryColor:m},e.createElement(Te,{size:12,color:g}),e.createElement(Tr,{$tertiaryTextColor:g},Z))),e.createElement(Er,{className:"yt-cart-product-quantity-controls"},x?e.createElement(Ko,{handleItemQuantityDecrement:async()=>{B&&B(!0,!0);try{i&&await i(o.key,o.quantity-1)}catch(e){}B&&B(!1,!1)},handleItemQuantityIncrement:async()=>{B&&B(!0,!0);try{if(a){-1===await a(o.id,o.quantity+1,o.properties)&&(z(o?.key),setTimeout(()=>z(void 0),3e3))}}catch(e){}B&&B(!1,!1)},value:o.quantity,isDev:s,themeColor:d,cartComponentsCornerType:C,cartComponentsCornerRadius:E,backgroundSubdued:k}):!L||M||b?e.createElement("span",{className:"yt-cart-line-item-freebie-badge",style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:g??"#000",borderRadius:"4px"}},M&&o.original_line_price?`${((o.original_line_price-o.final_line_price)/o.original_line_price*100).toFixed(0)}% off`:b&&o?.properties?._isYtFreebie?`${b}% Off`:"Freebie"):null)),I&&I===o?.key&&e.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))},Ir=c.div`
1365
1356
  margin: 8px 0 6px 0;
1366
1357
  padding: 12px;
1367
1358
  background: ${e=>e.$backgroundColor??"rgba(0,0,0,0.04)"};
@@ -1398,7 +1389,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
1398
1389
  border-bottom: 0.8px solid rgb(135 135 135 / 50%);
1399
1390
  width: calc(100% + 2rem);
1400
1391
  }
1401
- `,Pr=({addCartItem:t,handleDecrement:n,handleIncrement:o,removeCartItem:r,isDev:i,themeColor:a,primaryTextColor:l,secondaryTextColor:c,freeProduct:s,themeTextColor:d,showEditOptionOnProducts:p,productPercentageOffMapping:u,removeFreebieFromCart:m,showDeleteOnFreebies:g,freeProductAdjustedCartTotal:x,freebieCouponTemplates:f,cartCheckpoints:y,freebieFlowCheckpoints:b,imageAspectSelector:h,cartComponentsCornerType:v,cartComponentsCornerRadius:w,giftWrapProductId:C,giftWrapVariantId:E,showGiftWrapAsLineItem:k=!1,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:N,checkoutSectionMessage:I,checkoutSectionMessageRedirectLink:z,showFreebieMilestone:F,freebieMilestoneData:D,freeLabelText:P})=>{const A=ae(Ut),{cartLoading:_}=Jt(),R=!_.cartLoading&&A?.items,O=(x??Number(A?.items_subtotal_price))/100;let L=!0,M=0;if(A?.items?.length>0)for(const e of A.items)e?.properties?._isYtFreebie&&(M+=e?.quantity);if(M===A?.item_count&&(L=!1),!R&&0===A?.item_count)return e.createElement(Fr,null);if(!(R&&0!==A?.item_count||A?.items))return null;const V=D?.campaignFilter??"all_campaigns";let j=[];"all_campaigns"===V?j=f??[]:"progress_bar_tiers"===V?j=y??[]:"freebie_campaigns"===V&&(j=b??[]);const W=Array.isArray(j)?j.filter(e=>"free_product"===e?.couponType).slice().sort((e,t)=>e.minimumOrderValue-t.minimumOrderValue).find(e=>e.minimumOrderValue>O):void 0,H=on(A,A?.currency);return e.createElement(e.Fragment,null,A.items.filter(e=>!!k||!(String(e?.id)===dn(String(C))||String(e?.id)===dn(String(E)))).map(s=>{const x=u?.[s?.key],y=f?.find(e=>e?._allVariantIds?.includes(String(s.id)));let b=!1;if(y&&O>=y.minimumOrderValue&&0===s?.line_price&&(b=!0),!k&&(String(s?.id)===dn(String(C))||dn(String(E))===String(s?.id)))return null;const I=s.discounts&&s.discounts.length>0;return s.properties?._isYtFreebie&&(x||b)&&I&&L?e.createElement(e.Fragment,null,e.createElement(Dr,{className:"yt-cart-product-card-wrapper",key:s?.key??s?.id},e.createElement(Nr,{product:s,themeColor:a,isDev:i,primaryTextColor:l,secondaryTextColor:c,themeTextColor:d,showQtySelector:!1,showEditOptionOnProducts:p,percentageOff:x,imageAspectSelector:h,showDeleteOnFreebies:g,removeFreebieFromCart:m,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:!0,freeLabelText:P}))):e.createElement(Dr,{className:"yt-cart-product-card-wrapper",key:s?.key??s?.id},e.createElement(Nr,{themeColor:a,handleDecrement:n,handleIncrement:o,removeCartItem:r,addCartItem:t,product:s,isDev:i,primaryTextColor:l,secondaryTextColor:c,showQtySelector:!s.properties?._isYtFreebie,showEditOptionOnProducts:p,removeFreebieFromCart:m,showDeleteOnFreebies:g,imageAspectSelector:h,cartComponentsCornerRadius:w,cartComponentsCornerType:v,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:N,freeLabelText:P}))}),F&&L&&W&&e.createElement(zr,{name:W.name,minimumOrderValue:W.minimumOrderValue,currency:H,themeColor:a,tertiaryColor:S,imageUrl:D?.milestoneImage?.path}),mn()&&I&&I.length>0?e.createElement("div",{className:"yt-cart-checkout-message yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:S,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:$,marginBottom:"4px",cursor:z?"pointer":"default"},onClick:()=>{z&&(window.location.href=z)}},I):e.createElement("div",{className:"yt-cart-products-list-separator",style:{display:"list-item",height:"12px",background:"#87878717"}}))};const Ar=({bundleProducts:t})=>{const n=ae(Ut);return e.createElement("div",{className:"yt-cart-bundle-container flex flex-col gap-y-2"},e.createElement("div",{className:"yt-cart-bundle-title flex items-center justify-center"},e.createElement("span",{className:"font-semibold"},"Save more with Bundle!")),e.createElement("div",{className:"yt-cart-bundle-products flex items-center justify-center gap-2 relative"},e.createElement("div",{className:"yt-cart-bundle-product-card w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[0].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[0].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[0].price)),t[0]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[1].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[1].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[1].price)),t[1]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"yt-cart-bundle-plus-icon absolute",style:{left:"50%",transform:"translateX(-50%)"}},e.createElement("img",{src:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="17.2797" cy="18.7208" r="15.5219" fill="#3A3A3A" stroke="#767676" stroke-width="1.51433"/>\n<path d="M15.5903 25.9172V12.1037H19.0827V25.9172H15.5903ZM10.4297 20.7566V17.2642H24.2433V20.7566H10.4297Z" fill="white"/>\n</svg>',alt:"Delivery Truck",height:"25px",width:"42px"}))),e.createElement("div",{className:"yt-cart-bundle-pricing flex flex-row justify-between items-center"},e.createElement("div",{className:"flex flex-row gap-x-4 items-center"},e.createElement("span",{className:"text-[#667085] text-[13px]"},"Total Price"),e.createElement("span",null,e.createElement("span",{className:"font-bold text-black"},on(n,n?.currency),t[0].price+t[1].price)," ",e.createElement("span",{className:"text-[#868E96] text-[12px] line-through"},on(n,n?.currency),t[0].original_price+t[1].original_price))),e.createElement("span",{className:"text-[#1ADF5D] text-[10px]"},"save extra"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].original_price-t[0].price+(t[1].original_price-t[1].price)))),e.createElement("button",{className:"yt-cart-bundle-buy-button flex flex-row items-center bg-[#333333] gap-x-3 justify-center w-full py-1.5"},e.createElement(ct,{color:"white"}),e.createElement("span",{className:"text-white uppercase text-[14px]"},"Buy Bundle at"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].price+t[1].price))))},_r=({backgroundSubdued:o,themeColor:i,themeTextColor:a,primaryTextColor:l,cartComponentsCornerRadius:c,applyCouponCode:s,removeDiscount:d,enableConfetti:p,hideAppliedCodes:u})=>{const m=ae(Ut),[g,x]=t(""),[f,y]=t(null),[b,h]=t(!1),[v,w]=t(!1),[C,E]=t(!1),{setLoading:k}=Jt(),[T,S]=t(null),[$,B]=t(!1),[N,I]=t(!1),z=r(null);n(()=>{if(T){B(!0);const e=setTimeout(()=>{B(!1)},4e3),t=setTimeout(()=>{S(null)},4500);return()=>{clearTimeout(e),clearTimeout(t)}}B(!1)},[T]),n(()=>{if(m&&m.discount_codes&&f){const e=m.discount_codes.find(e=>e.code===f);e&&(e.applicable?(S({message:"Coupon applied successfully!",type:"success"}),p&&(I(!0),setTimeout(()=>I(!1),5e3))):S({message:"Coupon not applicable",type:"error"}),y(null))}},[m,f]);const F=async()=>{if(s&&g&&!b){S(null),h(!0),y(g);try{await s(g),x("")}catch(e){S({message:"Failed to apply coupon.",type:"error"}),y(null)}finally{h(!1)}}},D=async()=>{if(d&&!C){S(null),E(!0),k&&k(!0,!1,!1,!0);try{await d()}catch(e){S({message:"Failed to remove coupon.",type:"error"})}finally{k&&k(!1,!1,!1,!1),E(!1)}}},P="error"===T?.type,A=m?.discount_codes?.filter(e=>!1!==e?.applicable);return e.createElement("div",{className:"yt-cart-apply-container",ref:z,style:{marginTop:"10px",padding:"0 16px",marginBottom:"10px"}},N&&p&&e.createElement(vo,{particleCount:100,spread:160,origin:{y:.6},checkpointPosition:.5}),e.createElement("div",{className:"yt-cart-apply-input-wrapper",style:{display:"flex",alignItems:"stretch",border:P?"0.5px solid #FF4E4E":v?`1px solid ${i||"#007bff"}`:"1px solid #e0e0e0",borderRadius:c??4,transition:"border-color 0.5s ease-in-out",overflow:"hidden"}},e.createElement("input",{className:"yt-cart-apply-input",type:"text",placeholder:"Have a Coupon Code?",value:g,disabled:b,onFocus:()=>{w(!0),setTimeout(()=>{z.current&&window.innerWidth<=768&&z.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300)},onBlur:()=>w(!1),onChange:e=>{x(e.target.value),T&&S(null)},onKeyDown:e=>{"Enter"===e.key&&F()},style:{flexGrow:1,border:"none",padding:"10px",outline:"none",fontSize:"14px",fontWeight:"bold",borderTopLeftRadius:c??4,borderBottomLeftRadius:c??4,backgroundColor:o,color:l,boxShadow:"none",cursor:b?"not-allowed":"auto",margin:"0"}}),e.createElement("button",{className:"yt-cart-apply-button",onClick:F,disabled:!g||b,style:{padding:"10px 15px",border:"none",backgroundColor:P?"#D98181":g?i||"#007bff":"#cccccc",color:g||P?a||"#ffffff":"#666666",cursor:!g||b?"not-allowed":"pointer",fontSize:"14px",fontWeight:"bold",borderTopRightRadius:c??4,borderBottomRightRadius:c??4,transition:"background-color 0.5s ease-in-out, opacity 0.2s ease-in-out",minWidth:"80px",display:"flex",justifyContent:"center",alignItems:"center",opacity:b?.7:1}},b?e.createElement(rt,{color:a||"#ffffff",size:18}):"Apply")),T&&e.createElement("div",{className:"yt-cart-apply-status",style:{color:"success"===T.type?"#28a745":"#dc3545",fontSize:"12px",marginTop:"4px",fontStyle:"italic",transition:"opacity 0.5s ease-in-out, transform 0.5s ease-in-out, max-height 0.5s ease-in-out",opacity:$?1:0,transform:$?"translateY(0)":"translateY(-10px)",maxHeight:$?"50px":"0",overflow:"hidden"}},T.message),!u&&A&&A.length>0&&e.createElement("div",{className:"yt-cart-apply-applied-list",style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"8px"}},A.map(t=>e.createElement("div",{className:"yt-cart-apply-applied-item",key:t.code,style:{display:"flex",alignItems:"center",fontSize:"12px",fontStyle:"italic"}},e.createElement("div",{className:"yt-cart-apply-applied-badge",style:{display:"flex",alignItems:"center",color:"#333333",backgroundColor:o,paddingInlineStart:"6px",gap:"4px"}},e.createElement(Ke,{size:12,color:"#4D4D4D"}),e.createElement("span",{style:{fontWeight:"bold",fontStyle:"normal"}},t.code)," applied!",e.createElement("button",{className:"yt-cart-apply-remove-button",onClick:D,disabled:C,style:{background:"#E2E2E2",border:"0.5px solid #B5B5B5",cursor:"pointer",marginLeft:"4px",padding:"0",display:"flex",alignItems:"center"}},C?e.createElement(rt,{color:i||"#007bff",size:14}):e.createElement(be,{size:16})))))))},Rr="yt-coupon-selection-animations",Or=({rewardCoupons:o,applyCouponCode:r,removeDiscount:i,enableConfetti:a,backgroundSubdued:l,themeColor:c,themeTextColor:s,primaryTextColor:d,cartComponentsCornerRadius:p})=>{const u=ae(Ut),[m,g]=t(!1),[x,f]=t(!1),[y,b]=t(null),[h,v]=t(null),[w,C]=t(!1),[E,k]=t(null);n(()=>{(()=>{if(document.getElementById(Rr))return;const e=document.createElement("style");e.id=Rr,e.textContent="\n @keyframes ytSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes ytSlideDown {\n from { transform: translateY(0); }\n to { transform: translateY(100%); }\n }\n @keyframes ytSuccessPulse {\n 0% { box-shadow: 0 0 0 0 rgba(46,125,50,0.4); }\n 50% { box-shadow: 0 0 0 8px rgba(46,125,50,0); }\n 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); }\n }\n @keyframes ytCheckFade {\n 0% { opacity: 0; transform: scale(0.5); }\n 50% { opacity: 1; transform: scale(1.2); }\n 100% { opacity: 1; transform: scale(1); }\n }\n ",document.head.appendChild(e)})()},[]);const T=u?.discount_codes?.filter(e=>!1!==e?.applicable),S=T?.[0],$=h?o.find(e=>e.couponTemplateId===h):null,B=o;n(()=>{const e=u?.discount_codes?.filter(e=>!1!==e?.applicable)??[];if(null!==h){const t=o.find(e=>e.couponTemplateId===h);return void(t&&e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase())||v(null))}if(e.length>0){const t=o.find(t=>e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase()));t&&v(t.couponTemplateId)}},[u?.discount_codes,o,h]),n(()=>{if(m){window.history.pushState({couponSelectionOpen:!0},"");const e=()=>I();return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)}},[m]);const N=()=>{f(!1),g(!0)},I=()=>{f(!0),setTimeout(()=>{g(!1),f(!1)},280)},z=async()=>{if(i&&!w){C(!0);try{await i(),v(null)}catch(e){console.error("Failed to remove coupon:",e)}finally{C(!1)}}},F=()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved extra ${$.discountPercentage}% off`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved extra ₹${$.discountValue} off`}return""},D=(t,n=!1)=>{const o=y===t.couponTemplateId,i=E===t.couponTemplateId,a=!n&&!1===t.isEligible;return e.createElement("div",{className:`yt-cart-coupon-selection-card${n?" yt-cart-coupon-selection-card-selected":""}${a?" yt-cart-coupon-selection-card-ineligible":""}`,key:t.couponTemplateId,style:{border:n?`1.5px solid ${c||"#4A7C59"}`:"1px solid #E8E8E8",borderRadius:p??8,overflow:"hidden",marginBottom:"12px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px rgba(0,0,0,0.06)",animation:i?"ytSuccessPulse 0.6s ease-out":void 0,transition:"border-color 0.3s ease, box-shadow 0.3s ease"}},e.createElement("div",{className:"yt-cart-coupon-selection-card-body",style:{padding:"14px 16px",background:"linear-gradient(135deg, #FFFFFF 60%, #FFF5F5 100%)",position:"relative"}},i&&e.createElement("div",{className:"yt-cart-coupon-selection-card-checkmark",style:{position:"absolute",top:"10px",right:"10px",width:24,height:24,borderRadius:"50%",backgroundColor:"#2E7D32",display:"flex",alignItems:"center",justifyContent:"center",animation:"ytCheckFade 0.4s ease-out forwards"}},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:700}},"✓")),e.createElement("div",{className:"yt-cart-coupon-selection-card-header",style:{display:"flex",alignItems:"flex-start",gap:"10px"}},e.createElement("div",{className:"yt-cart-coupon-selection-card-icon",style:{width:32,height:32,borderRadius:4,backgroundColor:"#FDE8E8",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},e.createElement(ne,{size:18,color:a?"#6b7280":"#8B0000"})),e.createElement("div",{className:"yt-cart-coupon-selection-card-text",style:{flex:1}},e.createElement("div",{className:"yt-cart-coupon-selection-card-title",style:{fontSize:"14px",fontWeight:600,color:d||"#1A1A1A",marginBottom:"2px"}},(e=>"percentage_discount_coupon"===e.couponType&&e.discountPercentage?`Get an additional ${e.discountPercentage}% off`:"fixed_amount_coupon"===e.couponType&&e.discountValue?`Get an additional ₹${e.discountValue} off`:e.name)(t)),e.createElement("div",{className:"yt-cart-coupon-selection-card-subtitle",style:{fontSize:"12px",color:a?"#6b7280":"#2E7D32",fontWeight:500}},(e=>{if("minimum_quantity"===e.customCartProgressBarCriteria){if(e.quantityThreshold)return`On orders with ${e.quantityThreshold}+ items.`}else if(e.minimumOrderValue)return`On purchases above ₹${e.minimumOrderValue.toLocaleString("en-IN")}.`;return""})(t)))),e.createElement("div",{className:"yt-cart-coupon-selection-code-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"12px",border:"1px solid #E0E0E0",borderRadius:p??6,padding:"8px 12px",backgroundColor:"#FAFAFA"}},e.createElement("span",{className:"yt-cart-coupon-selection-code",style:{fontSize:"14px",fontWeight:700,color:d||"#1A1A1A",letterSpacing:"0.5px"}},t.name),e.createElement("button",{className:"yt-cart-coupon-selection-action",onClick:e=>{e.stopPropagation(),n?z():(async e=>{if(null===y){b(e.couponTemplateId);try{r&&e.name&&await r(e.name),v(e.couponTemplateId),k(e.couponTemplateId),setTimeout(()=>{k(null),I()},1200)}catch(e){console.error("Failed to collect coupon:",e)}finally{b(null)}}})(t)},disabled:o||w||a,style:{background:"none",border:"none",color:a?"#6b7280":"#8B0000",fontSize:"14px",fontWeight:600,cursor:o||w||a?"not-allowed":"pointer",padding:0,display:"flex",alignItems:"center",gap:"4px"}},o||n&&w?e.createElement(rt,{color:"#8B0000",size:14}):n?"Remove":"Collect"))),e.createElement("div",{className:"yt-cart-coupon-selection-applicability",style:{padding:"6px 16px",fontSize:"11px",fontWeight:500,textAlign:"center",backgroundColor:"#FFF0F0",color:a?"#6b7280":"#8B0000",borderTop:"1px solid '#FECACA'"}},(e=>{const t=e.resolvedCollectionNames;return t&&t.length>0?1===t.length?`Applicable on '${t[0]}' collection only.`:`Applicable on '${t.join("', '")}' collections.`:e.allowedCollections?.ids&&e.allowedCollections.ids.length>0?"Applicable on select collections.":"Applicable storewide"})(t)))};return e.createElement(e.Fragment,null,(()=>{const t=!!$||!!S,n=$?.name??S?.code??"",r=$?"#F0FFF4":S?"#F3E8FF":"#FDE8E8",i=$?"#2E7D32":"#C53030",a=$?"#2E7D32":"#666666";return e.createElement("div",{className:"yt-cart-coupon-selection-banner-container",style:{padding:"0 16px",marginTop:"10px",marginBottom:"10px"}},e.createElement("div",{className:"yt-cart-coupon-selection-banner",onClick:N,style:{display:"flex",alignItems:"center",padding:"12px 14px",border:"1px solid #E8E8E8",borderRadius:p??8,cursor:"pointer",backgroundColor:"#FFFFFF",transition:"box-shadow 0.2s ease"}},e.createElement("div",{className:"yt-cart-coupon-selection-banner-icon",style:{width:36,height:36,borderRadius:6,backgroundColor:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"12px",transition:"background-color 0.3s ease"}},$?e.createElement(Ke,{size:20,color:i}):e.createElement(ne,{size:20,color:i})),e.createElement("div",{className:"yt-cart-coupon-selection-banner-content",style:{flex:1}},t?e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-coupon-selection-banner-title",style:{fontSize:"14px",color:d||"#1A1A1A"}},e.createElement("span",{className:"yt-cart-coupon-selection-banner-code",style:{fontWeight:600}},n),e.createElement("span",{className:"yt-cart-coupon-selection-banner-applied",style:{fontStyle:"italic"}}," applied!")),e.createElement("div",{className:"yt-cart-coupon-selection-banner-subtitle",style:{fontSize:"12px",color:a,marginTop:"1px",fontStyle:$?"italic":"normal"}},(()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved additional ${$.discountPercentage}% on your purchase`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved additional ₹${$.discountValue} on your purchase`}return"coupon applied on your purchase"})())):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-coupon-selection-banner-title",style:{fontSize:"14px",fontWeight:700,color:d||"#1A1A1A"}},"Coupons and Offers"),e.createElement("div",{className:"yt-cart-coupon-selection-banner-subtitle",style:{fontSize:"12px",color:"#888888",marginTop:"1px"}},"collect and save more"))),e.createElement(L,{className:"yt-cart-coupon-selection-banner-arrow",size:14,color:"#888888"})),!t&&o.length>0&&e.createElement("div",{className:"yt-cart-coupon-selection-eligible-count",style:{textAlign:"center",fontSize:"12px",fontWeight:600,color:"#2E7D32",backgroundColor:"#F0FFF4",padding:"6px 0",borderRadius:`0 0 ${p??8}px ${p??8}px`,marginTop:"-1px",border:"1px solid #C6F6D5",borderTop:"none"}},o.length,"+ coupons eligible for your order"))})(),m&&e.createElement("div",{className:"yt-cart-coupon-selection-overlay",style:{position:"absolute",top:0,right:0,bottom:0,left:0,width:"100%",backgroundColor:"#FFFFFF",zIndex:2147483645,display:"flex",flexDirection:"column",animation:x?"ytSlideDown 0.28s cubic-bezier(0.4, 0, 1, 1) forwards":"ytSlideUp 0.32s cubic-bezier(0, 0, 0.2, 1) forwards"}},e.createElement("div",{className:"yt-cart-coupon-selection-overlay-header",style:{display:"flex",alignItems:"center",padding:"16px",flexShrink:0}},e.createElement("button",{className:"yt-cart-coupon-selection-back-button",onClick:I,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",marginRight:"12px"}},e.createElement(M,{size:18,color:d||"#1A1A1A"})),e.createElement("span",{className:"yt-cart-coupon-selection-overlay-title",style:{fontSize:"18px",fontWeight:700,color:d||"#1A1A1A"}},"Coupons and Offers")),e.createElement("div",{className:"yt-cart-coupon-selection-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{className:"yt-cart-coupon-selection-overlay-content",style:{flex:1,overflowY:"auto"}},S&&e.createElement("div",{className:"yt-cart-coupon-selection-applied-badge",style:{display:"flex",alignItems:"center",padding:"12px 16px",gap:"8px",flexWrap:"wrap"}},e.createElement(Ke,{size:16,color:"#333333"}),e.createElement("span",{className:"yt-cart-coupon-selection-applied-code",style:{fontWeight:700,fontSize:"14px",color:d||"#1A1A1A"}},S.code),e.createElement("span",{className:"yt-cart-coupon-selection-applied-text",style:{fontStyle:"italic",fontSize:"14px",color:d||"#1A1A1A"}},"applied!"),e.createElement("button",{className:"yt-cart-coupon-selection-applied-remove",onClick:z,disabled:w,style:{background:"none",border:"none",cursor:w?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center"}},w?e.createElement(rt,{color:"#666",size:14}):e.createElement(be,{size:18,color:"#666666"})),F()&&e.createElement("span",{className:"yt-cart-coupon-selection-applied-savings",style:{fontSize:"14px",color:"#2E7D32",fontStyle:"italic"}},F())),e.createElement("div",{className:"yt-cart-coupon-selection-apply-section"},e.createElement(_r,{backgroundSubdued:l,themeColor:c,themeTextColor:s,primaryTextColor:d,cartComponentsCornerRadius:p,applyCouponCode:r,removeDiscount:i,enableConfetti:a,hideAppliedCodes:!0})),e.createElement("div",{className:"yt-cart-coupon-selection-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{className:"yt-cart-coupon-selection-collect-section",style:{padding:"16px"}},e.createElement("div",{className:"yt-cart-coupon-selection-collect-title",style:{fontSize:"16px",fontWeight:700,color:d||"#1A1A1A",marginBottom:"4px"}},"Collect Coupon"),e.createElement("div",{className:"yt-cart-coupon-selection-collect-subtitle",style:{fontSize:"13px",color:"#888888",marginBottom:"16px"}},"Pick any one coupon deal"),e.createElement("div",{className:"yt-cart-coupon-selection-list"},B.map(e=>D(e,e.couponTemplateId===h)))))))},Lr=ce("showGSTInput",!1),Mr=c.div`
1392
+ `,Pr=({addCartItem:t,handleDecrement:n,handleIncrement:o,removeCartItem:r,isDev:i,themeColor:a,primaryTextColor:l,secondaryTextColor:c,freeProduct:s,themeTextColor:d,showEditOptionOnProducts:p,productPercentageOffMapping:u,removeFreebieFromCart:m,showDeleteOnFreebies:g,freeProductAdjustedCartTotal:x,freebieCouponTemplates:f,cartCheckpoints:y,freebieFlowCheckpoints:b,imageAspectSelector:h,cartComponentsCornerType:v,cartComponentsCornerRadius:w,giftWrapProductId:C,giftWrapVariantId:E,showGiftWrapAsLineItem:k=!1,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:N,checkoutSectionMessage:I,checkoutSectionMessageRedirectLink:z,showFreebieMilestone:F,freebieMilestoneData:D,freeLabelText:P})=>{const A=ae(Ut),{cartLoading:_}=Jt(),R=!_.cartLoading&&A?.items,O=(x??Number(A?.items_subtotal_price))/100;let L=!0,M=0;if(A?.items?.length>0)for(const e of A.items)e?.properties?._isYtFreebie&&(M+=e?.quantity);if(M===A?.item_count&&(L=!1),!R&&0===A?.item_count)return e.createElement(Fr,null);if(!(R&&0!==A?.item_count||A?.items))return null;const V=D?.campaignFilter??"all_campaigns";let j=[];"all_campaigns"===V?j=f??[]:"progress_bar_tiers"===V?j=y??[]:"freebie_campaigns"===V&&(j=b??[]);const W=Array.isArray(j)?j.filter(e=>"free_product"===e?.couponType).slice().sort((e,t)=>e.minimumOrderValue-t.minimumOrderValue).find(e=>e.minimumOrderValue>O):void 0,H=on(A,A?.currency);return e.createElement(e.Fragment,null,A.items.filter(e=>!!k||!(String(e?.id)===dn(String(C))||String(e?.id)===dn(String(E)))).map(s=>{const x=u?.[s?.key],y=f?.find(e=>e?._allVariantIds?.includes(String(s.id)));let b=!1;if(y&&O>=y.minimumOrderValue&&0===s?.line_price&&(b=!0),!k&&(String(s?.id)===dn(String(C))||dn(String(E))===String(s?.id)))return null;const I=s.discounts&&s.discounts.length>0;return s.properties?._isYtFreebie&&(x||b)&&I&&L?e.createElement(e.Fragment,null,e.createElement(Dr,{className:"yt-cart-product-card-wrapper",key:s?.key??s?.id},e.createElement(Nr,{product:s,themeColor:a,isDev:i,primaryTextColor:l,secondaryTextColor:c,themeTextColor:d,showQtySelector:!1,showEditOptionOnProducts:p,percentageOff:x,imageAspectSelector:h,showDeleteOnFreebies:g,removeFreebieFromCart:m,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:!0,freeLabelText:P}))):e.createElement(Dr,{className:"yt-cart-product-card-wrapper",key:s?.key??s?.id},e.createElement(Nr,{themeColor:a,handleDecrement:n,handleIncrement:o,removeCartItem:r,addCartItem:t,product:s,isDev:i,primaryTextColor:l,secondaryTextColor:c,showQtySelector:!s.properties?._isYtFreebie,showEditOptionOnProducts:p,removeFreebieFromCart:m,showDeleteOnFreebies:g,imageAspectSelector:h,cartComponentsCornerRadius:w,cartComponentsCornerType:v,backgroundSubdued:T,tertiaryColor:S,tertiaryTextColor:$,backgroundColor:B,showDiscountOnMRP:N,freeLabelText:P}))}),F&&L&&W&&e.createElement(zr,{name:W.name,minimumOrderValue:W.minimumOrderValue,currency:H,themeColor:a,tertiaryColor:S,imageUrl:D?.milestoneImage?.path}),mn()&&I&&I.length>0?e.createElement("div",{className:"yt-cart-checkout-message yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:S,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:$,marginBottom:"4px",cursor:z?"pointer":"default"},onClick:()=>{z&&(window.location.href=z)}},I):e.createElement("div",{className:"yt-cart-products-list-separator",style:{display:"list-item",height:"12px",background:"#87878717"}}))};const Ar=({bundleProducts:t})=>{const n=ae(Ut);return e.createElement("div",{className:"yt-cart-bundle-container flex flex-col gap-y-2"},e.createElement("div",{className:"yt-cart-bundle-title flex items-center justify-center"},e.createElement("span",{className:"font-semibold"},"Save more with Bundle!")),e.createElement("div",{className:"yt-cart-bundle-products flex items-center justify-center gap-2 relative"},e.createElement("div",{className:"yt-cart-bundle-product-card w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[0].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[0].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[0].price)),t[0]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"w-48 h-48 flex flex-col justify-center border-[1px] p-2 border-[#B0B0B0]"},e.createElement("img",{style:{alignSelf:"center"},width:100,height:100,src:t[1].image}),e.createElement("span",{className:"text-[12.5px] text-[#667085] font-semibold"},rn(t[0].title)),e.createElement("div",null,e.createElement("span",{className:"text-[#344054] text-[14px] font-bold"},on(n,n?.currency),t[1].original_price)," ",e.createElement("span",{className:"line-through text-[#667085] text-[12px]"},on(n,n?.currency),t[1].price)),t[1]?.options_with_values?.length>0&&e.createElement("div",{className:"flex flex-col"},t[0]?.options_with_values?.map(t=>{if("Title"!==t.name)return e.createElement("span",{className:"text-[10px] text-[#868E96]"},t.name,": ",t.value)}))),e.createElement("div",{className:"yt-cart-bundle-plus-icon absolute",style:{left:"50%",transform:"translateX(-50%)"}},e.createElement("img",{src:'<svg width="35" height="35" viewBox="0 0 35 35" fill="none" xmlns="http://www.w3.org/2000/svg">\n<circle cx="17.2797" cy="18.7208" r="15.5219" fill="#3A3A3A" stroke="#767676" stroke-width="1.51433"/>\n<path d="M15.5903 25.9172V12.1037H19.0827V25.9172H15.5903ZM10.4297 20.7566V17.2642H24.2433V20.7566H10.4297Z" fill="white"/>\n</svg>',alt:"Delivery Truck",height:"25px",width:"42px"}))),e.createElement("div",{className:"yt-cart-bundle-pricing flex flex-row justify-between items-center"},e.createElement("div",{className:"flex flex-row gap-x-4 items-center"},e.createElement("span",{className:"text-[#667085] text-[13px]"},"Total Price"),e.createElement("span",null,e.createElement("span",{className:"font-bold text-black"},on(n,n?.currency),t[0].price+t[1].price)," ",e.createElement("span",{className:"text-[#868E96] text-[12px] line-through"},on(n,n?.currency),t[0].original_price+t[1].original_price))),e.createElement("span",{className:"text-[#1ADF5D] text-[10px]"},"save extra"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].original_price-t[0].price+(t[1].original_price-t[1].price)))),e.createElement("button",{className:"yt-cart-bundle-buy-button flex flex-row items-center bg-[#333333] gap-x-3 justify-center w-full py-1.5"},e.createElement(ct,{color:"white"}),e.createElement("span",{className:"text-white uppercase text-[14px]"},"Buy Bundle at"," ",e.createElement("span",{className:"font-semibold"},on(n,n?.currency),t[0].price+t[1].price))))},_r=({backgroundSubdued:o,themeColor:i,themeTextColor:a,primaryTextColor:l,cartComponentsCornerRadius:c,applyCouponCode:s,removeDiscount:d,enableConfetti:p,hideAppliedCodes:u})=>{const m=ae(Ut),[g,x]=t(""),[f,y]=t(null),[b,h]=t(!1),[v,w]=t(!1),[C,E]=t(!1),{setLoading:k}=Jt(),[T,S]=t(null),[$,B]=t(!1),[N,I]=t(!1),z=r(null);n(()=>{if(T){B(!0);const e=setTimeout(()=>{B(!1)},4e3),t=setTimeout(()=>{S(null)},4500);return()=>{clearTimeout(e),clearTimeout(t)}}B(!1)},[T]),n(()=>{if(m&&m.discount_codes&&f){const e=m.discount_codes.find(e=>e.code===f);e&&(e.applicable?(S({message:"Coupon applied successfully!",type:"success"}),p&&(I(!0),setTimeout(()=>I(!1),5e3))):S({message:"Coupon not applicable",type:"error"}),y(null))}},[m,f]);const F=async()=>{if(s&&g&&!b){S(null),h(!0),y(g);try{await s(g),x("")}catch(e){S({message:"Failed to apply coupon.",type:"error"}),y(null)}finally{h(!1)}}},D=async()=>{if(d&&!C){S(null),E(!0),k&&k(!0,!1,!1,!0);try{await d()}catch(e){S({message:"Failed to remove coupon.",type:"error"})}finally{k&&k(!1,!1,!1,!1),E(!1)}}},P="error"===T?.type,A=m?.discount_codes?.filter(e=>!1!==e?.applicable);return e.createElement("div",{className:"yt-cart-apply-container",ref:z,style:{marginTop:"10px",padding:"0 16px",marginBottom:"10px"}},N&&p&&e.createElement(vo,{particleCount:100,spread:160,origin:{y:.6},checkpointPosition:.5}),e.createElement("div",{className:"yt-cart-apply-input-wrapper",style:{display:"flex",alignItems:"stretch",border:P?"0.5px solid #FF4E4E":v?`1px solid ${i||"#007bff"}`:"1px solid #e0e0e0",borderRadius:c??4,transition:"border-color 0.5s ease-in-out",overflow:"hidden"}},e.createElement("input",{className:"yt-cart-apply-input",type:"text",placeholder:"Have a Coupon Code?",value:g,disabled:b,onFocus:()=>{w(!0),setTimeout(()=>{z.current&&window.innerWidth<=768&&z.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300)},onBlur:()=>w(!1),onChange:e=>{x(e.target.value),T&&S(null)},onKeyDown:e=>{"Enter"===e.key&&F()},style:{flexGrow:1,border:"none",padding:"10px",outline:"none",fontSize:"14px",fontWeight:"bold",borderTopLeftRadius:c??4,borderBottomLeftRadius:c??4,backgroundColor:o,color:l,boxShadow:"none",cursor:b?"not-allowed":"auto",margin:"0"}}),e.createElement("button",{className:"yt-cart-apply-button",onClick:F,disabled:!g||b,style:{padding:"10px 15px",border:"none",backgroundColor:P?"#D98181":g?i||"#007bff":"#cccccc",color:g||P?a||"#ffffff":"#666666",cursor:!g||b?"not-allowed":"pointer",fontSize:"14px",fontWeight:"bold",borderTopRightRadius:c??4,borderBottomRightRadius:c??4,transition:"background-color 0.5s ease-in-out, opacity 0.2s ease-in-out",minWidth:"80px",display:"flex",justifyContent:"center",alignItems:"center",opacity:b?.7:1}},b?e.createElement(ue,{color:a||"#ffffff",size:18}):"Apply")),T&&e.createElement("div",{className:"yt-cart-apply-status",style:{color:"success"===T.type?"#28a745":"#dc3545",fontSize:"12px",marginTop:"4px",fontStyle:"italic",transition:"opacity 0.5s ease-in-out, transform 0.5s ease-in-out, max-height 0.5s ease-in-out",opacity:$?1:0,transform:$?"translateY(0)":"translateY(-10px)",maxHeight:$?"50px":"0",overflow:"hidden"}},T.message),!u&&A&&A.length>0&&e.createElement("div",{className:"yt-cart-apply-applied-list",style:{marginTop:"12px",display:"flex",flexDirection:"column",gap:"8px"}},A.map(t=>e.createElement("div",{className:"yt-cart-apply-applied-item",key:t.code,style:{display:"flex",alignItems:"center",fontSize:"12px",fontStyle:"italic"}},e.createElement("div",{className:"yt-cart-apply-applied-badge",style:{display:"flex",alignItems:"center",color:"#333333",backgroundColor:o,paddingInlineStart:"6px",gap:"4px"}},e.createElement(et,{size:12,color:"#4D4D4D"}),e.createElement("span",{style:{fontWeight:"bold",fontStyle:"normal"}},t.code)," applied!",e.createElement("button",{className:"yt-cart-apply-remove-button",onClick:D,disabled:C,style:{background:"#E2E2E2",border:"0.5px solid #B5B5B5",cursor:"pointer",marginLeft:"4px",padding:"0",display:"flex",alignItems:"center"}},C?e.createElement(ue,{color:i||"#007bff",size:14}):e.createElement(ve,{size:16})))))))},Rr="yt-coupon-selection-animations",Or=({rewardCoupons:o,applyCouponCode:r,removeDiscount:i,enableConfetti:a,backgroundSubdued:l,themeColor:c,themeTextColor:s,primaryTextColor:d,cartComponentsCornerRadius:p})=>{const u=ae(Ut),[m,g]=t(!1),[x,f]=t(!1),[y,b]=t(null),[h,v]=t(null),[w,C]=t(!1),[E,k]=t(null);n(()=>{(()=>{if(document.getElementById(Rr))return;const e=document.createElement("style");e.id=Rr,e.textContent="\n @keyframes ytSlideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes ytSlideDown {\n from { transform: translateY(0); }\n to { transform: translateY(100%); }\n }\n @keyframes ytSuccessPulse {\n 0% { box-shadow: 0 0 0 0 rgba(46,125,50,0.4); }\n 50% { box-shadow: 0 0 0 8px rgba(46,125,50,0); }\n 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); }\n }\n @keyframes ytCheckFade {\n 0% { opacity: 0; transform: scale(0.5); }\n 50% { opacity: 1; transform: scale(1.2); }\n 100% { opacity: 1; transform: scale(1); }\n }\n ",document.head.appendChild(e)})()},[]);const T=u?.discount_codes?.filter(e=>!1!==e?.applicable),S=T?.[0],$=h?o.find(e=>e.couponTemplateId===h):null,B=o;n(()=>{const e=u?.discount_codes?.filter(e=>!1!==e?.applicable)??[];if(null!==h){const t=o.find(e=>e.couponTemplateId===h);return void(t&&e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase())||v(null))}if(e.length>0){const t=o.find(t=>e.some(e=>e.code?.toLowerCase()===t.name?.toLowerCase()));t&&v(t.couponTemplateId)}},[u?.discount_codes,o,h]),n(()=>{if(m){window.history.pushState({couponSelectionOpen:!0},"");const e=()=>I();return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)}},[m]);const N=()=>{f(!1),g(!0)},I=()=>{f(!0),setTimeout(()=>{g(!1),f(!1)},280)},z=async()=>{if(i&&!w){C(!0);try{await i(),v(null)}catch(e){console.error("Failed to remove coupon:",e)}finally{C(!1)}}},F=()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved extra ${$.discountPercentage}% off`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved extra ₹${$.discountValue} off`}return""},D=(t,n=!1)=>{const o=y===t.couponTemplateId,i=E===t.couponTemplateId,a=!n&&!1===t.isEligible;return e.createElement("div",{className:`yt-cart-coupon-selection-card${n?" yt-cart-coupon-selection-card-selected":""}${a?" yt-cart-coupon-selection-card-ineligible":""}`,key:t.couponTemplateId,style:{border:n?`1.5px solid ${c||"#4A7C59"}`:"1px solid #E8E8E8",borderRadius:p??8,overflow:"hidden",marginBottom:"12px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px rgba(0,0,0,0.06)",animation:i?"ytSuccessPulse 0.6s ease-out":void 0,transition:"border-color 0.3s ease, box-shadow 0.3s ease"}},e.createElement("div",{className:"yt-cart-coupon-selection-card-body",style:{padding:"14px 16px",background:"linear-gradient(135deg, #FFFFFF 60%, #FFF5F5 100%)",position:"relative"}},i&&e.createElement("div",{className:"yt-cart-coupon-selection-card-checkmark",style:{position:"absolute",top:"10px",right:"10px",width:24,height:24,borderRadius:"50%",backgroundColor:"#2E7D32",display:"flex",alignItems:"center",justifyContent:"center",animation:"ytCheckFade 0.4s ease-out forwards"}},e.createElement("span",{style:{color:"#fff",fontSize:"14px",fontWeight:700}},"✓")),e.createElement("div",{className:"yt-cart-coupon-selection-card-header",style:{display:"flex",alignItems:"flex-start",gap:"10px"}},e.createElement("div",{className:"yt-cart-coupon-selection-card-icon",style:{width:32,height:32,borderRadius:4,backgroundColor:"#FDE8E8",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},e.createElement(ne,{size:18,color:a?"#6b7280":"#8B0000"})),e.createElement("div",{className:"yt-cart-coupon-selection-card-text",style:{flex:1}},e.createElement("div",{className:"yt-cart-coupon-selection-card-title",style:{fontSize:"14px",fontWeight:600,color:d||"#1A1A1A",marginBottom:"2px"}},(e=>"percentage_discount_coupon"===e.couponType&&e.discountPercentage?`Get an additional ${e.discountPercentage}% off`:"fixed_amount_coupon"===e.couponType&&e.discountValue?`Get an additional ₹${e.discountValue} off`:e.name)(t)),e.createElement("div",{className:"yt-cart-coupon-selection-card-subtitle",style:{fontSize:"12px",color:a?"#6b7280":"#2E7D32",fontWeight:500}},(e=>{if("minimum_quantity"===e.customCartProgressBarCriteria){if(e.quantityThreshold)return`On orders with ${e.quantityThreshold}+ items.`}else if(e.minimumOrderValue)return`On purchases above ₹${e.minimumOrderValue.toLocaleString("en-IN")}.`;return""})(t)))),e.createElement("div",{className:"yt-cart-coupon-selection-code-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"12px",border:"1px solid #E0E0E0",borderRadius:p??6,padding:"8px 12px",backgroundColor:"#FAFAFA"}},e.createElement("span",{className:"yt-cart-coupon-selection-code",style:{fontSize:"14px",fontWeight:700,color:d||"#1A1A1A",letterSpacing:"0.5px"}},t.name),e.createElement("button",{className:"yt-cart-coupon-selection-action",onClick:e=>{e.stopPropagation(),n?z():(async e=>{if(null===y){b(e.couponTemplateId);try{r&&e.name&&await r(e.name),v(e.couponTemplateId),k(e.couponTemplateId),setTimeout(()=>{k(null),I()},1200)}catch(e){console.error("Failed to collect coupon:",e)}finally{b(null)}}})(t)},disabled:o||w||a,style:{background:"none",border:"none",color:a?"#6b7280":"#8B0000",fontSize:"14px",fontWeight:600,cursor:o||w||a?"not-allowed":"pointer",padding:0,display:"flex",alignItems:"center",gap:"4px"}},o||n&&w?e.createElement(ue,{color:"#8B0000",size:14}):n?"Remove":"Collect"))),e.createElement("div",{className:"yt-cart-coupon-selection-applicability",style:{padding:"6px 16px",fontSize:"11px",fontWeight:500,textAlign:"center",backgroundColor:"#FFF0F0",color:a?"#6b7280":"#8B0000",borderTop:"1px solid '#FECACA'"}},(e=>{const t=e.resolvedCollectionNames;return t&&t.length>0?1===t.length?`Applicable on '${t[0]}' collection only.`:`Applicable on '${t.join("', '")}' collections.`:e.allowedCollections?.ids&&e.allowedCollections.ids.length>0?"Applicable on select collections.":"Applicable storewide"})(t)))};return e.createElement(e.Fragment,null,(()=>{const t=!!$||!!S,n=$?.name??S?.code??"",r=$?"#F0FFF4":S?"#F3E8FF":"#FDE8E8",i=$?"#2E7D32":"#C53030",a=$?"#2E7D32":"#666666";return e.createElement("div",{className:"yt-cart-coupon-selection-banner-container",style:{padding:"0 16px",marginTop:"10px",marginBottom:"10px"}},e.createElement("div",{className:"yt-cart-coupon-selection-banner",onClick:N,style:{display:"flex",alignItems:"center",padding:"12px 14px",border:"1px solid #E8E8E8",borderRadius:p??8,cursor:"pointer",backgroundColor:"#FFFFFF",transition:"box-shadow 0.2s ease"}},e.createElement("div",{className:"yt-cart-coupon-selection-banner-icon",style:{width:36,height:36,borderRadius:6,backgroundColor:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"12px",transition:"background-color 0.3s ease"}},$?e.createElement(et,{size:20,color:i}):e.createElement(ne,{size:20,color:i})),e.createElement("div",{className:"yt-cart-coupon-selection-banner-content",style:{flex:1}},t?e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-coupon-selection-banner-title",style:{fontSize:"14px",color:d||"#1A1A1A"}},e.createElement("span",{className:"yt-cart-coupon-selection-banner-code",style:{fontWeight:600}},n),e.createElement("span",{className:"yt-cart-coupon-selection-banner-applied",style:{fontStyle:"italic"}}," applied!")),e.createElement("div",{className:"yt-cart-coupon-selection-banner-subtitle",style:{fontSize:"12px",color:a,marginTop:"1px",fontStyle:$?"italic":"normal"}},(()=>{if($){if("percentage_discount_coupon"===$.couponType&&$.discountPercentage)return`saved additional ${$.discountPercentage}% on your purchase`;if("fixed_amount_coupon"===$.couponType&&$.discountValue)return`saved additional ₹${$.discountValue} on your purchase`}return"coupon applied on your purchase"})())):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-coupon-selection-banner-title",style:{fontSize:"14px",fontWeight:700,color:d||"#1A1A1A"}},"Coupons and Offers"),e.createElement("div",{className:"yt-cart-coupon-selection-banner-subtitle",style:{fontSize:"12px",color:"#888888",marginTop:"1px"}},"collect and save more"))),e.createElement(L,{className:"yt-cart-coupon-selection-banner-arrow",size:14,color:"#888888"})),!t&&o.length>0&&e.createElement("div",{className:"yt-cart-coupon-selection-eligible-count",style:{textAlign:"center",fontSize:"12px",fontWeight:600,color:"#2E7D32",backgroundColor:"#F0FFF4",padding:"6px 0",borderRadius:`0 0 ${p??8}px ${p??8}px`,marginTop:"-1px",border:"1px solid #C6F6D5",borderTop:"none"}},o.length,"+ coupons eligible for your order"))})(),m&&e.createElement("div",{className:"yt-cart-coupon-selection-overlay",style:{position:"absolute",top:0,right:0,bottom:0,left:0,width:"100%",backgroundColor:"#FFFFFF",zIndex:2147483645,display:"flex",flexDirection:"column",animation:x?"ytSlideDown 0.28s cubic-bezier(0.4, 0, 1, 1) forwards":"ytSlideUp 0.32s cubic-bezier(0, 0, 0.2, 1) forwards"}},e.createElement("div",{className:"yt-cart-coupon-selection-overlay-header",style:{display:"flex",alignItems:"center",padding:"16px",flexShrink:0}},e.createElement("button",{className:"yt-cart-coupon-selection-back-button",onClick:I,style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",marginRight:"12px"}},e.createElement(M,{size:18,color:d||"#1A1A1A"})),e.createElement("span",{className:"yt-cart-coupon-selection-overlay-title",style:{fontSize:"18px",fontWeight:700,color:d||"#1A1A1A"}},"Coupons and Offers")),e.createElement("div",{className:"yt-cart-coupon-selection-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{className:"yt-cart-coupon-selection-overlay-content",style:{flex:1,overflowY:"auto"}},S&&e.createElement("div",{className:"yt-cart-coupon-selection-applied-badge",style:{display:"flex",alignItems:"center",padding:"12px 16px",gap:"8px",flexWrap:"wrap"}},e.createElement(et,{size:16,color:"#333333"}),e.createElement("span",{className:"yt-cart-coupon-selection-applied-code",style:{fontWeight:700,fontSize:"14px",color:d||"#1A1A1A"}},S.code),e.createElement("span",{className:"yt-cart-coupon-selection-applied-text",style:{fontStyle:"italic",fontSize:"14px",color:d||"#1A1A1A"}},"applied!"),e.createElement("button",{className:"yt-cart-coupon-selection-applied-remove",onClick:z,disabled:w,style:{background:"none",border:"none",cursor:w?"not-allowed":"pointer",padding:"2px",display:"flex",alignItems:"center"}},w?e.createElement(ue,{color:"#666",size:14}):e.createElement(ve,{size:18,color:"#666666"})),F()&&e.createElement("span",{className:"yt-cart-coupon-selection-applied-savings",style:{fontSize:"14px",color:"#2E7D32",fontStyle:"italic"}},F())),e.createElement("div",{className:"yt-cart-coupon-selection-apply-section"},e.createElement(_r,{backgroundSubdued:l,themeColor:c,themeTextColor:s,primaryTextColor:d,cartComponentsCornerRadius:p,applyCouponCode:r,removeDiscount:i,enableConfetti:a,hideAppliedCodes:!0})),e.createElement("div",{className:"yt-cart-coupon-selection-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),e.createElement("div",{className:"yt-cart-coupon-selection-collect-section",style:{padding:"16px"}},e.createElement("div",{className:"yt-cart-coupon-selection-collect-title",style:{fontSize:"16px",fontWeight:700,color:d||"#1A1A1A",marginBottom:"4px"}},"Collect Coupon"),e.createElement("div",{className:"yt-cart-coupon-selection-collect-subtitle",style:{fontSize:"13px",color:"#888888",marginBottom:"16px"}},"Pick any one coupon deal"),e.createElement("div",{className:"yt-cart-coupon-selection-list"},B.map(e=>D(e,e.couponTemplateId===h)))))))},Lr=ce("showGSTInput",!1),Mr=c.div`
1402
1393
  width: 95%;
1403
1394
  background: white;
1404
1395
  border-radius: 2px;
@@ -1424,7 +1415,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
1424
1415
  display: flex;
1425
1416
  align-items: center;
1426
1417
  gap: 12px;
1427
- `,Wr=c(We)`
1418
+ `,Wr=c(qe)`
1428
1419
  font-size: 20px;
1429
1420
  `,Hr=c.span`
1430
1421
  color: ${e=>e.$textColor};
@@ -1434,7 +1425,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
1434
1425
  display: flex;
1435
1426
  align-items: center;
1436
1427
  gap: 8px;
1437
- `;c(He)`
1428
+ `;c(Qe)`
1438
1429
  color: #8c8c8c;
1439
1430
  font-size: 16px;
1440
1431
  `;const Qr=c.div`
@@ -1474,7 +1465,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
1474
1465
  color: #ff3b30;
1475
1466
  font-size: 12px;
1476
1467
  margin-left: 4px;
1477
- `,Zr=({companyName:o,gstNumber:r,themeColor:a,iconColor:l=a||"#1a1a1a",showIcon:c=!0,backgroundColor:s="white",textColor:d="#1A1A1A",title:p})=>{const[u,m]=ie(Ao),[g,x]=ie(Po),[f,y]=ie(Lr),[b,h]=t(!1),[v,w]=t(!1),[C,E]=t(!1),k=e=>!!e.match("[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9a-zA-Z]{1}[zZ]{1}[0-9a-zA-Z]")&&15===e.length;n(()=>{r&&o&&!g&&!u&&(x(r),m(o));const e=g||r||"";if(e){const t=k(e);h(t),w(!t),t&&y(!1)}},[g,u,r,o]);const T=i(e=>{const t=e.target.value.toUpperCase();if(x(t),E(!0),""===t)w(!1),h(!1);else{const e=k(t);h(e),w(!e)}},[]);return e.createElement(Mr,{className:"yt-cart-gst-container",$bgColor:s},e.createElement(Vr,{className:"yt-cart-gst-button",onClick:()=>{if(f&&(g||u)){if(k(g))return h(!0),w(!1),void y(!1);if(g)return void w(!0)}y(!f)},$active:f,$bgColor:s},e.createElement(jr,{className:"yt-cart-gst-left"},c&&e.createElement(Wr,{color:l}),e.createElement(Hr,{$textColor:d},p||"Get GST Invoice")),e.createElement(qr,{className:"yt-cart-gst-right"},e.createElement(Qr,{$bgColor:"white"!==s?"rgba(245, 245, 245, 0.4)":"rgba(245, 245, 245, 1)"},b&&!f?e.createElement(qe,{size:18,color:d??"#4A4A4A"}):f?e.createElement(Qe,{size:18,color:d??"#4A4A4A"}):e.createElement(Ue,{size:18,color:d??"#4A4A4A",strokeWidth:"0.1"})))),f&&e.createElement(Ur,{className:"yt-cart-gst-form"},e.createElement(Gr,{className:"yt-cart-gst-company-input",placeholder:"Company Name",value:u,onChange:e=>m(e.target.value)}),e.createElement(Yr,{className:"yt-cart-gst-input-wrapper"},e.createElement(Gr,{className:"yt-cart-gst-number-input",placeholder:"GST Number",value:g,onChange:T,onBlur:()=>{g&&!k(g)&&(w(!0),h(!1))},maxLength:15,$hasError:v}),v&&C&&e.createElement(Xr,null,"Please enter a valid GST number"))))};gt('.form-group {\n position: relative;\n display: block;\n}\n\n.floating-input-note {\n position: relative;\n display: block;\n width: 95%;\n max-width: 95%;\n border: 1px solid rgba(0, 0, 0, 0.37);\n background-color: transparent;\n margin: 0px 1rem;\n outline: none !important;\n font-size: 14px;\n color: rgba(0, 0, 0, 0.85);\n transition: all 0.2s ease-in-out;\n}\n\n.icon-transition {\n transition: all 0.2s ease-in-out;\n cursor: pointer;\n}\n\n.floating-label {\n position: absolute;\n top: -6px;\n left: 12px;\n text-align: left;\n display: inline-block;\n padding: 0 4px;\n height: 14px;\n line-height: 14px;\n font-size: 12px;\n font-weight: 400;\n background: #fff;\n color: rgba(0, 0, 0, 0.5);\n margin: 0px auto;\n cursor: text;\n transition: all 0.15s ease-in-out;\n}\n\n.floating-input-note:hover,\n.floating-input-note:focus {\n border: 1px solid #000;\n}\n\n.floating-input-note:valid + label,\n.floating-input-note:focus + label {\n color: #000;\n font-size: 9px;\n}\n\n.gl-form-asterisk {\n background-color: inherit;\n color: rgba(0, 0, 0, 0.5);\n padding: 0;\n padding-left: 3px;\n}\n\n.gl-form-asterisk:after {\n content: "*";\n color: #000;\n}');const Kr=({note:o,noteSectionTitle:r="Order Note"})=>{const[i,a]=ie(_o),[l,c]=t(!1);return n(()=>{""===i&&o&&""!==o&&a(o)},[o]),e.createElement("div",{className:"yt-cart-note-section form-group"},e.createElement("div",{className:"yt-cart-note-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem"},onClick:()=>c(!l)},e.createElement("span",{className:"yt-cart-note-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},r," ",e.createElement(K,null)),e.createElement("div",{className:"yt-cart-note-toggle icon-transition"},l?e.createElement(V,null):e.createElement(j,null))),l&&e.createElement("textarea",{className:"yt-cart-note-textarea floating-input-note",value:i,onChange:e=>{a(e.target.value)}}))},Jr=(e,t)=>!!t&&(!e?.tracksInventory||(!t?.inventoryItem?.tracked||("continue"===t.inventoryPolicy||t.inventoryQuantity>0))),ei=(e,t,n)=>{const o=e?.variants?.edges?.filter(t=>Jr(e,t?.node))||[];if(0===o.length)return{selectedVariantId:void 0,selectedVariantGid:void 0,selectedVariantPrice:0,availableVariants:[],displayVariantCount:0,effectiveDiscount:1,effectivePrice:0,dealAmount:0,showOptions:!1,isFree:!0};let r;n&&(r=o.find(e=>String(e?.node?.id)===`gid://shopify/ProductVariant/${n}`)),r||(r=o[0]);const i=r?.node?.id,a=n||sn(i),l=Number(r?.node?.price)||0,c=e?.percentageOffOnCustomerGetsProducts?.01*e.percentageOffOnCustomerGetsProducts:1;let s=0;if(t&&t.length>0&&i){const e=sn(i),n=t.find(t=>"deal_amount"===t.freebieType&&t.discountValue&&(t.customerGetsProductIds?.ids?.includes(e)||t._allVariantIds?.includes(e)));n&&(s=n.discountValue)}const d=1===c?0:(1-c)*l;return{selectedVariantId:a,selectedVariantGid:i,selectedVariantPrice:l,availableVariants:o,displayVariantCount:e?._claim_allowed_variants?.length||1,effectiveDiscount:c,effectivePrice:d,dealAmount:s,showOptions:e?.variants?.edges?.length>1,isFree:0===d}},ti=c.div`
1468
+ `,Zr=({companyName:o,gstNumber:r,themeColor:a,iconColor:l=a||"#1a1a1a",showIcon:c=!0,backgroundColor:s="white",textColor:d="#1A1A1A",title:p})=>{const[u,m]=ie(Ao),[g,x]=ie(Po),[f,y]=ie(Lr),[b,h]=t(!1),[v,w]=t(!1),[C,E]=t(!1),k=e=>!!e.match("[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9a-zA-Z]{1}[zZ]{1}[0-9a-zA-Z]")&&15===e.length;n(()=>{r&&o&&!g&&!u&&(x(r),m(o));const e=g||r||"";if(e){const t=k(e);h(t),w(!t),t&&y(!1)}},[g,u,r,o]);const T=i(e=>{const t=e.target.value.toUpperCase();if(x(t),E(!0),""===t)w(!1),h(!1);else{const e=k(t);h(e),w(!e)}},[]);return e.createElement(Mr,{className:"yt-cart-gst-container",$bgColor:s},e.createElement(Vr,{className:"yt-cart-gst-button",onClick:()=>{if(f&&(g||u)){if(k(g))return h(!0),w(!1),void y(!1);if(g)return void w(!0)}y(!f)},$active:f,$bgColor:s},e.createElement(jr,{className:"yt-cart-gst-left"},c&&e.createElement(Wr,{color:l}),e.createElement(Hr,{$textColor:d},p||"Get GST Invoice")),e.createElement(qr,{className:"yt-cart-gst-right"},e.createElement(Qr,{$bgColor:"white"!==s?"rgba(245, 245, 245, 0.4)":"rgba(245, 245, 245, 1)"},b&&!f?e.createElement(Ue,{size:18,color:d??"#4A4A4A"}):f?e.createElement(Ye,{size:18,color:d??"#4A4A4A"}):e.createElement(Ge,{size:18,color:d??"#4A4A4A",strokeWidth:"0.1"})))),f&&e.createElement(Ur,{className:"yt-cart-gst-form"},e.createElement(Gr,{className:"yt-cart-gst-company-input",placeholder:"Company Name",value:u,onChange:e=>m(e.target.value)}),e.createElement(Yr,{className:"yt-cart-gst-input-wrapper"},e.createElement(Gr,{className:"yt-cart-gst-number-input",placeholder:"GST Number",value:g,onChange:T,onBlur:()=>{g&&!k(g)&&(w(!0),h(!1))},maxLength:15,$hasError:v}),v&&C&&e.createElement(Xr,null,"Please enter a valid GST number"))))};gt('.form-group {\n position: relative;\n display: block;\n}\n\n.floating-input-note {\n position: relative;\n display: block;\n width: 95%;\n max-width: 95%;\n border: 1px solid rgba(0, 0, 0, 0.37);\n background-color: transparent;\n margin: 0px 1rem;\n outline: none !important;\n font-size: 14px;\n color: rgba(0, 0, 0, 0.85);\n transition: all 0.2s ease-in-out;\n}\n\n.icon-transition {\n transition: all 0.2s ease-in-out;\n cursor: pointer;\n}\n\n.floating-label {\n position: absolute;\n top: -6px;\n left: 12px;\n text-align: left;\n display: inline-block;\n padding: 0 4px;\n height: 14px;\n line-height: 14px;\n font-size: 12px;\n font-weight: 400;\n background: #fff;\n color: rgba(0, 0, 0, 0.5);\n margin: 0px auto;\n cursor: text;\n transition: all 0.15s ease-in-out;\n}\n\n.floating-input-note:hover,\n.floating-input-note:focus {\n border: 1px solid #000;\n}\n\n.floating-input-note:valid + label,\n.floating-input-note:focus + label {\n color: #000;\n font-size: 9px;\n}\n\n.gl-form-asterisk {\n background-color: inherit;\n color: rgba(0, 0, 0, 0.5);\n padding: 0;\n padding-left: 3px;\n}\n\n.gl-form-asterisk:after {\n content: "*";\n color: #000;\n}');const Kr=({note:o,noteSectionTitle:r="Order Note"})=>{const[i,a]=ie(_o),[l,c]=t(!1);return n(()=>{""===i&&o&&""!==o&&a(o)},[o]),e.createElement("div",{className:"yt-cart-note-section form-group"},e.createElement("div",{className:"yt-cart-note-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem"},onClick:()=>c(!l)},e.createElement("span",{className:"yt-cart-note-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},r," ",e.createElement(K,null)),e.createElement("div",{className:"yt-cart-note-toggle icon-transition"},l?e.createElement(V,null):e.createElement(j,null))),l&&e.createElement("textarea",{className:"yt-cart-note-textarea floating-input-note",value:i,onChange:e=>{a(e.target.value)}}))},Jr=(e,t)=>!!t&&(!e?.tracksInventory||(!t?.inventoryItem?.tracked||("continue"===t.inventoryPolicy||t.inventoryQuantity>0))),ei=(e,t,n)=>{const o=e?.variants?.edges?.filter(t=>Jr(e,t?.node))||[];if(0===o.length)return{selectedVariantId:void 0,selectedVariantGid:void 0,selectedVariantPrice:0,availableVariants:[],displayVariantCount:0,effectiveDiscount:1,effectivePrice:0,dealAmount:0,showOptions:!1,isFree:!0};let r;n&&(r=o.find(e=>String(e?.node?.id)===`gid://shopify/ProductVariant/${n}`)),r||(r=o[0]);const i=r?.node?.id,a=n||sn(i),l=Number(r?.node?.price)||0,c=e?.percentageOffOnCustomerGetsProducts?.01*e.percentageOffOnCustomerGetsProducts:1;let s=0;if(t&&t.length>0&&i){const e=sn(i),n=t.find(t=>"deal_amount"===t.freebieType&&t.discountValue&&(t.customerGetsProductIds?.ids?.includes(e)||t._allVariantIds?.includes(e)));n&&(s=n.discountValue)}const d=1===c?0:(1-c)*l;return{selectedVariantId:a,selectedVariantGid:i,selectedVariantPrice:l,availableVariants:o,displayVariantCount:e?._claim_allowed_variants?.length||1,effectiveDiscount:c,effectivePrice:d,dealAmount:s,showOptions:e?.variants?.edges?.length>1,isFree:0===d}},ti=c.div`
1478
1469
  display: flex;
1479
1470
  flex-direction: row;
1480
1471
  column-gap: 10px;
@@ -1540,7 +1531,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
1540
1531
  @media (max-width: 768px) {
1541
1532
  font-size: 11px;
1542
1533
  }
1543
- `,ai=({product:n,themeColor:r,themeTextColor:i,addFreebieToCart:a,productClaimCtaButtonText:l,imageAspectSelector:c,freebieCouponTemplates:s,isMultiClaim:d=!1,isSelected:p=!1,isDisabled:u=!1,onToggleSelection:m})=>{const{setLoading:g}=Jt(),x=le(en),f=o(()=>{const e=n?.variants?.edges?.filter(e=>Jr(n,e?.node));return((e,t,n)=>{if(e?.length){if(t?.length)for(const n of e){const e=sn(String(n?.node?.id));if(t.find(t=>"deal_amount"===t.freebieType&&t.discountValue&&(t.customerGetsProductIds?.ids?.includes(e)||t._allVariantIds?.includes(e))))return e}if(n?.length){const t=e.find(e=>{const t=sn(String(e?.node?.id));return t&&n.includes(t)});if(t)return sn(String(t?.node?.id))}return sn(String(e[0]?.node?.id))}})(e,s,n?._claim_allowed_variants)},[n,s]),[y,b]=t({variantId:f}),h=o(()=>ei(n,s,y?.variantId),[n,s,y?.variantId]);if(!h.availableVariants?.length)return null;const v=d?()=>{!u&&m&&m(n.id)}:()=>{(async(e,t,n,o)=>{e(!0,!0);try{const r=t._claim_allowed_variants||[],i=r[0];if(!i)return console.error("No allowed variant ID found for claiming freebie:",t),void e(!1,!1);if(r.length<=1)n&&await n(i,r);else if(o){const e=t?.id?.split("/").pop();o({open:!0,variantId:i,handle:t?.handle,freebieSelection:!0,productId:e,allowedVariantIds:r})}else console.error("Cannot open variant modal: setVariantSelectionModal not provided.")}catch(e){console.error("yt::uikit handleFreebieClaim error:",e)}finally{e(!1,!1)}})(g,n,a,x)};return e.createElement(ti,{className:"yt-cart-freebie-card",$isDisabled:u,$isSelected:p},e.createElement(ni,{className:"yt-cart-freebie-card-image",src:n?.featuredMedia?.preview?.image?.url,alt:n?.title,$imageAspectSelector:c}),e.createElement(oi,{className:"yt-cart-freebie-card-content"},e.createElement(ri,null,e.createElement(ii,{href:`/products/${n?.handle}?variant=${y?.variantId}`},n?.title),h.showOptions&&h.displayVariantCount>1&&e.createElement("div",{style:{fontSize:"10px",marginBottom:"5px"}},`${h.displayVariantCount} variants available`),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"5px",fontSize:"10px",marginBottom:"10px"}},e.createElement("span",{style:{fontWeight:"bold"}},h.dealAmount>0?`₹${h.dealAmount.toFixed(2)}`:h.isFree?"FREE":`₹${h.effectivePrice.toFixed(2)}`),e.createElement("span",{style:{color:"gray",textDecorationLine:"line-through"}},"₹",h.selectedVariantPrice),h.effectivePrice>0?e.createElement("span",{style:{padding:"2px",background:"#FFEAF2",color:"#E2454B",fontSize:"8px",fontWeight:"bold"}},"Save ",n?.percentageOffOnCustomerGetsProducts,"%"):"")),e.createElement("button",{className:"yt-cart-freebie-card-button",style:{cursor:u?"not-allowed":"pointer",border:d?p?"1px solid #51B286":"1px solid #888888":"none",color:d?p?"#ffffff":"#000000":i||"#ffffff",backgroundColor:d?p?"#51B286":"#ffffff":r||"#000000",fontSize:"12px",padding:"5px 7px",width:"80%",borderRadius:"14px",fontWeight:d?p?"600":"normal":"600",display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",fontFamily:"Poppins"},onClick:v,disabled:u},e.createElement("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},d&&e.createElement("span",{style:{display:"inline-flex"}},p?e.createElement(tt,{size:16}):e.createElement(nt,{size:16})),e.createElement("span",null,d?p?"Added":"Add":l||"Add")))))},li=async(e,t,n)=>{if(n&&0!==e.length)for(const o of e){const e=t.find(e=>e.id===o);if(!e){console.error("Product not found for ID:",o);continue}const r=e._claim_allowed_variants||[],i=r[0];i?await n(i,r):console.error("No allowed variant ID found for claiming freebie:",e)}},ci=c.div`
1534
+ `,ai=({product:n,themeColor:r,themeTextColor:i,addFreebieToCart:a,productClaimCtaButtonText:l,imageAspectSelector:c,freebieCouponTemplates:s,isMultiClaim:d=!1,isSelected:p=!1,isDisabled:u=!1,onToggleSelection:m})=>{const{setLoading:g}=Jt(),x=le(en),f=o(()=>{const e=n?.variants?.edges?.filter(e=>Jr(n,e?.node));return((e,t,n)=>{if(e?.length){if(t?.length)for(const n of e){const e=sn(String(n?.node?.id));if(t.find(t=>"deal_amount"===t.freebieType&&t.discountValue&&(t.customerGetsProductIds?.ids?.includes(e)||t._allVariantIds?.includes(e))))return e}if(n?.length){const t=e.find(e=>{const t=sn(String(e?.node?.id));return t&&n.includes(t)});if(t)return sn(String(t?.node?.id))}return sn(String(e[0]?.node?.id))}})(e,s,n?._claim_allowed_variants)},[n,s]),[y,b]=t({variantId:f}),h=o(()=>ei(n,s,y?.variantId),[n,s,y?.variantId]);if(!h.availableVariants?.length)return null;const v=d?()=>{!u&&m&&m(n.id)}:()=>{(async(e,t,n,o)=>{e(!0,!0);try{const r=t._claim_allowed_variants||[],i=r[0];if(!i)return console.error("No allowed variant ID found for claiming freebie:",t),void e(!1,!1);if(r.length<=1)n&&await n(i,r);else if(o){const e=t?.id?.split("/").pop();o({open:!0,variantId:i,handle:t?.handle,freebieSelection:!0,productId:e,allowedVariantIds:r})}else console.error("Cannot open variant modal: setVariantSelectionModal not provided.")}catch(e){console.error("yt::uikit handleFreebieClaim error:",e)}finally{e(!1,!1)}})(g,n,a,x)};return e.createElement(ti,{className:"yt-cart-freebie-card",$isDisabled:u,$isSelected:p},e.createElement(ni,{className:"yt-cart-freebie-card-image",src:n?.featuredMedia?.preview?.image?.url,alt:n?.title,$imageAspectSelector:c}),e.createElement(oi,{className:"yt-cart-freebie-card-content"},e.createElement(ri,null,e.createElement(ii,{href:`/products/${n?.handle}?variant=${y?.variantId}`},n?.title),h.showOptions&&h.displayVariantCount>1&&e.createElement("div",{style:{fontSize:"10px",marginBottom:"5px"}},`${h.displayVariantCount} variants available`),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"5px",fontSize:"10px",marginBottom:"10px"}},e.createElement("span",{style:{fontWeight:"bold"}},h.dealAmount>0?`₹${h.dealAmount.toFixed(2)}`:h.isFree?"FREE":`₹${h.effectivePrice.toFixed(2)}`),e.createElement("span",{style:{color:"gray",textDecorationLine:"line-through"}},"₹",h.selectedVariantPrice),h.effectivePrice>0?e.createElement("span",{style:{padding:"2px",background:"#FFEAF2",color:"#E2454B",fontSize:"8px",fontWeight:"bold"}},"Save ",n?.percentageOffOnCustomerGetsProducts,"%"):"")),e.createElement("button",{className:"yt-cart-freebie-card-button",style:{cursor:u?"not-allowed":"pointer",border:d?p?"1px solid #51B286":"1px solid #888888":"none",color:d?p?"#ffffff":"#000000":i||"#ffffff",backgroundColor:d?p?"#51B286":"#ffffff":r||"#000000",fontSize:"12px",padding:"5px 7px",width:"80%",borderRadius:"14px",fontWeight:d?p?"600":"normal":"600",display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",fontFamily:"Poppins"},onClick:v,disabled:u},e.createElement("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},d&&e.createElement("span",{style:{display:"inline-flex"}},p?e.createElement(ot,{size:16}):e.createElement(rt,{size:16})),e.createElement("span",null,d?p?"Added":"Add":l||"Add")))))},li=async(e,t,n)=>{if(n&&0!==e.length)for(const o of e){const e=t.find(e=>e.id===o);if(!e){console.error("Product not found for ID:",o);continue}const r=e._claim_allowed_variants||[],i=r[0];i?await n(i,r):console.error("No allowed variant ID found for claiming freebie:",e)}},ci=c.div`
1544
1535
  position: relative;
1545
1536
  width: 100%;
1546
1537
  display: flex;
@@ -2158,7 +2149,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2158
2149
  object-fit: cover;
2159
2150
  display: block;
2160
2151
  }
2161
- `,_a=({imageUrls:t,redirectionLink:n,cartOffersCarouselHeight:o,enableMarquee:r=!0})=>{if(!t||0===t.length)return null;const i=()=>{n&&(window.location.href=n)};if(!r)return e.createElement(Aa,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("img",{src:t[0],alt:"banner"}));const a=[...t,...t];return e.createElement(Pa,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("div",{className:"marquee-wrapper"},e.createElement("div",{className:"marquee-content"},a.map((t,n)=>e.createElement("img",{key:`marquee-img-${n}`,src:t,alt:`banner ${n+1}`})))))},Ra=({backgroundColor:o,titleText:r,descriptionText:i,criteria:a=[],pauseTimer:l,textAlignment:c="center",redirectionUrl:s,enableCustomCriteria:d=!0,cartData:p})=>{const[u,m]=t(0),g=e.useRef(null),x=e.useRef([]),f=d?a.filter(e=>{if(!p)return!1;if("mov"===e.type){return tn(p?.items_subtotal_price??0,p?.currency??"INR")>=e.value}if("moq"===e.type){return p.items.filter(e=>!e.properties?._isYtFreebie).reduce((e,t)=>e+(t.quantity||1),0)>=e.value}return!1}):[],y=Boolean(r&&r.trim()||i&&i.trim()),b=[...y?[{type:"default",titleText:r,descriptionText:i}]:[],...f.map(e=>({type:"criteria",titleText:e.message,descriptionText:"",redirectionUrl:e.redirectionUrl}))],h=b.length,v=h>0,w=h>1,C=e=>{"criteria"===e.type&&e.redirectionUrl?window.location.href=e.redirectionUrl:"default"===e.type&&s&&(window.location.href=s)};let E,k=!1;h>0&&(E=b[u]??b[0],k="criteria"===E.type&&Boolean(E.redirectionUrl)||"default"===E.type&&Boolean(s)),n(()=>{const e=f.filter(e=>!x.current.some(t=>t.id===e.id));if(e.length>0){const t=e[0],n=f.findIndex(e=>e.id===t.id);if(-1!==n){const e=(y?1:0)+n;e<b.length&&m(e)}}x.current=f},[f,b,y]),n(()=>{h>0&&u>=h&&m(h-1)},[u,h]),n(()=>{g.current&&pn(g.current)},[o,b,u]),n(()=>{if(!w)return void m(0);const e=setInterval(()=>{m(e=>(e+1)%h)},1e3*l);return()=>clearInterval(e)},[w,h,l]);return v?e.createElement(wa,{ref:g,$backgroundColor:o},e.createElement(Ea,null,w?e.createElement(Na,null,e.createElement(Fa,{$position:"left",onClick:()=>{m(e=>0===e?h-1:e-1)}},e.createElement(ke,null)),e.createElement(Ia,{$currentIndex:u},b.map((t,n)=>e.createElement(za,{key:n,onClick:()=>C(t),style:{cursor:"criteria"===t.type&&t.redirectionUrl||"default"===t.type&&s?"pointer":"default"}},e.createElement(Ta,null,e.createElement(Sa,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement($a,{style:{textAlign:"center"}},t.descriptionText))))),e.createElement(Fa,{$position:"right",onClick:()=>{m(e=>(e+1)%h)}},e.createElement(Te,null))):e.createElement(Ta,{onClick:()=>E&&C(E),style:{cursor:k?"pointer":"default"}},(()=>{const t=b[u]??b[0];return e.createElement(e.Fragment,null,e.createElement(Sa,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement($a,{style:{textAlign:"center"}},t.descriptionText))})()))):null},Oa=({backgroundColor:t,imageUrl:o,titleText:r,descriptionText:i,textAlignment:a,redirectionUrl:l})=>{const c=e.useRef(null);n(()=>{c.current&&pn(c.current)},[t]);return e.createElement(va,{ref:c,$backgroundColor:t,onClick:()=>{l&&(window.location.href=l)},style:{cursor:l?"pointer":"default"}},e.createElement(Ca,null,e.createElement(ka,{$imageUrl:o}),e.createElement(Ta,null,e.createElement(Sa,{style:{textAlign:"center"}},r),e.createElement($a,{style:{textAlign:"center"}},i))))},La=({backgroundColor:t,couponCode:o,copySuccess:r,setCopySuccess:i,titleText:a,descriptionText:l,textAlignment:c="center"})=>{const s=e.useRef(null);n(()=>{s.current&&pn(s.current)},[t]);return e.createElement(va,{ref:s,$backgroundColor:t,style:{position:"relative"}},e.createElement(Ca,{style:{filter:r?"blur(5px)":"none",zIndex:1}},e.createElement(Ta,{style:{borderRight:"1px solid #d9d9d9",paddingRight:"5px"}},e.createElement(Sa,{style:{textAlign:"center"}},a),e.createElement($a,{style:{textAlign:"center"}},l)),e.createElement(Ba,null,e.createElement(pe,{className:"copy-icon",size:24,onClick:()=>(e=>{navigator.clipboard.writeText(e).then(()=>{i(!0)},e=>{i(!1)}),setTimeout(()=>{i(!1)},3e3)})(o),style:{height:"24px",width:"24px"}}))))},Ma=({children:o,autoSlide:r=!0,autoSlideInterval:i,copySuccess:a,themeColor:l})=>{const[c,s]=t(0),d=e.Children.count(o),[p,u]=t(!1),[m,g]=t(r),x=()=>{s(e=>e===d-1?0:e+1)};return n(()=>{if(!m)return;const e=setInterval(x,i);return()=>clearInterval(e)},[m,i]),e.createElement(Da,null,a&&e.createElement("div",{className:"coupon-code-copied",style:{position:"absolute",top:"20%",left:"50%",transform:"translate(-50%, -20%)",backgroundColor:l,display:"flex",alignItems:"center",justifyContent:"center",gap:"9px",borderRadius:"9px",padding:"12px 30px",color:"#FFF",fontFamily:"Poppins",fontSize:"12px",fontWeight:"400",lineHeight:"118%",zIndex:2,minWidth:"70%"}},e.createElement(q,{size:20,color:"white",style:{height:"24px",width:"24px"}}),"Coupon Code Copied"),e.createElement("div",{onMouseEnter:()=>{u(!0),g(!1)},onMouseLeave:()=>{u(!1),g(!0)},style:{display:"flex",transition:p?"none":"transform 0.5s ease",transform:`translateX(-${100*c}%)`,cursor:"pointer"}},e.Children.toArray(o)))};function Va({cartOffersCarousalData:n,themeColor:o,cartOffersCarouselHeight:r,cartData:i}){const[a,l]=t(!1),{enableCartOffersCarousel:c,pauseTimer:s,backgroundColor:d,slides:p}=n,u=p.filter(e=>"ImageOnly"===e.slideType).map(e=>e.imageUrl).filter(e=>!!e),m=p.findIndex(e=>"ImageOnly"===e.slideType),g=[];let x=!1;return p.forEach((t,n)=>{if("ImageOnly"===t.slideType)n===m&&u.length>0&&!x&&(g.push(e.createElement(_a,{key:`image-only-marquee-${t.slideNumber}`,imageUrls:u,redirectionLink:t.redirectionUrl||t.carouselRedirectionLink,cartOffersCarouselHeight:r,enableMarquee:!1!==t.enableMarquee})),x=!0);else switch(t.slideType){case"TextFieldOnly":g.push(e.createElement(Ra,{key:t.slideNumber,backgroundColor:d,titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",criteria:t.criteria,pauseTimer:s,textAlignment:t.textAlignment,redirectionUrl:t.redirectionUrl||t.carouselRedirectionLink,enableCustomCriteria:t.enableCustomCriteria,cartData:i}));break;case"TextImage":g.push(e.createElement(Oa,{key:t.slideNumber,backgroundColor:d,titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",imageUrl:t.imageUrl||"",textAlignment:t.textAlignment,redirectionUrl:t.redirectionUrl||t.carouselRedirectionLink}));break;case"TextCode":g.push(e.createElement(La,{key:t.slideNumber,backgroundColor:d,couponCode:t.campaignCode??"",titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",copySuccess:a,setCopySuccess:l,textAlignment:t.textAlignment}))}}),c&&0!==g.length?e.createElement(Ma,{copySuccess:a,autoSlideInterval:1e3*s,themeColor:o},g):null}const ja=s`
2152
+ `,_a=({imageUrls:t,redirectionLink:n,cartOffersCarouselHeight:o,enableMarquee:r=!0})=>{if(!t||0===t.length)return null;const i=()=>{n&&(window.location.href=n)};if(!r)return e.createElement(Aa,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("img",{src:t[0],alt:"banner"}));const a=[...t,...t];return e.createElement(Pa,{onClick:i,style:{cursor:n?"pointer":"default"},$cartOffersCarouselHeight:o},e.createElement("div",{className:"marquee-wrapper"},e.createElement("div",{className:"marquee-content"},a.map((t,n)=>e.createElement("img",{key:`marquee-img-${n}`,src:t,alt:`banner ${n+1}`})))))},Ra=({backgroundColor:o,titleText:r,descriptionText:i,criteria:a=[],pauseTimer:l,textAlignment:c="center",redirectionUrl:s,enableCustomCriteria:d=!0,cartData:p})=>{const[u,m]=t(0),g=e.useRef(null),x=e.useRef([]),f=d?a.filter(e=>{if(!p)return!1;if("mov"===e.type){return tn(p?.items_subtotal_price??0,p?.currency??"INR")>=e.value}if("moq"===e.type){return p.items.filter(e=>!e.properties?._isYtFreebie).reduce((e,t)=>e+(t.quantity||1),0)>=e.value}return!1}):[],y=Boolean(r&&r.trim()||i&&i.trim()),b=[...y?[{type:"default",titleText:r,descriptionText:i}]:[],...f.map(e=>({type:"criteria",titleText:e.message,descriptionText:"",redirectionUrl:e.redirectionUrl}))],h=b.length,v=h>0,w=h>1,C=e=>{"criteria"===e.type&&e.redirectionUrl?window.location.href=e.redirectionUrl:"default"===e.type&&s&&(window.location.href=s)};let E,k=!1;h>0&&(E=b[u]??b[0],k="criteria"===E.type&&Boolean(E.redirectionUrl)||"default"===E.type&&Boolean(s)),n(()=>{const e=f.filter(e=>!x.current.some(t=>t.id===e.id));if(e.length>0){const t=e[0],n=f.findIndex(e=>e.id===t.id);if(-1!==n){const e=(y?1:0)+n;e<b.length&&m(e)}}x.current=f},[f,b,y]),n(()=>{h>0&&u>=h&&m(h-1)},[u,h]),n(()=>{g.current&&pn(g.current)},[o,b,u]),n(()=>{if(!w)return void m(0);const e=setInterval(()=>{m(e=>(e+1)%h)},1e3*l);return()=>clearInterval(e)},[w,h,l]);return v?e.createElement(wa,{ref:g,$backgroundColor:o},e.createElement(Ea,null,w?e.createElement(Na,null,e.createElement(Fa,{$position:"left",onClick:()=>{m(e=>0===e?h-1:e-1)}},e.createElement(Se,null)),e.createElement(Ia,{$currentIndex:u},b.map((t,n)=>e.createElement(za,{key:n,onClick:()=>C(t),style:{cursor:"criteria"===t.type&&t.redirectionUrl||"default"===t.type&&s?"pointer":"default"}},e.createElement(Ta,null,e.createElement(Sa,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement($a,{style:{textAlign:"center"}},t.descriptionText))))),e.createElement(Fa,{$position:"right",onClick:()=>{m(e=>(e+1)%h)}},e.createElement($e,null))):e.createElement(Ta,{onClick:()=>E&&C(E),style:{cursor:k?"pointer":"default"}},(()=>{const t=b[u]??b[0];return e.createElement(e.Fragment,null,e.createElement(Sa,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement($a,{style:{textAlign:"center"}},t.descriptionText))})()))):null},Oa=({backgroundColor:t,imageUrl:o,titleText:r,descriptionText:i,textAlignment:a,redirectionUrl:l})=>{const c=e.useRef(null);n(()=>{c.current&&pn(c.current)},[t]);return e.createElement(va,{ref:c,$backgroundColor:t,onClick:()=>{l&&(window.location.href=l)},style:{cursor:l?"pointer":"default"}},e.createElement(Ca,null,e.createElement(ka,{$imageUrl:o}),e.createElement(Ta,null,e.createElement(Sa,{style:{textAlign:"center"}},r),e.createElement($a,{style:{textAlign:"center"}},i))))},La=({backgroundColor:t,couponCode:o,copySuccess:r,setCopySuccess:i,titleText:a,descriptionText:l,textAlignment:c="center"})=>{const s=e.useRef(null);n(()=>{s.current&&pn(s.current)},[t]);return e.createElement(va,{ref:s,$backgroundColor:t,style:{position:"relative"}},e.createElement(Ca,{style:{filter:r?"blur(5px)":"none",zIndex:1}},e.createElement(Ta,{style:{borderRight:"1px solid #d9d9d9",paddingRight:"5px"}},e.createElement(Sa,{style:{textAlign:"center"}},a),e.createElement($a,{style:{textAlign:"center"}},l)),e.createElement(Ba,null,e.createElement(pe,{className:"copy-icon",size:24,onClick:()=>(e=>{navigator.clipboard.writeText(e).then(()=>{i(!0)},e=>{i(!1)}),setTimeout(()=>{i(!1)},3e3)})(o),style:{height:"24px",width:"24px"}}))))},Ma=({children:o,autoSlide:r=!0,autoSlideInterval:i,copySuccess:a,themeColor:l})=>{const[c,s]=t(0),d=e.Children.count(o),[p,u]=t(!1),[m,g]=t(r),x=()=>{s(e=>e===d-1?0:e+1)};return n(()=>{if(!m)return;const e=setInterval(x,i);return()=>clearInterval(e)},[m,i]),e.createElement(Da,null,a&&e.createElement("div",{className:"coupon-code-copied",style:{position:"absolute",top:"20%",left:"50%",transform:"translate(-50%, -20%)",backgroundColor:l,display:"flex",alignItems:"center",justifyContent:"center",gap:"9px",borderRadius:"9px",padding:"12px 30px",color:"#FFF",fontFamily:"Poppins",fontSize:"12px",fontWeight:"400",lineHeight:"118%",zIndex:2,minWidth:"70%"}},e.createElement(q,{size:20,color:"white",style:{height:"24px",width:"24px"}}),"Coupon Code Copied"),e.createElement("div",{onMouseEnter:()=>{u(!0),g(!1)},onMouseLeave:()=>{u(!1),g(!0)},style:{display:"flex",transition:p?"none":"transform 0.5s ease",transform:`translateX(-${100*c}%)`,cursor:"pointer"}},e.Children.toArray(o)))};function Va({cartOffersCarousalData:n,themeColor:o,cartOffersCarouselHeight:r,cartData:i}){const[a,l]=t(!1),{enableCartOffersCarousel:c,pauseTimer:s,backgroundColor:d,slides:p}=n,u=p.filter(e=>"ImageOnly"===e.slideType).map(e=>e.imageUrl).filter(e=>!!e),m=p.findIndex(e=>"ImageOnly"===e.slideType),g=[];let x=!1;return p.forEach((t,n)=>{if("ImageOnly"===t.slideType)n===m&&u.length>0&&!x&&(g.push(e.createElement(_a,{key:`image-only-marquee-${t.slideNumber}`,imageUrls:u,redirectionLink:t.redirectionUrl||t.carouselRedirectionLink,cartOffersCarouselHeight:r,enableMarquee:!1!==t.enableMarquee})),x=!0);else switch(t.slideType){case"TextFieldOnly":g.push(e.createElement(Ra,{key:t.slideNumber,backgroundColor:d,titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",criteria:t.criteria,pauseTimer:s,textAlignment:t.textAlignment,redirectionUrl:t.redirectionUrl||t.carouselRedirectionLink,enableCustomCriteria:t.enableCustomCriteria,cartData:i}));break;case"TextImage":g.push(e.createElement(Oa,{key:t.slideNumber,backgroundColor:d,titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",imageUrl:t.imageUrl||"",textAlignment:t.textAlignment,redirectionUrl:t.redirectionUrl||t.carouselRedirectionLink}));break;case"TextCode":g.push(e.createElement(La,{key:t.slideNumber,backgroundColor:d,couponCode:t.campaignCode??"",titleText:t.titleTextField??"",descriptionText:t.descriptionTextField??"",copySuccess:a,setCopySuccess:l,textAlignment:t.textAlignment}))}}),c&&0!==g.length?e.createElement(Ma,{copySuccess:a,autoSlideInterval:1e3*s,themeColor:o},g):null}const ja=s`
2162
2153
  0% {
2163
2154
  background-position: 200% 0;
2164
2155
  }
@@ -2433,7 +2424,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2433
2424
  &:hover {
2434
2425
  opacity: ${e=>e.$locked?.5:.85};
2435
2426
  }
2436
- `,kl=(e,t)=>e.find(e=>(e?.variants?.edges??e?.variants?.nodes??[]).some(e=>{const n=e?.node??e,o=String(n?.id??"");return o.includes(t)||o.split("/").pop()===t})),Tl=(e,t)=>{const n=(e?.variants?.edges??e?.variants?.nodes??[]).find(e=>{const n=e?.node??e,o=String(n?.id??"");return o.includes(t)||o.split("/").pop()===t});return n?.node??n},Sl=({stealDealCheckpoints:i,stealDealProducts:a,freeProductAdjustedCartTotal:l,effectiveQuantityForProgressBar:c,addFreebieToCart:s,freebiesInCart:d,primaryTextColor:p})=>{const u=ae(Ut),{setLoading:m}=Jt(),f=le(en),y=i?.[0],[b,h]=t(0),[v,w]=t(0),C=r(null),E=r(null),k=r(null),T=o(()=>(l||Number(u?.items_subtotal_price))/100,[l,u?.items_subtotal_price]),S=on(u,u?.currency),$=o(()=>{if(!y)return!1;return"minimum_order_value"===(y.customCartProgressBarCriteria??"minimum_order_value")?T>=y.minimumOrderValue:(u?.item_count??0)>=y.quantityThreshold},[y,T,u?.item_count]),B=y?.maxFreebiesInTier??1,N=o(()=>{if(!y)return 0;return(y.customerGetsProductIds?.ids??[]).filter(e=>d.includes(e)).length},[y,d])>=B,I=o(()=>{if(!y||!a?.length)return[];const e=y.customerGetsProductIds?.ids??[],t=[];for(const n of e){const e=kl(a,n);if(!e)continue;const o=Tl(e,n),r=Number(o?.price?.amount?o.price.amount:o?.price??0);let i,l;"no_discount"===y.freebieType?(i=r,l=0):"percentage_off"===y.freebieType&&y.discountPercentage?(l=y.discountPercentage,i=r*(1-l/100)):(i=y.discountValue??r,l=r>0?Math.round((r-i)/r*100):0);const c=d.includes(n),s=e?._claim_allowed_variants??[n];t.push({product:e,variantId:n,isUnlocked:$,isClaimed:c,discountPercent:l,dealPrice:i,originalPrice:r,allowedVariantIds:s})}return t},[y,a,d,$]);n(()=>{if(C.current){const e=C.current.offsetWidth,t=window.innerWidth<=768;w(t?Math.min(.95*e,280):Math.min(.8*e,320))}},[I.length]);const z=Math.max(0,I.length-1);n(()=>{b>z&&h(z)},[z,b]);const F=()=>{h(e=>0===e?z:e-1)},D=()=>{h(e=>e===z?0:e+1)};if(!y||!I.length)return null;return e.createElement(Za,null,e.createElement(Ka,null,e.createElement(Ja,{style:{color:p}},e.createElement(el,null,"STEAL"),e.createElement(tl,null,"DEALS")),N?e.createElement(il,null,"Max ",B," claims reached"):$?e.createElement(rl,null,e.createElement(Q,{size:10}),"UNLOCKED"):e.createElement(nl,null,e.createElement(ol,null),"minimum_order_value"===(y.customCartProgressBarCriteria??"minimum_order_value")?e.createElement(e.Fragment,null,"UNLOCK AT ",S,y.minimumOrderValue):e.createElement(e.Fragment,null,"UNLOCK AT ",y.quantityThreshold," ITEMS"))),e.createElement(al,{ref:C,onTouchStart:e=>{E.current=e.touches[0].clientX,k.current=e.touches[0].clientY},onTouchMove:e=>{if(null===E.current||null===k.current)return;const t=e.touches[0].clientX-E.current,n=e.touches[0].clientY-k.current;Math.abs(t)>10&&Math.abs(t)>Math.abs(n)&&e.preventDefault()},onTouchEnd:e=>{if(null===E.current)return;const t=e.changedTouches[0].clientX-E.current;Math.abs(t)>50&&(t<0?D():F()),E.current=null,k.current=null}},I.length>1&&e.createElement(pl,{onClick:F},e.createElement(g,{size:30,color:"#4D4D4D"})),e.createElement(sl,{position:"left",style:{display:"flex"}}),e.createElement(sl,{position:"right",style:{display:"flex"}}),e.createElement(ll,{$cardWidth:v},e.createElement(cl,{$translate:b*(v+10)},I.map(t=>{return e.createElement("div",{key:t.variantId,style:{width:`${v}px`,flexShrink:0},className:"yt-steal-deal-card"},e.createElement(ml,null,e.createElement(gl,null,e.createElement(xl,{src:(n=t.product,n?.featuredMedia?.preview?.image?.url??n?.featuredImage?.url??n?.images?.edges?.[0]?.node?.url??n?.image?.src??""),alt:t.product?.title??""}),t.discountPercent>0&&e.createElement(fl,null,"-",t.discountPercent,"% OFF")),e.createElement(yl,null,e.createElement(bl,null,t.product?.title??""),e.createElement(Cl,null,e.createElement(hl,null,e.createElement(vl,null,S,t.dealPrice.toLocaleString()),t.originalPrice>t.dealPrice&&e.createElement(wl,null,S,t.originalPrice.toLocaleString())),e.createElement(El,{$locked:!t.isUnlocked||t.isClaimed||N,onClick:()=>(async e=>{if(e.isUnlocked&&!e.isClaimed&&!N&&s){if(e.allowedVariantIds.length>1){const t=e.product?.variants?.edges??e.product?.variants?.nodes??[];if(e.allowedVariantIds.some(n=>t.some(t=>{const o=t?.node??t;return(String(o?.id??"").split("/").pop()===n||String(o?.id??"").includes(n))&&Jr(e.product,o)}))){const t=e.product?.id?.split("/").pop();return void f({open:!0,variantId:e.variantId,handle:e.product?.handle,freebieSelection:!0,stealDealSelection:!0,productId:t,allowedVariantIds:e.allowedVariantIds})}}m(!0,!0);try{await s(e.variantId,e.allowedVariantIds),window.dispatchEvent(new CustomEvent("yt:autoFreebieAdded"))}catch(e){}finally{m(!1,!1)}}})(t),disabled:!t.isUnlocked||t.isClaimed||N},t.isUnlocked?e.createElement(U,{size:12}):e.createElement(Y,{size:12}))))));var n}))),I.length>1&&e.createElement(ul,{onClick:D},e.createElement(x,{size:30,color:"#4D4D4D"}))))},$l=c.div`
2427
+ `,kl=e=>{const t=Number(e?.amount??e??0);return Number.isFinite(t)?t:0},Tl=(e,t)=>e.find(e=>(e?.variants?.edges??e?.variants?.nodes??[]).some(e=>{const n=e?.node??e,o=String(n?.id??"");return o.includes(t)||o.split("/").pop()===t})),Sl=(e,t)=>{const n=(e?.variants?.edges??e?.variants?.nodes??[]).find(e=>{const n=e?.node??e,o=String(n?.id??"");return o.includes(t)||o.split("/").pop()===t});return n?.node??n},$l=({stealDealCheckpoints:i,stealDealProducts:a,freeProductAdjustedCartTotal:l,effectiveQuantityForProgressBar:c,addFreebieToCart:s,freebiesInCart:d,primaryTextColor:p})=>{const u=ae(Ut),{setLoading:m}=Jt(),f=le(en),y=i?.[0],[b,h]=t(0),[v,w]=t(0),C=r(null),E=r(null),k=r(null),T=o(()=>(l||Number(u?.items_subtotal_price))/100,[l,u?.items_subtotal_price]),S=on(u,u?.currency),$=o(()=>{if(!y)return!1;return"minimum_order_value"===(y.customCartProgressBarCriteria??"minimum_order_value")?T>=y.minimumOrderValue:(u?.item_count??0)>=y.quantityThreshold},[y,T,u?.item_count]),B=y?.maxFreebiesInTier??1,N=o(()=>{if(!y)return 0;return(y.customerGetsProductIds?.ids??[]).filter(e=>d.includes(e)).length},[y,d])>=B,I=o(()=>{if(!y||!a?.length)return[];const e=y.customerGetsProductIds?.ids??[],t=[];for(const n of e){const e=Tl(a,n);if(!e)continue;const o=Sl(e,n),r=kl(o?.price),i=kl(o?.compareAtPrice);let l,c;"no_discount"===y.freebieType?(l=r,c=0):"percentage_off"===y.freebieType&&y.discountPercentage?(c=y.discountPercentage,l=r*(1-c/100)):(l=y.discountValue??r,c=r>0?Math.round((r-l)/r*100):0);const s=d.includes(n),p=e?._claim_allowed_variants??[n],u=i>l?i:r>l?r:null;t.push({product:e,variantId:n,isUnlocked:$,isClaimed:s,discountPercent:c,dealPrice:l,originalPrice:r,strikeThroughPrice:u,allowedVariantIds:p})}return t},[y,a,d,$]);n(()=>{if(C.current){const e=C.current.offsetWidth,t=window.innerWidth<=768;w(t?Math.min(.95*e,280):Math.min(.8*e,320))}},[I.length]);const z=Math.max(0,I.length-1);n(()=>{b>z&&h(z)},[z,b]);const F=()=>{h(e=>0===e?z:e-1)},D=()=>{h(e=>e===z?0:e+1)};if(!y||!I.length)return null;return e.createElement(Za,null,e.createElement(Ka,null,e.createElement(Ja,{style:{color:p}},e.createElement(el,null,"STEAL"),e.createElement(tl,null,"DEALS")),N?e.createElement(il,null,"Max ",B," claims reached"):$?e.createElement(rl,null,e.createElement(Q,{size:10}),"UNLOCKED"):e.createElement(nl,null,e.createElement(ol,null),"minimum_order_value"===(y.customCartProgressBarCriteria??"minimum_order_value")?e.createElement(e.Fragment,null,"UNLOCK AT ",S,y.minimumOrderValue):e.createElement(e.Fragment,null,"UNLOCK AT ",y.quantityThreshold," ITEMS"))),e.createElement(al,{ref:C,onTouchStart:e=>{E.current=e.touches[0].clientX,k.current=e.touches[0].clientY},onTouchMove:e=>{if(null===E.current||null===k.current)return;const t=e.touches[0].clientX-E.current,n=e.touches[0].clientY-k.current;Math.abs(t)>10&&Math.abs(t)>Math.abs(n)&&e.preventDefault()},onTouchEnd:e=>{if(null===E.current)return;const t=e.changedTouches[0].clientX-E.current;Math.abs(t)>50&&(t<0?D():F()),E.current=null,k.current=null}},I.length>1&&e.createElement(pl,{onClick:F},e.createElement(g,{size:30,color:"#4D4D4D"})),e.createElement(sl,{position:"left",style:{display:"flex"}}),e.createElement(sl,{position:"right",style:{display:"flex"}}),e.createElement(ll,{$cardWidth:v},e.createElement(cl,{$translate:b*(v+10)},I.map(t=>{return e.createElement("div",{key:t.variantId,style:{width:`${v}px`,flexShrink:0},className:"yt-steal-deal-card"},e.createElement(ml,null,e.createElement(gl,null,e.createElement(xl,{src:(n=t.product,n?.featuredMedia?.preview?.image?.url??n?.featuredImage?.url??n?.images?.edges?.[0]?.node?.url??n?.image?.src??""),alt:t.product?.title??""}),t.discountPercent>0&&e.createElement(fl,null,"-",t.discountPercent,"% OFF")),e.createElement(yl,null,e.createElement(bl,null,t.product?.title??""),e.createElement(Cl,null,e.createElement(hl,null,e.createElement(vl,null,S,t.dealPrice.toLocaleString()),null!==t.strikeThroughPrice&&e.createElement(wl,null,S,t.strikeThroughPrice.toLocaleString())),e.createElement(El,{$locked:!t.isUnlocked||t.isClaimed||N,onClick:()=>(async e=>{if(e.isUnlocked&&!e.isClaimed&&!N&&s){if(e.allowedVariantIds.length>1){const t=e.product?.variants?.edges??e.product?.variants?.nodes??[];if(e.allowedVariantIds.some(n=>t.some(t=>{const o=t?.node??t;return(String(o?.id??"").split("/").pop()===n||String(o?.id??"").includes(n))&&Jr(e.product,o)}))){const t=e.product?.id?.split("/").pop();return void f({open:!0,variantId:e.variantId,handle:e.product?.handle,freebieSelection:!0,stealDealSelection:!0,productId:t,allowedVariantIds:e.allowedVariantIds})}}m(!0,!0);try{await s(e.variantId,e.allowedVariantIds),window.dispatchEvent(new CustomEvent("yt:autoFreebieAdded"))}catch(e){}finally{m(!1,!1)}}})(t),disabled:!t.isUnlocked||t.isClaimed||N},t.isUnlocked?e.createElement(U,{size:12}):e.createElement(Y,{size:12}))))));var n}))),I.length>1&&e.createElement(ul,{onClick:D},e.createElement(x,{size:30,color:"#4D4D4D"}))))},Bl=c.div`
2437
2428
  line-height: normal;
2438
2429
  position: ${e=>e.$enableCustomCartOnCartPage&&e.$isCartPage?"relative":"fixed"};
2439
2430
  top: ${e=>e.$enableCustomCartOnCartPage&&e.$isCartPage?"auto":"0"};
@@ -2456,7 +2447,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2456
2447
  width: ${e=>e.$switchWidthVariant||e.$enableCustomCartOnCartPage&&e.$isCartPage&&!e.$isLargeScreen?"100%":"91%"};
2457
2448
  max-width: ${e=>e.$switchWidthVariant||e.$enableCustomCartOnCartPage&&e.$isCartPage&&!e.$isLargeScreen?"100%":"97%"};
2458
2449
  }
2459
- `,Bl=c.span`
2450
+ `,Nl=c.span`
2460
2451
  background-color: ${e=>e.$backgroundSubdued||"#e1e1e1"};
2461
2452
  border-radius: 50%;
2462
2453
  width: 14px;
@@ -2468,7 +2459,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2468
2459
  font-weight: 400;
2469
2460
  min-width: 14px;
2470
2461
  line-height: 14px;
2471
- `,Nl=({isOpen:o,setIsOpen:i,backgroundColor:a="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:g,emptyCartButtons:x,removeCartItem:f,handleIncrement:y,handleDecrement:b,addCartItem:h,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:$,discountApplied:B,removeDiscount:N,applyDiscount:I,checkoutFunction:z,joinNowFunction:F,guestLoyaltyPercentage:D,isDev:P,recProductsList:_,showMultiStepProgressBar:R,cartCheckpoints:O,redemptionRate:L,pointsRewardRate:M,showCartLevelAltPay:W,exploreCtaRedirectLink:H,discountAmountApplied:q,minimumCartValue:Q,discountInCheckoutButton:U,isStickyCheckout:Y,handleCheckpointCrossed:G,customCartProgressBarCriteria:X,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:le,emptyProductRecsTitleText:ce,showProductRecsOnDesktop:se,showProductRecsOnMobile:de,themeColor:pe,themeTextColor:ue,companyName:me,gstNumber:ge,showGSTOption:xe,applyGSTToCart:fe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:he=!1,freeProductAdjustedCartTotal:ve,minimumOrderValueToAvailDiscount:we,signinCTAButtonVisible:Ce,cartSigninCTAMainText:Ee,applyNoteToCart:ke,note:Te,showNoteOption:Se,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Be,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:Ie,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:De,freebieProductsInCart:Pe,showFreebieClaim:Ae,addFreebieToCart:_e,freebiesInCart:Re,effectiveQuantityForProgressBar:Oe,productPercentageOffMapping:Le,removeFreebieFromCart:Me,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:je=!1,getProductDetailsByVariantId:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,giftWrapSetupData:et,giftWrapProductDetail:tt,progressBarFreeProductIconType:nt,enableCustomCartOnCartPage:ot,isCartPage:rt,showCartTimer:it,showFreebieMilestone:at,freebieMilestoneData:lt,cartTimerInMinutes:ct,cartTimerCustomText:st,productRecsCardLayout:dt,productRecsCardListVariant:pt,imageAspectSelector:ut,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,cartOffersCarousalData:xt,gstSectionCustomizationData:ft,noteSectionTitle:yt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,showVariantSelectionDropdownInProductClaim:vt,loyaltyDiscount:wt,brandTokenName:Ct,showDiscountOnMRP:Et,switchWidthVariant:kt,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,toggleDecimal:Bt,cartOffersCarouselHeight:Nt,disableCheckoutButton:It,showEmptyCartRecommendations:zt=!1,checkoutButtonBottomSpacing:Ft,applyCouponCode:Dt,showApplyCoupon:Pt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Ot,stealDealProducts:Lt,stealDealAddToCart:Mt,showCouponOptions:Vt,rewardCoupons:jt,applyTemplateDiscount:Wt,useCartShell:Ht,showTrustedBadge:qt,trustedBadgeData:Qt})=>{const Gt=ae(Ut),nn=ae(Kt),[on,rn]=t(!1),[an,ln]=t(!1),[cn,sn]=t(!0),{setLoading:dn}=Jt();e.useEffect(()=>{ze&&ze(dn)},[ze]);const pn=r(!!Ht&&(window.ytCartShellState?.isOpen??!1)),un=r(null),mn=r(null);n(()=>{const e=()=>{i(!1)};return o?(pn.current||(un.current=window.history.state,mn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),pn.current=!0):(pn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(un.current,"",mn.current??window.location.href),pn.current=!1),()=>{window.removeEventListener("popstate",e)}},[o,i]);const[gn,xn]=t(!1);n(()=>{const e=document.querySelector("body");e&&(ot&&rt?e.classList.remove("drawer-open"):!gn&&o?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[o,ot,rt,gn]),n(()=>{function e(){const e=window.innerWidth;xn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const fn=Gt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{rn(!0),window.setTimeout(()=>rn(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[yn,bn]=t("normal"),[hn,vn]=t("normal"),[wn,Cn]=t("auto");n(()=>{CSS.supports("font-weight","500")?bn("500"):CSS.supports("font-weight","400")?bn("400"):CSS.supports("font-weight","600")&&bn("600"),CSS.supports("font-weight","400")?vn("400"):CSS.supports("font-weight","300")?vn("300"):CSS.supports("font-weight","200")&&vn("200"),CSS.supports("width","-webkit-fill-available")?Cn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Cn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",yn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",hn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",wn)},[yn,hn]);const[En]=ie(Yt),[kn]=ie(Zt),[Tn]=ie(Xt);n(()=>{sn(!("all-products"!==Ge&&("specific-tags"!==Ge||En.isPostalCodeValid||Xe)&&("specific-tags"!==Ge||En.isPostalCodeValid||kn||!Xe)&&("specific-tags"===Ge&&"standard"===Tn||an&&(Xe?En.isPostalCodeValid&&kn:En.isPostalCodeValid))))},[En.isPostalCodeValid,kn,an,Ge,Xe]),ie(en);const[Sn,$n]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&$n(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&$n(!1)},[]);const Bn=new Date("2024-11-01");tn(Gt?.items_subtotal_price,Gt?.currency);const Nn=Ht?document.getElementById("yt-cart-shell-content"):null,In=e.createElement(e.Fragment,null,nn.cartLoading?e.createElement("div",{className:"yt-cart-loader-overlay",style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},nn.showLoader&&!nn.showSkeletonLoader&&e.createElement("div",{className:"loader"},"‎")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",{className:"yt-cart-header"},e.createElement("div",{className:"yt-cart-header-row",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:te,fontSize:"16px"}},e.createElement("span",{className:"yt-cart-title-text",style:{whiteSpace:"nowrap",flexShrink:0}},u),Gt?.item_count>0&&W&&!(he&&W)&&M>0&&e.createElement(Ga,{pointsRewardRate:M,loyaltyIcon:k,brandTokenName:Ct,themeColor:pe,themeTextColor:ue,rewardMultiplier:S}),fn>0&&e.createElement(Bl,{$backgroundSubdued:l},fn)),e.createElement("div",{className:"yt-cart-header-actions",style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(ot&&rt)&&e.createElement("div",{className:"yt-cart-close-button close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(oe,{style:{height:"auto",width:"auto",color:te},fontSize:24,cursor:"pointer",onClick:()=>{i(!o)}})))),nn&&e.createElement(qa,{$themeColor:pe,show:nn.showLoader}),xt?.enableCartOffersCarousel&&e.createElement(Va,{themeColor:pe,cartOffersCarousalData:xt,cartOffersCarouselHeight:Nt,cartData:Gt}),it&&Sn&&Gt?.item_count?e.createElement(ha,{minutes:ct,customText:st,onTimerComplete:()=>{$n(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,on&&At&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3}}),$e?e.createElement(oa,{inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Be,themeColor:pe,tooltipText:Ne,themeTextColor:ue}):null),R&&Gt?.items_subtotal_price>0&&Gt?.currency&&!!O&&function(e,t,n,o,r){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===o?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[xo(o)]&&("minimum_order_value"!==o||1!==e?.[xo(o)])).some((e,a)=>fo(e,a,i,r,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:o,checkpoints:i}).progressPercentage>0)}(O,tn(void 0!==De?De:Gt?.items_subtotal_price,Gt.currency),void 0===Oe?Gt?.item_count:Oe,X??"minimum_order_value",Gt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(Io,{customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:G,checkpoints:O,effectiveQuantityForProgressBar:void 0===Oe?Gt?.item_count:Oe,currentCartAmount:tn(void 0!==De?De:Gt?.items_subtotal_price,Gt.currency),themeColor:pe,themeTextColor:ue,primaryTextColor:te,secondaryTextColor:ne,showMOVForProgressTiers:ye,progressBarFreeProductIconType:nt,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,enableConfetti:At})),Gt?.item_count>0&&e.createElement("div",{className:"yt-cart-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),0===Gt?.items?.length&&0===Gt?.item_count&&!1===nn?.showSkeletonLoader?e.createElement(Do,{showLoyaltyCta:he,joinNowFunction:F,emptyCartTitle:m,emptyCartDescription:g,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:H,themeColor:pe,emptyCartButtons:x,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,themeTextColor:ue,recProductsList:_,addCartItem:h,productRecsCtaButtonText:re,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,emptyProductRecsTitleText:ce,backgroundSubdued:l,showEmptyCartRecommendations:zt,tertiaryColor:c,tertiaryTextColor:s}):e.createElement("div",{className:"yt-cart-scroll-area",style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},e.createElement(Pr,{isDev:P,themeColor:pe,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:te,secondaryTextColor:ne,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:Ie,productPercentageOffMapping:Le,removeFreebieFromCart:Me,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ue??[],cartCheckpoints:O,freeProductAdjustedCartTotal:ve,imageAspectSelector:ut,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,giftWrapVariantId:tt?.variants?.nodes[0]?.id,giftWrapProductId:et?.giftProductId,showGiftWrapAsLineItem:et?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s,backgroundColor:a,showDiscountOnMRP:Et,checkoutSectionMessage:bt,checkoutSectionMessageRedirectLink:_t,showFreebieMilestone:at,freebieMilestoneData:lt,freeLabelText:Ye?.freeLabelText}),Ot&&Ot.length>0&&Lt&&Lt.length>0&&Gt?.item_count>0&&e.createElement(Sl,{stealDealCheckpoints:Ot,stealDealProducts:Lt,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Oe,addFreebieToCart:Mt??_e,freebiesInCart:Re??[],themeColor:pe,primaryTextColor:te,secondaryTextColor:ne}),gn&&se&&!!_&&_?.length>0&&Gt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,productRecsTitleText:le,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:s}),!gn&&de&&!!_&&_?.length>0&&Gt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,productRecsTitleText:le,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s}),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Xa,{showDiscountOnMRP:Et,cartCheckpoints:O,toggleDecimal:Bt,primaryTextColor:te,discountApplied:B,showTrustedBadge:qt,discountAmountApplied:q})),e.createElement(qo,null,Gt?.item_count>0&&w&&C&&e.createElement(Ar,{bundleProducts:C}),xe&&!!fe&&Gt?.item_count>0&&e.createElement(Zr,{companyName:me,gstNumber:ge,themeColor:pe,iconColor:ft?.iconColor,showIcon:ft?.showIcon,backgroundColor:ft?.backgroundColor,textColor:ft?.textColor,title:ft?.title}),!!Gt&&Gt?.item_count>0&&!!_e&&!!Pe&&!!Re&&Pe.length>0&&e.createElement(na,{freebieProductsInCart:Pe,themeColor:pe,themeTextColor:ue,primaryTextColor:te,addFreebieToCart:_e,freebiesInCart:Re,imageAspectSelector:ut,freebieCouponTemplates:Qe,freebieClaimData:Ye,cartCheckpoints:O,isCartDrawerOpen:o}),je&&(Ve?.length??0)>0&&!!He&&Gt?.item_count>0&&e.createElement("div",{className:"yt-cart-geolocation-section form-group"},e.createElement("div",{className:"yt-cart-shipping-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>sn(!cn)},e.createElement("span",{className:"yt-cart-shipping-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(K,null)),e.createElement("div",{className:"yt-cart-shipping-toggle-icon icon-transition"},cn?e.createElement(V,null):e.createElement(j,null))),"all-products"===Ge&&cn?e.createElement(aa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Bn}):cn&&(an?e.createElement(aa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Bn}):e.createElement(la,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,disabledDates:Bn}))),Se&&!!ke&&Gt?.item_count>0&&e.createElement(Kr,{note:Te,noteSectionTitle:yt}),et?.showGiftWrapOption&&Gt?.item_count>0&&e.createElement(fa,{themeColor:pe,id:et?.giftProductId,detail:tt,showPrice:et?.showPrice,errorText:et?.errorText,customText:et?.customText,showGiftIcon:et?.showGiftIcon,showProductImage:et?.showProductImage,addCartItem:h,removeCartItem:f}),Gt?.item_count>0&&Vt&&jt&&Dt&&!he&&e.createElement(Or,{rewardCoupons:jt,applyCouponCode:Dt,removeDiscount:N,enableConfetti:At,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt}),Gt?.item_count>0&&Pt&&!Vt&&!he&&Dt&&e.createElement(_r,{backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt,applyCouponCode:Dt,removeDiscount:N,enableConfetti:At}),e.createElement("div",null,Gt?.item_count>0&&e.createElement(e.Fragment,null,v||!he||wt?!wt&&void 0!==E&&void 0!==T&&!!k&&he&&!!I&&e.createElement(Zo,{themeColor:pe,applyDiscount:I,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:we,brandTokenName:Ct,showCartLevelAltPay:W,redemptionMultiplier:$}):!!D&&!!F&&e.createElement(Wo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:Ce,themeColor:pe,joinNowFunction:F,guestLoyaltyPercentage:D,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,showCartLevelAltPay:W})),Gt?.item_count>0&&!!wt&&!!N&&he&&wt&&void 0!==T&&e.createElement(Uo,{themeColor:pe,removeDiscount:N,loyaltyDiscount:wt,isDev:P,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:Ct,showCartLevelAltPay:W}),he&&W&&L&&k&&Gt?.item_count>0&&e.createElement(Ua,{loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:te,pointsRewardRate:M,rewardMultiplier:S})),he&&Gt&&Gt.item_count>0&&!!we&&we>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:pe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:Ce?"space-between":"center"}},"Minimum order value to use ",Ct,":"," ",we),Gt&&z&&Gt?.item_count>0&&e.createElement("div",{className:"yt-cart-checkout-wrapper"},e.createElement(Oo,{disableCheckoutButton:!!It||nn.cartLoading,discountApplied:B,checkoutFunction:z,checkoutButtonColor:Z,checkoutFontSize:p,discountInCheckoutButton:U,isStickyCheckout:Y,discountAmountApplied:q,minimumCartValue:Q,themeTextColor:ue,applyGSTToCart:fe,showGSTOption:xe,applyNoteToCart:ke,showNoteOption:Se,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:He,enableSlotPicker:Xe,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,checkoutSectionMessageRedirectLink:_t,showDiscountOnMRP:Et,tertiaryColor:c,tertiaryTextColor:s,cartCheckpoints:O,toggleDecimal:Bt,checkoutButtonBottomSpacing:Ft,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:te,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:qt,trustedBadgeData:Qt}))))));return Ht&&Nn?A(In,Nn):e.createElement($l,{className:"yt-cart-drawer",$isDev:P,$isOpen:o,$backgroundColor:a,$enableCustomCartOnCartPage:ot,$isCartPage:rt,$isLargeScreen:gn,$switchWidthVariant:kt},In)};gt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}');const Il=c.div`
2462
+ `,Il=({isOpen:o,setIsOpen:i,backgroundColor:a="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:g,emptyCartButtons:x,removeCartItem:f,handleIncrement:y,handleDecrement:b,addCartItem:h,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:$,discountApplied:B,removeDiscount:N,applyDiscount:I,checkoutFunction:z,joinNowFunction:F,guestLoyaltyPercentage:D,isDev:P,recProductsList:_,showMultiStepProgressBar:R,cartCheckpoints:O,redemptionRate:L,pointsRewardRate:M,showCartLevelAltPay:W,exploreCtaRedirectLink:H,discountAmountApplied:q,minimumCartValue:Q,discountInCheckoutButton:U,isStickyCheckout:Y,handleCheckpointCrossed:G,customCartProgressBarCriteria:X,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:le,emptyProductRecsTitleText:ce,showProductRecsOnDesktop:se,showProductRecsOnMobile:de,themeColor:pe,themeTextColor:ue,companyName:me,gstNumber:ge,showGSTOption:xe,applyGSTToCart:fe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:he=!1,freeProductAdjustedCartTotal:ve,minimumOrderValueToAvailDiscount:we,signinCTAButtonVisible:Ce,cartSigninCTAMainText:Ee,applyNoteToCart:ke,note:Te,showNoteOption:Se,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Be,cartOfferTermsAndConditionsText:Ne,showEditOptionOnProducts:Ie,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:De,freebieProductsInCart:Pe,showFreebieClaim:Ae,addFreebieToCart:_e,freebiesInCart:Re,effectiveQuantityForProgressBar:Oe,productPercentageOffMapping:Le,removeFreebieFromCart:Me,postalCodeList:Ve,enableGeoLocationDeliveryRestriction:je=!1,getProductDetailsByVariantId:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,giftWrapSetupData:et,giftWrapProductDetail:tt,progressBarFreeProductIconType:nt,enableCustomCartOnCartPage:ot,isCartPage:rt,showCartTimer:it,showFreebieMilestone:at,freebieMilestoneData:lt,cartTimerInMinutes:ct,cartTimerCustomText:st,productRecsCardLayout:dt,productRecsCardListVariant:pt,imageAspectSelector:ut,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,cartOffersCarousalData:xt,gstSectionCustomizationData:ft,noteSectionTitle:yt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,showVariantSelectionDropdownInProductClaim:vt,loyaltyDiscount:wt,brandTokenName:Ct,showDiscountOnMRP:Et,switchWidthVariant:kt,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,toggleDecimal:Bt,cartOffersCarouselHeight:Nt,disableCheckoutButton:It,showEmptyCartRecommendations:zt=!1,checkoutButtonBottomSpacing:Ft,applyCouponCode:Dt,showApplyCoupon:Pt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Ot,stealDealProducts:Lt,stealDealAddToCart:Mt,showCouponOptions:Vt,rewardCoupons:jt,applyTemplateDiscount:Wt,useCartShell:Ht,showTrustedBadge:qt,trustedBadgeData:Qt})=>{const Gt=ae(Ut),nn=ae(Kt),[on,rn]=t(!1),[an,ln]=t(!1),[cn,sn]=t(!0),{setLoading:dn}=Jt();e.useEffect(()=>{ze&&ze(dn)},[ze]);const pn=r(!!Ht&&(window.ytCartShellState?.isOpen??!1)),un=r(null),mn=r(null);n(()=>{const e=()=>{i(!1)};return o?(pn.current||(un.current=window.history.state,mn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),pn.current=!0):(pn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(un.current,"",mn.current??window.location.href),pn.current=!1),()=>{window.removeEventListener("popstate",e)}},[o,i]);const[gn,xn]=t(!1);n(()=>{const e=document.querySelector("body");e&&(ot&&rt?e.classList.remove("drawer-open"):!gn&&o?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[o,ot,rt,gn]),n(()=>{function e(){const e=window.innerWidth;xn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const fn=Gt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{rn(!0),window.setTimeout(()=>rn(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[yn,bn]=t("normal"),[hn,vn]=t("normal"),[wn,Cn]=t("auto");n(()=>{CSS.supports("font-weight","500")?bn("500"):CSS.supports("font-weight","400")?bn("400"):CSS.supports("font-weight","600")&&bn("600"),CSS.supports("font-weight","400")?vn("400"):CSS.supports("font-weight","300")?vn("300"):CSS.supports("font-weight","200")&&vn("200"),CSS.supports("width","-webkit-fill-available")?Cn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Cn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",yn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",hn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",wn)},[yn,hn]);const[En]=ie(Yt),[kn]=ie(Zt),[Tn]=ie(Xt);n(()=>{sn(!("all-products"!==Ge&&("specific-tags"!==Ge||En.isPostalCodeValid||Xe)&&("specific-tags"!==Ge||En.isPostalCodeValid||kn||!Xe)&&("specific-tags"===Ge&&"standard"===Tn||an&&(Xe?En.isPostalCodeValid&&kn:En.isPostalCodeValid))))},[En.isPostalCodeValid,kn,an,Ge,Xe]),ie(en);const[Sn,$n]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&$n(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&$n(!1)},[]);const Bn=new Date("2024-11-01");tn(Gt?.items_subtotal_price,Gt?.currency);const Nn=Ht?document.getElementById("yt-cart-shell-content"):null,In=e.createElement(e.Fragment,null,nn.cartLoading?e.createElement("div",{className:"yt-cart-loader-overlay",style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},nn.showLoader&&!nn.showSkeletonLoader&&e.createElement("div",{className:"loader"},"‎")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",{className:"yt-cart-header"},e.createElement("div",{className:"yt-cart-header-row",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:te,fontSize:"16px"}},e.createElement("span",{className:"yt-cart-title-text",style:{whiteSpace:"nowrap",flexShrink:0}},u),Gt?.item_count>0&&W&&!(he&&W)&&M>0&&e.createElement(Ga,{pointsRewardRate:M,loyaltyIcon:k,brandTokenName:Ct,themeColor:pe,themeTextColor:ue,rewardMultiplier:S}),fn>0&&e.createElement(Nl,{$backgroundSubdued:l},fn)),e.createElement("div",{className:"yt-cart-header-actions",style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(ot&&rt)&&e.createElement("div",{className:"yt-cart-close-button close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(oe,{style:{height:"auto",width:"auto",color:te},fontSize:24,cursor:"pointer",onClick:()=>{i(!o)}})))),nn&&e.createElement(qa,{$themeColor:pe,show:nn.showLoader}),xt?.enableCartOffersCarousel&&e.createElement(Va,{themeColor:pe,cartOffersCarousalData:xt,cartOffersCarouselHeight:Nt,cartData:Gt}),it&&Sn&&Gt?.item_count?e.createElement(ha,{minutes:ct,customText:st,onTimerComplete:()=>{$n(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,on&&At&&e.createElement(vo,{particleCount:50,spread:90,origin:{y:.3}}),$e?e.createElement(oa,{inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Be,themeColor:pe,tooltipText:Ne,themeTextColor:ue}):null),R&&Gt?.items_subtotal_price>0&&Gt?.currency&&!!O&&function(e,t,n,o,r){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===o?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[xo(o)]&&("minimum_order_value"!==o||1!==e?.[xo(o)])).some((e,a)=>fo(e,a,i,r,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:o,checkpoints:i}).progressPercentage>0)}(O,tn(void 0!==De?De:Gt?.items_subtotal_price,Gt.currency),void 0===Oe?Gt?.item_count:Oe,X??"minimum_order_value",Gt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(Io,{customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:G,checkpoints:O,effectiveQuantityForProgressBar:void 0===Oe?Gt?.item_count:Oe,currentCartAmount:tn(void 0!==De?De:Gt?.items_subtotal_price,Gt.currency),themeColor:pe,themeTextColor:ue,primaryTextColor:te,secondaryTextColor:ne,showMOVForProgressTiers:ye,progressBarFreeProductIconType:nt,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,enableConfetti:At})),Gt?.item_count>0&&e.createElement("div",{className:"yt-cart-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),0===Gt?.items?.length&&0===Gt?.item_count&&!1===nn?.showSkeletonLoader?e.createElement(Do,{showLoyaltyCta:he,joinNowFunction:F,emptyCartTitle:m,emptyCartDescription:g,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:H,themeColor:pe,emptyCartButtons:x,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,themeTextColor:ue,recProductsList:_,addCartItem:h,productRecsCtaButtonText:re,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,emptyProductRecsTitleText:ce,backgroundSubdued:l,showEmptyCartRecommendations:zt,tertiaryColor:c,tertiaryTextColor:s}):e.createElement("div",{className:"yt-cart-scroll-area",style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},e.createElement(Pr,{isDev:P,themeColor:pe,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:te,secondaryTextColor:ne,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:Ie,productPercentageOffMapping:Le,removeFreebieFromCart:Me,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ue??[],cartCheckpoints:O,freeProductAdjustedCartTotal:ve,imageAspectSelector:ut,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,giftWrapVariantId:tt?.variants?.nodes[0]?.id,giftWrapProductId:et?.giftProductId,showGiftWrapAsLineItem:et?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s,backgroundColor:a,showDiscountOnMRP:Et,checkoutSectionMessage:bt,checkoutSectionMessageRedirectLink:_t,showFreebieMilestone:at,freebieMilestoneData:lt,freeLabelText:Ye?.freeLabelText}),Ot&&Ot.length>0&&Lt&&Lt.length>0&&Gt?.item_count>0&&e.createElement($l,{stealDealCheckpoints:Ot,stealDealProducts:Lt,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Oe,addFreebieToCart:Mt??_e,freebiesInCart:Re??[],themeColor:pe,primaryTextColor:te,secondaryTextColor:ne}),gn&&se&&!!_&&_?.length>0&&Gt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,productRecsTitleText:le,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:s}),!gn&&de&&!!_&&_?.length>0&&Gt?.item_count>0&&h&&e.createElement(Yn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,productRecsTitleText:le,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s}),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Xa,{showDiscountOnMRP:Et,cartCheckpoints:O,toggleDecimal:Bt,primaryTextColor:te,discountApplied:B,showTrustedBadge:qt,discountAmountApplied:q})),e.createElement(qo,null,Gt?.item_count>0&&w&&C&&e.createElement(Ar,{bundleProducts:C}),xe&&!!fe&&Gt?.item_count>0&&e.createElement(Zr,{companyName:me,gstNumber:ge,themeColor:pe,iconColor:ft?.iconColor,showIcon:ft?.showIcon,backgroundColor:ft?.backgroundColor,textColor:ft?.textColor,title:ft?.title}),!!Gt&&Gt?.item_count>0&&!!_e&&!!Pe&&!!Re&&Pe.length>0&&e.createElement(na,{freebieProductsInCart:Pe,themeColor:pe,themeTextColor:ue,primaryTextColor:te,addFreebieToCart:_e,freebiesInCart:Re,imageAspectSelector:ut,freebieCouponTemplates:Qe,freebieClaimData:Ye,cartCheckpoints:O,isCartDrawerOpen:o}),je&&(Ve?.length??0)>0&&!!He&&Gt?.item_count>0&&e.createElement("div",{className:"yt-cart-geolocation-section form-group"},e.createElement("div",{className:"yt-cart-shipping-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>sn(!cn)},e.createElement("span",{className:"yt-cart-shipping-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(K,null)),e.createElement("div",{className:"yt-cart-shipping-toggle-icon icon-transition"},cn?e.createElement(V,null):e.createElement(j,null))),"all-products"===Ge&&cn?e.createElement(aa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Bn}):cn&&(an?e.createElement(aa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Bn}):e.createElement(la,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,disabledDates:Bn}))),Se&&!!ke&&Gt?.item_count>0&&e.createElement(Kr,{note:Te,noteSectionTitle:yt}),et?.showGiftWrapOption&&Gt?.item_count>0&&e.createElement(fa,{themeColor:pe,id:et?.giftProductId,detail:tt,showPrice:et?.showPrice,errorText:et?.errorText,customText:et?.customText,showGiftIcon:et?.showGiftIcon,showProductImage:et?.showProductImage,addCartItem:h,removeCartItem:f}),Gt?.item_count>0&&Vt&&jt&&Dt&&!he&&e.createElement(Or,{rewardCoupons:jt,applyCouponCode:Dt,removeDiscount:N,enableConfetti:At,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt}),Gt?.item_count>0&&Pt&&!Vt&&!he&&Dt&&e.createElement(_r,{backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt,applyCouponCode:Dt,removeDiscount:N,enableConfetti:At}),e.createElement("div",null,Gt?.item_count>0&&e.createElement(e.Fragment,null,v||!he||wt?!wt&&void 0!==E&&void 0!==T&&!!k&&he&&!!I&&e.createElement(Zo,{themeColor:pe,applyDiscount:I,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:we,brandTokenName:Ct,showCartLevelAltPay:W,redemptionMultiplier:$}):!!D&&!!F&&e.createElement(Wo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:Ce,themeColor:pe,joinNowFunction:F,guestLoyaltyPercentage:D,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,showCartLevelAltPay:W})),Gt?.item_count>0&&!!wt&&!!N&&he&&wt&&void 0!==T&&e.createElement(Uo,{themeColor:pe,removeDiscount:N,loyaltyDiscount:wt,isDev:P,ctaButtonBackgroundColor:J,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:Ct,showCartLevelAltPay:W}),he&&W&&L&&k&&Gt?.item_count>0&&e.createElement(Ua,{loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:te,pointsRewardRate:M,rewardMultiplier:S})),he&&Gt&&Gt.item_count>0&&!!we&&we>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:pe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:Ce?"space-between":"center"}},"Minimum order value to use ",Ct,":"," ",we),Gt&&z&&Gt?.item_count>0&&e.createElement("div",{className:"yt-cart-checkout-wrapper"},e.createElement(Oo,{disableCheckoutButton:!!It||nn.cartLoading,discountApplied:B,checkoutFunction:z,checkoutButtonColor:Z,checkoutFontSize:p,discountInCheckoutButton:U,isStickyCheckout:Y,discountAmountApplied:q,minimumCartValue:Q,themeTextColor:ue,applyGSTToCart:fe,showGSTOption:xe,applyNoteToCart:ke,showNoteOption:Se,enableGeoLocationDeliveryRestriction:je,applyPostalCodeAndDeliverySlotToCart:He,enableSlotPicker:Xe,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,checkoutSectionMessageRedirectLink:_t,showDiscountOnMRP:Et,tertiaryColor:c,tertiaryTextColor:s,cartCheckpoints:O,toggleDecimal:Bt,checkoutButtonBottomSpacing:Ft,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:te,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:qt,trustedBadgeData:Qt}))))));return Ht&&Nn?A(In,Nn):e.createElement(Bl,{className:"yt-cart-drawer",$isDev:P,$isOpen:o,$backgroundColor:a,$enableCustomCartOnCartPage:ot,$isCartPage:rt,$isLargeScreen:gn,$switchWidthVariant:kt},In)};gt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}');const zl=c.div`
2472
2463
  display: flex;
2473
2464
  flex-direction: row;
2474
2465
  height: 100%;
@@ -2491,14 +2482,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2491
2482
  &:disabled {
2492
2483
  cursor: not-allowed;
2493
2484
  }
2494
- `;const zl=c.div`
2485
+ `;const Fl=c.div`
2495
2486
  display: flex;
2496
2487
  align-items: center;
2497
2488
  justify-content: center;
2498
2489
  border: 0;
2499
2490
  width: 100%;
2500
2491
  font-size: 14px;
2501
- `,Fl=c.button`
2492
+ `,Dl=c.button`
2502
2493
  font-weight: 600;
2503
2494
  width: 100%;
2504
2495
  cursor: pointer;
@@ -2523,7 +2514,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2523
2514
  background-color: #e7e7e7;
2524
2515
  color: rgba(0, 0, 0, 0.44);
2525
2516
  }
2526
- `,Dl=c.div`
2517
+ `,Pl=c.div`
2527
2518
  position: absolute;
2528
2519
  background-color: "#e7e7e7";
2529
2520
  top: 0;
@@ -2539,7 +2530,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2539
2530
  &.visible {
2540
2531
  transform: translateX(0); /* Slide in from the left */
2541
2532
  }
2542
- `,Pl=c.div`
2533
+ `,Al=c.div`
2543
2534
  background-color: ${({backgroundColor:e})=>e||"#fff"};
2544
2535
  display: flex;
2545
2536
  flex-direction: column;
@@ -2554,7 +2545,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2554
2545
  box-shadow 0.6s ease;
2555
2546
  overflow: hidden;
2556
2547
  ${({shadowType:e})=>"none"===e?"box-shadow: none;":"spread"===e?"box-shadow: 8px 8px 8px -6px #0000004D;":"no-spread"===e?"box-shadow: 6px 6px 0px -1px #00000033;":void 0}
2557
- `,Al=c.div`
2548
+ `,_l=c.div`
2558
2549
  display: flex;
2559
2550
  position: relative;
2560
2551
  flex-direction: column;
@@ -2568,7 +2559,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2568
2559
  border-top-left-radius: ${({borderRadius:e})=>e};
2569
2560
  border-top-right-radius: ${({borderRadius:e})=>e};
2570
2561
  transition: transform 0.3s ease;
2571
- `;const _l=c.select`
2562
+ `;const Rl=c.select`
2572
2563
  border: 1px solid #c7c7c7;
2573
2564
  padding: 8px;
2574
2565
  position: absolute;
@@ -2589,7 +2580,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2589
2580
 
2590
2581
  background-image: none !important;
2591
2582
  marginbottom: 0 !important;
2592
- `,Rl=c.div`
2583
+ `,Ol=c.div`
2593
2584
  font-size: 18px;
2594
2585
  padding: ${({showBorder:e})=>e?"0 10px":"0 4px"};
2595
2586
  font-weight: var(--yt-bundle-font-weight, bold);
@@ -2604,11 +2595,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2604
2595
  `;c.div`
2605
2596
  margin-bottom: 5px;
2606
2597
  padding: ${({showBorder:e})=>e?"0 10px":"0 4px"};
2607
- `;const Ol=c.div`
2598
+ `;const Ll=c.div`
2608
2599
  position: relative;
2609
2600
  width: 100%;
2610
2601
  height: 40px;
2611
- `;c(Fl)`
2602
+ `;c(Dl)`
2612
2603
  background-color: #747474;
2613
2604
  border-radius: ${({borderRadius:e})=>e};
2614
2605
  color: #fff;
@@ -2616,7 +2607,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2616
2607
  justify-content: space-between;
2617
2608
  overflow: hidden;
2618
2609
  height: 40px;
2619
- `;const Ll=c.div`
2610
+ `;const Ml=c.div`
2620
2611
  flex: 1;
2621
2612
  text-align: center;
2622
2613
  font-size: 14px;
@@ -2627,7 +2618,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2627
2618
  align-items: center;
2628
2619
  justify-content: center;
2629
2620
  cursor: default;
2630
- `,Ml=c.div`
2621
+ `,Vl=c.div`
2631
2622
  width: 25%;
2632
2623
  background-color: #111;
2633
2624
  display: flex;
@@ -2636,7 +2627,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2636
2627
  border-left: 1px solid #fff;
2637
2628
  height: 100%;
2638
2629
  cursor: pointer;
2639
- `,Vl=c.div`
2630
+ `,jl=c.div`
2640
2631
  display: flex;
2641
2632
  flex-direction: row;
2642
2633
  flex-wrap: wrap;
@@ -2648,7 +2639,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2648
2639
  justify-content: space-between;
2649
2640
 
2650
2641
  ${({isMobile:e})=>e&&"\n min-height: 30px;\n "}
2651
- `,jl=c.div`
2642
+ `,Wl=c.div`
2652
2643
  position: absolute;
2653
2644
  top: -20px;
2654
2645
  background-color: ${({primaryColor:e})=>e||"#000"};
@@ -2660,7 +2651,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2660
2651
  left: 0;
2661
2652
  }
2662
2653
  `}
2663
- `,Wl=c.div`
2654
+ `,Hl=c.div`
2664
2655
  color: #000;
2665
2656
  background-color: #f5f5f5;
2666
2657
  padding: 6px;
@@ -2670,19 +2661,19 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2670
2661
  /* heigh: 80px; */
2671
2662
  margin: 10px 0px;
2672
2663
  border: 1px solid #d3d3d3;
2673
- `,Hl=c.div`
2674
- width: 100%;
2675
2664
  `,ql=c.div`
2676
2665
  width: 100%;
2666
+ `,Ql=c.div`
2667
+ width: 100%;
2677
2668
  font-size: 14px;
2678
2669
  background-color: #e0e0e0;
2679
2670
  border-radius: 0;
2680
- `,Ql=c.div`
2671
+ `,Ul=c.div`
2681
2672
  width: 100%;
2682
2673
  background-color: #e0e0e0;
2683
2674
  height: 6px;
2684
2675
  border-radius: 0;
2685
- `,Ul=c.div`
2676
+ `,Yl=c.div`
2686
2677
  display: block;
2687
2678
  width: ${({progressPercentage:e})=>`${e}%`};
2688
2679
  background-color: ${({progressPercentage:e,primaryColor:t})=>100===e?"#4caf50":t||"black"};
@@ -2690,14 +2681,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2690
2681
  transition:
2691
2682
  width 0.3s ease-in-out,
2692
2683
  background-color 0.5s ease-in-out;
2693
- `,Yl=c.div`
2684
+ `,Gl=c.div`
2694
2685
  display: flex;
2695
2686
  flex-direction: row;
2696
2687
  column-gap: ${({tierType:e})=>"productTier"===e?"0px":"10px"};
2697
2688
  max-width: ${({isMobile:e})=>e?"90%":"55%"};
2698
2689
  justify-content: flex-start;
2699
2690
  overflow-x: auto;
2700
- `,Gl=c.div`
2691
+ `,Xl=c.div`
2701
2692
  display: flex;
2702
2693
  flex-direction: row;
2703
2694
  align-items: center;
@@ -2723,7 +2714,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2723
2714
  background-size: cover;
2724
2715
  background-repeat: no-repeat;
2725
2716
  background-position: center;
2726
- `;const Xl=c.div`
2717
+ `;const Zl=c.div`
2727
2718
  position: absolute;
2728
2719
  top: 5px;
2729
2720
  left: 5px;
@@ -2732,7 +2723,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2732
2723
  padding: 2px 5px;
2733
2724
  border-radius: ${({borderRadius:e})=>e};
2734
2725
  font-size: 14px;
2735
- `,Zl=c.div.attrs({className:"yt-tracking-bar-item-remove-button"})`
2726
+ `,Kl=c.div.attrs({className:"yt-tracking-bar-item-remove-button"})`
2736
2727
  position: absolute;
2737
2728
  top: -8px;
2738
2729
  right: -8px;
@@ -2745,7 +2736,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2745
2736
  align-items: center;
2746
2737
  cursor: pointer;
2747
2738
  border-radius: 2px;
2748
- `,Kl=c.div`
2739
+ `,Jl=c.div`
2749
2740
  height: 85px;
2750
2741
  display: flex;
2751
2742
  flex-direction: row;
@@ -2756,7 +2747,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2756
2747
  max-width: 220px;
2757
2748
  border-radius: ${({borderRadius:e})=>e};
2758
2749
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
2759
- `,Jl=c.div`
2750
+ `,ec=c.div`
2760
2751
  position: relative;
2761
2752
  height: 75px;
2762
2753
  width: 75px;
@@ -2765,7 +2756,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2765
2756
  background-size: cover;
2766
2757
  background-repeat: no-repeat;
2767
2758
  background-position: center;
2768
- `,ec=c.div`
2759
+ `,tc=c.div`
2769
2760
  position: absolute;
2770
2761
  top: 5px;
2771
2762
  left: 5px;
@@ -2774,21 +2765,21 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2774
2765
  padding: 2px 5px;
2775
2766
  border-radius: 2px;
2776
2767
  font-size: 14px;
2777
- `,tc=c.div`
2768
+ `,nc=c.div`
2778
2769
  display: flex;
2779
2770
  flex-direction: column;
2780
2771
  row-gap: 8px;
2781
2772
  justify-content: flex-start;
2782
2773
  align-items: flex-start;
2783
2774
  text-align: left;
2784
- `,nc=c.span`
2775
+ `,oc=c.span`
2785
2776
  font-size: 14px;
2786
2777
  font-weight: 500;
2787
2778
  line-height: normal;
2788
- `,oc=c.span`
2779
+ `,rc=c.span`
2789
2780
  font-size: 13px;
2790
2781
  line-height: normal;
2791
- `,rc=c.div`
2782
+ `,ic=c.div`
2792
2783
  color: red;
2793
2784
  font-size: 10px;
2794
2785
  display: flex;
@@ -2796,7 +2787,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2796
2787
  column-gap: 3px;
2797
2788
  align-items: center;
2798
2789
  cursor: pointer;
2799
- `,ic=c.div`
2790
+ `,ac=c.div`
2800
2791
  width: ${({isMobile:e})=>e?"60px":"70px"};
2801
2792
  height: ${({isMobile:e})=>e?"60px":"70px"};
2802
2793
  border: 1px solid #d3d3d3;
@@ -2807,13 +2798,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2807
2798
  align-items: center;
2808
2799
  text-align: center;
2809
2800
  flex-shrink: 0;
2810
- `,ac=c.div`
2801
+ `,lc=c.div`
2811
2802
  display: flex;
2812
2803
  flex-direction: column;
2813
2804
  font-size: 18px;
2814
2805
  align-items: center;
2815
2806
  justify-content: center;
2816
- `,lc=c.span`
2807
+ `,cc=c.span`
2817
2808
  line-height: normal;
2818
2809
  color: black;
2819
2810
  align-self: center;
@@ -2821,7 +2812,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2821
2812
  display: flex;
2822
2813
  font-weight: 700;
2823
2814
  font-size: 16px;
2824
- `,cc=c.span`
2815
+ `,sc=c.span`
2825
2816
  font-size: 12px;
2826
2817
  color: #f6f8f7;
2827
2818
  padding: 4px 8px;
@@ -2832,21 +2823,21 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2832
2823
  @media (max-width: 600px) {
2833
2824
  padding: 2px 6px;
2834
2825
  }
2835
- `,sc=c.div`
2826
+ `,dc=c.div`
2836
2827
  display: flex;
2837
2828
  flex-direction: row;
2838
2829
  column-gap: 5px;
2839
2830
  font-size: 16px;
2840
2831
  margin: 5px 0px;
2841
2832
  align-items: flex-end;
2842
- `,dc=c.span`
2833
+ `,pc=c.span`
2843
2834
  font-weight: bold;
2844
2835
  text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1);
2845
- `,pc=c.span`
2836
+ `,uc=c.span`
2846
2837
  color: #a0a0a0;
2847
2838
  text-decoration-line: line-through;
2848
2839
  font-size: 14px;
2849
- `,uc=c.button`
2840
+ `,mc=c.button`
2850
2841
  padding: 5px 20px;
2851
2842
  height: 42px;
2852
2843
  outline: none;
@@ -2872,14 +2863,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2872
2863
  background-color: ${({canCheckout:e,progressPercentage:t,ctaColors:n})=>100===t&&e?n.ctaHoverBackgroundColor||"black":"#f4f4f6"};
2873
2864
  color: ${({canCheckout:e,progressPercentage:t,ctaColors:n})=>100===t&&e?n.ctaHoverTextColor||"#fff":"#000"};
2874
2865
  }
2875
- `,mc=c.div`
2866
+ `,gc=c.div`
2876
2867
  display: flex;
2877
2868
  flex-direction: row;
2878
2869
  column-gap: 6px;
2879
2870
  align-items: center;
2880
2871
  justify-content: center;
2881
2872
  font-weight: 650;
2882
- `,gc=c.div`
2873
+ `,xc=c.div`
2883
2874
  position: relative;
2884
2875
  margin-top: 8px;
2885
2876
  margin-right: 5px;
@@ -2895,7 +2886,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2895
2886
  `;c.div`
2896
2887
  display: flex;
2897
2888
  width: 100%;
2898
- `;const xc=c.div`
2889
+ `;const fc=c.div`
2899
2890
  position: relative;
2900
2891
  margin-top: ${({isMobile:e})=>e?"10px":"8px"};
2901
2892
  margin-right: 5px;
@@ -2908,7 +2899,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2908
2899
  background-repeat: no-repeat;
2909
2900
  background-position: center;
2910
2901
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
2911
- `,fc=c.div`
2902
+ `,yc=c.div`
2912
2903
  height: 85px;
2913
2904
  display: flex;
2914
2905
  flex-direction: row;
@@ -2919,14 +2910,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2919
2910
  max-width: 220px;
2920
2911
  border-radius: 5px;
2921
2912
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.1);
2922
- `,yc=c.div`
2913
+ `,bc=c.div`
2923
2914
  justify-content: center;
2924
2915
  align-items: center;
2925
2916
  margin: 0px 6px;
2926
2917
  text-align: center;
2927
2918
  display: flex;
2928
2919
  flex-shrink: 0;
2929
- `,bc=({tiers:t,isMobile:n=!1,selectedProductsByTier:o,selectedProducts:r,themeColor:i,showProductDetailsInTracker:a,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:s})=>e.createElement(e.Fragment,null,t.map((i,d)=>{const p=i.minimumQuantity-(o[d]?.length??0),u=r?.filter(e=>e.tierIndex===d);return Math.min(o[d]?.length/i.minimumQuantity*100,100),e.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},e.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},e.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(t=>{const r=t.product.variants?.edges?.find(e=>e.node.id===t.variantId),p=o[d]?.filter(e=>e===r?.node.id).length||0;return a?e.createElement(fc,{className:"yt-byob-tracker-detailed-product-item",key:t.variantId},e.createElement(Jl,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.isFree&&e.createElement("div",{style:{position:"absolute",bottom:4,left:"30%",background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"40px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},"FREE",e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),t?.quantity>1&&e.createElement(Xl,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},t.quantity,"x")),e.createElement(tc,{className:"yt-byob-tracker-info-block"},e.createElement(nc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(oc,{className:"yt-byob-tracker-product-price"},s,Cp(r?.node?.price)),e.createElement(Zl,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(t.variantId,d),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[d]?.length?{display:"none"}:{}}},e.createElement(lt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(xc,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url,style:{borderRadius:c||"12px"}},t?.isFree&&e.createElement("div",{style:{position:"absolute",top:4,left:4,background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"8px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},e.createElement(ot,null),e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),p>1&&e.createElement(Xl,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},p,"x"),e.createElement(Zl,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(t.variantId,d),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[d]?.length?{display:"none"}:{}}},e.createElement(J,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((t,o)=>e.createElement(ic,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:o},e.createElement(Fe,{size:40,color:"#A0A0A0"}))))),d<t.length-1&&e.createElement(yc,{className:"yt-byob-tracker-plus-icon-container"},e.createElement(Fe,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),hc=({builderTiers:o,handleAddToCart:r,minimumQuantity:i,selectedProducts:a,showProductDetailsInTracker:l,loading:c,handleRemoveItem:s,percentageOff:d,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:g,dealAmount:x,isMobile:f=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:h,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[E,k]=t(!1),[T,S]=t(0),[$,B]=t([]),[N,I]=t(0),[z,F]=t(0),[D,P]=t(!1),[A,_]=t(null),R=u?.price||0,O=o?.type,L=e=>{if(e<0||!$[e])return R;const t=$[e].discountValue??0;return d?R*(1-t/100):x?t:m?R-t:R};n(()=>{if(o&&"none"!==o.type)if("productTier"===O&&o.productTier){const e=o.productTier||[];B(e);let t=0;o.productTier.map(e=>{t+=e.minimumQuantity}),F(t-p)}else if($.length)N>0&&p<$[N-1]?.minimumQuantity?(I(N-1),_(N-1)):p<$[N]?.minimumQuantity&&_(N-1),S(L(N));else{const e=o.offerTier||[];B(e),I(0),F(e[0]?.minimumQuantity-p||i-p)}else B([]),F(i-p),I(0)},[o,i,p]),n(()=>{$.length&&"productTier"!=O?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===O)for(let o=0;o<$.length&&(n+=$[o].minimumQuantity,p>=n);o++)t=o,e=o+1<$.length?o+1:o;if(I(e),_(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);P(e===p),k(!0),S(L(t))}else P(!1),k(!1),S(R);const o=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;F(o)})():p===i?(k(!0),S(d?R*(1-d/100):x||(m?R-m:R)),P(!0)):(P(!1),k(!1))},[p,$]);const M=E?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,V=E?T.toFixed(2):u?.price?.toFixed(2),j=M&&V?(M-Number(V)).toFixed(2):0,W=o&&"none"!==O&&o.offerTier?"offerTier"===O?Math.min(p/(p+z)*100,100):void 0:p/i*100;n(()=>{if(E&&g.byob.enableConfetti){console.log("remainingItems",z);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,o=(t.top+t.height/2)/window.innerHeight;ve({particleCount:100,spread:70,origin:{x:n,y:o},zIndex:9999})}},[E,g]),N>=0&&N<$.length&&$[N].tier;const H=e.useMemo(()=>null!==A&&$[A+1]?$[A+1]?.customText||"":o?.offerTier?.[0]?.customText||"",[A,$,o]),q="number"==typeof A?$[A]?.customText:void 0,Q="string"==typeof q&&""!==q.trim();return e.createElement(Vl,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(f?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:f,style:{justifyContent:g.byob.selectedProductsVisibility&&!f?"space-between":"center"}},"offerTier"==O&&null!==A&&A>=0&&e.createElement(jl,{className:"yt-byob-tracker-offer-tier-tag"},Q?e.createElement(e.Fragment,null,q," unlocked"):e.createElement(e.Fragment,null,e.createElement(e.Fragment,null,"Buy"," ",$.slice(0,A+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||x?e.createElement(e.Fragment,null," ",Ep(g.general.currencySymbol,C)):""," ",Cp($[A]?.discountValue),d?e.createElement(e.Fragment,null,"% "):Cp(x)?e.createElement(e.Fragment,null):"",d||m?e.createElement(e.Fragment,null," Off"):""),e.createElement("span",{style:{fontStyle:"italic"}}," applied"))),f&&z>=1&&!D&&"offerTier"!==O?e.createElement(Wl,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},0===$.length?e.createElement(e.Fragment,null,"Select ",z," more item(s)"," ",0!==x||0!==d?"to get the bundle at":"",0!==x&&e.createElement(e.Fragment,null,` ${Ep(g.general.currencySymbol,C)}${x}`),0!==d&&e.createElement(e.Fragment,null," ",` ${d}% Off`)):e.createElement(e.Fragment,null," Select ",z," more item(s)")):e.createElement(e.Fragment,null),"productTier"!==O&&e.createElement(Hl,{className:"yt-byob-tracker-tier-progress-container"},e.createElement(ql,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==O&&$.length>0&&z>0&&e.createElement(e.Fragment,null,H?e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",z," more to unlock ",H):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",z," More Item(s)",e.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+z," at"," ",m||x?e.createElement(e.Fragment,null,Ep(g.general.currencySymbol,C)):""," ",Cp($[N>=0?N:0]?.discountValue),d?e.createElement(e.Fragment,null,"% "):Cp(x)?e.createElement(e.Fragment,null):"",d||m?e.createElement(e.Fragment,null," Off"):"")))),e.createElement(Ql,{className:"yt-byob-tracker-progress-bar-bg"},e.createElement(Ul,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:y??g?.general.primaryColor}," "))),g.byob.selectedProductsVisibility&&e.createElement(Yl,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(f?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:O??"",isMobile:f},"productTier"===O?e.createElement(bc,{tiers:$,isMobile:f,selectedProductsByTier:w??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:l,handleRemoveItemProductTier:v,cornerRadius:g.byob.borderRadius,currencySymbol:Ep(g.general.currencySymbol,C)}):e.createElement(e.Fragment,null,a?.map?.(t=>{const n=t.product.variants?.edges?.find(e=>e.node.id===t.variantId);return l?e.createElement(Kl,{className:"yt-byob-tracker-detailed-item-container",borderRadius:g.byob.borderRadius,key:t.variantId},e.createElement(Jl,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.quantity>1&&e.createElement(ec,{className:"yt-byob-tracker-badge"},t.quantity,"x")),e.createElement(tc,{className:"yt-byob-tracker-info-block"},e.createElement(nc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(oc,{className:"yt-byob-tracker-product-price"},g.general.currencySymbol,n?.node?.price),e.createElement(rc,{className:"yt-byob-tracker-remove-link",onClick:()=>s(t.variantId)},e.createElement(lt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(gc,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:f,borderRadius:g.byob.borderRadius,imageUrl:n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url},t?.quantity>1&&e.createElement(Xl,{className:"yt-byob-tracker-quantity-badge",borderRadius:g.byob.borderRadius},t.quantity,"x"),e.createElement(Zl,{className:"yt-byob-tracker-remove-btn",onClick:()=>s(t.variantId)},e.createElement(J,{fontSize:"12px"}))))}),z>=1&&[...Array(z)].map((t,n)=>e.createElement(ic,{className:"yt-byob-tracker-placeholder-box",isMobile:f,borderRadius:g.byob.borderRadius,key:n},e.createElement(Fe,{size:40,color:"#A0A0A0"}))))),(!f||D)&&e.createElement(Gl,{className:"yt-byob-tracker-summary-container bundle-summary "+(f?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:f},Number(V)>0&&e.createElement(ac,{className:"yt-byob-tracker-summary-info summary-info"},e.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},f?e.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},e.createElement(lc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(j)>0&&e.createElement(cc,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",Ep(g.general.currencySymbol,C),Cp(j))):e.createElement(e.Fragment,null,e.createElement(lc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(j)>0&&!f&&e.createElement(cc,{className:"yt-byob-tracker-save-label"},"Save:"," ",Ep(g.general.currencySymbol,C),Cp(j)))),e.createElement(sc,{className:"yt-byob-tracker-subtotal-row"},e.createElement(dc,{className:"yt-byob-tracker-final-price"},Ep(g.general.currencySymbol,C),Number(V)>=0?Cp(Number(V).toFixed(2)):0),M&&g.byob.compareAtPriceVisibility&&Number(M)>Number(V)&&e.createElement(pc,{className:"yt-byob-tracker-line-through-price"},Ep(g.general.currencySymbol,C),Cp(Number(M).toFixed(2))))),e.createElement(uc,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:D,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:g.general.ctaBackgroundColor,ctaBorderColor:g.general.ctaBorderColor,ctaHoverBackgroundColor:g.general.ctaHoverBackgroundColor,ctaHoverTextColor:g.general.ctaHoverTextColor},borderRadius:g.general.ctaBorderRadius,disabled:!D&&z>=1,onClick:e=>{c||console.log("saving"),r(e.target??e.currentTarget)},id:"checkoutButton"},c?e.createElement(rt,{color:"black",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):z>=1&&!D?e.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",z," More Item(s)"):e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}},e.createElement(mc,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:g.general.ctaTextColor,ctaHoverTextColor:h??g.general.ctaHoverTextColor},g.byob.checkoutCTAText??"Checkout"),g?.general?.showPaymentIcons&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"10px"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",className:"yt-cart-summary-checkout-next-icon",fontSize:"24px",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("polyline",{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"})))))))},vc={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},wc={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},Cc=o=>{const[r,i]=t(!1);n(()=>{const e=()=>{i(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const a="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,l=((e,t=!1)=>{const n=e&&vc[e]?vc[e]:{},o={...wc,...n};return t&&n.mobile?{...o,...n.mobile}:o})(String(a),r);o.renderingOnPage||(l.position="static",l.zIndex=0);const c={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...l};return e.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(r?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...c,width:r?"100%":l.width,...!o.styles.byob.selectedProductsVisibility&&{width:r?"96%":"fit-content",paddingInline:"10px"},...r&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===l.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=l.transform||"translateY(0)"}},e.createElement(hc,{...o,isMobile:r}))},Ec=re(void 0),kc=c.div`
2920
+ `,hc=({tiers:t,isMobile:n=!1,selectedProductsByTier:o,selectedProducts:r,themeColor:i,showProductDetailsInTracker:a,handleRemoveItemProductTier:l,cornerRadius:c,currencySymbol:s})=>e.createElement(e.Fragment,null,t.map((i,d)=>{const p=i.minimumQuantity-(o[d]?.length??0),u=r?.filter(e=>e.tierIndex===d);return Math.min(o[d]?.length/i.minimumQuantity*100,100),e.createElement("div",{className:"yt-byob-tracker-product-list-tier-wrapper",style:{display:"flex",width:"100%"}},e.createElement("div",{className:"yt-byob-tracker-product-list-tier-items"},e.createElement("div",{className:"yt-byob-tracker-product-list-items",style:{display:"flex",gap:"5px"}},u?.map?.(t=>{const r=t.product.variants?.edges?.find(e=>e.node.id===t.variantId),p=o[d]?.filter(e=>e===r?.node.id).length||0;return a?e.createElement(yc,{className:"yt-byob-tracker-detailed-product-item",key:t.variantId},e.createElement(ec,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.isFree&&e.createElement("div",{style:{position:"absolute",bottom:4,left:"30%",background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"40px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},"FREE",e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),t?.quantity>1&&e.createElement(Zl,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},t.quantity,"x")),e.createElement(nc,{className:"yt-byob-tracker-info-block"},e.createElement(oc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(rc,{className:"yt-byob-tracker-product-price"},s,Ep(r?.node?.price)),e.createElement(Kl,{className:"yt-byob-tracker-remove-detailed-btn",onClick:()=>l(t.variantId,d),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[d]?.length?{display:"none"}:{}}},e.createElement(lt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(fc,{className:"yt-byob-tracker-product-list-item",isMobile:n,borderRadius:c,imageUrl:r?.node.image?.url&&r?.node.image?.url?.length>0?r?.node.image.url:t.product.featuredMedia?.preview?.image?.url,style:{borderRadius:c||"12px"}},t?.isFree&&e.createElement("div",{style:{position:"absolute",top:4,left:4,background:"linear-gradient(135deg, #ff0080, #ff4d4d)",color:"white",fontWeight:900,fontSize:"8px",padding:"4px 6px",borderRadius:"8px",letterSpacing:"1.5px",textTransform:"uppercase",boxShadow:"0 6px 20px rgba(255, 0, 128, 0.7)",zIndex:20,border:"1px solid white",animation:"popup 0.6s ease-out"}},e.createElement(it,null),e.createElement("style",null,"\n @keyframes popup {\n 0% { transform: scale(0) rotate(-30deg); opacity: 0; }\n 70% { transform: scale(1.3); }\n 100% { transform: scale(1); }\n }\n ")),p>1&&e.createElement(Zl,{className:"yt-byob-tracker-quantity-badge",borderRadius:c},p,"x"),e.createElement(Kl,{className:"yt-byob-tracker-remove-btn",onClick:()=>l(t.variantId,d),style:{...1===i.minimumQuantity&&1===i.products.length&&1===o[d]?.length?{display:"none"}:{}}},e.createElement(J,{fontSize:"12px"}))))}),p>=1&&[...Array(p)].map((t,o)=>e.createElement(ac,{className:"yt-byob-tracker-placeholder-box",isMobile:n,borderRadius:c,key:o},e.createElement(Pe,{size:40,color:"#A0A0A0"}))))),d<t.length-1&&e.createElement(bc,{className:"yt-byob-tracker-plus-icon-container"},e.createElement(Pe,{size:"16px",style:{backgroundColor:"#f2f2f2"}})))})),vc=({builderTiers:o,handleAddToCart:r,minimumQuantity:i,selectedProducts:a,showProductDetailsInTracker:l,loading:c,handleRemoveItem:s,percentageOff:d,selectedItemsQuantity:p,bundleSubtotal:u,amountOff:m,styles:g,dealAmount:x,isMobile:f=!1,themeColor:y,cornerRadiusType:b,primaryTextColorCta:h,handleRemoveItemProductTier:v,selectedProductsByTier:w,storeCurrencyCode:C})=>{const[E,k]=t(!1),[T,S]=t(0),[$,B]=t([]),[N,I]=t(0),[z,F]=t(0),[D,P]=t(!1),[A,_]=t(null),R=u?.price||0,O=o?.type,L=e=>{if(e<0||!$[e])return R;const t=$[e].discountValue??0;return d?R*(1-t/100):x?t:m?R-t:R};n(()=>{if(o&&"none"!==o.type)if("productTier"===O&&o.productTier){const e=o.productTier||[];B(e);let t=0;o.productTier.map(e=>{t+=e.minimumQuantity}),F(t-p)}else if($.length)N>0&&p<$[N-1]?.minimumQuantity?(I(N-1),_(N-1)):p<$[N]?.minimumQuantity&&_(N-1),S(L(N));else{const e=o.offerTier||[];B(e),I(0),F(e[0]?.minimumQuantity-p||i-p)}else B([]),F(i-p),I(0)},[o,i,p]),n(()=>{$.length&&"productTier"!=O?(()=>{if(!$?.length)return;let e=-1,t=null,n=0;if("offerTier"===O)for(let o=0;o<$.length&&(n+=$[o].minimumQuantity,p>=n);o++)t=o,e=o+1<$.length?o+1:o;if(I(e),_(t),null!==t){let e=$.slice(0,t+1).reduce((e,t)=>e+t.minimumQuantity,0);P(e===p),k(!0),S(L(t))}else P(!1),k(!1),S(R);const o=e>=0&&e<$.length?$.slice(0,e+1).reduce((e,t)=>e+t.minimumQuantity,0)-p:$[0].minimumQuantity-p;F(o)})():p===i?(k(!0),S(d?R*(1-d/100):x||(m?R-m:R)),P(!0)):(P(!1),k(!1))},[p,$]);const M=E?Math.max(u?.compareAtPrice,u?.price):u?.compareAtPrice>u?.price?u?.compareAtPrice:null,V=E?T.toFixed(2):u?.price?.toFixed(2),j=M&&V?(M-Number(V)).toFixed(2):0,W=o&&"none"!==O&&o.offerTier?"offerTier"===O?Math.min(p/(p+z)*100,100):void 0:p/i*100;n(()=>{if(E&&g.byob.enableConfetti){console.log("remainingItems",z);const e=document.getElementById("checkoutButton");if(!e)return;const t=e.getBoundingClientRect(),n=(t.left+t.width/2)/window.innerWidth,o=(t.top+t.height/2)/window.innerHeight;Ce({particleCount:100,spread:70,origin:{x:n,y:o},zIndex:9999})}},[E,g]),N>=0&&N<$.length&&$[N].tier;const H=e.useMemo(()=>null!==A&&$[A+1]?$[A+1]?.customText||"":o?.offerTier?.[0]?.customText||"",[A,$,o]),q="number"==typeof A?$[A]?.customText:void 0,Q="string"==typeof q&&""!==q.trim();return e.createElement(jl,{className:"yt-byob-tracker-container bundle-builder-tracker-container "+(f?"yt-byob-tracker-mobile":"yt-byob-tracker-desktop"),isMobile:f,style:{justifyContent:g.byob.selectedProductsVisibility&&!f?"space-between":"center"}},"offerTier"==O&&null!==A&&A>=0&&e.createElement(Wl,{className:"yt-byob-tracker-offer-tier-tag"},Q?e.createElement(e.Fragment,null,q," unlocked"):e.createElement(e.Fragment,null,e.createElement(e.Fragment,null,"Buy"," ",$.slice(0,A+1).reduce((e,t)=>e+t.minimumQuantity,0)," ","at",m||x?e.createElement(e.Fragment,null," ",kp(g.general.currencySymbol,C)):""," ",Ep($[A]?.discountValue),d?e.createElement(e.Fragment,null,"% "):Ep(x)?e.createElement(e.Fragment,null):"",d||m?e.createElement(e.Fragment,null," Off"):""),e.createElement("span",{style:{fontStyle:"italic"}}," applied"))),f&&z>=1&&!D&&"offerTier"!==O?e.createElement(Hl,{className:"yt-byob-tracker-mobile-remaining",style:{margin:"0"}},0===$.length?e.createElement(e.Fragment,null,"Select ",z," more item(s)"," ",0!==x||0!==d?"to get the bundle at":"",0!==x&&e.createElement(e.Fragment,null,` ${kp(g.general.currencySymbol,C)}${x}`),0!==d&&e.createElement(e.Fragment,null," ",` ${d}% Off`)):e.createElement(e.Fragment,null," Select ",z," more item(s)")):e.createElement(e.Fragment,null),"productTier"!==O&&e.createElement(ql,{className:"yt-byob-tracker-tier-progress-container"},e.createElement(Ql,{className:"yt-byob-tracker-tier-progress-text"},"offerTier"==O&&$.length>0&&z>0&&e.createElement(e.Fragment,null,H?e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",z," more to unlock ",H):e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-tracker-add-more-text",style:{padding:"4px",fontWeight:"600",...window.innerWidth<=768&&{fontSize:"12px"},color:"#121212"}},"Add ",z," More Item(s)",e.createElement("span",{style:{fontWeight:"500"}}," to "),"Buy ",p+z," at"," ",m||x?e.createElement(e.Fragment,null,kp(g.general.currencySymbol,C)):""," ",Ep($[N>=0?N:0]?.discountValue),d?e.createElement(e.Fragment,null,"% "):Ep(x)?e.createElement(e.Fragment,null):"",d||m?e.createElement(e.Fragment,null," Off"):"")))),e.createElement(Ul,{className:"yt-byob-tracker-progress-bar-bg"},e.createElement(Yl,{className:"yt-byob-tracker-progress-bar-fill bundle-builder-tracker-progress",progressPercentage:W??0,primaryColor:y??g?.general.primaryColor}," "))),g.byob.selectedProductsVisibility&&e.createElement(Gl,{className:"yt-byob-tracker-product-list-wrapper hide-tracker-scrollbar "+(f?"yt-byob-tracker-mobile-product-list":"yt-byob-tracker-desktop-product-list"),tierType:O??"",isMobile:f},"productTier"===O?e.createElement(hc,{tiers:$,isMobile:f,selectedProductsByTier:w??{},selectedProducts:a,themeColor:g.general.primaryColor,showProductDetailsInTracker:l,handleRemoveItemProductTier:v,cornerRadius:g.byob.borderRadius,currencySymbol:kp(g.general.currencySymbol,C)}):e.createElement(e.Fragment,null,a?.map?.(t=>{const n=t.product.variants?.edges?.find(e=>e.node.id===t.variantId);return l?e.createElement(Jl,{className:"yt-byob-tracker-detailed-item-container",borderRadius:g.byob.borderRadius,key:t.variantId},e.createElement(ec,{className:"yt-byob-tracker-detailed-image",style:{backgroundImage:`url(${n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url})`}},t?.quantity>1&&e.createElement(tc,{className:"yt-byob-tracker-badge"},t.quantity,"x")),e.createElement(nc,{className:"yt-byob-tracker-info-block"},e.createElement(oc,{className:"yt-byob-tracker-product-title"},t.product.title),e.createElement(rc,{className:"yt-byob-tracker-product-price"},g.general.currencySymbol,n?.node?.price),e.createElement(ic,{className:"yt-byob-tracker-remove-link",onClick:()=>s(t.variantId)},e.createElement(lt,null),e.createElement("span",null,"Remove")))):e.createElement("div",{className:"yt-byob-tracker-product-item",key:t.variantId},e.createElement(xc,{className:"yt-byob-tracker-item bundle-builder-tracker-item",isMobile:f,borderRadius:g.byob.borderRadius,imageUrl:n?.node.image?.url&&n?.node.image?.url?.length>0?n?.node.image.url:t.product.featuredMedia?.preview?.image?.url},t?.quantity>1&&e.createElement(Zl,{className:"yt-byob-tracker-quantity-badge",borderRadius:g.byob.borderRadius},t.quantity,"x"),e.createElement(Kl,{className:"yt-byob-tracker-remove-btn",onClick:()=>s(t.variantId)},e.createElement(J,{fontSize:"12px"}))))}),z>=1&&[...Array(z)].map((t,n)=>e.createElement(ac,{className:"yt-byob-tracker-placeholder-box",isMobile:f,borderRadius:g.byob.borderRadius,key:n},e.createElement(Pe,{size:40,color:"#A0A0A0"}))))),(!f||D)&&e.createElement(Xl,{className:"yt-byob-tracker-summary-container bundle-summary "+(f?"yt-byob-tracker-mobile-summary":"yt-byob-tracker-desktop-summary"),isMobile:f},Number(V)>0&&e.createElement(lc,{className:"yt-byob-tracker-summary-info summary-info"},e.createElement("div",{className:"yt-byob-tracker-summary-info-content",style:{display:"flex",...window.innerWidth<=600&&{flexDirection:"column"},gap:"5px",justifyContent:"center"}},f?e.createElement("div",{className:"yt-byob-tracker-mobile-subtotal-row",style:{display:"flex",flexDirection:"row",gap:"6px",alignItems:"center"}},e.createElement(cc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(j)>0&&e.createElement(sc,{className:"yt-byob-tracker-save-label",style:{}},"Save:"," ",kp(g.general.currencySymbol,C),Ep(j))):e.createElement(e.Fragment,null,e.createElement(cc,{className:"yt-byob-tracker-subtotal-label"},"Subtotal"),Number(j)>0&&!f&&e.createElement(sc,{className:"yt-byob-tracker-save-label"},"Save:"," ",kp(g.general.currencySymbol,C),Ep(j)))),e.createElement(dc,{className:"yt-byob-tracker-subtotal-row"},e.createElement(pc,{className:"yt-byob-tracker-final-price"},kp(g.general.currencySymbol,C),Number(V)>=0?Ep(Number(V).toFixed(2)):0),M&&g.byob.compareAtPriceVisibility&&Number(M)>Number(V)&&e.createElement(uc,{className:"yt-byob-tracker-line-through-price"},kp(g.general.currencySymbol,C),Ep(Number(M).toFixed(2))))),e.createElement(mc,{className:"yt-byob-tracker-checkout-button yt-tracking-bar-checkout-button",canCheckout:D,progressPercentage:W??0,ctaColors:{ctaBackgroundColor:g.general.ctaBackgroundColor,ctaBorderColor:g.general.ctaBorderColor,ctaHoverBackgroundColor:g.general.ctaHoverBackgroundColor,ctaHoverTextColor:g.general.ctaHoverTextColor},borderRadius:g.general.ctaBorderRadius,disabled:!D&&z>=1,onClick:e=>{c||console.log("saving"),r(e.target??e.currentTarget)},id:"checkoutButton"},c?e.createElement(ue,{color:"black",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):z>=1&&!D?e.createElement("div",{className:"yt-byob-tracker-add-more-btn-text yt-tracking-bar-checkout-button-items-text",style:{color:g.general.primaryColor}},"Add ",z," More Item(s)"):e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}},e.createElement(gc,{className:"yt-byob-tracker-checkout-text yt-tracking-bar-checkout-button-text",ctaTextColor:g.general.ctaTextColor,ctaHoverTextColor:h??g.general.ctaHoverTextColor},g.byob.checkoutCTAText??"Checkout"),g?.general?.showPaymentIcons&&e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"10px"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",className:"yt-cart-summary-checkout-next-icon",fontSize:"24px",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e.createElement("polyline",{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"})))))))},wc={8087437412:{position:"fixed",bottom:"10px",zIndex:100,width:"95%",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"50px"}},66134737152:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},83438567714:{zIndex:100,position:"fixed",width:"95%",left:"50%",transform:"translateX(-50%)",bottom:"10px"},72726479068:{position:"fixed",zIndex:20,width:"90%",left:"50%",transform:"translateX(-50%)",bottom:"10px",mobile:{bottom:"70px"}},64800161992:{zIndex:20,mobile:{bottom:"50px"},position:"sticky",bottom:"10px"},53933408435:{zIndex:5,mobile:{bottom:"60px"},position:"sticky",bottom:"10px"},68377018594:{zIndex:5,bottom:"10px",position:"fixed",left:"50%",transform:"translateX(-50%)",mobile:{bottom:"70px"}},84569063743:{zIndex:999,bottom:"0px",width:"100%",position:"fixed",right:"0px",left:"0px"},62022680789:{bottom:"65px",zIndex:999,width:"100%",position:"fixed",right:"0px",left:"0px"},63102222549:{position:"sticky",bottom:"100px",zIndex:999,mobile:{bottom:"60px"}},26666008755:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},67641475285:{bottom:"10px",zIndex:999,position:"fixed",left:"50%",transform:"translateX(-50%)"},61613179125:{position:"fixed",left:"50%",transform:"translateX(-50%)"},80866345280:{bottom:"10px",mobile:{bottom:"70px"}}},Cc={position:"sticky",bottom:"10px",zIndex:999,width:"96%"},Ec=o=>{const[r,i]=t(!1);n(()=>{const e=()=>{i(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const a="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,l=((e,t=!1)=>{const n=e&&wc[e]?wc[e]:{},o={...Cc,...n};return t&&n.mobile?{...o,...n.mobile}:o})(String(a),r);o.renderingOnPage||(l.position="static",l.zIndex=0);const c={display:"flex",backgroundColor:"white",borderRadius:"4px",paddingBottom:"5px",justifyContent:"center",margin:"0 auto",transition:"box-shadow 0.3s ease, transform 0.3s ease",border:"1px solid #CBCBCB",boxShadow:"\n 0px 3px 6px 0px #00000040, \n 0px 11px 11px 0px #00000036, \n 0px 24px 14px 0px #00000021, \n 0px 43px 17px 0px #0000000A, \n 0px 68px 19px 0px #00000000\n ",...l};return e.createElement("div",{className:"yt-byob-tracker-bar yt-bundle-builder-tracker-bar "+(r?"yt-byob-tracker-mobile-bar":"yt-byob-tracker-desktop-bar"),style:{...c,width:r?"100%":l.width,...!o.styles.byob.selectedProductsVisibility&&{width:r?"96%":"fit-content",paddingInline:"10px"},...r&&{display:"flex",flexDirection:"row",paadingTop:"0px"}},onMouseEnter:e=>{e.currentTarget.style.boxShadow="\n 0px 8px 16px 0px #00000040, \n 0px 24px 24px 0px #00000036, \n 0px 50px 30px 0px #00000021, \n 0px 90px 36px 0px #0000000A, \n 0px 140px 40px 0px #00000000\n ",e.currentTarget.style.transform="translateX(-50%)"===l.transform?"translate(-50%, -3px)":"translateY(-3px)"},onMouseLeave:e=>{e.currentTarget.style.boxShadow="\n 0px 5px 12px 0px #00000040, \n 0px 22px 22px 0px #00000036, \n 0px 49px 29px 0px #00000021, \n 0px 87px 35px 0px #0000000A, \n 0px 136px 38px 0px #00000000\n ",e.currentTarget.style.transform=l.transform||"translateY(0)"}},e.createElement(vc,{...o,isMobile:r}))},kc=re(void 0),Tc=c.div`
2930
2921
  position: absolute;
2931
2922
  top: 0px;
2932
2923
  right: 0px;
@@ -2948,7 +2939,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2948
2939
  top: 5px;
2949
2940
  right: 5px;
2950
2941
  }
2951
- `,Tc=c.div`
2942
+ `,Sc=c.div`
2952
2943
  position: fixed;
2953
2944
  top: 0;
2954
2945
  left: 0;
@@ -2959,7 +2950,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2959
2950
  justify-content: center;
2960
2951
  align-items: center;
2961
2952
  z-index: 2147483644;
2962
- `,Sc=c.div`
2953
+ `,$c=c.div`
2963
2954
  background-color: white;
2964
2955
  padding: ${e=>e.$isSmallScreen?"20px":"15px"};
2965
2956
  border-radius: ${e=>e.$isSmallScreen?"0":"16.5px"};
@@ -2969,7 +2960,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2969
2960
  scrollbar-width: none;
2970
2961
 
2971
2962
  ${e=>e.$isSmallScreen?"\n width: 100%;\n height: 100%;\n ":"\n // width: 60%;\n max-width: min(1200px, 70%);\n max-height: 80vh;\n "}
2972
- `,$c=c.div`
2963
+ `,Bc=c.div`
2973
2964
  width: 100%;
2974
2965
  display: flex;
2975
2966
  justify-content: center;
@@ -3145,7 +3136,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3145
3136
  font-size: 1em;
3146
3137
  justify-content: center;
3147
3138
  align-items: center;
3148
- `;const Bc=({options:t,selectedValue:n,onChange:o,type:r="text",isOptionAvailable:i,isMobile:a})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const a=!i||i(t.name);return e.createElement("div",{key:t.name,onClick:()=>{a&&o(t)},style:{cursor:a?"pointer":"not-allowed"}},((t,n)=>{const o=!i||i(t.name),a={cursor:o?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:o?1:.5};if("color"===r)return t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...a,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name);return"image"===r?e.createElement("img",{src:gn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...a,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name)})(t,n?.name===t.name))})),Nc=({product:r,isOpen:i,onClose:a,variantOptions:l,cta:c,onConfirm:s})=>{const d=o(()=>e=>e?r?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[r?.tracksInventory]),p=o(()=>{const e=r.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):r.options?.map(e=>e.values[0])||[]},[r,d]),[u,m]=t(p),[g,x]=t(window.innerWidth<1024);n(()=>{const e=()=>x(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&a()};return i&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[i,a]);const f=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,y=f?.image?.url||r.featuredMedia?.preview?.image?.url,b=gn(y,150,85,"webp"),h=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},w=(e,t)=>{const n=u[t];if(!n)return null;return v(e).find(e=>e.name===n)||null};if(!i)return null;const C=e.createElement("div",{onClick:a,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}}},e.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:r.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},r.title))),e.createElement("div",{style:{padding:"20px"}},r.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},w(t,n)?.name||t.values[0])),e.createElement(Bc,{options:v(t),selectedValue:w(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(n,e)},type:h(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const o=r.options?.length>0?n.join(" / "):n[0],i=r.variants.edges.find(e=>e.node.title===o)?.node;return!!i&&d(i)>0})(n,e),isMobile:g}))))),e.createElement("button",{onClick:()=>{const e=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&d(e)>0;if(e?.id&&t)s(e.id),a();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=r.variants.edges.find(e=>d(e.node)>0)?.node.id;e&&(s(e),a())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:c.backgroundColor,color:c.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"}},"Add to Bundle")));return P.createPortal(C,document.body)},Ic=l((a,l)=>{const[c,s]=ie(Ec),d=o(()=>e=>{const t=a?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:a?.bundleProductsCustomQuantity?a?.bundleProductsCustomQuantity:e?c?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[c?.tracksInventory,a?.customVariantsQuantity,a?.bundleProductsCustomQuantity]),p=c?.variants.edges?.filter(e=>d(e.node)>0)||[],[u,m]=t(p?.[0]?.node),[g,x]=t(0),[f,y]=t("undefined"!=typeof window&&window.innerWidth<=600),[b,h]=t(1),[v,w]=t("idle"),C=r(null),E=r(null),k=r(!1),[T,S]=t(0),$=o(()=>{const e=c?.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):c?.options?.map(e=>e.values[0])||[]},[c,d]),[B,N]=t($);n(()=>{if(c){const e=c.variants.edges?.filter(e=>d(e.node)>0),t=c?.selectedVariant??e[0]?.node;m(t),t?.title&&"Default Title"!==t.title&&N(t.title.split(" / "))}},[c,d]),n(()=>{const e=a.selectedProducts.find(e=>e.variantId===u?.id);h(e?e.quantity:0)},[b,a.selectedProducts,u]),n(()=>{if(E.current&&-1!==g&&k.current){const e=E.current.children;e[g]&&e[g].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),k.current=!1}},[g]);if(n(()=>{const e=()=>y(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!c)return null;const{title:I,descriptionHtml:z,media:F,variants:D}=c,A=F.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0),_=i(e=>{const t=e.target.value,n=p?.find(e=>e.node.id===t)?.node;n&&d(n)>0&&(k.current=!0,m(n),n.title&&"Default Title"!==n.title&&N(n.title.split(" / ")))},[p,d]),R=i(e=>{if(!a.bundleVariantOptions?.options)return"text";const t=a.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[a.bundleVariantOptions]),O=i(e=>{if(!a?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=a?.bundleVariantOptions?.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},[a.bundleVariantOptions]),L=i((e,t)=>{const n=[...B];n[e]=t.name,N(n);const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;r&&d(r)>0&&(k.current=!0,m(r))},[B,c,d]),M=i((e,t)=>{const n=B[t];if(!n)return null;return O(e).find(e=>e.name===n)||null},[B,O]),V=i((e,t)=>{const n=[...B];n[e]=t;const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;return!!r&&d(r)>0},[B,c,d]);n(()=>{if(c&&u?.image?.url&&Array.isArray(A)){const e=A.findIndex(e=>e?.url===u?.image?.url);-1!==e&&e!==g&&x(e)}},[u,g,A]),n(()=>{if(c){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{s(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[c,s]),n(()=>{if(f&&c&&C.current){const e=()=>{C.current&&S(C.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[f,c]);const j=a.selectedProducts.filter(e=>e.variantId===u?.id).reduce((e,t)=>e+t.quantity,0),W=a.customVariantsQuantity?.find(e=>e.variantId===u?.id)?.quantity??a.bundleProductsCustomQuantity??1/0,H=W!==1/0&&j>=W,q=a.hideAddToBundle||!u||d(u)<=0||H||"idle"!==v||a?.disableQuantitySelector&&1===b,Q=({className:t})=>{const n=c?.rating?.averageRating??a?.rating?.averageRating??0,o=c?.rating?.ratingCount??a?.rating?.ratingCount??0;return n<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},n," rating")),"ratingAndReviewCount"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14}),n,e.createElement(he,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",o," reviews)"))},U=({isMobile:t})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:E,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},A.length>1&&A.map((t,n)=>e.createElement("div",{key:n,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(ut,{small:kp(t?.url),medium:kp(t?.url),large:kp(t?.url),alt:t.altText||`${I} - Image ${n+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image"})))):e.createElement(e.Fragment,null,e.createElement(ut,{small:kp(A[g]?.url),medium:kp(A[g]?.url),large:kp(A[g]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image main-image"}),e.createElement("div",{style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},A.length>1&&A.filter(e=>e?.url?.length>0).map((n,o)=>e.createElement("img",{key:o,src:kp(n?.url),alt:n.altText||`${I} - Image ${o+1}`,onClick:()=>x(o),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:g===o?`2px solid ${a.themeColor||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),Y=({className:t})=>c?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},c.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},u?.title)),e.createElement("select",{className:`${t}-select`,value:u?.id||"",onChange:_,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},c?.variants?.edges?.map(({node:t})=>e.createElement("option",{key:t.id,value:t.id,disabled:0===d(t)},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(Ge,null)))),X=({isMobile:t})=>e.createElement(e.Fragment,null,c.options.map((n,o)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},B[o]||n.values[0])),e.createElement(Bc,{options:O(n),selectedValue:M(n,o),onChange:e=>{L(o,e)},type:R(n.name),isOptionAvailable:e=>V(o,e),isMobile:t}))))),Z=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-price":"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},a?.isFreebieTier&&!a.showFreebieTierProductPrices?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Ep(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Cp(u?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:a.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,u?.compareAtPrice&&parseFloat(u.compareAtPrice)>parseFloat(u?.price)&&e.createElement("div",{className:t?"yt-byob-modal-mobile-compare-price":"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Ep(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Cp(u?.compareAtPrice)),e.createElement("div",{className:t?"yt-byob-modal-mobile-current-price":"yt-byob-modal-desktop-current-price"},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Ep(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Cp(u?.price))))),K=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-atc-wrapper":"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:t?"100%":"80%"}},e.createElement("button",{className:t?"yt-byob-modal-mobile-atc-button":"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:a.themeColor||"#111",borderRadius:a.cornerRadius,color:a.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:q?.5:1,cursor:q?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),u?.id&&c&&(w("check"),a.handleAddToBundle(u?.id,c,1),setTimeout(()=>{w("idle"),s(void 0)},500))},disabled:q},a.styles.byob.addToBundleCTAText??"Add to bundle")),J=e.createElement(Tc,{className:"yt-byob-modal-desktop-overlay"},e.createElement(Sc,{$isSmallScreen:f,ref:l},e.createElement($c,{ref:l,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},e.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},e.createElement(kc,{className:"yt-byob-modal-desktop-close",onClick:()=>{s(void 0)},style:{backgroundColor:"white"}},e.createElement(G,{size:"25"})),e.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},e.createElement(U,null)),e.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:"yt-byob-modal-desktop-title"},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement(Q,{className:"yt-byob-modal-desktop-rating"}),e.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===a?.styles?.byob.variantSelectorType&&e.createElement(Y,{className:"yt-byob-modal-desktop-variant-selector"}),"customOptions"===a?.styles?.byob.variantSelectorType&&e.createElement(X,null),e.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(Z,{isMobile:!1}),e.createElement(K,{isMobile:!1}))),e.createElement("div",{className:"yt-byob-modal-desktop-divider",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:z}})))))),ee=e.createElement(Tc,{className:"yt-byob-modal-mobile-overlay"},e.createElement(Sc,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:l},e.createElement($c,{ref:l,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},e.createElement("button",{className:"yt-byob-modal-mobile-close-btn",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{s(void 0)}},e.createElement(Ye,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},e.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},e.createElement(U,{isMobile:!0})),e.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:T?`${T+20}px`:"120px"}},e.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(Q,{className:"yt-byob-modal-mobile-rating"})),e.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:z}})))),e.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",ref:C,style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},"customOptions"===a?.styles?.byob.variantSelectorType?e.createElement(X,{isMobile:!0}):e.createElement(Y,{className:"yt-byob-modal-desktop-variant-selector"}),e.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(Z,{isMobile:!0}),e.createElement(K,{isMobile:!0})))));return P.createPortal(f?ee:J,document.body)}),zc=({coverImageUrl:t,mobileCoverImageUrl:n,alt:o="Background",styles:r})=>{const i=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],a=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality","80"),o.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?i.map(({imageWidth:t,descriptor:n})=>{const o=a(e,t);return o?`${o} ${n}w`:""}).filter(Boolean).join(", "):"";if(!t&&!n)return null;const c=t||n||"",s=a(c,800)||c,d=[];if(n&&n!==t){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(d.length>0?d.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},d,e.createElement("img",{src:s,alt:o,style:{width:"100%",height:"auto",display:"block",...r},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},Fc=({title:t,isOpen:n,onToggle:o,children:r})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:o,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(_e,{className:"yt-byob-icon-minus",size:20}):e.createElement(Fe,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},r)),Dc=({availableFilters:n,appliedFilters:o,toggleFilter:r,clearAllFilters:i,applyPriceFilter:a,priceMin:l,setPriceMin:c,priceMax:s,setPriceMax:d,maxPossiblePrice:p,styles:u,availableProductCount:m,products:g,unavailableProductCount:x,storeCurrencyCode:f,showActions:y=!0,openSections:b,toggleSection:h})=>{const[v,w]=t(null),C=Ep(u?.general?.currencySymbol,f)??"₹";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(Fc,{key:t.id,title:t.label,isOpen:!!b[t.id],onToggle:()=>h(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const i=o[t.id]?.includes(n.id)||!1,a="filter.v.availability.1"===n.id?m??g.length:"filter.v.availability.0"===n.id?x??0:n.count;return e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:i,onChange:()=>r(t.id,n.id),style:{width:"18px",height:"18px",accentColor:u?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)),e.createElement("span",{className:"yt-byob-filter-item-count",style:{fontSize:"12px",background:"#f3f4f6",padding:"2px 8px",borderRadius:"4px",color:"#666",minWidth:"24px",textAlign:"center"}},a))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,s.toLocaleString(),s>=p?"+":""),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-s/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>w("min"),onTouchStart:()=>w("min"),onChange:e=>{const t=Math.min(Number(e.target.value),s-10);c(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===v?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:s,onMouseDown:()=>w("max"),onTouchStart:()=>w("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);d(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===v?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),y&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:i,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:a,style:{flex:1,padding:"8px",background:u?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},Pc=t=>{const{showFiltersDrawer:n,handleClose:o,isAnimating:r,isMobile:i}=t;return n?A(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:r?1:0,transition:"opacity 300ms ease-in-out"},onClick:o},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:i?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:r?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(Dc,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),o()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},Ac=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(Dc,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},_c=({enableSortAndFilter:o,isMobile:r,setSearchTerm:i,searchTerm:a,styles:l,setSortBy:c,appliedFilters:s,setAppliedFilters:d,availableFilters:p=[],products:u,availableProductCount:m,unavailableProductCount:g,maxPossiblePrice:x,storeCurrencyCode:f,sharedFiltersState:b,openSections:h,toggleSection:v,sortBy:w})=>{const[C,E]=t(!1),[k,T]=t(a),{showFilters:S,setShowFilters:$,priceMax:B,setPriceMax:N,priceMin:I,setPriceMin:z}=b,[F,D]=t(!1),P=l?.byob?.productFiltersDisplay||"drawer",A=!r&&"sidebar"===P,_="none"===P;n(()=>{s["filter.v.price"]||(N(x),z(0))},[x,s]);n(()=>{const e=setTimeout(()=>{i(k)},300);return()=>clearTimeout(e)},[k,i]),n(()=>(S&&!A?(document.body.style.overflow="hidden",D(!0)):(document.body.style.overflow="",D(!1)),()=>{document.body.style.overflow=""}),[S,A]);const R=Object.entries(s).reduce((e,[t,n])=>"filter.v.price"===t?I>0||B<x?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:r?"column":"row",justifyContent:"space-between",alignItems:r?"flex-end":"center",marginBottom:"20px",width:"100%",gap:r?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:o?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},o&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:r?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},r&&!C?e.createElement(De,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:r?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(De,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),r&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>$(!S),style:{display:_?"none":"flex",alignItems:"center",gap:r?"0px":"6px",background:S&&A?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(Pe,{className:"yt-byob-filter-toggle-icon",size:18}),!r&&"Filters",R>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},R)),o&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!r&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),r&&e.createElement(Ae,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:w,onChange:e=>c(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(y,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!A&&!_&&e.createElement(Pc,{showFiltersDrawer:S,handleClose:()=>{A?$(!1):(document.body.style.overflow="",D(!1),setTimeout(()=>{$(!1)},300))},isAnimating:F,isMobile:r,availableFilters:p,appliedFilters:s,toggleFilter:(e,t)=>{d(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{N(x),z(0),d({})},applyPriceFilter:()=>{d(e=>{const t={...e};return t["filter.v.price"]=[`min:${I}-max:${B}`],t})},priceMin:I,setPriceMin:z,priceMax:B,setPriceMax:N,maxPossiblePrice:x,styles:l,availableProductCount:m,products:u,unavailableProductCount:g,storeCurrencyCode:f,openSections:h,toggleSection:v}))};function Rc({quantity:t,setQuantity:n,remainingQuantity:o,handleAddToBundle:r,variantId:i,product:a,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:s}){const d={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=t<s;return e.createElement(Il,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const o=Math.max(0,t-1);n(o),l&&i&&l(i,1)},style:d},"-"),e.createElement(zl,{className:"yt-byob-quantity-display"},t," added"),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(o,t+1,s);n(l),r&&i&&a&&r(i,a,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const Oc=({product:r,styles:i,selectedVariant:a})=>{const[l,c]=t(!1),s=o(()=>kp(a?.image?.url||r?.featuredMedia?.preview?.image?.url||r?.media?.edges?.[0]?.node?.image?.url)||"",[a?.image?.url,r?.featuredMedia?.preview?.image?.url,r?.media?.edges]),d=o(()=>r?.media?.edges?.map(e=>kp(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[r?.media?.edges]),p=o(()=>d?.[1]??s??"",[d,s]);n(()=>{if(s){(new Image).src=s}},[s]);const u=o(()=>s||d?.[0],[s,d]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:i.general.imageAspectRatio||"1/1"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:u,alt:r.title}),u!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:r.title})))},Lc=({product:o,bundle:r,handleAddToBundle:a,hideAddToBundle:l,remainingQuantity:c,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:g,currentProductTier:x,showFreebieTierProductPrices:f,tierIndex:b})=>{const h=le(Ec),v=r.customizations,w=v?.byob?.variantSelectorType,[C,E]=t(!1),k=v.general?.variantTitleSuffix?o?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map(e=>e.node.title).map(e=>e.split(" "));let n=[...t[0]];for(let e=1;e<t.length;e++){const o=t[e];let r=0;for(;r<n.length&&r<o.length&&n[n.length-1-r]===o[o.length-1-r];)r++;n=n.slice(n.length-r)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),o=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:o,commonSuffix:n.join(" ")}}})})(o?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=i(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;if(r?.customProductsQuantity)return r?.customProductsQuantity;const n=k?.find(t=>t.node.id===e),i=n?.node;return i?o.tracksInventory&&i.inventoryItem?.tracked?i.inventoryQuantity>0?i.inventoryQuantity:i.inventoryQuantity<=0&&"continue"===i.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[k,g,o.tracksInventory]),S=k?.find(e=>T(e.node.id)>0)?.node?.id;if(!S&&!v.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[$,B]=t(k?.find(e=>T(e.node.id)>0)?.node?.id||k[0]?.node?.id),[N,I]=t(0),[z,F]=t(window.innerWidth<450),[D,P]=t("normal"),A=k?.find(e=>e?.node?.id===$)?.node,_=T($||"");n(()=>{const e=m.find(e=>e.variantId===$&&(void 0===b||e.tierIndex===b));I(e?e.quantity:0)},[m,$,b]),n(()=>{const e=()=>{F(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?P("500"):CSS.supports("font-weight","400")?P("400"):CSS.supports("font-weight","600")&&P("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",D)},[D]),n(()=>{if($&&!k?.some(e=>e.node.id===$)){const e=k.find(e=>T(e.node.id)>0)?.node.id||k[0]?.node?.id;e&&B(e)}},[$,k,T]);const R=o.variants&&o.variants.edges?.length>1&&"customOptions"!==w,O="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,L="53933408435"===O,M="75851235630"===O,V=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(o),j=V.length>0;return e.createElement(e.Fragment,null,e.createElement(Pl,{borderRadius:v?.byob.borderRadius,borderColor:v?.byob.borderColor,shadowType:v?.byob.shadowType,backgroundColor:v?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(_<=0)return;const e={...o,variants:{...o.variants,edges:k},selectedVariant:A};h(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:v?.byob?.productCardDetailsAlignment||"left"}},e.createElement(Al,{className:"yt-byob-image-wrapper"},e.createElement(Oc,{product:o,styles:v,selectedVariant:A}),r?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:v.byob.borderRadius}},r.productCardBadgeText),R&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement(_l,{className:"yt-byob-variant-selector",isCoralHaze:L,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:$||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),B(e.target.value)}},k?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,o=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id},o)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(y,null)))),e.createElement("div",{className:"yt-byob-product-content"},"enabled"===r?.customizations?.byob?.productCardCategoryVisibility&&j&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},V.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:z?"8px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),V.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",V.length-2," more"))),e.createElement(Rl,{isMobile:z,showBorder:r?.showBorder??!0,style:{...!v?.byob.productsPriceVisibility&&{padding:"8px"},...v?.byob.productTitleFontSize&&{fontSize:v?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:v?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},M?String(A?.displayName).replace("- Default Title",""):o.title,A?.commonSuffix?" -"+A?.commonSuffix:""))),"Default Title"!==A?.title&&v?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:r?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},A?.title),"ratingOnly"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},o?.rating?.averageRating," rating")),"ratingAndReviewCount"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Se,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(he,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," reviews)"),v?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:r?.showBorder?"0px 10px":"0 4px"}},x?.isFreebieTier&&!f?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},Ep(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Cp(A?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:v.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(A?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},Ep(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Cp(A?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!x?.isFreebieTier||f)&&A?.compareAtPrice&&v?.byob.compareAtPriceVisibility&&parseFloat(A.compareAtPrice)>parseFloat(A?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},Ep(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Cp(A.compareAtPrice))),(_>0||_===1/0)&&e.createElement(Ol,{borderRadius:v?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===N||void 0===N)&&e.createElement(Fl,{style:{...!l&&{backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),I(1),(()=>{if(!$)return;"customOptions"===w&&k.length>1?E(!0):a($,o,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},v?.byob.addToBundleCTAText),!r?.disableQuantitySelector&&N>0&&$&&e.createElement(Dl,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(Rc,{remainingQuantity:c,setQuantity:I,quantity:N,handleAddToBundle:a,variantId:$,product:o,handleRemoveItem:d,hideAddToBundle:l,selectedVariantInventoryQty:_})),r?.disableQuantitySelector&&N>0&&$&&e.createElement(Fl,{style:{backgroundColor:"#747474",color:v?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},e.createElement(Ll,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(Ml,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,N-1);I(t),d&&$&&d($,b)}},e.createElement(Re,{style:{color:"#fff",fontSize:"20px"}})))),_<=0&&_!==1/0&&e.createElement(Fl,{style:{backgroundColor:v.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},v?.general.outOfStockLabel||"Out of Stock")),"customOptions"===w&&C&&k.length>1&&e.createElement(Nc,{product:o,isOpen:C,onClose:()=>E(!1),variantOptions:r.variantOptions,cta:{textColor:v.general.ctaTextColor,backgroundColor:v.general.primaryColor},onConfirm:e=>{B(e),a(e,o,1)}}))},Mc=({currentStep:t,setCurrentProductTier:n,totalSteps:o,tiers:r,isMobile:i,selectedProductsByTier:a,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:o}).map((c,d)=>{const p=d+1,u=r[d].minimumQuantity-(a[d]?.length??0)===0,m=d===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:i?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:d<o?i?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-title",style:{margin:i?"16px 0px":"15px 0px",fontSize:i?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},r[t]?.title)),Vc=({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)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...o].map(o=>{const i=r===o;return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(t.general.primaryColor,.07):"transparent",borderBottom:i?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=t?.general.primaryColor)},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-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...o].map(o=>e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:r===o?t?.general.primaryColor:"white",color:r===o?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:e=>{r!==o&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{r!==o&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},o.charAt(0).toUpperCase()+o.slice(1)))))},jc=(e,t)=>{const n=[],o=e=>!t||0===t.length||t.includes(e);let r=0,i=0;e.forEach(e=>{const t=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id)),n=t?.some(e=>e.node.availableForSale);n?r++:i++}),o("Availability")&&n.push({id:"filter.v.availability",label:"Availability",type:"LIST",values:[{id:"filter.v.availability.1",label:"In stock",count:r,input:'{"available":true}'},{id:"filter.v.availability.0",label:"Out of stock",count:i,input:'{"available":false}'}]});let a=0;e.forEach(e=>{const t=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id));t?.forEach(e=>{const t=parseFloat(e.node.price);t>a&&(a=t)})}),o("Price")&&n.push({id:"filter.v.price",label:"Price",type:"PRICE_RANGE",values:[{id:"filter.v.price",label:"Price",count:e.length,input:JSON.stringify({price:{min:0,max:a}})}]});const l={};e.forEach(e=>{const t=e.productDetails.productType;t&&(l[t]=(l[t]||0)+1)}),Object.keys(l).length>0&&o("Product Type")&&n.push({id:"filter.p.product_type",label:"Product Type",type:"LIST",values:Object.entries(l).map(([e,t])=>({id:`filter.p.product_type.${e}`,label:e,count:t,input:JSON.stringify({productType:e})}))});const c={};e.forEach(e=>{const t=e.productDetails.vendor;t&&(c[t]=(c[t]||0)+1)}),Object.keys(c).length>0&&o("Vendor")&&n.push({id:"filter.p.vendor",label:"Vendor",type:"LIST",values:Object.entries(c).map(([e,t])=>({id:`filter.p.vendor.${e}`,label:e,count:t,input:JSON.stringify({vendor:e})}))});const s={};e.forEach(e=>{e.productDetails.tags?.forEach(e=>{e&&(s[e]=(s[e]||0)+1)})}),Object.keys(s).length>0&&o("Tags")&&n.push({id:"filter.p.tag",label:"Tag",type:"LIST",values:Object.entries(s).map(([e,t])=>({id:`filter.p.tag.${e}`,label:e,count:t,input:JSON.stringify({tag:e})}))});const d={};return e.forEach(e=>{(e.productDetails.options||[]).forEach((t,n)=>{if("Title"===t.name)return;d[t.name]||(d[t.name]={});const o=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[];t.values?.forEach(e=>{void 0===d[t.name][e]&&(d[t.name][e]=0);o.some(t=>(t.node.title.split(" / ")[n]||t.node.title).toLowerCase()===e.toLowerCase())&&d[t.name][e]++})})}),o("Variant Options")&&Object.entries(d).forEach(([e,t])=>{const o=Object.entries(t).filter(([e,t])=>t>0).map(([t,n])=>({id:`${e.toLowerCase()}.${t}`,label:t,count:n,input:JSON.stringify({variantOption:{name:e,value:t}})}));o.length>0&&n.push({id:`filter.v.option.${e.toLowerCase()}`,label:e,type:"LIST",values:o})}),n},Wc=({bundle:a,selectedItems:l,setSelectedItems:c,handleAddToCart:s,bundleAddToCartLoading:d,renderingOnPage:p,selectedItemsQuantity:u,handleRemoveItem:m,bundleSubtotal:g,dispatchAnalyticsEvent:x,fetchStoreDetails:f})=>{const[y,b]=t(void 0),[h,v]=t(window.innerWidth<450),[w,C]=t(0),[E,k]=t({}),T=a.builderTiers?.type,S=a.customizations,$=a.builderTiers?.productTier??[],B=a.builderTiers?.offerTier??[],[N,I]=t([]),[z,F]=t(!1),[D,P]=t("All"),[A,_]=t(0),R=r(null),[O,L]=t({}),[M,V]=t([]),[j,W]=t(!1),[H,q]=t(0),[Q,U]=t(0),[Y,G]=t({}),X=e=>{G(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{M.length>0&&G(e=>{const t={...e};return M.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[M]);const Z=a.customStoreDetails?.fixedInventoryDetails;n(()=>{const e=new Set;let t=!1;a?.products?.forEach(n=>{const o=n.productDetails;if(o.metafield&&"yourtoken_bundles_app"===o.metafield.namespace&&"categories"===o.metafield.key){let n=[];if(o.metafield.jsonValue&&Array.isArray(o.metafield.jsonValue))n=o.metafield.jsonValue;else if(o.metafield.value)try{const e=JSON.parse(o.metafield.value);Array.isArray(e)&&(n=e)}catch(e){console.error("Failed to parse categories:",e)}n.length>0&&(t=!0,n.forEach(t=>e.add(t)))}}),I(Array.from(e)),F(t);S?.byob?.productFiltersDisplay&&"none"!==S?.byob?.productFiltersDisplay&&(async()=>{const e=S?.byob?.filtersProvider??"products-data",t=S?.byob?.selectedFilterOptions;if("search-and-discovery-app-sync"===e)try{const e=await(f?.());e?.productFilters&&V(e.productFilters??[])}catch(e){V(jc(a.products,t))}else V(jc(a.products,t))})()},[a.products,S?.byob,f]),n(()=>{L({})},[w,D]);const K=((e,t)=>"All"===t?e:e.filter(e=>{const n=e.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1}))(a.products.filter(e=>{const t=e.productDetails.status?.toLowerCase(),n="active"===t||"unlisted"===t||void 0===e.productDetails.status||""===e.productDetails.status,o="estailofashion.myshopify.com"!==window?.Shopify?.shop||null!==e?.productDetails?.publishedAt;return n&&o}),D),J="productTier"===T?$.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===T?B.reduce((e,t)=>e+t.minimumQuantity,0):a.minimumQuantity,ee=i((e,t)=>{const n=Z?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const o=(e.variants?.edges||[]).find(e=>e.node.id===t),r=o?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[Z]),[te,ne]=t(3e3);n(()=>{let e=0;a.products.forEach(t=>{const n=Number(t.productDetails.variants?.edges?.[0]?.node?.price||0);n>e&&(e=n)}),ne(100*Math.ceil(e/100)||5e3)},[a.products]);const[oe,re]=t(""),[ae,le]=t(""),ce=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(K,oe),se=((e,t)=>[...e].sort((e,n)=>{const o=e?.productDetails?.title?.toLowerCase(),r=n?.productDetails?.title?.toLowerCase(),i=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),a=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return o.localeCompare(r);case"title-desc":return r.localeCompare(o);case"price-low-to-high":return i-a;case"price-high-to-low":return a-i;default:return 0}}))(ce,ae),de=se.filter(e=>((e,t,n,o)=>{if(0===Object.keys(t).length)return!0;for(const[r,i]of Object.entries(t)){if(0===i.length)continue;const a=n.find(e=>e.id===r);if(!a)continue;let l=!1;if("filter.v.price"===r){const n=t[r][0];if(!n)continue;const[o,i]=n.split("-"),a=parseFloat(o.replace("min:",""))||0,c="max:∞"===i?1/0:parseFloat(i.replace("max:",""))||1/0;(e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[]).some(e=>{const t=Number(e.node.price||0);return t>=a&&t<=c})&&(l=!0)}else for(const t of i){const n=a.values.find(e=>e.id===t);if(n)try{const t=JSON.parse(n.input);if(void 0!==t.available){const n=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[];if(!0===t.available){if(n.some(t=>o(e.productDetails,t.node.id)>0)){l=!0;break}}else if(!1===t.available&&n.every(t=>0===o(e.productDetails,t.node.id))){l=!0;break}}else if(t.productType){if(e.productDetails.productType===t.productType){l=!0;break}}else if(t.vendor){if(e.productDetails.vendor===t.vendor){l=!0;break}}else if(t.tag){if(e.productDetails.tags?.includes(t.tag)){l=!0;break}}else if(t.variantOption){const{name:n,value:o}=t.variantOption,r=e.productDetails.options?.findIndex(e=>e.name===n);if(void 0!==r&&-1!==r){if((e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[]).some(e=>{const t=(e.node.title||"").split(" / ")[r]||e.node.title;return t?.toLowerCase()===o.toLowerCase()})){l=!0;break}}}}catch(e){console.warn("Bad filter input",n.input)}}if(!l)return!1}return!0})(e,O,M,ee)),pe=((e,t,n,o,r)=>(e[r]?.products.filter(e=>t.some(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))||[]).sort((e,n)=>{let r=t.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))),i=t.find(e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0])));if(!r||!i)return 0;const a=r.productDetails?.title?.toLowerCase(),l=i.productDetails?.title?.toLowerCase(),c=parseFloat(r?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),s=parseFloat(i?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(o){case"title-asc":return a.localeCompare(l);case"title-desc":return l.localeCompare(a);case"price-low-to-high":return c-s;case"price-high-to-low":return s-c;default:return 0}}))($,de,oe,ae,w),[ue,me]=ie(Ec),[ge,xe]=t(!1),fe="productTier"===T?pe:de,ye=fe.slice(0,20*(A+1));n(()=>{x?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a?._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder"}}),setTimeout(()=>{xe(!0)},100)},[]);const be=r(null);n(()=>{const e=()=>{v(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(a.coverImageUrl){const e=new Image;e.src=kp(a.coverImageUrl)??"",e.onload=()=>{b(e.width/e.height)}}},[a.coverImageUrl]),n(()=>{xe(!1),setTimeout(()=>xe(!0),100)},[w]);const he=(e,t)=>{if("productTier"===T){let n={...E},o=!1;if(n[t]){const r=n[t].indexOf(e);-1!==r&&(n[t]=[...n[t]],n[t].splice(r,1),o=!0)}if(!o)for(let t=$.length;t>=0;t--){const o=n[t].indexOf(e);if(-1!==o){n[t]=[...n[t]],n[t].splice(o,1);break}}k(n);const r=$.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==r&&C(r)}m(e,t)},ve=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if("productTier"===T){const e=Object.fromEntries($.map(e=>[e.tier,[]]));k(e)}},[a]),n(()=>{if("productTier"!==T||!$[w])return;if(J===u)return;const e=$.findIndex((e,t)=>{const n=E[t]||[];return t>=w&&n.length<e.minimumQuantity});if(-1!==e&&e!==w){C(e);$[w].products.length>1&&ve()}},[E,$,T]),n(()=>{re("")},[w]),n(()=>{function e(e){if(!be.current||!e.target)return;!be.current.contains(e.target)&&me(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const we=(e,t,n)=>{var o;"productTier"===T&&(o=e,k(e=>{const t={...e},n=$.findIndex((e,n)=>{const o=t[n]||[];return n>=w&&o.length<e.minimumQuantity});return-1!==n&&C(n),t[n]||(t[n]=[]),t[n].push(o),t}));const r=!0===$[w]?.isFreebieTier;x?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),Tp(e,t,n,l,c,r,w)},Ce=(()=>{if(!a?.builderTiers)return a.minimumQuantity;const{type:e,offerTier:t,productTier:n}=a.builderTiers,o="offerTier"===e?t:"productTier"===e?n:null;if(!o)return a.minimumQuantity;let r=0;return o.map(e=>{r+=e.minimumQuantity}),r})(),Ee=h&&a.mobileCoverImageUrl?kp(a.mobileCoverImageUrl):kp(a.coverImageUrl??"")||null,ke=i(e=>{const t=S?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,o=n?.variants?.edges||[];if(Z){if(o.some(e=>Z.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return o.some(e=>ee(n,e.node.id)>0)},[S?.general?.showOutOfStockProducts,Z,ee]);n(()=>{if("productTier"!==T)return;const e=$[w];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;const t=e.products[0],n=a.products.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const o=n.variants?.edges?.find(e=>ee(n,e.node.id)>0)?.node;if(!o)return;const r=o.id,i=E[w]?.includes(r);if(!i&&(we(r,n,1),w<$.length-1)){C(w+1);const e=$?.[w];e?.products?.length>1&&ve()}},[T,$,w,a.products,E,ee,we]);const Te=o(()=>K.filter(e=>{const t=e.productDetails;return(t.variants?.edges||[]).some(e=>ee(t,e.node.id)>0)}).length,[K,ee]),Se=o(()=>K.length-Te,[K,Te]),$e="bundles"==a.appName?a.pageHeader?.title:a?.title,Be="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;n(()=>{_(0)},[oe,ae,D,w,O]);const Ne=i(()=>{ye.length<fe.length&&_(e=>e+1)},[ye.length,fe.length]);n(()=>{const e=new IntersectionObserver(([e])=>{e.isIntersecting&&Ne()},{threshold:.1});return R.current&&e.observe(R.current),()=>{R.current&&e.unobserve(R.current)}},[Ne]);const Ie=()=>{x?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",flexDirection:"column",width:"100%",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:S.byob.sectionBackgroundColor,..."transparent"!==S.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},Ee?e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...a?.coverImageVerticalMargin&&{marginBottom:a?.coverImageVerticalMargin,marginTop:a?.coverImageVerticalMargin}}},Ee&&e.createElement(zc,{coverImageUrl:Ee,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.titleFontSize??"3rem",fontWeight:"700",color:S?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:S?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},$e),e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.subtitleFontSize??"1.5rem",color:S?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Be))):($e||Be)&&e.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},$e&&e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.titleFontSize??"3rem",fontWeight:"700",color:S?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:S?.byob?.titleBackgroundColor??"transparent"}},$e),Be&&e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.subtitleFontSize??"1.5rem",color:S?.byob?.titleTextColor??"#000"}},Be)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===T&&$.length>0&&S?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(Mc,{currentStep:w,totalSteps:$.length,tiers:$,isMobile:h,primaryColor:S?.general?.primaryColor,primaryTextColorCta:S?.general?.primaryContrastColor,setCurrentProductTier:C,selectedProductsByTier:E,tierNavigation:S.byob.tierNavigation})))),e.createElement("div",{style:{display:"flex",flexDirection:"row",width:h?"100%":"90%",marginInline:"auto"}},"sidebar"===S?.byob?.productFiltersDisplay&&!h&&e.createElement(Ac,{showFiltersDrawer:j,handleClose:()=>W(!1),isAnimating:!1,isMobile:!1,availableFilters:M,appliedFilters:O,toggleFilter:(e,t)=>{L(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{L({}),U(0),q(te)},applyPriceFilter:()=>{L(e=>{const t={...e};return t["filter.v.price"]=[`min:${Q}-max:${H}`],t})},priceMin:Q,setPriceMin:U,priceMax:H,setPriceMax:q,maxPossiblePrice:te,styles:S,products:a.products,unavailableProductCount:Se,storeCurrencyCode:a?.storeCurrencyCode,openSections:Y,toggleSection:X}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},e.createElement("div",{style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement(_c,{enableSortAndFilter:a?.enableSortAndFilter??!1,isMobile:h,searchTerm:oe,setSearchTerm:re,setSortBy:le,styles:S,appliedFilters:O,setAppliedFilters:L,availableFilters:M,products:a.products,availableProductCount:Te,unavailableProductCount:Se,maxPossiblePrice:te,storeCurrencyCode:a?.storeCurrencyCode,sharedFiltersState:{showFilters:j,setShowFilters:W,priceMax:H,setPriceMax:q,priceMin:Q,setPriceMin:U},openSections:Y,toggleSection:X}),a?.customizations?.byob?.enableProductCategories&&z&&e.createElement("div",null,e.createElement(Vc,{styles:S,isMobile:h,categories:N,activeCategory:D,onCategoryChange:e=>{P(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:j&&"sidebar"===S?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},0===fe?.length?e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===T&&$.length>0?ye.filter(e=>ke(de.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))).map((t,n)=>{const o=($[w]?.minimumQuantity??0)>(E[w]?.length??0),r=de.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return r?e.createElement(Lc,{bundle:a,idx:n,key:t?.variantIds?.[0]??t.productId,product:r?.productDetails,handleAddToBundle:we,hideAddToBundle:!o,remainingQuantity:Ce-u,themeColor:a?.dealTextColor,handleRemoveItem:e=>he(e,w),selecteditems:l,transitionActive:ge,customVariantsQuantity:Z,currentProductTier:$[w],showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:w}):null}):ye.filter(ke).map((t,n)=>e.createElement(Lc,{bundle:a,idx:n,key:t.productId,product:t?.productDetails,handleAddToBundle:we,hideAddToBundle:u>=Ce,remainingQuantity:Ce-u,themeColor:a?.dealTextColor,handleRemoveItem:m,selecteditems:l,transitionActive:ge,customVariantsQuantity:Z,tierIndex:w})),ye.length<fe.length&&e.createElement("div",{ref:R,style:{height:"1px",width:"100%",display:"block"}})),!p&&e.createElement(Cc,{builderTiers:a?.builderTiers,handleAddToCart:async e=>{await s(e),Ie()},minimumQuantity:J,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,handleRemoveItem:m,handleRemoveItemProductTier:he,selectedItemsQuantity:u,percentageOff:a.percentageOff,loading:d,bundleSubtotal:g,amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:a?.dealTextColor??"#333",primaryTextColorCta:a?.primaryTextColorCta??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:E,renderingOnPage:p}),p&&e.createElement("div",{style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(Cc,{handleAddToCart:async e=>{await s(e),Ie()},minimumQuantity:J,builderTiers:a?.builderTiers,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,loading:d,handleRemoveItem:m,handleRemoveItemProductTier:he,percentageOff:a.percentageOff,selectedItemsQuantity:u??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:S?.general.primaryColor||"#000",primaryTextColorCta:S.general.primaryContrastColor??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:E,renderingOnPage:p})))),ue&&void 0!==u&&(()=>{let t=u<a.minimumQuantity;return"productTier"==T?t=($[w]?.minimumQuantity??0)>(E[w]?.length??0):"offerTier"==T&&(t=u<B.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(Ic,{handleAddToBundle:we,ref:be,remainingQuantity:a.minimumQuantity-u,hideAddToBundle:!t,disableQuantitySelector:a?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:E,themeColor:S?.general.primaryColor||"#000",primaryTextColorCta:a?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:S?.general.primaryColor||"#000",cornerRadius:a?.customizations.byob.borderRadius,styles:a.customizations,reviewRatingType:a?.reviewRatingType??"none",customVariantsQuantity:Z,bundleProductsCustomQuantity:a?.customProductsQuantity,isFreebieTier:$?.[w]?.isFreebieTier,showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:a?.variantOptions})})()))},Hc=({product:t,selectedVariantId:n,onVariantChange:r,styles:i,originalPrice:a,dealPrice:l,totalPriceSum:c,isVertical:s=!1,variantOptions:d,storeCurrencyCode:p})=>{const u=o(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),o=n?.node;return o?t.productDetails.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t.productDetails]),m=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;u(n);const g=o(()=>{if(m?.title&&t.productDetails.options){const e=m.title.split(" / ");if(e.length===t.productDetails.options.length)return e}return t.productDetails.options?.map(e=>e.values[0])||[]},[m,t.productDetails.options]),x=e=>{r(e)};return s?e.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},i.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:kp(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:i.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null)))))),(i.comboBundle.subProductsProductTitleVisibility||i.comboBundle.subProductsProductPriceVisibility)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},Ep(i.general.currencySymbol,p),Cp((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==i.comboBundle.discountBadgeVisibility&&("discount-on-compare"===i.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Ep(i.general.currencySymbol,p),Cp(m?.compareAtPrice?m.compareAtPrice:m?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Ep(i.general.currencySymbol,p),Cp(m?.price)))))):e.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===i.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===i.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},i.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:kp(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===i.comboBundle?.infoAlignment?"flex-start":"right"===i.comboBundle?.infoAlignment?"flex-end":"center"===i.comboBundle?.infoAlignment?"flex-start":void 0}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==i.comboBundle.comboVariantTypeSelector&&t.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&d&&g&&e.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},g.length>1?g.join(" / "):g)),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},Ep(i.general.currencySymbol,p),Cp((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==i.comboBundle.discountBadgeVisibility&&("discount-on-compare"===i.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Ep(i.general.currencySymbol,p),Cp(m?.compareAtPrice?m?.compareAtPrice:m?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Ep(i.general.currencySymbol,p),Cp(m?.price)))),t.productDetails.variants.edges.length>1&&("dropdown"===i.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t.productDetails.variants.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null))):t.productDetails.options.length>0?e.createElement(e.Fragment,null,t.productDetails.options.map((n,o)=>e.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},t.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(r=>{const a=[...g];a[o]=r;const l=t.productDetails.options.length>0?a.join(" / "):a[o],c=t.productDetails.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?u(c.id):0),p=g[o]===r,m=d&&d?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},m?.values.find(e=>e.name===r)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===r)?.value}},e.createElement("span",null)):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):m&&"image"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},m?.values.find(e=>e.name===r)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:kp(m?.values.find(e=>e.name===r)?.value||"/placeholder.svg"),alt:r,style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},r)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const o=0===u(t?.node?.id);return e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${o?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>x(t?.node?.id),disabled:o,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:o?"#ccc":"#707070",cursor:o?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:o?.5:1}},t?.node?.title)}))))))},qc=({bundle:r,addToCartFunction:i,dispatchAnalyticsEvent:a})=>{const[l,c]=t(!1),[s,d]=t(window.innerWidth<786),p=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},[]),[u,m]=t(()=>{const e={};return r.products.forEach((t,n)=>{const o=t.productDetails?.variants?.edges?.find(e=>p(t.productDetails,e?.node?.id)>0)?.node;e[n]=o?o.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e});n(()=>(i&&(window.ytComboBundle={bundle:r,addToCart:i,selectedVariants:u},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[r,i,u]);const g=r.products?.every((e,t)=>{const n=u[t];return p(e.productDetails,n)>0}),x=(e,t)=>{m(n=>({...n,[e]:t}))},{originalPrice:f,dealPrice:y,offerValue:b,totalPriceSum:h,offerPercentage:v}=o(()=>{const{price:e,compareAtPrice:t}=Object.entries(u).reduce((e,[t,n])=>{const o=r.products[parseInt(t)],i=o.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(i?.price??"0"),l=parseFloat(i?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=l,e},{price:0,compareAtPrice:0}),n=r?.customizations?.comboBundle?.discountBadgeDisplay,o="discount-on-price"===n?e:t;let i=e;r?.percentageOff?i=e*(1-r.percentageOff/100):r?.dealAmount?i=r.dealAmount:r?.amountOff&&(i=e-r.amountOff);const a=o-i,l=o>0?Math.round((o-i)/o*100):0;return{originalPrice:o.toFixed(2),dealPrice:i.toFixed(2),offerValue:a.toFixed(2),totalPriceSum:e.toFixed(2),offerPercentage:l}},[u,r.products,r.percentageOff,r.dealAmount,r.amountOff,r?.customizations?.comboBundle?.discountBadgeDisplay]);n(()=>{a?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"combo-bundle"}});const e=()=>{d(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const w=r.customizations,C=w.comboBundle?.comboCardStyle||"auto",E="vertical"===C||"auto"===C&&!s,k=w.comboBundle?.embedContentVisibility,T="bundles"==r.appName?r.pageHeader?.title:r?.title,S="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:w.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===w.comboBundle?.infoAlignment?"flex-start":"right"===w.comboBundle?.infoAlignment?"flex-end":"center"===w.comboBundle?.infoAlignment?"center":void 0,textAlign:w.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},k&&w.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:w.comboBundle?.productTitleFontSize||"28px",color:w.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},T)),k&&w?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:w.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(w.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},Ep(w.general.currencySymbol,r.storeCurrencyCode),Cp(y)),!isNaN(Number(f))&&!isNaN(Number(y))&&Number(f)>Number(y)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:w.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},Ep(w.general.currencySymbol,r.storeCurrencyCode),Cp(f)),Number(b)>0&&e.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},"discount-on-compare"===w.comboBundle.discountBadgeDisplay?`${v}% Off`:r?.percentageOff?`${r?.percentageOff}% Off`:r?.amountOff?`${Ep(w.general.currencySymbol,r.storeCurrencyCode)}${Cp(r?.amountOff)} Off`:`Save ${Ep(w.general.currencySymbol,r.storeCurrencyCode)}${Cp(b)}`))),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:w.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:w.comboBundle.productDescriptionFontSize||"16px",color:w.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),w.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,E?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(s?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},r.products.map((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===u[n])?.node;return o?e.createElement(Hc,{key:`combo-product-${n}-${t.productId}`,product:t,styles:w,originalPrice:f,dealPrice:y,totalPriceSum:h,selectedVariantId:u[n],onVariantChange:e=>x(n,e),isVertical:E,variantOptions:r.variantOptions,storeCurrencyCode:r.storeCurrencyCode}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(s?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},w.comboBundle.subProductsSectionVisibility&&r.products.map((t,n)=>e.createElement(Hc,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:w,originalPrice:f,dealPrice:y,totalPriceSum:h,selectedVariantId:u[n],onVariantChange:e=>x(n,e),variantOptions:r.variantOptions})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${g?"":"yt-comboBundle-bundle-cta-button-disabled"} ${s?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:g?w.general?.ctaBackgroundColor||"#121212":w.general.disabledButtonColor,color:w.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:w.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:g?"pointer":"not-allowed",border:`1px solid ${g?w.general?.ctaBackgroundColor||"#121212":w.general.disabledButtonColor}`,boxShadow:w.general.ctaShadowType,padding:w.general?.ctaPadding,width:w.general?.ctaWidth,margin:"0"},disabled:!g,onMouseOver:e=>{w.general.customizeHoverState&&g&&(e.currentTarget.style.backgroundColor=w.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=w.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{w.general.customizeHoverState&&g&&(e.currentTarget.style.backgroundColor=w.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=w.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{const e=Object.entries(u).map(([e])=>({id:r.products[parseInt(e)].productId,title:r.products[parseInt(e)]?.productDetails?.title}));a?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"combo-bundle",selectedProducts:e}});try{if(c(!0),!i)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void c(!1);const e=Object.entries(u).map(([e,t])=>{const n=r.products[parseInt(e)],o=n.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return o?{variantId:t,price:Number(o.price)}:null}).filter(e=>null!==e),t=Object.values(u);await i(Number(f),t,Number(y),e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}c(!1)}},l?e.createElement(rt,{color:"white",loading:l,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,g?w.comboBundle?.ctaTitle??"Add Bundle to cart":w.general.outOfStockLabel||"Out of Stock"," "))),k&&w.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:w.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:w.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:w.comboBundle.productDescriptionFontSize||"16px",color:w.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:w.general.primaryColor+"08"}},e.createElement("p",null,S))))},Qc=c.div`
3139
+ `;const Nc=({options:t,selectedValue:n,onChange:o,type:r="text",isOptionAvailable:i,isMobile:a})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const a=!i||i(t.name);return e.createElement("div",{key:t.name,onClick:()=>{a&&o(t)},style:{cursor:a?"pointer":"not-allowed"}},((t,n)=>{const o=!i||i(t.name),a={cursor:o?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:o?1:.5};if("color"===r)return t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...a,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name);return"image"===r?e.createElement("img",{src:gn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...a,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name)})(t,n?.name===t.name))})),Ic=({product:r,isOpen:i,onClose:a,variantOptions:l,cta:c,onConfirm:s})=>{const d=o(()=>e=>e?r?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[r?.tracksInventory]),p=o(()=>{const e=r.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):r.options?.map(e=>e.values[0])||[]},[r,d]),[u,m]=t(p),[g,x]=t(window.innerWidth<1024);n(()=>{const e=()=>x(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&a()};return i&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[i,a]);const f=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,y=f?.image?.url||r.featuredMedia?.preview?.image?.url,b=gn(y,150,85,"webp"),h=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},w=(e,t)=>{const n=u[t];if(!n)return null;return v(e).find(e=>e.name===n)||null};if(!i)return null;const C=e.createElement("div",{onClick:a,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}}},e.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:r.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},r.title))),e.createElement("div",{style:{padding:"20px"}},r.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},w(t,n)?.name||t.values[0])),e.createElement(Nc,{options:v(t),selectedValue:w(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(n,e)},type:h(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const o=r.options?.length>0?n.join(" / "):n[0],i=r.variants.edges.find(e=>e.node.title===o)?.node;return!!i&&d(i)>0})(n,e),isMobile:g}))))),e.createElement("button",{onClick:()=>{const e=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&d(e)>0;if(e?.id&&t)s(e.id),a();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=r.variants.edges.find(e=>d(e.node)>0)?.node.id;e&&(s(e),a())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:c.backgroundColor,color:c.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"}},"Add to Bundle")));return P.createPortal(C,document.body)},zc=l((a,l)=>{const[c,s]=ie(kc),d=o(()=>e=>{const t=a?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:a?.bundleProductsCustomQuantity?a?.bundleProductsCustomQuantity:e?c?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[c?.tracksInventory,a?.customVariantsQuantity,a?.bundleProductsCustomQuantity]),p=c?.variants.edges?.filter(e=>d(e.node)>0)||[],[u,m]=t(p?.[0]?.node),[g,x]=t(0),[f,y]=t("undefined"!=typeof window&&window.innerWidth<=600),[b,h]=t(1),[v,w]=t("idle"),C=r(null),E=r(null),k=r(!1),[T,S]=t(0),$=o(()=>{const e=c?.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):c?.options?.map(e=>e.values[0])||[]},[c,d]),[B,N]=t($);n(()=>{if(c){const e=c.variants.edges?.filter(e=>d(e.node)>0),t=c?.selectedVariant??e[0]?.node;m(t),t?.title&&"Default Title"!==t.title&&N(t.title.split(" / "))}},[c,d]),n(()=>{const e=a.selectedProducts.find(e=>e.variantId===u?.id);h(e?e.quantity:0)},[b,a.selectedProducts,u]),n(()=>{if(E.current&&-1!==g&&k.current){const e=E.current.children;e[g]&&e[g].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),k.current=!1}},[g]);if(n(()=>{const e=()=>y(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!c)return null;const{title:I,descriptionHtml:z,media:F,variants:D}=c,A=F.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0),_=i(e=>{const t=e.target.value,n=p?.find(e=>e.node.id===t)?.node;n&&d(n)>0&&(k.current=!0,m(n),n.title&&"Default Title"!==n.title&&N(n.title.split(" / ")))},[p,d]),R=i(e=>{if(!a.bundleVariantOptions?.options)return"text";const t=a.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[a.bundleVariantOptions]),O=i(e=>{if(!a?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=a?.bundleVariantOptions?.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},[a.bundleVariantOptions]),L=i((e,t)=>{const n=[...B];n[e]=t.name,N(n);const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;r&&d(r)>0&&(k.current=!0,m(r))},[B,c,d]),M=i((e,t)=>{const n=B[t];if(!n)return null;return O(e).find(e=>e.name===n)||null},[B,O]),V=i((e,t)=>{const n=[...B];n[e]=t;const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;return!!r&&d(r)>0},[B,c,d]);n(()=>{if(c&&u?.image?.url&&Array.isArray(A)){const e=A.findIndex(e=>e?.url===u?.image?.url);-1!==e&&e!==g&&x(e)}},[u,g,A]),n(()=>{if(c){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{s(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[c,s]),n(()=>{if(f&&c&&C.current){const e=()=>{C.current&&S(C.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[f,c]);const j=a.selectedProducts.filter(e=>e.variantId===u?.id).reduce((e,t)=>e+t.quantity,0),W=a.customVariantsQuantity?.find(e=>e.variantId===u?.id)?.quantity??a.bundleProductsCustomQuantity??1/0,H=W!==1/0&&j>=W,q=a.hideAddToBundle||!u||d(u)<=0||H||"idle"!==v||a?.disableQuantitySelector&&1===b,Q=({className:t})=>{const n=c?.rating?.averageRating??a?.rating?.averageRating??0,o=c?.rating?.ratingCount??a?.rating?.ratingCount??0;return n<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},n," rating")),"ratingAndReviewCount"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14}),n,e.createElement(we,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",o," reviews)"))},U=({isMobile:t})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:E,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},A.length>1&&A.map((t,n)=>e.createElement("div",{key:n,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(ut,{small:Tp(t?.url),medium:Tp(t?.url),large:Tp(t?.url),alt:t.altText||`${I} - Image ${n+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image"})))):e.createElement(e.Fragment,null,e.createElement(ut,{small:Tp(A[g]?.url),medium:Tp(A[g]?.url),large:Tp(A[g]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image main-image"}),e.createElement("div",{style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},A.length>1&&A.filter(e=>e?.url?.length>0).map((n,o)=>e.createElement("img",{key:o,src:Tp(n?.url),alt:n.altText||`${I} - Image ${o+1}`,onClick:()=>x(o),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:g===o?`2px solid ${a.themeColor||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),Y=({className:t})=>c?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},c.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},u?.title)),e.createElement("select",{className:`${t}-select`,value:u?.id||"",onChange:_,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},c?.variants?.edges?.map(({node:t})=>e.createElement("option",{key:t.id,value:t.id,disabled:0===d(t)},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(Ze,null)))),X=({isMobile:t})=>e.createElement(e.Fragment,null,c.options.map((n,o)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},B[o]||n.values[0])),e.createElement(Nc,{options:O(n),selectedValue:M(n,o),onChange:e=>{L(o,e)},type:R(n.name),isOptionAvailable:e=>V(o,e),isMobile:t}))))),Z=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-price":"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},a?.isFreebieTier&&!a.showFreebieTierProductPrices?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},kp(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Ep(u?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:a.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,u?.compareAtPrice&&parseFloat(u.compareAtPrice)>parseFloat(u?.price)&&e.createElement("div",{className:t?"yt-byob-modal-mobile-compare-price":"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},kp(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Ep(u?.compareAtPrice)),e.createElement("div",{className:t?"yt-byob-modal-mobile-current-price":"yt-byob-modal-desktop-current-price"},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},kp(a.styles.general.currencySymbol,a.styles.general.currencySymbol),Ep(u?.price))))),K=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-atc-wrapper":"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:t?"100%":"80%"}},e.createElement("button",{className:t?"yt-byob-modal-mobile-atc-button":"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:a.themeColor||"#111",borderRadius:a.cornerRadius,color:a.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:q?.5:1,cursor:q?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),u?.id&&c&&(w("check"),a.handleAddToBundle(u?.id,c,1),setTimeout(()=>{w("idle"),s(void 0)},500))},disabled:q},a.styles.byob.addToBundleCTAText??"Add to bundle")),J=e.createElement(Sc,{className:"yt-byob-modal-desktop-overlay"},e.createElement($c,{$isSmallScreen:f,ref:l},e.createElement(Bc,{ref:l,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},e.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},e.createElement(Tc,{className:"yt-byob-modal-desktop-close",onClick:()=>{s(void 0)},style:{backgroundColor:"white"}},e.createElement(G,{size:"25"})),e.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},e.createElement(U,null)),e.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:"yt-byob-modal-desktop-title"},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement(Q,{className:"yt-byob-modal-desktop-rating"}),e.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===a?.styles?.byob.variantSelectorType&&e.createElement(Y,{className:"yt-byob-modal-desktop-variant-selector"}),"customOptions"===a?.styles?.byob.variantSelectorType&&e.createElement(X,null),e.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(Z,{isMobile:!1}),e.createElement(K,{isMobile:!1}))),e.createElement("div",{className:"yt-byob-modal-desktop-divider",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:z}})))))),ee=e.createElement(Sc,{className:"yt-byob-modal-mobile-overlay"},e.createElement($c,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:l},e.createElement(Bc,{ref:l,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},e.createElement("button",{className:"yt-byob-modal-mobile-close-btn",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{s(void 0)}},e.createElement(Xe,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},e.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},e.createElement(U,{isMobile:!0})),e.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:T?`${T+20}px`:"120px"}},e.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(Q,{className:"yt-byob-modal-mobile-rating"})),e.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:z}})))),e.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",ref:C,style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},"customOptions"===a?.styles?.byob.variantSelectorType?e.createElement(X,{isMobile:!0}):e.createElement(Y,{className:"yt-byob-modal-desktop-variant-selector"}),e.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(Z,{isMobile:!0}),e.createElement(K,{isMobile:!0})))));return P.createPortal(f?ee:J,document.body)}),Fc=({coverImageUrl:t,mobileCoverImageUrl:n,alt:o="Background",styles:r})=>{const i=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],a=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality","80"),o.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?i.map(({imageWidth:t,descriptor:n})=>{const o=a(e,t);return o?`${o} ${n}w`:""}).filter(Boolean).join(", "):"";if(!t&&!n)return null;const c=t||n||"",s=a(c,800)||c,d=[];if(n&&n!==t){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(d.length>0?d.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},d,e.createElement("img",{src:s,alt:o,style:{width:"100%",height:"auto",display:"block",...r},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},Dc=({title:t,isOpen:n,onToggle:o,children:r})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:o,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(Oe,{className:"yt-byob-icon-minus",size:20}):e.createElement(Pe,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},r)),Pc=({availableFilters:n,appliedFilters:o,toggleFilter:r,clearAllFilters:i,applyPriceFilter:a,priceMin:l,setPriceMin:c,priceMax:s,setPriceMax:d,maxPossiblePrice:p,styles:u,availableProductCount:m,products:g,unavailableProductCount:x,storeCurrencyCode:f,showActions:y=!0,openSections:b,toggleSection:h})=>{const[v,w]=t(null),C=kp(u?.general?.currencySymbol,f)??"₹";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(Dc,{key:t.id,title:t.label,isOpen:!!b[t.id],onToggle:()=>h(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const i=o[t.id]?.includes(n.id)||!1,a="filter.v.availability.1"===n.id?m??g.length:"filter.v.availability.0"===n.id?x??0:n.count;return e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:i,onChange:()=>r(t.id,n.id),style:{width:"18px",height:"18px",accentColor:u?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)),e.createElement("span",{className:"yt-byob-filter-item-count",style:{fontSize:"12px",background:"#f3f4f6",padding:"2px 8px",borderRadius:"4px",color:"#666",minWidth:"24px",textAlign:"center"}},a))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,s.toLocaleString(),s>=p?"+":""),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-s/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>w("min"),onTouchStart:()=>w("min"),onChange:e=>{const t=Math.min(Number(e.target.value),s-10);c(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===v?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:s,onMouseDown:()=>w("max"),onTouchStart:()=>w("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);d(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===v?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),y&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:i,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:a,style:{flex:1,padding:"8px",background:u?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},Ac=t=>{const{showFiltersDrawer:n,handleClose:o,isAnimating:r,isMobile:i}=t;return n?A(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:r?1:0,transition:"opacity 300ms ease-in-out"},onClick:o},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:i?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:r?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(Pc,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),o()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},_c=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(Pc,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},Rc=({enableSortAndFilter:o,isMobile:r,setSearchTerm:i,searchTerm:a,styles:l,setSortBy:c,appliedFilters:s,setAppliedFilters:d,availableFilters:p=[],products:u,availableProductCount:m,unavailableProductCount:g,maxPossiblePrice:x,storeCurrencyCode:f,sharedFiltersState:b,openSections:h,toggleSection:v,sortBy:w})=>{const[C,E]=t(!1),[k,T]=t(a),{showFilters:S,setShowFilters:$,priceMax:B,setPriceMax:N,priceMin:I,setPriceMin:z}=b,[F,D]=t(!1),P=l?.byob?.productFiltersDisplay||"drawer",A=!r&&"sidebar"===P,_="none"===P;n(()=>{s["filter.v.price"]||(N(x),z(0))},[x,s]);n(()=>{const e=setTimeout(()=>{i(k)},300);return()=>clearTimeout(e)},[k,i]),n(()=>(S&&!A?(document.body.style.overflow="hidden",D(!0)):(document.body.style.overflow="",D(!1)),()=>{document.body.style.overflow=""}),[S,A]);const R=Object.entries(s).reduce((e,[t,n])=>"filter.v.price"===t?I>0||B<x?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:r?"column":"row",justifyContent:"space-between",alignItems:r?"flex-end":"center",marginBottom:"20px",width:"100%",gap:r?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:o?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},o&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:r?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},r&&!C?e.createElement(Ae,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:r?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(Ae,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),r&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>$(!S),style:{display:_?"none":"flex",alignItems:"center",gap:r?"0px":"6px",background:S&&A?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(_e,{className:"yt-byob-filter-toggle-icon",size:18}),!r&&"Filters",R>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},R)),o&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!r&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),r&&e.createElement(Re,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:w,onChange:e=>c(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(y,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!A&&!_&&e.createElement(Ac,{showFiltersDrawer:S,handleClose:()=>{A?$(!1):(document.body.style.overflow="",D(!1),setTimeout(()=>{$(!1)},300))},isAnimating:F,isMobile:r,availableFilters:p,appliedFilters:s,toggleFilter:(e,t)=>{d(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{N(x),z(0),d({})},applyPriceFilter:()=>{d(e=>{const t={...e};return t["filter.v.price"]=[`min:${I}-max:${B}`],t})},priceMin:I,setPriceMin:z,priceMax:B,setPriceMax:N,maxPossiblePrice:x,styles:l,availableProductCount:m,products:u,unavailableProductCount:g,storeCurrencyCode:f,openSections:h,toggleSection:v}))};function Oc({quantity:t,setQuantity:n,remainingQuantity:o,handleAddToBundle:r,variantId:i,product:a,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:s}){const d={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=t<s;return e.createElement(zl,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const o=Math.max(0,t-1);n(o),l&&i&&l(i,1)},style:d},"-"),e.createElement(Fl,{className:"yt-byob-quantity-display"},t," added"),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(o,t+1,s);n(l),r&&i&&a&&r(i,a,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const Lc=({product:r,styles:i,selectedVariant:a})=>{const[l,c]=t(!1),s=o(()=>Tp(a?.image?.url||r?.featuredMedia?.preview?.image?.url||r?.media?.edges?.[0]?.node?.image?.url)||"",[a?.image?.url,r?.featuredMedia?.preview?.image?.url,r?.media?.edges]),d=o(()=>r?.media?.edges?.map(e=>Tp(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[r?.media?.edges]),p=o(()=>d?.[1]??s??"",[d,s]);n(()=>{if(s){(new Image).src=s}},[s]);const u=o(()=>s||d?.[0],[s,d]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:i.general.imageAspectRatio||"1/1"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:u,alt:r.title}),u!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:r.title})))},Mc=({product:o,bundle:r,handleAddToBundle:a,hideAddToBundle:l,remainingQuantity:c,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:g,currentProductTier:x,showFreebieTierProductPrices:f,tierIndex:b})=>{const h=le(kc),v=r.customizations,w=v?.byob?.variantSelectorType,[C,E]=t(!1),k=v.general?.variantTitleSuffix?o?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map(e=>e.node.title).map(e=>e.split(" "));let n=[...t[0]];for(let e=1;e<t.length;e++){const o=t[e];let r=0;for(;r<n.length&&r<o.length&&n[n.length-1-r]===o[o.length-1-r];)r++;n=n.slice(n.length-r)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),o=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:o,commonSuffix:n.join(" ")}}})})(o?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=i(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;if(r?.customProductsQuantity)return r?.customProductsQuantity;const n=k?.find(t=>t.node.id===e),i=n?.node;return i?o.tracksInventory&&i.inventoryItem?.tracked?i.inventoryQuantity>0?i.inventoryQuantity:i.inventoryQuantity<=0&&"continue"===i.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[k,g,o.tracksInventory]),S=k?.find(e=>T(e.node.id)>0)?.node?.id;if(!S&&!v.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[$,B]=t(k?.find(e=>T(e.node.id)>0)?.node?.id||k[0]?.node?.id),[N,I]=t(0),[z,F]=t(window.innerWidth<450),[D,P]=t("normal"),A=k?.find(e=>e?.node?.id===$)?.node,_=T($||"");n(()=>{const e=m.find(e=>e.variantId===$&&(void 0===b||e.tierIndex===b));I(e?e.quantity:0)},[m,$,b]),n(()=>{const e=()=>{F(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?P("500"):CSS.supports("font-weight","400")?P("400"):CSS.supports("font-weight","600")&&P("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",D)},[D]),n(()=>{if($&&!k?.some(e=>e.node.id===$)){const e=k.find(e=>T(e.node.id)>0)?.node.id||k[0]?.node?.id;e&&B(e)}},[$,k,T]);const R=o.variants&&o.variants.edges?.length>1&&"customOptions"!==w,O="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,L="53933408435"===O,M="75851235630"===O,V=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(o),j=V.length>0;return e.createElement(e.Fragment,null,e.createElement(Al,{borderRadius:v?.byob.borderRadius,borderColor:v?.byob.borderColor,shadowType:v?.byob.shadowType,backgroundColor:v?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(_<=0)return;const e={...o,variants:{...o.variants,edges:k},selectedVariant:A};h(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:v?.byob?.productCardDetailsAlignment||"left"}},e.createElement(_l,{className:"yt-byob-image-wrapper"},e.createElement(Lc,{product:o,styles:v,selectedVariant:A}),r?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:v.byob.borderRadius}},r.productCardBadgeText),R&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement(Rl,{className:"yt-byob-variant-selector",isCoralHaze:L,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:$||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),B(e.target.value)}},k?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,o=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id},o)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(y,null)))),e.createElement("div",{className:"yt-byob-product-content"},"enabled"===r?.customizations?.byob?.productCardCategoryVisibility&&j&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},V.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:z?"8px":"12px",color:"#666",fontWeight:"500"}},t.charAt(0).toUpperCase()+t.slice(1))),V.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",V.length-2," more"))),e.createElement(Ol,{isMobile:z,showBorder:r?.showBorder??!0,style:{...!v?.byob.productsPriceVisibility&&{padding:"8px"},...v?.byob.productTitleFontSize&&{fontSize:v?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:v?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},M?String(A?.displayName).replace("- Default Title",""):o.title,A?.commonSuffix?" -"+A?.commonSuffix:""))),"Default Title"!==A?.title&&v?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:r?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},A?.title),"ratingOnly"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},o?.rating?.averageRating," rating")),"ratingAndReviewCount"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(we,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," reviews)"),v?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:r?.showBorder?"0px 10px":"0 4px"}},x?.isFreebieTier&&!f?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},kp(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Ep(A?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:v.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(A?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},kp(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Ep(A?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!x?.isFreebieTier||f)&&A?.compareAtPrice&&v?.byob.compareAtPriceVisibility&&parseFloat(A.compareAtPrice)>parseFloat(A?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},kp(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",Ep(A.compareAtPrice))),(_>0||_===1/0)&&e.createElement(Ll,{borderRadius:v?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===N||void 0===N)&&e.createElement(Dl,{style:{...!l&&{backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),I(1),(()=>{if(!$)return;"customOptions"===w&&k.length>1?E(!0):a($,o,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},v?.byob.addToBundleCTAText),!r?.disableQuantitySelector&&N>0&&$&&e.createElement(Pl,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(Oc,{remainingQuantity:c,setQuantity:I,quantity:N,handleAddToBundle:a,variantId:$,product:o,handleRemoveItem:d,hideAddToBundle:l,selectedVariantInventoryQty:_})),r?.disableQuantitySelector&&N>0&&$&&e.createElement(Dl,{style:{backgroundColor:"#747474",color:v?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},e.createElement(Ml,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(Vl,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,N-1);I(t),d&&$&&d($,b)}},e.createElement(Le,{style:{color:"#fff",fontSize:"20px"}})))),_<=0&&_!==1/0&&e.createElement(Dl,{style:{backgroundColor:v.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},v?.general.outOfStockLabel||"Out of Stock")),"customOptions"===w&&C&&k.length>1&&e.createElement(Ic,{product:o,isOpen:C,onClose:()=>E(!1),variantOptions:r.variantOptions,cta:{textColor:v.general.ctaTextColor,backgroundColor:v.general.primaryColor},onConfirm:e=>{B(e),a(e,o,1)}}))},Vc=({currentStep:t,setCurrentProductTier:n,totalSteps:o,tiers:r,isMobile:i,selectedProductsByTier:a,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:o}).map((c,d)=>{const p=d+1,u=r[d].minimumQuantity-(a[d]?.length??0)===0,m=d===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:i?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:d<o?i?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-title",style:{margin:i?"16px 0px":"15px 0px",fontSize:i?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},r[t]?.title)),jc=({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)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...o].map(o=>{const i=r===o;return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(t.general.primaryColor,.07):"transparent",borderBottom:i?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=t?.general.primaryColor)},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-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...o].map(o=>e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:r===o?t?.general.primaryColor:"white",color:r===o?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:e=>{r!==o&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{r!==o&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},o.charAt(0).toUpperCase()+o.slice(1)))))},Wc=(e,t)=>{const n=[],o=e=>!t||0===t.length||t.includes(e);let r=0,i=0;e.forEach(e=>{const t=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id)),n=t?.some(e=>e.node.availableForSale);n?r++:i++}),o("Availability")&&n.push({id:"filter.v.availability",label:"Availability",type:"LIST",values:[{id:"filter.v.availability.1",label:"In stock",count:r,input:'{"available":true}'},{id:"filter.v.availability.0",label:"Out of stock",count:i,input:'{"available":false}'}]});let a=0;e.forEach(e=>{const t=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id));t?.forEach(e=>{const t=parseFloat(e.node.price);t>a&&(a=t)})}),o("Price")&&n.push({id:"filter.v.price",label:"Price",type:"PRICE_RANGE",values:[{id:"filter.v.price",label:"Price",count:e.length,input:JSON.stringify({price:{min:0,max:a}})}]});const l={};e.forEach(e=>{const t=e.productDetails.productType;t&&(l[t]=(l[t]||0)+1)}),Object.keys(l).length>0&&o("Product Type")&&n.push({id:"filter.p.product_type",label:"Product Type",type:"LIST",values:Object.entries(l).map(([e,t])=>({id:`filter.p.product_type.${e}`,label:e,count:t,input:JSON.stringify({productType:e})}))});const c={};e.forEach(e=>{const t=e.productDetails.vendor;t&&(c[t]=(c[t]||0)+1)}),Object.keys(c).length>0&&o("Vendor")&&n.push({id:"filter.p.vendor",label:"Vendor",type:"LIST",values:Object.entries(c).map(([e,t])=>({id:`filter.p.vendor.${e}`,label:e,count:t,input:JSON.stringify({vendor:e})}))});const s={};e.forEach(e=>{e.productDetails.tags?.forEach(e=>{e&&(s[e]=(s[e]||0)+1)})}),Object.keys(s).length>0&&o("Tags")&&n.push({id:"filter.p.tag",label:"Tag",type:"LIST",values:Object.entries(s).map(([e,t])=>({id:`filter.p.tag.${e}`,label:e,count:t,input:JSON.stringify({tag:e})}))});const d={};return e.forEach(e=>{(e.productDetails.options||[]).forEach((t,n)=>{if("Title"===t.name)return;d[t.name]||(d[t.name]={});const o=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[];t.values?.forEach(e=>{void 0===d[t.name][e]&&(d[t.name][e]=0);o.some(t=>(t.node.title.split(" / ")[n]||t.node.title).toLowerCase()===e.toLowerCase())&&d[t.name][e]++})})}),o("Variant Options")&&Object.entries(d).forEach(([e,t])=>{const o=Object.entries(t).filter(([e,t])=>t>0).map(([t,n])=>({id:`${e.toLowerCase()}.${t}`,label:t,count:n,input:JSON.stringify({variantOption:{name:e,value:t}})}));o.length>0&&n.push({id:`filter.v.option.${e.toLowerCase()}`,label:e,type:"LIST",values:o})}),n},Hc=({bundle:a,selectedItems:l,setSelectedItems:c,handleAddToCart:s,bundleAddToCartLoading:d,renderingOnPage:p,selectedItemsQuantity:u,handleRemoveItem:m,bundleSubtotal:g,dispatchAnalyticsEvent:x,fetchStoreDetails:f})=>{const[y,b]=t(void 0),[h,v]=t(window.innerWidth<450),[w,C]=t(0),[E,k]=t({}),T=a.builderTiers?.type,S=a.customizations,$=a.builderTiers?.productTier??[],B=a.builderTiers?.offerTier??[],[N,I]=t([]),[z,F]=t(!1),[D,P]=t("All"),[A,_]=t(0),R=r(null),[O,L]=t({}),[M,V]=t([]),[j,W]=t(!1),[H,q]=t(0),[Q,U]=t(0),[Y,G]=t({}),X=e=>{G(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{M.length>0&&G(e=>{const t={...e};return M.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[M]);const Z=a.customStoreDetails?.fixedInventoryDetails;n(()=>{const e=new Set;let t=!1;a?.products?.forEach(n=>{const o=n.productDetails;if(o.metafield&&"yourtoken_bundles_app"===o.metafield.namespace&&"categories"===o.metafield.key){let n=[];if(o.metafield.jsonValue&&Array.isArray(o.metafield.jsonValue))n=o.metafield.jsonValue;else if(o.metafield.value)try{const e=JSON.parse(o.metafield.value);Array.isArray(e)&&(n=e)}catch(e){console.error("Failed to parse categories:",e)}n.length>0&&(t=!0,n.forEach(t=>e.add(t)))}}),I(Array.from(e)),F(t);S?.byob?.productFiltersDisplay&&"none"!==S?.byob?.productFiltersDisplay&&(async()=>{const e=S?.byob?.filtersProvider??"products-data",t=S?.byob?.selectedFilterOptions;if("search-and-discovery-app-sync"===e)try{const e=await(f?.());e?.productFilters&&V(e.productFilters??[])}catch(e){V(Wc(a.products,t))}else V(Wc(a.products,t))})()},[a.products,S?.byob,f]),n(()=>{L({})},[w,D]);const K=((e,t)=>"All"===t?e:e.filter(e=>{const n=e.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1}))(a.products.filter(e=>{const t=e.productDetails.status?.toLowerCase(),n="active"===t||"unlisted"===t||void 0===e.productDetails.status||""===e.productDetails.status,o="estailofashion.myshopify.com"!==window?.Shopify?.shop||null!==e?.productDetails?.publishedAt;return n&&o}),D),J="productTier"===T?$.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===T?B.reduce((e,t)=>e+t.minimumQuantity,0):a.minimumQuantity,ee=i((e,t)=>{const n=Z?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const o=(e.variants?.edges||[]).find(e=>e.node.id===t),r=o?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[Z]),[te,ne]=t(3e3);n(()=>{let e=0;a.products.forEach(t=>{const n=Number(t.productDetails.variants?.edges?.[0]?.node?.price||0);n>e&&(e=n)}),ne(100*Math.ceil(e/100)||5e3)},[a.products]);const[oe,re]=t(""),[ae,le]=t(""),ce=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(K,oe),se=((e,t)=>[...e].sort((e,n)=>{const o=e?.productDetails?.title?.toLowerCase(),r=n?.productDetails?.title?.toLowerCase(),i=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),a=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return o.localeCompare(r);case"title-desc":return r.localeCompare(o);case"price-low-to-high":return i-a;case"price-high-to-low":return a-i;default:return 0}}))(ce,ae),de=se.filter(e=>((e,t,n,o)=>{if(0===Object.keys(t).length)return!0;for(const[r,i]of Object.entries(t)){if(0===i.length)continue;const a=n.find(e=>e.id===r);if(!a)continue;let l=!1;if("filter.v.price"===r){const n=t[r][0];if(!n)continue;const[o,i]=n.split("-"),a=parseFloat(o.replace("min:",""))||0,c="max:∞"===i?1/0:parseFloat(i.replace("max:",""))||1/0;(e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[]).some(e=>{const t=Number(e.node.price||0);return t>=a&&t<=c})&&(l=!0)}else for(const t of i){const n=a.values.find(e=>e.id===t);if(n)try{const t=JSON.parse(n.input);if(void 0!==t.available){const n=e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[];if(!0===t.available){if(n.some(t=>o(e.productDetails,t.node.id)>0)){l=!0;break}}else if(!1===t.available&&n.every(t=>0===o(e.productDetails,t.node.id))){l=!0;break}}else if(t.productType){if(e.productDetails.productType===t.productType){l=!0;break}}else if(t.vendor){if(e.productDetails.vendor===t.vendor){l=!0;break}}else if(t.tag){if(e.productDetails.tags?.includes(t.tag)){l=!0;break}}else if(t.variantOption){const{name:n,value:o}=t.variantOption,r=e.productDetails.options?.findIndex(e=>e.name===n);if(void 0!==r&&-1!==r){if((e.productDetails.variants?.edges?.filter(t=>e.variantIds.includes(t.node.id))||[]).some(e=>{const t=(e.node.title||"").split(" / ")[r]||e.node.title;return t?.toLowerCase()===o.toLowerCase()})){l=!0;break}}}}catch(e){console.warn("Bad filter input",n.input)}}if(!l)return!1}return!0})(e,O,M,ee)),pe=((e,t,n,o,r)=>(e[r]?.products.filter(e=>t.some(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))||[]).sort((e,n)=>{let r=t.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))),i=t.find(e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0])));if(!r||!i)return 0;const a=r.productDetails?.title?.toLowerCase(),l=i.productDetails?.title?.toLowerCase(),c=parseFloat(r?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),s=parseFloat(i?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(o){case"title-asc":return a.localeCompare(l);case"title-desc":return l.localeCompare(a);case"price-low-to-high":return c-s;case"price-high-to-low":return s-c;default:return 0}}))($,de,oe,ae,w),[ue,me]=ie(kc),[ge,xe]=t(!1),fe="productTier"===T?pe:de,ye=fe.slice(0,20*(A+1));n(()=>{x?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a?._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder"}}),setTimeout(()=>{xe(!0)},100)},[]);const be=r(null);n(()=>{const e=()=>{v(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(a.coverImageUrl){const e=new Image;e.src=Tp(a.coverImageUrl)??"",e.onload=()=>{b(e.width/e.height)}}},[a.coverImageUrl]),n(()=>{xe(!1),setTimeout(()=>xe(!0),100)},[w]);const he=(e,t)=>{if("productTier"===T){let n={...E},o=!1;if(n[t]){const r=n[t].indexOf(e);-1!==r&&(n[t]=[...n[t]],n[t].splice(r,1),o=!0)}if(!o)for(let t=$.length;t>=0;t--){const o=n[t].indexOf(e);if(-1!==o){n[t]=[...n[t]],n[t].splice(o,1);break}}k(n);const r=$.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==r&&C(r)}m(e,t)},ve=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if("productTier"===T){const e=Object.fromEntries($.map(e=>[e.tier,[]]));k(e)}},[a]),n(()=>{if("productTier"!==T||!$[w])return;if(J===u)return;const e=$.findIndex((e,t)=>{const n=E[t]||[];return t>=w&&n.length<e.minimumQuantity});if(-1!==e&&e!==w){C(e);$[w].products.length>1&&ve()}},[E,$,T]),n(()=>{re("")},[w]),n(()=>{function e(e){if(!be.current||!e.target)return;!be.current.contains(e.target)&&me(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const we=(e,t,n)=>{var o;"productTier"===T&&(o=e,k(e=>{const t={...e},n=$.findIndex((e,n)=>{const o=t[n]||[];return n>=w&&o.length<e.minimumQuantity});return-1!==n&&C(n),t[n]||(t[n]=[]),t[n].push(o),t}));const r=!0===$[w]?.isFreebieTier;x?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),Sp(e,t,n,l,c,r,w)},Ce=(()=>{if(!a?.builderTiers)return a.minimumQuantity;const{type:e,offerTier:t,productTier:n}=a.builderTiers,o="offerTier"===e?t:"productTier"===e?n:null;if(!o)return a.minimumQuantity;let r=0;return o.map(e=>{r+=e.minimumQuantity}),r})(),Ee=h&&a.mobileCoverImageUrl?Tp(a.mobileCoverImageUrl):Tp(a.coverImageUrl??"")||null,ke=i(e=>{const t=S?.general?.showOutOfStockProducts;if(t)return!0;const n=e.productDetails,o=n?.variants?.edges||[];if(Z){if(o.some(e=>Z.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return o.some(e=>ee(n,e.node.id)>0)},[S?.general?.showOutOfStockProducts,Z,ee]);n(()=>{if("productTier"!==T)return;const e=$[w];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;const t=e.products[0],n=a.products.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const o=n.variants?.edges?.find(e=>ee(n,e.node.id)>0)?.node;if(!o)return;const r=o.id,i=E[w]?.includes(r);if(!i&&(we(r,n,1),w<$.length-1)){C(w+1);const e=$?.[w];e?.products?.length>1&&ve()}},[T,$,w,a.products,E,ee,we]);const Te=o(()=>K.filter(e=>{const t=e.productDetails;return(t.variants?.edges||[]).some(e=>ee(t,e.node.id)>0)}).length,[K,ee]),Se=o(()=>K.length-Te,[K,Te]),$e="bundles"==a.appName?a.pageHeader?.title:a?.title,Be="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;n(()=>{_(0)},[oe,ae,D,w,O]);const Ne=i(()=>{ye.length<fe.length&&_(e=>e+1)},[ye.length,fe.length]);n(()=>{const e=new IntersectionObserver(([e])=>{e.isIntersecting&&Ne()},{threshold:.1});return R.current&&e.observe(R.current),()=>{R.current&&e.unobserve(R.current)}},[Ne]);const Ie=()=>{x?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",flexDirection:"column",width:"100%",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:S.byob.sectionBackgroundColor,..."transparent"!==S.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},Ee?e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...a?.coverImageVerticalMargin&&{marginBottom:a?.coverImageVerticalMargin,marginTop:a?.coverImageVerticalMargin}}},Ee&&e.createElement(Fc,{coverImageUrl:Ee,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.titleFontSize??"3rem",fontWeight:"700",color:S?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:S?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},$e),e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.subtitleFontSize??"1.5rem",color:S?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Be))):($e||Be)&&e.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},$e&&e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.titleFontSize??"3rem",fontWeight:"700",color:S?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:S?.byob?.titleBackgroundColor??"transparent"}},$e),Be&&e.createElement("span",{style:{lineHeight:"normal",fontSize:S?.byob?.subtitleFontSize??"1.5rem",color:S?.byob?.titleTextColor??"#000"}},Be)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===T&&$.length>0&&S?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",null,e.createElement(Vc,{currentStep:w,totalSteps:$.length,tiers:$,isMobile:h,primaryColor:S?.general?.primaryColor,primaryTextColorCta:S?.general?.primaryContrastColor,setCurrentProductTier:C,selectedProductsByTier:E,tierNavigation:S.byob.tierNavigation})))),e.createElement("div",{style:{display:"flex",flexDirection:"row",width:h?"100%":"90%",marginInline:"auto"}},"sidebar"===S?.byob?.productFiltersDisplay&&!h&&e.createElement(_c,{showFiltersDrawer:j,handleClose:()=>W(!1),isAnimating:!1,isMobile:!1,availableFilters:M,appliedFilters:O,toggleFilter:(e,t)=>{L(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{L({}),U(0),q(te)},applyPriceFilter:()=>{L(e=>{const t={...e};return t["filter.v.price"]=[`min:${Q}-max:${H}`],t})},priceMin:Q,setPriceMin:U,priceMax:H,setPriceMax:q,maxPossiblePrice:te,styles:S,products:a.products,unavailableProductCount:Se,storeCurrencyCode:a?.storeCurrencyCode,openSections:Y,toggleSection:X}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},e.createElement("div",{style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement(Rc,{enableSortAndFilter:a?.enableSortAndFilter??!1,isMobile:h,searchTerm:oe,setSearchTerm:re,setSortBy:le,styles:S,appliedFilters:O,setAppliedFilters:L,availableFilters:M,products:a.products,availableProductCount:Te,unavailableProductCount:Se,maxPossiblePrice:te,storeCurrencyCode:a?.storeCurrencyCode,sharedFiltersState:{showFilters:j,setShowFilters:W,priceMax:H,setPriceMax:q,priceMin:Q,setPriceMin:U},openSections:Y,toggleSection:X}),a?.customizations?.byob?.enableProductCategories&&z&&e.createElement("div",null,e.createElement(jc,{styles:S,isMobile:h,categories:N,activeCategory:D,onCategoryChange:e=>{P(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:j&&"sidebar"===S?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},0===fe?.length?e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===T&&$.length>0?ye.filter(e=>ke(de.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))).map((t,n)=>{const o=($[w]?.minimumQuantity??0)>(E[w]?.length??0),r=de.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return r?e.createElement(Mc,{bundle:a,idx:n,key:t?.variantIds?.[0]??t.productId,product:r?.productDetails,handleAddToBundle:we,hideAddToBundle:!o,remainingQuantity:Ce-u,themeColor:a?.dealTextColor,handleRemoveItem:e=>he(e,w),selecteditems:l,transitionActive:ge,customVariantsQuantity:Z,currentProductTier:$[w],showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:w}):null}):ye.filter(ke).map((t,n)=>e.createElement(Mc,{bundle:a,idx:n,key:t.productId,product:t?.productDetails,handleAddToBundle:we,hideAddToBundle:u>=Ce,remainingQuantity:Ce-u,themeColor:a?.dealTextColor,handleRemoveItem:m,selecteditems:l,transitionActive:ge,customVariantsQuantity:Z,tierIndex:w})),ye.length<fe.length&&e.createElement("div",{ref:R,style:{height:"1px",width:"100%",display:"block"}})),!p&&e.createElement(Ec,{builderTiers:a?.builderTiers,handleAddToCart:async e=>{await s(e),Ie()},minimumQuantity:J,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,handleRemoveItem:m,handleRemoveItemProductTier:he,selectedItemsQuantity:u,percentageOff:a.percentageOff,loading:d,bundleSubtotal:g,amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:a?.dealTextColor??"#333",primaryTextColorCta:a?.primaryTextColorCta??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:E,renderingOnPage:p}),p&&e.createElement("div",{style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(Ec,{handleAddToCart:async e=>{await s(e),Ie()},minimumQuantity:J,builderTiers:a?.builderTiers,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,loading:d,handleRemoveItem:m,handleRemoveItemProductTier:he,percentageOff:a.percentageOff,selectedItemsQuantity:u??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:S?.general.primaryColor||"#000",primaryTextColorCta:S.general.primaryContrastColor??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:E,renderingOnPage:p})))),ue&&void 0!==u&&(()=>{let t=u<a.minimumQuantity;return"productTier"==T?t=($[w]?.minimumQuantity??0)>(E[w]?.length??0):"offerTier"==T&&(t=u<B.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(zc,{handleAddToBundle:we,ref:be,remainingQuantity:a.minimumQuantity-u,hideAddToBundle:!t,disableQuantitySelector:a?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:E,themeColor:S?.general.primaryColor||"#000",primaryTextColorCta:a?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:S?.general.primaryColor||"#000",cornerRadius:a?.customizations.byob.borderRadius,styles:a.customizations,reviewRatingType:a?.reviewRatingType??"none",customVariantsQuantity:Z,bundleProductsCustomQuantity:a?.customProductsQuantity,isFreebieTier:$?.[w]?.isFreebieTier,showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:a?.variantOptions})})()))},qc=({product:t,selectedVariantId:n,onVariantChange:r,styles:i,originalPrice:a,dealPrice:l,totalPriceSum:c,isVertical:s=!1,variantOptions:d,storeCurrencyCode:p})=>{const u=o(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),o=n?.node;return o?t.productDetails.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t.productDetails]),m=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;u(n);const g=o(()=>{if(m?.title&&t.productDetails.options){const e=m.title.split(" / ");if(e.length===t.productDetails.options.length)return e}return t.productDetails.options?.map(e=>e.values[0])||[]},[m,t.productDetails.options]),x=e=>{r(e)};return s?e.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},i.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:Tp(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:i.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null)))))),(i.comboBundle.subProductsProductTitleVisibility||i.comboBundle.subProductsProductPriceVisibility)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},kp(i.general.currencySymbol,p),Ep((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==i.comboBundle.discountBadgeVisibility&&("discount-on-compare"===i.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},kp(i.general.currencySymbol,p),Ep(m?.compareAtPrice?m.compareAtPrice:m?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},kp(i.general.currencySymbol,p),Ep(m?.price)))))):e.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===i.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===i.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},i.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:Tp(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===i.comboBundle?.infoAlignment?"flex-start":"right"===i.comboBundle?.infoAlignment?"flex-end":"center"===i.comboBundle?.infoAlignment?"flex-start":void 0}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==i.comboBundle.comboVariantTypeSelector&&t.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&d&&g&&e.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},g.length>1?g.join(" / "):g)),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},kp(i.general.currencySymbol,p),Ep((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==i.comboBundle.discountBadgeVisibility&&("discount-on-compare"===i.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},kp(i.general.currencySymbol,p),Ep(m?.compareAtPrice?m?.compareAtPrice:m?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},kp(i.general.currencySymbol,p),Ep(m?.price)))),t.productDetails.variants.edges.length>1&&("dropdown"===i.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t.productDetails.variants.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null))):t.productDetails.options.length>0?e.createElement(e.Fragment,null,t.productDetails.options.map((n,o)=>e.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},t.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(r=>{const a=[...g];a[o]=r;const l=t.productDetails.options.length>0?a.join(" / "):a[o],c=t.productDetails.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?u(c.id):0),p=g[o]===r,m=d&&d?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},m?.values.find(e=>e.name===r)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===r)?.value}},e.createElement("span",null)):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):m&&"image"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},m?.values.find(e=>e.name===r)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:Tp(m?.values.find(e=>e.name===r)?.value||"/placeholder.svg"),alt:r,style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},r)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const o=0===u(t?.node?.id);return e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${o?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>x(t?.node?.id),disabled:o,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:o?"#ccc":"#707070",cursor:o?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:o?.5:1}},t?.node?.title)}))))))},Qc=({bundle:r,addToCartFunction:i,dispatchAnalyticsEvent:a})=>{const[l,c]=t(!1),[s,d]=t(window.innerWidth<786),p=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},[]),[u,m]=t(()=>{const e={};return r.products.forEach((t,n)=>{const o=t.productDetails?.variants?.edges?.find(e=>p(t.productDetails,e?.node?.id)>0)?.node;e[n]=o?o.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e});n(()=>(i&&(window.ytComboBundle={bundle:r,addToCart:i,selectedVariants:u},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[r,i,u]);const g=r.products?.every((e,t)=>{const n=u[t];return p(e.productDetails,n)>0}),x=(e,t)=>{m(n=>({...n,[e]:t}))},{originalPrice:f,dealPrice:y,offerValue:b,totalPriceSum:h,offerPercentage:v}=o(()=>{const{price:e,compareAtPrice:t}=Object.entries(u).reduce((e,[t,n])=>{const o=r.products[parseInt(t)],i=o.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(i?.price??"0"),l=parseFloat(i?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=l,e},{price:0,compareAtPrice:0}),n=r?.customizations?.comboBundle?.discountBadgeDisplay,o="discount-on-price"===n?e:t;let i=e;r?.percentageOff?i=e*(1-r.percentageOff/100):r?.dealAmount?i=r.dealAmount:r?.amountOff&&(i=e-r.amountOff);const a=o-i,l=o>0?Math.round((o-i)/o*100):0;return{originalPrice:o.toFixed(2),dealPrice:i.toFixed(2),offerValue:a.toFixed(2),totalPriceSum:e.toFixed(2),offerPercentage:l}},[u,r.products,r.percentageOff,r.dealAmount,r.amountOff,r?.customizations?.comboBundle?.discountBadgeDisplay]);n(()=>{a?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"combo-bundle"}});const e=()=>{d(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const w=r.customizations,C=w.comboBundle?.comboCardStyle||"auto",E="vertical"===C||"auto"===C&&!s,k=w.comboBundle?.embedContentVisibility,T="bundles"==r.appName?r.pageHeader?.title:r?.title,S="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===w.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:w.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===w.comboBundle?.infoAlignment?"flex-start":"right"===w.comboBundle?.infoAlignment?"flex-end":"center"===w.comboBundle?.infoAlignment?"center":void 0,textAlign:w.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},k&&w.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:w.comboBundle?.productTitleFontSize||"28px",color:w.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},T)),k&&w?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:w.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(w.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},kp(w.general.currencySymbol,r.storeCurrencyCode),Ep(y)),!isNaN(Number(f))&&!isNaN(Number(y))&&Number(f)>Number(y)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:w.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},kp(w.general.currencySymbol,r.storeCurrencyCode),Ep(f)),Number(b)>0&&e.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},"discount-on-compare"===w.comboBundle.discountBadgeDisplay?`${v}% Off`:r?.percentageOff?`${r?.percentageOff}% Off`:r?.amountOff?`${kp(w.general.currencySymbol,r.storeCurrencyCode)}${Ep(r?.amountOff)} Off`:`Save ${kp(w.general.currencySymbol,r.storeCurrencyCode)}${Ep(b)}`))),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:w.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:w.comboBundle.productDescriptionFontSize||"16px",color:w.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),w.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,E?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(s?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},r.products.map((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===u[n])?.node;return o?e.createElement(qc,{key:`combo-product-${n}-${t.productId}`,product:t,styles:w,originalPrice:f,dealPrice:y,totalPriceSum:h,selectedVariantId:u[n],onVariantChange:e=>x(n,e),isVertical:E,variantOptions:r.variantOptions,storeCurrencyCode:r.storeCurrencyCode}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(s?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},w.comboBundle.subProductsSectionVisibility&&r.products.map((t,n)=>e.createElement(qc,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:w,originalPrice:f,dealPrice:y,totalPriceSum:h,selectedVariantId:u[n],onVariantChange:e=>x(n,e),variantOptions:r.variantOptions})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${g?"":"yt-comboBundle-bundle-cta-button-disabled"} ${s?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:g?w.general?.ctaBackgroundColor||"#121212":w.general.disabledButtonColor,color:w.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:w.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:g?"pointer":"not-allowed",border:`1px solid ${g?w.general?.ctaBackgroundColor||"#121212":w.general.disabledButtonColor}`,boxShadow:w.general.ctaShadowType,padding:w.general?.ctaPadding,width:w.general?.ctaWidth,margin:"0"},disabled:!g,onMouseOver:e=>{w.general.customizeHoverState&&g&&(e.currentTarget.style.backgroundColor=w.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=w.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{w.general.customizeHoverState&&g&&(e.currentTarget.style.backgroundColor=w.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=w.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{const e=Object.entries(u).map(([e])=>({id:r.products[parseInt(e)].productId,title:r.products[parseInt(e)]?.productDetails?.title}));a?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"combo-bundle",selectedProducts:e}});try{if(c(!0),!i)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void c(!1);const e=Object.entries(u).map(([e,t])=>{const n=r.products[parseInt(e)],o=n.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return o?{variantId:t,price:Number(o.price)}:null}).filter(e=>null!==e),t=Object.values(u);await i(Number(f),t,Number(y),e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}c(!1)}},l?e.createElement(ue,{color:"white",loading:l,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,g?w.comboBundle?.ctaTitle??"Add Bundle to cart":w.general.outOfStockLabel||"Out of Stock"," "))),k&&w.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:w.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:w.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:w.comboBundle.productDescriptionFontSize||"16px",color:w.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:w.general.primaryColor+"08"}},e.createElement("p",null,S))))},Uc=c.div`
3149
3140
  max-width: 800px;
3150
3141
  container-type: inline-size;
3151
3142
  margin-top: ${e=>e.verticalMargin||"0px"};
@@ -3153,10 +3144,10 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3153
3144
  background-color: ${e=>e.$backgroundColor||"transparent"};
3154
3145
 
3155
3146
  ${e=>"transparent"!==e.$backgroundColor?"padding: 10px":""};
3156
- `,Uc=c.div`
3147
+ `,Yc=c.div`
3157
3148
  text-align: left;
3158
3149
  margin-bottom: 24px;
3159
- `,Yc=c.h2`
3150
+ `,Gc=c.h2`
3160
3151
  font-size: ${e=>e.fontSize||"24px"};
3161
3152
  font-weight: 600;
3162
3153
  margin: 0 0 8px 0;
@@ -3168,7 +3159,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3168
3159
  @media (max-width: 600px) {
3169
3160
  font-size: 20px;
3170
3161
  }
3171
- `,Gc=c.p`
3162
+ `,Xc=c.p`
3172
3163
  font-size: ${e=>e.fontSize||"16px"};
3173
3164
  color: #666;
3174
3165
  margin: 0;
@@ -3179,7 +3170,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3179
3170
  @container (max-width: 600px) {
3180
3171
  font-size: 14px;
3181
3172
  }
3182
- `,Xc=c.div`
3173
+ `,Zc=c.div`
3183
3174
  background-color: ${e=>e.primaryBackgroundColorCta||"#121212"};
3184
3175
  color: ${e=>e.primaryTextColorCta||"#FFFFFF"};
3185
3176
  clip-path: polygon(2% 0%, 98% 0%, 100% 100%, 0% 100%);
@@ -3196,7 +3187,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3196
3187
  @container (max-width: 600px) {
3197
3188
  font-size: 10px;
3198
3189
  }
3199
- `,Zc=c.div`
3190
+ `,Kc=c.div`
3200
3191
  border: 1px solid
3201
3192
  ${e=>e.isSelected?e.primaryBackgroundColorCta:"#D4D4D4"};
3202
3193
  border-radius: ${e=>"medium"==e.cornerRadiusType?"6px":"high"==e.cornerRadiusType?"16px":""};
@@ -3211,7 +3202,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3211
3202
  &:hover {
3212
3203
  border-color: ${e=>e.primaryBackgroundColorCta};
3213
3204
  }
3214
- `,Kc=c.div`
3205
+ `,Jc=c.div`
3215
3206
  display: flex;
3216
3207
  justify-content: space-between;
3217
3208
  border-radius: ${e=>"medium"==e.cornerRadiusType?"6px 6px 0px 0px":"high"==e.cornerRadiusType?"16px 16px 0px 0px":""};
@@ -3219,7 +3210,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3219
3210
  padding: 16px;
3220
3211
  background: #f9f9f9;
3221
3212
  min-height: 32px;
3222
- `,Jc=c.div`
3213
+ `,es=c.div`
3223
3214
  display: flex;
3224
3215
  align-items: center;
3225
3216
  gap: 12px;
@@ -3231,7 +3222,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3231
3222
  @container (max-width: 600px) {
3232
3223
  gap: 6px;
3233
3224
  }
3234
- `,es=c.div`
3225
+ `,ts=c.div`
3235
3226
  background-color: ${e=>e.primaryBackgroundColorCta||"#000"};
3236
3227
  color: white;
3237
3228
  padding: 2px 8px;
@@ -3246,13 +3237,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3246
3237
  padding: 2px 4px;
3247
3238
  margin: 0px 5px;
3248
3239
  }
3249
- `,ts=c.span`
3240
+ `,ns=c.span`
3250
3241
  display: flex;
3251
3242
  flex-direction: column;
3252
3243
  justify-content: center;
3253
3244
  align-items: flex-start;
3254
3245
  flex: 1 0 0;
3255
- `,ns=c.h3`
3246
+ `,os=c.h3`
3256
3247
  font-size: 16px;
3257
3248
  font-weight: 600;
3258
3249
  text-align: left;
@@ -3263,7 +3254,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3263
3254
  @container (max-width: 600px) {
3264
3255
  font-size: 14px;
3265
3256
  }
3266
- `,os=c.p`
3257
+ `,rs=c.p`
3267
3258
  font-size: 12px;
3268
3259
  margin: 0;
3269
3260
  @media (max-width: 600px) {
@@ -3272,9 +3263,9 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3272
3263
  @container (max-width: 600px) {
3273
3264
  font-size: 10px;
3274
3265
  }
3275
- `,rs=c.div`
3266
+ `,is=c.div`
3276
3267
  text-align: right;
3277
- `,is=c.span`
3268
+ `,as=c.span`
3278
3269
  font-size: 16px;
3279
3270
  font-weight: 600;
3280
3271
  color: #111;
@@ -3287,7 +3278,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3287
3278
  font-size: 12px;
3288
3279
  margin-left: 4px;
3289
3280
  }
3290
- `,as=c.span`
3281
+ `,ls=c.span`
3291
3282
  font-size: 12px;
3292
3283
  color: #666;
3293
3284
  text-decoration: line-through;
@@ -3297,7 +3288,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3297
3288
  @container (max-width: 600px) {
3298
3289
  font-size: 10px;
3299
3290
  }
3300
- `,ls=c.div`
3291
+ `,cs=c.div`
3301
3292
  display: flex;
3302
3293
  flex-direction: column;
3303
3294
  @media (max-width: 768px) {
@@ -3313,7 +3304,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3313
3304
  max-width: fit-content;
3314
3305
  justify-content: space-between;
3315
3306
  }
3316
- `,cs=c.div`
3307
+ `,ss=c.div`
3317
3308
  margin: auto 0px;
3318
3309
  `;c.div`
3319
3310
  font-size: 12px;
@@ -3324,7 +3315,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3324
3315
  gap: 6px;
3325
3316
  justify-content: flex-start;
3326
3317
  flex-wrap: wrap;
3327
- `;const ss=c.button`
3318
+ `;const ds=c.button`
3328
3319
  padding: 4px 8px;
3329
3320
  border: 1px solid
3330
3321
  ${e=>e.isSelected?e.primaryColor:"#e5e7eb"};
@@ -3345,7 +3336,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3345
3336
  font-size: 10px;
3346
3337
  padding: 4px 8px;
3347
3338
  }
3348
- `,ds=c.button`
3339
+ `,ps=c.button`
3349
3340
  width: ${e=>e.width||"100%"};
3350
3341
  padding: ${e=>e.padding||"16px"};
3351
3342
  background: ${e=>e.bgColor||"#121212"};
@@ -3370,13 +3361,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3370
3361
  }
3371
3362
 
3372
3363
  ${e=>e.hoverProperties.customizeHoverState&&`\n &:hover {\n background: ${e.hoverProperties.backgroundColor||"#dc2626"};\n color: ${e.hoverProperties.textColor||"white"};\n }\n `}
3373
- `,ps=c.label`
3364
+ `,us=c.label`
3374
3365
  display: inline-flex;
3375
3366
  align-items: center;
3376
3367
  cursor: pointer;
3377
- `,us=c.input.attrs({type:"radio"})`
3368
+ `,ms=c.input.attrs({type:"radio"})`
3378
3369
  display: none;
3379
- `,ms=c.span`
3370
+ `,gs=c.span`
3380
3371
  width: 20px;
3381
3372
  height: 20px;
3382
3373
  border-radius: 50%;
@@ -3397,7 +3388,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3397
3388
  transition: transform 0.2s ease-in-out;
3398
3389
  }
3399
3390
 
3400
- ${ps}[data-active="true"] & {
3391
+ ${us}[data-active="true"] & {
3401
3392
  &::before {
3402
3393
  transform: scale(1);
3403
3394
  }
@@ -3418,11 +3409,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3418
3409
  outline: none;
3419
3410
  box-shadow: none;
3420
3411
  }
3421
- `,gs=c.img`
3412
+ `,xs=c.img`
3422
3413
  margin-right: 8px;
3423
3414
  height: 64px;
3424
3415
  border-radius: 8px;
3425
- `,xs=c.li`
3416
+ `,fs=c.li`
3426
3417
  display: flex;
3427
3418
  align-items: center;
3428
3419
  padding: 8px 12px;
@@ -3435,24 +3426,24 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3435
3426
  &:last-child {
3436
3427
  border-bottom: none;
3437
3428
  }
3438
- `,fs=c.img`
3429
+ `,ys=c.img`
3439
3430
  width: 30px;
3440
3431
  height: 30px;
3441
3432
  border-radius: 4px;
3442
3433
  margin-right: 8px;
3443
- `,ys=c.div`
3434
+ `,bs=c.div`
3444
3435
  width: 20px;
3445
3436
  height: 20px;
3446
3437
  border-radius: 50%;
3447
3438
  margin-right: 8px;
3448
3439
  border: 1px solid #ccc;
3449
- `,bs=c.div`
3440
+ `,hs=c.div`
3450
3441
  position: relative;
3451
3442
  min-width: fit-content;
3452
3443
  width: fit-content;
3453
3444
  z-index: ${e=>e.isActive?"9999":"auto"};
3454
3445
  outline: none;
3455
- `,hs=c.button`
3446
+ `,vs=c.button`
3456
3447
  width: 100%;
3457
3448
  display: flex;
3458
3449
  gap: 10px;
@@ -3468,7 +3459,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3468
3459
  background-color: #eaeaea;
3469
3460
  }
3470
3461
  border: 1px solid #e0e0e0;
3471
- `,vs=c.ul`
3462
+ `,ws=c.ul`
3472
3463
  position: absolute;
3473
3464
  top: 100%;
3474
3465
  left: 0;
@@ -3490,22 +3481,22 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3490
3481
  scrollbar-width: none;
3491
3482
 
3492
3483
  -ms-overflow-style: none;
3493
- `,ws=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function Cs({bundle:a,addToCartFunction:l,currentProductId:c,dispatchAnalyticsEvent:s}){const d=o(()=>{if(c){const e="gid://shopify/Product/"+c,t=a.products?.some(t=>t.productId===e);return t?e:a.products?.[0]?.productId}return a.products?.[0]?.productId},[c,a.products]),p=o(()=>ws(d,a.products),[d,a.products]),u=r(null),m=r(null);r({}),document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[g,x]=t(0),[f,y]=t(""),b=a.customizations??{},h=!1===b?.general?.showDecimalsInBundlePricing,v=o(()=>p?.productDetails?.tracksInventory??!0,[p?.productDetails?.tracksInventory]),w=i(e=>{if(!v)return 1/0;if(!e)return 0;if(!e.inventoryItem?.tracked)return 1/0;let t=e.inventoryQuantity??0;return t>0?t:"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0},[v]),C=(o(()=>p?.productDetails?.variants?.edges?.reduce((e,{node:t})=>w(t)>0?e+1:e,0),[p,w]),o(()=>ws(d,a.products)?.id,[d,a.products]));o(()=>C?ws(d,a.products):void 0,[d,a.products,C]),o(()=>a.products?.some(e=>e.productDetails?.options?.some(e=>e.values.length>1))||!1,[a.products]),b.volumeBundle;const E=o(()=>a?.volumeTiers||[],[a?.volumeTiers]),k=E.findIndex(e=>e.isDefault),[T,S]=t(-1!==k?E[k].tier:E?.[0]?.tier||1),[$,B]=t(p?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||""),[N,I]=t({}),[z,F]=t(E.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>p?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[D,P]=t(!1),[A,_]=t(window.innerWidth<550),[R,O]=t(null),[L,M]=t(null);r([]);const V=r([]),j=r(T);n(()=>{if(s?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a._id,bundleType:"volume-bundle"}}),"officialhouseofzelena.myshopify.com"===window?.Shopify?.shop||"791204-63.myshopify.com"===window?.Shopify?.shop){const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelectorAll('[type="submit"]');t&&t.forEach(e=>{e.setAttribute("style","display: none;")})}const e=()=>{_(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{const e=e=>{R&&V.current[R.index]&&V.current[R.index][R.optionIndex]&&!V.current[R.index][R.optionIndex]?.contains(e.target)&&O(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[R]),i(e=>{const t=E.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,o=p?.productDetails?.variants?.edges||[];for(const e of o){const t=e.node;if(w(t)>=n){const e=t.title.split(" / ");return Array(n).fill(e)}}const r=[],i={},a=[...o].sort((e,t)=>{const n=w(e.node),o=w(t.node);return n===1/0&&o===1/0?0:n===1/0?-1:o===1/0?1:o-n});for(let e=0;e<n&&r.length<n;e++){let e=!1;for(const t of a){const n=t.node,o=i[n.id]||0;if(w(n)>o&&n.availableForSale){const t=n.title.split(" / ");r.push(t),i[n.id]=o+1,e=!0;break}}if(!e)return null}return r.length===n?r:null},[p,E,w]);const W=i(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,o=p?.productDetails?.variants?.edges||[];let r=0;for(const e of o){const t=w(e.node);if(t===1/0){r=1/0;break}r+=t}return r>=n},[E,p,w]);n(()=>{const e={},t=p?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&E.forEach(n=>{e[n.tier]={};for(let o=0;o<n.minimumQuantity;o++)e[n.tier][o]=t}),I(e)},[p?.id,E?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),w]);const H=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,q=i((e,t,n,o,r)=>{const i=E.find(t=>t.tier===e);if(!i)return!1;const a=i.minimumQuantity,l=[...n];l[o]=r;const c=l.join(" / "),s=p?.productDetails?.variants?.edges?.find(e=>e.node.title===c)?.node;if(!s||0===w(s))return!1;const d={},u=N[e]||{};for(let e=0;e<a;e++){let n;if(e===t)n=s.id;else{const t=u[e]||$,o=H(p,t);if(!o)return!1;n=o.id}d[n]=(d[n]||0)+1}for(const[e,t]of Object.entries(d)){const n=H(p,e),o=w(n);if(o!==1/0&&t>o)return!1}return!0},[E,p,z,z,N,$,w]),Q=i(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,o=e-1,r={};for(let e=0;e<n;e++){const t=(z[o]?.[e]||p.productDetails.options.map(e=>e.values[0])).join(" / "),n=p?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const i=n.node.id;r[i]=(r[i]||0)+1}for(const[e,t]of Object.entries(r)){const n=H(p,e),o=w(n);if(o!==1/0&&t>o)return!1}return!0},[E,p,z,w]);n(()=>{x(e=>e+1)},[N]);const U=(e,t,n)=>{I(o=>({...o,[e]:{...o[e]||{},[t]:n}}))},Y=i(()=>p?.productDetails?.variants?.edges?.find(e=>w(e.node)>0)?.node||p?.productDetails?.variants?.edges?.[0]?.node,[p,w]),G=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);n(()=>{j.current=T},[T]),n(()=>{L?(M(null),X()):X()},[T]),n(()=>{if(a){const e=Y();if(e)y(e.id),B(e.id);else{const e=p?.productDetails?.variants?.edges?.[0]?.node?.id||"";y(e),B(e)}}},[a,p,Y]);const X=()=>{const e=G();if(e){const t=p?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)B(String(n.id)),x(e=>e+1);else{const e=Y();e&&(B(String(e.id)),n=e),x(e=>e+1)}if(n){0===w(n)?(M(null),setTimeout(()=>{M({tier:j.current,index:0,optionIndex:0,value:n.title})},0)):L&&M(null)}}};n(()=>{X();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",X),()=>{t=!1,window.removeEventListener("urlChange",X),window.history.pushState=n,window.history.replaceState=o}},[G,p?.id,Y,w]);const Z=e=>{const t=E.find(t=>t.tier===e);if(!t)return{original:0,discounted:0,discountedFromPrice:0,discountedFromCompare:0,diffAmountFromPrice:0,diffAmountFromCompare:0,diffPercentFromPrice:0,diffPercentFromCompare:0,discountValue:0};let n=0,o=0,r=0;const i=N[e]||{};for(let e=0;e<t.minimumQuantity;e++){const t=i[e]||$,a=H(p,t);if(!a)continue;const l=Number.parseFloat(a.price);n+=a.compareAtPrice?Number.parseFloat(a.compareAtPrice):l,o+=l,r+=l}if("percentOff"===a?.discountType){r*=1-t.discountValue/100}else"amountOff"===a?.discountType&&(r-=t.discountValue);const l=Math.max(0,r),c=b?.volumeBundle?.discountBadgeDisplay,s=b?.volumeBundle?.discountBadgeVisibility;let d=n;"Disabled"===s?d=l:"discount-on-price"===c&&(d=o);const u=o-l,m=d-l,g=o>0?u/o*100:0,x=d>0?m/d*100:0;return{original:d,discounted:l,discountedFromPrice:l,discountedFromCompare:l,diffAmountFromPrice:u,diffAmountFromCompare:m,diffPercentFromPrice:Math.round(g),diffPercentFromCompare:Math.round(x),discountValue:t.discountValue}},K=(e,t,n,o)=>{let r=H(e,t);if(o){const i=N[o]?.[n||0]||t;r=H(e,i)}return r?.image?.url?r.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""};function J(e){if(e.startsWith("gid://")){const t=e.split("/");return t[t.length-1]}return e}n(()=>{const e=()=>{if(b.volumeBundle?.addtoCartMethod&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod)return;const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelector(".sr-headless-checkout");t&&t?.setAttribute("style","display: none;");const n=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');let o=1;n&&n.value&&(o=parseInt(n.value,10)||1);const r=E.find(e=>e.tier===T);if(!r)return;e.querySelectorAll('.bundle-input-field, [name^="properties["], [name="id"], [name="quantity"], .t4s-quantity-wrapper').forEach(e=>e.remove());const i=r.minimumQuantity;let a={};const l=Math.max(i,o);if(o>i){const e=f||$;if(!e)return;a[e]=l}else{const e=N[r.tier]||{};for(let t=0;t<i;t++){let n=e[t];n||(n=$),n&&(a[n]=(a[n]||0)+1)}}const c=Z(r.tier),s=Object.fromEntries(Object.entries(a).map(([e,t])=>[J(e),Math.round(t)])),d=(t,n,o="bundle-input-field")=>{const r=document.createElement("input");r.type="hidden",r.name=t,r.value=n,r.className=o,e.appendChild(r)};if(o>i){const e=f||$;e&&d("id",J(e))}d("properties[_bundle_price]",String(c.original)),d("properties[_bundle_tier]",String(r.tier)),d("properties[_bundle_items]",JSON.stringify(s));let p=0;Object.entries(s).forEach(([e,t])=>{t>0&&(d(`items[${p}][id]`,e),d(`items[${p}][quantity]`,String(t)),p++)}),requestAnimationFrame(()=>{const t=e.querySelector('[type="submit"]'),n=e.querySelector(".noti-btn-main-wrap"),r=(e,t,n)=>{if(!e)return;e.disabled=t,e.classList.toggle("disabled",t);const o=e.querySelector("[data-add-to-cart-text]")||e.querySelector("span");o&&(o.textContent=n)};o<=i&&(L?(r(t,!0,"Sold out"),t&&t.classList.add("btn--sold-out","hidden"),n&&(n.style.display="block",n.classList.remove("hidden"),n.classList.add("block"))):(r(t,!1,"Add to cart"),t&&t.classList.remove("btn--sold-out","hidden"),n&&(n.style.display="none",n.classList.add("hidden"))))})};e();const t=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');if(t){const n=()=>{requestAnimationFrame(()=>{e()})};return t.addEventListener("input",n),t.addEventListener("change",n),()=>{t.removeEventListener("input",n),t.removeEventListener("change",n)}}return()=>{}},[T,JSON.stringify(N),$,b.volumeBundle?.cardStyle,c,f,L]);const ee=o(()=>E.find(e=>e.tier===T),[E,T]),te=o(()=>ee?Z(ee.tier):null,[ee,N,$]),ne=o(()=>{if(!ee||!te)return;const e=N[ee.tier]||{},t={};for(let n=0;n<ee.minimumQuantity;n++){const o=e[n]||$;t[o]=(t[o]||0)+1}return t},[ee?.minimumQuantity,$,N,te]),oe=o(()=>Object.entries(ne??{}).map(([e,t])=>({variantId:e,quantity:t})),[ne]);if(n(()=>{if(!ee||!te)return;const e={tier:T,items:ee.minimumQuantity,discountedPrice:te.discounted,originalPrice:te.original,variants:oe,productId:p?.id??null,tierMeta:{title:ee.title,subtitle:ee.subtitle,badgeTitle:ee.badgeTitle},productData:p,tierData:ee},t=m.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(u.current&&clearTimeout(u.current),u.current=window.setTimeout(()=>{m.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t),l&&(window.ytVolumeBundle={bundle:a,addToCart:l,currentTier:ee,selectedVariants:oe},window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:{...e,addToCart:l}})))},50),()=>{u.current&&clearTimeout(u.current)})},[T,ee?.tier,ee?.minimumQuantity,te?.discounted,te?.original,p?.id,JSON.stringify(oe),l,a]),n(()=>()=>{window.ytVolumeBundle=void 0,window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:void 0}))},[]),n(()=>{if(!$||!p)return;const e=H(p,$);if(!e)return;const t=e.title.split(" / "),n={},o={};E.forEach(e=>{const r=e.tier-1,i={};for(let t=0;t<e.minimumQuantity;t++)i[t]=$;n[e.tier]=i,o[r]=Array(e.minimumQuantity).fill(t)}),I(e=>({...e,...n})),F(e=>({...e,...o}))},[$,p?.id,E.length]),!l)return e.createElement(e.Fragment,null);const re=b.volumeBundle?.cardStyle,ie=b.general?.primaryColor,ae=b.general?.secondaryColor,le=b.general.primaryContrastColor,ce=b.general.secondaryContrastColor,se="high"===a.cornerRadiusType?"20px":"medium"===a.cornerRadiusType?"6px":"0px",de="bundles"==a.appName?a.pageHeader?.title:a?.title,pe="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;return n(()=>{const e=Q(T);e?M(null):e||M({tier:T,index:0,optionIndex:0,value:""})},[T,oe,Q]),e.createElement(Qc,{verticalMargin:b.volumeBundle?.verticalMargin,$backgroundColor:b.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},e.createElement(Uc,{className:"yt-bundle-header"},de&&de.trim().length>0&&e.createElement(Yc,{fontSize:b.volumeBundle?.titleFontSize,$backgroundColor:b.volumeBundle?.titleBackgroundColor,textColor:b.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},de),e.createElement(Gc,{className:"yt-bundle-header-subtitle",fontSize:b.volumeBundle?.subtitleFontSize},pe)),"vertical"===re?e.createElement("div",{style:{display:"grid",gridTemplateColumns:A||4===E.length?"repeat(2, 1fr)":E.length>4?"repeat(3, 1fr)":`repeat(${E.length}, 1fr)`,justifyItems:"center",gap:A?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},E.map(t=>{const n=Z(t.tier),o=n.original-n.discounted,r=T===t.tier,i=!W(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:se||"24px",...r?{border:`2px solid ${ie}`}:{border:`1px solid ${ae}`},boxShadow:`6px 6px 0px -1px ${r?ie:ae}20`,...t.badgeTitle&&{position:"relative"},zIndex:5,backgroundColor:i?"#f5f5f5":"white",cursor:i?"not-allowed":"pointer",position:"relative",height:"100%",maxHeight:"350px",width:"100%",opacity:i?.6:1},className:"yt-volume-vertical-tier-item "+(r?"yt-volume-vertical-tier-item-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),onClick:()=>!i&&S(t.tier)},t.badgeTitle&&e.createElement("div",{style:{position:"absolute",top:"-15px",zIndex:-1,left:"0",right:"0",width:"80%",textAlign:"center",margin:"0 auto",fontSize:"10px",clipPath:"polygon(2% 0%, 98% 0%, 100% 100%, 0% 100%)",backgroundColor:r?ie:ae,color:r?le:ce,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:r?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},"Enabled"===b.volumeBundle?.discountBadgeVisibility&&A&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=Ep(b.general.currencySymbol,a.storeCurrencyCode);let i="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(i="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Cp(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(i="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Cp(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(i="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Cp(n.discountValue)}`);return i?e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},e.createElement(es,{primaryBackgroundColorCta:r?ie:ae,isSelected:r,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:r?le:ce},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},i)):null})(),t.imageUrl&&e.createElement("img",{src:kp(t.imageUrl),style:{objectFit:"cover",aspectRatio:"1/1",width:"100%",maxHeight:"160px",maxWidth:"160px",height:"fit-content",borderTopLeftRadius:se||"24px",borderTopRightRadius:se||"24px"},className:"yt-volume-vertical-tier-badge"})),e.createElement("div",{style:{padding:"8px",paddingTop:"0"}},e.createElement(ts,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},e.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},e.createElement(ns,{style:{fontSize:A?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},t.title?t.title:e.createElement(e.Fragment,null,"Buy ",t.minimumQuantity,", Get"," ",t.discountValue,"% Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&!A&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=Ep(b.general.currencySymbol,a.storeCurrencyCode);let i="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(i="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Cp(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(i="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Cp(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(i="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Cp(n.discountValue)}`);return i?e.createElement(es,{primaryBackgroundColorCta:r?ie:ae,isSelected:r,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:r?le:ce},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},i):null})(),r&&t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:le,padding:"2px"}},e.createElement(Oe,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),e.createElement(os,{style:{lineHeight:"normal",fontSize:A?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null))),W(t.tier)?e.createElement(rs,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":t.tier,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),"data-savings":o.toFixed(h?0:2)},(()=>{const r=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===r)return;let i="",l="";if("unit-price"===r){const e=n.discounted/t.minimumQuantity;i=(n.original/t.minimumQuantity).toFixed(h?0:2),l=e.toFixed(h?0:2)}else"tier-price"===r&&(i=n.original.toFixed(h?0:2),l=n.discounted.toFixed(h?0:2));return e.createElement(e.Fragment,null,e.createElement(is,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},Ep(b.general.currencySymbol,a.storeCurrencyCode),Cp(l),"unit-price"===r?"/unit":""),o>0&&e.createElement(as,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},Ep(b.general.currencySymbol,a.storeCurrencyCode),Cp(i),"unit-price"===r?"/unit":""))})()):e.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),r&&!t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:le,padding:"2px"}},e.createElement(Oe,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):e.createElement(e.Fragment,null,E.map(t=>{const n=Z(t.tier),o=n.original-n.discounted,r=!W(t.tier);return e.createElement(e.Fragment,{key:t.tier},t.badgeTitle&&e.createElement(Xc,{primaryTextColorCta:le,primaryBackgroundColorCta:ie,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement(Zc,{cornerRadiusType:a?.cornerRadiusType??"",key:t.tier,primaryBackgroundColorCta:ie??"",isSelected:T===t.tier,onClick:()=>S(t.tier),style:{borderRadius:se,cursor:"pointer",backgroundColor:r?"#f5f5f5":"white",opacity:r?.6:1},className:"yt-volume-horizontal-tier-container "+(T===t.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2)},e.createElement(Kc,{cornerRadiusType:a?.cornerRadiusType??"",style:{borderRadius:se,borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},className:"yt-volume-horizontal-tier-header"},e.createElement(Jc,{className:"yt-volume-horizontal-tier-info"},e.createElement(ps,{"data-active":T===t.tier,accentColor:ie,className:"yt-volume-horizontal-tier-radio-wrapper"},e.createElement(us,{name:"tier",checked:T===t.tier,onChange:()=>!r&&S(t.tier),disabled:r,className:"yt-volume-horizontal-tier-radio-hidden"}),e.createElement(ms,{accentColor:ie,className:"yt-volume-horizontal-tier-radio-custom"})),e.createElement(ts,{className:"yt-volume-horizontal-tier-details"},e.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},e.createElement(ns,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},t.title?t.title:e.createElement(e.Fragment,null,"Buy ",t.minimumQuantity,", Get"," ",t.discountValue,"% Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=Ep(b.general.currencySymbol,a.storeCurrencyCode);let r="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(r="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Cp(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(r="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Cp(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(r="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Cp(n.discountValue)}`);return r?e.createElement(es,{primaryBackgroundColorCta:ie,isSelected:T===t.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},r):null})()),e.createElement(os,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null)))),W(t.tier)?e.createElement(rs,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":t.tier,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),"data-savings":o.toFixed(0)},(()=>{const r=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===r)return;let i="",l="";if("unit-price"===r){const e=n.discounted/t.minimumQuantity;i=(n.original/t.minimumQuantity).toFixed(h?0:2),l=e.toFixed(h?0:2)}else"tier-price"===r&&(i=n.original.toFixed(h?0:2),l=n.discounted.toFixed(h?0:2));return e.createElement(e.Fragment,null,o>0?e.createElement(as,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},Ep(b.general.currencySymbol,a.storeCurrencyCode),Cp(i),"unit-price"===r?"/unit":""):"",e.createElement(is,{className:"yt-volume-horizontal-tier-discounted-price"},Ep(b.general.currencySymbol,a.storeCurrencyCode),Cp(l),"unit-price"===r?"/unit":""))})()):e.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},e.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),T===t.tier&&e.createElement(ls,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px 15px":"0",gap:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px":"0"}},Array.from({length:t.minimumQuantity}).map((n,o)=>{const i=t.tier-1,l=(z[i]||[])[o]||p.productDetails.options?.map(e=>e.values[0])||[],c=p?.productDetails?.options.some(e=>e.values.length>1)||1===p?.productDetails?.variants?.edges?.length&&"Default Title"!==p?.productDetails?.variants?.edges[0]?.node?.title;return e.createElement("div",{key:o,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},c&&e.createElement(gs,{src:kp(K(p,$,o,t.tier)),alt:p?.productDetails?.title||"Product",style:{height:"64px",width:"auto"},className:"yt-volume-horizontal-tier-product-image"}),("auto"===b?.volumeBundle?.variantSelectorType||"dropdown"===b?.volumeBundle?.variantSelectorType)&&e.createElement("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"}},p?.productDetails?.options?.map((n,c)=>{const s=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===s.length||1===s.length&&"Default Title"===s[0])return null;const d=R?.tier===t.tier&&R?.index===o&&R?.optionIndex===c,u=a?.variantOptions?.options?.find(e=>e.name===n.name);let m="";return"color"===u?.type&&(m=u?.values?.find(e=>e.name===l[c])?.value||""),e.createElement(bs,{key:c,ref:e=>{V.current[o]||(V.current[o]=[]),V.current[o][c]=e},style:{zIndex:d?1e3:"auto",display:"flex",flexDirection:"column",gap:"4px"},isActive:d},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement(hs,{onClick:e=>{e.stopPropagation(),O(d?null:{tier:t.tier,index:o,optionIndex:c})},isActive:d,disabled:r},"color"===u?.type&&m&&e.createElement("div",{className:"yt-fixedBundle-product-card_color-swatch",style:{display:"inline-block",width:20,height:20,borderRadius:"50%",backgroundColor:m||"transparent",border:"1px solid #ddd"}}),l[c],e.createElement($e,{style:{display:"block"}})),d&&e.createElement(vs,{style:{zIndex:1001}},s.map((n,a)=>{const s=[...l];s[c]=n;const d=!q(t.tier,o,l,c,n)||r;p.productDetails.variants.edges.find(({node:e})=>e.title===s.join(" / "));const m=e=>{if(e.preventDefault(),e.stopPropagation(),F(e=>{const t={...e},n=[...t[i]||[]];return n[o]=s,t[i]=n,t}),d){M({tier:T,index:o,optionIndex:c,value:n}),O(null);const e=s.join(" / "),r=p.productDetails.variants.edges.find(t=>t.node.title===e)?.node.id||$;return void U(t.tier,o,r)}const r=s.join(" / "),a=p.productDetails.variants.edges.find(e=>e.node.title===r)?.node.id||$;U(t.tier,o,a),O(null)},g=u?.values.find(e=>e.name===n);return"image"===u?.type&&g?.value?e.createElement(xs,{key:n,onClick:m,style:{cursor:"pointer"}},e.createElement(fs,{src:g.value,alt:n}),n):"color"===u?.type&&g?.value?e.createElement(xs,{key:n,onClick:m,style:{cursor:"pointer"}},e.createElement(ys,{style:{backgroundColor:g.value}}),n):e.createElement(xs,{key:n,onClick:m,style:{cursor:"pointer"}},n)})))})),"swatches"===b?.volumeBundle?.variantSelectorType&&e.createElement(cs,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},p?.productDetails?.options.map((n,c)=>{const s=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===s.length||1===s.length&&"Default Title"===s[0])return null;const d=a.variantOptions?.options?.find(e=>e.name===n.name)||null;return e.createElement("div",{key:n.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},s.map(n=>{const a=l[c]===n,s=!q(t.tier,o,l,c,n)||r,u=d?.values.find(e=>e.name===n),m=e=>{if(e.preventDefault(),e.stopPropagation(),s)return;const r=[...l];r[c]=n,F(e=>{const t={...e},n=[...t[i]||[]];return n[o]=r,t[i]=n,t});const a=r.join(" / "),d=p.productDetails.variants.edges.find(e=>e.node.title===a)?.node.id||$;U(t.tier,o,d)},g={opacity:s?.5:1,cursor:s?"not-allowed":"pointer"};return"color"===d?.type&&u?.value?e.createElement("button",{key:n,onClick:m,style:{...g,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-color-button",disabled:s},e.createElement("div",{style:{width:a?"24px":"20px",height:a?"24px":"20px",borderRadius:"50%",backgroundColor:u.value,lineHeight:"normal",boxShadow:"rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 2px"}},e.createElement("span",null))):"image"===d?.type&&u?.value?e.createElement("button",{key:n,onClick:m,style:{...g,border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:a?"#F7F7F7":"transparent",padding:"0px",width:a?"20px":"18px",height:a?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-image-button",disabled:s},e.createElement("img",{src:u.value,alt:n,style:{width:a?"26px":"24px",height:a?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):e.createElement(ss,{key:n,isSelected:a,onClick:m,style:{...g,padding:"4px 8px",border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button-default",disabled:s},n)})))})))})),L&&L.tier===t.tier&&e.createElement("div",{style:{color:ie,textAlign:"center",fontSize:"14px",fontStyle:"normal",fontWeight:"500",lineHeight:"110%",background:`${ie}1A`,padding:"12px",borderBottomLeftRadius:se,borderBottomRightRadius:se}},"There aren’t enough items in our stock for select option, please select smaller bundle.")))})),a?.showCta&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod&&e.createElement("div",{style:{position:"relative"}},e.createElement(ds,{bgColor:Q(T)?b.general?.ctaBackgroundColor:"#ccc",textColor:Q(T)?b.general?.ctaTextColor:"#666",border:`1px solid ${Q(T)?b.general?.ctaBorderColor||"#121212":"#999"}`,shadow:b.general.ctaShadowType,padding:b.general?.ctaPadding,width:b.general?.ctaWidth,hoverProperties:{customizeHoverState:!!Q(T)&&b.general?.customizeHoverState,backgroundColor:b.general?.ctaHoverBackgroundColor,textColor:b.general?.ctaHoverTextColor},onClick:async()=>{if(Q(T))try{P(!0);const e=E.find(e=>e.tier===T);if(!e)return;const t={},n=N[e.tier]||{};for(let o=0;o<e.minimumQuantity;o++){const e=n[o]||$;t[e]?t[e].quantity+=1:t[e]={quantity:1}}s?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"volume-bundle",selectedProducts:p?[{id:p?.productId,title:p?.productDetails?.title}]:[],selectedVariants:Object.values(n)}});const o=Z(e.tier),r=Array.from({length:e.minimumQuantity},(e,t)=>n[t]||$);l&&await l(o.original,r)}catch(e){console.error("VolumeBundle handleAddToCart error:",e)}finally{P(!1)}else console.error("Selected tier is out of stock")},borderRadius:b.general.ctaBorderRadius??"",disabled:D||!Q(T),className:"yt-volume-add-to-cart-button"},Q(T)?e.createElement(e.Fragment,null,D?e.createElement(rt,{color:"white",loading:D,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,b.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=Z(T);return e.createElement(e.Fragment,null,Ep(b.general.currencySymbol,a.storeCurrencyCode),Cp(t.discounted.toFixed(h?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},Ep(b.general.currencySymbol,a.storeCurrencyCode),Cp(t?.original.toFixed(h?0:2))," "))})()))):e.createElement(e.Fragment,null,"Out of Stock"))))}const Es=c.div`
3484
+ `,Cs=(e,t)=>{if(!t)return{};for(const n of t)if(n.productId==e)return n;return{}};function Es({bundle:a,addToCartFunction:l,currentProductId:c,dispatchAnalyticsEvent:s}){const d=o(()=>{if(c){const e="gid://shopify/Product/"+c,t=a.products?.some(t=>t.productId===e);return t?e:a.products?.[0]?.productId}return a.products?.[0]?.productId},[c,a.products]),p=o(()=>Cs(d,a.products),[d,a.products]),u=r(null),m=r(null);r({}),document.querySelector("#ProductSelect-product-template"),document.querySelector('form[action="/cart/add"]');const[g,x]=t(0),[f,y]=t(""),b=a.customizations??{},h=!1===b?.general?.showDecimalsInBundlePricing,v=o(()=>p?.productDetails?.tracksInventory??!0,[p?.productDetails?.tracksInventory]),w=i(e=>{if(!v)return 1/0;if(!e)return 0;if(!e.inventoryItem?.tracked)return 1/0;let t=e.inventoryQuantity??0;return t>0?t:"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0},[v]),C=(o(()=>p?.productDetails?.variants?.edges?.reduce((e,{node:t})=>w(t)>0?e+1:e,0),[p,w]),o(()=>Cs(d,a.products)?.id,[d,a.products]));o(()=>C?Cs(d,a.products):void 0,[d,a.products,C]),o(()=>a.products?.some(e=>e.productDetails?.options?.some(e=>e.values.length>1))||!1,[a.products]),b.volumeBundle;const E=o(()=>a?.volumeTiers||[],[a?.volumeTiers]),k=E.findIndex(e=>e.isDefault),[T,S]=t(-1!==k?E[k].tier:E?.[0]?.tier||1),[$,B]=t(p?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||""),[N,I]=t({}),[z,F]=t(E.reduce((e,t,n)=>(e[t.tier-1]=Array.from({length:t.minimumQuantity},()=>p?.productDetails?.options?.map(e=>e.values[0])||[]),e),{})||{}),[D,P]=t(!1),[A,_]=t(window.innerWidth<550),[R,O]=t(null),[L,M]=t(null);r([]);const V=r([]),j=r(T);n(()=>{if(s?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a._id,bundleType:"volume-bundle"}}),"officialhouseofzelena.myshopify.com"===window?.Shopify?.shop||"791204-63.myshopify.com"===window?.Shopify?.shop){const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelectorAll('[type="submit"]');t&&t.forEach(e=>{e.setAttribute("style","display: none;")})}const e=()=>{_(window.innerWidth<550)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{const e=e=>{R&&V.current[R.index]&&V.current[R.index][R.optionIndex]&&!V.current[R.index][R.optionIndex]?.contains(e.target)&&O(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[R]),i(e=>{const t=E.find(t=>t.tier===e);if(!t)return null;const n=t.minimumQuantity,o=p?.productDetails?.variants?.edges||[];for(const e of o){const t=e.node;if(w(t)>=n){const e=t.title.split(" / ");return Array(n).fill(e)}}const r=[],i={},a=[...o].sort((e,t)=>{const n=w(e.node),o=w(t.node);return n===1/0&&o===1/0?0:n===1/0?-1:o===1/0?1:o-n});for(let e=0;e<n&&r.length<n;e++){let e=!1;for(const t of a){const n=t.node,o=i[n.id]||0;if(w(n)>o&&n.availableForSale){const t=n.title.split(" / ");r.push(t),i[n.id]=o+1,e=!0;break}}if(!e)return null}return r.length===n?r:null},[p,E,w]);const W=i(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,o=p?.productDetails?.variants?.edges||[];let r=0;for(const e of o){const t=w(e.node);if(t===1/0){r=1/0;break}r+=t}return r>=n},[E,p,w]);n(()=>{const e={},t=p?.productDetails?.variants?.edges?.find(e=>w(e?.node)>0)?.node?.id||p?.productDetails?.variants?.edges?.[0]?.node?.id||"";t&&E.forEach(n=>{e[n.tier]={};for(let o=0;o<n.minimumQuantity;o++)e[n.tier][o]=t}),I(e)},[p?.id,E?.map(e=>`${e.tier}-${e.minimumQuantity}`).join("|"),w]);const H=(e,t)=>e?.productDetails?.variants?.edges?.find(e=>e.node.id===t)?.node,q=i((e,t,n,o,r)=>{const i=E.find(t=>t.tier===e);if(!i)return!1;const a=i.minimumQuantity,l=[...n];l[o]=r;const c=l.join(" / "),s=p?.productDetails?.variants?.edges?.find(e=>e.node.title===c)?.node;if(!s||0===w(s))return!1;const d={},u=N[e]||{};for(let e=0;e<a;e++){let n;if(e===t)n=s.id;else{const t=u[e]||$,o=H(p,t);if(!o)return!1;n=o.id}d[n]=(d[n]||0)+1}for(const[e,t]of Object.entries(d)){const n=H(p,e),o=w(n);if(o!==1/0&&t>o)return!1}return!0},[E,p,z,z,N,$,w]),Q=i(e=>{const t=E.find(t=>t.tier===e);if(!t)return!1;const n=t.minimumQuantity,o=e-1,r={};for(let e=0;e<n;e++){const t=(z[o]?.[e]||p.productDetails.options.map(e=>e.values[0])).join(" / "),n=p?.productDetails?.variants?.edges?.find(e=>e.node.title===t);if(!n)return!1;const i=n.node.id;r[i]=(r[i]||0)+1}for(const[e,t]of Object.entries(r)){const n=H(p,e),o=w(n);if(o!==1/0&&t>o)return!1}return!0},[E,p,z,w]);n(()=>{x(e=>e+1)},[N]);const U=(e,t,n)=>{I(o=>({...o,[e]:{...o[e]||{},[t]:n}}))},Y=i(()=>p?.productDetails?.variants?.edges?.find(e=>w(e.node)>0)?.node||p?.productDetails?.variants?.edges?.[0]?.node,[p,w]),G=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]);n(()=>{j.current=T},[T]),n(()=>{L?(M(null),X()):X()},[T]),n(()=>{if(a){const e=Y();if(e)y(e.id),B(e.id);else{const e=p?.productDetails?.variants?.edges?.[0]?.node?.id||"";y(e),B(e)}}},[a,p,Y]);const X=()=>{const e=G();if(e){const t=p?.productDetails?.variants?.edges?.find(t=>String(t.node.id)==="gid://shopify/ProductVariant/"+String(e));let n=t?.node;if(n)B(String(n.id)),x(e=>e+1);else{const e=Y();e&&(B(String(e.id)),n=e),x(e=>e+1)}if(n){0===w(n)?(M(null),setTimeout(()=>{M({tier:j.current,index:0,optionIndex:0,value:n.title})},0)):L&&M(null)}}};n(()=>{X();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",X),()=>{t=!1,window.removeEventListener("urlChange",X),window.history.pushState=n,window.history.replaceState=o}},[G,p?.id,Y,w]);const Z=e=>{const t=E.find(t=>t.tier===e);if(!t)return{original:0,discounted:0,discountedFromPrice:0,discountedFromCompare:0,diffAmountFromPrice:0,diffAmountFromCompare:0,diffPercentFromPrice:0,diffPercentFromCompare:0,discountValue:0};let n=0,o=0,r=0;const i=N[e]||{};for(let e=0;e<t.minimumQuantity;e++){const t=i[e]||$,a=H(p,t);if(!a)continue;const l=Number.parseFloat(a.price);n+=a.compareAtPrice?Number.parseFloat(a.compareAtPrice):l,o+=l,r+=l}if("percentOff"===a?.discountType){r*=1-t.discountValue/100}else"amountOff"===a?.discountType&&(r-=t.discountValue);const l=Math.max(0,r),c=b?.volumeBundle?.discountBadgeDisplay,s=b?.volumeBundle?.discountBadgeVisibility;let d=n;"Disabled"===s?d=l:"discount-on-price"===c&&(d=o);const u=o-l,m=d-l,g=o>0?u/o*100:0,x=d>0?m/d*100:0;return{original:d,discounted:l,discountedFromPrice:l,discountedFromCompare:l,diffAmountFromPrice:u,diffAmountFromCompare:m,diffPercentFromPrice:Math.round(g),diffPercentFromCompare:Math.round(x),discountValue:t.discountValue}},K=(e,t,n,o)=>{let r=H(e,t);if(o){const i=N[o]?.[n||0]||t;r=H(e,i)}return r?.image?.url?r.image.url:e.productDetails?.media?.edges[0]?.node?.preview?.image?.url||""};function J(e){if(e.startsWith("gid://")){const t=e.split("/");return t[t.length-1]}return e}n(()=>{const e=()=>{if(b.volumeBundle?.addtoCartMethod&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod)return;const e=document.querySelector('form[action="/cart/add"]');if(!e)return;const t=e.querySelector(".sr-headless-checkout");t&&t?.setAttribute("style","display: none;");const n=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');let o=1;n&&n.value&&(o=parseInt(n.value,10)||1);const r=E.find(e=>e.tier===T);if(!r)return;e.querySelectorAll('.bundle-input-field, [name^="properties["], [name="id"], [name="quantity"], .t4s-quantity-wrapper').forEach(e=>e.remove());const i=r.minimumQuantity;let a={};const l=Math.max(i,o);if(o>i){const e=f||$;if(!e)return;a[e]=l}else{const e=N[r.tier]||{};for(let t=0;t<i;t++){let n=e[t];n||(n=$),n&&(a[n]=(a[n]||0)+1)}}const c=Z(r.tier),s=Object.fromEntries(Object.entries(a).map(([e,t])=>[J(e),Math.round(t)])),d=(t,n,o="bundle-input-field")=>{const r=document.createElement("input");r.type="hidden",r.name=t,r.value=n,r.className=o,e.appendChild(r)};if(o>i){const e=f||$;e&&d("id",J(e))}d("properties[_bundle_price]",String(c.original)),d("properties[_bundle_tier]",String(r.tier)),d("properties[_bundle_items]",JSON.stringify(s));let p=0;Object.entries(s).forEach(([e,t])=>{t>0&&(d(`items[${p}][id]`,e),d(`items[${p}][quantity]`,String(t)),p++)}),requestAnimationFrame(()=>{const t=e.querySelector('[type="submit"]'),n=e.querySelector(".noti-btn-main-wrap"),r=(e,t,n)=>{if(!e)return;e.disabled=t,e.classList.toggle("disabled",t);const o=e.querySelector("[data-add-to-cart-text]")||e.querySelector("span");o&&(o.textContent=n)};o<=i&&(L?(r(t,!0,"Sold out"),t&&t.classList.add("btn--sold-out","hidden"),n&&(n.style.display="block",n.classList.remove("hidden"),n.classList.add("block"))):(r(t,!1,"Add to cart"),t&&t.classList.remove("btn--sold-out","hidden"),n&&(n.style.display="none",n.classList.add("hidden"))))})};e();const t=document.querySelector("#Quantity-product-template")||document.querySelector('input[name="quantity"]')||document.querySelector('input[type="number"][min="1"]');if(t){const n=()=>{requestAnimationFrame(()=>{e()})};return t.addEventListener("input",n),t.addEventListener("change",n),()=>{t.removeEventListener("input",n),t.removeEventListener("change",n)}}return()=>{}},[T,JSON.stringify(N),$,b.volumeBundle?.cardStyle,c,f,L]);const ee=o(()=>E.find(e=>e.tier===T),[E,T]),te=o(()=>ee?Z(ee.tier):null,[ee,N,$]),ne=o(()=>{if(!ee||!te)return;const e=N[ee.tier]||{},t={};for(let n=0;n<ee.minimumQuantity;n++){const o=e[n]||$;t[o]=(t[o]||0)+1}return t},[ee?.minimumQuantity,$,N,te]),oe=o(()=>Object.entries(ne??{}).map(([e,t])=>({variantId:e,quantity:t})),[ne]);if(n(()=>{if(!ee||!te)return;const e={tier:T,items:ee.minimumQuantity,discountedPrice:te.discounted,originalPrice:te.original,variants:oe,productId:p?.id??null,tierMeta:{title:ee.title,subtitle:ee.subtitle,badgeTitle:ee.badgeTitle},productData:p,tierData:ee},t=m.current;return t&&JSON.stringify(t)===JSON.stringify(e)?void 0:(u.current&&clearTimeout(u.current),u.current=window.setTimeout(()=>{m.current=e;const t=new CustomEvent("ytBundleTierChange",{detail:e});window.dispatchEvent(t),l&&(window.ytVolumeBundle={bundle:a,addToCart:l,currentTier:ee,selectedVariants:oe},window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:{...e,addToCart:l}})))},50),()=>{u.current&&clearTimeout(u.current)})},[T,ee?.tier,ee?.minimumQuantity,te?.discounted,te?.original,p?.id,JSON.stringify(oe),l,a]),n(()=>()=>{window.ytVolumeBundle=void 0,window.dispatchEvent(new CustomEvent("yt-volume-bundle-updated",{detail:void 0}))},[]),n(()=>{if(!$||!p)return;const e=H(p,$);if(!e)return;const t=e.title.split(" / "),n={},o={};E.forEach(e=>{const r=e.tier-1,i={};for(let t=0;t<e.minimumQuantity;t++)i[t]=$;n[e.tier]=i,o[r]=Array(e.minimumQuantity).fill(t)}),I(e=>({...e,...n})),F(e=>({...e,...o}))},[$,p?.id,E.length]),!l)return e.createElement(e.Fragment,null);const re=b.volumeBundle?.cardStyle,ie=b.general?.primaryColor,ae=b.general?.secondaryColor,le=b.general.primaryContrastColor,ce=b.general.secondaryContrastColor,se="high"===a.cornerRadiusType?"20px":"medium"===a.cornerRadiusType?"6px":"0px",de="bundles"==a.appName?a.pageHeader?.title:a?.title,pe="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;return n(()=>{const e=Q(T);e?M(null):e||M({tier:T,index:0,optionIndex:0,value:""})},[T,oe,Q]),e.createElement(Uc,{verticalMargin:b.volumeBundle?.verticalMargin,$backgroundColor:b.volumeBundle?.sectionBackgroundColor,className:"yt-bundle-container"},e.createElement(Yc,{className:"yt-bundle-header"},de&&de.trim().length>0&&e.createElement(Gc,{fontSize:b.volumeBundle?.titleFontSize,$backgroundColor:b.volumeBundle?.titleBackgroundColor,textColor:b.volumeBundle?.titleTextColor,className:"yt-bundle-header-title"},de),e.createElement(Xc,{className:"yt-bundle-header-subtitle",fontSize:b.volumeBundle?.subtitleFontSize},pe)),"vertical"===re?e.createElement("div",{style:{display:"grid",gridTemplateColumns:A||4===E.length?"repeat(2, 1fr)":E.length>4?"repeat(3, 1fr)":`repeat(${E.length}, 1fr)`,justifyItems:"center",gap:A?"10px":"16px",paddingTop:"10px"},className:"yt-bundle-vertical-container"},E.map(t=>{const n=Z(t.tier),o=n.original-n.discounted,r=T===t.tier,i=!W(t.tier);return e.createElement(e.Fragment,{key:t.tier},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",borderRadius:se||"24px",...r?{border:`2px solid ${ie}`}:{border:`1px solid ${ae}`},boxShadow:`6px 6px 0px -1px ${r?ie:ae}20`,...t.badgeTitle&&{position:"relative"},zIndex:5,backgroundColor:i?"#f5f5f5":"white",cursor:i?"not-allowed":"pointer",position:"relative",height:"100%",maxHeight:"350px",width:"100%",opacity:i?.6:1},className:"yt-volume-vertical-tier-item "+(r?"yt-volume-vertical-tier-item-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),onClick:()=>!i&&S(t.tier)},t.badgeTitle&&e.createElement("div",{style:{position:"absolute",top:"-15px",zIndex:-1,left:"0",right:"0",width:"80%",textAlign:"center",margin:"0 auto",fontSize:"10px",clipPath:"polygon(2% 0%, 98% 0%, 100% 100%, 0% 100%)",backgroundColor:r?ie:ae,color:r?le:ce,padding:"2px 0",borderRadius:"12px 12px 0px 0px",lineHeight:"normal"},className:r?"yt-volume-vertical-tier-badge-active":"yt-volume-vertical-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",height:"fit-content"},className:"yt-volume-vertical-tier-save-badge-container"},"Enabled"===b.volumeBundle?.discountBadgeVisibility&&A&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=kp(b.general.currencySymbol,a.storeCurrencyCode);let i="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(i="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Ep(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(i="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Ep(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(i="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Ep(n.discountValue)}`);return i?e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"5px",top:"8px"}},e.createElement(ts,{primaryBackgroundColorCta:r?ie:ae,isSelected:r,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:r?le:ce},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},i)):null})(),t.imageUrl&&e.createElement("img",{src:Tp(t.imageUrl),style:{objectFit:"cover",aspectRatio:"1/1",width:"100%",maxHeight:"160px",maxWidth:"160px",height:"fit-content",borderTopLeftRadius:se||"24px",borderTopRightRadius:se||"24px"},className:"yt-volume-vertical-tier-badge"})),e.createElement("div",{style:{padding:"8px",paddingTop:"0"}},e.createElement(ns,{style:{display:"flex",width:"100%",gap:"4px"},className:"yt-volume-vertical-details-container"},e.createElement("div",{style:{display:"flex",alignItems:"center",position:"relative",width:"100%"},className:"yt-volume-vertical-details-title-container"},e.createElement(os,{style:{fontSize:A?"12px":"14px",lineHeight:"normal"},className:"yt-volume-vertical-details-title"},t.title?t.title:e.createElement(e.Fragment,null,"Buy ",t.minimumQuantity,", Get"," ",t.discountValue,"% Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&!A&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=kp(b.general.currencySymbol,a.storeCurrencyCode);let i="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(i="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Ep(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(i="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Ep(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(i="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Ep(n.discountValue)}`);return i?e.createElement(ts,{primaryBackgroundColorCta:r?ie:ae,isSelected:r,style:{height:"fit-content",fontSize:"10px",lineHeight:"normal",color:r?le:ce},className:"yt-volume-vertical-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},i):null})(),r&&t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"0px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:le,padding:"2px"}},e.createElement(Me,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))),e.createElement(rs,{style:{lineHeight:"normal",fontSize:A?"10px":"14px",color:"#666"},className:"yt-volume-vertical-details-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null))),W(t.tier)?e.createElement(is,{style:{textAlign:"left",marginTop:"4px",display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center"},className:"yt-volume-vertical-details-price","data-tier":t.tier,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),"data-savings":o.toFixed(h?0:2)},(()=>{const r=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===r)return;let i="",l="";if("unit-price"===r){const e=n.discounted/t.minimumQuantity;i=(n.original/t.minimumQuantity).toFixed(h?0:2),l=e.toFixed(h?0:2)}else"tier-price"===r&&(i=n.original.toFixed(h?0:2),l=n.discounted.toFixed(h?0:2));return e.createElement(e.Fragment,null,e.createElement(as,{style:{marginLeft:"0",lineHeight:"normal",marginRight:"8px"},className:"yt-volume-vertical-details-price-discount"},kp(b.general.currencySymbol,a.storeCurrencyCode),Ep(l),"unit-price"===r?"/unit":""),o>0&&e.createElement(ls,{style:{lineHeight:"normal"},className:"yt-volume-vertical-details-price-original"},kp(b.general.currencySymbol,a.storeCurrencyCode),Ep(i),"unit-price"===r?"/unit":""))})()):e.createElement("div",{style:{textAlign:"center",color:"#999",fontSize:"14px",fontWeight:"500",padding:"4px 0",lineHeight:"normal"}},"Out of Stock")),r&&!t.imageUrl&&e.createElement("div",{style:{lineHeight:"normal",position:"absolute",right:"10px",bottom:"10px"},className:"yt-volume-vertical-tier-selected-check"},e.createElement("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",borderRadius:"50%",backgroundColor:ie,color:le,padding:"2px"}},e.createElement(Me,{style:{paddingBottom:"1px"},size:20,fontWeight:20})))))})):e.createElement(e.Fragment,null,E.map(t=>{const n=Z(t.tier),o=n.original-n.discounted,r=!W(t.tier);return e.createElement(e.Fragment,{key:t.tier},t.badgeTitle&&e.createElement(Zc,{primaryTextColorCta:le,primaryBackgroundColorCta:ie,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-badge","data-tier":t.tier,"data-badge-title":t.badgeTitle},t.badgeTitle),e.createElement(Kc,{cornerRadiusType:a?.cornerRadiusType??"",key:t.tier,primaryBackgroundColorCta:ie??"",isSelected:T===t.tier,onClick:()=>S(t.tier),style:{borderRadius:se,cursor:"pointer",backgroundColor:r?"#f5f5f5":"white",opacity:r?.6:1},className:"yt-volume-horizontal-tier-container "+(T===t.tier?"yt-volume-horizontal-tier-container-active":""),"data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType,"data-minimum-quantity":t.minimumQuantity,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2)},e.createElement(Jc,{cornerRadiusType:a?.cornerRadiusType??"",style:{borderRadius:se,borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},className:"yt-volume-horizontal-tier-header"},e.createElement(es,{className:"yt-volume-horizontal-tier-info"},e.createElement(us,{"data-active":T===t.tier,accentColor:ie,className:"yt-volume-horizontal-tier-radio-wrapper"},e.createElement(ms,{name:"tier",checked:T===t.tier,onChange:()=>!r&&S(t.tier),disabled:r,className:"yt-volume-horizontal-tier-radio-hidden"}),e.createElement(gs,{accentColor:ie,className:"yt-volume-horizontal-tier-radio-custom"})),e.createElement(ns,{className:"yt-volume-horizontal-tier-details"},e.createElement("div",{style:{display:"flex"},className:"yt-volume-horizontal-tier-title-container"},e.createElement(os,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-title"},t.title?t.title:e.createElement(e.Fragment,null,"Buy ",t.minimumQuantity,", Get"," ",t.discountValue,"% Off")),"Enabled"===b.volumeBundle?.discountBadgeVisibility&&(()=>{if(!((n?.diffAmountFromPrice>0||n?.diffAmountFromCompare>0)&&(n?.diffPercentFromPrice>0||n?.diffPercentFromCompare>0)))return null;const o=kp(b.general.currencySymbol,a.storeCurrencyCode);let r="";if(b?.volumeBundle?.discountBadgeDisplay&&b?.volumeBundle?.discountDisplayType){const{discountBadgeDisplay:e,discountDisplayType:t}=b.volumeBundle;"discount-on-compare"===e&&(r="percentage"===t?n.diffPercentFromCompare>0?`${Math.round(n.diffPercentFromCompare)}% Off`:"":n.diffAmountFromCompare>0?`Save ${o}${Ep(n.diffAmountFromCompare)}`:""),"discount-on-price"===e&&(r="percentage"===t?n.diffPercentFromPrice>0?`${Math.round(n.diffPercentFromPrice)}% Off`:"":n.diffAmountFromPrice>0?`Save ${o}${Ep(n.diffAmountFromPrice)}`:"")}else n?.discountValue>0&&(r="percentOff"===a?.discountType?`${n.discountValue}% Off`:`Save ${o}${Ep(n.discountValue)}`);return r?e.createElement(ts,{primaryBackgroundColorCta:ie,isSelected:T===t.tier,style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-save-badge","data-tier":t.tier,"data-discount-value":n.discountValue,"data-discount-type":a?.discountType},r):null})()),e.createElement(rs,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-subtitle"},t.subtitle?t.subtitle:e.createElement(e.Fragment,null)))),W(t.tier)?e.createElement(is,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-price","data-tier":t.tier,"data-original-price":n.original.toFixed(h?0:2),"data-discounted-price":n.discounted.toFixed(h?0:2),"data-savings":o.toFixed(0)},(()=>{const r=b?.volumeBundle?.tierPriceType||"tier-price";if("none"===r)return;let i="",l="";if("unit-price"===r){const e=n.discounted/t.minimumQuantity;i=(n.original/t.minimumQuantity).toFixed(h?0:2),l=e.toFixed(h?0:2)}else"tier-price"===r&&(i=n.original.toFixed(h?0:2),l=n.discounted.toFixed(h?0:2));return e.createElement(e.Fragment,null,o>0?e.createElement(ls,{style:{lineHeight:"normal"},className:"yt-volume-horizontal-tier-original-price"},kp(b.general.currencySymbol,a.storeCurrencyCode),Ep(i),"unit-price"===r?"/unit":""):"",e.createElement(as,{className:"yt-volume-horizontal-tier-discounted-price"},kp(b.general.currencySymbol,a.storeCurrencyCode),Ep(l),"unit-price"===r?"/unit":""))})()):e.createElement("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:"normal"}},e.createElement("span",{style:{color:"#999",fontSize:"14px",fontWeight:"500"}},"Out of Stock"))),T===t.tier&&e.createElement(cs,{className:"yt-volume-horizontal-tier-product-grid",style:{padding:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px 15px":"0",gap:p.productDetails.variants.edges.length>1||1===p.productDetails.variants.edges.length&&"Default Title"!==p.productDetails.variants.edges[0].node.title?"10px":"0"}},Array.from({length:t.minimumQuantity}).map((n,o)=>{const i=t.tier-1,l=(z[i]||[])[o]||p.productDetails.options?.map(e=>e.values[0])||[],c=p?.productDetails?.options.some(e=>e.values.length>1)||1===p?.productDetails?.variants?.edges?.length&&"Default Title"!==p?.productDetails?.variants?.edges[0]?.node?.title;return e.createElement("div",{key:o,style:{display:"flex",gap:"10px",alignItems:"center",position:"relative"},className:"yt-volume-horizontal-tier-product-item"},c&&e.createElement(xs,{src:Tp(K(p,$,o,t.tier)),alt:p?.productDetails?.title||"Product",style:{height:"64px",width:"auto"},className:"yt-volume-horizontal-tier-product-image"}),("auto"===b?.volumeBundle?.variantSelectorType||"dropdown"===b?.volumeBundle?.variantSelectorType)&&e.createElement("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap"}},p?.productDetails?.options?.map((n,c)=>{const s=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===s.length||1===s.length&&"Default Title"===s[0])return null;const d=R?.tier===t.tier&&R?.index===o&&R?.optionIndex===c,u=a?.variantOptions?.options?.find(e=>e.name===n.name);let m="";return"color"===u?.type&&(m=u?.values?.find(e=>e.name===l[c])?.value||""),e.createElement(hs,{key:c,ref:e=>{V.current[o]||(V.current[o]=[]),V.current[o][c]=e},style:{zIndex:d?1e3:"auto",display:"flex",flexDirection:"column",gap:"4px"},isActive:d},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement(vs,{onClick:e=>{e.stopPropagation(),O(d?null:{tier:t.tier,index:o,optionIndex:c})},isActive:d,disabled:r},"color"===u?.type&&m&&e.createElement("div",{className:"yt-fixedBundle-product-card_color-swatch",style:{display:"inline-block",width:20,height:20,borderRadius:"50%",backgroundColor:m||"transparent",border:"1px solid #ddd"}}),l[c],e.createElement(Ne,{style:{display:"block"}})),d&&e.createElement(ws,{style:{zIndex:1001}},s.map((n,a)=>{const s=[...l];s[c]=n;const d=!q(t.tier,o,l,c,n)||r;p.productDetails.variants.edges.find(({node:e})=>e.title===s.join(" / "));const m=e=>{if(e.preventDefault(),e.stopPropagation(),F(e=>{const t={...e},n=[...t[i]||[]];return n[o]=s,t[i]=n,t}),d){M({tier:T,index:o,optionIndex:c,value:n}),O(null);const e=s.join(" / "),r=p.productDetails.variants.edges.find(t=>t.node.title===e)?.node.id||$;return void U(t.tier,o,r)}const r=s.join(" / "),a=p.productDetails.variants.edges.find(e=>e.node.title===r)?.node.id||$;U(t.tier,o,a),O(null)},g=u?.values.find(e=>e.name===n);return"image"===u?.type&&g?.value?e.createElement(fs,{key:n,onClick:m,style:{cursor:"pointer"}},e.createElement(ys,{src:g.value,alt:n}),n):"color"===u?.type&&g?.value?e.createElement(fs,{key:n,onClick:m,style:{cursor:"pointer"}},e.createElement(bs,{style:{backgroundColor:g.value}}),n):e.createElement(fs,{key:n,onClick:m,style:{cursor:"pointer"}},n)})))})),"swatches"===b?.volumeBundle?.variantSelectorType&&e.createElement(ss,{style:{display:"flex",flexDirection:"column",gap:"5px"},className:"yt-volume-horizontal-tier-variant-selector"},p?.productDetails?.options.map((n,c)=>{const s=n.values.filter(e=>p.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[c]===e));if(0===s.length||1===s.length&&"Default Title"===s[0])return null;const d=a.variantOptions?.options?.find(e=>e.name===n.name)||null;return e.createElement("div",{key:n.name,style:{width:"100%",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"},className:"yt-volume-horizontal-tier-variant-option"},b?.volumeBundle?.showVariantOptionsLabel&&n?.name&&e.createElement("p",{style:{lineHeight:"normal",fontSize:"14px",margin:0}},n?.name),e.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"},className:"yt-volume-horizontal-tier-variant-values"},s.map(n=>{const a=l[c]===n,s=!q(t.tier,o,l,c,n)||r,u=d?.values.find(e=>e.name===n),m=e=>{if(e.preventDefault(),e.stopPropagation(),s)return;const r=[...l];r[c]=n,F(e=>{const t={...e},n=[...t[i]||[]];return n[o]=r,t[i]=n,t});const a=r.join(" / "),d=p.productDetails.variants.edges.find(e=>e.node.title===a)?.node.id||$;U(t.tier,o,d)},g={opacity:s?.5:1,cursor:s?"not-allowed":"pointer"};return"color"===d?.type&&u?.value?e.createElement("button",{key:n,onClick:m,style:{...g,borderRadius:"50%",padding:"1px",backgroundColor:"white",border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid transparent",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-color-button",disabled:s},e.createElement("div",{style:{width:a?"24px":"20px",height:a?"24px":"20px",borderRadius:"50%",backgroundColor:u.value,lineHeight:"normal",boxShadow:"rgba(9, 30, 66, 0.25) 0px 4px 8px -2px, rgba(9, 30, 66, 0.08) 0px 0px 0px 2px"}},e.createElement("span",null))):"image"===d?.type&&u?.value?e.createElement("button",{key:n,onClick:m,style:{...g,border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:a?"#F7F7F7":"transparent",padding:"0px",width:a?"20px":"18px",height:a?"20px":"18px",overflow:"hidden"},className:"yt-volume-horizontal-tier-variant-image-button",disabled:s},e.createElement("img",{src:u.value,alt:n,style:{width:a?"26px":"24px",height:a?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}})):e.createElement(ds,{key:n,isSelected:a,onClick:m,style:{...g,padding:"4px 8px",border:a?`1px solid ${b.general?.ctaBackgroundColor||"#121212"}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"600",lineHeight:"normal"},className:"yt-volume-horizontal-tier-variant-button-default",disabled:s},n)})))})))})),L&&L.tier===t.tier&&e.createElement("div",{style:{color:ie,textAlign:"center",fontSize:"14px",fontStyle:"normal",fontWeight:"500",lineHeight:"110%",background:`${ie}1A`,padding:"12px",borderBottomLeftRadius:se,borderBottomRightRadius:se}},"There aren’t enough items in our stock for select option, please select smaller bundle.")))})),a?.showCta&&"shopify_atc_button"!==b.volumeBundle?.addtoCartMethod&&e.createElement("div",{style:{position:"relative"}},e.createElement(ps,{bgColor:Q(T)?b.general?.ctaBackgroundColor:"#ccc",textColor:Q(T)?b.general?.ctaTextColor:"#666",border:`1px solid ${Q(T)?b.general?.ctaBorderColor||"#121212":"#999"}`,shadow:b.general.ctaShadowType,padding:b.general?.ctaPadding,width:b.general?.ctaWidth,hoverProperties:{customizeHoverState:!!Q(T)&&b.general?.customizeHoverState,backgroundColor:b.general?.ctaHoverBackgroundColor,textColor:b.general?.ctaHoverTextColor},onClick:async()=>{if(Q(T))try{P(!0);const e=E.find(e=>e.tier===T);if(!e)return;const t={},n=N[e.tier]||{};for(let o=0;o<e.minimumQuantity;o++){const e=n[o]||$;t[e]?t[e].quantity+=1:t[e]={quantity:1}}s?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"volume-bundle",selectedProducts:p?[{id:p?.productId,title:p?.productDetails?.title}]:[],selectedVariants:Object.values(n)}});const o=Z(e.tier),r=Array.from({length:e.minimumQuantity},(e,t)=>n[t]||$);l&&await l(o.original,r)}catch(e){console.error("VolumeBundle handleAddToCart error:",e)}finally{P(!1)}else console.error("Selected tier is out of stock")},borderRadius:b.general.ctaBorderRadius??"",disabled:D||!Q(T),className:"yt-volume-add-to-cart-button"},Q(T)?e.createElement(e.Fragment,null,D?e.createElement(ue,{color:"white",loading:D,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"8px",justifyContent:"center",alignItems:"center"}},e.createElement("span",null,b.volumeBundle?.ctaTitle??"Add Bundle to Cart")," ","•",e.createElement("div",{className:"yt-volume-add-to-cart-button-info"},(()=>{const t=Z(T);return e.createElement(e.Fragment,null,kp(b.general.currencySymbol,a.storeCurrencyCode),Ep(t.discounted.toFixed(h?0:2))," ",t?.original!==t.discounted&&t?.original>t.discounted&&e.createElement("span",{style:{lineHeight:"normal",textDecoration:"line-through",fontWeight:"550"}},kp(b.general.currencySymbol,a.storeCurrencyCode),Ep(t?.original.toFixed(h?0:2))," "))})()))):e.createElement(e.Fragment,null,"Out of Stock"))))}const ks=c.div`
3494
3485
  container-type: inline-size;
3495
3486
  border-radius: ${e=>e.borderRadius?e.borderRadius:"8px"};
3496
3487
  max-width: 800px;
3497
3488
 
3498
3489
  ${e=>e.verticalMargin&&`margin: ${e.verticalMargin} 0;`}
3499
- `,ks=c.div`
3500
- margin-bottom: 16px;
3501
3490
  `,Ts=c.div`
3491
+ margin-bottom: 16px;
3492
+ `,Ss=c.div`
3502
3493
  display: flex;
3503
3494
  align-items: center;
3504
3495
  gap: 8px;
3505
3496
  margin-bottom: 4px;
3506
3497
  justify-content: ${e=>"left"===e.infoAlignment?"flex-start":"right"===e.infoAlignment?"flex-end":"center"};
3507
3498
  flex-direction: row;
3508
- `,Ss=c.span`
3499
+ `,$s=c.span`
3509
3500
  font-size: 20px;
3510
3501
  font-weight: 700;
3511
3502
  color: #000;
@@ -3513,7 +3504,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3513
3504
  @media (max-width: 600px) {
3514
3505
  font-size: 18px;
3515
3506
  }
3516
- `,$s=c.span`
3507
+ `,Bs=c.span`
3517
3508
  font-size: 16px;
3518
3509
  color: #888;
3519
3510
  text-decoration: line-through;
@@ -3521,7 +3512,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3521
3512
  @media (max-width: 600px) {
3522
3513
  font-size: 14px;
3523
3514
  }
3524
- `,Bs=c.span`
3515
+ `,Ns=c.span`
3525
3516
  font-size: 12px;
3526
3517
  background-color: #f3f3f3;
3527
3518
  color: #666;
@@ -3533,7 +3524,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3533
3524
  font-size: 10px;
3534
3525
  padding: 2px 4px;
3535
3526
  }
3536
- `,Ns=c.p`
3527
+ `,Is=c.p`
3537
3528
  font-size: 12px;
3538
3529
  color: #666;
3539
3530
  margin: 0;
@@ -3541,7 +3532,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3541
3532
  @media (max-width: 600px) {
3542
3533
  font-size: 10px;
3543
3534
  }
3544
- `,Is=c.div`
3535
+ `,zs=c.div`
3545
3536
  display: grid;
3546
3537
  justify-content: center;
3547
3538
  gap: 12px;
@@ -3567,7 +3558,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3567
3558
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
3568
3559
  gap: 6px;
3569
3560
  }
3570
- `,zs=c.div`
3561
+ `,Fs=c.div`
3571
3562
  position: relative;
3572
3563
  border: 2px solid #e5e7eb;
3573
3564
  border-radius: 12px;
@@ -3589,7 +3580,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3589
3580
  border-radius: 10px;
3590
3581
  min-height: 170px;
3591
3582
  }
3592
- `,Fs=c.div`
3583
+ `,Ds=c.div`
3593
3584
  border: 2px dashed #d1d5db;
3594
3585
  border-radius: 14px;
3595
3586
  display: flex;
@@ -3612,7 +3603,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3612
3603
  border-radius: 12px;
3613
3604
  min-height: 170px;
3614
3605
  }
3615
- `,Ds=c.img`
3606
+ `,Ps=c.img`
3616
3607
  width: 100%;
3617
3608
  height: 80%;
3618
3609
  object-fit: cover;
@@ -3624,7 +3615,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3624
3615
  @media (max-width: 600px) {
3625
3616
  height: 80%;
3626
3617
  }
3627
- `,Ps=c.div`
3618
+ `,As=c.div`
3628
3619
  display: flex;
3629
3620
  flex-direction: column;
3630
3621
  gap: 2px;
@@ -3639,7 +3630,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3639
3630
  @media (max-width: 600px) {
3640
3631
  height: 4rem;
3641
3632
  }
3642
- `,As=c.div`
3633
+ `,_s=c.div`
3643
3634
  font-size: 11px;
3644
3635
  font-weight: 600;
3645
3636
  display: flex;
@@ -3683,7 +3674,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3683
3674
  @media (max-width: 600px) {
3684
3675
  font-size: 10px;
3685
3676
  }
3686
- `;const _s=c.p`
3677
+ `;const Rs=c.p`
3687
3678
  box-sizing: border-box;
3688
3679
  width: 100%;
3689
3680
  height: auto;
@@ -3746,7 +3737,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3746
3737
  animation-duration: var(--duration, 14s);
3747
3738
  }
3748
3739
  }
3749
- `,Rs=c.button`
3740
+ `,Os=c.button`
3750
3741
  position: absolute;
3751
3742
  top: -9px;
3752
3743
  right: -9px;
@@ -3780,7 +3771,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3780
3771
  top: -8px;
3781
3772
  right: -8px;
3782
3773
  }
3783
- `,Os=c.div`
3774
+ `,Ls=c.div`
3784
3775
  font-size: 42px;
3785
3776
  color: #94a3b8;
3786
3777
  font-weight: 300;
@@ -3791,7 +3782,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3791
3782
  width: 100%;
3792
3783
  transition: color 0.25s ease, transform 0.25s ease;
3793
3784
 
3794
- ${Fs}:hover & {
3785
+ ${Ds}:hover & {
3795
3786
  color: #64748b;
3796
3787
  transform: scale(1.08);
3797
3788
  }
@@ -3799,7 +3790,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3799
3790
  @media (max-width: 600px) {
3800
3791
  font-size: 36px;
3801
3792
  }
3802
- `,Ls=c.button`
3793
+ `,Ms=c.button`
3803
3794
  width: 100%;
3804
3795
  background-color: ${e=>e.primaryBgColor?e.primaryBgColor:"#e75a87"};
3805
3796
  color: ${e=>e.textColor?e.textColor:"white"};
@@ -3822,7 +3813,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3822
3813
  }
3823
3814
 
3824
3815
  ${e=>e.hoverProperties?.customizeHoverState&&`\n &:hover {\n background: ${e.hoverProperties.backgroundColor||"#dc2626"};\n color: ${e.hoverProperties.textColor||"white"};\n }\n `}
3825
- `,Ms=c.div`
3816
+ `,Vs=c.div`
3826
3817
  position: fixed;
3827
3818
  top: 0;
3828
3819
  left: 0;
@@ -3833,7 +3824,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3833
3824
  align-items: center;
3834
3825
  justify-content: center;
3835
3826
  z-index: 1000;
3836
- `,Vs=c.div`
3827
+ `,js=c.div`
3837
3828
  position: relative;
3838
3829
  width: 90%;
3839
3830
  max-height: 57vh;
@@ -3856,12 +3847,12 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3856
3847
  border-bottom-left-radius: 0;
3857
3848
  border-bottom-right-radius: 0;
3858
3849
  }
3859
- `,js=c.div`
3850
+ `,Ws=c.div`
3860
3851
  display: flex;
3861
3852
  flex-direction: column;
3862
3853
  align-items: center;
3863
3854
  padding: 10px 7px 0px 7px;
3864
- `,Ws=c.input`
3855
+ `,Hs=c.input`
3865
3856
  flex-grow: 1;
3866
3857
  padding: 8px 12px;
3867
3858
  border: 1px solid #ddd;
@@ -3876,7 +3867,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3876
3867
  font-size: 12px;
3877
3868
  padding: 6px 10px;
3878
3869
  }
3879
- `,Hs=c.button`
3870
+ `,qs=c.button`
3880
3871
  font-weight: 600;
3881
3872
  font-size: 12px;
3882
3873
  background: none;
@@ -3909,12 +3900,12 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3909
3900
  border-radius: 10px;
3910
3901
  margin-left: 4px;
3911
3902
  }
3912
- `;const qs=c.div`
3903
+ `;const Qs=c.div`
3913
3904
  display: flex;
3914
3905
  flex-direction: column;
3915
3906
  gap: 12px;
3916
3907
 
3917
- `,Qs=c.div`
3908
+ `,Us=c.div`
3918
3909
  display: flex;
3919
3910
  align-items: center;
3920
3911
  padding: 8px 4px;
@@ -3934,15 +3925,15 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3934
3925
  @media (max-width: 600px) {
3935
3926
  padding: 6px;
3936
3927
  }
3937
- `,Us=c.img`
3928
+ `,Ys=c.img`
3938
3929
  width: 50px;
3939
3930
  height: 50px;
3940
3931
  border-radius: 4px;
3941
3932
  object-fit: cover;
3942
3933
  margin-right: 12px;
3943
- `,Ys=c.div`
3934
+ `,Gs=c.div`
3944
3935
  flex-grow: 1;
3945
- `,Gs=c.h4`
3936
+ `,Xs=c.h4`
3946
3937
  font-size: 14px;
3947
3938
  font-weight: 500;
3948
3939
  margin: 0 0 4px 0;
@@ -3957,7 +3948,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3957
3948
  text-decoration: line-through;
3958
3949
  margin-left: 4px;
3959
3950
  }
3960
- `;const Xs=c.button`
3951
+ `;const Zs=c.button`
3961
3952
  background: ${e=>e.primaryBgColor?e.primaryBgColor+"20":"#e75a87"};
3962
3953
  color: ${e=>e.primaryBgColor?e.primaryBgColor:"#e75a87"};
3963
3954
  border: none;
@@ -3976,11 +3967,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3976
3967
  font-size: 11px;
3977
3968
  padding: 5px 10px;
3978
3969
  }
3979
- `,Zs=c.span`
3970
+ `,Ks=c.span`
3980
3971
  display: flex;
3981
3972
  align-items: center;
3982
3973
  gap: 4px;
3983
- `,Ks=c.div`
3974
+ `,Js=c.div`
3984
3975
  text-align: center;
3985
3976
  padding: 20px;
3986
3977
  color: #666;
@@ -3992,11 +3983,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3992
3983
  font-size: 12px;
3993
3984
  font-weight: 500;
3994
3985
  margin-bottom: 4px;
3995
- `;const Js=c.div`
3986
+ `;const ed=c.div`
3996
3987
  display: flex;
3997
3988
  gap: 4px;
3998
3989
  flex-wrap: wrap;
3999
- `,ed=c.button`
3990
+ `,td=c.button`
4000
3991
  padding: 6px 12px;
4001
3992
  border: 1px solid
4002
3993
  ${e=>e.isSelected?e.primaryBgColor+"50":"#e5e7eb"};
@@ -4014,10 +4005,10 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4014
4005
  font-size: 11px;
4015
4006
  padding: 4px 8px;
4016
4007
  }
4017
- `,td=({bundle:i,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,s]=t({}),[d,p]=t(!1),[u,m]=t(0),[g,x]=t(0),[f,y]=t(""),[b,h]=t([]),[v,w]=t({}),[C,E]=t(!1),[k,T]=t(window.innerWidth<450),S=i.builderTiers?.productTier||[],$=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},[]),{originalPrice:B,dealPrice:N,offerValue:I}=o(()=>{const e=[];let t=0;Object.values(c).forEach(n=>{n.productId&&n.variantId&&(e.push({productId:n.productId,variantId:n.variantId}),t++)});let n=0,o=0;for(const{productId:t,variantId:r}of e){const e=i.products.find(e=>e.productId===t);if(!e)continue;const a=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===r)?.node;if(!a)continue;const l=Number.parseFloat(a?.price||"0"),c=Number.parseFloat(a?.compareAtPrice||"0");n+=l,o+=c>0?c:l}let r=n;(t===S.length||i?.dealAmount)&&(i?.percentageOff?r=n*(1-i.percentageOff/100):i?.dealAmount?r=i.dealAmount:i?.amountOff&&i.amountOff<n&&(r=n-i.amountOff));const a=o||n,l=a-r;return{originalPrice:a.toFixed(2),dealPrice:r.toFixed(2),offerValue:l.toFixed(2)}},[i,c,S.length]);n(()=>{m(S.length-Object.keys(c).length)},[c]),n(()=>{const e={};let t=!1;S.forEach((n,o)=>{if(n.isFixed&&n.products&&n.products.length>0){const r=n.products[0];if(r&&r.productId){const n=r?.variantIds?.[0]||F(r?.productId);n&&(e[o]={productId:r.productId,variantId:n},t=!0)}}}),t&&s(t=>({...t,...e}))},[S]),n(()=>{if(null===g||0===S.length)return;const e=S[g].products.map(e=>e.productId),t=new Map;i.products.forEach(n=>{e.includes(n.productId)&&!t.has(n.productId)&&t.set(n.productId,n)});let n=Array.from(t.values());if(""!==f.trim()){const e=f.toLowerCase();n=n.filter(t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some(t=>t.node.title.toLowerCase().includes(e)))}h(n)},[f,i.products,g,S]);const z=e=>{const t=i.products.find(t=>t.productId===e);return t?.productDetails},F=e=>{const t=i.products.find(t=>t.productId===e);if(!t||!t.productDetails?.variants?.edges?.length)return"";const n=t.productDetails.variants.edges.find(e=>$(t.productDetails,e.node.id)>0)?.node;return n?n.id:t.productDetails.variants.edges[0].node.id},D=(e,t)=>{if(null==g)return;const n=t||F(e),o=i.products.find(t=>t.productId===e);if(o){if(0===$(o.productDetails,n))return void console.log("Cannot select out of stock variant")}s(t=>({...t,[g]:{productId:e,variantId:n}})),p(!1),y("")},P=e=>{s(t=>{const n={...t};return delete n[e],n}),w({})},_=e=>{const t=S[e];if(t.isFixed)return;x(e),p(!0),y("");const n=t.products.map(e=>e.productId),o=i.products.filter(e=>n.includes(e.productId)),r=new Map;o.forEach(e=>{r.has(e.productId)||r.set(e.productId,e)}),h(Array.from(r.values()))};n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:i._id,bundleType:"mixandmatch-bundle"}});const e=()=>{T(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const R=i.customizations,O=k,L="bundles"===i.appName?i.pageHeader?.title:i?.title,M="bundles"===i.appName?i.pageHeader?.description:i?.subtitle;return e.createElement(e.Fragment,null,e.createElement(Es,{verticalMargin:R.comboBundle.verticalMargin,borderRadius:"20px"},R.comboBundle.embedContentVisibility&&e.createElement(ks,null,R.comboBundle?.embedContentVisibility&&R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:R.comboBundle.infoAlignment||"left"}},e.createElement("h2",{style:{fontSize:"28px",color:R.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},L)),R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number(N)>1&&e.createElement(e.Fragment,null,e.createElement(Ts,{infoAlignment:R.comboBundle.infoAlignment},e.createElement(Ss,null,Ep(R.general.currencySymbol,i.storeCurrencyCode),Cp(N)),Number(N)<Number(B)&&e.createElement($s,{style:{minWidth:"fit-content"}},Ep(R.general.currencySymbol,i.storeCurrencyCode)," ",Cp(B)),e.createElement(Bs,{style:{minWidth:"fit-content"}},"In Stock")),e.createElement(Ns,{style:{textAlign:R.comboBundle.infoAlignment||"left",fontSize:R.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),e.createElement(Is,{gridSize:S.length,isHorizontal:O},S.map((t,o)=>{const i=(e=>!!c[e]&&!!c[e].productId)(o),{product:a,variantId:l}=(e=>{const t=c?.[e];return t?{product:z(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(o),s=a?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find(e=>e.node.id===t);return n?.node})(a,l):null,d=t.isFixed,p=r(null);return n(()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,o=t.scrollWidth;if(o<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const r=-(o-n);e.style.setProperty("--scroll-end",`${r}px`);const i=2*Math.max(1,Math.abs(r)/40)+3;e.style.setProperty("--duration",`${i}s`),e.setAttribute("data-overflow","true")},[s?.displayName,s?.title]),i&&a?e.createElement(zs,{key:`tier-${o}`,onClick:()=>!d&&_(o),style:{borderRadius:"20px",cursor:d?"default":"pointer"},isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment},!d&&e.createElement(Rs,{onClick:e=>{e.stopPropagation(),P(o)}},"×"),e.createElement(Ds,{src:a?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:a?.title,style:{aspectRatio:R?.general.imageAspectRatio||"1/1"},isHorizontal:O}),e.createElement(Ps,{style:{color:"#1e1e1e",textAlign:"center",...O&&"right"===R.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...O&&"left"===R.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!O&&"left"===R.comboBundle.infoAlignment&&{padding:"0 10px"},...O&&"center"===R.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:O},e.createElement(_s,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},e.createElement("span",null,a?.title," - ",s?.title)))):e.createElement(Fs,{key:`tier-${o}`,onClick:()=>!d&&_(o),isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment,style:{cursor:d?"default":"pointer"}},d?e.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},e.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),e.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},t.title||`Product ${o+1}`)):e.createElement(e.Fragment,null,e.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},e.createElement(Os,null,"+")),e.createElement(As,{style:{fontSize:"15px",fontWeight:"600",color:R.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment},e.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},t.title?`${t.title}`:`Select Product ${o+1}`))))})),e.createElement(Ls,{hoverProperties:{customizeHoverState:R.general.customizeHoverState,backgroundColor:R.general.ctaHoverBackgroundColor,textColor:R.general.ctaHoverTextColor},borderRadius:R.general.ctaBorderRadius,primaryBgColor:R.general.ctaBackgroundColor,onClick:async()=>{const e=Object.values(c).map(e=>{const t=i.products.find(t=>t.productId===e.productId);return{id:t?.productId,title:t?.productDetails?.title}});l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"mixandmatch-bundle",byobBundleType:i.builderTiers?.type??"builder",selectedProducts:e}}),E(!0);try{if(u>0)return console.log("Please select all products"),void E(!1);const e=Object.values(c).map(e=>e.variantId),t=Object.values(c).map(e=>{const t=i.products.find(t=>t.productId===e.productId);if(!t)return null;const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e.variantId)?.node;return n?{variantId:e.variantId,price:Number(n.price)}:null}).filter(Boolean);await a(e.length,e,Number(N),t)}catch(e){console.log("Add to cart error:",e)}finally{E(!1)}},textColor:R.general.ctaTextColor,borderColor:R.general.ctaBorderColor},0===u?C?e.createElement(rt,{color:"white",loading:C,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,R.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${u} more item(s)`),R.comboBundle?.embedContentVisibility&&R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{style:{margin:"20px 0px"}},e.createElement("h4",{style:{fontSize:"16px",color:R.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:R.general.primaryColor+"20",textAlign:R.comboBundle.infoAlignment||"left"}},"Description"),e.createElement("div",{style:{fontSize:R.comboBundle.productDescriptionFontSize||"16px",color:R.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:R.general.primaryColor+"08",textAlign:R.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:M}}))),d&&A(e.createElement(Ms,{onClick:()=>p(!1)},e.createElement(Vs,{onClick:e=>e.stopPropagation()},e.createElement(js,{style:{position:"sticky",top:0,background:"#fff",zIndex:10}},e.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},e.createElement(Ws,{placeholder:"Search",value:f,onChange:e=>{y(e.target.value)}}),e.createElement(Hs,{onClick:()=>p(!1)},"Cancel")),e.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),e.createElement("div",{style:{marginBottom:k?"20px":"5px",flex:1,minHeight:0,overflow:"scroll"}},e.createElement(qs,{style:{height:"auto",flex:"unset"}},b?.length>0?b?.map(t=>{const n=t?.productDetails;if(!n)return null;const o=(e=>{if(null==g)return!1;const t=c?.[g];return!!t&&t.productId===e})(t.productId),r=F(t.productId);let a=r||"";return a=o&&null!==g?c?.[g]?.variantId||a:v[t.productId]||r,e.createElement(Qs,{className:"mixAndMatch-product-item",primaryBgColor:R.general.primaryColor||"#1e1e1e",key:n.id,isSelected:o,onClick:()=>{D(t.productId,a)}},e.createElement(Us,{className:"mixAndMatch-vendor-image",src:n.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:n.title}),e.createElement(Ys,{className:"mixAndMatch-vendor-info"},e.createElement(Gs,{className:"mixAndMatch-vendor-name"},n.title),e.createElement(Js,{className:"mixAndMatch-variant-options"},n.variants?.edges?.filter(({node:e})=>"Default Title"!==e.title)?.map(({node:r})=>{const i=0===$(n,r.id);return e.createElement(ed,{className:"mixAndMatch-variant-button "+(a===r.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:R.general?.primaryColor,disabled:!!o||i,key:r.id,isSelected:a===r.id,tierHasProductId:!!o,onClick:e=>{var n,o;e.stopPropagation(),i||(n=t.productId,o=r.id,w(e=>({...e,[n]:o})))},style:{opacity:i?.5:1,cursor:i?"not-allowed":"pointer"}},r.title)}))),e.createElement(Xs,{cornerRadiusType:i?.cornerRadiusType??"",primaryBgColor:R.general?.primaryColor||"#1e1e1e",onClick:()=>o?P(g||0):D(t.productId,a)},o?e.createElement(Zs,null,"Added"):" + Add"))}):e.createElement(Ks,null,'No products found matching "',f,'"'))))),document.body))},nd=c.div`
4008
+ `,nd=({bundle:i,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,s]=t({}),[d,p]=t(!1),[u,m]=t(0),[g,x]=t(0),[f,y]=t(""),[b,h]=t([]),[v,w]=t({}),[C,E]=t(!1),[k,T]=t(window.innerWidth<450),S=i.builderTiers?.productTier||[],$=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},[]),{originalPrice:B,dealPrice:N,offerValue:I}=o(()=>{const e=[];let t=0;Object.values(c).forEach(n=>{n.productId&&n.variantId&&(e.push({productId:n.productId,variantId:n.variantId}),t++)});let n=0,o=0;for(const{productId:t,variantId:r}of e){const e=i.products.find(e=>e.productId===t);if(!e)continue;const a=e?.productDetails?.variants?.edges?.find(e=>e?.node?.id===r)?.node;if(!a)continue;const l=Number.parseFloat(a?.price||"0"),c=Number.parseFloat(a?.compareAtPrice||"0");n+=l,o+=c>0?c:l}let r=n;(t===S.length||i?.dealAmount)&&(i?.percentageOff?r=n*(1-i.percentageOff/100):i?.dealAmount?r=i.dealAmount:i?.amountOff&&i.amountOff<n&&(r=n-i.amountOff));const a=o||n,l=a-r;return{originalPrice:a.toFixed(2),dealPrice:r.toFixed(2),offerValue:l.toFixed(2)}},[i,c,S.length]);n(()=>{m(S.length-Object.keys(c).length)},[c]),n(()=>{const e={};let t=!1;S.forEach((n,o)=>{if(n.isFixed&&n.products&&n.products.length>0){const r=n.products[0];if(r&&r.productId){const n=r?.variantIds?.[0]||F(r?.productId);n&&(e[o]={productId:r.productId,variantId:n},t=!0)}}}),t&&s(t=>({...t,...e}))},[S]),n(()=>{if(null===g||0===S.length)return;const e=S[g].products.map(e=>e.productId),t=new Map;i.products.forEach(n=>{e.includes(n.productId)&&!t.has(n.productId)&&t.set(n.productId,n)});let n=Array.from(t.values());if(""!==f.trim()){const e=f.toLowerCase();n=n.filter(t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some(t=>t.node.title.toLowerCase().includes(e)))}h(n)},[f,i.products,g,S]);const z=e=>{const t=i.products.find(t=>t.productId===e);return t?.productDetails},F=e=>{const t=i.products.find(t=>t.productId===e);if(!t||!t.productDetails?.variants?.edges?.length)return"";const n=t.productDetails.variants.edges.find(e=>$(t.productDetails,e.node.id)>0)?.node;return n?n.id:t.productDetails.variants.edges[0].node.id},D=(e,t)=>{if(null==g)return;const n=t||F(e),o=i.products.find(t=>t.productId===e);if(o){if(0===$(o.productDetails,n))return void console.log("Cannot select out of stock variant")}s(t=>({...t,[g]:{productId:e,variantId:n}})),p(!1),y("")},P=e=>{s(t=>{const n={...t};return delete n[e],n}),w({})},_=e=>{const t=S[e];if(t.isFixed)return;x(e),p(!0),y("");const n=t.products.map(e=>e.productId),o=i.products.filter(e=>n.includes(e.productId)),r=new Map;o.forEach(e=>{r.has(e.productId)||r.set(e.productId,e)}),h(Array.from(r.values()))};n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:i._id,bundleType:"mixandmatch-bundle"}});const e=()=>{T(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const R=i.customizations,O=k,L="bundles"===i.appName?i.pageHeader?.title:i?.title,M="bundles"===i.appName?i.pageHeader?.description:i?.subtitle;return e.createElement(e.Fragment,null,e.createElement(ks,{verticalMargin:R.comboBundle.verticalMargin,borderRadius:"20px"},R.comboBundle.embedContentVisibility&&e.createElement(Ts,null,R.comboBundle?.embedContentVisibility&&R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:R.comboBundle.infoAlignment||"left"}},e.createElement("h2",{style:{fontSize:"28px",color:R.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},L)),R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number(N)>1&&e.createElement(e.Fragment,null,e.createElement(Ss,{infoAlignment:R.comboBundle.infoAlignment},e.createElement($s,null,kp(R.general.currencySymbol,i.storeCurrencyCode),Ep(N)),Number(N)<Number(B)&&e.createElement(Bs,{style:{minWidth:"fit-content"}},kp(R.general.currencySymbol,i.storeCurrencyCode)," ",Ep(B)),e.createElement(Ns,{style:{minWidth:"fit-content"}},"In Stock")),e.createElement(Is,{style:{textAlign:R.comboBundle.infoAlignment||"left",fontSize:R.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),e.createElement(zs,{gridSize:S.length,isHorizontal:O},S.map((t,o)=>{const i=(e=>!!c[e]&&!!c[e].productId)(o),{product:a,variantId:l}=(e=>{const t=c?.[e];return t?{product:z(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(o),s=a?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find(e=>e.node.id===t);return n?.node})(a,l):null,d=t.isFixed,p=r(null);return n(()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,o=t.scrollWidth;if(o<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const r=-(o-n);e.style.setProperty("--scroll-end",`${r}px`);const i=2*Math.max(1,Math.abs(r)/40)+3;e.style.setProperty("--duration",`${i}s`),e.setAttribute("data-overflow","true")},[s?.displayName,s?.title]),i&&a?e.createElement(Fs,{key:`tier-${o}`,onClick:()=>!d&&_(o),style:{borderRadius:"20px",cursor:d?"default":"pointer"},isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment},!d&&e.createElement(Os,{onClick:e=>{e.stopPropagation(),P(o)}},"×"),e.createElement(Ps,{src:a?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:a?.title,style:{aspectRatio:R?.general.imageAspectRatio||"1/1"},isHorizontal:O}),e.createElement(As,{style:{color:"#1e1e1e",textAlign:"center",...O&&"right"===R.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...O&&"left"===R.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!O&&"left"===R.comboBundle.infoAlignment&&{padding:"0 10px"},...O&&"center"===R.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:O},e.createElement(Rs,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},e.createElement("span",null,a?.title," - ",s?.title)))):e.createElement(Ds,{key:`tier-${o}`,onClick:()=>!d&&_(o),isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment,style:{cursor:d?"default":"pointer"}},d?e.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},e.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),e.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},t.title||`Product ${o+1}`)):e.createElement(e.Fragment,null,e.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},e.createElement(Ls,null,"+")),e.createElement(_s,{style:{fontSize:"15px",fontWeight:"600",color:R.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:O,infoAlignment:R.comboBundle.infoAlignment},e.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},t.title?`${t.title}`:`Select Product ${o+1}`))))})),e.createElement(Ms,{hoverProperties:{customizeHoverState:R.general.customizeHoverState,backgroundColor:R.general.ctaHoverBackgroundColor,textColor:R.general.ctaHoverTextColor},borderRadius:R.general.ctaBorderRadius,primaryBgColor:R.general.ctaBackgroundColor,onClick:async()=>{const e=Object.values(c).map(e=>{const t=i.products.find(t=>t.productId===e.productId);return{id:t?.productId,title:t?.productDetails?.title}});l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:i._id,bundleType:"mixandmatch-bundle",byobBundleType:i.builderTiers?.type??"builder",selectedProducts:e}}),E(!0);try{if(u>0)return console.log("Please select all products"),void E(!1);const e=Object.values(c).map(e=>e.variantId),t=Object.values(c).map(e=>{const t=i.products.find(t=>t.productId===e.productId);if(!t)return null;const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e.variantId)?.node;return n?{variantId:e.variantId,price:Number(n.price)}:null}).filter(Boolean);await a(e.length,e,Number(N),t)}catch(e){console.log("Add to cart error:",e)}finally{E(!1)}},textColor:R.general.ctaTextColor,borderColor:R.general.ctaBorderColor},0===u?C?e.createElement(ue,{color:"white",loading:C,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,R.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${u} more item(s)`),R.comboBundle?.embedContentVisibility&&R.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{style:{margin:"20px 0px"}},e.createElement("h4",{style:{fontSize:"16px",color:R.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:R.general.primaryColor+"20",textAlign:R.comboBundle.infoAlignment||"left"}},"Description"),e.createElement("div",{style:{fontSize:R.comboBundle.productDescriptionFontSize||"16px",color:R.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:R.general.primaryColor+"08",textAlign:R.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:M}}))),d&&A(e.createElement(Vs,{onClick:()=>p(!1)},e.createElement(js,{onClick:e=>e.stopPropagation()},e.createElement(Ws,{style:{position:"sticky",top:0,background:"#fff",zIndex:10}},e.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},e.createElement(Hs,{placeholder:"Search",value:f,onChange:e=>{y(e.target.value)}}),e.createElement(qs,{onClick:()=>p(!1)},"Cancel")),e.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),e.createElement("div",{style:{marginBottom:k?"20px":"5px",flex:1,minHeight:0,overflow:"scroll"}},e.createElement(Qs,{style:{height:"auto",flex:"unset"}},b?.length>0?b?.map(t=>{const n=t?.productDetails;if(!n)return null;const o=(e=>{if(null==g)return!1;const t=c?.[g];return!!t&&t.productId===e})(t.productId),r=F(t.productId);let a=r||"";return a=o&&null!==g?c?.[g]?.variantId||a:v[t.productId]||r,e.createElement(Us,{className:"mixAndMatch-product-item",primaryBgColor:R.general.primaryColor||"#1e1e1e",key:n.id,isSelected:o,onClick:()=>{D(t.productId,a)}},e.createElement(Ys,{className:"mixAndMatch-vendor-image",src:n.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:n.title}),e.createElement(Gs,{className:"mixAndMatch-vendor-info"},e.createElement(Xs,{className:"mixAndMatch-vendor-name"},n.title),e.createElement(ed,{className:"mixAndMatch-variant-options"},n.variants?.edges?.filter(({node:e})=>"Default Title"!==e.title)?.map(({node:r})=>{const i=0===$(n,r.id);return e.createElement(td,{className:"mixAndMatch-variant-button "+(a===r.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:R.general?.primaryColor,disabled:!!o||i,key:r.id,isSelected:a===r.id,tierHasProductId:!!o,onClick:e=>{var n,o;e.stopPropagation(),i||(n=t.productId,o=r.id,w(e=>({...e,[n]:o})))},style:{opacity:i?.5:1,cursor:i?"not-allowed":"pointer"}},r.title)}))),e.createElement(Zs,{cornerRadiusType:i?.cornerRadiusType??"",primaryBgColor:R.general?.primaryColor||"#1e1e1e",onClick:()=>o?P(g||0):D(t.productId,a)},o?e.createElement(Ks,null,"Added"):" + Add"))}):e.createElement(Js,null,'No products found matching "',f,'"'))))),document.body))},od=c.div`
4018
4009
  border-radius: 8px;
4019
4010
  container-type: inline-size;
4020
- `,od=c.div`
4011
+ `,rd=c.div`
4021
4012
  background-color: #ff4da6;
4022
4013
  color: white;
4023
4014
  padding: 10px;
@@ -4026,19 +4017,19 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4026
4017
  border-radius: 4px;
4027
4018
  font-size: 14px;
4028
4019
  line-height: normal;
4029
- `,rd=c.div`
4020
+ `,id=c.div`
4030
4021
  text-align: center;
4031
4022
  color: #777;
4032
4023
  font-size: 16px;
4033
4024
  margin: 8px 0;
4034
4025
  line-height: normal;
4035
- `,id=c.div`
4026
+ `,ad=c.div`
4036
4027
  display: flex;
4037
4028
  flex-direction: column;
4038
4029
  gap: 5px;
4039
4030
  margin: 10px 0px;
4040
4031
  padding: 5px;
4041
- `,ad=c.div`
4032
+ `,ld=c.div`
4042
4033
  display: flex;
4043
4034
  border: 1px solid #eee;
4044
4035
  border-radius: 8px;
@@ -4046,27 +4037,27 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4046
4037
  align-items: center;
4047
4038
  background-color: white;
4048
4039
  width: 100%;
4049
- `,ld=c.img`
4040
+ `,cd=c.img`
4050
4041
  width: 100px;
4051
4042
  object-fit: cover;
4052
4043
  border-radius: 4px;
4053
4044
  margin-right: 12px;
4054
4045
  aspect-ratio: 1/1;
4055
- `,cd=c.div`
4056
- flex: 1;
4057
4046
  `,sd=c.div`
4047
+ flex: 1;
4048
+ `,dd=c.div`
4058
4049
  font-weight: 500;
4059
4050
  font-size: 16px;
4060
4051
  margin-bottom: 4px;
4061
4052
  line-height: normal;
4062
- `,dd=c.div`
4053
+ `,pd=c.div`
4063
4054
  font-size: 14px;
4064
4055
  margin-bottom: 6px;
4065
4056
  font-weight: bold;
4066
4057
  line-height: normal;
4067
- `,pd=c.span`
4068
- color: #000;
4069
4058
  `,ud=c.span`
4059
+ color: #000;
4060
+ `,md=c.span`
4070
4061
  text-decoration: line-through;
4071
4062
  color: #999;
4072
4063
  margin-left: 6px;
@@ -4076,7 +4067,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4076
4067
  font-size: 10px;
4077
4068
  margin-left: 2px;
4078
4069
  }
4079
- `,md=c.div`
4070
+ `,gd=c.div`
4080
4071
  font-size: 14px;
4081
4072
  width: 100%;
4082
4073
  display: flex;
@@ -4086,11 +4077,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4086
4077
  gap: 10px;
4087
4078
  color: #2e2e2e;
4088
4079
  line-height: normal;
4089
- `,gd=c.div`
4080
+ `,xd=c.div`
4090
4081
  margin-top: 10px;
4091
4082
  font-size: 14px;
4092
4083
  line-height: normal;
4093
- `,xd=c.div`
4084
+ `,fd=c.div`
4094
4085
  font-size: 20px;
4095
4086
  display: flex;
4096
4087
  flex-direction: row;
@@ -4101,15 +4092,15 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4101
4092
  @media (max-width: 480px) {
4102
4093
  font-size: 18px;
4103
4094
  }
4104
- `,fd=c.span`
4105
- font-weight: 600;
4106
4095
  `,yd=c.span`
4096
+ font-weight: 600;
4097
+ `,bd=c.span`
4107
4098
  background-color: red;
4108
4099
  color: white;
4109
4100
  font-weight: bold;
4110
4101
  font-size: 13px;
4111
4102
  padding: 3px 6px;
4112
- `,bd=c.button`
4103
+ `,hd=c.button`
4113
4104
  width: 100%;
4114
4105
  margin-top: 12px;
4115
4106
  padding: 12px;
@@ -4143,7 +4134,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4143
4134
  `,c.span`
4144
4135
  font-size: 14px;
4145
4136
  margin-left: 6px;
4146
- `;const hd=c.div`
4137
+ `;const vd=c.div`
4147
4138
  border-radius: 8px;
4148
4139
  container-type: inline-size;
4149
4140
  margin-top: 10px;
@@ -4162,7 +4153,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4162
4153
  font-size: 14px;
4163
4154
  margin: 6px 0 16px;
4164
4155
  line-height: normal;
4165
- `;const vd=c.div`
4156
+ `;const wd=c.div`
4166
4157
  display: flex;
4167
4158
  flex-direction: row;
4168
4159
  align-items: stretch;
@@ -4171,7 +4162,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4171
4162
  padding: 0;
4172
4163
  flex-wrap: wrap;
4173
4164
  overflow: hidden;
4174
- `,wd=c.div`
4165
+ `,Cd=c.div`
4175
4166
  flex: 0 0 auto;
4176
4167
  width: ${({productsLength:e})=>`calc((100% - ${e-1} * 37px - 8px) / ${e})`};
4177
4168
  border: 1px solid #ccc;
@@ -4191,9 +4182,9 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4191
4182
  @container (max-width: 480px) {
4192
4183
  width: ${({productsLength:e})=>`calc((100% - ${e-1} * 20px - 8px) / ${e})`};
4193
4184
  }
4194
- `,Cd=c.div`
4185
+ `,Ed=c.div`
4195
4186
  position: relative;
4196
- `,Ed=c.img`
4187
+ `,kd=c.img`
4197
4188
  width: 100%;
4198
4189
  aspect-ratio: 1/1;
4199
4190
  object-fit: cover;
@@ -4220,7 +4211,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4220
4211
  cursor: pointer;
4221
4212
  background-color: #ffffff60;
4222
4213
  }
4223
- `,c(Le)`
4214
+ `,c(Ve)`
4224
4215
  cursor: pointer;
4225
4216
  transition:
4226
4217
  color 0.2s ease,
@@ -4229,7 +4220,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4229
4220
  &:hover {
4230
4221
  transform: scale(1.1);
4231
4222
  }
4232
- `;const kd=c.div`
4223
+ `;const Td=c.div`
4233
4224
  position: absolute;
4234
4225
  bottom: 10px;
4235
4226
  left: 6px;
@@ -4256,7 +4247,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4256
4247
  cursor: pointer;
4257
4248
  background-color: #ffffff60;
4258
4249
  }
4259
- `,Td=c.div`
4250
+ `,Sd=c.div`
4260
4251
  width: 14px;
4261
4252
  height: 14px;
4262
4253
  border-radius: 50%;
@@ -4270,7 +4261,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4270
4261
  width: 12px;
4271
4262
  height: 12px;
4272
4263
  }
4273
- `,Sd=c.div`
4264
+ `,$d=c.div`
4274
4265
  width: 14px;
4275
4266
  height: 14px;
4276
4267
  border-radius: 50%;
@@ -4285,7 +4276,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4285
4276
  width: 12px;
4286
4277
  height: 12px;
4287
4278
  }
4288
- `,$d=c.div`
4279
+ `,Bd=c.div`
4289
4280
  border-radius: 20px;
4290
4281
  font-size: 10px;
4291
4282
  font-weight: 600;
@@ -4295,7 +4286,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4295
4286
  color: #333;
4296
4287
 
4297
4288
  line-height: normal;
4298
- `,Bd=c.div`
4289
+ `,Nd=c.div`
4299
4290
  padding: 6px;
4300
4291
  text-align: left;
4301
4292
  min-height: 40px;
@@ -4311,7 +4302,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4311
4302
  @container (max-width: 480px) {
4312
4303
  padding: 4px;
4313
4304
  }
4314
- `,Nd=c.div`
4305
+ `,Id=c.div`
4315
4306
  font-size: 14px;
4316
4307
  font-weight: 500;
4317
4308
  margin: 4px 0;
@@ -4325,7 +4316,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4325
4316
  font-size: 12px;
4326
4317
  margin: 2px 0;
4327
4318
  }
4328
- `,Id=c.div`
4319
+ `,zd=c.div`
4329
4320
  font-weight: bold;
4330
4321
  line-height: normal;
4331
4322
 
@@ -4334,7 +4325,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4334
4325
  @container (max-width: 480px) {
4335
4326
  font-size: 12px;
4336
4327
  }
4337
- `,zd=c.div`
4328
+ `,Fd=c.div`
4338
4329
  display: flex;
4339
4330
  align-items: center;
4340
4331
  font-size: 14px;
@@ -4362,9 +4353,9 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4362
4353
  font-size: 16px;
4363
4354
  font-weight: bold;
4364
4355
  cursor: pointer;
4365
- `;const Fd=c.div`
4356
+ `;const Dd=c.div`
4366
4357
  position: relative;
4367
- `;c(Fd)`
4358
+ `;c(Dd)`
4368
4359
  &:nth-child(2n) {
4369
4360
  @media (max-width: 768px) {
4370
4361
  display: none;
@@ -4382,7 +4373,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4382
4373
  display: none;
4383
4374
  }
4384
4375
  }
4385
- `;const Dd=c.div`
4376
+ `;const Pd=c.div`
4386
4377
  flex: 0 0 auto;
4387
4378
  max-width: 20px;
4388
4379
  font-size: 32px;
@@ -4407,11 +4398,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4407
4398
  color: #717171;
4408
4399
  z-index: 2;
4409
4400
  }
4410
- `,Pd=c.div`
4401
+ `,Ad=c.div`
4411
4402
  position: relative;
4412
4403
  display: inline-block;
4413
4404
  min-width: 100px;
4414
- `,Ad=c.div`
4405
+ `,_d=c.div`
4415
4406
  display: flex;
4416
4407
  align-items: center;
4417
4408
  justify-content: space-between;
@@ -4429,7 +4420,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4429
4420
  @container (max-width: 480px) {
4430
4421
  padding: 4px 6px;
4431
4422
  }
4432
- `,_d=c.div`
4423
+ `,Rd=c.div`
4433
4424
  display: flex;
4434
4425
  align-items: center;
4435
4426
  gap: 6px;
@@ -4439,11 +4430,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4439
4430
  &:hover {
4440
4431
  cursor: pointer;
4441
4432
  }
4442
- `,Rd=c(Me)`
4433
+ `,Od=c(je)`
4443
4434
  font-size: 14px;
4444
4435
  transition: transform 0.2s ease;
4445
4436
  transform: ${({$isOpen:e})=>e?"rotate(180deg)":"rotate(0deg)"};
4446
- `,Od=c.div`
4437
+ `,Ld=c.div`
4447
4438
  position: absolute;
4448
4439
  top: 100%;
4449
4440
  left: 0;
@@ -4455,7 +4446,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4455
4446
  z-index: 1000;
4456
4447
  max-height: 200px;
4457
4448
  overflow-y: auto;
4458
- `,Ld=c.div`
4449
+ `,Md=c.div`
4459
4450
  display: flex;
4460
4451
  align-items: center;
4461
4452
  padding: 8px;
@@ -4468,9 +4459,9 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4468
4459
  &:hover {
4469
4460
  background-color: ${({$isSelected:e})=>e?"#F7F7F7":"#F9F9F9"};
4470
4461
  }
4471
- `,Md=c.span`
4462
+ `,Vd=c.span`
4472
4463
  font-weight: 500;
4473
- `,Vd=c.div`
4464
+ `,jd=c.div`
4474
4465
  width: 14px;
4475
4466
  height: 14px;
4476
4467
  border-radius: 50%;
@@ -4478,7 +4469,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4478
4469
  border: 1px solid #e4e4e4;
4479
4470
  flex-shrink: 0;
4480
4471
  line-height: normal;
4481
- `,jd=c.img`
4472
+ `,Wd=c.img`
4482
4473
  width: 16px;
4483
4474
  height: 16px;
4484
4475
  border-radius: 50%;
@@ -4486,14 +4477,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4486
4477
  border: 1px solid #e4e4e4;
4487
4478
  flex-shrink: 0;
4488
4479
  line-height: normal;
4489
- `,Wd=c.div`
4480
+ `,Hd=c.div`
4490
4481
  display: flex;
4491
4482
  flex-direction: row;
4492
4483
  gap: 5px;
4493
4484
  align-items: center;
4494
4485
 
4495
4486
  flex-wrap: wrap;
4496
- `,Hd=c.div`
4487
+ `,qd=c.div`
4497
4488
  display: flex;
4498
4489
  flex-direction: row;
4499
4490
  gap: 8px;
@@ -4509,7 +4500,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4509
4500
  @media (max-width: 600px) {
4510
4501
  display: none;
4511
4502
  }
4512
- `;const qd=c(c.div`
4503
+ `;const Qd=c(c.div`
4513
4504
  position: absolute;
4514
4505
  z-index: 2;
4515
4506
  display: flex;
@@ -4519,7 +4510,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4519
4510
  top: ${({isImage:e})=>e?"0px":"10px"} !important;
4520
4511
  left: ${({isImage:e})=>e?"0px":"10px"} !important;
4521
4512
  position: ${({isImage:e})=>e?"relative":"absolute"} !important;
4522
- `,Qd=c.div`
4513
+ `,Ud=c.div`
4523
4514
  position: fixed;
4524
4515
  top: 0;
4525
4516
  left: 0;
@@ -4532,7 +4523,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4532
4523
  display: flex;
4533
4524
  align-items: center;
4534
4525
  justify-content: center;
4535
- `,Ud=c.div`
4526
+ `,Yd=c.div`
4536
4527
  background: white;
4537
4528
  border-radius: 20px;
4538
4529
  width: fit-content;
@@ -4548,7 +4539,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4548
4539
  max-width: 80vw;
4549
4540
  min-width: 80vw;
4550
4541
  }
4551
- `,Yd=c.div`
4542
+ `,Gd=c.div`
4552
4543
  width: 100%;
4553
4544
  padding: 8px;
4554
4545
  font-weight: 600;
@@ -4558,7 +4549,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4558
4549
 
4559
4550
  text-align: center;
4560
4551
  padding: 10px 0;
4561
- `,Gd=c.button`
4552
+ `,Xd=c.button`
4562
4553
  width: 100%;
4563
4554
  font-size: 14px;
4564
4555
  font-weight: 600;
@@ -4571,13 +4562,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4571
4562
  border: none;
4572
4563
 
4573
4564
  cursor: pointer;
4574
- `,Xd=c.div`
4565
+ `,Zd=c.div`
4575
4566
  display: flex;
4576
4567
  align-items: center;
4577
4568
  gap: 12px;
4578
4569
 
4579
4570
  padding: 10px;
4580
- `,Zd=c.img`
4571
+ `,Kd=c.img`
4581
4572
  width: 70px;
4582
4573
  min-width: 70px;
4583
4574
  height: 70px;
@@ -4585,14 +4576,14 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4585
4576
  border-radius: 8px;
4586
4577
  object-fit: cover;
4587
4578
  object-position: top;
4588
- `,Kd=c.div`
4579
+ `,Jd=c.div`
4589
4580
  display: flex;
4590
4581
  flex-direction: column;
4591
4582
  height: 100%;
4592
4583
  justify-content: center;
4593
4584
 
4594
4585
  gap: 4px;
4595
- `,Jd=c.div`
4586
+ `,ep=c.div`
4596
4587
  font-size: 14px;
4597
4588
  font-weight: 600;
4598
4589
  margin-bottom: 4px;
@@ -4603,11 +4594,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4603
4594
  align-items: center;
4604
4595
  flex-wrap: wrap;
4605
4596
  gap: 4px;
4606
- `,ep=c.hr`
4597
+ `,tp=c.hr`
4607
4598
  margin: 0;
4608
4599
  border: none;
4609
4600
  border-top: 1px solid #d3d3d3;
4610
- `,tp=c.span`
4601
+ `,np=c.span`
4611
4602
  font-size: 10px;
4612
4603
  color: #777;
4613
4604
  margin-left: 4px;
@@ -4617,13 +4608,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4617
4608
  font-weight: 600;
4618
4609
  border: 1px solid lightgray;
4619
4610
  border-radius: 10px;
4620
- `,np=c.div`
4611
+ `,op=c.div`
4621
4612
  display: flex;
4622
4613
  flex-wrap: wrap;
4623
4614
  gap: 6px;
4624
4615
 
4625
4616
  align-items: center;
4626
- `,op=c.div`
4617
+ `,rp=c.div`
4627
4618
  width: 18px;
4628
4619
  height: 18px;
4629
4620
  border-radius: 50%;
@@ -4640,7 +4631,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4640
4631
  &:hover {
4641
4632
  cursor: ${e=>e.disabled?"not-allowed":"pointer"};
4642
4633
  }
4643
- `,rp=c.span`
4634
+ `,ip=c.span`
4644
4635
  font-size: 10px;
4645
4636
  color: ${e=>e.disabled?"#999":"#777"};
4646
4637
  padding: 2px 4px;
@@ -4654,7 +4645,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4654
4645
  cursor: ${e=>e.disabled?"not-allowed":"pointer"};
4655
4646
  background-color: ${e=>e.disabled?"#f3f3f3bd":"#f3f3f35f"};
4656
4647
  }
4657
- `,ip=c.img`
4648
+ `,ap=c.img`
4658
4649
  width: 16px;
4659
4650
  height: 16px;
4660
4651
  border-radius: 50%;
@@ -4666,11 +4657,11 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4666
4657
  &:hover {
4667
4658
  cursor: ${e=>e.disabled?"not-allowed":"pointer"};
4668
4659
  }
4669
- `,ap=c.span`
4660
+ `,lp=c.span`
4670
4661
  font-size: 12px;
4671
- `,lp=({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(Qd,{className:"yt-fixedBundle-variant-modal_overlay",onClick:a},e.createElement(Ud,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Yd,{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(Xd,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(Zd,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(Kd,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(Jd,{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(tp,{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(np,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(ap,{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(op,{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(rp,{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(np,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(ap,{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(ip,{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(rp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):e.createElement(np,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(ap,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,i)=>{const a=!b(n,r,o,t);return e.createElement(rp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:g[n]?.[r]==o,disabled:a,onClick:()=>{h(n,o,r)}},o)}))}))),o<r.length-1&&e.createElement(ep,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(Gd,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:l.backgroundColor,color:l.textColor},onClick:d},"Add bundle to cart")));return P.createPortal(v,document.body)},cp=({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(Vd,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(jd,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name},e.createElement("span",null)):null;return e.createElement(Pd,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},e.createElement(Ad,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!c)},e.createElement(_d,{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(Rd,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(Od,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},o?.map(t=>e.createElement(Ld,{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(Md,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},sp=({product:o,variantOptions:r,selectedVariants:i,onVariantChange:a,variantId:l,primaryProductId:c,variantType:s="dropdown"})=>{const[d,p]=t(i||[]);n(()=>{i&&i.length>0&&p(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(" / ");p(t)}}},[l,o]);const u=e=>{if(!r?.options)return"text";const t=r.options.find(t=>t.name===e);return t?.type||"text"},m=(e,t)=>{const n=d[t];if(!n)return null;return g(e,t).find(e=>e.name===n)||null},g=(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=[...d||[]];o[e]=t;const r=o.join(" / "),i=n.variants.edges.find(e=>e.node.title===r)?.node;return!!i&&((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})(n,i.id)>0})(t,e,o);return{name:e,value:r?.value||e,disabled:i}})};return e.createElement(Wd,{className:"yt-fixedBundle-variant-selector-horizontal_container"},o.options.map((t,n)=>{const r=g(t,n);return 0===r.length||1===r.length&&"Default Title"===r[0].name?null:e.createElement(Hd,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(cp,{options:r,selectedValue:m(t,n),onChange:e=>{((e,t)=>{const n=[...d];n[e]=t.name,p(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:u(t.name)}))}))},dp=({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]),[$,B]=t(r?.variants?.edges.find(e=>S(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node),N=o(()=>$?.title?.split(" / ")||[],[$]),I=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&&(B(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;B(e)}},[r,h,a,v,d,S]);const z=i(e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&d(e)},[r,d]),F=s?.fixedBundle?.discountBadgeDisplay,D=parseFloat($?.price??"0"),P=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}})(D,E,C??0,w?.size,k,T),_=P?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: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(ad,{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(ld,{className:"yt-fixedBundle-product-card-horizontal_image",src:kp(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(cd,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(sd,{className:"yt-fixedBundle-product-card-horizontal_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(dd,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(pd,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Ep(s.general.currencySymbol,b)," ",Cp(L)),O&&R>_&&e.createElement(ud,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Ep(s.general.currencySymbol,b),Cp(R))),e.createElement(sp,{product:r,variantOptions:x,selectedVariants:N,onVariantChange:z,variantId:v,primaryProductId:h})))):e.createElement(e.Fragment,null,e.createElement(wd,{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(qd,{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: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(Cd,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:s.general.imageAspectRatio,height:"fit-content"}},e.createElement(Ed,{className:"yt-fixedBundle-product-card_image--vertical",src:kp(V),style:{aspectRatio:s.general.imageAspectRatio},alt:r.title}),r.variants.edges.length>1&&e.createElement(kd,{className:"yt-fixedBundle-product-card_badge-container"},e.createElement(Td,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement(Sd,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement($d,{className:"yt-fixedBundle-product-card_count-badge"},r.variants.edges.length,"+"))),e.createElement(Bd,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(Nd,{className:"yt-fixedBundle-product-card-vertical_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(zd,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(Id,{className:"yt-fixedBundle-product-card-vertical_price--new"},Ep(s.general.currencySymbol,b),Cp(L)),s.fixedBundle.compareAtPriceVisibility&&O&&R>_&&e.createElement(ud,{className:"yt-fixedBundle-product-card-vertical_price--old"},Ep(s.general.currencySymbol,b),Cp(R))))),(f<=3||!u)&&g<f-1&&e.createElement(Fd,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement(Dd,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},pp=({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="undefined"!=typeof window?window.location.href:null,y=r?.products?.find(e=>e.productDetails?.handle===f?.split("/").pop()?.split("?")[0]),b=y?.productId,h=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},[]),[v,w]=t(Object.fromEntries(r?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>h(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),C="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain),E=r?.showIndividualProductSelector??!0,[k,T]=t(new Set(r.products.reduce((e,t,n)=>(C&&t?.productId!==b&&!E||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&&b&&w(e=>{const t={...e};return r?.products?.forEach((e,n)=>{e.productId===b&&(t[n.toString()]=u)}),t})},[u,b,r?.products]),n(()=>{const e=()=>{p(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const S=i((e,t)=>{w(n=>({...n,[e.toString()]:t}))},[]),$=(e,t)=>{const n=r.products[t].productId;C&&n===b||T(n=>{const o=new Set(n);return e?o.add(t):o.delete(t),o})},B=o(()=>(e,t)=>h(e.productDetails,t)>0,[h]),N=o(()=>r.products.some((e,t)=>k.has(t)&&e.productDetails.variants.edges.length>1),[r.products,k]),{originalPrice:I,dealPrice:z,offerValue:F}=o(()=>{const{price:e,compareAtPrice:t}=r.products.reduce((e,t,n)=>{if(!k.has(n))return e;const o=v[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;k.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,v,k,r.percentageOff,r.dealAmount,r.amountOff,r?.customizations?.fixedBundle?.discountBadgeDisplay]),D=o(()=>r.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>k.has(e)),[r.products,k]),P=D.every(({product:e,index:t})=>B(e,v[t.toString()])),A=o(()=>{let e=0;return r.products.forEach((t,n)=>{if(k.has(n)){const o=v[n.toString()],r=t.productDetails.variants.edges.find(e=>e.node.id===o)?.node;r&&(e+=parseFloat(r.price??"0"))}}),e},[r.products,k,v]),_=async e=>{if(P){e.preventDefault(),e.stopPropagation(),s(!0),x(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"fixed-bundle",selectedProducts:D?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const e=Object.entries(v).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!k.has(n)?null:t}).filter(Boolean);a&&await a(Number(I),e)}catch(e){console.error("Error adding to cart:",e)}s(!1)}};if(!a)return e.createElement(e.Fragment,null);const R=r.customizations,O=R.fixedBundle?.cardLayoutStyle||"auto",L="horizontal"===O||"auto"===O&&d,M="bundles"==r.appName?r.pageHeader?.title:r?.title,V="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement(nd,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:R.fixedBundle.sectionBackgroundColor,..."transparent"!==R.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},M&&e.createElement(od,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:R.fixedBundle?.titleBackgroundColor||"none",color:R.fixedBundle?.titleTextColor||"black",textAlign:R.fixedBundle.infoAlignment??"center",fontSize:R.fixedBundle?.titleFontSize,..."transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"===R.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},M),V&&e.createElement(rd,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:R.fixedBundle?.subtitleFontSize,textAlign:R.fixedBundle.infoAlignment??"center",..."left"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"===R.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},V),L?e.createElement(id,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},r?.products?.map((t,n)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(dp,{isChecked:k.has(n),product:t.productDetails,selectedVariantId:v[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:R,onVariantChange:e=>S(n,e),onCheckChange:e=>{$(e,n)},isMobile:d,index:n,isHorizontal:L,variantOptions:r.variantOptions,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:b,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:k,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:A})))):e.createElement(hd,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(vd,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===R.fixedBundle.infoAlignment?"flex-start":"right"===R.fixedBundle.infoAlignment?"flex-end":"center"}},r?.products?.map((t,n)=>e.createElement(dp,{key:`${t.productId}-${n}`,isChecked:k.has(n),product:t.productDetails,selectedVariantId:v[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:R,onVariantChange:e=>{S(n,e)},onCheckChange:e=>$(e,n),isMobile:d,index:n,isHorizontal:L,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:b,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:k,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:A})),N&&e.createElement(lp,{productsWithIndices:D,isOpen:g,onClose:()=>x(!1),variantOptions:r.variantOptions,cta:{textColor:R.general.ctaTextColor,backgroundColor:R.general.ctaBackgroundColor},onVariantChange:S,handleAddToCart:_,primaryProductId:b,variantId:u||void 0}))),e.createElement(md,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===R.fixedBundle.infoAlignment?"flex-start":"right"===R.fixedBundle.infoAlignment?"flex-end":"center"}},Number(I)>0&&Number(F)>0&&R.fixedBundle.compareAtPriceVisibility&&e.createElement(gd,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(fd,{className:"yt-fixedBundle-summary_price"},Ep(R.general.currencySymbol,r?.storeCurrencyCode),Cp(I))),0!==k.size&&e.createElement(xd,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(fd,{className:"yt-fixedBundle-summary_price"},Ep(R.general.currencySymbol,r?.storeCurrencyCode),Cp(z))," ",Number(F)>0&&e.createElement(yd,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",Ep(R.general.currencySymbol,r?.storeCurrencyCode),Cp(F)))),e.createElement(bd,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),L||!N?_(e):x(!0)},disabled:k.size<1||c||!P,style:{backgroundColor:R.general?.ctaBackgroundColor||"#121212",color:R.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${R.general?.ctaBackgroundColor||"#121212"}`,boxShadow:R.general.ctaShadowType,paddingTop:R.general?.ctaPadding,paddingBottom:R.general?.ctaPadding,borderRadius:R.general.ctaBorderRadius,width:R.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{R.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=R.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=R.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{R.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=R.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=R.general?.ctaTextColor||"#FFFFFF")}},c?e.createElement(rt,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):P?e.createElement(e.Fragment,null,R.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")))},up=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),mp=({product:o,tierIdx:r,isOpen:i,onClose:a,onAddToBundle:l,canAdd:c,isSelected:s,customizations:d,isMobile:p})=>{const[u,m]=t(0),[g,x]=t(o.variants[0]?.id.toString()||""),[f,y]=t(!0),b=o.variants.find(e=>e.id.toString()===g)||o.variants[0],h=o.images.filter(Boolean),v=()=>{h.length<=1||(m(e=>0===e?h.length-1:e-1),y(!0))},w=()=>{h.length<=1||(m(e=>e===h.length-1?0:e+1),y(!0))};if(n(()=>(i&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[i]),n(()=>{if(b&&b?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=kp(b?.featured_image?.src);e?.setAttribute("src",t)}},[b]),!i)return null;const C=h.length>1,E=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"}},h.length>0&&e.createElement(e.Fragment,null,f&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),f&&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:kp(h[u]||o.images[0]),alt:o.title,onLoad:()=>y(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px",opacity:f?0:1,transition:"opacity 0.3s"}}),C&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:v,disabled:0===u,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:0===u?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===u?.5:1}},e.createElement(Z,{size:24})),e.createElement("button",{onClick:w,disabled:u===h.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:u===h.length-1?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:u===h.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:u===h.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"}},o.title),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,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:g,onChange:e=>{x(e.target.value),y(!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"}},"₹",(b.price/100).toLocaleString(),b.compare_at_price&&b.compare_at_price>b.price?e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(b.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||!b.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:b.available?s||!c?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock")),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),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",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}},h.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},f&&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:h[u]||o.images[0],alt:o.title,onLoad:()=>y(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:f?0:1,transition:"opacity 0.3s"}}),C&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:v,disabled:0===u,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:0===u?.5:1,cursor:0===u?"not-allowed":"pointer"}},e.createElement(Z,{size:20})),e.createElement("button",{onClick:w,disabled:u===h.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:u===h.length-1?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:u===h.length-1?.5:1,cursor:u===h.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),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,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:g,onChange:e=>{x(e.target.value),y(!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"}},"₹",(b.price/100).toLocaleString(),b.compare_at_price?b.compare_at_price>b.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(b.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||!b.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&c&&b.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock"))));return P.createPortal(p?k:E,document.body)},gp=({title:t,uploadState:n,onUpload:o,onRemove:r,onRetry:i})=>{const a="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return e.createElement("div",{className:"yt-collection-bundle-upload-field",style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},e.createElement("div",{className:"yt-collection-bundle-upload-title",style:{fontWeight:500,color:"#333",marginBottom:"4px"}},t),a&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},e.createElement(up,null)," Uploading ",n?.name,"...")),l&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-error",style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-retry-btn",onClick:i,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!a&&!l&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-image-container",style:{margin:"12px 0"}},e.createElement("img",{className:"yt-collection-bundle-upload-image",src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),e.createElement("div",{className:"yt-collection-bundle-upload-filename",style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-remove-btn",onClick:r,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-hint",style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-btn",onClick:o,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},xp=({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))})))},fp=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[]},yp=({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(window.innerWidth<640),[v,w]=t({}),C=r(new Map),[E,k]=t(!1),T=r(null),S=r(new Map),[$,B]=t(160),N=b?8:20,{customizations:I}=o,z=o.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),F=!!o.config.form,D=z.length+(F?1:0),P=I.hideSelectedProducts,A=I.allowMultipleQty,_=I.hideOutOfStockProducts,R=i((e,t=d)=>{const n=z[e-1]?.products||[],o="All"===t?n:n.filter(e=>fp(e).includes(t));return _?o.filter(e=>e.available):o},[z,d,_]),O=i(e=>{const t=R(e).length;w(n=>{const o=n[e]||0,r=Math.min(o+8,t);return r<=o?n:{...n,[e]:r}})},[8,R]);n(()=>(T.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===c&&O(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{T.current?.disconnect()}),[O,c]),n(()=>{p("All")},[c]),n(()=>{if(F&&c===D)return;const e=c,t=R(e).length;w(n=>{const o=n[`${e}_category`]!==d;return 0===(n[e]||0)||o?{...n,[e]:Math.min(N,t),[`${e}_category`]:d}:n})},[c,N,d,R]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>h(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const L=i(e=>{B(e+10)},[]),M=u.reduce((e,t)=>e+t.quantity,0),V=u.reduce((e,t)=>e+t.price*t.quantity,0)/100,j=u.reduce((e,t)=>{const n=z.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,W=(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())},H=(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=U[t],c=q(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:o,price:r,quantity:1,tierIndex:t}]})},q=e=>{const t=z[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},Q=(e,t)=>{const n=q(t);if(n===1/0)return!0;const o=U[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||o<n},U=z.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),Y=(e,t,n)=>{const o=q(n);if(o===1/0)return!0;return U[n]<o},G=e=>{if(!C.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");y(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),k(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",o=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!o.ok)throw new Error("Upload failed");return(await o.json()).url}catch(e){throw k(!1),alert("Upload failed. Try again."),e}finally{k(!1)}})(n);y(o=>({...o,[e]:{url:t,name:n.name}}))}catch{y(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),C.current.set(e,t)}return C.current.get(e)},X=F&&c===D,Z=(X?null:z[c-1])?q(c-1):0,K=z.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:U[t]}));return e.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},I.headerImage&&!I.headerImage.includes("Liquid error")&&e.createElement("img",{className:"yt-collection-bundle-header-img",src:I.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),I.showTierSteps&&e.createElement("div",{style:{paddingTop:I.headerImage&&!I.headerImage.includes("Liquid error")?"20px":"0"}},e.createElement(bp,{totalSteps:D,isFormStep:X,currentStep:c,getStepTitle:e=>F&&e===D?"Customize Gift Details":z[e-1]?.title||`Step ${e}`,isMobile:b,formTitle:o?.config?.form?.title,hasForm:F,onStepClick:e=>{if(e>1&&!u.length)return alert("Add at least one product first");s(e),window.scrollTo(0,0)}})),Array.from({length:D},(e,t)=>t+1).map(t=>{const n=F&&t===D,r=n?[]:(e=>z[e-1]?.products||[])(t);let i=[];if(!n&&I.enableProductCategories){const e=new Set;r.forEach(t=>fp(t).forEach(t=>e.add(t))),i=Array.from(e).sort()}const a=n?[]:R(t),l=t-1,s=a.slice(0,v[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("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:`${$}px`}},o?.config?.form?.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},e.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n;return e.createElement("textarea",{key:o,className:"yt-collection-bundle-textarea",placeholder:t?.title,rows:3,maxLength:500,onChange:e=>y(t=>({...t,[o]:e.target.value})),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical",lineHeight:"normal"}})})),"image"===t.type&&e.createElement("div",{className:"yt-collection-bundle-image-section",style:{marginBottom:"24px"}},e.createElement("sub",{className:"yt-collection-bundle-upload-hint",style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px",lineHeight:"normal"}},"jpeg/png (max 5MB)"),e.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"16px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n,r=f[o];return e.createElement(gp,{key:o,title:t?.title,uploadState:r,onUpload:()=>G(o).click(),onRemove:()=>y(e=>{const{[o]:t,...n}=e;return n}),onRetry:()=>G(o).click()})})))))):e.createElement(e.Fragment,null,I.enableProductCategories&&i.length>0&&e.createElement(xp,{styles:I,isMobile:b,categories:i,activeCategory:d,onCategoryChange:p}),e.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:b?"grid":"flex",gridTemplateColumns:b?"repeat(2,1fr)":"",flexWrap:b?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${$}px`}},s.map(t=>e.createElement(hp,{key:t.id,product:t,tierIdx:l,customizations:I,isMobile:b,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:H,canAddProduct:Q,allowMultipleQty:A,handleVariantChange:W,canIncrement:Y,setSelectedProducts:m})),c===t&&(v[t]||0)<a.length&&e.createElement("div",{ref:e=>{const n=S.current.get(t);n&&T.current?.unobserve(n),e?(S.current.set(t,e),T.current?.observe(e)):S.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))))}),e.createElement(vp,{config:o,selectedProducts:u,selectedByTier:K,totalItems:M,totalPrice:V,totalCompareAtPrice:j,currentStep:c,totalSteps:D,currentTierMax:Z,tierSelectedCounts:U,isMobile:b,bundleAddToCartLoading:a,isUploading:E,hoveredCard:g,setHoveredCard:x,hideSelectedProducts:P,getProductStep:e=>{for(let t=0;t<z.length;t++)if(z[t].products.some(t=>t.id.toString()===e))return t+1;return F?D:z.length},setCurrentStep:s,handleRemoveItem:(e,t,n)=>{m(o=>o.filter(o=>!(o.productId===e&&o.variantId===t&&o.tierIndex===n)))},handleCheckout:async()=>{if(c!==D||!u.length)return;const e={};F&&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)},hasForm:F,onHeightChange:L}))},bp=({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))},hp=({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})=>{const[x,f]=t(!1),y=document.querySelector(`[data-product-id="${n.id}"]`),b=y?.dataset.selectedVariant||n.variants[0].id.toString(),h=n.variants.find(e=>e.id.toString()===b)||n.variants[0],v=c.some(e=>e.productId===n.id.toString()&&e.variantId===b&&e.tierIndex===o),w=a===n.id,C=c.filter(e=>e.productId===n.id.toString()&&e.variantId===h.id.toString()&&e.tierIndex===o).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:n.id,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":h.id,"data-current-price":h.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:()=>f(!0),onMouseEnter:()=>l(n.id),onMouseLeave:()=>l(null)},e.createElement("img",{src:kp(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:w?0:1,transform:w?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:kp(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:w?1:0,transform:"scale(1.05)"},alt:n.title}),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:h.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&&fp(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"}},fp(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))),fp(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"}},"+",fp(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:1}},n.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"}},"₹",(h.price/100).toLocaleString()),h.compare_at_price&&0!==h.compare_at_price&&h.compare_at_price>h.price?e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(h.compare_at_price/100).toLocaleString()):null)),p&&C>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:h.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}-${h.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"}},C),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:h.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:()=>{h.available&&m(n,h.id.toString(),o)&&g(e=>{const t=`${n.id}-${h.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:h.id.toString(),price:h.price,quantity:1,tierIndex:o}]})},disabled:!h.available||!m(n,h.id.toString(),o)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":d(n,o)&&h.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:h.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{h.available&&d(n,o)&&s(n,o)},disabled:!h.available||!d(n,o)},v?"Added":h.available?"ADD TO BOX":"Out of Stock")),x&&e.createElement(mp,{product:n,tierIdx:o,isOpen:x,onClose:()=>f(!1),onAddToBundle:(e,t)=>{s(e,t),f(!1)},canAdd:d(n,o),isSelected:v,customizations:r,isMobile:i}))},vp=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,[$,B]=t(!1),N=r(null),I=r(null),{totalOriginal:z,hasSavings:F,formattedSavings:D,totalAfterDiscount:P}=(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?(B(!0),t=setTimeout(()=>{B(!1)},3e3)):B(!1),()=>{t&&clearTimeout(t)}},[m,g,p]),n(()=>{if(N.current&&T){const e=N.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<(I.current??0)&&(I.current=e),e>(I.current??0)){I.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;ve({particleCount:100,spread:70,origin:{x:o,y:r},zIndex:9999})}},[l]),e.createElement("div",{ref:N,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:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",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:kp(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}},"₹",(P??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",z.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",D)):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(up,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}},"₹",(P??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",z.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",D)):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(up,null)):p===u?"Checkout":"Next")))},wp=window?.Shopify?.currency||{rate:1,active:"INR"},Cp=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*wp.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},Ep=(e,t)=>t==wp.active?e:se(wp.active)||wp.active,kp=(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"}`}},Tp=(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))},Sp=({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})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Wc,{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}):"combo"===t.type?e.createElement(qc,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"mixAndMatch"===t.type?e.createElement(td,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"collection"===t.type?e.createElement(yp,{config:t,addCustomBundleToCart:r,bundleAddToCartLoading:l}):e.createElement(Cs,{bundle:t,currentProductId:n,addToCartFunction:o,dispatchAnalyticsEvent:u}):e.createElement(pp,{addToCartFunction:o,bundle:t,dispatchAnalyticsEvent:u}),$p=c.div`
4662
+ `,cp=({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(Ud,{className:"yt-fixedBundle-variant-modal_overlay",onClick:a},e.createElement(Yd,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Gd,{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(Zd,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(Kd,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(Jd,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(ep,{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(np,{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(op,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(lp,{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(ip,{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(op,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(lp,{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(ap,{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(ip,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[r]==o,disabled:l,onClick:()=>{h(n,o,r)}},o))})):e.createElement(op,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(lp,{className:"yt-fixedBundle-variant-modal_option-name"},o.name," :"," "),a.map((o,i)=>{const a=!b(n,r,o,t);return e.createElement(ip,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:g[n]?.[r]==o,disabled:a,onClick:()=>{h(n,o,r)}},o)}))}))),o<r.length-1&&e.createElement(tp,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(Xd,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:l.backgroundColor,color:l.textColor},onClick:d},"Add bundle to cart")));return P.createPortal(v,document.body)},sp=({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(jd,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(Wd,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name},e.createElement("span",null)):null;return e.createElement(Ad,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},e.createElement(_d,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!c)},e.createElement(Rd,{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(Od,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(Ld,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},o?.map(t=>e.createElement(Md,{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(Vd,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},dp=({product:o,variantOptions:r,selectedVariants:i,onVariantChange:a,variantId:l,primaryProductId:c,variantType:s="dropdown"})=>{const[d,p]=t(i||[]);n(()=>{i&&i.length>0&&p(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(" / ");p(t)}}},[l,o]);const u=e=>{if(!r?.options)return"text";const t=r.options.find(t=>t.name===e);return t?.type||"text"},m=(e,t)=>{const n=d[t];if(!n)return null;return g(e,t).find(e=>e.name===n)||null},g=(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=[...d||[]];o[e]=t;const r=o.join(" / "),i=n.variants.edges.find(e=>e.node.title===r)?.node;return!!i&&((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})(n,i.id)>0})(t,e,o);return{name:e,value:r?.value||e,disabled:i}})};return e.createElement(Hd,{className:"yt-fixedBundle-variant-selector-horizontal_container"},o.options.map((t,n)=>{const r=g(t,n);return 0===r.length||1===r.length&&"Default Title"===r[0].name?null:e.createElement(qd,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(sp,{options:r,selectedValue:m(t,n),onChange:e=>{((e,t)=>{const n=[...d];n[e]=t.name,p(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:u(t.name)}))}))},pp=({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]),[$,B]=t(r?.variants?.edges.find(e=>S(e?.node?.id)>0)?.node||r?.variants?.edges?.[0]?.node),N=o(()=>$?.title?.split(" / ")||[],[$]),I=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&&(B(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;B(e)}},[r,h,a,v,d,S]);const z=i(e=>{const t=r?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&d(e)},[r,d]),F=s?.fixedBundle?.discountBadgeDisplay,D=parseFloat($?.price??"0"),P=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}})(D,E,C??0,w?.size,k,T),_=P?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: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(ld,{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(cd,{className:"yt-fixedBundle-product-card-horizontal_image",src:Tp(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(sd,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(dd,{className:"yt-fixedBundle-product-card-horizontal_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(pd,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(ud,{className:"yt-fixedBundle-product-card-horizontal_price--new"},kp(s.general.currencySymbol,b)," ",Ep(L)),O&&R>_&&e.createElement(md,{className:"yt-fixedBundle-product-card-horizontal_price--old"},kp(s.general.currencySymbol,b),Ep(R))),e.createElement(dp,{product:r,variantOptions:x,selectedVariants:N,onVariantChange:z,variantId:v,primaryProductId:h})))):e.createElement(e.Fragment,null,e.createElement(Cd,{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(Qd,{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: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(Ed,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:s.general.imageAspectRatio,height:"fit-content"}},e.createElement(kd,{className:"yt-fixedBundle-product-card_image--vertical",src:Tp(V),style:{aspectRatio:s.general.imageAspectRatio},alt:r.title}),r.variants.edges.length>1&&e.createElement(Td,{className:"yt-fixedBundle-product-card_badge-container"},e.createElement(Sd,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement($d,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement(Bd,{className:"yt-fixedBundle-product-card_count-badge"},r.variants.edges.length,"+"))),e.createElement(Nd,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(Id,{className:"yt-fixedBundle-product-card-vertical_title"},r.title),s.fixedBundle.productsPriceVisibility&&e.createElement(Fd,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(zd,{className:"yt-fixedBundle-product-card-vertical_price--new"},kp(s.general.currencySymbol,b),Ep(L)),s.fixedBundle.compareAtPriceVisibility&&O&&R>_&&e.createElement(md,{className:"yt-fixedBundle-product-card-vertical_price--old"},kp(s.general.currencySymbol,b),Ep(R))))),(f<=3||!u)&&g<f-1&&e.createElement(Dd,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement(Pd,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},up=({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="undefined"!=typeof window?window.location.href:null,y=r?.products?.find(e=>e.productDetails?.handle===f?.split("/").pop()?.split("?")[0]),b=y?.productId,h=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},[]),[v,w]=t(Object.fromEntries(r?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>h(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),C="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain),E=r?.showIndividualProductSelector??!0,[k,T]=t(new Set(r.products.reduce((e,t,n)=>(C&&t?.productId!==b&&!E||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&&b&&w(e=>{const t={...e};return r?.products?.forEach((e,n)=>{e.productId===b&&(t[n.toString()]=u)}),t})},[u,b,r?.products]),n(()=>{const e=()=>{p(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const S=i((e,t)=>{w(n=>({...n,[e.toString()]:t}))},[]),$=(e,t)=>{const n=r.products[t].productId;C&&n===b||T(n=>{const o=new Set(n);return e?o.add(t):o.delete(t),o})},B=o(()=>(e,t)=>h(e.productDetails,t)>0,[h]),N=o(()=>r.products.some((e,t)=>k.has(t)&&e.productDetails.variants.edges.length>1),[r.products,k]),{originalPrice:I,dealPrice:z,offerValue:F}=o(()=>{const{price:e,compareAtPrice:t}=r.products.reduce((e,t,n)=>{if(!k.has(n))return e;const o=v[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;k.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,v,k,r.percentageOff,r.dealAmount,r.amountOff,r?.customizations?.fixedBundle?.discountBadgeDisplay]),D=o(()=>r.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>k.has(e)),[r.products,k]),P=D.every(({product:e,index:t})=>B(e,v[t.toString()])),A=o(()=>{let e=0;return r.products.forEach((t,n)=>{if(k.has(n)){const o=v[n.toString()],r=t.productDetails.variants.edges.find(e=>e.node.id===o)?.node;r&&(e+=parseFloat(r.price??"0"))}}),e},[r.products,k,v]),_=async e=>{if(P){e.preventDefault(),e.stopPropagation(),s(!0),x(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"fixed-bundle",selectedProducts:D?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const e=Object.entries(v).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!k.has(n)?null:t}).filter(Boolean);a&&await a(Number(I),e)}catch(e){console.error("Error adding to cart:",e)}s(!1)}};if(!a)return e.createElement(e.Fragment,null);const R=r.customizations,O=R.fixedBundle?.cardLayoutStyle||"auto",L="horizontal"===O||"auto"===O&&d,M="bundles"==r.appName?r.pageHeader?.title:r?.title,V="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement(od,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:R.fixedBundle.sectionBackgroundColor,..."transparent"!==R.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},M&&e.createElement(rd,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:R.fixedBundle?.titleBackgroundColor||"none",color:R.fixedBundle?.titleTextColor||"black",textAlign:R.fixedBundle.infoAlignment??"center",fontSize:R.fixedBundle?.titleFontSize,..."transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"===R.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},M),V&&e.createElement(id,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:R.fixedBundle?.subtitleFontSize,textAlign:R.fixedBundle.infoAlignment??"center",..."left"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===R.fixedBundle.infoAlignment&&"transparent"!==R.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===R.fixedBundle.infoAlignment&&"transparent"===R.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},V),L?e.createElement(ad,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},r?.products?.map((t,n)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(pp,{isChecked:k.has(n),product:t.productDetails,selectedVariantId:v[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:R,onVariantChange:e=>S(n,e),onCheckChange:e=>{$(e,n)},isMobile:d,index:n,isHorizontal:L,variantOptions:r.variantOptions,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:b,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:k,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:A})))):e.createElement(vd,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(wd,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===R.fixedBundle.infoAlignment?"flex-start":"right"===R.fixedBundle.infoAlignment?"flex-end":"center"}},r?.products?.map((t,n)=>e.createElement(pp,{key:`${t.productId}-${n}`,isChecked:k.has(n),product:t.productDetails,selectedVariantId:v[n.toString()]||"",canCustomize:r?.canCustomizeFixedBundle||!1,styles:R,onVariantChange:e=>{S(n,e)},onCheckChange:e=>$(e,n),isMobile:d,index:n,isHorizontal:L,productsLength:r.products.length,storeCurrencyCode:r.storeCurrencyCode,primaryProductId:b,variantId:u||void 0,bundleDiscountType:r.discountType??"none",checkedProducts:k,bundleProductsCount:r.products.length,bundleDiscountValue:r.percentageOff||r.amountOff||r.dealAmount,totalSelectedOriginal:A})),N&&e.createElement(cp,{productsWithIndices:D,isOpen:g,onClose:()=>x(!1),variantOptions:r.variantOptions,cta:{textColor:R.general.ctaTextColor,backgroundColor:R.general.ctaBackgroundColor},onVariantChange:S,handleAddToCart:_,primaryProductId:b,variantId:u||void 0}))),e.createElement(gd,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===R.fixedBundle.infoAlignment?"flex-start":"right"===R.fixedBundle.infoAlignment?"flex-end":"center"}},Number(I)>0&&Number(F)>0&&R.fixedBundle.compareAtPriceVisibility&&e.createElement(xd,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(yd,{className:"yt-fixedBundle-summary_price"},kp(R.general.currencySymbol,r?.storeCurrencyCode),Ep(I))),0!==k.size&&e.createElement(fd,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(yd,{className:"yt-fixedBundle-summary_price"},kp(R.general.currencySymbol,r?.storeCurrencyCode),Ep(z))," ",Number(F)>0&&e.createElement(bd,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",kp(R.general.currencySymbol,r?.storeCurrencyCode),Ep(F)))),e.createElement(hd,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),L||!N?_(e):x(!0)},disabled:k.size<1||c||!P,style:{backgroundColor:R.general?.ctaBackgroundColor||"#121212",color:R.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${R.general?.ctaBackgroundColor||"#121212"}`,boxShadow:R.general.ctaShadowType,paddingTop:R.general?.ctaPadding,paddingBottom:R.general?.ctaPadding,borderRadius:R.general.ctaBorderRadius,width:R.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{R.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=R.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=R.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{R.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=R.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=R.general?.ctaTextColor||"#FFFFFF")}},c?e.createElement(ue,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):P?e.createElement(e.Fragment,null,R.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")))},mp=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),gp=({product:o,tierIdx:r,isOpen:i,onClose:a,onAddToBundle:l,canAdd:c,isSelected:s,customizations:d,isMobile:p})=>{const[u,m]=t(0),[g,x]=t(o.variants[0]?.id.toString()||""),[f,y]=t(!0),b=o.variants.find(e=>e.id.toString()===g)||o.variants[0],h=o.images.filter(Boolean),v=()=>{h.length<=1||(m(e=>0===e?h.length-1:e-1),y(!0))},w=()=>{h.length<=1||(m(e=>e===h.length-1?0:e+1),y(!0))};if(n(()=>(i&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[i]),n(()=>{if(b&&b?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=Tp(b?.featured_image?.src);e?.setAttribute("src",t)}},[b]),!i)return null;const C=h.length>1,E=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"}},h.length>0&&e.createElement(e.Fragment,null,f&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),f&&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:Tp(h[u]||o.images[0]),alt:o.title,onLoad:()=>y(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px",opacity:f?0:1,transition:"opacity 0.3s"}}),C&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:v,disabled:0===u,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:0===u?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===u?.5:1}},e.createElement(Z,{size:24})),e.createElement("button",{onClick:w,disabled:u===h.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:u===h.length-1?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:u===h.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:u===h.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"}},o.title),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,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:g,onChange:e=>{x(e.target.value),y(!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"}},"₹",(b.price/100).toLocaleString(),b.compare_at_price&&b.compare_at_price>b.price?e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(b.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||!b.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:b.available?s||!c?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock")),o.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:o.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),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",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}},h.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},f&&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:h[u]||o.images[0],alt:o.title,onLoad:()=>y(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:f?0:1,transition:"opacity 0.3s"}}),C&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:v,disabled:0===u,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===u?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:0===u?.5:1,cursor:0===u?"not-allowed":"pointer"}},e.createElement(Z,{size:20})),e.createElement("button",{onClick:w,disabled:u===h.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:u===h.length-1?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:u===h.length-1?.5:1,cursor:u===h.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),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,b.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:g,onChange:e=>{x(e.target.value),y(!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"}},"₹",(b.price/100).toLocaleString(),b.compare_at_price?b.compare_at_price>b.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(b.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||!b.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&c&&b.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:c&&b.available?"pointer":"not-allowed"}},s?"Added to Box":b.available?"Add to Box":"Out of Stock"))));return P.createPortal(p?k:E,document.body)},xp=({title:t,uploadState:n,onUpload:o,onRemove:r,onRetry:i})=>{const a="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return e.createElement("div",{className:"yt-collection-bundle-upload-field",style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},e.createElement("div",{className:"yt-collection-bundle-upload-title",style:{fontWeight:500,color:"#333",marginBottom:"4px"}},t),a&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-loading",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},e.createElement(mp,null)," Uploading ",n?.name,"...")),l&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-error",style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-retry-btn",onClick:i,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!a&&!l&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-image-container",style:{margin:"12px 0"}},e.createElement("img",{className:"yt-collection-bundle-upload-image",src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),e.createElement("div",{className:"yt-collection-bundle-upload-filename",style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-remove-btn",onClick:r,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-collection-bundle-upload-hint",style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),e.createElement("button",{type:"button",className:"yt-collection-bundle-upload-btn",onClick:o,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},fp=({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))})))},yp=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[]},bp=({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(window.innerWidth<640),[v,w]=t({}),C=r(new Map),[E,k]=t(!1),T=r(null),S=r(new Map),[$,B]=t(160),N=b?8:20,{customizations:I}=o,z=o.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),F=!!o.config.form,D=z.length+(F?1:0),P=I.hideSelectedProducts,A=I.allowMultipleQty,_=I.hideOutOfStockProducts,R=i((e,t=d)=>{const n=z[e-1]?.products||[],o="All"===t?n:n.filter(e=>yp(e).includes(t));return _?o.filter(e=>e.available):o},[z,d,_]),O=i(e=>{const t=R(e).length;w(n=>{const o=n[e]||0,r=Math.min(o+8,t);return r<=o?n:{...n,[e]:r}})},[8,R]);n(()=>(T.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===c&&O(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{T.current?.disconnect()}),[O,c]),n(()=>{p("All")},[c]),n(()=>{if(F&&c===D)return;const e=c,t=R(e).length;w(n=>{const o=n[`${e}_category`]!==d;return 0===(n[e]||0)||o?{...n,[e]:Math.min(N,t),[`${e}_category`]:d}:n})},[c,N,d,R]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>h(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const L=i(e=>{B(e+10)},[]),M=u.reduce((e,t)=>e+t.quantity,0),V=u.reduce((e,t)=>e+t.price*t.quantity,0)/100,j=u.reduce((e,t)=>{const n=z.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,W=(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())},H=(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=U[t],c=q(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:o,price:r,quantity:1,tierIndex:t}]})},q=e=>{const t=z[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},Q=(e,t)=>{const n=q(t);if(n===1/0)return!0;const o=U[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||o<n},U=z.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),Y=(e,t,n)=>{const o=q(n);if(o===1/0)return!0;return U[n]<o},G=e=>{if(!C.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");y(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),k(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",o=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!o.ok)throw new Error("Upload failed");return(await o.json()).url}catch(e){throw k(!1),alert("Upload failed. Try again."),e}finally{k(!1)}})(n);y(o=>({...o,[e]:{url:t,name:n.name}}))}catch{y(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),C.current.set(e,t)}return C.current.get(e)},X=F&&c===D,Z=(X?null:z[c-1])?q(c-1):0,K=z.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:U[t]}));return e.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},I.headerImage&&!I.headerImage.includes("Liquid error")&&e.createElement("img",{className:"yt-collection-bundle-header-img",src:I.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),I.showTierSteps&&e.createElement("div",{style:{paddingTop:I.headerImage&&!I.headerImage.includes("Liquid error")?"20px":"0"}},e.createElement(hp,{totalSteps:D,isFormStep:X,currentStep:c,getStepTitle:e=>F&&e===D?"Customize Gift Details":z[e-1]?.title||`Step ${e}`,isMobile:b,formTitle:o?.config?.form?.title,hasForm:F,onStepClick:e=>{if(e>1&&!u.length)return alert("Add at least one product first");s(e),window.scrollTo(0,0)}})),Array.from({length:D},(e,t)=>t+1).map(t=>{const n=F&&t===D,r=n?[]:(e=>z[e-1]?.products||[])(t);let i=[];if(!n&&I.enableProductCategories){const e=new Set;r.forEach(t=>yp(t).forEach(t=>e.add(t))),i=Array.from(e).sort()}const a=n?[]:R(t),l=t-1,s=a.slice(0,v[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("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:`${$}px`}},o?.config?.form?.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},e.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n;return e.createElement("textarea",{key:o,className:"yt-collection-bundle-textarea",placeholder:t?.title,rows:3,maxLength:500,onChange:e=>y(t=>({...t,[o]:e.target.value})),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical",lineHeight:"normal"}})})),"image"===t.type&&e.createElement("div",{className:"yt-collection-bundle-image-section",style:{marginBottom:"24px"}},e.createElement("sub",{className:"yt-collection-bundle-upload-hint",style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px",lineHeight:"normal"}},"jpeg/png (max 5MB)"),e.createElement("div",{className:"yt-collection-bundle-form-fields",style:{display:"flex",flexDirection:"column",gap:"16px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n,r=f[o];return e.createElement(xp,{key:o,title:t?.title,uploadState:r,onUpload:()=>G(o).click(),onRemove:()=>y(e=>{const{[o]:t,...n}=e;return n}),onRetry:()=>G(o).click()})})))))):e.createElement(e.Fragment,null,I.enableProductCategories&&i.length>0&&e.createElement(fp,{styles:I,isMobile:b,categories:i,activeCategory:d,onCategoryChange:p}),e.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:b?"grid":"flex",gridTemplateColumns:b?"repeat(2,1fr)":"",flexWrap:b?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${$}px`}},s.map(t=>e.createElement(vp,{key:t.id,product:t,tierIdx:l,customizations:I,isMobile:b,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:H,canAddProduct:Q,allowMultipleQty:A,handleVariantChange:W,canIncrement:Y,setSelectedProducts:m})),c===t&&(v[t]||0)<a.length&&e.createElement("div",{ref:e=>{const n=S.current.get(t);n&&T.current?.unobserve(n),e?(S.current.set(t,e),T.current?.observe(e)):S.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))))}),e.createElement(wp,{config:o,selectedProducts:u,selectedByTier:K,totalItems:M,totalPrice:V,totalCompareAtPrice:j,currentStep:c,totalSteps:D,currentTierMax:Z,tierSelectedCounts:U,isMobile:b,bundleAddToCartLoading:a,isUploading:E,hoveredCard:g,setHoveredCard:x,hideSelectedProducts:P,getProductStep:e=>{for(let t=0;t<z.length;t++)if(z[t].products.some(t=>t.id.toString()===e))return t+1;return F?D:z.length},setCurrentStep:s,handleRemoveItem:(e,t,n)=>{m(o=>o.filter(o=>!(o.productId===e&&o.variantId===t&&o.tierIndex===n)))},handleCheckout:async()=>{if(c!==D||!u.length)return;const e={};F&&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)},hasForm:F,onHeightChange:L}))},hp=({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))},vp=({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})=>{const[x,f]=t(!1),y=document.querySelector(`[data-product-id="${n.id}"]`),b=y?.dataset.selectedVariant||n.variants[0].id.toString(),h=n.variants.find(e=>e.id.toString()===b)||n.variants[0],v=c.some(e=>e.productId===n.id.toString()&&e.variantId===b&&e.tierIndex===o),w=a===n.id,C=c.filter(e=>e.productId===n.id.toString()&&e.variantId===h.id.toString()&&e.tierIndex===o).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:n.id,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":h.id,"data-current-price":h.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:()=>f(!0),onMouseEnter:()=>l(n.id),onMouseLeave:()=>l(null)},e.createElement("img",{src:Tp(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:w?0:1,transform:w?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:Tp(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:w?1:0,transform:"scale(1.05)"},alt:n.title}),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:h.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&&yp(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"}},yp(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))),yp(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"}},"+",yp(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:1}},n.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"}},"₹",(h.price/100).toLocaleString()),h.compare_at_price&&0!==h.compare_at_price&&h.compare_at_price>h.price?e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(h.compare_at_price/100).toLocaleString()):null)),p&&C>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:h.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}-${h.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"}},C),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:h.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:()=>{h.available&&m(n,h.id.toString(),o)&&g(e=>{const t=`${n.id}-${h.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:h.id.toString(),price:h.price,quantity:1,tierIndex:o}]})},disabled:!h.available||!m(n,h.id.toString(),o)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":d(n,o)&&h.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:h.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{h.available&&d(n,o)&&s(n,o)},disabled:!h.available||!d(n,o)},v?"Added":h.available?"ADD TO BOX":"Out of Stock")),x&&e.createElement(gp,{product:n,tierIdx:o,isOpen:x,onClose:()=>f(!1),onAddToBundle:(e,t)=>{s(e,t),f(!1)},canAdd:d(n,o),isSelected:v,customizations:r,isMobile:i}))},wp=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,[$,B]=t(!1),N=r(null),I=r(null),{totalOriginal:z,hasSavings:F,formattedSavings:D,totalAfterDiscount:P}=(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?(B(!0),t=setTimeout(()=>{B(!1)},3e3)):B(!1),()=>{t&&clearTimeout(t)}},[m,g,p]),n(()=>{if(N.current&&T){const e=N.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<(I.current??0)&&(I.current=e),e>(I.current??0)){I.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;Ce({particleCount:100,spread:70,origin:{x:o,y:r},zIndex:9999})}},[l]),e.createElement("div",{ref:N,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:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",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:Tp(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}},"₹",(P??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",z.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",D)):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(mp,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}},"₹",(P??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",z.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",D)):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(mp,null)):p===u?"Checkout":"Next")))},Cp=window?.Shopify?.currency||{rate:1,active:"INR"},Ep=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Cp.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},kp=(e,t)=>t==Cp.active?e:se(Cp.active)||Cp.active,Tp=(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"}`}},Sp=(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))},$p=({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})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Hc,{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}):"combo"===t.type?e.createElement(Qc,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"mixAndMatch"===t.type?e.createElement(nd,{bundle:t,addToCartFunction:o,dispatchAnalyticsEvent:u}):"collection"===t.type?e.createElement(bp,{config:t,addCustomBundleToCart:r,bundleAddToCartLoading:l}):e.createElement(Es,{bundle:t,currentProductId:n,addToCartFunction:o,dispatchAnalyticsEvent:u}):e.createElement(up,{addToCartFunction:o,bundle:t,dispatchAnalyticsEvent:u}),Bp=c.div`
4672
4663
  position: relative;
4673
- `,Bp=c.button`
4664
+ `,Np=c.button`
4674
4665
  border: 1px solid #ccc;
4675
4666
  border-radius: 4px;
4676
4667
  padding: 2px 8px;
@@ -4680,7 +4671,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4680
4671
  font-size: 13px;
4681
4672
  font-weight: 500;
4682
4673
  cursor: pointer;
4683
- `,Np=c.div`
4674
+ `,Ip=c.div`
4684
4675
  position: absolute;
4685
4676
  bottom: calc(100% + 5px);
4686
4677
  left: 0;
@@ -4692,7 +4683,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4692
4683
  min-width: 100px;
4693
4684
  max-height: 150px;
4694
4685
  overflow-y: auto;
4695
- `,Ip=c.div`
4686
+ `,zp=c.div`
4696
4687
  padding: 8px 12px;
4697
4688
  display: flex;
4698
4689
  align-items: center;
@@ -4702,31 +4693,31 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4702
4693
  &:hover {
4703
4694
  background-color: #f1f1f1;
4704
4695
  }
4705
- `,zp=c.span`
4696
+ `,Fp=c.span`
4706
4697
  width: 16px;
4707
4698
  height: 16px;
4708
4699
  border-radius: 50%;
4709
4700
  background-color: ${({$colorValue:e})=>e};
4710
4701
  border: 1px solid #eee;
4711
- `,Fp=c.img`
4702
+ `,Dp=c.img`
4712
4703
  width: 20px;
4713
4704
  height: 20px;
4714
4705
  border-radius: 50%;
4715
4706
  object-fit: cover;
4716
- `,Dp=c(V)`
4707
+ `,Pp=c(V)`
4717
4708
  transition: transform 0.2s ease-in-out;
4718
4709
  transform: ${({$isOpen:e})=>e?"rotate(180deg)":"none"};
4719
- `,Pp=c.div`
4710
+ `,Ap=c.div`
4720
4711
  display: flex;
4721
4712
  align-items: center;
4722
4713
  gap: 15px;
4723
4714
  margin-top: 4px;
4724
4715
  flex-wrap: wrap;
4725
- `,Ap=c.span`
4716
+ `,_p=c.span`
4726
4717
  font-size: 14px;
4727
4718
  color: #666;
4728
4719
  font-weight: 400;
4729
- `,_p=c.div`
4720
+ `,Rp=c.div`
4730
4721
  position: fixed;
4731
4722
  bottom: 0;
4732
4723
  left: 0;
@@ -4740,7 +4731,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4740
4731
  transform: translateY(${e=>e.$translateY}px);
4741
4732
  pointer-events: ${e=>0===e.$opacity?"none":"auto"};
4742
4733
  background-color: ${e=>"stretch"===e.$desktopBarType?"white":"none"};
4743
- `,Rp=c.div`
4734
+ `,Op=c.div`
4744
4735
  display: flex;
4745
4736
  align-items: center;
4746
4737
  flex-direction: column;
@@ -4765,7 +4756,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4765
4756
 
4766
4757
  ${e=>e.$topRibbonText&&`&::before {\n content: "${e.$topRibbonText}";\n position: absolute;\n top: 0;\n left: 50%;\n transform: translate(-50%, -70%);\n background-color: ${e.$themeColor||"black"};\n color: ${e.$themeTextColor||"white"};\n padding-top: 2px;\n padding-bottom: 8px;\n font-size: 12px;\n line-height: normal;\n text-align: center;\n border-top-left-radius: ${"rounded"===e.$cornerType?"30px":"0px"};\n border-top-right-radius: ${"rounded"===e.$cornerType?"30px":"0px"};\n line-height: normal;\n width: ${"rounded"===e.$cornerType?"97%":"100%"};\n z-index: -1;\n }`}
4767
4758
  ${e=>"hover"===e.$desktopBarType&&"\n box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);\n &:hover {\n box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);\n }\n "}
4768
- `,Op=c.div`
4759
+ `,Lp=c.div`
4769
4760
  display: flex;
4770
4761
  align-items: center;
4771
4762
  justify-content: space-between;
@@ -4776,7 +4767,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4776
4767
  flex-direction: row;
4777
4768
  width: 498px;
4778
4769
  }
4779
- `,Lp=c.img`
4770
+ `,Mp=c.img`
4780
4771
  width: 80px;
4781
4772
  // height: 50px;
4782
4773
  object-fit: cover;
@@ -4784,7 +4775,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4784
4775
  aspect-ratio: 1;
4785
4776
  border-radius: 8px;
4786
4777
  border: 1.55px solid var(--base-border, #dedede);
4787
- `,Mp=c.div`
4778
+ `,Vp=c.div`
4788
4779
  display: flex;
4789
4780
  flex-direction: column;
4790
4781
  align-items: flex-start;
@@ -4804,7 +4795,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4804
4795
  @media (min-width: 768px) {
4805
4796
  max-width: 200px;
4806
4797
  }
4807
- `;const Vp=c.div`
4798
+ `;const jp=c.div`
4808
4799
  display: flex;
4809
4800
  width: 100%;
4810
4801
  justify-content: space-between;
@@ -4816,7 +4807,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4816
4807
  width: auto;
4817
4808
  flex-direction: row;
4818
4809
  }
4819
- `,jp=c.button`
4810
+ `,Wp=c.button`
4820
4811
  display: flex;
4821
4812
  justify-content: center;
4822
4813
  align-items: center;
@@ -4842,7 +4833,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4842
4833
  transform: scale(1.01);
4843
4834
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
4844
4835
  }
4845
- `,Wp=c.button`
4836
+ `,Hp=c.button`
4846
4837
  display: flex;
4847
4838
  justify-content: center;
4848
4839
  align-items: center;
@@ -4869,7 +4860,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4869
4860
  transform: scale(1.01);
4870
4861
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
4871
4862
  }
4872
- `,Hp={showPrice:!0,productImage:{id:"",path:""},buyNowCtaTitle:"BUY NOW",desktopBarType:"stretch",showProductName:!0,showBuyNowButton:!1,showProductImage:!0,addToCartCtaTitle:"ADD TO CART",showAddToCartButton:!0,showVariantSelector:!1,productInfoVisibility:!0,excludeProducts:[],showBarOnDesktop:!0,ctaButtonFontSize:18,startsAppearingAtHeight:200,fullyAppearsAtHeight:400,alwaysPersistent:!1},qp=({showStickyCart:o,product:a,addCartItem:l,onSetLoading:c,themeColor:s,cartData:d,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:g,addToStickyCart:x,cartComponentsCornerType:f,cartComponentsCornerRadius:y,themeTextColor:b,stickyCartCustomizationData:h,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:E,comboBundleAddToCartFunction:k,volumeBundleCurrentTier:T,volumeBundleData:S,volumeBundleAddToCartFunction:$})=>{const[B,N]=t(""),[I,z]=t(null),[F,D]=t({}),P=ir(),[A,_]=t(null),R=r(null);n(()=>{const e=e=>{R.current&&!R.current.contains(e.target)&&_(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const O=i((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},[]),L=i(()=>E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>O(E.products[0].productDetails,e?.node?.id)>0)?.node:a?.variants?.find(e=>e?.available),[E,a,O]),[M,V]=t(()=>{if(!E||"combo"!==E.type)return{};const e={};return E?.products?.forEach((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>O(t.productDetails,e?.node?.id)>0)?.node;o?e[n]=o.id:t?.productDetails?.variants?.edges?.length>0&&(e[n]=t.productDetails.variants.edges[0].node.id)}),e}),j=i(e=>{if(!E||"combo"!==E.type)return;const t={};E?.products?.forEach((n,o)=>{const r=n?.productDetails?.variants?.edges?.find(t=>{const o=t?.node;return n?.productDetails?.options?.every((t,n)=>{const r=e?.[t?.name],i=o?.title?.split(" / ")?.at(n);return!(!r||!i)&&r.trim().toLowerCase()===i.trim().toLowerCase()})});r?.node?.id&&(t[o]=r.node.id)}),Object.keys(t).length>0&&V(e=>({...e,...t}))},[E]);n(()=>{const e=L();if(e){N(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}else if(a?.variants?.length>0){const e=a.variants[0];N(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}},[a,L]);const W=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]),H=()=>{const e=W();if(e){const t=a?.variants?.find(t=>String(t?.id)===String(e));if(t&&t?.available){N(String(t.id)),z(t);const e={};a?.options?.forEach((n,o)=>{const r=`option${o+1}`;t?.[r]&&(e[n?.name]=t[r])}),D(e)}else{const e=L();e?(N(String(e.id)),z(e)):a?.variants?.length>0&&(N(String(a.variants[0].id)),z(a.variants[0]))}}};n(()=>{H();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",H),()=>{t=!1,window.removeEventListener("urlChange",H),window.history.pushState=n,window.history.replaceState=o}},[W,a,L]);const q=r(null),[Q,U]=t(1),Y=on(d,d?.currency),G=e.useMemo(()=>{if(!E||"combo"!==E.type)return null;const{price:e,compareAtPrice:t}=Object.entries(M).reduce((e,[t,n])=>{const o=E.products?.[Number(t)],r=o?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node,i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);return E?.percentageOff?o=e*(1-E.percentageOff/100):E?.dealAmount?o=E.dealAmount:E?.amountOff&&(o=e-E.amountOff),{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),savings:(n-o).toFixed(2),hasSavings:n>o}},[E,M]),X=e.useMemo(()=>{if(!T||!I)return null;const e=parseFloat(I.price??"0"),t=parseFloat(I.compare_at_price||e.toString()),n=tn(e,d?.currency),o=tn(t,d?.currency),r=T.minimumQuantity,i=Math.max(n,o)*r;let a=n*r;const l=S?.discountType||T.discountType;"percentOff"===l?a*=1-T.discountValue/100:"amountOff"===l&&(a-=T.discountValue);const c=Math.max(0,a);return{originalPrice:i.toFixed(2),dealPrice:c.toFixed(2),savings:(i-c).toFixed(2),hasSavings:i>c&&void 0!==l}},[T,S,I,d]);n(()=>{(async()=>{try{if(E&&"combo"===E.type)return;a&&B&&z(a?.variants?.filter(e=>String(e?.id)===String(B))[0])}catch(e){console.error("Error getting selected product variant id")}})()},[a,B,E]),n(()=>{const e=e=>{const t=e;t.detail?.selectedVariants&&V(t.detail.selectedVariants)};return window.addEventListener("yt-combo-bundle-updated",e),()=>{window.removeEventListener("yt-combo-bundle-updated",e)}},[]);const{cartLoading:Z}=Jt(),K=r(null),[J,ee]=t(0);n(()=>{K.current&&ee(K.current.offsetWidth)},[]);const te=a?.options?.find(e=>e?.name?.toLowerCase()?.includes("color"))?.name,ne=te?F?.[te]:null,oe=h&&(re=h,0!==Object.keys(re).length||re.constructor!==Object)?h:Hp;var re;const{showProductName:ie,showPrice:ae,showVariantSelector:le,showBuyNowButton:ce,showAddToCartButton:se,desktopBarType:de,showProductImage:pe,buyNowCtaTitle:ue,addToCartCtaTitle:me,productInfoVisibility:ge,showBarOnDesktop:xe,ctaButtonFontSize:fe,startsAppearingAtHeight:ye,fullyAppearsAtHeight:be,topRibbonText:he,alwaysPersistent:ve}=oe,[we,Ce]=t(ve?1:0),[Ee,ke]=t(ve?0:100),[Te,Se]=t(!1);if(n(()=>{if(ve)return Ce(1),void ke(0);const e=()=>{const e=window.scrollY;document.documentElement.scrollHeight;const t=ye||200,n=be||400;if(e>t){const o=Math.min((e-t)/(n-t),1);Ce(o),ke(100-100*o)}else Ce(0),ke(100)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[ve,ye,be]),n(()=>{const e=()=>{const e=window.innerWidth<768;Se(e||!1!==xe)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[xe]),a?.variants?.length<1)return null;const $e=a?.available??!0,Be=L(),Ne=E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>e?.node?.id===M?.[0])?.node?.price:I?.price??Be?.price??a?.variants?.[0]?.price;if(0===Number(Ne)&&(!E||"combo"!==E.type))return null;if(!o||!Te)return null;if(h?.excludeProducts?.includes(a?.handle))return null;const Ie=E&&"combo"===E.type?E.products?.every((e,t)=>{const n=M[t];return!!n&&O(e.productDetails,n)>0})??!1:I?.available??!0;return e.createElement(_p,{className:"yt-sticky-bar-container",$opacity:we,$translateY:Ee,$desktopBarType:de||"stretch"},e.createElement(Rp,{className:"yt-sticky-bar-inner-container",$desktopBarType:de||"stretch",$themeColor:s,$cornerType:f??"sharp",$cornerRadius:y??20,$themeTextColor:b,$productInfoVisibility:ge,$topRibbonText:he,$backgroundColor:w},ge&&e.createElement(Op,null,pe&&e.createElement(Lp,{className:"yt-sticky-bar-product-image",src:((e,t)=>"string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t?.featured_image)(I,a),alt:I?.name}),e.createElement(Mp,{ref:K,className:"yt-sticky-bar-product-details"},ie&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{style:{fontSize:"20px",fontWeight:"500",color:C,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",lineHeight:"normal"}},`${a?.title}`),ne&&e.createElement("span",{style:{fontSize:"11px",color:"#666",backgroundColor:"#f1f1f1",padding:"2px 6px",borderRadius:"10px",border:"1px solid #ddd"}},ne)),a?.variants?.length>1&&le&&e.createElement(Pp,{className:"yt-sticky-bar-option-container",ref:R},a?.options?.map(t=>{const n=P?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=F[t.name],r=A===t.name,i=e=>{((e,t)=>{const n={...F,[e]:t};D(n);const o=a?.variants?.find(e=>a?.options?.every((t,o)=>{const r=n?.[t?.name],i=e?.[`option${o+1}`];return"string"==typeof r&&"string"==typeof i?r.trim().toLowerCase()===i.trim().toLowerCase():r===i}));o&&(N(String(o.id)),z(o)),E&&"combo"===E?.type&&j(n)})(t.name,e),_(null)},l=rr(n,o);return e.createElement("div",{key:t.name,style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement(Ap,null,t.name),e.createElement($p,null,e.createElement(Bp,{onClick:()=>{_(r?null:t.name)},className:"yt-sticky-bar-dropdown-button"},"color"===n?.type&&l?.value?e.createElement(zp,{$colorValue:l.value}):"image"===n?.type&&l?.value?e.createElement(Fp,{src:l.value}):null,o,e.createElement(Dp,{size:8,$isOpen:r})),r&&e.createElement(Np,{$backgroundColor:w,className:"yt-sticky-bar-dropdown-panel"},t.values.map(t=>{const o=rr(n,t);return e.createElement(Ip,{className:"yt-sticky-bar-dropdown-item",key:t,onClick:()=>i(t)},"color"===n?.type&&o?.value?e.createElement(zp,{$colorValue:o.value}):"image"===n?.type&&o?.value?e.createElement(Fp,{src:o.value}):null,t)}))))})),ae&&e.createElement(e.Fragment,null,G?G.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Cp(G.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,Cp(G.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,Cp(G.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Cp(G.dealPrice)):X?X.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Cp(X.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,Cp(X.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,Cp(X.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Cp(X.dealPrice)):I?.compare_at_price&&I?.compare_at_price>I?.price?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,tn(I?.price,d?.currency)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,tn(I?.compare_at_price,d?.currency)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,tn(I?.compare_at_price-I?.price,d?.currency))):e.createElement(e.Fragment,null,e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,tn(I?.price,d?.currency)))),e.createElement("span",{style:{color:"#6E747B",fontSize:10},className:"yt-sticky-bar-product-tax-inclusion"},"Inclusive of all taxes"))),$e&&e.createElement(Vp,{className:"yt-sticky-bar-product-line-item-control",$flexDirection:ge?"row":"column"},se&&e.createElement(Wp,{ref:q,onClick:async()=>{if(E&&"combo"===E.type){if(!k)return void console.error("[StickyCart.tsx] comboBundleAddToCartFunction is undefined");const e=Object.entries(M);if(0===e.length)return;const t=e.map(([,e])=>e),n=e.map(([e,t])=>{const n=E?.products?.[Number(e)],o=n?.productDetails?.variants?.edges?.find(e=>e?.node?.id===t)?.node;return o?{variantId:t,price:Number(o?.price),compareAtPrice:Number(o?.compareAtPrice||o?.price)}:null}).filter(e=>null!==e),o=n.reduce((e,t)=>e+Math.max(t.compareAtPrice,t.price),0),r=n.reduce((e,t)=>e+t.price,0);let i=Math.min(o,r);E?.percentageOff?i=r*(1-E.percentageOff/100):E?.dealAmount?i=E.dealAmount:E?.amountOff&&(i=r-E.amountOff);const a=n.map(({variantId:e,price:t})=>({variantId:e,price:t}));try{await k(Number(o.toFixed(2)),t,Number(i.toFixed(2)),a)}catch(e){console.error("[StickyCart.tsx] Error adding combo bundle to cart:",e)}return}if(T&&T.minimumQuantity>1){if(!$)return void console.error("[StickyCart.tsx] volumeBundleAddToCartFunction is undefined");const e=String(B)??String(a?.variants[0]?.id),t=Array(T.minimumQuantity).fill(e),n=X?Number(X.originalPrice):0;try{await $(n,t)}catch(e){console.error("[StickyCart.tsx] Error adding volume bundle to cart:",e)}return}x&&await x(String(B)??String(a?.variants[0]?.id),Q)},disabled:Z.cartLoading||!Ie,$bgColor:Ie?m:"#d1d5db",$textColor:Ie?g:"#6b7280",className:"yt-sticky-add-to-cart-button",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:fe,style:{cursor:Ie?"pointer":"not-allowed",opacity:Ie?1:.6}},Z.cartLoading?e.createElement(rt,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,Ie?me??"Add to Cart":"Out of Stock")),ce&&e.createElement(jp,{onClick:async()=>{try{v&&await v(String(B)??String(a?.variants[0]?.id),Q)}catch(e){console.error("Error checking out from sticky bar")}},id:"yt-checkout-button",className:"yt-checkout-button",disabled:Z.cartLoading||!Ie,$bgColor:Ie?s:"#d1d5db",$textColor:Ie?b:"#6b7280",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:fe,style:{cursor:Ie?"pointer":"not-allowed",opacity:Ie?1:.6}},Z.cartLoading?e.createElement(rt,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,Ie?ue??"Buy Now":"Out of Stock")))))},Qp=c.div`
4863
+ `,qp={showPrice:!0,productImage:{id:"",path:""},buyNowCtaTitle:"BUY NOW",desktopBarType:"stretch",showProductName:!0,showBuyNowButton:!1,showProductImage:!0,addToCartCtaTitle:"ADD TO CART",showAddToCartButton:!0,showVariantSelector:!1,productInfoVisibility:!0,excludeProducts:[],showBarOnDesktop:!0,ctaButtonFontSize:18,startsAppearingAtHeight:200,fullyAppearsAtHeight:400,alwaysPersistent:!1},Qp=({showStickyCart:o,product:a,addCartItem:l,onSetLoading:c,themeColor:s,cartData:d,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:g,addToStickyCart:x,cartComponentsCornerType:f,cartComponentsCornerRadius:y,themeTextColor:b,stickyCartCustomizationData:h,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:E,comboBundleAddToCartFunction:k,volumeBundleCurrentTier:T,volumeBundleData:S,volumeBundleAddToCartFunction:$})=>{const[B,N]=t(""),[I,z]=t(null),[F,D]=t({}),P=ir(),[A,_]=t(null),R=r(null);n(()=>{const e=e=>{R.current&&!R.current.contains(e.target)&&_(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const O=i((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},[]),L=i(()=>E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>O(E.products[0].productDetails,e?.node?.id)>0)?.node:a?.variants?.find(e=>e?.available),[E,a,O]),[M,V]=t(()=>{if(!E||"combo"!==E.type)return{};const e={};return E?.products?.forEach((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>O(t.productDetails,e?.node?.id)>0)?.node;o?e[n]=o.id:t?.productDetails?.variants?.edges?.length>0&&(e[n]=t.productDetails.variants.edges[0].node.id)}),e}),j=i(e=>{if(!E||"combo"!==E.type)return;const t={};E?.products?.forEach((n,o)=>{const r=n?.productDetails?.variants?.edges?.find(t=>{const o=t?.node;return n?.productDetails?.options?.every((t,n)=>{const r=e?.[t?.name],i=o?.title?.split(" / ")?.at(n);return!(!r||!i)&&r.trim().toLowerCase()===i.trim().toLowerCase()})});r?.node?.id&&(t[o]=r.node.id)}),Object.keys(t).length>0&&V(e=>({...e,...t}))},[E]);n(()=>{const e=L();if(e){N(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}else if(a?.variants?.length>0){const e=a.variants[0];N(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}},[a,L]);const W=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]),H=()=>{const e=W();if(e){const t=a?.variants?.find(t=>String(t?.id)===String(e));if(t&&t?.available){N(String(t.id)),z(t);const e={};a?.options?.forEach((n,o)=>{const r=`option${o+1}`;t?.[r]&&(e[n?.name]=t[r])}),D(e)}else{const e=L();e?(N(String(e.id)),z(e)):a?.variants?.length>0&&(N(String(a.variants[0].id)),z(a.variants[0]))}}};n(()=>{H();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",H),()=>{t=!1,window.removeEventListener("urlChange",H),window.history.pushState=n,window.history.replaceState=o}},[W,a,L]);const q=r(null),[Q,U]=t(1),Y=on(d,d?.currency),G=e.useMemo(()=>{if(!E||"combo"!==E.type)return null;const{price:e,compareAtPrice:t}=Object.entries(M).reduce((e,[t,n])=>{const o=E.products?.[Number(t)],r=o?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node,i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);return E?.percentageOff?o=e*(1-E.percentageOff/100):E?.dealAmount?o=E.dealAmount:E?.amountOff&&(o=e-E.amountOff),{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),savings:(n-o).toFixed(2),hasSavings:n>o}},[E,M]),X=e.useMemo(()=>{if(!T||!I)return null;const e=parseFloat(I.price??"0"),t=parseFloat(I.compare_at_price||e.toString()),n=tn(e,d?.currency),o=tn(t,d?.currency),r=T.minimumQuantity,i=Math.max(n,o)*r;let a=n*r;const l=S?.discountType||T.discountType;"percentOff"===l?a*=1-T.discountValue/100:"amountOff"===l&&(a-=T.discountValue);const c=Math.max(0,a);return{originalPrice:i.toFixed(2),dealPrice:c.toFixed(2),savings:(i-c).toFixed(2),hasSavings:i>c&&void 0!==l}},[T,S,I,d]);n(()=>{(async()=>{try{if(E&&"combo"===E.type)return;a&&B&&z(a?.variants?.filter(e=>String(e?.id)===String(B))[0])}catch(e){console.error("Error getting selected product variant id")}})()},[a,B,E]),n(()=>{const e=e=>{const t=e;t.detail?.selectedVariants&&V(t.detail.selectedVariants)};return window.addEventListener("yt-combo-bundle-updated",e),()=>{window.removeEventListener("yt-combo-bundle-updated",e)}},[]);const{cartLoading:Z}=Jt(),K=r(null),[J,ee]=t(0);n(()=>{K.current&&ee(K.current.offsetWidth)},[]);const te=a?.options?.find(e=>e?.name?.toLowerCase()?.includes("color"))?.name,ne=te?F?.[te]:null,oe=h&&(re=h,0!==Object.keys(re).length||re.constructor!==Object)?h:qp;var re;const{showProductName:ie,showPrice:ae,showVariantSelector:le,showBuyNowButton:ce,showAddToCartButton:se,desktopBarType:de,showProductImage:pe,buyNowCtaTitle:me,addToCartCtaTitle:ge,productInfoVisibility:xe,showBarOnDesktop:fe,ctaButtonFontSize:ye,startsAppearingAtHeight:be,fullyAppearsAtHeight:he,topRibbonText:ve,alwaysPersistent:we}=oe,[Ce,Ee]=t(we?1:0),[ke,Te]=t(we?0:100),[Se,$e]=t(!1);if(n(()=>{if(we)return Ee(1),void Te(0);const e=()=>{const e=window.scrollY;document.documentElement.scrollHeight;const t=be||200,n=he||400;if(e>t){const o=Math.min((e-t)/(n-t),1);Ee(o),Te(100-100*o)}else Ee(0),Te(100)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[we,be,he]),n(()=>{const e=()=>{const e=window.innerWidth<768;$e(e||!1!==fe)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[fe]),a?.variants?.length<1)return null;const Be=a?.available??!0,Ne=L(),Ie=E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>e?.node?.id===M?.[0])?.node?.price:I?.price??Ne?.price??a?.variants?.[0]?.price;if(0===Number(Ie)&&(!E||"combo"!==E.type))return null;if(!o||!Se)return null;if(h?.excludeProducts?.includes(a?.handle))return null;const ze=E&&"combo"===E.type?E.products?.every((e,t)=>{const n=M[t];return!!n&&O(e.productDetails,n)>0})??!1:I?.available??!0;return e.createElement(Rp,{className:"yt-sticky-bar-container",$opacity:Ce,$translateY:ke,$desktopBarType:de||"stretch"},e.createElement(Op,{className:"yt-sticky-bar-inner-container",$desktopBarType:de||"stretch",$themeColor:s,$cornerType:f??"sharp",$cornerRadius:y??20,$themeTextColor:b,$productInfoVisibility:xe,$topRibbonText:ve,$backgroundColor:w},xe&&e.createElement(Lp,null,pe&&e.createElement(Mp,{className:"yt-sticky-bar-product-image",src:((e,t)=>"string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t?.featured_image)(I,a),alt:I?.name}),e.createElement(Vp,{ref:K,className:"yt-sticky-bar-product-details"},ie&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{style:{fontSize:"20px",fontWeight:"500",color:C,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",lineHeight:"normal"}},`${a?.title}`),ne&&e.createElement("span",{style:{fontSize:"11px",color:"#666",backgroundColor:"#f1f1f1",padding:"2px 6px",borderRadius:"10px",border:"1px solid #ddd"}},ne)),a?.variants?.length>1&&le&&e.createElement(Ap,{className:"yt-sticky-bar-option-container",ref:R},a?.options?.map(t=>{const n=P?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=F[t.name],r=A===t.name,i=e=>{((e,t)=>{const n={...F,[e]:t};D(n);const o=a?.variants?.find(e=>a?.options?.every((t,o)=>{const r=n?.[t?.name],i=e?.[`option${o+1}`];return"string"==typeof r&&"string"==typeof i?r.trim().toLowerCase()===i.trim().toLowerCase():r===i}));o&&(N(String(o.id)),z(o)),E&&"combo"===E?.type&&j(n)})(t.name,e),_(null)},l=rr(n,o);return e.createElement("div",{key:t.name,style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement(_p,null,t.name),e.createElement(Bp,null,e.createElement(Np,{onClick:()=>{_(r?null:t.name)},className:"yt-sticky-bar-dropdown-button"},"color"===n?.type&&l?.value?e.createElement(Fp,{$colorValue:l.value}):"image"===n?.type&&l?.value?e.createElement(Dp,{src:l.value}):null,o,e.createElement(Pp,{size:8,$isOpen:r})),r&&e.createElement(Ip,{$backgroundColor:w,className:"yt-sticky-bar-dropdown-panel"},t.values.map(t=>{const o=rr(n,t);return e.createElement(zp,{className:"yt-sticky-bar-dropdown-item",key:t,onClick:()=>i(t)},"color"===n?.type&&o?.value?e.createElement(Fp,{$colorValue:o.value}):"image"===n?.type&&o?.value?e.createElement(Dp,{src:o.value}):null,t)}))))})),ae&&e.createElement(e.Fragment,null,G?G.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Ep(G.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,Ep(G.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,Ep(G.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Ep(G.dealPrice)):X?X.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Ep(X.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,Ep(X.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,Ep(X.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,Ep(X.dealPrice)):I?.compare_at_price&&I?.compare_at_price>I?.price?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,tn(I?.price,d?.currency)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,tn(I?.compare_at_price,d?.currency)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,tn(I?.compare_at_price-I?.price,d?.currency))):e.createElement(e.Fragment,null,e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,tn(I?.price,d?.currency)))),e.createElement("span",{style:{color:"#6E747B",fontSize:10},className:"yt-sticky-bar-product-tax-inclusion"},"Inclusive of all taxes"))),Be&&e.createElement(jp,{className:"yt-sticky-bar-product-line-item-control",$flexDirection:xe?"row":"column"},se&&e.createElement(Hp,{ref:q,onClick:async()=>{if(E&&"combo"===E.type){if(!k)return void console.error("[StickyCart.tsx] comboBundleAddToCartFunction is undefined");const e=Object.entries(M);if(0===e.length)return;const t=e.map(([,e])=>e),n=e.map(([e,t])=>{const n=E?.products?.[Number(e)],o=n?.productDetails?.variants?.edges?.find(e=>e?.node?.id===t)?.node;return o?{variantId:t,price:Number(o?.price),compareAtPrice:Number(o?.compareAtPrice||o?.price)}:null}).filter(e=>null!==e),o=n.reduce((e,t)=>e+Math.max(t.compareAtPrice,t.price),0),r=n.reduce((e,t)=>e+t.price,0);let i=Math.min(o,r);E?.percentageOff?i=r*(1-E.percentageOff/100):E?.dealAmount?i=E.dealAmount:E?.amountOff&&(i=r-E.amountOff);const a=n.map(({variantId:e,price:t})=>({variantId:e,price:t}));try{await k(Number(o.toFixed(2)),t,Number(i.toFixed(2)),a)}catch(e){console.error("[StickyCart.tsx] Error adding combo bundle to cart:",e)}return}if(T&&T.minimumQuantity>1){if(!$)return void console.error("[StickyCart.tsx] volumeBundleAddToCartFunction is undefined");const e=String(B)??String(a?.variants[0]?.id),t=Array(T.minimumQuantity).fill(e),n=X?Number(X.originalPrice):0;try{await $(n,t)}catch(e){console.error("[StickyCart.tsx] Error adding volume bundle to cart:",e)}return}x&&await x(String(B)??String(a?.variants[0]?.id),Q)},disabled:Z.cartLoading||!ze,$bgColor:ze?m:"#d1d5db",$textColor:ze?g:"#6b7280",className:"yt-sticky-add-to-cart-button",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:ye,style:{cursor:ze?"pointer":"not-allowed",opacity:ze?1:.6}},Z.cartLoading?e.createElement(ue,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,ze?ge??"Add to Cart":"Out of Stock")),ce&&e.createElement(Wp,{onClick:async()=>{try{v&&await v(String(B)??String(a?.variants[0]?.id),Q)}catch(e){console.error("Error checking out from sticky bar")}},id:"yt-checkout-button",className:"yt-checkout-button",disabled:Z.cartLoading||!ze,$bgColor:ze?s:"#d1d5db",$textColor:ze?b:"#6b7280",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:ye,style:{cursor:ze?"pointer":"not-allowed",opacity:ze?1:.6}},Z.cartLoading?e.createElement(ue,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,ze?me??"Buy Now":"Out of Stock")))))},Up=c.div`
4873
4864
  width: 100%;
4874
4865
  height: 100%;
4875
4866
  display: flex;
@@ -4882,7 +4873,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4882
4873
  bottom: 0;
4883
4874
  z-index: 2147483644;
4884
4875
  pointer-events: none; /* Allow clicks to pass through to overlay */
4885
- `,Up=c.div`
4876
+ `,Yp=c.div`
4886
4877
  width: 100%;
4887
4878
  text-align: center;
4888
4879
  font-size: 18px;
@@ -4900,7 +4891,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4900
4891
  padding: 5px 0;
4901
4892
  font-size: 14px;
4902
4893
  }
4903
- `,Yp=c.div`
4894
+ `,Gp=c.div`
4904
4895
  position: relative;
4905
4896
  display: flex;
4906
4897
  flex-direction: column;
@@ -4948,13 +4939,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4948
4939
  `,c.label`
4949
4940
  font-size: 14px;
4950
4941
  color: #2d2d2d;
4951
- `;const Gp=c.div`
4942
+ `;const Xp=c.div`
4952
4943
  display: flex;
4953
4944
  justify-content: center;
4954
4945
  align-items: center;
4955
4946
  width: 100%;
4956
4947
  height: 150px;
4957
- `,Xp=c.div`
4948
+ `,Zp=c.div`
4958
4949
  display: flex;
4959
4950
  flex-direction: column;
4960
4951
  row-gap: 12px;
@@ -4973,7 +4964,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4973
4964
  padding: 12px 15px;
4974
4965
  row-gap: 10px;
4975
4966
  }
4976
- `,Zp=c.div`
4967
+ `,Kp=c.div`
4977
4968
  display: flex;
4978
4969
  flex-direction: row;
4979
4970
  width: 100%;
@@ -4991,7 +4982,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4991
4982
  gap: 10px;
4992
4983
  margin-bottom: 8px;
4993
4984
  }
4994
- `,Kp=c.div`
4985
+ `,Jp=c.div`
4995
4986
  flex-shrink: 0;
4996
4987
  width: 90px;
4997
4988
 
@@ -5003,7 +4994,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5003
4994
  @media (max-width: 480px) {
5004
4995
  width: 75px;
5005
4996
  }
5006
- `,Jp=c.img`
4997
+ `,eu=c.img`
5007
4998
  width: 90px;
5008
4999
  height: 90px;
5009
5000
  border-radius: 8px;
@@ -5020,12 +5011,12 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5020
5011
  width: 75px;
5021
5012
  height: 75px;
5022
5013
  }
5023
- `,eu=c.div`
5014
+ `,tu=c.div`
5024
5015
  display: flex;
5025
5016
  flex-direction: column;
5026
5017
  flex: 1;
5027
5018
  gap: 5px;
5028
- `,tu=c.a`
5019
+ `,nu=c.a`
5029
5020
  margin: 0 0 5px 0;
5030
5021
  font-size: 16px;
5031
5022
  font-weight: 500;
@@ -5052,12 +5043,12 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5052
5043
  font-size: 14px;
5053
5044
  margin: 0 0 3px 0;
5054
5045
  }
5055
- `,nu=c.div`
5046
+ `,ou=c.div`
5056
5047
  display: flex;
5057
5048
  flex-direction: row;
5058
5049
  align-items: center;
5059
5050
  gap: 4px;
5060
- `,ou=c.span`
5051
+ `,ru=c.span`
5061
5052
  font-weight: 600;
5062
5053
  font-size: 16px;
5063
5054
  color: ${e=>e.$primaryTextColor??"#1a1a1a"};
@@ -5070,7 +5061,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5070
5061
  @media (max-width: 480px) {
5071
5062
  font-size: 14px;
5072
5063
  }
5073
- `,ru=c.span`
5064
+ `,iu=c.span`
5074
5065
  text-decoration-line: line-through;
5075
5066
  color: #9b9c9d;
5076
5067
  font-size: 14px;
@@ -5104,7 +5095,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5104
5095
  justify-content: space-between;
5105
5096
  align-items: center;
5106
5097
  margin-top: 15px;
5107
- `;const iu=c.button`
5098
+ `;const au=c.button`
5108
5099
  width: 100%;
5109
5100
  padding: 16px;
5110
5101
  background: ${e=>e.$themeColor||"#C33"};
@@ -5146,7 +5137,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5146
5137
  align-items: flex-start;
5147
5138
  gap: 24px;
5148
5139
  width: 100%;
5149
- `;const au=c.div`
5140
+ `;const lu=c.div`
5150
5141
  display: flex;
5151
5142
  flex-direction: column;
5152
5143
  align-items: flex-start;
@@ -5170,7 +5161,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5170
5161
  `,c.div`
5171
5162
  display: flex;
5172
5163
  flex-wrap: wrap;
5173
- `;const lu=c.button`
5164
+ `;const cu=c.button`
5174
5165
  height: 23px;
5175
5166
  min-width: 35px;
5176
5167
  padding: 0 15px;
@@ -5205,7 +5196,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5205
5196
  min-width: 32px;
5206
5197
  font-size: 12px;
5207
5198
  }
5208
- `,cu=c.div`
5199
+ `,su=c.div`
5209
5200
  font-family: inherit;
5210
5201
  font-weight: 500;
5211
5202
  font-size: 13px;
@@ -5223,7 +5214,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5223
5214
  @media (max-width: 480px) {
5224
5215
  font-size: 12px;
5225
5216
  }
5226
- `,su=c.span`
5217
+ `,du=c.span`
5227
5218
  font-weight: 400;
5228
5219
  font-size: 12px;
5229
5220
  color: #333;
@@ -5246,13 +5237,13 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5246
5237
  @media (max-width: 480px) {
5247
5238
  font-size: 12px;
5248
5239
  }
5249
- `;const du=c.div`
5240
+ `;const pu=c.div`
5250
5241
  display: flex;
5251
5242
  flex-wrap: wrap;
5252
5243
  width: 100%;
5253
5244
  gap: 2px;
5254
5245
  margin-top: 8px;
5255
- `,pu=c.div`
5246
+ `,uu=c.div`
5256
5247
  display: flex;
5257
5248
  flex-direction: row;
5258
5249
  justify-content: space-between;
@@ -5269,7 +5260,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5269
5260
  @media (max-width: 480px) {
5270
5261
  margin-top: 3px;
5271
5262
  }
5272
- `,uu=c.button`
5263
+ `,mu=c.button`
5273
5264
  border-radius: 50%;
5274
5265
  padding: 2px;
5275
5266
  background-color: ${({$colorValue:e})=>e||"transparent"};
@@ -5284,7 +5275,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5284
5275
  &:hover {
5285
5276
  border-color: ${({$themeColor:e})=>e||"#000"};
5286
5277
  }
5287
- `,mu=c.button`
5278
+ `,gu=c.button`
5288
5279
  border-radius: 50%;
5289
5280
  padding: 2px;
5290
5281
  background-color: transparent;
@@ -5300,4 +5291,4 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
5300
5291
  &:hover {
5301
5292
  border-color: ${({$themeColor:e})=>e||"#000"};
5302
5293
  }
5303
- `,gu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=ie(en),w=ae(Ut),C=r(null),[E,k]=t(null),[T,S]=t(!1),[$,B]=t({}),[N,I]=t(h?.variantId),[z,F]=t(h?.quantity||1),[D,P]=t(!1),A=ir();n(()=>{h?.open?setTimeout(()=>{P(!0)},10):P(!1)},[h?.open]);n(()=>{(async()=>{if(!E&&l&&h?.variantId&&h?.handle){const e=await l(h.handle,h.variantId);if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){I(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),B(n)}else I(void 0),B({})}k(e)}})()},[E,l,h]);const _=(e,t)=>{const n={...$,[e]:t};B(n);const o=E?.variants?.find(e=>E.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&I(String(o.id))}},R=E?.variants?.find(e=>String(e.id)===String(N)),O=on(w,w?.currency),L=o(()=>{const e={};if(!E)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return E.options.forEach(n=>{e[n.name]=n.values.filter(e=>E.variants.filter(o=>{const r=E.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!E.options.every((e,t)=>{if(e.name===n.name)return!0;const r=$[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[E,$,h]);return E?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{P(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Qp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Yp,{ref:C,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Up,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(Xp,null,e.createElement(Zp,null,e.createElement(Kp,null,e.createElement(Jp,{src:R?.featured_image?.src??E?.featured_image,alt:R?.featured_image?.alt??E?.title})),e.createElement(eu,null,e.createElement(tu,{$themeColor:c,$primaryTextColor:y,href:`${E?.url}?variant=${R?.id}`},E?.title),e.createElement(pu,null,e.createElement(nu,null,e.createElement(ou,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(ru,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Ko,{value:z,handleItemQuantityIncrement:async()=>{F(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&F(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:f})))),E?.options?.map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(au,{key:t.name},e.createElement(cu,null,e.createElement("span",null,"Select ",t.name),$[t.name]&&e.createElement(su,null,$[t.name])),e.createElement(du,null,L[t.name]?.map(o=>{const r=$[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(uu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(mu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(lu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(iu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(N&&a){S(!0);try{await a(N,z,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}S(!1)}}:async()=>{if(!N)return;const e=!!h?.lineItemKey,t=String(N)!==String(h?.variantId);if(!e||t){S(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(N,h.allowedVariantIds):e&&m?await m(N,h.allowedVariantIds):a&&N&&await a(N,z,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!N||T},T?e.createElement(rt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Qp,{ref:b},e.createElement(Yp,{style:{backgroundColor:p||"white"}},e.createElement(Gp,null,e.createElement(it,{color:c||"#868E96"}))))});gu.displayName="DesktopVariantPopup";const xu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=ie(en),w=ae(Ut),[C,E]=t(null),[k,T]=t(!1),[S,$]=t({}),[B,N]=t(h?.variantId),[I,z]=t(h?.quantity||1),F=r(null),D=ir(),[P,A]=t(!1);n(()=>{h?.open?setTimeout(()=>{A(!0)},10):A(!1)},[h?.open]);n(()=>{(async()=>{if(!C&&l&&h?.variantId&&h?.handle)try{const e=await l(h.handle,h.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){N(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),$(n)}else N(void 0),$({})}E(e)}catch(e){}})()},[C,l,h]),n(()=>{},[p,i,a,l]);const _=(e,t)=>{const n={...S,[e]:t};$(n);const o=C?.variants?.find(e=>C.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&N(String(o.id))}},R=C?.variants?.find(e=>String(e.id)===String(B)),O=on(w,w?.currency),L=o(()=>{const e={};if(!C)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(o=>{const r=C.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const r=S[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,S,h]);return C?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{A(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Qp,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Yp,{ref:F,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Up,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(Xp,null,e.createElement(Zp,null,e.createElement(Kp,null,e.createElement(Jp,{src:R?.featured_image?.src??C?.featured_image,alt:R?.featured_image?.alt??C?.title})),e.createElement(eu,null,e.createElement(tu,{$themeColor:c,$primaryTextColor:y,href:`${C?.url}?variant=${R?.id}`},C?.title),e.createElement(pu,null,e.createElement(nu,null,e.createElement(ou,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(ru,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Ko,{value:I,handleItemQuantityIncrement:async()=>{z(e=>e+1)},handleItemQuantityDecrement:async()=>{I>1&&z(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:f})))),C?.options?.map(t=>{const n=D?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(au,{key:t.name},e.createElement(cu,null,e.createElement("span",null,"Select ",t.name,":"),S[t.name]&&e.createElement(su,null,S[t.name])),e.createElement(du,null,L[t.name]?.map(o=>{const r=S[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(uu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(mu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(lu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(iu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(B&&a){T(!0);try{await a(B,I,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!B)return;const e=!!h?.lineItemKey,t=String(B)!==String(h?.variantId);if(!e||t){T(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(B,h.allowedVariantIds):e&&m?await m(B,h.allowedVariantIds):a&&B&&await a(B,I,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||k},k?e.createElement(rt,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Qp,{ref:b},e.createElement(Yp,{style:{backgroundColor:p||"white"}},e.createElement(Gp,null,e.createElement(it,{color:c||"#868E96"}))))});const fu=({setIsCartOpen:t,isCartOpen:n,cartCheckpoints:o,customCartProgressBarCriteria:r,floatingCartData:i,effectiveQuantityForProgressBar:a,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const s=ae(Ut),d=i?.bannerFooterText,p="string"==typeof d&&d.trim().length>0,u=!n&&(e=>{try{if("undefined"==typeof window)return!1;const t=window.location.pathname||"/";if("/"===t||""===t)return!0;const n=e?.showOnPages;if(!Array.isArray(n)||0===n.length)return!1;const o=t.toLowerCase(),r=o.endsWith("/")?o:`${o}/`;return n.some(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim().toLowerCase().replace(/^\/|\/$/g,"");if(!t)return!1;const n=`/${t}/`;return r.includes(n)})}catch{return!1}})(i),m=s?.item_count??0,g=tn(s?.items_subtotal_price??0,s?.currency??"INR"),x=on(s),f=function(e,t,n,o,r){if(!e||0===e.length)return{deltaValue:0,show:!1};const i=(t??"minimum_order_value").toLowerCase(),a="quantity_threshold"===i?"number"==typeof r?r:o:n,l=[...e].sort((e,t)=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===i?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)>a);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===i?l.quantityThreshold:l.minimumOrderValue,s=Math.max(0,c-a);return{deltaValue:s,show:s>0,isQuantity:"quantity_threshold"===i}}(o,r,g,m,a),y="sharp"===l?0:c??12,h=i?.textColor??"#111",v=i?.backgroundColor??"#FF7E6E",w=i?.bannerBackgroundColor??"#FFE0DC",C=i?.buttonColor??"#E8513F",E=e.useRef(null);e.useEffect(()=>{pn(E.current)},[C]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},T={background:"#FFFFFF",color:"#111",padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},S={background:"#fff",color:h,borderRadius:y,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},$={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:w,color:h,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},B={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:v,cursor:"pointer"},N={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:h},I={fontSize:12,color:h,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},z={padding:"5px 10px",background:C,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!f.show)return null;const t=f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} to get freebie`;return e.createElement("div",{style:k},e.createElement("div",{className:"yt-cart-floating-ribbon",style:T},e.createElement(b,{"aria-hidden":!0}),e.createElement("span",null,t)))}const F=1===m?"1 item":`${m} items`,D=i?.lastTierUnlockedText||"Best tier unlocked",P=f.show?f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} more to get freebie`:D;return e.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},e.createElement("div",{style:{position:"relative"}},(f.show||o&&o.length>0)&&e.createElement("div",{className:"yt-cart-floating-banner",style:$},e.createElement(b,{"aria-hidden":!0,style:{marginBottom:7}}),e.createElement("span",{style:{display:"inline-block",marginBottom:7}},P)),e.createElement("div",{style:S},e.createElement("div",{className:"yt-cart-floating-body",style:B,onClick:()=>t(!0)},e.createElement(_,{width:24,height:24,color:h}),e.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},e.createElement("div",{style:N},e.createElement("span",null,x,un(g.toFixed(0))),e.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},F)),p?e.createElement("span",{style:I,title:d},d):null),e.createElement("button",{ref:E,style:z,onClick:()=>t(!0),"aria-label":"View Cart"},"View Cart")))))},yu=({exploreCTAColor:o,checkoutFontSize:i,handleDecrement:l,handleIncrement:c,removeCartItem:s,addCartItem:d,cartTitle:p,emptyCartTitle:u,emptyCartDescription:m,emptyCartButtons:g,backgroundColor:x,backgroundSubdued:f,tertiaryColor:y,tertiaryTextColor:b,backdrop:h=!0,cartData:v,isUserSignedIn:w,showBundle:C,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:N,applyDiscount:I,discountApplied:z,checkoutFunction:F,joinNowFunction:D,guestLoyaltyPercentage:P,showToggleButton:A,isOpen:_,setIsOpen:R,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:V,cartCheckpoints:j,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:K,checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:re,secondaryTextColor:ae,showProductRecsOnDesktop:ce,showProductRecsOnMobile:se,themeColor:de,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,showNoteOption:Ee,applyNoteToCart:ke,note:Te,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ne,getProductDetailsByVariantId:Ie,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:De,currentTier:Pe,freebieProductsInCart:Ae,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:Ve,postalCodeList:je,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,showStickyAddToCart:Ge,stickyCartLineItem:Xe,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,enableCustomCartOnCartPage:rt,isCartPage:it,progressBarFreeProductIconType:at,addToStickyCart:lt,productRecsCardLayout:ct,productRecsCardListVariant:st,showCartTimer:dt,showFreebieMilestone:pt,showFloatingCart:ut,floatingCartData:mt,freebieMilestoneData:gt,cartTimerInMinutes:xt,cartTimerCustomText:ft,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,stickyCartCustomizationData:vt,cartOffersCarousalData:wt,stickyBarBuyNowFunction:Ct,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:Nt,brandTokenName:It,showDiscountOnMRP:zt,prefixMessageText:Ft,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,applyCouponCode:Vt,showApplyCoupon:jt,enableConfetti:Wt,showCheckoutButtonPaymentIcons:Ht=!0,showCouponOptions:qt,rewardCoupons:Qt,comboBundleData:Yt,comboBundleAddToCartFunction:Gt,stealDealCheckpoints:Xt,stealDealProducts:Zt,stealDealAddToCart:Kt,useCartShell:Jt,showTrustedBadge:tn,trustedBadgeData:nn})=>{const on=le(Ut),[rn,an]=ie(en),[ln,cn]=ie(Vi),sn=()=>R(!_),[dn,pn]=t(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});n(()=>{const e=e=>{const t=e.detail;pn({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const un=dn.comboBundleData??Yt,mn=dn.comboBundleAddToCartFunction??Gt,[gn,xn]=t(()=>{const e=window.ytVolumeBundle;return{bundle:e?.bundle??void 0,currentTier:e?.currentTier??void 0,volumeBundleAddToCartFunction:e?.addToCart??void 0}});n(()=>{const e=e=>{const t=e.detail;xn({bundle:t?.bundle??void 0,currentTier:t?.tierData??void 0,volumeBundleAddToCartFunction:t?.addToCart??void 0})};return window.addEventListener("yt-volume-bundle-updated",e),()=>window.removeEventListener("yt-volume-bundle-updated",e)},[]);const fn=r(null),yn=r(0);a(()=>{if(v){const e=v?.token??null,t="number"==typeof v?.cartUpdatedAtMs?v.cartUpdatedAtMs:void 0;e!==fn.current&&(fn.current=e,yn.current=t??0);const n=yn.current;if(!(void 0===t||t>=n))return;void 0!==t&&(yn.current=t),on(v)}},[v]);const bn=r(null);n(()=>{function e(e){bn.current&&!bn.current.contains(e.target)&&(an({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),cn({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[hn,vn]=t(!1);return n(()=>{const e=()=>{vn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{if(!Jt)return;const e=window.ytCartShell;if(!e)return;const t=e.getDrawerElement?.(),n=e.getOverlayElement?.();t&&(!_||rt&&it?(t.style.setProperty("transform","translateX(100%)","important"),t.style.boxShadow="none",n&&(n.style.display="none"),document.body.classList.remove("drawer-open")):(t.style.setProperty("transform","translateX(0)","important"),t.style.boxShadow="-14px 8px 14.4px 0px rgba(0, 0, 0, 0.35)",h&&n&&(n.style.display="block"),document.body.classList.add("drawer-open")))},[_,Jt,rt,it,h]),n(()=>{if(!Jt)return;const e=window.ytCartShell,t=e?.getOverlayElement?.();if(!t)return;const n=()=>R(!1);return t.addEventListener("click",n),()=>t.removeEventListener("click",n)},[Jt,R]),e.createElement(e.Fragment,null,e.createElement("div",{style:{position:rt&&it?"relative":"absolute",width:"100%",display:rt&&it?"flex":"block",alignItems:"center",justifyContent:"center"}},A&&!(rt&&it)&&e.createElement("button",{style:{margin:"16px"},onClick:sn},_?"Close Drawer":"Open Drawer"),!Jt&&_&&h&&!(rt&&it)&&e.createElement("div",{onClick:sn,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},"‎"),e.createElement(Nl,{useCartShell:Jt,isCartPage:it,enableCustomCartOnCartPage:rt,isOpen:_,setIsOpen:R,backgroundColor:x,backgroundSubdued:f??"#F5F5F5",tertiaryColor:y,tertiaryTextColor:b,exploreCTAColor:o,checkoutFontSize:i,cartTitle:p,handleDecrement:l,handleIncrement:c,removeCartItem:s,addCartItem:d,emptyCartTitle:u,emptyCartButtons:g,emptyCartDescription:m,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:N,applyDiscount:I,discountApplied:z,checkoutFunction:F,joinNowFunction:D,guestLoyaltyPercentage:P,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:V,cartCheckpoints:j,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:K??"minimum_order_value",checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:re,secondaryTextColor:ae,showProductRecsOnDesktop:ce,showProductRecsOnMobile:se,themeColor:de,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,applyNoteToCart:ke,note:Te,showNoteOption:Ee,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ne,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:De,currentTier:Pe,freebieProductsInCart:Ae,cartOffersCarousalData:wt,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:Ve,postalCodeList:je,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,progressBarFreeProductIconType:at,productRecsCardLayout:ct,productRecsCardListVariant:st,showCartTimer:dt,showFreebieMilestone:pt,freebieMilestoneData:gt,cartTimerCustomText:ft,cartTimerInMinutes:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:Nt,getProductDetailsByVariantId:Ie,brandTokenName:It,showDiscountOnMRP:zt??!0,prefixMessageText:Ft,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,applyCouponCode:Vt,showApplyCoupon:jt,enableConfetti:Wt,showCheckoutButtonPaymentIcons:Ht,stealDealCheckpoints:Xt,stealDealProducts:Zt,stealDealAddToCart:Kt,showCouponOptions:qt,rewardCoupons:Qt,showTrustedBadge:tn,trustedBadgeData:nn}),Ge&&Xe&&d&&e.createElement(qp,{showStickyCart:Ge,stickyCartCustomizationData:vt,product:Xe,addCartItem:d,onSetLoading:ze,themeColor:de,themeTextColor:pe,cartData:v,isCartOpen:_,setIsCartOpen:R,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,addToStickyCart:lt,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,checkoutFunction:Ct,backgroundColor:x,primaryTextColor:ne,comboBundleData:un,comboBundleAddToCartFunction:mn,volumeBundleCurrentTier:gn.currentTier,volumeBundleData:gn.bundle,volumeBundleAddToCartFunction:gn.volumeBundleAddToCartFunction}),hn&&rn.open&&e.createElement(gu,{backgroundColor:x,ref:bn,isDev:O,removeCartItem:s,addCartItem:d,getProductDetailsByVariantId:Ie,themeColor:de,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,removeFreebieFromCart:Ve,freebieClaimAddToCart:Re,stealDealAddToCart:Kt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne}),!hn&&rn.open&&e.createElement(xu,{ref:bn,isDev:O,removeCartItem:s,addCartItem:d,getProductDetailsByVariantId:Ie,themeColor:de,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,backgroundColor:x,removeFreebieFromCart:Ve,freebieClaimAddToCart:Re,stealDealAddToCart:Kt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne})),!hn&&ut&&e.createElement(fu,{isCartOpen:_,setIsCartOpen:R,cartCheckpoints:j,customCartProgressBarCriteria:K,floatingCartData:mt,effectiveQuantityForProgressBar:Le,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt}))};gt(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const bu=()=>e.createElement("div",{className:"scene"},e.createElement("div",{className:"floating"},e.createElement("div",{className:"cube"},e.createElement("div",{className:"side front"},"‎"),e.createElement("div",{className:"side back"},"‎"),e.createElement("div",{className:"side left"},"‎"),e.createElement("div",{className:"side right"},"‎"),e.createElement("div",{className:"side bottom"},"‎"),e.createElement("div",{className:"lid"},e.createElement("div",{className:"flap north"},"‎"),e.createElement("div",{className:"flap south"},"‎"),e.createElement("div",{className:"flap east"},"‎"),e.createElement("div",{className:"flap west"},"‎"))))),hu=({config:t,brandConfig:n})=>{const{heroDesktopImage:o,heroMobileImage:r,heroTitle:i="ZERO WASTE PREMIUM PET CARE",heroSubtitle:a="Earn Doglycoins for exclusive rewards every time you shop.",heroTextAlignment:l="left",heroSubtitleFontSize:c="18px",heroSubtitleColor:s="#000000",heroSubtitleFontWeight:d="400",heroTitleFontSize:p="48px",heroTitleColor:u="#000000",heroRegistrationCTAVisibility:m=!0,primaryColor:g="#1C1C1D",primaryContrastColor:x="#FFFFFF",secondaryColor:f="#FFFFFF",secondaryContrastColor:y="#000000",accentColor:b="#FFFFFF",borderColor:N="#E5E5E5",themeRoundness:I="0px",heroBannerVisibility:z="show",stepsVisibility:F="show",waysToEarnVisibility:D="show",waysToEarnCustomText:P="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",customSectionVisibility:A="show",footerSignupVisibility:_="show",customSectionImagePosition:R="left",customSectionTitle:O="Earn Doglycoins every time you shop",customSectionSubtitle:L="Collect more Doglycoins by entering your birthday, following us on social or referring a friend (details below)\n\nRedeem your Doglycoins for cash off at checkout by signing in or creating an account. Did you shop without registering? No worries, your Credits have been saved for you",customSectionTitleFontSize:M="36px",customSectionSubtitleFontSize:V="18px",customSectionImage:j,customSectionTextAlignment:W="left",customSectionTitleColor:H="#000000",customSectionSubtitleColor:q="#000000",stepsTitle:Q="Getting started is easy",stepsSubtitle:U="Earn Stars and get rewarded in a few easy steps.",step1Title:Y="CREATE AN ACCOUNT",step1Description:G="To get started, Join Now. You can also register on the mobile app to get access to the full range of reward benefits",step2Title:X="ORDER AND EARN REWARDS POINTS",step2Description:Z="Use cash, credit/debit card or save some time and pay right through the app. You'll collect Stars all ways.",step3Title:K="UNLOCK REWARDS AND OFFERS",step3Description:J="As you earn Stars, you can redeem them for Rewards—like free food, drinks, and more. Start redeeming with as little as 25 Stars!",footerCustomText:ee="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",footerSignupSubtext:te="Use your points to redeem samples and more."}=t||{},ne="undefined"!=typeof window&&window.innerWidth<=768,oe=e=>e&&e.startsWith("//")?`https:${e}`:e,re={padding:"12px 32px",borderRadius:"30px",fontSize:"14px",fontWeight:600,cursor:"pointer",textTransform:"uppercase",border:`1px solid ${g}`,transition:"all 0.3s ease"},ie={...re,backgroundColor:g,color:x,borderColor:g},ae={...re,backgroundColor:f,color:y,borderColor:N},{newSignupTokens:le,firstOrderTokens:ce,instagramFollowPoints:se,twitterFollowPoints:de,facebookFollowPoints:pe,youtubeSubscriptionPoints:ue,rewardToLeaveReview:me,birthdayPoints:ge,referralPointsForReferrer:xe,tokenCreditPercentage:fe,brandTokenName:ye}=n||{},be=[...le?[{icon:e.createElement(h,null),title:`${le} ${ye}`,subtitle:"Create an account"}]:[],...ce?[{icon:e.createElement(v,null),title:`${ce} ${ye}`,subtitle:"Place your first order"}]:[],...fe?[{icon:e.createElement(v,null),title:`${fe}% ${ye}`,subtitle:`Earn ${fe}% back on every order`}]:[],...xe?[{icon:e.createElement(w,null),title:`${xe} ${ye}`,subtitle:"Refer a friend and get"}]:[],...ge?[{icon:e.createElement(C,null),title:`${ge} ${ye}`,subtitle:"Get on your birthday to spend"}]:[],...me?[{icon:e.createElement(E,null),title:`${me} ${ye}`,subtitle:"Write a Review"}]:[],...pe?[{icon:e.createElement(k,null),title:`${pe} ${ye}`,subtitle:"Like on Facebook"}]:[],...se?[{icon:e.createElement(T,null),title:`${se} ${ye}`,subtitle:"Follow on Instagram"}]:[],...de?[{icon:e.createElement(S,null),title:`${de} ${ye}`,subtitle:"Follow on Twitter"}]:[],...ue?[{icon:e.createElement($,null),title:`${ue} ${ye}`,subtitle:"Subscribe on YouTube"}]:[]];return e.createElement("div",{className:"yt-loyalty-page-container",style:{fontFamily:"'Poppins', sans-serif",width:"100%",overflow:"hidden"}},"show"===z&&e.createElement("div",{className:"yt-loyalty-page-hero",style:{position:"relative",minHeight:"500px",display:"flex",alignItems:"center",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start",backgroundImage:`url(${oe(ne&&r?r:o)})`,backgroundSize:"cover",backgroundPosition:"center",padding:ne?"40px 20px":"60px 80px"}},e.createElement("div",{className:"yt-loyalty-page-hero-content",style:{maxWidth:"600px",zIndex:2,textAlign:l}},e.createElement("h1",{className:"yt-loyalty-page-hero-title",style:{fontSize:ne?"32px":p,color:u,marginBottom:"16px",lineHeight:1.1,fontWeight:800,textTransform:"uppercase"}},i),e.createElement("p",{className:"yt-loyalty-page-hero-subtitle",style:{fontSize:c,color:s,fontWeight:Number(d)||400,marginBottom:"32px"}},a),m&&e.createElement("div",{className:"yt-loyalty-page-hero-button-wrapper",style:{display:"flex",gap:"16px",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start"}},e.createElement("button",{className:"yt-loyalty-page-hero-button",style:ie,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"Join Now")))),"show"===F&&e.createElement("div",{className:"yt-loyalty-page-steps",style:{padding:"40px 20px",position:"relative",textAlign:"center"}},e.createElement("div",{className:"yt-loyalty-page-steps-background-text",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"GETTING STARTED"),e.createElement("div",{className:"yt-loyalty-page-steps-content",style:{position:"relative",zIndex:1}},e.createElement("h2",{className:"yt-loyalty-page-steps-title",style:{fontSize:"32px",fontWeight:700,marginBottom:"8px",color:"#000"}},Q),e.createElement("p",{className:"yt-loyalty-page-steps-subtitle",style:{color:g,marginBottom:"24px"}},U),e.createElement("div",{className:"yt-loyalty-page-steps-grid",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"center",gap:"40px",maxWidth:"1200px",margin:"0 auto"}},[{icon:e.createElement(v,null),title:Y,desc:G},{icon:e.createElement(B,null),title:X,desc:Z},{icon:e.createElement(C,null),title:K,desc:J}].map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-step-item",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{className:"yt-loyalty-page-step-icon",style:{width:"80px",height:"80px",borderRadius:"50%",border:"4px solid #ccc",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"32px",color:"#666",marginBottom:"12px"}},t.icon),e.createElement("div",{className:"yt-loyalty-page-step-title",style:{fontSize:"16px",fontWeight:700,color:g,textTransform:"uppercase",lineHeight:"normal"}},t.title),e.createElement("p",{className:"yt-loyalty-page-step-description",style:{fontSize:"13px",color:g,lineHeight:1.2,maxWidth:"300px"}},t.desc)))))),"show"===D&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn",style:{padding:"40px 20px",position:"relative",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-background-text",style:{position:"absolute",top:ne?"10%":"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"WAYS TO EARN"),e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-grid",style:{position:"relative",zIndex:1,maxWidth:"1000px",margin:"0 auto",display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"12px"}},be.map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-ways-to-earn-item",style:{width:ne?"100%":"220px",border:"2px solid #ddd",padding:"12px 8px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",borderRadius:I,boxShadow:"-1px 2px 3px rgba(0,0,0,0.1)"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-icon",style:{fontSize:"32px",marginBottom:"4px",color:"#1a1a2e"}},t.icon),e.createElement("h3",{className:"yt-loyalty-page-ways-to-earn-title",style:{fontSize:"13px",fontWeight:700,marginBottom:"2px",textTransform:"uppercase",color:"#000"}},t.title),e.createElement("p",{className:"yt-loyalty-page-ways-to-earn-subtitle",style:{fontSize:"11px",color:"#666"}},t.subtitle)))),P&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-custom-text",style:{maxWidth:"1000px",margin:"24px auto 0",backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},P)),"show"===A&&e.createElement("div",{className:"yt-loyalty-page-custom-section",style:{padding:ne?"40px 0px":"40px 20px",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-container",style:{maxWidth:"1200px",margin:"0 auto",display:"flex",flexDirection:ne?"column":"row",alignItems:"center",gap:"40px",borderRadius:I,overflow:"hidden",backgroundColor:"#F9F9F9"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image-wrapper",style:{flex:1,width:"100%",order:ne||"left"===R?0:1}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image",style:{display:"flex",width:"100%",height:"300px",backgroundColor:"#ddd",backgroundImage:j?`url(${oe(j)})`:o?`url(${oe(o)})`:void 0,backgroundSize:"cover",backgroundPosition:"center"}})),e.createElement("div",{className:"yt-loyalty-page-custom-section-content",style:{flex:1,paddingInline:ne?"20px":"10px",textAlign:ne?"center":W,order:ne||"left"===R?1:0,marginBottom:ne?"20px":"0px"}},e.createElement("h2",{className:"yt-loyalty-page-custom-section-title",style:{fontSize:M,fontWeight:700,marginBottom:"16px",color:H}},O),e.createElement("p",{className:"yt-loyalty-page-custom-section-subtitle",style:{fontSize:V,color:q,marginBottom:"24px",lineHeight:1.6,whiteSpace:"pre-line"}},L)))),"show"===_&&e.createElement("div",{className:"yt-loyalty-page-footer",style:{marginBottom:"20px"}},e.createElement("div",{className:"yt-loyalty-page-footer-container",style:{maxWidth:"1200px",margin:"0 auto"}},e.createElement("div",{className:"yt-loyalty-page-footer-custom-text",style:{backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},ee),e.createElement("div",{className:"yt-loyalty-page-footer-signup",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"space-between",alignItems:"center",marginTop:"40px",padding:"20px",border:"1px solid #eee",borderRadius:"4px",gap:"20px",textAlign:ne?"center":"left"}},e.createElement("div",{className:"yt-loyalty-page-footer-signup-content"},e.createElement("h3",{style:{fontSize:"20px",fontWeight:700,marginBottom:"4px",color:"#000",textAlign:ne?"center":"left"}},"Rewards Program"),e.createElement("p",{style:{fontSize:"14px",color:"#666"}},te)),e.createElement("button",{className:"yt-loyalty-page-footer-signup-button",style:ae,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"JOIN NOW")))))},vu=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const s=o._customOffer,d=s?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:i},e.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"16px",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(Ve,null)),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},o.name),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),d&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"16px",padding:"12px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"clamp(16px, 4vw, 18px)",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},d),e.createElement("button",{onClick:async()=>{if(d)try{await navigator.clipboard.writeText(d),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"20px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(N,null):e.createElement(I,null))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),e.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},e.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),e.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return A(p,document.body)},wu=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const s=o._customOffer,d=s?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:i},e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),e.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),e.createElement("div",{style:{overflowY:"auto",flex:1}},e.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},e.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(Ve,null)),e.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},o.name),e.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),d&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"20px",padding:"14px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"18px",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},d),e.createElement("button",{onClick:async()=>{if(d)try{await navigator.clipboard.writeText(d),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"22px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(N,null):e.createElement(I,null)))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},e.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),e.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},e.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t)))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return A(p,document.body)},Cu=({offersToShow:o,offersConfig:i,getOfferCardMessage:a,setSelectedOffer:l,setShowPopup:c})=>{const s=r(null),[d,p]=t(!1),[u,m]=t(!0),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=768),f=()=>{if(s.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=s.current;p(e>0),m(e<t-n-10)}};n(()=>{f();const e=s.current;if(e)return e.addEventListener("scroll",f),()=>e.removeEventListener("scroll",f)},[o]),n(()=>{const e=()=>{x(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const y=e=>{if(s.current){const t=g?280:365,n=16,o="right"===e?t+n:-(t+n);s.current.scrollBy({left:o,behavior:"smooth"})}};return e.createElement("div",{style:{position:"relative"}},e.createElement("svg",{style:{position:"absolute",width:0,height:0}},e.createElement("defs",null,e.createElement("mask",{id:"coupon-cut-mask-desktop"},e.createElement("rect",{width:"365",height:"138",fill:"white"}),e.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),e.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),e.createElement("mask",{id:"coupon-cut-mask-mobile"},e.createElement("rect",{width:"280",height:"120",fill:"white"}),e.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),e.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),d&&e.createElement("button",{onClick:()=>y("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(z,{size:20})),u&&e.createElement("button",{onClick:()=>y("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(F,{size:20})),e.createElement("div",{ref:s,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:g?"110px":"128px"}},o?.map(t=>e.createElement("div",{key:t.discountId,style:{flexShrink:0,width:g?"280px":"365px",minWidth:g?"280px":"365px",minHeight:g?"110px":"128px",backgroundColor:"transparent",borderRadius:`${i?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},e.createElement("div",{style:{width:g?"60px":"80px",minHeight:g?"110px":"128px",backgroundColor:i?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:g?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${i?.roundness||0}px`,borderBottomLeftRadius:`${i?.roundness||0}px`}},e.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),i?.iconVisibility&&e.createElement("div",{style:{position:"absolute",left:g?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:g?"32px":"40px",height:g?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:g?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(Ve,null)),e.createElement("div",{style:{flex:1,padding:g?"12px 12px":"15px 15px",paddingLeft:g?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${i?.roundness||0}px`,borderBottomRightRadius:`${i?.roundness||0}px`,overflow:"hidden",backgroundColor:i?.cardBackgroundColor||"#ffffff",minWidth:0}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:g?"4px":"6px",lineHeight:"normal"}},e.createElement("div",{style:{fontSize:g?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===t.couponType?"Free Gift":t._customOffer?.code?"Coupon":"Special Deal"),e.createElement("div",{style:{fontSize:g?"13px":"15px",fontWeight:"600",color:i?.textColor||"#2c3e50"}},t.name),e.createElement("div",{style:{fontSize:g?"11px":"12px",color:i?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:g?"28px":"32px"}},a(t))),e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),l(t),c(!0)},style:{fontSize:g?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},i?.viewDetailsTitle||"View Details")))))),e.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},Eu=({offersToShow:o,offersConfig:r,getOfferCardMessage:i,setSelectedOffer:a,setShowPopup:l})=>{const[c,s]=t("undefined"!=typeof window&&window.innerWidth<=768);return n(()=>{const e=()=>{s(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.createElement("div",{style:{borderRadius:`${r?.roundness||8}px`}},o?.map((t,n)=>e.createElement("div",{key:t.discountId,style:{display:"flex",alignItems:"flex-start",gap:c?"8px":"12px",padding:c?"12px 0":"16px 0",paddingLeft:c?"10px":"20px",backgroundColor:!0===r?.cardBackgroundTransparent||"true"===String(r?.cardBackgroundTransparent)?"transparent":r?.cardBackgroundColor||"#ffffff",borderBottom:n<(o?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${r?.roundness||0}px`}},r?.iconVisibility&&e.createElement("div",{style:{width:c?"40px":"50px",height:c?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:c?"20px":"25px",marginTop:c?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(Ve,null)),e.createElement("div",{style:{flex:1}},e.createElement("div",{style:{fontSize:c?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},t.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",e.createElement("span",{style:{fontWeight:600,color:r?.textColor||"#34495e"}},t.name)),e.createElement("div",{style:{fontSize:c?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},i(t)),e.createElement("div",{style:{fontSize:c?"11px":"12px",color:"#000000"}},"offer auto applied",e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),a(t),l(!0)},style:{color:r?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},r?.viewDetailsTitle||"T&C"))))))},ku=({offersConfig:o,offers:i})=>{const[a,l]=t(!1),[c,s]=t(null),[d,p]=t(null),[u,m]=t("undefined"!=typeof window&&window.innerWidth<=768),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=450),f=r(null);n(()=>{const e=()=>{m(window.innerWidth<=768),x(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{f.current&&pn(f.current)},[o?.sectionBgContrastColor]);const y=(e=>{if(!e||0===e.length)return e;const t={};e.forEach(e=>{const n=e.customCartProgressBarCriteria||"none";t[n]=(t[n]||0)+1});let n="none",o=-1;Object.keys(t).forEach(e=>{t[e]>o&&(o=t[e],n=e)});const r=e.map((e,t)=>({o:e,idx:t})),i=e=>"minimum_order_value"===n?void 0!==e.minimumOrderValue&&null!==e.minimumOrderValue?Number(e.minimumOrderValue):1/0:"quantity"===n&&void 0!==e.quantityThreshold&&null!==e.quantityThreshold?Number(e.quantityThreshold):1/0;return r.sort((e,t)=>{const o=e.o.customCartProgressBarCriteria===n,r=t.o.customCartProgressBarCriteria===n;if(o&&r){const n=i(e.o),o=i(t.o);return n!==o?n-o:e.idx-t.idx}return o&&!r?-1:!o&&r?1:e.idx-t.idx}),r.map(e=>e.o)})((!1===o?.showBackendOffers&&o?.customOffers&&o.customOffers.length>0?o.customOffers.map((e,t)=>{return{discountId:-(t+1),name:(n=e).title,couponType:n.code?"discount_code":"special_deal",customCartProgressBarCriteria:null,discountPercentage:null,couponTemplateId:0,minimumOrderValue:0,quantityThreshold:0,_allVariantIds:[],description:n.description,_customOffer:n};var n}):i)||[]),b=e=>{if(s(e),e){const t=e._customOffer;p(t?(e=>({offerMessage:e.description||"Special offer available",terms:e.terms?e.terms.split("\n").filter(e=>""!==e.trim()):[]}))(t):(e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const o=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?o.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&o.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&o.push("Combines with other order discounts"),t||o.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:o}})(e))}},h=e=>{const t=e._customOffer;return t?t.description||"Special offer available":(e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available")(e)};return e.createElement("div",null,e.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===o?.sectionType?`${o?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:o?.sectionBackgroundColor||"#fff"}},e.createElement("div",{style:{border:"coupon"===o?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=o?.cardPadding?`${o.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===o?.sectionType?`${o?.roundness||8}px`:"0px"}},e.createElement("span",{ref:f,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"right"===o?.alignment?"auto":"50%",right:"right"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===o?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:o?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},o?.sectionTitle||"Available Deals and Offers"),(()=>{const t=o?.sectionType;return"list"===t?e.createElement(Eu,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):"coupon"===t?e.createElement(Cu,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):null})(),g?e.createElement(wu,{selectedOffer:c,selectedOfferTerms:d,showPopup:a,offersConfig:o,onClose:()=>{l(!1),s(null),p(null)}}):e.createElement(vu,{selectedOffer:c,selectedOfferTerms:d,showPopup:a,offersConfig:o,onClose:()=>{l(!1),s(null),p(null)}}))))};export{Sp as Bundle,bu as BundleLoader,yu as Cart,hu as LoyaltyPageBlock,Lt as Nudge,ku as ProductOffers,Qt as SpinnerWheel};
5294
+ `,xu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=ie(en),w=ae(Ut),C=r(null),[E,k]=t(null),[T,S]=t(!1),[$,B]=t({}),[N,I]=t(h?.variantId),[z,F]=t(h?.quantity||1),[D,P]=t(!1),A=ir();n(()=>{h?.open?setTimeout(()=>{P(!0)},10):P(!1)},[h?.open]);n(()=>{(async()=>{if(!E&&l&&h?.variantId&&h?.handle){const e=await l(h.handle,h.variantId);if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){I(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),B(n)}else I(void 0),B({})}k(e)}})()},[E,l,h]);const _=(e,t)=>{const n={...$,[e]:t};B(n);const o=E?.variants?.find(e=>E.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&I(String(o.id))}},R=E?.variants?.find(e=>String(e.id)===String(N)),O=on(w,w?.currency),L=o(()=>{const e={};if(!E)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return E.options.forEach(n=>{e[n.name]=n.values.filter(e=>E.variants.filter(o=>{const r=E.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!E.options.every((e,t)=>{if(e.name===n.name)return!0;const r=$[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[E,$,h]);return E?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{P(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Up,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Gp,{ref:C,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Yp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(Zp,null,e.createElement(Kp,null,e.createElement(Jp,null,e.createElement(eu,{src:R?.featured_image?.src??E?.featured_image,alt:R?.featured_image?.alt??E?.title})),e.createElement(tu,null,e.createElement(nu,{$themeColor:c,$primaryTextColor:y,href:`${E?.url}?variant=${R?.id}`},E?.title),e.createElement(uu,null,e.createElement(ou,null,e.createElement(ru,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(iu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Ko,{value:z,handleItemQuantityIncrement:async()=>{F(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&F(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:f})))),E?.options?.map(t=>{const n=A?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(lu,{key:t.name},e.createElement(su,null,e.createElement("span",null,"Select ",t.name),$[t.name]&&e.createElement(du,null,$[t.name])),e.createElement(pu,null,L[t.name]?.map(o=>{const r=$[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(mu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(gu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(cu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(au,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(N&&a){S(!0);try{await a(N,z,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}S(!1)}}:async()=>{if(!N)return;const e=!!h?.lineItemKey,t=String(N)!==String(h?.variantId);if(!e||t){S(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(N,h.allowedVariantIds):e&&m?await m(N,h.allowedVariantIds):a&&N&&await a(N,z,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}S(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!N||T},T?e.createElement(ue,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Up,{ref:b},e.createElement(Gp,{style:{backgroundColor:p||"white"}},e.createElement(Xp,null,e.createElement(me,{color:c||"#868E96"}))))});xu.displayName="DesktopVariantPopup";const fu=l(({removeCartItem:i,addCartItem:a,getProductDetailsByVariantId:l,themeColor:c,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,stealDealAddToCart:g,productClaimCtaButtonText:x,backgroundSubdued:f,primaryTextColor:y},b)=>{const[h,v]=ie(en),w=ae(Ut),[C,E]=t(null),[k,T]=t(!1),[S,$]=t({}),[B,N]=t(h?.variantId),[I,z]=t(h?.quantity||1),F=r(null),D=ir(),[P,A]=t(!1);n(()=>{h?.open?setTimeout(()=>{A(!0)},10):A(!1)},[h?.open]);n(()=>{(async()=>{if(!C&&l&&h?.variantId&&h?.handle)try{const e=await l(h.handle,h.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=h.allowedVariantIds,o=Array.isArray(n)&&n.length>0;if(t=o?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(h.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(h.variantId)),t){N(String(t.id));const n={};e.options.forEach((e,o)=>{n[e.name]=t[`option${o+1}`]}),$(n)}else N(void 0),$({})}E(e)}catch(e){}})()},[C,l,h]),n(()=>{},[p,i,a,l]);const _=(e,t)=>{const n={...S,[e]:t};$(n);const o=C?.variants?.find(e=>C.options.every((t,o)=>e[`option${o+1}`]===n[t.name]));if(o){const e=h?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(o.id)))return;o.available&&N(String(o.id))}},R=C?.variants?.find(e=>String(e.id)===String(B)),O=on(w,w?.currency),L=o(()=>{const e={};if(!C)return e;const t=Array.isArray(h?.allowedVariantIds)&&h.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(o=>{const r=C.options.indexOf(n);if(o[`option${r+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const r=S[e.name];return!r||o[`option${t+1}`]===r})&&(!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(o.id)))&&!!o.available)}).some(e=>!!(!t||Array.isArray(h.allowedVariantIds)&&h.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,S,h]);return C?e.createElement(e.Fragment,null,e.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:h?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:P?1:0,transition:"opacity 0.3s ease"},onClick:()=>{A(!1),setTimeout(()=>{v({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),e.createElement(Up,{ref:b,className:"yt-variant-selection-popup"},e.createElement(Gp,{ref:F,style:{backgroundColor:p||"white",opacity:P?1:0,transform:P?"translateY(0)":"translateY(20px)"},$themeColor:c,onClick:e=>e.stopPropagation()},h?.freebieSelection&&e.createElement(Yp,null,h?.stealDealSelection?"Unlocked Steal Deal":"Unlocked Freebie"),e.createElement(Zp,null,e.createElement(Kp,null,e.createElement(Jp,null,e.createElement(eu,{src:R?.featured_image?.src??C?.featured_image,alt:R?.featured_image?.alt??C?.title})),e.createElement(tu,null,e.createElement(nu,{$themeColor:c,$primaryTextColor:y,href:`${C?.url}?variant=${R?.id}`},C?.title),e.createElement(uu,null,e.createElement(ou,null,e.createElement(ru,{$primaryTextColor:y},O,tn(R?.price,w?.currency??"INR")),null!=R?.compare_at_price&&null!=R?.price&&R.compare_at_price>R.price&&e.createElement(iu,null,O,tn(R?.compare_at_price,w?.currency??"INR"))),!h?.freebieSelection&&e.createElement(Ko,{value:I,handleItemQuantityIncrement:async()=>{z(e=>e+1)},handleItemQuantityDecrement:async()=>{I>1&&z(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:f})))),C?.options?.map(t=>{const n=D?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase());return e.createElement(lu,{key:t.name},e.createElement(su,null,e.createElement("span",null,"Select ",t.name,":"),S[t.name]&&e.createElement(du,null,S[t.name])),e.createElement(pu,null,L[t.name]?.map(o=>{const r=S[t.name]===o,i=rr(n,o);return"color"===n?.type&&i?.value?e.createElement(mu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$colorValue:i.value}):"image"===n?.type&&i?.value?e.createElement(gu,{key:o,$isSelected:r,$themeColor:c,onClick:()=>_(t.name,o),$imageUrl:i.value}):e.createElement(cu,{$themeColor:c,key:o,$isSelected:r,backgroundColor:r?c:void 0,onClick:()=>_(t.name,o)},o)})))})),e.createElement(au,{className:"yt-cart-variant-popup-ATC-button",$themeColor:c??"#C33",onClick:h?.productRec?async()=>{if(B&&a){T(!0);try{await a(B,I,"product-recommendation-variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!B)return;const e=!!h?.lineItemKey,t=String(B)!==String(h?.variantId);if(!e||t){T(!0);try{const e=h?.freebieSelection;e&&!h?.lineItemKey||(e&&u&&h?.lineItemKey?await u(h.lineItemKey):await i(h?.lineItemKey||h?.variantId,"variant-selector",!0)),e&&h?.stealDealSelection&&g?await g(B,h.allowedVariantIds):e&&m?await m(B,h.allowedVariantIds):a&&B&&await a(B,I,"variant-selector",!1,h.handle),v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else v({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||k},k?e.createElement(ue,{color:"white",size:13}):h?.productRec?"ADD TO BAG":h?.stealDealSelection?"CLAIM DEAL":h?.freebieSelection?x||"CLAIM FREEBIE":"GET IN BAG")))):e.createElement(Up,{ref:b},e.createElement(Gp,{style:{backgroundColor:p||"white"}},e.createElement(Xp,null,e.createElement(me,{color:c||"#868E96"}))))});const yu=({setIsCartOpen:t,isCartOpen:n,cartCheckpoints:o,customCartProgressBarCriteria:r,floatingCartData:i,effectiveQuantityForProgressBar:a,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const s=ae(Ut),d=i?.bannerFooterText,p="string"==typeof d&&d.trim().length>0,u=!n&&(e=>{try{if("undefined"==typeof window)return!1;const t=window.location.pathname||"/";if("/"===t||""===t)return!0;const n=e?.showOnPages;if(!Array.isArray(n)||0===n.length)return!1;const o=t.toLowerCase(),r=o.endsWith("/")?o:`${o}/`;return n.some(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim().toLowerCase().replace(/^\/|\/$/g,"");if(!t)return!1;const n=`/${t}/`;return r.includes(n)})}catch{return!1}})(i),m=s?.item_count??0,g=tn(s?.items_subtotal_price??0,s?.currency??"INR"),x=on(s),f=function(e,t,n,o,r){if(!e||0===e.length)return{deltaValue:0,show:!1};const i=(t??"minimum_order_value").toLowerCase(),a="quantity_threshold"===i?"number"==typeof r?r:o:n,l=[...e].sort((e,t)=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===i?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===i?e.quantityThreshold:e.minimumOrderValue)>a);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===i?l.quantityThreshold:l.minimumOrderValue,s=Math.max(0,c-a);return{deltaValue:s,show:s>0,isQuantity:"quantity_threshold"===i}}(o,r,g,m,a),y="sharp"===l?0:c??12,h=i?.textColor??"#111",v=i?.backgroundColor??"#FF7E6E",w=i?.bannerBackgroundColor??"#FFE0DC",C=i?.buttonColor??"#E8513F",E=e.useRef(null);e.useEffect(()=>{pn(E.current)},[C]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},T={background:"#FFFFFF",color:"#111",padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},S={background:"#fff",color:h,borderRadius:y,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},$={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:w,color:h,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},B={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:v,cursor:"pointer"},N={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:h},I={fontSize:12,color:h,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},z={padding:"5px 10px",background:C,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!f.show)return null;const t=f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} to get freebie`;return e.createElement("div",{style:k},e.createElement("div",{className:"yt-cart-floating-ribbon",style:T},e.createElement(b,{"aria-hidden":!0}),e.createElement("span",null,t)))}const F=1===m?"1 item":`${m} items`,D=i?.lastTierUnlockedText||"Best tier unlocked",P=f.show?f.isQuantity?`${f.deltaValue} more items to get freebie`:`Add items worth ${x}${un(f.deltaValue.toFixed(0))} more to get freebie`:D;return e.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},e.createElement("div",{style:{position:"relative"}},(f.show||o&&o.length>0)&&e.createElement("div",{className:"yt-cart-floating-banner",style:$},e.createElement(b,{"aria-hidden":!0,style:{marginBottom:7}}),e.createElement("span",{style:{display:"inline-block",marginBottom:7}},P)),e.createElement("div",{style:S},e.createElement("div",{className:"yt-cart-floating-body",style:B,onClick:()=>t(!0)},e.createElement(_,{width:24,height:24,color:h}),e.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},e.createElement("div",{style:N},e.createElement("span",null,x,un(g.toFixed(0))),e.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},F)),p?e.createElement("span",{style:I,title:d},d):null),e.createElement("button",{ref:E,style:z,onClick:()=>t(!0),"aria-label":"View Cart"},"View Cart")))))},bu=({exploreCTAColor:o,checkoutFontSize:i,handleDecrement:l,handleIncrement:c,removeCartItem:s,addCartItem:d,cartTitle:p,emptyCartTitle:u,emptyCartDescription:m,emptyCartButtons:g,backgroundColor:x,backgroundSubdued:f,tertiaryColor:y,tertiaryTextColor:b,backdrop:h=!0,cartData:v,isUserSignedIn:w,showBundle:C,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:N,applyDiscount:I,discountApplied:z,checkoutFunction:F,joinNowFunction:D,guestLoyaltyPercentage:P,showToggleButton:A,isOpen:_,setIsOpen:R,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:V,cartCheckpoints:j,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:K,checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:re,secondaryTextColor:ae,showProductRecsOnDesktop:ce,showProductRecsOnMobile:se,themeColor:de,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,showNoteOption:Ee,applyNoteToCart:ke,note:Te,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ne,getProductDetailsByVariantId:Ie,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:De,currentTier:Pe,freebieProductsInCart:Ae,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:Ve,postalCodeList:je,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,showStickyAddToCart:Ge,stickyCartLineItem:Xe,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,enableCustomCartOnCartPage:rt,isCartPage:it,progressBarFreeProductIconType:at,addToStickyCart:lt,productRecsCardLayout:ct,productRecsCardListVariant:st,showCartTimer:dt,showFreebieMilestone:pt,showFloatingCart:ut,floatingCartData:mt,freebieMilestoneData:gt,cartTimerInMinutes:xt,cartTimerCustomText:ft,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,stickyCartCustomizationData:vt,cartOffersCarousalData:wt,stickyBarBuyNowFunction:Ct,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:Nt,brandTokenName:It,showDiscountOnMRP:zt,prefixMessageText:Ft,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,applyCouponCode:Vt,showApplyCoupon:jt,enableConfetti:Wt,showCheckoutButtonPaymentIcons:Ht=!0,showCouponOptions:qt,rewardCoupons:Qt,comboBundleData:Yt,comboBundleAddToCartFunction:Gt,stealDealCheckpoints:Xt,stealDealProducts:Zt,stealDealAddToCart:Kt,useCartShell:Jt,showTrustedBadge:tn,trustedBadgeData:nn})=>{const on=le(Ut),[rn,an]=ie(en),[ln,cn]=ie(Vi),sn=()=>R(!_),[dn,pn]=t(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});n(()=>{const e=e=>{const t=e.detail;pn({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const un=dn.comboBundleData??Yt,mn=dn.comboBundleAddToCartFunction??Gt,[gn,xn]=t(()=>{const e=window.ytVolumeBundle;return{bundle:e?.bundle??void 0,currentTier:e?.currentTier??void 0,volumeBundleAddToCartFunction:e?.addToCart??void 0}});n(()=>{const e=e=>{const t=e.detail;xn({bundle:t?.bundle??void 0,currentTier:t?.tierData??void 0,volumeBundleAddToCartFunction:t?.addToCart??void 0})};return window.addEventListener("yt-volume-bundle-updated",e),()=>window.removeEventListener("yt-volume-bundle-updated",e)},[]);const fn=r(null),yn=r(0);a(()=>{if(v){const e=v?.token??null,t="number"==typeof v?.cartUpdatedAtMs?v.cartUpdatedAtMs:void 0;e!==fn.current&&(fn.current=e,yn.current=t??0);const n=yn.current;if(!(void 0===t||t>=n))return;void 0!==t&&(yn.current=t),on(v)}},[v]);const bn=r(null);n(()=>{function e(e){bn.current&&!bn.current.contains(e.target)&&(an({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),cn({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[hn,vn]=t(!1);return n(()=>{const e=()=>{vn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{if(!Jt)return;const e=window.ytCartShell;if(!e)return;const t=e.getDrawerElement?.(),n=e.getOverlayElement?.();t&&(!_||rt&&it?(t.style.setProperty("transform","translateX(100%)","important"),t.style.boxShadow="none",n&&(n.style.display="none"),document.body.classList.remove("drawer-open")):(t.style.setProperty("transform","translateX(0)","important"),t.style.boxShadow="-14px 8px 14.4px 0px rgba(0, 0, 0, 0.35)",h&&n&&(n.style.display="block"),document.body.classList.add("drawer-open")))},[_,Jt,rt,it,h]),n(()=>{if(!Jt)return;const e=window.ytCartShell,t=e?.getOverlayElement?.();if(!t)return;const n=()=>R(!1);return t.addEventListener("click",n),()=>t.removeEventListener("click",n)},[Jt,R]),e.createElement(e.Fragment,null,e.createElement("div",{style:{position:rt&&it?"relative":"absolute",width:"100%",display:rt&&it?"flex":"block",alignItems:"center",justifyContent:"center"}},A&&!(rt&&it)&&e.createElement("button",{style:{margin:"16px"},onClick:sn},_?"Close Drawer":"Open Drawer"),!Jt&&_&&h&&!(rt&&it)&&e.createElement("div",{onClick:sn,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},"‎"),e.createElement(Il,{useCartShell:Jt,isCartPage:it,enableCustomCartOnCartPage:rt,isOpen:_,setIsOpen:R,backgroundColor:x,backgroundSubdued:f??"#F5F5F5",tertiaryColor:y,tertiaryTextColor:b,exploreCTAColor:o,checkoutFontSize:i,cartTitle:p,handleDecrement:l,handleIncrement:c,removeCartItem:s,addCartItem:d,emptyCartTitle:u,emptyCartButtons:g,emptyCartDescription:m,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,removeDiscount:N,applyDiscount:I,discountApplied:z,checkoutFunction:F,joinNowFunction:D,guestLoyaltyPercentage:P,isDev:O,switchWidthVariant:L,recProductsList:M,showMultiStepProgressBar:V,cartCheckpoints:j,redemptionRate:W,pointsRewardRate:H,showCartLevelAltPay:q,exploreCtaRedirectLink:Q,discountAmountApplied:U,minimumCartValue:Y,discountInCheckoutButton:G,isStickyCheckout:X,handleCheckpointCrossed:Z,customCartProgressBarCriteria:K??"minimum_order_value",checkoutButtonColor:J,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,primaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:re,secondaryTextColor:ae,showProductRecsOnDesktop:ce,showProductRecsOnMobile:se,themeColor:de,themeTextColor:pe,companyName:ue,gstNumber:me,showGSTOption:ge,applyGSTToCart:xe,showMOVForProgressTiers:fe,freeProduct:ye,showLoyaltyCta:be,freeProductAdjustedCartTotal:he,minimumOrderValueToAvailDiscount:ve,signinCTAButtonVisible:we,cartSigninCTAMainText:Ce,applyNoteToCart:ke,note:Te,showNoteOption:Ee,inlineCartOfferInfoText:Se,inlineCartOfferInfoRedirectLink:$e,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Ne,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:De,currentTier:Pe,freebieProductsInCart:Ae,cartOffersCarousalData:wt,showFreebieClaim:_e,addFreebieToCart:Re,freebiesInCart:Oe,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Me,removeFreebieFromCart:Ve,postalCodeList:je,enableGeoLocationDeliveryRestriction:We,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ze,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:ot,progressBarFreeProductIconType:at,productRecsCardLayout:ct,productRecsCardListVariant:st,showCartTimer:dt,showFreebieMilestone:pt,freebieMilestoneData:gt,cartTimerCustomText:ft,cartTimerInMinutes:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:ht,gstSectionCustomizationData:Et,noteSectionTitle:kt,checkoutSectionMessage:Tt,checkoutSectionMessageRedirectLink:St,checkoutSectionMessageDisplay:$t,showVariantSelectionDropdownInProductClaim:Bt,loyaltyDiscount:Nt,getProductDetailsByVariantId:Ie,brandTokenName:It,showDiscountOnMRP:zt??!0,prefixMessageText:Ft,suffixMessageText:Dt,successMessageText:Pt,toggleDecimal:At,cartOffersCarouselHeight:_t,disableCheckoutButton:Rt,showEmptyCartRecommendations:Ot,emptyProductRecsTitleText:Lt,checkoutButtonBottomSpacing:Mt,applyCouponCode:Vt,showApplyCoupon:jt,enableConfetti:Wt,showCheckoutButtonPaymentIcons:Ht,stealDealCheckpoints:Xt,stealDealProducts:Zt,stealDealAddToCart:Kt,showCouponOptions:qt,rewardCoupons:Qt,showTrustedBadge:tn,trustedBadgeData:nn}),Ge&&Xe&&d&&e.createElement(Qp,{showStickyCart:Ge,stickyCartCustomizationData:vt,product:Xe,addCartItem:d,onSetLoading:ze,themeColor:de,themeTextColor:pe,cartData:v,isCartOpen:_,setIsCartOpen:R,ctaButtonBackgroundColor:ee,ctaButtonTextColor:te,addToStickyCart:lt,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,checkoutFunction:Ct,backgroundColor:x,primaryTextColor:ne,comboBundleData:un,comboBundleAddToCartFunction:mn,volumeBundleCurrentTier:gn.currentTier,volumeBundleData:gn.bundle,volumeBundleAddToCartFunction:gn.volumeBundleAddToCartFunction}),hn&&rn.open&&e.createElement(xu,{backgroundColor:x,ref:bn,isDev:O,removeCartItem:s,addCartItem:d,getProductDetailsByVariantId:Ie,themeColor:de,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,removeFreebieFromCart:Ve,freebieClaimAddToCart:Re,stealDealAddToCart:Kt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne}),!hn&&rn.open&&e.createElement(fu,{ref:bn,isDev:O,removeCartItem:s,addCartItem:d,getProductDetailsByVariantId:Ie,themeColor:de,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt,backgroundColor:x,removeFreebieFromCart:Ve,freebieClaimAddToCart:Re,stealDealAddToCart:Kt,productClaimCtaButtonText:Ye?.productClaimCtaButtonText,backgroundSubdued:f??"#F5F5F5",primaryTextColor:ne})),!hn&&ut&&e.createElement(yu,{isCartOpen:_,setIsCartOpen:R,cartCheckpoints:j,customCartProgressBarCriteria:K,floatingCartData:mt,effectiveQuantityForProgressBar:Le,cartComponentsCornerRadius:ht,cartComponentsCornerType:bt}))};gt(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const hu=()=>e.createElement("div",{className:"scene"},e.createElement("div",{className:"floating"},e.createElement("div",{className:"cube"},e.createElement("div",{className:"side front"},"‎"),e.createElement("div",{className:"side back"},"‎"),e.createElement("div",{className:"side left"},"‎"),e.createElement("div",{className:"side right"},"‎"),e.createElement("div",{className:"side bottom"},"‎"),e.createElement("div",{className:"lid"},e.createElement("div",{className:"flap north"},"‎"),e.createElement("div",{className:"flap south"},"‎"),e.createElement("div",{className:"flap east"},"‎"),e.createElement("div",{className:"flap west"},"‎"))))),vu=({config:t,brandConfig:n})=>{const{heroDesktopImage:o,heroMobileImage:r,heroTitle:i="ZERO WASTE PREMIUM PET CARE",heroSubtitle:a="Earn Doglycoins for exclusive rewards every time you shop.",heroTextAlignment:l="left",heroSubtitleFontSize:c="18px",heroSubtitleColor:s="#000000",heroSubtitleFontWeight:d="400",heroTitleFontSize:p="48px",heroTitleColor:u="#000000",heroRegistrationCTAVisibility:m=!0,primaryColor:g="#1C1C1D",primaryContrastColor:x="#FFFFFF",secondaryColor:f="#FFFFFF",secondaryContrastColor:y="#000000",accentColor:b="#FFFFFF",borderColor:N="#E5E5E5",themeRoundness:I="0px",heroBannerVisibility:z="show",stepsVisibility:F="show",waysToEarnVisibility:D="show",waysToEarnCustomText:P="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",customSectionVisibility:A="show",footerSignupVisibility:_="show",customSectionImagePosition:R="left",customSectionTitle:O="Earn Doglycoins every time you shop",customSectionSubtitle:L="Collect more Doglycoins by entering your birthday, following us on social or referring a friend (details below)\n\nRedeem your Doglycoins for cash off at checkout by signing in or creating an account. Did you shop without registering? No worries, your Credits have been saved for you",customSectionTitleFontSize:M="36px",customSectionSubtitleFontSize:V="18px",customSectionImage:j,customSectionTextAlignment:W="left",customSectionTitleColor:H="#000000",customSectionSubtitleColor:q="#000000",stepsTitle:Q="Getting started is easy",stepsSubtitle:U="Earn Stars and get rewarded in a few easy steps.",step1Title:Y="CREATE AN ACCOUNT",step1Description:G="To get started, Join Now. You can also register on the mobile app to get access to the full range of reward benefits",step2Title:X="ORDER AND EARN REWARDS POINTS",step2Description:Z="Use cash, credit/debit card or save some time and pay right through the app. You'll collect Stars all ways.",step3Title:K="UNLOCK REWARDS AND OFFERS",step3Description:J="As you earn Stars, you can redeem them for Rewards—like free food, drinks, and more. Start redeeming with as little as 25 Stars!",footerCustomText:ee="Individual rewards of 750 points or more ship FREE. No merchandise purchase required.",footerSignupSubtext:te="Use your points to redeem samples and more."}=t||{},ne="undefined"!=typeof window&&window.innerWidth<=768,oe=e=>e&&e.startsWith("//")?`https:${e}`:e,re={padding:"12px 32px",borderRadius:"30px",fontSize:"14px",fontWeight:600,cursor:"pointer",textTransform:"uppercase",border:`1px solid ${g}`,transition:"all 0.3s ease"},ie={...re,backgroundColor:g,color:x,borderColor:g},ae={...re,backgroundColor:f,color:y,borderColor:N},{newSignupTokens:le,firstOrderTokens:ce,instagramFollowPoints:se,twitterFollowPoints:de,facebookFollowPoints:pe,youtubeSubscriptionPoints:ue,rewardToLeaveReview:me,birthdayPoints:ge,referralPointsForReferrer:xe,tokenCreditPercentage:fe,brandTokenName:ye}=n||{},be=[...le?[{icon:e.createElement(h,null),title:`${le} ${ye}`,subtitle:"Create an account"}]:[],...ce?[{icon:e.createElement(v,null),title:`${ce} ${ye}`,subtitle:"Place your first order"}]:[],...fe?[{icon:e.createElement(v,null),title:`${fe}% ${ye}`,subtitle:`Earn ${fe}% back on every order`}]:[],...xe?[{icon:e.createElement(w,null),title:`${xe} ${ye}`,subtitle:"Refer a friend and get"}]:[],...ge?[{icon:e.createElement(C,null),title:`${ge} ${ye}`,subtitle:"Get on your birthday to spend"}]:[],...me?[{icon:e.createElement(E,null),title:`${me} ${ye}`,subtitle:"Write a Review"}]:[],...pe?[{icon:e.createElement(k,null),title:`${pe} ${ye}`,subtitle:"Like on Facebook"}]:[],...se?[{icon:e.createElement(T,null),title:`${se} ${ye}`,subtitle:"Follow on Instagram"}]:[],...de?[{icon:e.createElement(S,null),title:`${de} ${ye}`,subtitle:"Follow on Twitter"}]:[],...ue?[{icon:e.createElement($,null),title:`${ue} ${ye}`,subtitle:"Subscribe on YouTube"}]:[]];return e.createElement("div",{className:"yt-loyalty-page-container",style:{fontFamily:"'Poppins', sans-serif",width:"100%",overflow:"hidden"}},"show"===z&&e.createElement("div",{className:"yt-loyalty-page-hero",style:{position:"relative",minHeight:"500px",display:"flex",alignItems:"center",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start",backgroundImage:`url(${oe(ne&&r?r:o)})`,backgroundSize:"cover",backgroundPosition:"center",padding:ne?"40px 20px":"60px 80px"}},e.createElement("div",{className:"yt-loyalty-page-hero-content",style:{maxWidth:"600px",zIndex:2,textAlign:l}},e.createElement("h1",{className:"yt-loyalty-page-hero-title",style:{fontSize:ne?"32px":p,color:u,marginBottom:"16px",lineHeight:1.1,fontWeight:800,textTransform:"uppercase"}},i),e.createElement("p",{className:"yt-loyalty-page-hero-subtitle",style:{fontSize:c,color:s,fontWeight:Number(d)||400,marginBottom:"32px"}},a),m&&e.createElement("div",{className:"yt-loyalty-page-hero-button-wrapper",style:{display:"flex",gap:"16px",justifyContent:"center"===l?"center":"right"===l?"flex-end":"flex-start"}},e.createElement("button",{className:"yt-loyalty-page-hero-button",style:ie,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"Join Now")))),"show"===F&&e.createElement("div",{className:"yt-loyalty-page-steps",style:{padding:"40px 20px",position:"relative",textAlign:"center"}},e.createElement("div",{className:"yt-loyalty-page-steps-background-text",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"GETTING STARTED"),e.createElement("div",{className:"yt-loyalty-page-steps-content",style:{position:"relative",zIndex:1}},e.createElement("h2",{className:"yt-loyalty-page-steps-title",style:{fontSize:"32px",fontWeight:700,marginBottom:"8px",color:"#000"}},Q),e.createElement("p",{className:"yt-loyalty-page-steps-subtitle",style:{color:g,marginBottom:"24px"}},U),e.createElement("div",{className:"yt-loyalty-page-steps-grid",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"center",gap:"40px",maxWidth:"1200px",margin:"0 auto"}},[{icon:e.createElement(v,null),title:Y,desc:G},{icon:e.createElement(B,null),title:X,desc:Z},{icon:e.createElement(C,null),title:K,desc:J}].map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-step-item",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{className:"yt-loyalty-page-step-icon",style:{width:"80px",height:"80px",borderRadius:"50%",border:"4px solid #ccc",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"32px",color:"#666",marginBottom:"12px"}},t.icon),e.createElement("div",{className:"yt-loyalty-page-step-title",style:{fontSize:"16px",fontWeight:700,color:g,textTransform:"uppercase",lineHeight:"normal"}},t.title),e.createElement("p",{className:"yt-loyalty-page-step-description",style:{fontSize:"13px",color:g,lineHeight:1.2,maxWidth:"300px"}},t.desc)))))),"show"===D&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn",style:{padding:"40px 20px",position:"relative",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-background-text",style:{position:"absolute",top:ne?"10%":"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"12vw",fontWeight:900,color:"#F5F5F5",zIndex:0,whiteSpace:"nowrap",pointerEvents:"none",opacity:.5}},"WAYS TO EARN"),e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-grid",style:{position:"relative",zIndex:1,maxWidth:"1000px",margin:"0 auto",display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"12px"}},be.map((t,n)=>e.createElement("div",{key:n,className:"yt-loyalty-page-ways-to-earn-item",style:{width:ne?"100%":"220px",border:"2px solid #ddd",padding:"12px 8px",display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",borderRadius:I,boxShadow:"-1px 2px 3px rgba(0,0,0,0.1)"}},e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-icon",style:{fontSize:"32px",marginBottom:"4px",color:"#1a1a2e"}},t.icon),e.createElement("h3",{className:"yt-loyalty-page-ways-to-earn-title",style:{fontSize:"13px",fontWeight:700,marginBottom:"2px",textTransform:"uppercase",color:"#000"}},t.title),e.createElement("p",{className:"yt-loyalty-page-ways-to-earn-subtitle",style:{fontSize:"11px",color:"#666"}},t.subtitle)))),P&&e.createElement("div",{className:"yt-loyalty-page-ways-to-earn-custom-text",style:{maxWidth:"1000px",margin:"24px auto 0",backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},P)),"show"===A&&e.createElement("div",{className:"yt-loyalty-page-custom-section",style:{padding:ne?"40px 0px":"40px 20px",borderTop:"1px solid #eee"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-container",style:{maxWidth:"1200px",margin:"0 auto",display:"flex",flexDirection:ne?"column":"row",alignItems:"center",gap:"40px",borderRadius:I,overflow:"hidden",backgroundColor:"#F9F9F9"}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image-wrapper",style:{flex:1,width:"100%",order:ne||"left"===R?0:1}},e.createElement("div",{className:"yt-loyalty-page-custom-section-image",style:{display:"flex",width:"100%",height:"300px",backgroundColor:"#ddd",backgroundImage:j?`url(${oe(j)})`:o?`url(${oe(o)})`:void 0,backgroundSize:"cover",backgroundPosition:"center"}})),e.createElement("div",{className:"yt-loyalty-page-custom-section-content",style:{flex:1,paddingInline:ne?"20px":"10px",textAlign:ne?"center":W,order:ne||"left"===R?1:0,marginBottom:ne?"20px":"0px"}},e.createElement("h2",{className:"yt-loyalty-page-custom-section-title",style:{fontSize:M,fontWeight:700,marginBottom:"16px",color:H}},O),e.createElement("p",{className:"yt-loyalty-page-custom-section-subtitle",style:{fontSize:V,color:q,marginBottom:"24px",lineHeight:1.6,whiteSpace:"pre-line"}},L)))),"show"===_&&e.createElement("div",{className:"yt-loyalty-page-footer",style:{marginBottom:"20px"}},e.createElement("div",{className:"yt-loyalty-page-footer-container",style:{maxWidth:"1200px",margin:"0 auto"}},e.createElement("div",{className:"yt-loyalty-page-footer-custom-text",style:{backgroundColor:b,color:"#fff",padding:"16px",textAlign:"center",fontSize:"12px",fontStyle:"italic",borderRadius:"4px"}},ee),e.createElement("div",{className:"yt-loyalty-page-footer-signup",style:{display:"flex",flexDirection:ne?"column":"row",justifyContent:"space-between",alignItems:"center",marginTop:"40px",padding:"20px",border:"1px solid #eee",borderRadius:"4px",gap:"20px",textAlign:ne?"center":"left"}},e.createElement("div",{className:"yt-loyalty-page-footer-signup-content"},e.createElement("h3",{style:{fontSize:"20px",fontWeight:700,marginBottom:"4px",color:"#000",textAlign:ne?"center":"left"}},"Rewards Program"),e.createElement("p",{style:{fontSize:"14px",color:"#666"}},te)),e.createElement("button",{className:"yt-loyalty-page-footer-signup-button",style:ae,onClick:()=>{"undefined"!=typeof window&&window.ytapp&&(window.ytapp.loyaltyWidgetOpen=!0,window.dispatchEvent(new Event("loyaltyWidgetOpenChanged")))}},"JOIN NOW")))))},wu=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const s=o._customOffer,d=s?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:i},e.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"16px",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(We,null)),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},o.name),e.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),d&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"16px",padding:"12px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"clamp(16px, 4vw, 18px)",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},d),e.createElement("button",{onClick:async()=>{if(d)try{await navigator.clipboard.writeText(d),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"20px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(N,null):e.createElement(I,null))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),e.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},e.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),e.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return A(p,document.body)},Cu=({showPopup:n,selectedOffer:o,selectedOfferTerms:r,onClose:i,offersConfig:a})=>{const[l,c]=t(!1);if(!n||!o||!r)return null;const s=o._customOffer,d=s?.code||o.code,p=e.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:i},e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),e.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},e.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),e.createElement("div",{style:{overflowY:"auto",flex:1}},e.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},e.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},"free_product"===o.couponType?e.createElement(b,null):e.createElement(We,null)),e.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},o.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")),e.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},o.name),e.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),d&&e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",marginTop:"20px",padding:"14px 20px",backgroundColor:a?.cardBackgroundColor||"#F5F5F5",borderRadius:`${a?.roundness||8}px`,border:`1px dashed ${a?.accentColor||"#EE8E35"}`}},e.createElement("span",{style:{fontSize:"18px",fontWeight:"600",color:a?.textColor||"#333",letterSpacing:"1px"}},d),e.createElement("button",{onClick:async()=>{if(d)try{await navigator.clipboard.writeText(d),c(!0),setTimeout(()=>c(!1),2e3)}catch(e){console.error("Failed to copy:",e)}},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",color:l?"#22c55e":a?.accentColor||"#EE8E35",fontSize:"22px",transition:"color 0.2s ease"},title:l?"Copied!":"Copy code"},l?e.createElement(N,null):e.createElement(I,null)))),r.terms.length>0&&e.createElement(e.Fragment,null,e.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},e.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),e.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},e.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map((t,n)=>e.createElement("li",{key:n,style:{marginBottom:"4px"}},t)))))),e.createElement("button",{onClick:i,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return A(p,document.body)},Eu=({offersToShow:o,offersConfig:i,getOfferCardMessage:a,setSelectedOffer:l,setShowPopup:c})=>{const s=r(null),[d,p]=t(!1),[u,m]=t(!0),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=768),f=()=>{if(s.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=s.current;p(e>0),m(e<t-n-10)}};n(()=>{f();const e=s.current;if(e)return e.addEventListener("scroll",f),()=>e.removeEventListener("scroll",f)},[o]),n(()=>{const e=()=>{x(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const y=e=>{if(s.current){const t=g?280:365,n=16,o="right"===e?t+n:-(t+n);s.current.scrollBy({left:o,behavior:"smooth"})}};return e.createElement("div",{style:{position:"relative"}},e.createElement("svg",{style:{position:"absolute",width:0,height:0}},e.createElement("defs",null,e.createElement("mask",{id:"coupon-cut-mask-desktop"},e.createElement("rect",{width:"365",height:"138",fill:"white"}),e.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),e.createElement("circle",{cx:"80",cy:"138",r:"12",fill:"black"})),e.createElement("mask",{id:"coupon-cut-mask-mobile"},e.createElement("rect",{width:"280",height:"120",fill:"white"}),e.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),e.createElement("circle",{cx:"60",cy:"120",r:"10",fill:"black"})))),d&&e.createElement("button",{onClick:()=>y("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(z,{size:20})),u&&e.createElement("button",{onClick:()=>y("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},e.createElement(F,{size:20})),e.createElement("div",{ref:s,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:g?"110px":"128px"}},o?.map(t=>e.createElement("div",{key:t.discountId,style:{flexShrink:0,width:g?"280px":"365px",minWidth:g?"280px":"365px",minHeight:g?"110px":"128px",backgroundColor:"transparent",borderRadius:`${i?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${g?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},e.createElement("div",{style:{width:g?"60px":"80px",minHeight:g?"110px":"128px",backgroundColor:i?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:g?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${i?.roundness||0}px`,borderBottomLeftRadius:`${i?.roundness||0}px`}},e.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),i?.iconVisibility&&e.createElement("div",{style:{position:"absolute",left:g?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:g?"32px":"40px",height:g?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:g?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(We,null)),e.createElement("div",{style:{flex:1,padding:g?"12px 12px":"15px 15px",paddingLeft:g?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${i?.roundness||0}px`,borderBottomRightRadius:`${i?.roundness||0}px`,overflow:"hidden",backgroundColor:i?.cardBackgroundColor||"#ffffff",minWidth:0}},e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:g?"4px":"6px",lineHeight:"normal"}},e.createElement("div",{style:{fontSize:g?"9px":"10px",color:"#666666",fontWeight:"400"}},"free_product"===t.couponType?"Free Gift":t._customOffer?.code?"Coupon":"Special Deal"),e.createElement("div",{style:{fontSize:g?"13px":"15px",fontWeight:"600",color:i?.textColor||"#2c3e50"}},t.name),e.createElement("div",{style:{fontSize:g?"11px":"12px",color:i?.accentColor||"#EE8E35",wordWrap:"break-word",overflowWrap:"break-word",whiteSpace:"normal",minHeight:g?"28px":"32px"}},a(t))),e.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},e.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",width:"100%",height:"0",display:"block"}}),e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),l(t),c(!0)},style:{fontSize:g?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0"}},i?.viewDetailsTitle||"View Details")))))),e.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},ku=({offersToShow:o,offersConfig:r,getOfferCardMessage:i,setSelectedOffer:a,setShowPopup:l})=>{const[c,s]=t("undefined"!=typeof window&&window.innerWidth<=768);return n(()=>{const e=()=>{s(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e.createElement("div",{style:{borderRadius:`${r?.roundness||8}px`}},o?.map((t,n)=>e.createElement("div",{key:t.discountId,style:{display:"flex",alignItems:"flex-start",gap:c?"8px":"12px",padding:c?"12px 0":"16px 0",paddingLeft:c?"10px":"20px",backgroundColor:!0===r?.cardBackgroundTransparent||"true"===String(r?.cardBackgroundTransparent)?"transparent":r?.cardBackgroundColor||"#ffffff",borderBottom:n<(o?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${r?.roundness||0}px`}},r?.iconVisibility&&e.createElement("div",{style:{width:c?"40px":"50px",height:c?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:c?"20px":"25px",marginTop:c?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===t.couponType?e.createElement(b,null):e.createElement(We,null)),e.createElement("div",{style:{flex:1}},e.createElement("div",{style:{fontSize:c?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},t.couponType.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),":"," ",e.createElement("span",{style:{fontWeight:600,color:r?.textColor||"#34495e"}},t.name)),e.createElement("div",{style:{fontSize:c?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},i(t)),e.createElement("div",{style:{fontSize:c?"11px":"12px",color:"#000000"}},"offer auto applied",e.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),a(t),l(!0)},style:{color:r?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},r?.viewDetailsTitle||"T&C"))))))},Tu=({offersConfig:o,offers:i})=>{const[a,l]=t(!1),[c,s]=t(null),[d,p]=t(null),[u,m]=t("undefined"!=typeof window&&window.innerWidth<=768),[g,x]=t("undefined"!=typeof window&&window.innerWidth<=450),f=r(null);n(()=>{const e=()=>{m(window.innerWidth<=768),x(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{f.current&&pn(f.current)},[o?.sectionBgContrastColor]);const y=(e=>{if(!e||0===e.length)return e;const t={};e.forEach(e=>{const n=e.customCartProgressBarCriteria||"none";t[n]=(t[n]||0)+1});let n="none",o=-1;Object.keys(t).forEach(e=>{t[e]>o&&(o=t[e],n=e)});const r=e.map((e,t)=>({o:e,idx:t})),i=e=>"minimum_order_value"===n?void 0!==e.minimumOrderValue&&null!==e.minimumOrderValue?Number(e.minimumOrderValue):1/0:"quantity"===n&&void 0!==e.quantityThreshold&&null!==e.quantityThreshold?Number(e.quantityThreshold):1/0;return r.sort((e,t)=>{const o=e.o.customCartProgressBarCriteria===n,r=t.o.customCartProgressBarCriteria===n;if(o&&r){const n=i(e.o),o=i(t.o);return n!==o?n-o:e.idx-t.idx}return o&&!r?-1:!o&&r?1:e.idx-t.idx}),r.map(e=>e.o)})((!1===o?.showBackendOffers&&o?.customOffers&&o.customOffers.length>0?o.customOffers.map((e,t)=>{return{discountId:-(t+1),name:(n=e).title,couponType:n.code?"discount_code":"special_deal",customCartProgressBarCriteria:null,discountPercentage:null,couponTemplateId:0,minimumOrderValue:0,quantityThreshold:0,_allVariantIds:[],description:n.description,_customOffer:n};var n}):i)||[]),b=e=>{if(s(e),e){const t=e._customOffer;p(t?(e=>({offerMessage:e.description||"Special offer available",terms:e.terms?e.terms.split("\n").filter(e=>""!==e.trim()):[]}))(t):(e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const o=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?o.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&o.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&o.push("Combines with other order discounts"),t||o.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:o}})(e))}},h=e=>{const t=e._customOffer;return t?t.description||"Special offer available":(e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available")(e)};return e.createElement("div",null,e.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===o?.sectionType?`${o?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:o?.sectionBackgroundColor||"#fff"}},e.createElement("div",{style:{border:"coupon"===o?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=o?.cardPadding?`${o.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===o?.sectionType?`${o?.roundness||8}px`:"0px"}},e.createElement("span",{ref:f,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"right"===o?.alignment?"auto":"50%",right:"right"===o?.alignment?"coupon"===o?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===o?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:o?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},o?.sectionTitle||"Available Deals and Offers"),(()=>{const t=o?.sectionType;return"list"===t?e.createElement(ku,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):"coupon"===t?e.createElement(Eu,{offersToShow:y,offersConfig:o||{},getOfferCardMessage:h,setSelectedOffer:b,setShowPopup:l}):null})(),g?e.createElement(Cu,{selectedOffer:c,selectedOfferTerms:d,showPopup:a,offersConfig:o,onClose:()=>{l(!1),s(null),p(null)}}):e.createElement(wu,{selectedOffer:c,selectedOfferTerms:d,showPopup:a,offersConfig:o,onClose:()=>{l(!1),s(null),p(null)}}))))};export{$p as Bundle,hu as BundleLoader,bu as Cart,vu as LoyaltyPageBlock,Lt as Nudge,Tu as ProductOffers,Qt as SpinnerWheel};