yt-uikit 0.9.26-progress-bar-ui.5 → 0.9.26-progress-bar-ui.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +9 -9
- 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 r,useRef as o,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 z,IoCopy as N,IoChevronBack as I,IoChevronForward as F}from"react-icons/io5";import{PhoneInput as P}from"react-international-phone";import D,{createPortal as A}from"react-dom";import{FaShoppingCart as _,FaAngleUp as R,FaAngleDown as L,FaChevronRight as O,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,FaSearch as K,FaSortAmountDown as J}from"react-icons/fa";import{RxInfoCircled as ee,RxMinus as te}from"react-icons/rx";import{RiDeleteBinLine as ne,RiDeleteBinFill as re,RiCouponLine as oe,RiCloseLine as ie}from"react-icons/ri";import{atom as ae,useAtom as le,useAtomValue as ce,useSetAtom as se}from"jotai";import{atomWithStorage as de}from"jotai/utils";import pe from"currency-symbol-map";import{FaBagShopping as ue,FaRegCopy as me}from"react-icons/fa6";import{ClipLoader as ge,ScaleLoader as xe}from"react-spinners";import{TbShoppingBagEdit as fe,TbTrashXFilled as ye,TbTrashX as be}from"react-icons/tb";import{MdChevronLeft as he,MdChevronRight as ve,MdDiscount as we,MdClose as Ce,MdVerified as Ee}from"react-icons/md";import ke from"canvas-confetti";import{IoMdCheckmark as Te,IoIosCart as Se,IoMdPricetags as $e,IoMdArrowDropleft as Be,IoMdArrowDropright as ze,IoIosStar as Ne,IoIosArrowDown as Ie}from"react-icons/io";import{AiFillGift as Fe,AiOutlineEdit as Pe}from"react-icons/ai";import{BiSolidTShirt as De,BiCube as Ae,BiPlus as _e,BiSearch as Re,BiFilterAlt as Le,BiSortAlt2 as Oe,BiMinus as Me,BiTrash as Ve,BiCheck as je,BiPencil as We,BiChevronDown as He,BiSolidDiscount as qe}from"react-icons/bi";import{BsCupHotFill as Qe,BsReceiptCutoff as Ue,BsInfoCircle as Ye,BsCheck as Ge,BsX as Xe,BsArrowRight as Ze,BsXLg as Ke,BsChevronDown as Je}from"react-icons/bs";import{PiPercentDuotone as et}from"react-icons/pi";import{HiOutlineShoppingBag as tt,HiTag as nt}from"react-icons/hi";import{LuZap as rt}from"react-icons/lu";import{GrFormNext as ot,GrFormSubtract as it,GrFormAdd as at,GrGift as lt}from"react-icons/gr";import{FiLock as ct,FiTrash as st,FiArrowLeft as dt,FiArrowRight as pt}from"react-icons/fi";import{HiOutlineShoppingBag as ut}from"react-icons/hi2";import{ImCheckboxChecked as mt,ImCheckboxUnchecked as gt}from"react-icons/im";import xt from"react-calendar";import ft from"react-modal-image";var yt='<svg width="29" height="23" viewBox="0 0 29 23" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M3.58718 11.5427H14.229V12.9247H3.58718V11.5427Z" fill="#FF4E4E"/>\r\n<path d="M1.81354 8.08752H10.6818V9.46959H1.81354V8.08752Z" fill="#FF4E4E"/>\r\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"/>\r\n</svg>';function bt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}bt('@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");');bt(".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 ht=c.div`
|
|
1
|
+
import e,{useState as t,useEffect as n,useMemo as r,useRef as o,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 z,IoCopy as N,IoChevronBack as I,IoChevronForward as F}from"react-icons/io5";import{PhoneInput as P}from"react-international-phone";import D,{createPortal as A}from"react-dom";import{FaShoppingCart as _,FaAngleUp as R,FaAngleDown as L,FaChevronRight as O,FaArrowLeft as M,FaChevronDown as V,FaGift as j,FaRegQuestionCircle as W,FaCheckCircle as H,FaLockOpen as q,FaPlus as Q,FaLock as U,FaChevronUp as Y,FaTimes as G,FaCheck as X,FaChevronLeft as Z,FaSearch as K,FaSortAmountDown as J}from"react-icons/fa";import{RxInfoCircled as ee,RxMinus as te}from"react-icons/rx";import{RiDeleteBinLine as ne,RiDeleteBinFill as re,RiCouponLine as oe,RiCloseLine as ie}from"react-icons/ri";import{atom as ae,useAtom as le,useAtomValue as ce,useSetAtom as se}from"jotai";import{atomWithStorage as de}from"jotai/utils";import pe from"currency-symbol-map";import{FaBagShopping as ue,FaRegCopy as me}from"react-icons/fa6";import{ClipLoader as ge,ScaleLoader as xe}from"react-spinners";import{TbShoppingBagEdit as fe,TbTrashXFilled as ye,TbTrashX as be}from"react-icons/tb";import{MdChevronLeft as he,MdChevronRight as ve,MdDiscount as we,MdClose as Ce,MdVerified as Ee}from"react-icons/md";import ke from"canvas-confetti";import{IoMdCheckmark as Te,IoIosCart as Se,IoMdPricetags as $e,IoMdArrowDropleft as Be,IoMdArrowDropright as ze,IoIosStar as Ne,IoIosArrowDown as Ie}from"react-icons/io";import{AiFillGift as Fe,AiOutlineEdit as Pe}from"react-icons/ai";import{BiSolidTShirt as De,BiCube as Ae,BiPlus as _e,BiSearch as Re,BiFilterAlt as Le,BiSortAlt2 as Oe,BiMinus as Me,BiTrash as Ve,BiCheck as je,BiPencil as We,BiChevronDown as He,BiSolidDiscount as qe}from"react-icons/bi";import{BsCupHotFill as Qe,BsReceiptCutoff as Ue,BsInfoCircle as Ye,BsCheck as Ge,BsX as Xe,BsArrowRight as Ze,BsXLg as Ke,BsChevronDown as Je}from"react-icons/bs";import{PiPercentDuotone as et}from"react-icons/pi";import{HiOutlineShoppingBag as tt,HiTag as nt}from"react-icons/hi";import{LuZap as rt}from"react-icons/lu";import{GrFormNext as ot,GrFormSubtract as it,GrFormAdd as at,GrGift as lt}from"react-icons/gr";import{FiLock as ct,FiTrash as st,FiArrowLeft as dt,FiArrowRight as pt}from"react-icons/fi";import{HiOutlineShoppingBag as ut}from"react-icons/hi2";import{ImCheckboxChecked as mt,ImCheckboxUnchecked as gt}from"react-icons/im";import xt from"react-calendar";import ft from"react-modal-image";var yt='<svg width="29" height="23" viewBox="0 0 29 23" fill="none" xmlns="http://www.w3.org/2000/svg">\r\n<path d="M3.58718 11.5427H14.229V12.9247H3.58718V11.5427Z" fill="#FF4E4E"/>\r\n<path d="M1.81354 8.08752H10.6818V9.46959H1.81354V8.08752Z" fill="#FF4E4E"/>\r\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"/>\r\n</svg>';function bt(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}bt('@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");');bt(".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 ht=c.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 10px;
|
|
4
4
|
right: 10px;
|
|
@@ -1465,7 +1465,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
|
|
|
1465
1465
|
color: #ff3b30;
|
|
1466
1466
|
font-size: 12px;
|
|
1467
1467
|
margin-left: 4px;
|
|
1468
|
-
`,pi=({companyName:r,gstNumber:o,themeColor:a,iconColor:l=a||"#1a1a1a",showIcon:c=!0,backgroundColor:s="white",textColor:d="#1A1A1A",title:p})=>{const[u,m]=le(Lr),[g,x]=le(Rr),[f,y]=le(Jo),[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(()=>{o&&r&&!g&&!u&&(x(o),m(r));const e=g||o||"";if(e){const t=k(e);h(t),w(!t),t&&y(!1)}},[g,u,o,r]);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(ei,{className:"yt-cart-gst-container",$bgColor:s},e.createElement(ti,{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(ni,{className:"yt-cart-gst-left"},c&&e.createElement(ri,{color:l}),e.createElement(oi,{$textColor:d},p||"Get GST Invoice")),e.createElement(ii,{className:"yt-cart-gst-right"},e.createElement(ai,{$bgColor:"white"!==s?"rgba(245, 245, 245, 0.4)":"rgba(245, 245, 245, 1)"},b&&!f?e.createElement(Ge,{size:18,color:d??"#4A4A4A"}):f?e.createElement(Xe,{size:18,color:d??"#4A4A4A"}):e.createElement(Ze,{size:18,color:d??"#4A4A4A",strokeWidth:"0.1"})))),f&&e.createElement(li,{className:"yt-cart-gst-form"},e.createElement(si,{className:"yt-cart-gst-company-input",placeholder:"Company Name",value:u,onChange:e=>m(e.target.value)}),e.createElement(ci,{className:"yt-cart-gst-input-wrapper"},e.createElement(si,{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(di,null,"Please enter a valid GST number"))))};bt(
|
|
1468
|
+
`,pi=({companyName:r,gstNumber:o,themeColor:a,iconColor:l=a||"#1a1a1a",showIcon:c=!0,backgroundColor:s="white",textColor:d="#1A1A1A",title:p})=>{const[u,m]=le(Lr),[g,x]=le(Rr),[f,y]=le(Jo),[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(()=>{o&&r&&!g&&!u&&(x(o),m(r));const e=g||o||"";if(e){const t=k(e);h(t),w(!t),t&&y(!1)}},[g,u,o,r]);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(ei,{className:"yt-cart-gst-container",$bgColor:s},e.createElement(ti,{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(ni,{className:"yt-cart-gst-left"},c&&e.createElement(ri,{color:l}),e.createElement(oi,{$textColor:d},p||"Get GST Invoice")),e.createElement(ii,{className:"yt-cart-gst-right"},e.createElement(ai,{$bgColor:"white"!==s?"rgba(245, 245, 245, 0.4)":"rgba(245, 245, 245, 1)"},b&&!f?e.createElement(Ge,{size:18,color:d??"#4A4A4A"}):f?e.createElement(Xe,{size:18,color:d??"#4A4A4A"}):e.createElement(Ze,{size:18,color:d??"#4A4A4A",strokeWidth:"0.1"})))),f&&e.createElement(li,{className:"yt-cart-gst-form"},e.createElement(si,{className:"yt-cart-gst-company-input",placeholder:"Company Name",value:u,onChange:e=>m(e.target.value)}),e.createElement(ci,{className:"yt-cart-gst-input-wrapper"},e.createElement(si,{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(di,null,"Please enter a valid GST number"))))};bt(".form-group {\n position: relative;\n display: block;\n}\n\n.yt-cart-note-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 12px;\n cursor: pointer;\n}\n\n.yt-cart-note-label {\n font-size: 14px;\n display: flex;\n gap: 8px;\n align-items: center;\n font-weight: 400;\n color: #000;\n}\n\n.info-icon {\n color: #666;\n font-size: 16px;\n}\n\n.icon-transition {\n transition: all 0.2s ease-in-out;\n cursor: pointer;\n font-size: 14px;\n}\n\n.textarea-container {\n position: relative;\n width: 100%;\n margin-top: 12px;\n}\n\n.floating-input-note {\n position: relative;\n display: block;\n width: 100%;\n min-height: 85px;\n border: 1px solid #767676;\n border-radius: 4px;\n background-color: transparent;\n padding: 16px 12px;\n outline: none !important;\n font-size: 14px;\n color: rgba(0, 0, 0, 0.85);\n box-sizing: border-box;\n resize: vertical;\n transition: all 0.2s ease-in-out;\n}\n\n.floating-label {\n position: absolute;\n top: -10px;\n left: 12px;\n display: inline-block;\n padding: 0 6px;\n font-size: 14px;\n font-weight: 400;\n background: #fff;\n color: #333;\n pointer-events: none;\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.note-collapse-wrapper {\n display: grid;\n grid-template-rows: 0fr;\n opacity: 0;\n transition: grid-template-rows 0.3s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;\n margin-top: 0;\n}\n\n.note-collapse-wrapper.is-open {\n grid-template-rows: 1fr;\n opacity: 1;\n margin-top: 12px;\n}\n\n.note-collapse-inner {\n overflow: hidden;\n}\n\n.icon-transition {\n transition: transform 0.3s ease-in-out;\n}\n\n.icon-transition.rotated {\n transform: rotate(180deg);\n}");const ui=({note:r,noteSectionTitle:o="ORDER NOTE"})=>{const[i,a]=le(Or),[l,c]=t(!1);return n(()=>{""===i&&r&&""!==r&&a(r)},[r,i,a]),e.createElement("div",{className:"yt-cart-note-section form-group"},e.createElement("div",{className:"yt-cart-note-header",onClick:()=>c(!l)},e.createElement("span",{className:"yt-cart-note-label"},o.toUpperCase()," ",e.createElement(ee,{className:"info-icon"})),e.createElement("div",{className:"yt-cart-note-toggle icon-transition "+(l?"rotated":"")},e.createElement(V,null))),e.createElement("div",{className:"note-collapse-wrapper "+(l?"is-open":"")},e.createElement("div",{className:"note-collapse-inner"},e.createElement("div",{className:"textarea-container"},e.createElement("textarea",{className:"yt-cart-note-textarea floating-input-note",value:i,onChange:e=>a(e.target.value)}),e.createElement("label",{className:"floating-label"},"Add Message here")))))},mi=(e,t)=>!!t&&(!e?.tracksInventory||(!t?.inventoryItem?.tracked||("continue"===t.inventoryPolicy||t.inventoryQuantity>0))),gi=e=>{if(null!=e)return mn(String(e))},xi=(e,t)=>{const n=gi(e),r=gi(t);return Boolean(n&&r&&n===r)},fi=e=>{const t=e?._claim_allowed_variants;return Array.isArray(t)&&t.length>0?t.map(String):[]},yi=e=>{const t=(e=>e?.variants?.edges?.filter(t=>mi(e,t?.node))||[])(e),n=fi(e);return n.length?t.filter(e=>n.some(t=>xi(t,e?.node?.id))):[]},bi=e=>{const t=yi(e)[0]?.node?.id;return gi(t)},hi=e=>yi(e).length>0,vi=(e,t)=>t?.find(t=>t.couponTemplateId===e?.couponTemplateId),wi=(e,t,n)=>t?e.filter(e=>{const r=n.find(t=>String(t?.id)===e);return r?.couponTemplateId===t}).length:0,Ci=({product:e,selectedProductIds:t,freebieProducts:n,freebieCouponTemplates:r,fallbackMaxFreebies:o=1,fallbackLimitReached:i=!1})=>{const a=vi(e,r);if(!a)return i||t.length>=o;const l=a.maxFreebiesInTier??1;return wi(t,a.couponTemplateId,n)>=l},Ei=(e,t)=>{if(!t)return!1;const n=mn(t);return[...e?.customerGetsProductIds?.ids??[],...e?._allVariantIds??[]].some(e=>{const r=String(e);return xi(r,t)||r===n})},ki=(e,t,n=1)=>{if(!e?.length)return 0;const r=new Map;e.forEach(e=>{const t=e?.couponTemplateId??"__default__";r.set(t,(r.get(t)??0)+1)});let o=0;return r.forEach((e,r)=>{const i="number"==typeof r?t?.find(e=>e.couponTemplateId===r):void 0,a=i?.maxFreebiesInTier??n;o+=Math.min(e,a)}),o},Ti=(e,t,n)=>{const r=yi(e);if(0===r.length)return{selectedVariantId:void 0,selectedVariantGid:void 0,selectedVariantPrice:0,availableVariants:[],displayVariantCount:0,effectiveDiscount:1,effectiveDiscountPercentage:0,effectivePrice:0,dealAmount:0,showOptions:!1,isFree:!0,isNoDiscount:!1};let o;n&&(o=r.find(e=>xi(e?.node?.id,n))),o||(o=r[0]);const i=o?.node?.id,a=mn(i),l=Number(o?.node?.price)||0,c=t?.find(e=>Ei(e,i)),s="no_discount"===c?.freebieType,d="percentage_off"===c?.freebieType?Number(c?.discountPercentage)||0:Number(e?.percentageOffOnCustomerGetsProducts)||0,p=d?.01*d:1;let u=0;"deal_amount"===c?.freebieType&&c.discountValue&&(u=c.discountValue);const m=s?l:1===p?0:(1-p)*l;return{selectedVariantId:a,selectedVariantGid:i,selectedVariantPrice:l,availableVariants:r,displayVariantCount:e?._claim_allowed_variants?.length||1,effectiveDiscount:p,effectiveDiscountPercentage:d,effectivePrice:m,dealAmount:u,showOptions:e?.variants?.edges?.length>1,isFree:!s&&0===m,isNoDiscount:s}},Si=c.div`
|
|
1469
1469
|
display: flex;
|
|
1470
1470
|
flex-direction: row;
|
|
1471
1471
|
column-gap: 10px;
|
|
@@ -1805,7 +1805,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
|
|
|
1805
1805
|
border: none;
|
|
1806
1806
|
max-width: unset;
|
|
1807
1807
|
margin-left: 10px;
|
|
1808
|
-
`,$a=({freebieProductsInCart:t,maxFreebiesInTier:i,tierName:a,themeColor:l,themeTextColor:c,primaryTextColor:s,addFreebieToCart:d,imageAspectSelector:p="square",freebieCouponTemplates:u=[],freebieClaimData:g,isCartDrawerOpen:x=!0})=>{const[f]=le(Xi),[y]=le(Ki),b=se(ea),h=se(ta),[v,w]=le(ma),C=o(!1),[E,k]=e.useState(!1),T=g?.allowOverlayClose??!0,S=g?.freebieSectionTitle,$=g?.productClaimCtaButtonText??"Claim Gifts",B=r(()=>t?.length?t.filter(hi):[],[t]),z=r(()=>ki(B,u,i),[B,u,i]);n(()=>{if(!x)return C.current=!1,w({isOpen:!1}),void b();C.current||(h(z,a),w({isOpen:!0}),C.current=!0)},[x,z,a,h,b,w]);const N=()=>{w({isOpen:!1}),b()},I=()=>{w({isOpen:!0})};n(()=>{const e=e=>{"Escape"===e.key&&T&&N()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[T]);const F=0===f.selectedProducts.length||E;if(!v.isOpen)return e.createElement("div",{style:{display:"flex",flexDirection:"column",marginTop:"5px"}},e.createElement(ka,{onClick:I},e.createElement(Ta,{$primaryTextColor:s},e.createElement(m,{size:16}),S??"Freebies"," • ",z," items available"),e.createElement(Sa,null)));const P=e.createElement(ga,{role:"dialog","aria-modal":"true",onClick:T?N:void 0},e.createElement(xa,{onClick:e=>e.stopPropagation(),"aria-labelledby":"freebie-modal-title"},e.createElement(fa,null,e.createElement(ya,null,e.createElement(
|
|
1808
|
+
`,$a=({freebieProductsInCart:t,maxFreebiesInTier:i,tierName:a,themeColor:l,themeTextColor:c,primaryTextColor:s,addFreebieToCart:d,imageAspectSelector:p="square",freebieCouponTemplates:u=[],freebieClaimData:g,isCartDrawerOpen:x=!0})=>{const[f]=le(Xi),[y]=le(Ki),b=se(ea),h=se(ta),[v,w]=le(ma),C=o(!1),[E,k]=e.useState(!1),T=g?.allowOverlayClose??!0,S=g?.freebieSectionTitle,$=g?.productClaimCtaButtonText??"Claim Gifts",B=r(()=>t?.length?t.filter(hi):[],[t]),z=r(()=>ki(B,u,i),[B,u,i]);n(()=>{if(!x)return C.current=!1,w({isOpen:!1}),void b();C.current||(h(z,a),w({isOpen:!0}),C.current=!0)},[x,z,a,h,b,w]);const N=()=>{w({isOpen:!1}),b()},I=()=>{w({isOpen:!0})};n(()=>{const e=e=>{"Escape"===e.key&&T&&N()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[T]);const F=0===f.selectedProducts.length||E;if(!v.isOpen)return e.createElement("div",{style:{display:"flex",flexDirection:"column",marginTop:"5px"}},e.createElement(ka,{onClick:I},e.createElement(Ta,{$primaryTextColor:s},e.createElement(m,{size:16}),S??"Freebies"," • ",z," items available"),e.createElement(Sa,null)));const P=e.createElement(ga,{role:"dialog","aria-modal":"true",onClick:T?N:void 0},e.createElement(xa,{onClick:e=>e.stopPropagation(),"aria-labelledby":"freebie-modal-title"},e.createElement(fa,null,e.createElement(ya,null,e.createElement(j,{color:"#4D4D4D",size:22})),e.createElement(ba,{id:"freebie-modal-title"},e.createElement("span",{className:"bold"},"Freebie")," Unlocked!"),e.createElement(ha,null,"claim up to ",e.createElement("span",{className:"bold"},z," items")," for free")),e.createElement(va,null,e.createElement(wa,null,B.map(t=>e.createElement(ua,{key:t.id,product:t,imageAspectSelector:p,freebieCouponTemplates:u,accentColor:l,freebieProductsInCart:B})))),e.createElement(Ca,null,e.createElement(Ea,{$themeColor:l||"#000",$themeTextColor:c,$disabled:F,onClick:async()=>{if(f.selectedProducts.length>0&&!E){k(!0);try{await d(f.selectedProducts),N()}catch(e){console.error("Failed to add freebies:",e)}finally{k(!1)}}},disabled:F},E?"Adding to Cart...":y>0?`${$} • ${y}/${z} added`:`${y}/${z} added`))));return"undefined"!=typeof document&&document.body?D.createPortal(P,document.body):null},Ba=({freebieProductsInCart:t,themeColor:n,themeTextColor:r,primaryTextColor:o,addFreebieToCart:i,freebiesInCart:a,freebieClaimData:l,imageAspectSelector:c,freebieCouponTemplates:s,cartCheckpoints:d,isCartDrawerOpen:p})=>{const u=e.useMemo(()=>{const e=d?.filter(e=>"free_product"===e?.couponType);if(!e||0===e.length)return;const n=Array.from(new Set((t??[]).map(e=>e?.couponTemplateId).filter(e=>"number"==typeof e)));if(n.length>0){const t=e.find(e=>n.includes(e.couponTemplateId));if(t)return t}},[d,t]),m=e.useMemo(()=>{const e=u?.maxFreebiesInTier;return"number"!=typeof e||isNaN(e)?1:e},[u]),g=e.useMemo(()=>u?.name??"Freebie",[u]),x=async e=>{try{await Fi(e,t,i)}catch(e){console.error("Failed to add multiclaim freebies:",e)}},f=l?.type||"section";return"section"===f?e.createElement(Ui,{freebieProductsInCart:t,themeColor:n,themeTextColor:r,primaryTextColor:o,addFreebieToCart:i,freebiesInCart:a,imageAspectSelector:c,freebieCouponTemplates:s,maxFreebiesInTier:m,tierName:g,freebieClaimData:l}):"overlay"===f?e.createElement($a,{freebieProductsInCart:t,maxFreebiesInTier:m,tierName:g,themeColor:n,themeTextColor:r,primaryTextColor:o,addFreebieToCart:x,imageAspectSelector:c,freebieCouponTemplates:s,freebieClaimData:l,isCartDrawerOpen:p}):(console.warn(`Unknown claimDisplayType: ${f}`),null)};function za({inlineCartOfferInfoText:n,inlineCartOfferInfoRedirectLink:r,themeColor:o,tooltipText:i,themeTextColor:a}){const[l,c]=t(!1),s="polygon(0% 100%, 100% 100%, 100% 0%, 100% 0%, 90% 18%, 0% 18%)",d=e.createElement("div",{className:"yt-cart-top-bar",style:{marginTop:"4px",display:"flex",flexDirection:"row",width:"100%",fontSize:"12px",borderRadius:"none",textAlign:"center",justifyContent:"center",position:"relative",background:un(o,1),color:a,fontWeight:"var(--yt-cart-font-weight)",padding:"3px",cursor:r?"pointer":"default"}},n,i&&e.createElement("div",{className:"yt-cart-offer-info-tooltip-wrapper",style:{position:"relative",alignSelf:"center",justifySelf:"center",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(W,{size:16,style:{marginLeft:"5px",cursor:"pointer",alignSelf:"center",color:a},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)}),l&&e.createElement("div",{className:"yt-cart-offer-info-tooltip",style:{position:"absolute",top:"100%",right:"100%",zIndex:1e3,filter:"drop-shadow(0px 0px 10px rgba(0,0,0,0.1))"}},e.createElement("div",{className:"yt-cart-offer-info-tooltip-border",style:{backgroundColor:"gray",clipPath:s,padding:".5px"}},e.createElement("div",{className:"yt-cart-offer-info-tooltip-content",style:{backgroundColor:"white",clipPath:s,padding:"10px",fontSize:"10px",color:"black",whiteSpace:"nowrap",display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"15px",height:"10px"}},i)))));return r?e.createElement("a",{href:r,style:{textDecoration:"none",color:"inherit"}},d):d}bt(".react-calendar {\n width: 350px;\n max-width: 100%;\n background: white;\n border: 1px solid #a0a096;\n font-family: 'Arial', 'Helvetica', sans-serif;\n line-height: 1.125em;\n}\n\n.react-calendar--doubleView {\n width: 700px;\n}\n\n.react-calendar--doubleView .react-calendar__viewContainer {\n display: flex;\n margin: -0.5em;\n}\n\n.react-calendar--doubleView .react-calendar__viewContainer > * {\n width: 50%;\n margin: 0.5em;\n}\n\n.react-calendar,\n.react-calendar *,\n.react-calendar *:before,\n.react-calendar *:after {\n -moz-box-sizing: border-box;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n\n.react-calendar button {\n margin: 0;\n border: 0;\n outline: none;\n}\n\n.react-calendar button:enabled:hover {\n cursor: pointer;\n}\n\n.react-calendar__navigation {\n display: flex;\n height: 44px;\n margin-bottom: 1em;\n}\n\n.react-calendar__navigation button {\n min-width: 44px;\n background: none;\n}\n\n.react-calendar__navigation button:disabled {\n background-color: #f0f0f0;\n}\n\n.react-calendar__navigation button:enabled:hover,\n.react-calendar__navigation button:enabled:focus {\n background-color: #e6e6e6;\n}\n\n.react-calendar__month-view__weekdays {\n text-align: center;\n text-transform: uppercase;\n font: inherit;\n font-size: 0.75em;\n font-weight: bold;\n}\n\n.react-calendar__month-view__weekdays__weekday {\n padding: 0.5em;\n}\n\n.react-calendar__month-view__weekNumbers .react-calendar__tile {\n display: flex;\n align-items: center;\n justify-content: center;\n font: inherit;\n font-size: 0.75em;\n font-weight: bold;\n}\n\n.react-calendar__month-view__days__day--weekend {\n color: #d10000;\n}\n\n.react-calendar__month-view__days__day--neighboringMonth,\n.react-calendar__decade-view__years__year--neighboringDecade,\n.react-calendar__century-view__decades__decade--neighboringCentury {\n color: #757575;\n}\n\n.react-calendar__year-view .react-calendar__tile,\n.react-calendar__decade-view .react-calendar__tile,\n.react-calendar__century-view .react-calendar__tile {\n padding: 2em 0.5em;\n}\n\n.react-calendar__tile {\n max-width: 100%;\n padding: 10px 6.6667px;\n background: none;\n text-align: center;\n font: inherit;\n font-size: 0.833em;\n}\n\n.react-calendar__tile:disabled {\n background-color: #f0f0f0;\n color: #ababab;\n}\n\n.react-calendar__month-view__days__day--neighboringMonth:disabled,\n.react-calendar__decade-view__years__year--neighboringDecade:disabled,\n.react-calendar__century-view__decades__decade--neighboringCentury:disabled {\n color: #cdcdcd;\n}\n\n.react-calendar__tile:enabled:hover,\n.react-calendar__tile:enabled:focus {\n background-color: #e6e6e6;\n}\n\n.react-calendar__tile--now {\n background: #ffff76;\n}\n\n.react-calendar__tile--now:enabled:hover,\n.react-calendar__tile--now:enabled:focus {\n background: #ffffa9;\n}\n\n.react-calendar__tile--hasActive {\n background: #76baff;\n}\n\n.react-calendar__tile--hasActive:enabled:hover,\n.react-calendar__tile--hasActive:enabled:focus {\n background: #a9d4ff;\n}\n\n.react-calendar__tile--active {\n background: #006edc;\n color: white;\n}\n\n.react-calendar__tile--active:enabled:hover,\n.react-calendar__tile--active:enabled:focus {\n background: #1087ff;\n}\n\n.react-calendar--selectRange .react-calendar__tile--hover {\n background-color: #e6e6e6;\n}\n");bt(".custom-date-picker {\r\n position: relative;\r\n width: 100%;\r\n}\r\n\r\n.date-display {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n cursor: pointer;\r\n}\r\n\r\n.date-display span {\r\n color: black;\r\n}\r\n\r\n.date-display svg {\r\n width: 20px;\r\n height: 20px;\r\n color: rgb(73, 69, 69);\r\n}\r\n\r\n.calendar-container {\r\n position: absolute;\r\n bottom: 100%;\r\n left: -10%;\r\n z-index: 10;\r\n margin-top: 10px;\r\n}\r\n\r\n.custom-calendar {\r\n background-color: white;\r\n border-radius: 6px;\r\n box-shadow: 0 4px 6px rgba(10, 8, 8, 0.1);\r\n border: 1px solid darken(#674918, 50%);\r\n}\r\n");const Na=c(xt)`
|
|
1809
1809
|
.react-calendar {
|
|
1810
1810
|
font-family: Arial, sans-serif;
|
|
1811
1811
|
color: ${e=>e.tileTextColor||"#374151"} !important;
|
|
@@ -1902,7 +1902,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
|
|
|
1902
1902
|
.active-date abbr {
|
|
1903
1903
|
color: ${e=>e.tileTextColor||"#374151"} !important;
|
|
1904
1904
|
}
|
|
1905
|
-
`,Ia=({themeColor:r,themeTextColor:o,disabledDates:a=[]})=>{const[l,c]=t(!1),[s,d]=le(tn),p=se(Kt),u=e.useRef(null),m=s?new Date(s):null,g=Array.isArray(a)?a:[a],x=i(()=>{const e=new Date;return e.setDate(e.getDate()+1),e},[]),y=i(e=>g.some(t=>t instanceof Date&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())),[g]),b=i(e=>{if(!e)return!1;const t=x(),n=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n>=new Date(t.getFullYear(),t.getMonth(),t.getDate())&&!y(n)},[x,y]);n(()=>{const e=e=>{u.current&&!u.current.contains(e.target)&&c(!1)};return l&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[l]),n(()=>{const e=b(m);p(t=>t.isDateValid!==e?{...t,isDateValid:e}:t)},[m,b,p]);const h=i(({date:e,view:t})=>{if("month"===t){const t=x(),n=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(n>=new Date(t.getFullYear(),t.getMonth(),t.getDate())&&!y(n)){const e=s?new Date(s):null;return e&&n.getFullYear()===e.getFullYear()&&n.getMonth()===e.getMonth()&&n.getDate()===e.getDate()?"active-date":"black-date"}}return null},[x,s,y]);return e.createElement("div",{className:"yt-cart-date-picker custom-date-picker"},e.createElement("div",{className:"yt-cart-date-display date-display",onClick:()=>c(!l)},e.createElement("span",{style:{fontSize:"12px"}},(v=s?new Date(s):null)?v.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"/"):"Select a date"),e.createElement(f,null)),l&&e.createElement("div",{className:"yt-cart-calendar-container calendar-container",ref:u},e.createElement(Na,{onChange:(e,t)=>{e instanceof Date&&!y(e)&&(d(e.toISOString()),c(!1));const n=b(e instanceof Date?e:null);p(e=>e.isDateValid!==n?{...e,isDateValid:n}:e)},value:s?new Date(s):null,className:"custom-calendar",minDate:x(),tileBackgroundColor:r,tileTextColor:o,tileHoverColor:un(r,.2),tileClassName:h,tileDisabled:({date:e,view:t})=>"month"===t&&y(e)})));var v};bt(".shipment-container {\n font-family: Arial, sans-serif;\n max-width: 400px;\n padding: 3px;\n padding-bottom: 0;\n background-color: #fff;\n border-radius: 8px;\n margin: 8px 1rem;\n}\n\n.shipment-header {\n background-color: #f6efdd;\n padding: 4px;\n border-radius: 0px;\n margin-bottom: 12px;\n}\n\n.shipment-header-text {\n color: #ae8846;\n font-size: 14px;\n font-weight: 500;\n text-align: center;\n margin: 0;\n line-height: normal;\n}\n\n.shipment-option {\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n padding: 12px;\n margin-bottom: 8px;\n cursor: pointer;\n transition: all 0.3s ease;\n}\n\n.shipment-option:hover {\n background-color: #f9fafb;\n}\n\n.shipment-option.selected {\n border-color: #ae8846;\n border-width: 1 1 0 2 px;\n box-shadow: 0 0 0 1px #ae8846;\n}\n\n.option-content {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.option-title {\n font-size: 12px;\n margin-bottom: 4px;\n font-weight: 600;\n}\n\n.option-subtitle {\n color: #6b7280;\n font-size: 10px;\n}\n\n.checkmark {\n color: #ae8846;\n font-size: 20px;\n font-weight: bold;\n}\n\n.availability-check {\n margin-top: 8px;\n}\n\n.availability-title {\n font-size: 12px;\n color: #374151;\n margin-bottom: 3px;\n font-weight: 600;\n}\n\n.availability-input {\n width: 98%;\n padding: 2px;\n border: none;\n border-bottom: 2px solid #d1d5db;\n border-radius: 0;\n font-size: 12px;\n transition: border-color 0.3s ease;\n background: none;\n outline: none;\n font-weight: 500 !important;\n box-shadow: none;\n text-shadow: none;\n}\n\n.availability-input:focus {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n font-weight: 500 !important;\n box-shadow: none;\n text-shadow: none;\n}\n\n.availability-input:hover {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n font-weight: 500 !important;\n}\n\n.error-message {\n background-color: #fee2e2;\n color: #b91c1c;\n padding: 6px;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n font-size: 13px;\n margin-top: 10px;\n display: flex;\n align-items: center;\n margin-bottom: -12px;\n margin-left: -12px;\n margin-right: -12px;\n line-height: normal;\n justify-content: center;\n text-align: center;\n}\n\n.error-icon {\n margin-right: 8px;\n}\n\n.slot {\n width: 98%;\n margin-top: 4px;\n padding: 4px;\n display: flex;\n justify-content: space-between;\n align-items: left;\n flex-direction: column;\n border-bottom: 2px solid #e5e7eb;\n}\n\n.slot:focus {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n}\n\n.slot:hover {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n}\n\n.slot-label {\n font-size: 12px;\n margin-bottom: 4px;\n color: #374151;\n margin-left: -4px;\n font-weight: 600;\n}\n\n.success-message {\n background-color: #dcf6ee;\n color: #307d66;\n padding: 6px;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n font-size: 13px;\n margin-top: 6px;\n display: flex;\n align-items: center;\n margin-bottom: -12px;\n margin-left: -12px;\n margin-right: -12px;\n line-height: normal;\n justify-content: center;\n}");const Fa=({title:r="Cart Item(s) available in NCR only",backgroundColor:a="#F6EFDD78",tag:l="NCR",postalCodeList:c=[110001,110002,110003,110004,110005],themeColor:s,themeTextColor:d,enableSlotPicker:p,deliveryHeaderTitle:u,deliveryAvailableText:m,deliveryNotAvailableText:g,disabledDates:x})=>{const[f,y]=t(!1),[b,h]=le(Mr),[v,w]=le(Kt),[C,E]=le(en),k=ce(Jt),T=o(null),S=i(e=>{const t=c.includes(e);y(!t),w(e=>({...e,isPostalCodeValid:t}))},[c,w]);return n(()=>{E("specific")},[]),n(()=>{void 0!==b&&S(b)},[b,S]),n(()=>{!1===p&&w(e=>e.isDateValid?e:{...e,isDateValid:!0})},[p,w]),e.createElement("div",null,u&&e.createElement("div",{className:"shipment-header"},e.createElement("h2",{className:"shipment-header-text"},u)),e.createElement("div",{className:"availability-check",style:{border:`2px solid ${s||"black"}`,padding:"12px",borderRadius:"8px",margin:"8px 1rem"}},e.createElement("div",{className:"availability-title"},"Check Shipment Availability"),e.createElement("input",{className:"availability-input",type:"text",placeholder:"Enter Postal Code",value:b||"",onChange:e=>{const t=e.target.value;if(""===t)return h(void 0),y(!1),void w(e=>({...e,isPostalCodeValid:!1}));if(!/^\d+$/.test(t))return;const n=Number(t);h(n),y(!1),w(e=>({...e,isPostalCodeValid:!1})),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{S(n)},1e3)},onBlur:()=>{T.current&&clearTimeout(T.current),void 0!==b&&S(b)}}),f&&e.createElement("div",{className:"error-message"},g||"Cart items aren't available at your address"),v.isPostalCodeValid&&p&&e.createElement("div",{className:"slot"},e.createElement("label",{className:"slot-label"},"Select Delivery Slot"),e.createElement(Ia,{themeColor:s,themeTextColor:d,disabledDates:x})),k&&e.createElement("div",{className:"success-message"},m||"Voila! Local delivery is available")))},Pa=({postalCodeList:r=[110001,110002,110003,110004,110005],themeColor:a,themeTextColor:l,enableSlotPicker:c,disabledDates:s})=>{const[d,p]=t("standard"),[u,m]=t(!1),[g,x]=le(Mr),[f,y]=le(Kt),[b,h]=le(en),v=ce(Jt),w=o(null),C=i(e=>{const t=r.includes(e);e?(m(!t),y(e=>({...e,isPostalCodeValid:t}))):y(e=>({...e,isPostalCodeValid:!1}))},[r,y]);return n(()=>{h("delhi-ncr"===d?"specific":"standard"),g&&C(g)},[d]),e.createElement("div",{className:"shipment-container"},e.createElement("div",{className:"shipment-header"},e.createElement("p",{className:"shipment-header-text"},"Cart Item(s) are available for standard shipment")),e.createElement("div",{className:"shipment-option "+("standard"===d?"selected":""),onClick:()=>p("standard")},e.createElement("div",{className:"option-content"},e.createElement("div",{className:"option-text"},e.createElement("div",{className:"option-title"},"Pan India"),e.createElement("div",{className:"option-subtitle"},"7-10 days")),"standard"===d&&e.createElement(
|
|
1905
|
+
`,Ia=({themeColor:r,themeTextColor:o,disabledDates:a=[]})=>{const[l,c]=t(!1),[s,d]=le(tn),p=se(Kt),u=e.useRef(null),m=s?new Date(s):null,g=Array.isArray(a)?a:[a],x=i(()=>{const e=new Date;return e.setDate(e.getDate()+1),e},[]),y=i(e=>g.some(t=>t instanceof Date&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())),[g]),b=i(e=>{if(!e)return!1;const t=x(),n=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n>=new Date(t.getFullYear(),t.getMonth(),t.getDate())&&!y(n)},[x,y]);n(()=>{const e=e=>{u.current&&!u.current.contains(e.target)&&c(!1)};return l&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[l]),n(()=>{const e=b(m);p(t=>t.isDateValid!==e?{...t,isDateValid:e}:t)},[m,b,p]);const h=i(({date:e,view:t})=>{if("month"===t){const t=x(),n=new Date(e.getFullYear(),e.getMonth(),e.getDate());if(n>=new Date(t.getFullYear(),t.getMonth(),t.getDate())&&!y(n)){const e=s?new Date(s):null;return e&&n.getFullYear()===e.getFullYear()&&n.getMonth()===e.getMonth()&&n.getDate()===e.getDate()?"active-date":"black-date"}}return null},[x,s,y]);return e.createElement("div",{className:"yt-cart-date-picker custom-date-picker"},e.createElement("div",{className:"yt-cart-date-display date-display",onClick:()=>c(!l)},e.createElement("span",{style:{fontSize:"12px"}},(v=s?new Date(s):null)?v.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"/"):"Select a date"),e.createElement(f,null)),l&&e.createElement("div",{className:"yt-cart-calendar-container calendar-container",ref:u},e.createElement(Na,{onChange:(e,t)=>{e instanceof Date&&!y(e)&&(d(e.toISOString()),c(!1));const n=b(e instanceof Date?e:null);p(e=>e.isDateValid!==n?{...e,isDateValid:n}:e)},value:s?new Date(s):null,className:"custom-calendar",minDate:x(),tileBackgroundColor:r,tileTextColor:o,tileHoverColor:un(r,.2),tileClassName:h,tileDisabled:({date:e,view:t})=>"month"===t&&y(e)})));var v};bt(".shipment-container {\n font-family: Arial, sans-serif;\n max-width: 400px;\n padding: 3px;\n padding-bottom: 0;\n background-color: #fff;\n border-radius: 8px;\n margin: 8px 1rem;\n}\n\n.shipment-header {\n background-color: #f6efdd;\n padding: 4px;\n border-radius: 0px;\n margin-bottom: 12px;\n}\n\n.shipment-header-text {\n color: #ae8846;\n font-size: 14px;\n font-weight: 500;\n text-align: center;\n margin: 0;\n line-height: normal;\n}\n\n.shipment-option {\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n padding: 12px;\n margin-bottom: 8px;\n cursor: pointer;\n transition: all 0.3s ease;\n}\n\n.shipment-option:hover {\n background-color: #f9fafb;\n}\n\n.shipment-option.selected {\n border-color: #ae8846;\n border-width: 1 1 0 2 px;\n box-shadow: 0 0 0 1px #ae8846;\n}\n\n.option-content {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.option-title {\n font-size: 12px;\n margin-bottom: 4px;\n font-weight: 600;\n}\n\n.option-subtitle {\n color: #6b7280;\n font-size: 10px;\n}\n\n.checkmark {\n color: #ae8846;\n font-size: 20px;\n font-weight: bold;\n}\n\n.availability-check {\n margin-top: 8px;\n}\n\n.availability-title {\n font-size: 12px;\n color: #374151;\n margin-bottom: 3px;\n font-weight: 600;\n}\n\n.availability-input {\n width: 98%;\n padding: 2px;\n border: none;\n border-bottom: 2px solid #d1d5db;\n border-radius: 0;\n font-size: 12px;\n transition: border-color 0.3s ease;\n background: none;\n outline: none;\n font-weight: 500 !important;\n box-shadow: none;\n text-shadow: none;\n}\n\n.availability-input:focus {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n font-weight: 500 !important;\n box-shadow: none;\n text-shadow: none;\n}\n\n.availability-input:hover {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n font-weight: 500 !important;\n}\n\n.error-message {\n background-color: #fee2e2;\n color: #b91c1c;\n padding: 6px;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n font-size: 13px;\n margin-top: 10px;\n display: flex;\n align-items: center;\n margin-bottom: -12px;\n margin-left: -12px;\n margin-right: -12px;\n line-height: normal;\n justify-content: center;\n text-align: center;\n}\n\n.error-icon {\n margin-right: 8px;\n}\n\n.slot {\n width: 98%;\n margin-top: 4px;\n padding: 4px;\n display: flex;\n justify-content: space-between;\n align-items: left;\n flex-direction: column;\n border-bottom: 2px solid #e5e7eb;\n}\n\n.slot:focus {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n}\n\n.slot:hover {\n outline: none;\n border-color: #ae8846;\n border: none;\n border-bottom: 2px solid #000000;\n border-radius: 0;\n}\n\n.slot-label {\n font-size: 12px;\n margin-bottom: 4px;\n color: #374151;\n margin-left: -4px;\n font-weight: 600;\n}\n\n.success-message {\n background-color: #dcf6ee;\n color: #307d66;\n padding: 6px;\n border-bottom-left-radius: 6px;\n border-bottom-right-radius: 6px;\n font-size: 13px;\n margin-top: 6px;\n display: flex;\n align-items: center;\n margin-bottom: -12px;\n margin-left: -12px;\n margin-right: -12px;\n line-height: normal;\n justify-content: center;\n}");const Fa=({title:r="Cart Item(s) available in NCR only",backgroundColor:a="#F6EFDD78",tag:l="NCR",postalCodeList:c=[110001,110002,110003,110004,110005],themeColor:s,themeTextColor:d,enableSlotPicker:p,deliveryHeaderTitle:u,deliveryAvailableText:m,deliveryNotAvailableText:g,disabledDates:x})=>{const[f,y]=t(!1),[b,h]=le(Mr),[v,w]=le(Kt),[C,E]=le(en),k=ce(Jt),T=o(null),S=i(e=>{const t=c.includes(e);y(!t),w(e=>({...e,isPostalCodeValid:t}))},[c,w]);return n(()=>{E("specific")},[]),n(()=>{void 0!==b&&S(b)},[b,S]),n(()=>{!1===p&&w(e=>e.isDateValid?e:{...e,isDateValid:!0})},[p,w]),e.createElement("div",null,u&&e.createElement("div",{className:"shipment-header"},e.createElement("h2",{className:"shipment-header-text"},u)),e.createElement("div",{className:"availability-check",style:{border:`2px solid ${s||"black"}`,padding:"12px",borderRadius:"8px",margin:"8px 1rem"}},e.createElement("div",{className:"availability-title"},"Check Shipment Availability"),e.createElement("input",{className:"availability-input",type:"text",placeholder:"Enter Postal Code",value:b||"",onChange:e=>{const t=e.target.value;if(""===t)return h(void 0),y(!1),void w(e=>({...e,isPostalCodeValid:!1}));if(!/^\d+$/.test(t))return;const n=Number(t);h(n),y(!1),w(e=>({...e,isPostalCodeValid:!1})),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{S(n)},1e3)},onBlur:()=>{T.current&&clearTimeout(T.current),void 0!==b&&S(b)}}),f&&e.createElement("div",{className:"error-message"},g||"Cart items aren't available at your address"),v.isPostalCodeValid&&p&&e.createElement("div",{className:"slot"},e.createElement("label",{className:"slot-label"},"Select Delivery Slot"),e.createElement(Ia,{themeColor:s,themeTextColor:d,disabledDates:x})),k&&e.createElement("div",{className:"success-message"},m||"Voila! Local delivery is available")))},Pa=({postalCodeList:r=[110001,110002,110003,110004,110005],themeColor:a,themeTextColor:l,enableSlotPicker:c,disabledDates:s})=>{const[d,p]=t("standard"),[u,m]=t(!1),[g,x]=le(Mr),[f,y]=le(Kt),[b,h]=le(en),v=ce(Jt),w=o(null),C=i(e=>{const t=r.includes(e);e?(m(!t),y(e=>({...e,isPostalCodeValid:t}))):y(e=>({...e,isPostalCodeValid:!1}))},[r,y]);return n(()=>{h("delhi-ncr"===d?"specific":"standard"),g&&C(g)},[d]),e.createElement("div",{className:"shipment-container"},e.createElement("div",{className:"shipment-header"},e.createElement("p",{className:"shipment-header-text"},"Cart Item(s) are available for standard shipment")),e.createElement("div",{className:"shipment-option "+("standard"===d?"selected":""),onClick:()=>p("standard")},e.createElement("div",{className:"option-content"},e.createElement("div",{className:"option-text"},e.createElement("div",{className:"option-title"},"Pan India"),e.createElement("div",{className:"option-subtitle"},"7-10 days")),"standard"===d&&e.createElement(H,{className:"checkmark"}))),e.createElement("div",{className:"shipment-option "+("delhi-ncr"===d?"selected":""),onClick:()=>p("delhi-ncr")},e.createElement("div",{className:"option-content"},e.createElement("div",{className:"option-text"},e.createElement("div",{className:"option-title"},"Delhi NCR"),e.createElement("div",{className:"option-subtitle"},"Single day delivery")),"delhi-ncr"===d&&e.createElement(H,{className:"checkmark"})),"delhi-ncr"===d&&e.createElement("div",{className:"availability-check"},e.createElement("div",{className:"availability-title"},"Check Product Availability"),e.createElement("input",{className:"availability-input",type:"text",placeholder:"Enter Postal Code",value:g,onChange:e=>{const t=e.target.value;if(""===t)return x(void 0),m(!1),void y(e=>({...e,isPostalCodeValid:!1}));if(!/^\d+$/.test(t))return;const n=Number(t);x(n),m(!1),y(e=>({...e,isPostalCodeValid:!1})),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{C(n)},1e3)},onBlur:()=>{w.current&&clearTimeout(w.current),C(g)}}),u&&e.createElement("div",{className:"error-message"},"Cart items aren't available on your selected pincode for quick shipment"),f.isPostalCodeValid&&c&&e.createElement("div",{className:"slot"},e.createElement("label",{className:"slot-label"},"Pick a Selivery Slot"),e.createElement(Ia,{themeColor:a,themeTextColor:l,disabledDates:s})),v&&e.createElement("div",{className:"success-message"},"Voila! Local delivery is available"))))},Da=de("gift_wrap",!1);de("gift_wrap_id","");const Aa=c.img`
|
|
1906
1906
|
width: 24px !important;
|
|
1907
1907
|
height: 24px !important;
|
|
1908
1908
|
min-width: 24px !important;
|
|
@@ -1949,7 +1949,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
|
|
|
1949
1949
|
font-size: 12px;
|
|
1950
1950
|
margin-top: 5px;
|
|
1951
1951
|
padding: 0 20px;
|
|
1952
|
-
`,Va=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function ja({themeColor:r,id:o,showPrice:i,detail:a,errorText:l,customText:c,showGiftIcon:s,showProductImage:d,addCartItem:p,removeCartItem:u}){const[m,g]=le(Da),[x,f]=t(null),[y,b]=t(!1),[h,v]=t(null),{setLoading:w}=rn();n(()=>{a?.availableForSale&&b(!0),a?.variants?.nodes&&a?.variants?.nodes.length>0&&f(a?.variants?.nodes[0])},[a]);const C=async()=>{try{w(!0,!0),v(null),g(!m),!m&&p&&x?await p(Va(x?.id),1):m&&u&&x&&await u(Va(x?.id),"giftWrap"),w(!1,!1)}catch(e){w(!1,!1),v("Failed to add to cart"),g(m),console.error("Error updating gift wrap:",e)}},E=x?.price?.amount,k=x?.image?.url||a?.featuredImage?.url;return y?e.createElement(_a,{className:"yt-cart-gift-wrap-container"},e.createElement(Ra,{className:"yt-cart-gift-wrap-row",onClick:C},e.createElement(La,{className:"yt-cart-gift-wrap-text-container"},d&&k?e.createElement(Aa,{className:"yt-cart-gift-wrap-product-image",src:k,alt:"Gift wrap"}):s?e.createElement(
|
|
1952
|
+
`,Va=e=>{if("string"!=typeof e)return e;const t=e.match(/^gid:\/\/shopify\/\w+\/(\d+)$/);return t?t[1]:e};function ja({themeColor:r,id:o,showPrice:i,detail:a,errorText:l,customText:c,showGiftIcon:s,showProductImage:d,addCartItem:p,removeCartItem:u}){const[m,g]=le(Da),[x,f]=t(null),[y,b]=t(!1),[h,v]=t(null),{setLoading:w}=rn();n(()=>{a?.availableForSale&&b(!0),a?.variants?.nodes&&a?.variants?.nodes.length>0&&f(a?.variants?.nodes[0])},[a]);const C=async()=>{try{w(!0,!0),v(null),g(!m),!m&&p&&x?await p(Va(x?.id),1):m&&u&&x&&await u(Va(x?.id),"giftWrap"),w(!1,!1)}catch(e){w(!1,!1),v("Failed to add to cart"),g(m),console.error("Error updating gift wrap:",e)}},E=x?.price?.amount,k=x?.image?.url||a?.featuredImage?.url;return y?e.createElement(_a,{className:"yt-cart-gift-wrap-container"},e.createElement(Ra,{className:"yt-cart-gift-wrap-row",onClick:C},e.createElement(La,{className:"yt-cart-gift-wrap-text-container"},d&&k?e.createElement(Aa,{className:"yt-cart-gift-wrap-product-image",src:k,alt:"Gift wrap"}):s?e.createElement(j,{className:"yt-cart-gift-wrap-icon",size:24,color:r,style:{height:"24px",width:"24px"}}):null,c||"+ Gift-Wrap",i?e.createElement("span",{className:"yt-cart-gift-wrap-price",style:{color:r}},"₹",Number(E).toFixed(0)):""),e.createElement(Oa,{className:"yt-cart-gift-wrap-checkbox",type:"checkbox",checked:m,onChange:C,onClick:e=>e.stopPropagation(),$themeColor:r,disabled:!y})),h&&e.createElement(Ma,{className:"yt-cart-gift-wrap-error-message"},h)):null}const Wa=c.div`
|
|
1953
1953
|
margin-top: 10px;
|
|
1954
1954
|
margin-bottom: 5px;
|
|
1955
1955
|
margin-left: 1rem;
|
|
@@ -2157,7 +2157,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
|
|
|
2157
2157
|
object-fit: cover;
|
|
2158
2158
|
display: block;
|
|
2159
2159
|
}
|
|
2160
|
-
`,cl=({imageUrls:r,redirectionLink:a,cartOffersCarouselHeight:l,enableMarquee:c=!0})=>{const s=o(null),d=o(null),p=o(null),[u,m]=t({containerWidth:0,trackWidth:0}),g=r.join("\n"),x=()=>{a&&(window.location.href=a)},f=i(()=>{const e=s.current?.getBoundingClientRect().width??0,t=d.current?.getBoundingClientRect().width??0;m(n=>n.containerWidth===e&&n.trackWidth===t?n:{containerWidth:e,trackWidth:t})},[]),y=i(()=>{null!==p.current&&window.cancelAnimationFrame(p.current),p.current=window.requestAnimationFrame(()=>{p.current=null,f()})},[f]);n(()=>{if(!c||!r||0===r.length)return;y();const e=s.current,t=d.current;if(!e||!t)return()=>{null!==p.current&&window.cancelAnimationFrame(p.current)};if("undefined"==typeof ResizeObserver)return window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y),null!==p.current&&window.cancelAnimationFrame(p.current)};const n=new ResizeObserver(y);return n.observe(e),n.observe(t),()=>{n.disconnect(),null!==p.current&&window.cancelAnimationFrame(p.current)}},[c,g,l,y]);const b=()=>{y()};if(!r||0===r.length)return null;if(!c)return e.createElement(ll,{onClick:x,style:{cursor:a?"pointer":"default"},$cartOffersCarouselHeight:l},e.createElement("img",{src:r[0],alt:"banner"}));const h=u.trackWidth,v=h>0?Math.max(2,Math.ceil((u.containerWidth+h)/h)):2;return e.createElement(al,{ref:s,onClick:x,style:{cursor:a?"pointer":"default"},$cartOffersCarouselHeight:l,$marqueeTrackWidth:h,$isMarqueeReady:h>0},e.createElement("div",{className:"marquee-wrapper"},e.createElement("div",{className:"marquee-content",ref:d},r.map((t,n)=>e.createElement("img",{key:`marquee-img-primary-${n}`,src:t,alt:`banner ${n+1}`,onLoad:b,onError:b}))),Array.from({length:v-1}).map((t,n)=>e.createElement("div",{className:"marquee-content","aria-hidden":"true",key:`marquee-repeat-${n}`},r.map((t,r)=>e.createElement("img",{key:`marquee-img-repeat-${n}-${r}`,src:t,alt:""}))))))},sl=({backgroundColor:r,titleText:o,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 an(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(o&&o.trim()||i&&i.trim()),b=[...y?[{type:"default",titleText:o,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&&xn(g.current)},[r,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(Ua,{ref:g,$backgroundColor:r},e.createElement(Ga,null,w?e.createElement(tl,null,e.createElement(ol,{$position:"left",onClick:()=>{m(e=>0===e?h-1:e-1)}},e.createElement(Be,null)),e.createElement(nl,{$currentIndex:u},b.map((t,n)=>e.createElement(rl,{key:n,onClick:()=>C(t),style:{cursor:"criteria"===t.type&&t.redirectionUrl||"default"===t.type&&s?"pointer":"default"}},e.createElement(Za,null,e.createElement(Ka,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement(Ja,{style:{textAlign:"center"}},t.descriptionText))))),e.createElement(ol,{$position:"right",onClick:()=>{m(e=>(e+1)%h)}},e.createElement(ze,null))):e.createElement(Za,{onClick:()=>E&&C(E),style:{cursor:k?"pointer":"default"}},(()=>{const t=b[u]??b[0];return e.createElement(e.Fragment,null,e.createElement(Ka,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement(Ja,{style:{textAlign:"center"}},t.descriptionText))})()))):null},dl=({backgroundColor:t,imageUrl:r,titleText:o,descriptionText:i,textAlignment:a,redirectionUrl:l})=>{const c=e.useRef(null);n(()=>{c.current&&xn(c.current)},[t]);return e.createElement(Qa,{ref:c,$backgroundColor:t,onClick:()=>{l&&(window.location.href=l)},style:{cursor:l?"pointer":"default"}},e.createElement(Ya,null,e.createElement(Xa,{$imageUrl:r}),e.createElement(Za,null,e.createElement(Ka,{style:{textAlign:"center"}},o),e.createElement(Ja,{style:{textAlign:"center"}},i))))},pl=({backgroundColor:t,couponCode:r,copySuccess:o,setCopySuccess:i,titleText:a,descriptionText:l,textAlignment:c="center"})=>{const s=e.useRef(null);n(()=>{s.current&&xn(s.current)},[t]);return e.createElement(Qa,{ref:s,$backgroundColor:t,style:{position:"relative"}},e.createElement(Ya,{style:{filter:o?"blur(5px)":"none",zIndex:1}},e.createElement(Za,{style:{borderRight:"1px solid #d9d9d9",paddingRight:"5px"}},e.createElement(Ka,{style:{textAlign:"center"}},a),e.createElement(Ja,{style:{textAlign:"center"}},l)),e.createElement(el,null,e.createElement(me,{className:"copy-icon",size:24,onClick:()=>(e=>{navigator.clipboard.writeText(e).then(()=>{i(!0)},e=>{i(!1)}),setTimeout(()=>{i(!1)},3e3)})(r),style:{height:"24px",width:"24px"}}))))},ul=({children:r,autoSlide:o=!0,autoSlideInterval:i,copySuccess:a,themeColor:l})=>{const[c,s]=t(0),d=e.Children.count(r),[p,u]=t(!1),[m,g]=t(o),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(il,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(
|
|
2160
|
+
`,cl=({imageUrls:r,redirectionLink:a,cartOffersCarouselHeight:l,enableMarquee:c=!0})=>{const s=o(null),d=o(null),p=o(null),[u,m]=t({containerWidth:0,trackWidth:0}),g=r.join("\n"),x=()=>{a&&(window.location.href=a)},f=i(()=>{const e=s.current?.getBoundingClientRect().width??0,t=d.current?.getBoundingClientRect().width??0;m(n=>n.containerWidth===e&&n.trackWidth===t?n:{containerWidth:e,trackWidth:t})},[]),y=i(()=>{null!==p.current&&window.cancelAnimationFrame(p.current),p.current=window.requestAnimationFrame(()=>{p.current=null,f()})},[f]);n(()=>{if(!c||!r||0===r.length)return;y();const e=s.current,t=d.current;if(!e||!t)return()=>{null!==p.current&&window.cancelAnimationFrame(p.current)};if("undefined"==typeof ResizeObserver)return window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y),null!==p.current&&window.cancelAnimationFrame(p.current)};const n=new ResizeObserver(y);return n.observe(e),n.observe(t),()=>{n.disconnect(),null!==p.current&&window.cancelAnimationFrame(p.current)}},[c,g,l,y]);const b=()=>{y()};if(!r||0===r.length)return null;if(!c)return e.createElement(ll,{onClick:x,style:{cursor:a?"pointer":"default"},$cartOffersCarouselHeight:l},e.createElement("img",{src:r[0],alt:"banner"}));const h=u.trackWidth,v=h>0?Math.max(2,Math.ceil((u.containerWidth+h)/h)):2;return e.createElement(al,{ref:s,onClick:x,style:{cursor:a?"pointer":"default"},$cartOffersCarouselHeight:l,$marqueeTrackWidth:h,$isMarqueeReady:h>0},e.createElement("div",{className:"marquee-wrapper"},e.createElement("div",{className:"marquee-content",ref:d},r.map((t,n)=>e.createElement("img",{key:`marquee-img-primary-${n}`,src:t,alt:`banner ${n+1}`,onLoad:b,onError:b}))),Array.from({length:v-1}).map((t,n)=>e.createElement("div",{className:"marquee-content","aria-hidden":"true",key:`marquee-repeat-${n}`},r.map((t,r)=>e.createElement("img",{key:`marquee-img-repeat-${n}-${r}`,src:t,alt:""}))))))},sl=({backgroundColor:r,titleText:o,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 an(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(o&&o.trim()||i&&i.trim()),b=[...y?[{type:"default",titleText:o,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&&xn(g.current)},[r,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(Ua,{ref:g,$backgroundColor:r},e.createElement(Ga,null,w?e.createElement(tl,null,e.createElement(ol,{$position:"left",onClick:()=>{m(e=>0===e?h-1:e-1)}},e.createElement(Be,null)),e.createElement(nl,{$currentIndex:u},b.map((t,n)=>e.createElement(rl,{key:n,onClick:()=>C(t),style:{cursor:"criteria"===t.type&&t.redirectionUrl||"default"===t.type&&s?"pointer":"default"}},e.createElement(Za,null,e.createElement(Ka,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement(Ja,{style:{textAlign:"center"}},t.descriptionText))))),e.createElement(ol,{$position:"right",onClick:()=>{m(e=>(e+1)%h)}},e.createElement(ze,null))):e.createElement(Za,{onClick:()=>E&&C(E),style:{cursor:k?"pointer":"default"}},(()=>{const t=b[u]??b[0];return e.createElement(e.Fragment,null,e.createElement(Ka,{style:{textAlign:"center"}},t.titleText),t.descriptionText&&e.createElement(Ja,{style:{textAlign:"center"}},t.descriptionText))})()))):null},dl=({backgroundColor:t,imageUrl:r,titleText:o,descriptionText:i,textAlignment:a,redirectionUrl:l})=>{const c=e.useRef(null);n(()=>{c.current&&xn(c.current)},[t]);return e.createElement(Qa,{ref:c,$backgroundColor:t,onClick:()=>{l&&(window.location.href=l)},style:{cursor:l?"pointer":"default"}},e.createElement(Ya,null,e.createElement(Xa,{$imageUrl:r}),e.createElement(Za,null,e.createElement(Ka,{style:{textAlign:"center"}},o),e.createElement(Ja,{style:{textAlign:"center"}},i))))},pl=({backgroundColor:t,couponCode:r,copySuccess:o,setCopySuccess:i,titleText:a,descriptionText:l,textAlignment:c="center"})=>{const s=e.useRef(null);n(()=>{s.current&&xn(s.current)},[t]);return e.createElement(Qa,{ref:s,$backgroundColor:t,style:{position:"relative"}},e.createElement(Ya,{style:{filter:o?"blur(5px)":"none",zIndex:1}},e.createElement(Za,{style:{borderRight:"1px solid #d9d9d9",paddingRight:"5px"}},e.createElement(Ka,{style:{textAlign:"center"}},a),e.createElement(Ja,{style:{textAlign:"center"}},l)),e.createElement(el,null,e.createElement(me,{className:"copy-icon",size:24,onClick:()=>(e=>{navigator.clipboard.writeText(e).then(()=>{i(!0)},e=>{i(!1)}),setTimeout(()=>{i(!1)},3e3)})(r),style:{height:"24px",width:"24px"}}))))},ul=({children:r,autoSlide:o=!0,autoSlideInterval:i,copySuccess:a,themeColor:l})=>{const[c,s]=t(0),d=e.Children.count(r),[p,u]=t(!1),[m,g]=t(o),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(il,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(H,{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(r)))};function ml({cartOffersCarousalData:n,themeColor:r,cartOffersCarouselHeight:o,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(cl,{key:`image-only-marquee-${t.slideNumber}`,imageUrls:u,redirectionLink:t.redirectionUrl||t.carouselRedirectionLink,cartOffersCarouselHeight:o,enableMarquee:!1!==t.enableMarquee})),x=!0);else switch(t.slideType){case"TextFieldOnly":g.push(e.createElement(sl,{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(dl,{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(pl,{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(ul,{copySuccess:a,autoSlideInterval:1e3*s,themeColor:r},g):null}const gl=s`
|
|
2161
2161
|
0% {
|
|
2162
2162
|
background-position: 200% 0;
|
|
2163
2163
|
}
|
|
@@ -2432,7 +2432,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
|
|
|
2432
2432
|
&:hover {
|
|
2433
2433
|
opacity: ${e=>e.$locked?.5:.85};
|
|
2434
2434
|
}
|
|
2435
|
-
`,Xl=e=>{const t=Number(e?.amount??e??0);return Number.isFinite(t)?t:0},Zl=(e,t)=>e.find(e=>(e?.variants?.edges??e?.variants?.nodes??[]).some(e=>{const n=e?.node??e,r=String(n?.id??"");return r.includes(t)||r.split("/").pop()===t})),Kl=(e,t)=>{const n=(e?.variants?.edges??e?.variants?.nodes??[]).find(e=>{const n=e?.node??e,r=String(n?.id??"");return r.includes(t)||r.split("/").pop()===t});return n?.node??n},Jl=({stealDealCheckpoints:i,stealDealProducts:a,freeProductAdjustedCartTotal:l,effectiveQuantityForProgressBar:c,addFreebieToCart:s,freebiesInCart:d,primaryTextColor:p})=>{const u=ce(Zt),{setLoading:m}=rn(),f=se(on),y=i?.[0],[b,h]=t(0),[v,w]=t(0),C=o(null),E=o(null),k=o(null),T=r(()=>(l||Number(u?.items_subtotal_price))/100,[l,u?.items_subtotal_price]),S=cn(u,u?.currency),$=r(()=>{if(!y)return!1;const e="minimum_order_value"===(y.customCartProgressBarCriteria??"minimum_order_value"),t=c||(u?.item_count??0);return e?T>=y.minimumOrderValue:t>=y.quantityThreshold},[y,T,u?.item_count,c]),B=y?.maxFreebiesInTier??1,z=r(()=>{if(!y)return 0;return(y.customerGetsProductIds?.ids??[]).filter(e=>d.includes(e)).length},[y,d])>=B,N=r(()=>{if(!y||!a?.length)return[];const e=y.customerGetsProductIds?.ids??[],t=[];for(const n of e){const e=Zl(a,n);if(!e)continue;const r=Kl(e,n),o=Xl(r?.price),i=Xl(r?.compareAtPrice);let l,c;"no_discount"===y.freebieType?(l=o,c=0):"percentage_off"===y.freebieType&&y.discountPercentage?(c=y.discountPercentage,l=o*(1-c/100)):(l=y.discountValue??o,c=o>0?Math.round((o-l)/o*100):0);const s=d.includes(n),p=e?._claim_allowed_variants??[n],u=i>l?i:o>l?o:null;t.push({product:e,variantId:n,isUnlocked:$,isClaimed:s,discountPercent:c,dealPrice:l,originalPrice:o,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))}},[N.length]);const I=Math.max(0,N.length-1);n(()=>{b>I&&h(I)},[I,b]);const F=()=>{h(e=>0===e?I:e-1)},P=()=>{h(e=>e===I?0:e+1)};if(!y||!N.length)return null;return e.createElement(El,null,e.createElement(kl,null,e.createElement(Tl,{style:{color:p}},e.createElement(Sl,null,"STEAL"),e.createElement($l,null,"DEALS")),z?e.createElement(Il,null,"Max ",B," claims reached"):$?e.createElement(Nl,null,e.createElement(
|
|
2435
|
+
`,Xl=e=>{const t=Number(e?.amount??e??0);return Number.isFinite(t)?t:0},Zl=(e,t)=>e.find(e=>(e?.variants?.edges??e?.variants?.nodes??[]).some(e=>{const n=e?.node??e,r=String(n?.id??"");return r.includes(t)||r.split("/").pop()===t})),Kl=(e,t)=>{const n=(e?.variants?.edges??e?.variants?.nodes??[]).find(e=>{const n=e?.node??e,r=String(n?.id??"");return r.includes(t)||r.split("/").pop()===t});return n?.node??n},Jl=({stealDealCheckpoints:i,stealDealProducts:a,freeProductAdjustedCartTotal:l,effectiveQuantityForProgressBar:c,addFreebieToCart:s,freebiesInCart:d,primaryTextColor:p})=>{const u=ce(Zt),{setLoading:m}=rn(),f=se(on),y=i?.[0],[b,h]=t(0),[v,w]=t(0),C=o(null),E=o(null),k=o(null),T=r(()=>(l||Number(u?.items_subtotal_price))/100,[l,u?.items_subtotal_price]),S=cn(u,u?.currency),$=r(()=>{if(!y)return!1;const e="minimum_order_value"===(y.customCartProgressBarCriteria??"minimum_order_value"),t=c||(u?.item_count??0);return e?T>=y.minimumOrderValue:t>=y.quantityThreshold},[y,T,u?.item_count,c]),B=y?.maxFreebiesInTier??1,z=r(()=>{if(!y)return 0;return(y.customerGetsProductIds?.ids??[]).filter(e=>d.includes(e)).length},[y,d])>=B,N=r(()=>{if(!y||!a?.length)return[];const e=y.customerGetsProductIds?.ids??[],t=[];for(const n of e){const e=Zl(a,n);if(!e)continue;const r=Kl(e,n),o=Xl(r?.price),i=Xl(r?.compareAtPrice);let l,c;"no_discount"===y.freebieType?(l=o,c=0):"percentage_off"===y.freebieType&&y.discountPercentage?(c=y.discountPercentage,l=o*(1-c/100)):(l=y.discountValue??o,c=o>0?Math.round((o-l)/o*100):0);const s=d.includes(n),p=e?._claim_allowed_variants??[n],u=i>l?i:o>l?o:null;t.push({product:e,variantId:n,isUnlocked:$,isClaimed:s,discountPercent:c,dealPrice:l,originalPrice:o,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))}},[N.length]);const I=Math.max(0,N.length-1);n(()=>{b>I&&h(I)},[I,b]);const F=()=>{h(e=>0===e?I:e-1)},P=()=>{h(e=>e===I?0:e+1)};if(!y||!N.length)return null;return e.createElement(El,null,e.createElement(kl,null,e.createElement(Tl,{style:{color:p}},e.createElement(Sl,null,"STEAL"),e.createElement($l,null,"DEALS")),z?e.createElement(Il,null,"Max ",B," claims reached"):$?e.createElement(Nl,null,e.createElement(q,{size:10}),"UNLOCKED"):e.createElement(Bl,null,e.createElement(zl,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(Fl,{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?P():F()),E.current=null,k.current=null}},N.length>1&&e.createElement(Rl,{onClick:F},e.createElement(g,{size:30,color:"#4D4D4D"})),e.createElement(Al,{position:"left",style:{display:"flex"}}),e.createElement(Al,{position:"right",style:{display:"flex"}}),e.createElement(Pl,{$cardWidth:v},e.createElement(Dl,{$translate:b*(v+10)},N.map(t=>{return e.createElement("div",{key:t.variantId,style:{width:`${v}px`,flexShrink:0},className:"yt-steal-deal-card"},e.createElement(Ol,null,e.createElement(Ml,null,e.createElement(Vl,{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(jl,null,"-",t.discountPercent,"% OFF")),e.createElement(Wl,null,e.createElement(Hl,null,t.product?.title??""),e.createElement(Yl,null,e.createElement(ql,null,e.createElement(Ql,null,S,t.dealPrice.toLocaleString()),null!==t.strikeThroughPrice&&e.createElement(Ul,null,S,t.strikeThroughPrice.toLocaleString())),e.createElement(Gl,{$locked:!t.isUnlocked||t.isClaimed||z,onClick:()=>(async e=>{if(e.isUnlocked&&!e.isClaimed&&!z&&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 r=t?.node??t;return(String(r?.id??"").split("/").pop()===n||String(r?.id??"").includes(n))&&mi(e.product,r)}))){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||z},t.isUnlocked?e.createElement(Q,{size:12}):e.createElement(U,{size:12}))))));var n}))),N.length>1&&e.createElement(Ll,{onClick:P},e.createElement(x,{size:30,color:"#4D4D4D"}))))},ec=c.div`
|
|
2436
2436
|
line-height: normal;
|
|
2437
2437
|
position: ${e=>e.$enableCustomCartOnCartPage&&e.$isCartPage?"relative":"fixed"};
|
|
2438
2438
|
top: ${e=>e.$enableCustomCartOnCartPage&&e.$isCartPage?"auto":"0"};
|
|
@@ -2467,7 +2467,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
|
|
|
2467
2467
|
font-weight: 400;
|
|
2468
2468
|
min-width: 14px;
|
|
2469
2469
|
line-height: 14px;
|
|
2470
|
-
`,nc=[...((rc={headerIds:["offers-carousel","timer","info-text"],scroll:{topIds:[],bottomIds:["steal-deal","recs"]},footerIds:["bundle","gst","freebie-claim","shipping","note","gift-wrap","coupon","loyalty","points-preview"]}).headerIds??[]).map(e=>({id:e,zone:"headerIds"})),...(rc.scroll?.topIds??[]).map(e=>({id:e,zone:"scroll.topIds"})),...(rc.scroll?.bottomIds??[]).map(e=>({id:e,zone:"scroll.bottomIds"})),...(rc.footerIds??[]).map(e=>({id:e,zone:"footerIds"}))];var rc;const oc=new Set(nc.map(e=>e.id)),ic=(e,t,n)=>{switch(t){case"headerIds":e.headerIds?.push(n);break;case"scroll.topIds":e.scroll?.topIds?.push(n);break;case"scroll.bottomIds":e.scroll?.bottomIds?.push(n);break;case"footerIds":e.footerIds?.push(n)}},ac=({isOpen:r,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:z,applyDiscount:N,checkoutFunction:I,joinNowFunction:F,guestLoyaltyPercentage:P,isDev:D,recProductsList:_,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:O,pointsRewardRate:M,showCartLevelAltPay:W,exploreCtaRedirectLink:H,discountAmountApplied:q,minimumCartValue:Q,discountInCheckoutButton:U,isStickyCheckout:Y,handleCheckpointCrossed:G,customCartProgressBarCriteria:X,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:oe,emptyProductRecsTitleText:ae,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:ze,showEditOptionOnProducts:Ne,onSetLoading:Ie,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:Pe,freebieProductsInCart:De,showFreebieClaim:Ae,addFreebieToCart:_e,freebiesInCart:Re,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Oe,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:rt,isCartPage:ot,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:zt,disableCheckoutButton:Nt,showEmptyCartRecommendations:It=!1,checkoutButtonBottomSpacing:Ft,applyCouponCode:Pt,showApplyCoupon:Dt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Lt,stealDealProducts:Ot,stealDealAddToCart:Mt,showCouponOptions:Vt,rewardCoupons:jt,couponSelectionData:Wt,useCartShell:Ht,showTrustedBadge:qt,trustedBadgeData:Qt,drawerLayoutData:Ut})=>{const Yt=ce(Zt),Gt=ce(nn),[Xt,Jt]=t(!1),[ln,cn]=t(!1),[sn,dn]=t(!0),[pn,un]=t(!0),{setLoading:mn}=rn();e.useEffect(()=>{Ie&&Ie(mn)},[Ie]);const gn=o(!!Ht&&(window.ytCartShellState?.isOpen??!1)),xn=o(null),fn=o(null);n(()=>{const e=e=>{"open"!==e.state?.ytCustomCartDrawer&&i(!1)};return r?(gn.current||(xn.current=window.history.state,fn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),gn.current=!0):(gn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(xn.current,"",fn.current??window.location.href),gn.current=!1),()=>{window.removeEventListener("popstate",e)}},[r,i]);const[yn,bn]=t(!1);n(()=>{const e=document.querySelector("body");e&&(rt&&ot?e.classList.remove("drawer-open"):!yn&&r?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[r,rt,ot,yn]),n(()=>{function e(){const e=window.innerWidth;bn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const hn=Yt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{Jt(!0),window.setTimeout(()=>Jt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[vn,wn]=t("normal"),[Cn,En]=t("normal"),[kn,Tn]=t("auto");n(()=>{CSS.supports("font-weight","500")?wn("500"):CSS.supports("font-weight","400")?wn("400"):CSS.supports("font-weight","600")&&wn("600"),CSS.supports("font-weight","400")?En("400"):CSS.supports("font-weight","300")?En("300"):CSS.supports("font-weight","200")&&En("200"),CSS.supports("width","-webkit-fill-available")?Tn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Tn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",vn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",Cn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",kn)},[vn,Cn]);const[Sn]=le(Kt),[$n]=le(tn),[Bn]=le(en);n(()=>{dn(!("all-products"!==Ge&&("specific-tags"!==Ge||Sn.isPostalCodeValid||Xe)&&("specific-tags"!==Ge||Sn.isPostalCodeValid||$n||!Xe)&&("specific-tags"===Ge&&"standard"===Bn||ln&&(Xe?Sn.isPostalCodeValid&&$n:Sn.isPostalCodeValid))))},[Sn.isPostalCodeValid,$n,ln,Ge,Xe]),le(on);const[zn,Nn]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Nn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Nn(!1)},[]);const In=()=>{Nn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")},Fn=new Date("2024-11-01"),Pn=Ht?document.getElementById("yt-cart-shell-content"):null,Dn=(e=>{const t={headerIds:[],scroll:{topIds:[],bottomIds:[]},footerIds:[]},n=new Set;return["headerIds","scroll.topIds","scroll.bottomIds","footerIds"].forEach(r=>{((e,t)=>{switch(t){case"headerIds":return e?.headerIds??[];case"scroll.topIds":return e?.scroll?.topIds??[];case"scroll.bottomIds":return e?.scroll?.bottomIds??[];case"footerIds":return e?.footerIds??[];default:return[]}})(e,r).forEach(e=>{!n.has(e)&&oc.has(e)&&(n.add(e),ic(t,r,e))})}),nc.forEach(({id:e,zone:r})=>{n.has(e)||(n.add(e),ic(t,r,e))}),t})(Ut),An=(t,n)=>{const o=`drawer-layout-${t}-${n}`;switch(t){case"offers-carousel":return xt?.enableCartOffersCarousel?e.createElement(ml,{key:o,themeColor:pe,cartOffersCarousalData:xt,cartOffersCarouselHeight:zt,cartData:Yt}):null;case"timer":return it&&zn&&Yt?.item_count?e.createElement(qa,{key:o,minutes:ct,customText:st,onTimerComplete:In}):null;case"info-text":return $e?e.createElement(za,{key:o,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Be,themeColor:pe,tooltipText:ze,themeTextColor:ue}):null;case"steal-deal":return Lt&&Lt.length>0&&Ot&&Ot.length>0&&Yt?.item_count>0?e.createElement(Jl,{key:o,stealDealCheckpoints:Lt,stealDealProducts:Ot,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Le,addFreebieToCart:Mt??_e,freebiesInCart:Re??[],themeColor:pe,primaryTextColor:te,secondaryTextColor:ne}):null;case"recs":return(t=>{const n=yn&&se&&!!_&&_.length>0&&Yt?.item_count>0&&h,r=!yn&&de&&!!_&&_.length>0&&Yt?.item_count>0&&h;return n||r?e.createElement(e.Fragment,{key:t},n&&e.createElement(Kn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,productRecsTitleText:oe,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:s}),r&&e.createElement(Kn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,productRecsTitleText:oe,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s})):null})(o);case"bundle":return Yt?.item_count>0&&w&&C?e.createElement(Oo,{key:o,bundleProducts:C}):null;case"gst":return xe&&fe&&Yt?.item_count>0?e.createElement(pi,{key:o,companyName:me,gstNumber:ge,themeColor:pe,iconColor:ft?.iconColor,showIcon:ft?.showIcon,backgroundColor:ft?.backgroundColor,textColor:ft?.textColor,title:ft?.title}):null;case"freebie-claim":return Yt&&Yt?.item_count>0&&_e&&De&&Re&&De.length>0?e.createElement(Ba,{key:o,freebieProductsInCart:De,themeColor:pe,themeTextColor:ue,primaryTextColor:te,addFreebieToCart:_e,freebiesInCart:Re,imageAspectSelector:ut,freebieCouponTemplates:Qe,freebieClaimData:Ye,cartCheckpoints:L,isCartDrawerOpen:r}):null;case"shipping":return je&&(Ve?.length??0)>0&&He&&Yt?.item_count>0?e.createElement("div",{key:o,className:"yt-cart-geolocation-section form-group"},e.createElement("div",{className:"yt-cart-shipping-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>dn(!sn)},e.createElement("span",{className:"yt-cart-shipping-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(ee,null)),e.createElement("div",{className:"yt-cart-shipping-toggle-icon icon-transition"},sn?e.createElement(V,null):e.createElement(j,null))),"all-products"===Ge&&sn?e.createElement(Fa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Fn}):sn&&(ln?e.createElement(Fa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Fn}):e.createElement(Pa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,disabledDates:Fn}))):null;case"note":return Se&&ke&&Yt?.item_count>0?e.createElement(ui,{key:o,note:Te,noteSectionTitle:yt}):null;case"gift-wrap":return et?.showGiftWrapOption&&Yt?.item_count>0?e.createElement(ja,{key:o,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}):null;case"coupon":return Yt?.item_count>0&&Vt&&jt&&Wt&&Pt&&!he?e.createElement(Ko,{key:o,rewardCoupons:jt,couponSelectionData:Wt,applyCouponCode:Pt,removeDiscount:z,enableConfetti:At,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,cartComponentsCornerRadius:gt}):Yt?.item_count>0&&Dt&&!Vt&&!he&&Pt?e.createElement(Mo,{key:o,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt,applyCouponCode:Pt,removeDiscount:z,enableConfetti:At}):null;case"loyalty":return(t=>he&&Yt?.item_count?e.createElement(e.Fragment,{key:t},v||wt?!wt&&void 0!==E&&void 0!==T&&!!k&&!!N&&e.createElement(eo,{themeColor:pe,applyDiscount:N,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:we,brandTokenName:Ct,showCartLevelAltPay:W,redemptionMultiplier:$}):!!P&&!!F&&e.createElement(Qr,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:Ce,themeColor:pe,joinNowFunction:F,guestLoyaltyPercentage:P,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,showCartLevelAltPay:W}),!!wt&&!!z&&wt&&void 0!==T&&e.createElement(Xr,{themeColor:pe,removeDiscount:z,loyaltyDiscount:wt,isDev:D,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:Ct,showCartLevelAltPay:W}),!!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)):null)(o);case"points-preview":return he&&W&&O&&k&&Yt?.item_count>0?e.createElement(hl,{key:o,loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:te,pointsRewardRate:M,rewardMultiplier:S}):null;default:return null}},_n=e.createElement(e.Fragment,null,Gt.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}},Gt.showLoader&&!Gt.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),Yt?.item_count>0&&W&&!(he&&W)&&M>0&&e.createElement(wl,{pointsRewardRate:M,loyaltyIcon:k,brandTokenName:Ct,themeColor:pe,themeTextColor:ue,rewardMultiplier:S}),hn>0&&e.createElement(tc,{className:"yt-cart-item-count-badge",$backgroundSubdued:l},hn)),e.createElement("div",{className:"yt-cart-header-actions",style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(rt&&ot)&&e.createElement("div",{className:"yt-cart-close-button close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(ie,{style:{height:"auto",width:"auto",color:te},fontSize:24,cursor:"pointer",onClick:()=>{i(!r)}})))),Gt&&e.createElement(yl,{$themeColor:pe,show:Gt.showLoader}),Xt&&At&&e.createElement(Er,{particleCount:50,spread:90,origin:{y:.3}}),Dn.headerIds?.map((e,t)=>An(e,t))),R&&Yt?.items_subtotal_price>0&&Yt?.currency&&!!L&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[br(r)]&&("minimum_order_value"!==r||1!==e?.[br(r)])).some((e,a)=>hr(e,a,i,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:i}).progressPercentage>0)}(L,an(void 0!==Pe?Pe:Yt?.items_subtotal_price,Yt.currency),void 0===Le?Yt?.item_count:Le,X??"minimum_order_value",Yt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(Pr,{isLineTierIconVisible:pn,customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:G,checkpoints:L,effectiveQuantityForProgressBar:void 0===Le?Yt?.item_count:Le,currentCartAmount:an(void 0!==Pe?Pe:Yt?.items_subtotal_price,Yt.currency),themeColor:pe,themeTextColor:ue,primaryTextColor:te,secondaryTextColor:ne,showMOVForProgressTiers:ye,progressBarFreeProductIconType:nt,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,enableConfetti:At})),Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),0===Yt?.items?.length&&0===Yt?.item_count&&!1===Gt?.showSkeletonLoader?e.createElement(_r,{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:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,emptyProductRecsTitleText:ae,backgroundSubdued:l,showEmptyCartRecommendations:It,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"}},Dn.scroll?.topIds?.map((e,t)=>An(e,t)),e.createElement(Lo,{isDev:D,themeColor:pe,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:te,secondaryTextColor:ne,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:Ne,productPercentageOffMapping:Oe,removeFreebieFromCart:Me,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ue??[],cartCheckpoints:L,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}),Dn.scroll?.bottomIds?.map((e,t)=>An(e,t)),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Cl,{showDiscountOnMRP:Et,cartCheckpoints:L,toggleDecimal:Bt,primaryTextColor:te,discountApplied:B,showTrustedBadge:qt,discountAmountApplied:q})),e.createElement(Yr,null,Dn.footerIds?.map((e,t)=>An(e,t)),Yt&&I&&Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-checkout-wrapper"},e.createElement(Vr,{disableCheckoutButton:!!Nt||Gt.cartLoading,discountApplied:B,checkoutFunction:I,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:L,toggleDecimal:Bt,checkoutButtonBottomSpacing:Ft,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:te,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:qt,trustedBadgeData:Qt}))))));return Ht&&Pn?A(_n,Pn):e.createElement(ec,{className:"yt-cart-drawer",$isDev:D,$isOpen:r,$backgroundColor:a,$enableCustomCartOnCartPage:rt,$isCartPage:ot,$isLargeScreen:yn,$switchWidthVariant:kt},_n)};bt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}\n\n.yt-byob-pagination-observer {\n display: block !important;\n}');const lc=c.div`
|
|
2470
|
+
`,nc=[...((rc={headerIds:["offers-carousel","timer","info-text"],scroll:{topIds:[],bottomIds:["steal-deal","recs"]},footerIds:["bundle","gst","freebie-claim","shipping","note","gift-wrap","coupon","loyalty","points-preview"]}).headerIds??[]).map(e=>({id:e,zone:"headerIds"})),...(rc.scroll?.topIds??[]).map(e=>({id:e,zone:"scroll.topIds"})),...(rc.scroll?.bottomIds??[]).map(e=>({id:e,zone:"scroll.bottomIds"})),...(rc.footerIds??[]).map(e=>({id:e,zone:"footerIds"}))];var rc;const oc=new Set(nc.map(e=>e.id)),ic=(e,t,n)=>{switch(t){case"headerIds":e.headerIds?.push(n);break;case"scroll.topIds":e.scroll?.topIds?.push(n);break;case"scroll.bottomIds":e.scroll?.bottomIds?.push(n);break;case"footerIds":e.footerIds?.push(n)}},ac=({isOpen:r,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:z,applyDiscount:N,checkoutFunction:I,joinNowFunction:F,guestLoyaltyPercentage:P,isDev:D,recProductsList:_,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:O,pointsRewardRate:M,showCartLevelAltPay:j,exploreCtaRedirectLink:W,discountAmountApplied:H,minimumCartValue:q,discountInCheckoutButton:Q,isStickyCheckout:U,handleCheckpointCrossed:G,customCartProgressBarCriteria:X,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,productRecsCtaButtonText:re,productRecsTitleText:oe,emptyProductRecsTitleText:ae,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:ze,showEditOptionOnProducts:Ne,onSetLoading:Ie,showVariantSelectionDropdownInProductRecs:Fe,originalCartSubtotal:Pe,freebieProductsInCart:De,showFreebieClaim:Ae,addFreebieToCart:_e,freebiesInCart:Re,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Oe,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:rt,isCartPage:ot,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:zt,disableCheckoutButton:Nt,showEmptyCartRecommendations:It=!1,checkoutButtonBottomSpacing:Ft,applyCouponCode:Pt,showApplyCoupon:Dt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Lt,stealDealProducts:Ot,stealDealAddToCart:Mt,showCouponOptions:Vt,rewardCoupons:jt,couponSelectionData:Wt,useCartShell:Ht,showTrustedBadge:qt,trustedBadgeData:Qt,drawerLayoutData:Ut})=>{const Yt=ce(Zt),Gt=ce(nn),[Xt,Jt]=t(!1),[ln,cn]=t(!1),[sn,dn]=t(!0),[pn,un]=t(!0),{setLoading:mn}=rn();e.useEffect(()=>{Ie&&Ie(mn)},[Ie]);const gn=o(!!Ht&&(window.ytCartShellState?.isOpen??!1)),xn=o(null),fn=o(null);n(()=>{const e=e=>{"open"!==e.state?.ytCustomCartDrawer&&i(!1)};return r?(gn.current||(xn.current=window.history.state,fn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),gn.current=!0):(gn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(xn.current,"",fn.current??window.location.href),gn.current=!1),()=>{window.removeEventListener("popstate",e)}},[r,i]);const[yn,bn]=t(!1);n(()=>{const e=document.querySelector("body");e&&(rt&&ot?e.classList.remove("drawer-open"):!yn&&r?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[r,rt,ot,yn]),n(()=>{function e(){const e=window.innerWidth;bn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const hn=Yt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{Jt(!0),window.setTimeout(()=>Jt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[vn,wn]=t("normal"),[Cn,En]=t("normal"),[kn,Tn]=t("auto");n(()=>{CSS.supports("font-weight","500")?wn("500"):CSS.supports("font-weight","400")?wn("400"):CSS.supports("font-weight","600")&&wn("600"),CSS.supports("font-weight","400")?En("400"):CSS.supports("font-weight","300")?En("300"):CSS.supports("font-weight","200")&&En("200"),CSS.supports("width","-webkit-fill-available")?Tn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Tn("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",vn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",Cn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",kn)},[vn,Cn]);const[Sn]=le(Kt),[$n]=le(tn),[Bn]=le(en);n(()=>{dn(!("all-products"!==Ge&&("specific-tags"!==Ge||Sn.isPostalCodeValid||Xe)&&("specific-tags"!==Ge||Sn.isPostalCodeValid||$n||!Xe)&&("specific-tags"===Ge&&"standard"===Bn||ln&&(Xe?Sn.isPostalCodeValid&&$n:Sn.isPostalCodeValid))))},[Sn.isPostalCodeValid,$n,ln,Ge,Xe]),le(on);const[zn,Nn]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Nn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Nn(!1)},[]);const In=()=>{Nn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")},Fn=new Date("2024-11-01"),Pn=Ht?document.getElementById("yt-cart-shell-content"):null,Dn=(e=>{const t={headerIds:[],scroll:{topIds:[],bottomIds:[]},footerIds:[]},n=new Set;return["headerIds","scroll.topIds","scroll.bottomIds","footerIds"].forEach(r=>{((e,t)=>{switch(t){case"headerIds":return e?.headerIds??[];case"scroll.topIds":return e?.scroll?.topIds??[];case"scroll.bottomIds":return e?.scroll?.bottomIds??[];case"footerIds":return e?.footerIds??[];default:return[]}})(e,r).forEach(e=>{!n.has(e)&&oc.has(e)&&(n.add(e),ic(t,r,e))})}),nc.forEach(({id:e,zone:r})=>{n.has(e)||(n.add(e),ic(t,r,e))}),t})(Ut),An=(t,n)=>{const o=`drawer-layout-${t}-${n}`;switch(t){case"offers-carousel":return xt?.enableCartOffersCarousel?e.createElement(ml,{key:o,themeColor:pe,cartOffersCarousalData:xt,cartOffersCarouselHeight:zt,cartData:Yt}):null;case"timer":return it&&zn&&Yt?.item_count?e.createElement(qa,{key:o,minutes:ct,customText:st,onTimerComplete:In}):null;case"info-text":return $e?e.createElement(za,{key:o,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Be,themeColor:pe,tooltipText:ze,themeTextColor:ue}):null;case"steal-deal":return Lt&&Lt.length>0&&Ot&&Ot.length>0&&Yt?.item_count>0?e.createElement(Jl,{key:o,stealDealCheckpoints:Lt,stealDealProducts:Ot,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Le,addFreebieToCart:Mt??_e,freebiesInCart:Re??[],themeColor:pe,primaryTextColor:te,secondaryTextColor:ne}):null;case"recs":return(t=>{const n=yn&&se&&!!_&&_.length>0&&Yt?.item_count>0&&h,r=!yn&&de&&!!_&&_.length>0&&Yt?.item_count>0&&h;return n||r?e.createElement(e.Fragment,{key:t},n&&e.createElement(Kn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,productRecsTitleText:oe,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:s}),r&&e.createElement(Kn,{addCartItem:h,products:_,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,productRecsTitleText:oe,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,cardLayout:dt,variant:pt,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s})):null})(o);case"bundle":return Yt?.item_count>0&&w&&C?e.createElement(Oo,{key:o,bundleProducts:C}):null;case"gst":return xe&&fe&&Yt?.item_count>0?e.createElement(pi,{key:o,companyName:me,gstNumber:ge,themeColor:pe,iconColor:ft?.iconColor,showIcon:ft?.showIcon,backgroundColor:ft?.backgroundColor,textColor:ft?.textColor,title:ft?.title}):null;case"freebie-claim":return Yt&&Yt?.item_count>0&&_e&&De&&Re&&De.length>0?e.createElement(Ba,{key:o,freebieProductsInCart:De,themeColor:pe,themeTextColor:ue,primaryTextColor:te,addFreebieToCart:_e,freebiesInCart:Re,imageAspectSelector:ut,freebieCouponTemplates:Qe,freebieClaimData:Ye,cartCheckpoints:L,isCartDrawerOpen:r}):null;case"shipping":return je&&(Ve?.length??0)>0&&He&&Yt?.item_count>0?e.createElement("div",{key:o,className:"yt-cart-geolocation-section form-group"},e.createElement("div",{className:"yt-cart-shipping-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>dn(!sn)},e.createElement("span",{className:"yt-cart-shipping-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(ee,null)),e.createElement("div",{className:"yt-cart-shipping-toggle-icon icon-transition"},sn?e.createElement(V,null):e.createElement(Y,null))),"all-products"===Ge&&sn?e.createElement(Fa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Fn}):sn&&(ln?e.createElement(Fa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Fn}):e.createElement(Pa,{postalCodeList:Ve,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,disabledDates:Fn}))):null;case"note":return Se&&ke&&Yt?.item_count>0?e.createElement(ui,{key:o,note:Te,noteSectionTitle:yt}):null;case"gift-wrap":return et?.showGiftWrapOption&&Yt?.item_count>0?e.createElement(ja,{key:o,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}):null;case"coupon":return Yt?.item_count>0&&Vt&&jt&&Wt&&Pt&&!he?e.createElement(Ko,{key:o,rewardCoupons:jt,couponSelectionData:Wt,applyCouponCode:Pt,removeDiscount:z,enableConfetti:At,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,cartComponentsCornerRadius:gt}):Yt?.item_count>0&&Dt&&!Vt&&!he&&Pt?e.createElement(Mo,{key:o,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt,applyCouponCode:Pt,removeDiscount:z,enableConfetti:At}):null;case"loyalty":return(t=>he&&Yt?.item_count?e.createElement(e.Fragment,{key:t},v||wt?!wt&&void 0!==E&&void 0!==T&&!!k&&!!N&&e.createElement(eo,{themeColor:pe,applyDiscount:N,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:we,brandTokenName:Ct,showCartLevelAltPay:j,redemptionMultiplier:$}):!!P&&!!F&&e.createElement(Qr,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:Ce,themeColor:pe,joinNowFunction:F,guestLoyaltyPercentage:P,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,showCartLevelAltPay:j}),!!wt&&!!z&&wt&&void 0!==T&&e.createElement(Xr,{themeColor:pe,removeDiscount:z,loyaltyDiscount:wt,isDev:D,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:Ct,showCartLevelAltPay:j}),!!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)):null)(o);case"points-preview":return he&&j&&O&&k&&Yt?.item_count>0?e.createElement(hl,{key:o,loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:te,pointsRewardRate:M,rewardMultiplier:S}):null;default:return null}},_n=e.createElement(e.Fragment,null,Gt.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}},Gt.showLoader&&!Gt.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),Yt?.item_count>0&&j&&!(he&&j)&&M>0&&e.createElement(wl,{pointsRewardRate:M,loyaltyIcon:k,brandTokenName:Ct,themeColor:pe,themeTextColor:ue,rewardMultiplier:S}),hn>0&&e.createElement(tc,{className:"yt-cart-item-count-badge",$backgroundSubdued:l},hn)),e.createElement("div",{className:"yt-cart-header-actions",style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(rt&&ot)&&e.createElement("div",{className:"yt-cart-close-button close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(ie,{style:{height:"auto",width:"auto",color:te},fontSize:24,cursor:"pointer",onClick:()=>{i(!r)}})))),Gt&&e.createElement(yl,{$themeColor:pe,show:Gt.showLoader}),Xt&&At&&e.createElement(Er,{particleCount:50,spread:90,origin:{y:.3}}),Dn.headerIds?.map((e,t)=>An(e,t))),R&&Yt?.items_subtotal_price>0&&Yt?.currency&&!!L&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[br(r)]&&("minimum_order_value"!==r||1!==e?.[br(r)])).some((e,a)=>hr(e,a,i,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:i}).progressPercentage>0)}(L,an(void 0!==Pe?Pe:Yt?.items_subtotal_price,Yt.currency),void 0===Le?Yt?.item_count:Le,X??"minimum_order_value",Yt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(Pr,{isLineTierIconVisible:pn,customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:G,checkpoints:L,effectiveQuantityForProgressBar:void 0===Le?Yt?.item_count:Le,currentCartAmount:an(void 0!==Pe?Pe:Yt?.items_subtotal_price,Yt.currency),themeColor:pe,themeTextColor:ue,primaryTextColor:te,secondaryTextColor:ne,showMOVForProgressTiers:ye,progressBarFreeProductIconType:nt,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,enableConfetti:At})),Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),0===Yt?.items?.length&&0===Yt?.item_count&&!1===Gt?.showSkeletonLoader?e.createElement(_r,{showLoyaltyCta:he,joinNowFunction:F,emptyCartTitle:m,emptyCartDescription:g,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:W,themeColor:pe,emptyCartButtons:x,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,themeTextColor:ue,recProductsList:_,addCartItem:h,productRecsCtaButtonText:re,ctaButtonBackgroundColor:K,ctaButtonTextColor:J,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Fe,emptyProductRecsTitleText:ae,backgroundSubdued:l,showEmptyCartRecommendations:It,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"}},Dn.scroll?.topIds?.map((e,t)=>An(e,t)),e.createElement(Lo,{isDev:D,themeColor:pe,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:te,secondaryTextColor:ne,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:Ne,productPercentageOffMapping:Oe,removeFreebieFromCart:Me,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ue??[],cartCheckpoints:L,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}),Dn.scroll?.bottomIds?.map((e,t)=>An(e,t)),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(Cl,{showDiscountOnMRP:Et,cartCheckpoints:L,toggleDecimal:Bt,primaryTextColor:te,discountApplied:B,showTrustedBadge:qt,discountAmountApplied:H})),e.createElement(Yr,null,Dn.footerIds?.map((e,t)=>An(e,t)),Yt&&I&&Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-checkout-wrapper"},e.createElement(Vr,{disableCheckoutButton:!!Nt||Gt.cartLoading,discountApplied:B,checkoutFunction:I,checkoutButtonColor:Z,checkoutFontSize:p,discountInCheckoutButton:Q,isStickyCheckout:U,discountAmountApplied:H,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:L,toggleDecimal:Bt,checkoutButtonBottomSpacing:Ft,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:te,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:qt,trustedBadgeData:Qt}))))));return Ht&&Pn?A(_n,Pn):e.createElement(ec,{className:"yt-cart-drawer",$isDev:D,$isOpen:r,$backgroundColor:a,$enableCustomCartOnCartPage:rt,$isCartPage:ot,$isLargeScreen:yn,$switchWidthVariant:kt},_n)};bt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}\n\n.yt-byob-pagination-observer {\n display: block !important;\n}');const lc=c.div`
|
|
2471
2471
|
display: flex;
|
|
2472
2472
|
flex-direction: row;
|
|
2473
2473
|
height: 100%;
|
|
@@ -4673,7 +4673,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
|
|
|
4673
4673
|
}
|
|
4674
4674
|
`,Mp=c.span`
|
|
4675
4675
|
font-size: 12px;
|
|
4676
|
-
`,Vp=({productsWithIndices:o,isOpen:i,onClose:a,cta:l,variantOptions:c,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:u})=>{const m=r(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[g,x]=t({}),[f,y]=t({});n(()=>{const e={},t={};o?.forEach(({product:n,index:r})=>{let o,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(" / "),o=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(" / "),o=e):i=n?.productDetails?.options?.map(e=>e.values[0]??"")}e[r]=i,o&&(t[r]={node:o},s(r,o.id))}),x(e),y(t)},[o,p,u,s,m]),n(()=>{if(!p||!u)return;const e=o?.find(({product:e})=>e?.productId===p);if(!e)return;const{product:t,index:n}=e,r=t?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(r&&m(t.productDetails,r.id)>0){const e=r.title.split(" / ");x(t=>({...t,[n]:e})),y(e=>({...e,[n]:{node:r}})),s(n,r.id)}},[u,p,o,s,m]);const b=(e,t,n,r)=>{const o=[...g[e]||[]];o[t]=n;const i=o.join(" / "),a=r.productDetails.variants.edges.find(e=>e.node.title===i)?.node;return!!a&&m(r.productDetails,a.id)>0},h=(e,t,n)=>{const{product:r}=o?.find(t=>t.index===e)||{product:{productDetails:{variants:{edges:[]}}}};if(!r?.productDetails)return;if(!b(e,n,t,r))return;const i={...g};i[e][n]=t,x(i);const a=r?.productDetails?.variants?.edges?.find(t=>t.node.title===i[e].join(" / "))?.node;a&&(s(e,a.id),y(t=>({...t,[e]:{node:a}})))};if(!i)return null;const v=e.createElement(Sp,{className:"yt-fixedBundle-variant-modal_overlay",onClick:a},e.createElement($p,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Bp,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:l.backgroundColor,color:l.textColor}},"Select Options"),o?.map(({product:t,index:n},r)=>e.createElement(e.Fragment,null,e.createElement(Np,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(Ip,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(Fp,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(Pp,{className:"yt-fixedBundle-variant-modal_product-name"},t.productDetails.title,t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(Ap,{className:"yt-fixedBundle-variant-modal_selected-value"},g[n]?.join(" / "))),t.productDetails.options.map((r,o)=>{const i=c&&c?.options?.find(e=>e.name===r.name),a=r.values.filter(e=>t.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[o]===e));return 0===a.length||1===a.length&&"Default Title"===a[0]?e.createElement(e.Fragment,null):i&&"color"===i?.type?e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),a.map((r,a)=>{const l=!b(n,o,r,t);return e.createElement(e.Fragment,null,i.values.find(e=>e.name===r)?.value?e.createElement(Rp,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(e=>e.name===r)?.value||r,selected:g[n]?.[o]==r,disabled:l,onClick:()=>{h(n,r,o)}},e.createElement("span",null)):e.createElement(Lp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[o]==r,disabled:l,onClick:()=>{h(n,r,o)}},r))})):i&&"image"===i?.type?e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),a.map((r,a)=>{const l=!b(n,o,r,t);return e.createElement(e.Fragment,null,i?.values.find(e=>e.name===r)?.value?e.createElement(Op,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:g[n]?.[o]==r,disabled:l,onClick:()=>{h(n,r,o)},src:i.values.find(e=>e.name===r)?.value},e.createElement("span",null)):e.createElement(Lp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[o]==r,disabled:l,onClick:()=>{h(n,r,o)}},r))})):e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),a.map((r,i)=>{const a=!b(n,o,r,t);return e.createElement(Lp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:g[n]?.[o]==r,disabled:a,onClick:()=>{h(n,r,o)}},r)}))}))),r<o.length-1&&e.createElement(Dp,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(zp,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:l.backgroundColor,color:l.textColor},onClick:d},"Add bundle to cart")));return D.createPortal(v,document.body)},jp=({options:r,selectedValue:i,onChange:a,type:l="text"})=>{const[c,s]=t(!1),d=o(null);n(()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=t=>"color"===l?e.createElement(wp,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(Cp,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name},e.createElement("span",null)):null;return e.createElement(gp,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},e.createElement(xp,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!c)},e.createElement(fp,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},i&&("color"===l||"image"===l)&&p(i),e.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},i&&i.name)),e.createElement(yp,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(bp,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},r?.map(t=>e.createElement(hp,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(i?.name===t.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:t.name,$isSelected:i?.name===t.name,onClick:()=>{t.disabled||(a(t),s(!1))},style:{opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"}},("color"===l||"image"===l)&&p(t),e.createElement(vp,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},Wp=({product:r,variantOptions:o,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&&r.variants.edges.some(e=>e.node.id.includes(l))){const e=r.variants.edges.find(e=>e.node.id.includes(l))?.node;if(e){const t=e.title.split(" / ");p(t)}}},[l,r]);const u=e=>{if(!o?.options)return"text";const t=o.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=o?.options?.find(t=>t.name===e.name);return e.values.filter(e=>r.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)).map(e=>{const o=n?.values?.find(t=>t.name===e),i=!((e,t,n)=>{const r=[...d||[]];r[e]=t;const o=r.join(" / "),i=n.variants.edges.find(e=>e.node.title===o)?.node;return!!i&&((e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0})(n,i.id)>0})(t,e,r);return{name:e,value:o?.value||e,disabled:i}})};return e.createElement(Ep,{className:"yt-fixedBundle-variant-selector-horizontal_container"},r.options.map((t,n)=>{const o=g(t,n);return 0===o.length||1===o.length&&"Default Title"===o[0].name?null:e.createElement(kp,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(jp,{options:o,selectedValue:m(t,n),onChange:e=>{((e,t)=>{const n=[...d];n[e]=t.name,p(n);const o=r.variants.edges.find(t=>t.node.title===(r.options?.length>0?n.join(" / "):n[e]))?.node.id;a(o||"")})(n,e)},type:u(t.name)}))}))},Hp=({product:o,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=r(()=>e=>{const t=o?.variants?.edges?.find(t=>t.node.id===e),n=t?.node;return n?o?.tracksInventory&&n.inventoryItem?.tracked?n.inventoryQuantity>0?n.inventoryQuantity:n.inventoryQuantity<=0&&"continue"===n.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[o]),[$,B]=t(o?.variants?.edges.find(e=>S(e?.node?.id)>0)?.node||o?.variants?.edges?.[0]?.node),z=r(()=>$?.title?.split(" / ")||[],[$]),N=o?.id===h;n(()=>{if(o.id===h){const e=o?.variants?.edges?.find(e=>e?.node?.id?.includes(a))?.node;e&&S(e.id)>0&&(B(e),d(e.id))}else{const e=o?.variants?.edges?.find(e=>e?.node?.id===a)?.node||o?.variants?.edges?.find(e=>S(e?.node?.id)>0)?.node||o?.variants?.edges?.[0]?.node;B(e)}},[o,h,a,v,d,S]);const I=i(e=>{const t=o?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&d(e)},[o,d]),F=s?.fixedBundle?.discountBadgeDisplay,P=parseFloat($?.price??"0"),D=w?.size===k,A=((e,t,n,r,o,i)=>{if(0===r||!n)return e;if(r!==o)return e;switch(t){case"percentOff":case"percentageOff":case"percentage":case"Percentage":return e*(1-n/100);case"amountOff":case"amount":case"Amount Off":{if(i<=0)return e;const t=e/i*n;return Math.max(0,e-t)}case"fixedPrice":case"fixed":case"fixedPrice":return n*(e/i);default:return e}})(P,E,C??0,w?.size,k,T),_=D?A:parseFloat($?.price??"0"),R="discount-on-compare"===F?parseFloat($?.compareAtPrice||$?.price||"0"):parseFloat($?.price??"0"),L=!1!==s?.fixedBundle?.discountBadgeVisibility&&(R>_&&s?.fixedBundle?.compareAtPriceVisibility||"discount-on-compare"===F&&s?.fixedBundle?.compareAtPriceVisibility),O=_.toFixed(2),M="undefined"!=typeof window&&"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,V=$?.image?.url||o.featuredMedia?.preview?.image?.url;return e.createElement(e.Fragment,null,m?e.createElement("div",{className:""+(o.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-${o.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:N}),e.createElement("label",{className:"yt-fixed-bundle-checkbox-label yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${o.id}-${g}`,style:{width:"18px",height:"18px",border:"1.5px solid "+((s.fixedBundle?.borderColor??"#ccc")+"80"),borderRadius:s.fixedBundle?.borderRadius??"4px",backgroundColor:l?s.general?.ctaBackgroundColor??"#d3122a":"transparent",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",color:"white"}},e.createElement(X,{style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),e.createElement(Md,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}80`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${s.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}80`}[s.fixedBundle.shadowType]||"none"},canCustomize:c},"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(Vd,{className:"yt-fixedBundle-product-card-horizontal_image",src:nu(V),alt:o.title,style:{borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,aspectRatio:s.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),e.createElement(jd,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(Wd,{className:"yt-fixedBundle-product-card-horizontal_title"},o.title),s.fixedBundle.productsPriceVisibility&&e.createElement(Hd,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(qd,{className:"yt-fixedBundle-product-card-horizontal_price--new"},tu(s.general.currencySymbol,b)," ",eu(O)),L&&R>_&&e.createElement(Qd,{className:"yt-fixedBundle-product-card-horizontal_price--old"},tu(s.general.currencySymbol,b),eu(R))),e.createElement(Wp,{product:o,variantOptions:x,selectedVariants:z,onVariantChange:I,variantId:v,primaryProductId:h})))):e.createElement(e.Fragment,null,e.createElement(tp,{className:""+(o.id===h?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}50`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${s.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}50`}[s.fixedBundle.shadowType]||"none",...c&&{position:"relative"},...M&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,backgroundColor:s.fixedBundle?.cardBackgroundColor},c&&e.createElement(Tp,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:M},e.createElement("input",{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${o.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:N}),e.createElement("label",{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${o.id}-${g}`,style:{width:"18px",height:"18px",border:"1.5px solid "+((s.fixedBundle?.borderColor??"#ccc")+"80"),borderRadius:s.fixedBundle?.borderRadius??"4px",backgroundColor:l?s.general?.ctaBackgroundColor??"#d3122a":"transparent",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",color:"white"}},e.createElement(X,{size:10,style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(np,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:s.general.imageAspectRatio,height:"fit-content"}},e.createElement(rp,{className:"yt-fixedBundle-product-card_image--vertical",src:nu(V),style:{aspectRatio:s.general.imageAspectRatio},alt:o.title}),o.variants.edges.length>1&&e.createElement(op,{className:"yt-fixedBundle-product-card_badge-container"},e.createElement(ip,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement(ap,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement(lp,{className:"yt-fixedBundle-product-card_count-badge"},o.variants.edges.length,"+"))),e.createElement(cp,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(sp,{className:"yt-fixedBundle-product-card-vertical_title"},o.title),s.fixedBundle.productsPriceVisibility&&e.createElement(pp,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(dp,{className:"yt-fixedBundle-product-card-vertical_price--new"},tu(s.general.currencySymbol,b),eu(O)),s.fixedBundle.compareAtPriceVisibility&&L&&R>_&&e.createElement(Qd,{className:"yt-fixedBundle-product-card-vertical_price--old"},tu(s.general.currencySymbol,b),eu(R))))),(f<=3||!u)&&g<f-1&&e.createElement(up,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement(mp,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},qp=({bundle:o,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,s]=t(!1),[d,p]=t(window.innerWidth<786),[u,m]=t(null),[g,x]=t(!1),[f,y]=t(!1),b="undefined"!=typeof window?window.location.href:null,h=o?.products?.find(e=>e.productDetails?.handle===b?.split("/").pop()?.split("?")[0]),v=h?.productId,w=r(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[C,E]=t(Object.fromEntries(o?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>w(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),k="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain||"swashaa.myshopify.com"===window.ytBundleApp?.storeDomain),T=o?.showIndividualProductSelector??!0,[S,$]=t(new Set(o.products.reduce((e,t,n)=>(k&&t?.productId!==v&&!T||e.push(n),e),[])));n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:o._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 r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}},[]),n(()=>{u&&v&&E(e=>{const t={...e};return o?.products?.forEach((e,n)=>{e.productId===v&&(t[n.toString()]=u)}),t})},[u,v,o?.products]),n(()=>{const e=()=>{p(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const B=i((e,t)=>{E(n=>({...n,[e.toString()]:t}))},[]),z=(e,t)=>{const n=o.products[t].productId;k&&n===v||$(n=>{const r=new Set(n);return e?r.add(t):r.delete(t),r})},N=r(()=>(e,t)=>w(e.productDetails,t)>0,[w]),I=r(()=>o.products.some((e,t)=>S.has(t)&&e.productDetails.variants.edges.length>1),[o.products,S]),{originalPrice:F,dealPrice:P,offerValue:D}=r(()=>{const{price:e,compareAtPrice:t}=o.products.reduce((e,t,n)=>{if(!S.has(n))return e;const r=C[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find(e=>e.node.id===r)?.node;if(!o)return e;const i=parseFloat(o?.price??"0"),a=parseFloat(o?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n="discount-on-compare"===(o?.customizations?.fixedBundle?.discountBadgeDisplay||"discount-on-price")?t:e;let r=e;S.size===o.products.length&&(o?.percentageOff?r=e*(1-o.percentageOff/100):o?.dealAmount?r=o.dealAmount:o?.amountOff&&(r=e-o.amountOff));const i=n-r;return{originalPrice:n.toFixed(2),dealPrice:r.toFixed(2),offerValue:i.toFixed(2)}},[o.products,C,S,o.percentageOff,o.dealAmount,o.amountOff,o?.customizations?.fixedBundle?.discountBadgeDisplay]),A=r(()=>o.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>S.has(e)),[o.products,S]),_=A.every(({product:e,index:t})=>N(e,C[t.toString()])),R=r(()=>{let e=0;return o.products.forEach((t,n)=>{if(S.has(n)){const r=C[n.toString()],o=t.productDetails.variants.edges.find(e=>e.node.id===r)?.node;o&&(e+=parseFloat(o.price??"0"))}}),e},[o.products,S,C]),L=async e=>{s(!0),x(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:o._id,bundleType:"fixed-bundle",selectedProducts:A?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const t=Object.entries(C).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!S.has(n)?null:t}).filter(Boolean);a&&await a(Number(F),t,void 0,void 0,e)}catch(e){console.error("Error adding to cart:",e)}s(!1)},O=async e=>{if(_){if(e&&(e.preventDefault(),e.stopPropagation()),o?.personalizedForm?.title)return x(!1),void y(!0);await L()}};if(!a)return e.createElement(e.Fragment,null);const M=o.customizations,V=M.fixedBundle?.cardLayoutStyle||"auto",j="horizontal"===V||"auto"===V&&d,W="bundles"==o.appName?o.pageHeader?.title:o?.title,H="bundles"==o.appName?o.pageHeader?.description:o?.subtitle;return e.createElement(_d,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:M.fixedBundle.sectionBackgroundColor,..."transparent"!==M.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},W&&e.createElement(Rd,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:M.fixedBundle?.titleBackgroundColor||"none",color:M.fixedBundle?.titleTextColor||"black",textAlign:M.fixedBundle.infoAlignment??"center",fontSize:M.fixedBundle?.titleFontSize,..."transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===M.fixedBundle.infoAlignment&&"transparent"===M.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},W),H&&e.createElement(Ld,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:M.fixedBundle?.subtitleFontSize,textAlign:M.fixedBundle.infoAlignment??"center",..."left"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===M.fixedBundle.infoAlignment&&"transparent"===M.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},H),j?e.createElement(Od,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},o?.products?.map((t,n)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(Hp,{isChecked:S.has(n),product:t.productDetails,selectedVariantId:C[n.toString()]||"",canCustomize:o?.canCustomizeFixedBundle||!1,styles:M,onVariantChange:e=>B(n,e),onCheckChange:e=>{z(e,n)},isMobile:d,index:n,isHorizontal:j,variantOptions:o.variantOptions,productsLength:o.products.length,storeCurrencyCode:o.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:o.discountType??"none",checkedProducts:S,bundleProductsCount:o.products.length,bundleDiscountValue:o.percentageOff||o.amountOff||o.dealAmount,totalSelectedOriginal:R})))):e.createElement(Jd,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(ep,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===M.fixedBundle.infoAlignment?"flex-start":"right"===M.fixedBundle.infoAlignment?"flex-end":"center"}},o?.products?.map((t,n)=>e.createElement(Hp,{key:`${t.productId}-${n}`,isChecked:S.has(n),product:t.productDetails,selectedVariantId:C[n.toString()]||"",canCustomize:o?.canCustomizeFixedBundle||!1,styles:M,onVariantChange:e=>{B(n,e)},onCheckChange:e=>z(e,n),isMobile:d,index:n,isHorizontal:j,productsLength:o.products.length,storeCurrencyCode:o.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:o.discountType??"none",checkedProducts:S,bundleProductsCount:o.products.length,bundleDiscountValue:o.percentageOff||o.amountOff||o.dealAmount,totalSelectedOriginal:R})),I&&e.createElement(Vp,{productsWithIndices:A,isOpen:g,onClose:()=>x(!1),variantOptions:o.variantOptions,cta:{textColor:M.general.ctaTextColor,backgroundColor:M.general.ctaBackgroundColor},onVariantChange:B,handleAddToCart:O,primaryProductId:v,variantId:u||void 0}))),e.createElement(Ud,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===M.fixedBundle.infoAlignment?"flex-start":"right"===M.fixedBundle.infoAlignment?"flex-end":"center"}},Number(F)>0&&Number(D)>0&&M.fixedBundle.compareAtPriceVisibility&&e.createElement(Yd,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(Xd,{className:"yt-fixedBundle-summary_price"},tu(M.general.currencySymbol,o?.storeCurrencyCode),eu(F))),0!==S.size&&e.createElement(Gd,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(Xd,{className:"yt-fixedBundle-summary_price"},tu(M.general.currencySymbol,o?.storeCurrencyCode),eu(P))," ",Number(D)>0&&e.createElement(Zd,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",tu(M.general.currencySymbol,o?.storeCurrencyCode),eu(D)))),e.createElement(Kd,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),j||!I?O(e):x(!0)},disabled:S.size<1||c||!_,style:{backgroundColor:M.general?.ctaBackgroundColor||"#121212",color:M.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${M.general?.ctaBackgroundColor||"#121212"}`,boxShadow:M.general.ctaShadowType,paddingTop:M.general?.ctaPadding,paddingBottom:M.general?.ctaPadding,borderRadius:M.general.ctaBorderRadius,width:M.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{M.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=M.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=M.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{M.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=M.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=M.general?.ctaTextColor||"#FFFFFF")}},c?e.createElement(ge,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):_?e.createElement(e.Fragment,null,M.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")),o?.personalizedForm?.title&&e.createElement(Es,{isOpen:f,onClose:()=>y(!1),formConfig:o.personalizedForm,onCheckout:async e=>{await L(e),y(!1)},cta:{backgroundColor:M.general?.ctaBackgroundColor||"#121212",textColor:M.general?.ctaTextColor||"#FFFFFF"},isMobile:d}))},Qp=({product:r,tierIdx:o,isOpen:i,onClose:a,onAddToBundle:l,canAdd:c,isSelected:s,customizations:d,isMobile:p,splitVariants:u=!1})=>{const[m,g]=t(0),[x,f]=t(r.variants[0]?.id.toString()||""),[y,b]=t(!0),h=r.variants.find(e=>e.id.toString()===x)||r.variants[0],v=r.images.filter(Boolean),w=()=>{v.length<=1||(g(e=>0===e?v.length-1:e-1),b(!0))},C=()=>{v.length<=1||(g(e=>e===v.length-1?0:e+1),b(!0))};if(n(()=>(i&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[i]),n(()=>{if(h&&h?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=nu(h?.featured_image?.src);e?.setAttribute("src",t)}},[h]),!i)return null;const E=v.length>1,k=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:a},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",borderRadius:d?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:a,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:d?.borderRadius||"12px",background:"#f5f5f5"}},v.length>0&&e.createElement(e.Fragment,null,y&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),y&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite",borderRadius:d?.borderRadius||"12px"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:nu(v[m]||r.images[0]),alt:r.title,onLoad:()=>b(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px",opacity:y?0:1,transition:"opacity 0.3s"}}),E&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:w,disabled:0===m,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===m?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:0===m?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===m?.5:1}},e.createElement(Z,{size:24})),e.createElement("button",{onClick:C,disabled:m===v.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:m===v.length-1?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:m===v.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:m===v.length-1?.5:1}},e.createElement(O,{size:24}))))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},u&&h?.name||r.title),!u&&r.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},r?.options?.join(" & "),":"," ",e.createElement("strong",null,h.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:x,onChange:e=>{f(e.target.value),b(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},r.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},"₹",(h.price/100).toLocaleString(),h.compare_at_price&&h.compare_at_price>h.price?e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(h.compare_at_price/100).toLocaleString()):null),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(r,o),disabled:!c||!h.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:h.available?s||!c?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:c&&h.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock")),r.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:r.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),T=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:a},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:a,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},v.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},y&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:v[m]||r.images[0],alt:r.title,onLoad:()=>b(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:y?0:1,transition:"opacity 0.3s"}}),E&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:w,disabled:0===m,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===m?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:0===m?.5:1,cursor:0===m?"not-allowed":"pointer"}},e.createElement(Z,{size:20})),e.createElement("button",{onClick:C,disabled:m===v.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:m===v.length-1?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:m===v.length-1?.5:1,cursor:m===v.length-1?"not-allowed":"pointer"}},e.createElement(O,{size:20})))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},r.title),!u&&r.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},r?.options?.join(" & "),":"," ",e.createElement("strong",null,h.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:x,onChange:e=>{f(e.target.value),b(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},r.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(h.price/100).toLocaleString(),h.compare_at_price?h.compare_at_price>h.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toLocaleString()):null),r.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:r.description},style:{lineHeight:1.7,color:"#444"}}))),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(r,o),disabled:!c||!h.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&c&&h.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:c&&h.available?"pointer":"not-allowed"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock"))));return D.createPortal(p?T:k,document.body)},Up=({styles:t,isMobile:n,categories:r,activeCategory:o,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",...r].map(r=>{const i=o===r,c=t.btnPrimaryBg||"#111";return e.createElement("button",{key:r,onClick:()=>a(r),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"},r.charAt(0).toUpperCase()+r.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-collection-bundle-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map(r=>{const i=t.btnPrimaryBg||"#111",l=t.borderRadius||"8px";return e.createElement("button",{key:r,onClick:()=>a(r),className:"yt-collection-bundle-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?i:"#e0e0e0"}`,borderRadius:l,backgroundColor:o===r?i:"white",color:o===r?"white":"#333",cursor:"pointer"}},r.charAt(0).toUpperCase()+r.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[]},Gp=({config:r,bundleAddToCartLoading:a,addCustomBundleToCart:l})=>{const[c,s]=t(1),[d,p]=t("All"),[u,m]=t([]),[g,x]=t(null),[f,y]=t({}),[b,h]=t(!1),[v,w]=t(window.innerWidth<640),[C,E]=t({}),k=o(null),T=o(new Map),[S,$]=t(160),[B,z]=t(""),[N,I]=t(""),[F,P]=t(!1),[D,A]=t("none"),_=v?8:20,{customizations:R}=r,L=r.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),O=!!r.config.form,M=L.length+(O?1:0),j=R.hideSelectedProducts,W=R.allowMultipleQty,H=R.hideOutOfStockProducts,q=r.config.splitVariants??!1,Q=o(new Set),U=i((e,t=d,n=N,r=D)=>{const o=L[e-1]?.products||[];let i="All"===t?o:o.filter(e=>Yp(e).includes(t));if(n.trim()){const e=n.toLowerCase();i=i.filter(t=>t.title.toLowerCase().includes(e))}return H&&(i=i.filter(e=>e.available)),"none"!==r&&(i=[...i].sort((e,t)=>{if("asc"===r||"desc"===r){const n=e.price||e.price_min||0,o=t.price||t.price_min||0;return"asc"===r?n-o:o-n}{const n=(e.title||"").toLowerCase(),o=(t.title||"").toLowerCase();return"alpha-asc"===r?n.localeCompare(o):o.localeCompare(n)}})),i},[L,d,N,D,H]),Y=i(e=>{const t=U(e).length;E(n=>{const r=n[e]||0,o=Math.min(r+8,t);return o<=r?n:{...n,[e]:o}})},[8,U]);n(()=>(k.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===c&&Y(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{k.current?.disconnect()}),[Y,c]),n(()=>{p("All"),z(""),I(""),P(!1),A("none")},[c]),n(()=>{const e=setTimeout(()=>{I(B)},300);return()=>clearTimeout(e)},[B]),n(()=>{if(O&&c===M)return;const e=c-1;if(!L[e])return;if(Q.current.has(e))return;const t=U(c);if(console.log("filteredProducts",t),1!==t.length)return;const n=t[0],r=n.variants.filter(e=>e.available);if(1!==r.length)return;const o=r[0],i=ie(e),a=le[e];if(i!==1/0&&a>=i)return;if(!u.some(t=>t.productId===n.id.toString()&&t.variantId===o.id.toString()&&t.tierIndex===e)&&(Q.current.add(e),m(t=>[...t,{productId:n.id.toString(),variantId:o.id.toString(),price:o.price,quantity:1,tierIndex:e}]),c<M)){const e=setTimeout(()=>{s(e=>e+1),window.scrollTo(0,0)},50);return()=>clearTimeout(e)}},[c]),n(()=>{if(O&&c===M)return;const e=c,t=U(e).length;E(n=>{const r=n[`${e}_category`]!==d;return 0===(n[e]||0)||r?{...n,[e]:Math.min(_,t),[`${e}_category`]:d}:n})},[c,_,d,U]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>w(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const X=i(e=>{$(e+10)},[]),Z=u.reduce((e,t)=>e+t.quantity,0),ee=u.reduce((e,t)=>e+t.price*t.quantity,0)/100,te=u.reduce((e,t)=>{const n=L.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),r=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(r?.compare_at_price??t.price)*t.quantity},0)/100,ne=e=>{for(let t=0;t<L.length;t++)if(L[t].products.some(t=>t.id.toString()===e))return t+1;return O?M:L.length},re=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const r=document.querySelector(`[data-product-id="${e.id}"]`);r&&(r.dataset.selectedVariant=t,r.dataset.currentPrice=n.price.toString())},oe=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const r=n.dataset.selectedVariant||e.variants[0].id.toString(),o=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());m(n=>{const i=`${e.id}-${r}-${t}`,a=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===i);if(a)return n.filter(e=>e!==a);const l=le[t],c=ie(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:r,price:o,quantity:1,tierIndex:t}]})},ie=e=>{const t=L[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},ae=(e,t)=>{const n=ie(t);if(n===1/0)return!0;const r=le[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||r<n},le=L.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),ce=(e,t,n)=>{const r=ie(n);if(r===1/0)return!0;return le[n]<r},se=(e,t,n)=>{m(r=>r.filter(r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))},de=async()=>{if(c!==M||!u.length)return;const e={};O&&Object.entries(f).forEach(([t,n])=>{const r=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[r]=n:n&&"object"==typeof n&&"url"in n&&(e[r]=n.url)});const t=u.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));l(t)},pe=O&&c===M,ue=(pe?null:L[c-1])?ie(c-1):0,me=L.map((e,t)=>({tier:e,items:u.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,r=e.find(e=>`${e.productId}-${e.variantId}`===n);return r?r.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]),count:le[t]}));return e.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},R.headerImage&&!R.headerImage.includes("Liquid error")&&e.createElement("img",{className:"yt-collection-bundle-header-img",src:R.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),R.showTierSteps&&e.createElement("div",{style:{paddingTop:R.headerImage&&!R.headerImage.includes("Liquid error")?"20px":"0"}},e.createElement(Xp,{totalSteps:M,isFormStep:pe,currentStep:c,getStepTitle:e=>O&&e===M?"Customize Gift Details":L[e-1]?.title||`Step ${e}`,isMobile:v,formTitle:r?.config?.form?.title,hasForm:O,onStepClick:e=>{s(e),window.scrollTo(0,0)}})),Array.from({length:M},(e,t)=>t+1).map(t=>{const n=O&&t===M,o=n?[]:(e=>L[e-1]?.products||[])(t);let i=[];if(!n&&R.enableProductCategories){const e=new Set;o.forEach(t=>Yp(t).forEach(t=>e.add(t))),i=Array.from(e).sort()}const l=n?[]:U(t),w=t-1,E=l.slice(0,C[t]||0);return e.createElement("div",{key:t,className:"yt-collection-bundle-step-content "+(c===t?"yt-collection-bundle-step-content-active":""),style:{display:c===t?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},n&&r.config.form?e.createElement(fs,{form:r.config.form,formData:f,setFormData:y,barHeight:S,isUploading:b,setIsUploading:h}):e.createElement(e.Fragment,null,R.enableProductCategories&&i.length>0&&e.createElement(Up,{styles:R,isMobile:v,categories:i,activeCategory:d,onCategoryChange:p}),(R.enableSearch||R.enableSort)&&e.createElement("div",{className:"yt-collection-bundle-controls",style:{display:"flex",alignItems:"center",justifyContent:v?"flex-end":"space-between",gap:"12px",padding:"0 16px",marginBottom:"16px",flexWrap:"nowrap",height:"45px"}},v?e.createElement(e.Fragment,null,F?e.createElement("div",{style:{position:"relative",flex:1,display:"flex",alignItems:"center",gap:"8px"}},e.createElement("input",{type:"text",autoFocus:!0,placeholder:"Search...",value:B,onChange:e=>z(e.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:R.borderRadius||"8px",border:`1px solid ${R.bundleBorder||"#878787"}`,background:R.productCardBg||"#fff",color:"#333",fontSize:"14px",outline:"none"}}),e.createElement("button",{onClick:()=>{P(!1),z(""),I("")},style:{background:"none",border:"none",color:"#888",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center"}},e.createElement(G,null))):e.createElement("div",{style:{display:"flex",gap:"20px",alignItems:"center"}},R.enableSearch&&e.createElement("button",{onClick:()=>P(!0),style:{background:"none",border:"none",color:"#333",fontSize:"20px",cursor:"pointer",display:"flex",alignItems:"center"},className:"yt-collection-bundle-search-btn-mobile"},e.createElement(K,null)),R.enableSort&&e.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"},className:"yt-collection-bundle-sort-selecter-mobile-wrapper"},e.createElement("select",{value:D,onChange:e=>A(e.target.value),style:{position:"absolute",opacity:0,width:"100%",height:"100%",cursor:"pointer",left:0,top:0,zIndex:1},className:"yt-collection-bundle-sort-selecter-mobile"},e.createElement("option",{value:"none"},"Featured"),e.createElement("option",{value:"asc"},"Price: Low to High"),e.createElement("option",{value:"desc"},"Price: High to Low"),e.createElement("option",{value:"alpha-asc"},"Alphabetical: A-Z"),e.createElement("option",{value:"alpha-desc"},"Alphabetical: Z-A")),e.createElement("div",{style:{fontSize:"20px",color:"#333",pointerEvents:"none",display:"flex",alignItems:"center"}},e.createElement(J,null))))):e.createElement(e.Fragment,null,R.enableSort&&e.createElement("div",{style:{position:"relative",flex:"0 1 200px",marginLeft:"12px",padding:"10px 16px",borderRadius:R.borderRadius||"8px",border:"1px solid #878787",background:R.productCardBg||"#fff",display:"flex",flexDirection:"row",alignItems:"center",gap:"6px"},className:"yt-collection-bundle-sort-wrapper"},e.createElement("span",{style:{fontWeight:"500",minWidth:"fit-content",fontSize:"14px"}},"Sort By"),e.createElement("select",{value:D,onChange:e=>A(e.target.value),style:{width:"100%",color:"#333",fontSize:"14px",outline:"none",cursor:"pointer",appearance:"none",boxSizing:"border-box",lineHeight:"normal",border:"none",fontFamily:"inherit"},className:"yt-collection-bundle-sort-selector"},e.createElement("option",{value:"none"}," Featured"),e.createElement("option",{value:"asc"},"Price: Low to High"),e.createElement("option",{value:"desc"},"Price: High to Low"),e.createElement("option",{value:"alpha-asc"},"Alphabetical: A-Z"),e.createElement("option",{value:"alpha-desc"},"Alphabetical: Z-A")),e.createElement("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",color:"#888",pointerEvents:"none"}},e.createElement(V,null))),R.enableSearch&&e.createElement("div",{style:{position:"relative",flex:"0 1 300px"},className:"yt-collection-bundle-search-wrapper"},e.createElement("input",{type:"text",placeholder:"Search products...",value:B,onChange:e=>z(e.target.value),style:{width:"100%",padding:"10px 16px",paddingRight:"40px",borderRadius:R.borderRadius||"8px",border:"1px solid #878787",background:R.productCardBg||"#fff",color:"#333",fontSize:"14px",outline:"none",boxSizing:"border-box",lineHeight:"normal"},className:"yt-collection-bundle-search-input"}),e.createElement("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",color:"#888"}},e.createElement(K,null))))),e.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:v?"grid":"flex",gridTemplateColumns:v?"repeat(2,1fr)":"",flexWrap:v?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${S}px`}},0===l.length&&""!==N.trim()?e.createElement("div",{style:{padding:"60px 20px",textAlign:"center",width:"100%",gridColumn:"1 / -1"}},e.createElement("div",{style:{fontSize:"18px",color:"#333",marginBottom:"8px",fontWeight:600}},'No results found for "',B,'"'),e.createElement("div",{style:{fontSize:"14px",color:"#666",marginBottom:"24px"}},"Try checking your spelling or using more general terms."),e.createElement("button",{onClick:()=>{z(""),I(""),P(!1)},style:{background:R.atcBg||"#000",color:R.atcText||"#fff",padding:"12px 32px",borderRadius:R.borderRadius||"8px",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:600,transition:"opacity 0.2s"},onMouseEnter:e=>e.currentTarget.style.opacity="0.8",onMouseLeave:e=>e.currentTarget.style.opacity="1"},"Clear Search")):q?E.flatMap(t=>t.variants.filter(e=>!H||e.available).map(n=>e.createElement(Zp,{key:`${t.id}-${n.id}`,product:{...t,variants:[n]},tierIdx:w,customizations:R,isMobile:v,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:oe,canAddProduct:ae,allowMultipleQty:W,handleVariantChange:re,canIncrement:ce,setSelectedProducts:m,splitVariants:!0}))):E.map(t=>e.createElement(Zp,{key:t.id,product:t,tierIdx:w,customizations:R,isMobile:v,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:oe,canAddProduct:ae,allowMultipleQty:W,handleVariantChange:re,canIncrement:ce,setSelectedProducts:m,splitVariants:!1})),c===t&&(C[t]||0)<l.length&&e.createElement("div",{ref:e=>{const n=T.current.get(t);n&&k.current?.unobserve(n),e?(T.current.set(t,e),k.current?.observe(e)):T.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))),c===t&&e.createElement(Kp,{config:r,selectedProducts:u,selectedByTier:me,totalItems:Z,totalPrice:ee,totalCompareAtPrice:te,currentStep:c,totalSteps:M,currentTierMax:ue,tierSelectedCounts:le,isMobile:v,bundleAddToCartLoading:a,isUploading:b,hoveredCard:g,setHoveredCard:x,hideSelectedProducts:j,getProductStep:ne,setCurrentStep:s,handleRemoveItem:se,handleCheckout:de,hasForm:O,onHeightChange:X}))}))},Xp=({totalSteps:t,isFormStep:r,currentStep:o,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"})},[o,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 "+(o===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:o===n?1:.5,transition:"opacity 0.2s"},onClick:()=>s(n)},e.createElement("div",{className:"yt-collection-bundle-step-icon "+(o===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:o===n?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},c&&n===t?e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:o===n?"#fff":"#999"}},e.createElement("path",{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.67C10.96 2.54 10.05 2 9 2c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1h-2c-.55 0-1-.45-1-1s.45-1 1-1h2zm-6 0c.55 0 1 .45 1 1s-.45 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2zM20 19H4V8h16v11z"})):e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:o===n?"#fff":"#999"}},e.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),e.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},i(n))))),l&&c&&r&&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))},Zp=({product:n,tierIdx:r,customizations:o,isMobile:i,hoveredCard:a,setHoveredCard:l,selectedProducts:c,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:g,splitVariants:x=!1})=>{const[f,y]=t(!1),b=x?null:document.querySelector(`[data-product-id="${n.id}"]`),h=x?n.variants[0].id.toString():b?.dataset.selectedVariant??n.variants[0].id.toString(),v=n.variants.find(e=>e.id.toString()===h)||n.variants[0],w=x?`${n.id}-${v.id}`:n.id,C=c.some(e=>e.productId===n.id.toString()&&e.variantId===h&&e.tierIndex===r),E=a===w,k=c.filter(e=>e.productId===n.id.toString()&&e.variantId===v.id.toString()&&e.tierIndex===r).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:w,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":v.id,"data-current-price":v.price,style:{display:"flex",flexDirection:"column",border:o?.productCardBorder||"1px solid #ddd",background:o?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:i?0:"250px",maxWidth:i?"none":"250px",borderRadius:o?.borderRadius||"8px",boxShadow:"spread"===o?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===o?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:i?"100%":""}},e.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:o?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>y(!0),onMouseEnter:()=>l(w),onMouseLeave:()=>l(null)},e.createElement("img",{src:nu(n.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:E?0:1,transform:E?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:nu(n.images[1]||n.images[0]),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:E?1:0,transform:"scale(1.05)"},alt:n.title}),!x&&n.variants.length>1&&e.createElement("select",{className:"yt-collection-bundle-variant-selector",style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"8px",fontSize:"12px",fontWeight:"600",zIndex:2,lineHeight:"normal"},onChange:e=>u(n,e.target.value),defaultValue:v.id,onClick:e=>{e.stopPropagation()}},n.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},o.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:x?0:1}},n.title),x&&"Default Title"!==v.title&&e.createElement("p",{className:"yt-collection-bundle-variant-label",style:{fontSize:i?"10px":"12px",color:"#666",margin:"0 0 4px",lineHeight:"normal",flexGrow:1}},v.title),e.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},e.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:i?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(v.price/100).toLocaleString()),v.compare_at_price&&0!==v.compare_at_price&&v.compare_at_price>v.price?e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(v.compare_at_price/100).toLocaleString()):null)),p&&k>0?e.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:v.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{g(e=>{const t=`${n.id}-${v.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o&&o.quantity>1?e.map(e=>e===o?{...e,quantity:e.quantity-1}:e):o?e.filter(e=>e!==o):e})}},"-"),e.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},k),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:v.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{v.available&&m(n,v.id.toString(),r)&&g(e=>{const t=`${n.id}-${v.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o?e.map(e=>e===o?{...e,quantity:e.quantity+1}:e):[...e,{productId:n.id.toString(),variantId:v.id.toString(),price:v.price,quantity:1,tierIndex:r}]})},disabled:!v.available||!m(n,v.id.toString(),r)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(C?"yt-collection-bundle-add-btn-added":""),style:{background:C?"#28a745":d(n,r)&&v.available?o?.atcBg||"#007bff":"#ccc",color:o?.atcText||"#fff",border:"none",padding:i?"6px":"12px",fontSize:i?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:v.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{if(x)v.available&&d(n,r)&&g(e=>{const t=`${n.id}-${v.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o?e.filter(e=>e!==o):[...e,{productId:n.id.toString(),variantId:v.id.toString(),price:v.price,quantity:1,tierIndex:r}]});else{if(!v.available||!d(n,r))return;s(n,r)}},disabled:!v.available||!d(n,r)},C?"Added":v.available?"ADD TO BOX":"Out of Stock")),f&&e.createElement(Qp,{product:n,tierIdx:r,isOpen:f,onClose:()=>y(!1),onAddToBundle:(e,t)=>{s(e,t),y(!1)},canAdd:d(n,r),isSelected:C,customizations:o,isMobile:i,splitVariants:x}))},Kp=r=>{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}=r,{customizations:S}=i,[$,B]=t(!1),z=o(null),N=o(null),{totalOriginal:I,hasSavings:F,formattedSavings:P,totalAfterDiscount:D}=(e=>{let t=0,n=0;e.forEach(({items:e,tier:r})=>{const o=r?.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"===o?.type&&o.tiers?.length){const e=[...o.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 r=Math.round(t-n),o=r>0;return{savings:r,totalOriginal:t,totalAfterDiscount:n,hasSavings:o,formattedSavings:o?`₹${r.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 r=e.discountData;if(!r||!r.tiers?.length)return null;const o=[...r.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),i=[];if("mov_percentage"===r.type){if("number"!=typeof n)return null;const e=o.filter(e=>n>=e.minimumQuantity).pop();e&&i.push(`${e.discountValue}% OFF`);const t=o.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=o.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(r.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=o.find(e=>t<e.minimumQuantity);if(l){const e=l.minimumQuantity-t;let n=null;switch(r.type){case"percentage_discount_coupon":n=`${l.discountValue}% OFF`;break;case"amount_discount_coupon":n=`₹${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(z.current&&T){const e=z.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,r=(e?.discountData?.tiers||[]).filter(e=>n>=e.minimumQuantity).sort((e,t)=>t.discountValue-e.discountValue)[0];return r?.discountValue??0}));if(e<(N.current??0)&&(N.current=e),e>(N.current??0)){N.current=e;const t=document.querySelector(".yt-collection-bundle-next-btn");if(!t)return;const n=t.getBoundingClientRect(),r=(n.left+n.width/2)/window.innerWidth,o=(n.top+n.height/2)/window.innerHeight;ke({particleCount:100,spread:70,origin:{x:r,y:o},zIndex:9999})}},[l]),e.createElement("div",{ref:z,className:"yt-collection-bundle-bar",style:{background:S?.bundleBg||"#fff",color:S?.bundleText||"#333",border:S?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"sticky",bottom:"10px",left:"0",right:"0",marginInline:"auto",width:"compact"==S.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},A.length>0&&e.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},A.join(" + ")),e.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&e.createElement(e.Fragment,null,e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; transform: translateX(-50%) translateY(10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n "),e.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:S?.atcBg||"#007bff",color:S?.atcText||"#fff",padding:"4px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"14px",whiteSpace:"nowrap",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",animation:"fadeIn 0.3s ease-out",minWidth:"300px",textAlign:"center",border:"1px solid rgba(0,0,0,0.1)",lineHeight:"normal"}},"Add up to"," ",e.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),a.length>0&&e.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:S?.borderRadius||"8px"}},e.createElement("div",{className:"yt-collection-bundle-images",style:{display:"flex",flex:1,gap:"5px",justifyContent:"center",alignItems:"center",overflowX:"auto",padding:"4px 0",scrollbarWidth:"none"}},l.filter(({count:e})=>e>0).map(({items:t},n,r)=>e.createElement(e.Fragment,{key:n},e.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},e.createElement("div",{style:{display:"flex",gap:"4px"}},t.map((t,r)=>{const o=i.config.builderTiers.collectionTier.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId);if(!o)return null;const a=v(t.productId),l=p===a;return e.createElement("div",{key:r,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},e.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,overflow:"hidden",cursor:l?"default":"pointer",transition:"transform 0.2s ease"},onMouseEnter:e=>!l&&(e.currentTarget.style.transform="scale(1.08)"),onMouseLeave:e=>e.currentTarget.style.transform="scale(1)",onClick:()=>!l&&w(a)},e.createElement("img",{src:nu(o.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),t.quantity>1&&e.createElement("div",{className:"yt-collection-bundle-qty-badge",style:{position:"absolute",bottom:"4px",right:"4px",background:"rgba(0,0,0,0.7)",color:"#fff",borderRadius:"10px",padding:"2px 6px",fontSize:"10px",fontWeight:600,lineHeight:"normal"}},"x",t.quantity),e.createElement("button",{className:"yt-collection-bundle-remove-btn",style:{position:"absolute",top:"4px",right:"4px",width:"20px",height:"20px",background:"rgba(220,53,69,0.95)",color:"white",border:"none",borderRadius:"50%",fontSize:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",textAlign:"center",lineHeight:"normal"},onClick:e=>{e.stopPropagation(),C(t.productId,t.variantId,n)}},"×")))}))),n<r.length-1&&r[n+1].count>0&&e.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},e.createElement(U,null)))))),x?e.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:c>0&&(k||i?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:c>0?"10px":"0",background:"#dbdbdb",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.length>0?"space-between":"center",alignItems:"center",borderRadius:S?.borderRadius||"8px"}},e.createElement(e.Fragment,null,0===c&&e.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===c&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:S?.borderRadius||"8px"}}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px",width:"100%",justifyContent:"center",flexWrap:"wrap"}},e.createElement("div",{style:{fontSize:"14px",color:"#000",fontWeight:600}},"₹",(D??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",I.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",P)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",d.toLocaleString())),e.createElement("span",{style:{fontSize:"12px",color:"#000",fontWeight:500}},"(",c," items)")))),e.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(i?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:1===p?"not-allowed":"pointer",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===c||y?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(gs,null)):p===u?"Checkout":"Next"))):e.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:S?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(i?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:1===p?"not-allowed":"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===b&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===c&&{padding:"12px 24px"}}},0===c&&e.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",justifyContent:"center"}},e.createElement("div",{style:{fontSize:"16px",color:"#000",fontWeight:600}},"₹",(D??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",I.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",P)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",d.toLocaleString())),e.createElement("span",{style:{fontSize:"16px",color:"#000",fontWeight:500}},"(",c," items)"))),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===c||y?.6:1,...-2===b&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y,onMouseEnter:()=>h(-2),onMouseLeave:()=>h(null)},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(gs,null)):p===u?"Checkout":"Next")))},Jp=window?.Shopify?.currency||{rate:1,active:"INR"},eu=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Jp.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},tu=(e,t)=>t==Jp.active?e:pe(Jp.active)||Jp.active,nu=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality",t?.toString()||"70"),r.has("width")||r.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},ru=(e,t,n,r,o,i,a)=>{const l=r.findIndex(t=>t.variantId===e&&(void 0===a||t.tierIndex===a));o(0===n?e=>e.filter((e,t)=>t!==l):-1===l?r=>[...r,{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))},ou=({bundle:t,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:i,setSelectedItems:a,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p,dispatchAnalyticsEvent:u,fetchStoreDetails:m,productsPagination:g})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Cs,{bundleAddToCartLoading:l,bundle:t,selectedItems:i,setSelectedItems:a,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0},dispatchAnalyticsEvent:u,fetchStoreDetails:m,productsPagination:g}):"combo"===t.type?e.createElement(Ts,{bundle:t,addToCartFunction:r,dispatchAnalyticsEvent:u}):"mixAndMatch"===t.type?e.createElement(Ad,{bundle:t,addToCartFunction:r,dispatchAnalyticsEvent:u}):"collection"===t.type?e.createElement(Gp,{config:t,addCustomBundleToCart:o,bundleAddToCartLoading:l}):e.createElement(nd,{bundle:t,currentProductId:n,addToCartFunction:r,dispatchAnalyticsEvent:u}):e.createElement(qp,{addToCartFunction:r,bundle:t,dispatchAnalyticsEvent:u}),iu=c.div`
|
|
4676
|
+
`,Vp=({productsWithIndices:o,isOpen:i,onClose:a,cta:l,variantOptions:c,onVariantChange:s,handleAddToCart:d,primaryProductId:p,variantId:u})=>{const m=r(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[g,x]=t({}),[f,y]=t({});n(()=>{const e={},t={};o?.forEach(({product:n,index:r})=>{let o,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(" / "),o=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(" / "),o=e):i=n?.productDetails?.options?.map(e=>e.values[0]??"")}e[r]=i,o&&(t[r]={node:o},s(r,o.id))}),x(e),y(t)},[o,p,u,s,m]),n(()=>{if(!p||!u)return;const e=o?.find(({product:e})=>e?.productId===p);if(!e)return;const{product:t,index:n}=e,r=t?.productDetails?.variants?.edges?.find(e=>e.node.id.includes(u))?.node;if(r&&m(t.productDetails,r.id)>0){const e=r.title.split(" / ");x(t=>({...t,[n]:e})),y(e=>({...e,[n]:{node:r}})),s(n,r.id)}},[u,p,o,s,m]);const b=(e,t,n,r)=>{const o=[...g[e]||[]];o[t]=n;const i=o.join(" / "),a=r.productDetails.variants.edges.find(e=>e.node.title===i)?.node;return!!a&&m(r.productDetails,a.id)>0},h=(e,t,n)=>{const{product:r}=o?.find(t=>t.index===e)||{product:{productDetails:{variants:{edges:[]}}}};if(!r?.productDetails)return;if(!b(e,n,t,r))return;const i={...g};i[e][n]=t,x(i);const a=r?.productDetails?.variants?.edges?.find(t=>t.node.title===i[e].join(" / "))?.node;a&&(s(e,a.id),y(t=>({...t,[e]:{node:a}})))};if(!i)return null;const v=e.createElement(Sp,{className:"yt-fixedBundle-variant-modal_overlay",onClick:a},e.createElement($p,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},e.createElement(Bp,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:l.backgroundColor,color:l.textColor}},"Select Options"),o?.map(({product:t,index:n},r)=>e.createElement(e.Fragment,null,e.createElement(Np,{className:"yt-fixedBundle-variant-modal_product-block"},e.createElement(Ip,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n]?.node?.image?.url||t.productDetails.featuredMedia?.preview?.image?.url,alt:t.productDetails.title}),e.createElement(Fp,{className:"yt-fixedBundle-variant-modal_product-info"},e.createElement(Pp,{className:"yt-fixedBundle-variant-modal_product-name"},t.productDetails.title,t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(Ap,{className:"yt-fixedBundle-variant-modal_selected-value"},g[n]?.join(" / "))),t.productDetails.options.map((r,o)=>{const i=c&&c?.options?.find(e=>e.name===r.name),a=r.values.filter(e=>t.productDetails.variants.edges.some(t=>t.node.title.split(" / ")[o]===e));return 0===a.length||1===a.length&&"Default Title"===a[0]?e.createElement(e.Fragment,null):i&&"color"===i?.type?e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),a.map((r,a)=>{const l=!b(n,o,r,t);return e.createElement(e.Fragment,null,i.values.find(e=>e.name===r)?.value?e.createElement(Rp,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:i.values.find(e=>e.name===r)?.value||r,selected:g[n]?.[o]==r,disabled:l,onClick:()=>{h(n,r,o)}},e.createElement("span",null)):e.createElement(Lp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[o]==r,disabled:l,onClick:()=>{h(n,r,o)}},r))})):i&&"image"===i?.type?e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),a.map((r,a)=>{const l=!b(n,o,r,t);return e.createElement(e.Fragment,null,i?.values.find(e=>e.name===r)?.value?e.createElement(Op,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:g[n]?.[o]==r,disabled:l,onClick:()=>{h(n,r,o)},src:i.values.find(e=>e.name===r)?.value},e.createElement("span",null)):e.createElement(Lp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:g[n]?.[o]==r,disabled:l,onClick:()=>{h(n,r,o)}},r))})):e.createElement(_p,{className:"yt-fixedBundle-variant-modal_options-row"},e.createElement(Mp,{className:"yt-fixedBundle-variant-modal_option-name"},r.name," :"," "),a.map((r,i)=>{const a=!b(n,o,r,t);return e.createElement(Lp,{className:"yt-fixedBundle-variant-modal_text-swatch",key:i,selected:g[n]?.[o]==r,disabled:a,onClick:()=>{h(n,r,o)}},r)}))}))),r<o.length-1&&e.createElement(Dp,{className:"yt-fixedBundle-variant-modal_divider"}))),e.createElement(zp,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:l.backgroundColor,color:l.textColor},onClick:d},"Add bundle to cart")));return D.createPortal(v,document.body)},jp=({options:r,selectedValue:i,onChange:a,type:l="text"})=>{const[c,s]=t(!1),d=o(null);n(()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const p=t=>"color"===l?e.createElement(wp,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:t.value},e.createElement("span",null)):"image"===l?e.createElement(Cp,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:t.value||"/placeholder.svg",alt:t.name},e.createElement("span",null)):null;return e.createElement(gp,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},e.createElement(xp,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!c)},e.createElement(fp,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},i&&("color"===l||"image"===l)&&p(i),e.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},i&&i.name)),e.createElement(yp,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:c})),c&&e.createElement(bp,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},r?.map(t=>e.createElement(hp,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(i?.name===t.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:t.name,$isSelected:i?.name===t.name,onClick:()=>{t.disabled||(a(t),s(!1))},style:{opacity:t.disabled?.5:1,cursor:t.disabled?"not-allowed":"pointer"}},("color"===l||"image"===l)&&p(t),e.createElement(vp,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},t.name)))))},Wp=({product:r,variantOptions:o,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&&r.variants.edges.some(e=>e.node.id.includes(l))){const e=r.variants.edges.find(e=>e.node.id.includes(l))?.node;if(e){const t=e.title.split(" / ");p(t)}}},[l,r]);const u=e=>{if(!o?.options)return"text";const t=o.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=o?.options?.find(t=>t.name===e.name);return e.values.filter(e=>r.variants.edges.some(n=>n.node.title.split(" / ")[t]===e)).map(e=>{const o=n?.values?.find(t=>t.name===e),i=!((e,t,n)=>{const r=[...d||[]];r[e]=t;const o=r.join(" / "),i=n.variants.edges.find(e=>e.node.title===o)?.node;return!!i&&((e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0})(n,i.id)>0})(t,e,r);return{name:e,value:o?.value||e,disabled:i}})};return e.createElement(Ep,{className:"yt-fixedBundle-variant-selector-horizontal_container"},r.options.map((t,n)=>{const o=g(t,n);return 0===o.length||1===o.length&&"Default Title"===o[0].name?null:e.createElement(kp,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:t.name,$isFirst:0===n},e.createElement(jp,{options:o,selectedValue:m(t,n),onChange:e=>{((e,t)=>{const n=[...d];n[e]=t.name,p(n);const o=r.variants.edges.find(t=>t.node.title===(r.options?.length>0?n.join(" / "):n[e]))?.node.id;a(o||"")})(n,e)},type:u(t.name)}))}))},Hp=({product:o,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=r(()=>e=>{const t=o?.variants?.edges?.find(t=>t.node.id===e),n=t?.node;return n?o?.tracksInventory&&n.inventoryItem?.tracked?n.inventoryQuantity>0?n.inventoryQuantity:n.inventoryQuantity<=0&&"continue"===n.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[o]),[$,B]=t(o?.variants?.edges.find(e=>S(e?.node?.id)>0)?.node||o?.variants?.edges?.[0]?.node),z=r(()=>$?.title?.split(" / ")||[],[$]),N=o?.id===h;n(()=>{if(o.id===h){const e=o?.variants?.edges?.find(e=>e?.node?.id?.includes(a))?.node;e&&S(e.id)>0&&(B(e),d(e.id))}else{const e=o?.variants?.edges?.find(e=>e?.node?.id===a)?.node||o?.variants?.edges?.find(e=>S(e?.node?.id)>0)?.node||o?.variants?.edges?.[0]?.node;B(e)}},[o,h,a,v,d,S]);const I=i(e=>{const t=o?.variants?.edges?.find(t=>t.node.id===e)?.node;t&&d(e)},[o,d]),F=s?.fixedBundle?.discountBadgeDisplay,P=parseFloat($?.price??"0"),D=w?.size===k,A=((e,t,n,r,o,i)=>{if(0===r||!n)return e;if(r!==o)return e;switch(t){case"percentOff":case"percentageOff":case"percentage":case"Percentage":return e*(1-n/100);case"amountOff":case"amount":case"Amount Off":{if(i<=0)return e;const t=e/i*n;return Math.max(0,e-t)}case"fixedPrice":case"fixed":case"fixedPrice":return n*(e/i);default:return e}})(P,E,C??0,w?.size,k,T),_=D?A:parseFloat($?.price??"0"),R="discount-on-compare"===F?parseFloat($?.compareAtPrice||$?.price||"0"):parseFloat($?.price??"0"),L=!1!==s?.fixedBundle?.discountBadgeVisibility&&(R>_&&s?.fixedBundle?.compareAtPriceVisibility||"discount-on-compare"===F&&s?.fixedBundle?.compareAtPriceVisibility),O=_.toFixed(2),M="undefined"!=typeof window&&"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,V=$?.image?.url||o.featuredMedia?.preview?.image?.url;return e.createElement(e.Fragment,null,m?e.createElement("div",{className:""+(o.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-${o.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:N}),e.createElement("label",{className:"yt-fixed-bundle-checkbox-label yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${o.id}-${g}`,style:{width:"18px",height:"18px",border:"1.5px solid "+((s.fixedBundle?.borderColor??"#ccc")+"80"),borderRadius:s.fixedBundle?.borderRadius??"4px",backgroundColor:l?s.general?.ctaBackgroundColor??"#d3122a":"transparent",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",color:"white"}},e.createElement(X,{style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),e.createElement(Md,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}80`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${s.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}80`}[s.fixedBundle.shadowType]||"none"},canCustomize:c},"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(Vd,{className:"yt-fixedBundle-product-card-horizontal_image",src:nu(V),alt:o.title,style:{borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,aspectRatio:s.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),e.createElement(jd,{className:"yt-fixedBundle-product-card-horizontal_details"},e.createElement(Wd,{className:"yt-fixedBundle-product-card-horizontal_title"},o.title),s.fixedBundle.productsPriceVisibility&&e.createElement(Hd,{className:"yt-fixedBundle-product-card-horizontal_price-section"},e.createElement(qd,{className:"yt-fixedBundle-product-card-horizontal_price--new"},tu(s.general.currencySymbol,b)," ",eu(O)),L&&R>_&&e.createElement(Qd,{className:"yt-fixedBundle-product-card-horizontal_price--old"},tu(s.general.currencySymbol,b),eu(R))),e.createElement(Wp,{product:o,variantOptions:x,selectedVariants:z,onVariantChange:I,variantId:v,primaryProductId:h})))):e.createElement(e.Fragment,null,e.createElement(tp,{className:""+(o.id===h?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:s.fixedBundle?.borderRadius,border:`1px solid ${s.fixedBundle?.borderColor}50`,backgroundColor:s.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${s.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${s.fixedBundle.borderColor}50`}[s.fixedBundle.shadowType]||"none",...c&&{position:"relative"},...M&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:s.fixedBundle?.borderRadius,borderColor:s.fixedBundle?.borderColor,backgroundColor:s.fixedBundle?.cardBackgroundColor},c&&e.createElement(Tp,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:M},e.createElement("input",{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${o.id}-${g}`,defaultChecked:l,onChange:e=>p(e.target.checked),disabled:N}),e.createElement("label",{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${o.id}-${g}`,style:{width:"18px",height:"18px",border:"1.5px solid "+((s.fixedBundle?.borderColor??"#ccc")+"80"),borderRadius:s.fixedBundle?.borderRadius??"4px",backgroundColor:l?s.general?.ctaBackgroundColor??"#d3122a":"transparent",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.2s ease",color:"white"}},e.createElement(X,{size:10,style:{fontSize:"14px",visibility:l?"visible":"hidden"}}))),"undefined"!=typeof window&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&e.createElement(np,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:s.general.imageAspectRatio,height:"fit-content"}},e.createElement(rp,{className:"yt-fixedBundle-product-card_image--vertical",src:nu(V),style:{aspectRatio:s.general.imageAspectRatio},alt:o.title}),o.variants.edges.length>1&&e.createElement(op,{className:"yt-fixedBundle-product-card_badge-container"},e.createElement(ip,{className:"yt-fixedBundle-product-card_circle-button"},e.createElement("span",null)),e.createElement(ap,{className:"yt-fixedBundle-product-card_circle-button-two"},e.createElement("span",null)),e.createElement(lp,{className:"yt-fixedBundle-product-card_count-badge"},o.variants.edges.length,"+"))),e.createElement(cp,{className:"yt-fixedBundle-product-card-vertical_info"},e.createElement(sp,{className:"yt-fixedBundle-product-card-vertical_title"},o.title),s.fixedBundle.productsPriceVisibility&&e.createElement(pp,{className:"yt-fixedBundle-product-card-vertical_price-line"},e.createElement(dp,{className:"yt-fixedBundle-product-card-vertical_price--new"},tu(s.general.currencySymbol,b),eu(O)),s.fixedBundle.compareAtPriceVisibility&&L&&R>_&&e.createElement(Qd,{className:"yt-fixedBundle-product-card-vertical_price--old"},tu(s.general.currencySymbol,b),eu(R))))),(f<=3||!u)&&g<f-1&&e.createElement(up,{className:"yt-fixedBundle-plus-wrapper"}," ",e.createElement(mp,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},qp=({bundle:o,addToCartFunction:a,dispatchAnalyticsEvent:l})=>{const[c,s]=t(!1),[d,p]=t(window.innerWidth<786),[u,m]=t(null),[g,x]=t(!1),[f,y]=t(!1),b="undefined"!=typeof window?window.location.href:null,h=o?.products?.find(e=>e.productDetails?.handle===b?.split("/").pop()?.split("?")[0]),v=h?.productId,w=r(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),r=n?.node;return r?e?.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[C,E]=t(Object.fromEntries(o?.products?.map((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find(t=>w(e.productDetails,t?.node?.id)>0)?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id]))),k="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"beautywiseshop.myshopify.com"===window.ytBundleApp?.storeDomain||"swashaa.myshopify.com"===window.ytBundleApp?.storeDomain),T=o?.showIndividualProductSelector??!0,[S,$]=t(new Set(o.products.reduce((e,t,n)=>(k&&t?.productId!==v&&!T||e.push(n),e),[])));n(()=>{l?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:o._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 r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}},[]),n(()=>{u&&v&&E(e=>{const t={...e};return o?.products?.forEach((e,n)=>{e.productId===v&&(t[n.toString()]=u)}),t})},[u,v,o?.products]),n(()=>{const e=()=>{p(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const B=i((e,t)=>{E(n=>({...n,[e.toString()]:t}))},[]),z=(e,t)=>{const n=o.products[t].productId;k&&n===v||$(n=>{const r=new Set(n);return e?r.add(t):r.delete(t),r})},N=r(()=>(e,t)=>w(e.productDetails,t)>0,[w]),I=r(()=>o.products.some((e,t)=>S.has(t)&&e.productDetails.variants.edges.length>1),[o.products,S]),{originalPrice:F,dealPrice:P,offerValue:D}=r(()=>{const{price:e,compareAtPrice:t}=o.products.reduce((e,t,n)=>{if(!S.has(n))return e;const r=C[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find(e=>e.node.id===r)?.node;if(!o)return e;const i=parseFloat(o?.price??"0"),a=parseFloat(o?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n="discount-on-compare"===(o?.customizations?.fixedBundle?.discountBadgeDisplay||"discount-on-price")?t:e;let r=e;S.size===o.products.length&&(o?.percentageOff?r=e*(1-o.percentageOff/100):o?.dealAmount?r=o.dealAmount:o?.amountOff&&(r=e-o.amountOff));const i=n-r;return{originalPrice:n.toFixed(2),dealPrice:r.toFixed(2),offerValue:i.toFixed(2)}},[o.products,C,S,o.percentageOff,o.dealAmount,o.amountOff,o?.customizations?.fixedBundle?.discountBadgeDisplay]),A=r(()=>o.products.map((e,t)=>({product:e,index:t})).filter(({index:e})=>S.has(e)),[o.products,S]),_=A.every(({product:e,index:t})=>N(e,C[t.toString()])),R=r(()=>{let e=0;return o.products.forEach((t,n)=>{if(S.has(n)){const r=C[n.toString()],o=t.productDetails.variants.edges.find(e=>e.node.id===r)?.node;o&&(e+=parseFloat(o.price??"0"))}}),e},[o.products,S,C]),L=async e=>{s(!0),x(!1),l?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:o._id,bundleType:"fixed-bundle",selectedProducts:A?.map(e=>({id:e?.product?.productId,title:e?.product?.productDetails?.title}))}});try{const t=Object.entries(C).map(([e,t])=>{const n=parseInt(e);return isNaN(n)||!S.has(n)?null:t}).filter(Boolean);a&&await a(Number(F),t,void 0,void 0,e)}catch(e){console.error("Error adding to cart:",e)}s(!1)},O=async e=>{if(_){if(e&&(e.preventDefault(),e.stopPropagation()),o?.personalizedForm?.title)return x(!1),void y(!0);await L()}};if(!a)return e.createElement(e.Fragment,null);const M=o.customizations,V=M.fixedBundle?.cardLayoutStyle||"auto",j="horizontal"===V||"auto"===V&&d,W="bundles"==o.appName?o.pageHeader?.title:o?.title,H="bundles"==o.appName?o.pageHeader?.description:o?.subtitle;return e.createElement(_d,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:M.fixedBundle.sectionBackgroundColor,..."transparent"!==M.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},W&&e.createElement(Rd,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:M.fixedBundle?.titleBackgroundColor||"none",color:M.fixedBundle?.titleTextColor||"black",textAlign:M.fixedBundle.infoAlignment??"center",fontSize:M.fixedBundle?.titleFontSize,..."transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===M.fixedBundle.infoAlignment&&"transparent"===M.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},W),H&&e.createElement(Ld,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:M.fixedBundle?.subtitleFontSize,textAlign:M.fixedBundle.infoAlignment??"center",..."left"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===M.fixedBundle.infoAlignment&&"transparent"!==M.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===M.fixedBundle.infoAlignment&&"transparent"===M.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},H),j?e.createElement(Od,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},o?.products?.map((t,n)=>e.createElement(e.Fragment,{key:`${t.productId}-${n}`},e.createElement(Hp,{isChecked:S.has(n),product:t.productDetails,selectedVariantId:C[n.toString()]||"",canCustomize:o?.canCustomizeFixedBundle||!1,styles:M,onVariantChange:e=>B(n,e),onCheckChange:e=>{z(e,n)},isMobile:d,index:n,isHorizontal:j,variantOptions:o.variantOptions,productsLength:o.products.length,storeCurrencyCode:o.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:o.discountType??"none",checkedProducts:S,bundleProductsCount:o.products.length,bundleDiscountValue:o.percentageOff||o.amountOff||o.dealAmount,totalSelectedOriginal:R})))):e.createElement(Jd,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},e.createElement(ep,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===M.fixedBundle.infoAlignment?"flex-start":"right"===M.fixedBundle.infoAlignment?"flex-end":"center"}},o?.products?.map((t,n)=>e.createElement(Hp,{key:`${t.productId}-${n}`,isChecked:S.has(n),product:t.productDetails,selectedVariantId:C[n.toString()]||"",canCustomize:o?.canCustomizeFixedBundle||!1,styles:M,onVariantChange:e=>{B(n,e)},onCheckChange:e=>z(e,n),isMobile:d,index:n,isHorizontal:j,productsLength:o.products.length,storeCurrencyCode:o.storeCurrencyCode,primaryProductId:v,variantId:u||void 0,bundleDiscountType:o.discountType??"none",checkedProducts:S,bundleProductsCount:o.products.length,bundleDiscountValue:o.percentageOff||o.amountOff||o.dealAmount,totalSelectedOriginal:R})),I&&e.createElement(Vp,{productsWithIndices:A,isOpen:g,onClose:()=>x(!1),variantOptions:o.variantOptions,cta:{textColor:M.general.ctaTextColor,backgroundColor:M.general.ctaBackgroundColor},onVariantChange:B,handleAddToCart:O,primaryProductId:v,variantId:u||void 0}))),e.createElement(Ud,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===M.fixedBundle.infoAlignment?"flex-start":"right"===M.fixedBundle.infoAlignment?"flex-end":"center"}},Number(F)>0&&Number(D)>0&&M.fixedBundle.compareAtPriceVisibility&&e.createElement(Yd,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",e.createElement(Xd,{className:"yt-fixedBundle-summary_price"},tu(M.general.currencySymbol,o?.storeCurrencyCode),eu(F))),0!==S.size&&e.createElement(Gd,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",e.createElement(Xd,{className:"yt-fixedBundle-summary_price"},tu(M.general.currencySymbol,o?.storeCurrencyCode),eu(P))," ",Number(D)>0&&e.createElement(Zd,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",tu(M.general.currencySymbol,o?.storeCurrencyCode),eu(D)))),e.createElement(Kd,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),j||!I?O(e):x(!0)},disabled:S.size<1||c||!_,style:{backgroundColor:M.general?.ctaBackgroundColor||"#121212",color:M.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${M.general?.ctaBackgroundColor||"#121212"}`,boxShadow:M.general.ctaShadowType,paddingTop:M.general?.ctaPadding,paddingBottom:M.general?.ctaPadding,borderRadius:M.general.ctaBorderRadius,width:M.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{M.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=M.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=M.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{M.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=M.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=M.general?.ctaTextColor||"#FFFFFF")}},c?e.createElement(ge,{color:"white",loading:c,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):_?e.createElement(e.Fragment,null,M.fixedBundle?.ctaTitle??"Add Bundle to cart"):e.createElement(e.Fragment,null,"Out of Stock")),o?.personalizedForm?.title&&e.createElement(Es,{isOpen:f,onClose:()=>y(!1),formConfig:o.personalizedForm,onCheckout:async e=>{await L(e),y(!1)},cta:{backgroundColor:M.general?.ctaBackgroundColor||"#121212",textColor:M.general?.ctaTextColor||"#FFFFFF"},isMobile:d}))},Qp=({product:r,tierIdx:o,isOpen:i,onClose:a,onAddToBundle:l,canAdd:c,isSelected:s,customizations:d,isMobile:p,splitVariants:u=!1})=>{const[m,g]=t(0),[x,f]=t(r.variants[0]?.id.toString()||""),[y,b]=t(!0),h=r.variants.find(e=>e.id.toString()===x)||r.variants[0],v=r.images.filter(Boolean),w=()=>{v.length<=1||(g(e=>0===e?v.length-1:e-1),b(!0))},C=()=>{v.length<=1||(g(e=>e===v.length-1?0:e+1),b(!0))};if(n(()=>(i&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[i]),n(()=>{if(h&&h?.featured_image?.src){const e=document.querySelector(".yt-collection-bundle-modal-image"),t=nu(h?.featured_image?.src);e?.setAttribute("src",t)}},[h]),!i)return null;const E=v.length>1,k=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:a},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",borderRadius:d?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:a,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-image-container",style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:d?.borderRadius||"12px",background:"#f5f5f5"}},v.length>0&&e.createElement(e.Fragment,null,y&&e.createElement("style",null,"\n @keyframes shimmer {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n "),y&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite",borderRadius:d?.borderRadius||"12px"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:nu(v[m]||r.images[0]),alt:r.title,onLoad:()=>b(!1),style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:d?.borderRadius||"12px",opacity:y?0:1,transition:"opacity 0.3s"}}),E&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:w,disabled:0===m,style:{position:"absolute",left:16,top:"50%",transform:"translateY(-50%)",background:0===m?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:0===m?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:0===m?.5:1}},e.createElement(Z,{size:24})),e.createElement("button",{onClick:C,disabled:m===v.length-1,style:{position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",background:m===v.length-1?"rgba(0,0,0,0.2)":"rgba(0,0,0,0.4)",border:"none",borderRadius:"50%",width:44,height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:m===v.length-1?"not-allowed":"pointer",color:"#fff",zIndex:5,opacity:m===v.length-1?.5:1}},e.createElement(O,{size:24}))))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"6px 0",fontSize:24,fontWeight:600,lineHeight:"normal"}},u&&h?.name||r.title),!u&&r.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative"}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee",lineHeight:"normal"}},r?.options?.join(" & "),":"," ",e.createElement("strong",null,h.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:x,onChange:e=>{f(e.target.value),b(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer",lineHeight:"normal"}},r.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0",lineHeight:"normal"}},"₹",(h.price/100).toLocaleString(),h.compare_at_price&&h.compare_at_price>h.price?e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999",lineHeight:"normal"}},"₹",(h.compare_at_price/100).toLocaleString()):null),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"white"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(r,o),disabled:!c||!h.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:h.available?s||!c?"#28a745":d?.atcBg||"#007bff":"rgb(204, 204, 204)",color:d?.atcText||"#fff",cursor:c&&h.available?"pointer":"not-allowed",textAlign:"center",lineHeight:"normal"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock")),r.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:r.description},style:{lineHeight:"normal",color:"#444",marginTop:"10px"}})))),T=e.createElement("div",{className:"yt-collection-bundle-modal-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:a},e.createElement("div",{className:"yt-collection-bundle-modal-container",style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement("button",{className:"yt-collection-bundle-modal-close-btn",onClick:a,style:{position:"absolute",top:12,right:12,zIndex:10,background:"#fff",border:"1px solid #ddd",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center"}},e.createElement(G,{size:22})),e.createElement("div",{className:"yt-collection-bundle-modal-scroll-container",style:{flex:1,overflowY:"auto",paddingBottom:100}},v.length>0&&e.createElement("div",{className:"yt-collection-bundle-modal-image-wrapper",style:{position:"relative",background:"#f5f5f5"}},y&&e.createElement("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s infinite"}}),e.createElement("img",{className:"yt-collection-bundle-modal-image",src:v[m]||r.images[0],alt:r.title,onLoad:()=>b(!1),style:{width:"100%",minWidth:"100%",display:"block",maxHeight:"50vh",minHeight:"50vh",objectFit:"cover",objectPosition:"center",opacity:y?0:1,transition:"opacity 0.3s"}}),E&&e.createElement(e.Fragment,null,e.createElement("button",{onClick:w,disabled:0===m,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",background:0===m?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:0===m?.5:1,cursor:0===m?"not-allowed":"pointer"}},e.createElement(Z,{size:20})),e.createElement("button",{onClick:C,disabled:m===v.length-1,style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:m===v.length-1?"rgba(0,0,0,0.3)":"rgba(0,0,0,0.5)",border:"none",borderRadius:"50%",width:40,height:40,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",zIndex:5,opacity:m===v.length-1?.5:1,cursor:m===v.length-1?"not-allowed":"pointer"}},e.createElement(O,{size:20})))),e.createElement("div",{className:"yt-collection-bundle-modal-content",style:{padding:"20px"}},e.createElement("h2",{className:"yt-collection-bundle-modal-title",style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},r.title),!u&&r.variants.length>1&&e.createElement("div",{className:"yt-collection-bundle-modal-variant-container",style:{position:"relative",marginBottom:20}},e.createElement("div",{className:"yt-collection-bundle-modal-variant-label",style:{padding:"8px 0",borderBottom:"1px solid #eee"}},r?.options?.join(" & "),":"," ",e.createElement("strong",null,h.title)),e.createElement("select",{className:"yt-collection-bundle-modal-variant-select",value:x,onChange:e=>{f(e.target.value),b(!0)},style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},r.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-modal-price-container",style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(h.price/100).toLocaleString(),h.compare_at_price?h.compare_at_price>h.price&&e.createElement("span",{className:"yt-collection-bundle-modal-compare-price",style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toLocaleString()):null),r.description&&e.createElement("div",{className:"yt-collection-bundle-modal-description",dangerouslySetInnerHTML:{__html:r.description},style:{lineHeight:1.7,color:"#444"}}))),e.createElement("div",{className:"yt-collection-bundle-modal-add-section",style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},e.createElement("button",{className:"yt-collection-bundle-modal-add-btn "+(s||!c?"yt-collection-bundle-modal-add-btn-added":""),onClick:()=>l(r,o),disabled:!c||!h.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:d?.borderRadius||"8px",background:!s&&c&&h.available?d?.atcBg||"#007bff":"#28a745",color:d?.atcText||"#fff",cursor:c&&h.available?"pointer":"not-allowed"}},s?"Added to Box":h.available?"Add to Box":"Out of Stock"))));return D.createPortal(p?T:k,document.body)},Up=({styles:t,isMobile:n,categories:r,activeCategory:o,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",...r].map(r=>{const i=o===r,c=t.btnPrimaryBg||"#111";return e.createElement("button",{key:r,onClick:()=>a(r),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"},r.charAt(0).toUpperCase()+r.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))}))):e.createElement("div",{className:"yt-collection-bundle-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-collection-bundle-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...r].map(r=>{const i=t.btnPrimaryBg||"#111",l=t.borderRadius||"8px";return e.createElement("button",{key:r,onClick:()=>a(r),className:"yt-collection-bundle-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?i:"#e0e0e0"}`,borderRadius:l,backgroundColor:o===r?i:"white",color:o===r?"white":"#333",cursor:"pointer"}},r.charAt(0).toUpperCase()+r.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[]},Gp=({config:r,bundleAddToCartLoading:a,addCustomBundleToCart:l})=>{const[c,s]=t(1),[d,p]=t("All"),[u,m]=t([]),[g,x]=t(null),[f,y]=t({}),[b,h]=t(!1),[v,w]=t(window.innerWidth<640),[C,E]=t({}),k=o(null),T=o(new Map),[S,$]=t(160),[B,z]=t(""),[N,I]=t(""),[F,P]=t(!1),[D,A]=t("none"),_=v?8:20,{customizations:R}=r,L=r.config.builderTiers.collectionTier.sort((e,t)=>e.tier-t.tier),O=!!r.config.form,M=L.length+(O?1:0),j=R.hideSelectedProducts,W=R.allowMultipleQty,H=R.hideOutOfStockProducts,q=r.config.splitVariants??!1,Q=o(new Set),U=i((e,t=d,n=N,r=D)=>{const o=L[e-1]?.products||[];let i="All"===t?o:o.filter(e=>Yp(e).includes(t));if(n.trim()){const e=n.toLowerCase();i=i.filter(t=>t.title.toLowerCase().includes(e))}return H&&(i=i.filter(e=>e.available)),"none"!==r&&(i=[...i].sort((e,t)=>{if("asc"===r||"desc"===r){const n=e.price||e.price_min||0,o=t.price||t.price_min||0;return"asc"===r?n-o:o-n}{const n=(e.title||"").toLowerCase(),o=(t.title||"").toLowerCase();return"alpha-asc"===r?n.localeCompare(o):o.localeCompare(n)}})),i},[L,d,N,D,H]),Y=i(e=>{const t=U(e).length;E(n=>{const r=n[e]||0,o=Math.min(r+8,t);return o<=r?n:{...n,[e]:o}})},[8,U]);n(()=>(k.current=new IntersectionObserver(e=>{for(const t of e)if(t.isIntersecting){const e=parseInt(t.target.getAttribute("data-sentinel-step")||"0");e>0&&e===c&&Y(e)}},{root:null,threshold:0,rootMargin:"100px 0px"}),()=>{k.current?.disconnect()}),[Y,c]),n(()=>{p("All"),z(""),I(""),P(!1),A("none")},[c]),n(()=>{const e=setTimeout(()=>{I(B)},300);return()=>clearTimeout(e)},[B]),n(()=>{if(O&&c===M)return;const e=c-1;if(!L[e])return;if(Q.current.has(e))return;const t=U(c);if(console.log("filteredProducts",t),1!==t.length)return;const n=t[0],r=n.variants.filter(e=>e.available);if(1!==r.length)return;const o=r[0],i=ie(e),a=le[e];if(i!==1/0&&a>=i)return;if(!u.some(t=>t.productId===n.id.toString()&&t.variantId===o.id.toString()&&t.tierIndex===e)&&(Q.current.add(e),m(t=>[...t,{productId:n.id.toString(),variantId:o.id.toString(),price:o.price,quantity:1,tierIndex:e}]),c<M)){const e=setTimeout(()=>{s(e=>e+1),window.scrollTo(0,0)},50);return()=>clearTimeout(e)}},[c]),n(()=>{if(O&&c===M)return;const e=c,t=U(e).length;E(n=>{const r=n[`${e}_category`]!==d;return 0===(n[e]||0)||r?{...n,[e]:Math.min(_,t),[`${e}_category`]:d}:n})},[c,_,d,U]),n(()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>w(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const X=i(e=>{$(e+10)},[]),Z=u.reduce((e,t)=>e+t.quantity,0),ee=u.reduce((e,t)=>e+t.price*t.quantity,0)/100,te=u.reduce((e,t)=>{const n=L.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId),r=n?.variants.find(e=>e.id.toString()===t.variantId);return e+(r?.compare_at_price??t.price)*t.quantity},0)/100,ne=e=>{for(let t=0;t<L.length;t++)if(L[t].products.some(t=>t.id.toString()===e))return t+1;return O?M:L.length},re=(e,t)=>{const n=e.variants.find(e=>e.id===parseInt(t));if(!n)return;const r=document.querySelector(`[data-product-id="${e.id}"]`);r&&(r.dataset.selectedVariant=t,r.dataset.currentPrice=n.price.toString())},oe=(e,t)=>{const n=document.querySelector(`[data-product-id="${e.id}"]`);if(!n)return;const r=n.dataset.selectedVariant||e.variants[0].id.toString(),o=parseInt(n.dataset.currentPrice||e.variants[0].price.toString());m(n=>{const i=`${e.id}-${r}-${t}`,a=n.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===i);if(a)return n.filter(e=>e!==a);const l=le[t],c=ie(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:r,price:o,quantity:1,tierIndex:t}]})},ie=e=>{const t=L[e];return t.maximumQuantity>0?t.maximumQuantity:1/0},ae=(e,t)=>{const n=ie(t);if(n===1/0)return!0;const r=le[t];return!!u.some(n=>n.productId===e.id.toString()&&n.tierIndex===t)||r<n},le=L.map((e,t)=>u.filter(e=>e.tierIndex===t).reduce((e,t)=>e+t.quantity,0)),ce=(e,t,n)=>{const r=ie(n);if(r===1/0)return!0;return le[n]<r},se=(e,t,n)=>{m(r=>r.filter(r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))},de=async()=>{if(c!==M||!u.length)return;const e={};O&&Object.entries(f).forEach(([t,n])=>{const r=t.split("|").pop()?.replace(/^f_\d+$/,"")||t;"string"==typeof n&&n.trim()?e[r]=n:n&&"object"==typeof n&&"url"in n&&(e[r]=n.url)});const t=u.map(t=>({variantId:t.variantId,quantity:t.quantity,properties:e}));l(t)},pe=O&&c===M,ue=(pe?null:L[c-1])?ie(c-1):0,me=L.map((e,t)=>({tier:e,items:u.filter(e=>e.tierIndex===t).reduce((e,t)=>{const n=`${t.productId}-${t.variantId}`,r=e.find(e=>`${e.productId}-${e.variantId}`===n);return r?r.quantity+=t.quantity:e.push({...t,quantity:t.quantity}),e},[]),count:le[t]}));return e.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"0 auto",maxWidth:"1600px"}},R.headerImage&&!R.headerImage.includes("Liquid error")&&e.createElement("img",{className:"yt-collection-bundle-header-img",src:R.headerImage,alt:"Collection Bundle header",style:{width:"100%"}}),R.showTierSteps&&e.createElement("div",{style:{paddingTop:R.headerImage&&!R.headerImage.includes("Liquid error")?"20px":"0"}},e.createElement(Xp,{totalSteps:M,isFormStep:pe,currentStep:c,getStepTitle:e=>O&&e===M?"Customize Gift Details":L[e-1]?.title||`Step ${e}`,isMobile:v,formTitle:r?.config?.form?.title,hasForm:O,onStepClick:e=>{s(e),window.scrollTo(0,0)}})),Array.from({length:M},(e,t)=>t+1).map(t=>{const n=O&&t===M,o=n?[]:(e=>L[e-1]?.products||[])(t);let i=[];if(!n&&R.enableProductCategories){const e=new Set;o.forEach(t=>Yp(t).forEach(t=>e.add(t))),i=Array.from(e).sort()}const l=n?[]:U(t),w=t-1,E=l.slice(0,C[t]||0);return e.createElement("div",{key:t,className:"yt-collection-bundle-step-content "+(c===t?"yt-collection-bundle-step-content-active":""),style:{display:c===t?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},n&&r.config.form?e.createElement(fs,{form:r.config.form,formData:f,setFormData:y,barHeight:S,isUploading:b,setIsUploading:h}):e.createElement(e.Fragment,null,R.enableProductCategories&&i.length>0&&e.createElement(Up,{styles:R,isMobile:v,categories:i,activeCategory:d,onCategoryChange:p}),(R.enableSearch||R.enableSort)&&e.createElement("div",{className:"yt-collection-bundle-controls",style:{display:"flex",alignItems:"center",justifyContent:v?"flex-end":"space-between",gap:"12px",padding:"0 16px",marginBottom:"16px",flexWrap:"nowrap",height:"45px"}},v?e.createElement(e.Fragment,null,F?e.createElement("div",{style:{position:"relative",flex:1,display:"flex",alignItems:"center",gap:"8px"}},e.createElement("input",{type:"text",autoFocus:!0,placeholder:"Search...",value:B,onChange:e=>z(e.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:R.borderRadius||"8px",border:`1px solid ${R.bundleBorder||"#878787"}`,background:R.productCardBg||"#fff",color:"#333",fontSize:"14px",outline:"none"}}),e.createElement("button",{onClick:()=>{P(!1),z(""),I("")},style:{background:"none",border:"none",color:"#888",cursor:"pointer",padding:"4px",display:"flex",alignItems:"center"}},e.createElement(G,null))):e.createElement("div",{style:{display:"flex",gap:"20px",alignItems:"center"}},R.enableSearch&&e.createElement("button",{onClick:()=>P(!0),style:{background:"none",border:"none",color:"#333",fontSize:"20px",cursor:"pointer",display:"flex",alignItems:"center"},className:"yt-collection-bundle-search-btn-mobile"},e.createElement(K,null)),R.enableSort&&e.createElement("div",{style:{position:"relative",display:"flex",alignItems:"center"},className:"yt-collection-bundle-sort-selecter-mobile-wrapper"},e.createElement("select",{value:D,onChange:e=>A(e.target.value),style:{position:"absolute",opacity:0,width:"100%",height:"100%",cursor:"pointer",left:0,top:0,zIndex:1},className:"yt-collection-bundle-sort-selecter-mobile"},e.createElement("option",{value:"none"},"Featured"),e.createElement("option",{value:"asc"},"Price: Low to High"),e.createElement("option",{value:"desc"},"Price: High to Low"),e.createElement("option",{value:"alpha-asc"},"Alphabetical: A-Z"),e.createElement("option",{value:"alpha-desc"},"Alphabetical: Z-A")),e.createElement("div",{style:{fontSize:"20px",color:"#333",pointerEvents:"none",display:"flex",alignItems:"center"}},e.createElement(J,null))))):e.createElement(e.Fragment,null,R.enableSort&&e.createElement("div",{style:{position:"relative",flex:"0 1 200px",marginLeft:"12px",padding:"10px 16px",borderRadius:R.borderRadius||"8px",border:"1px solid #878787",background:R.productCardBg||"#fff",display:"flex",flexDirection:"row",alignItems:"center",gap:"6px"},className:"yt-collection-bundle-sort-wrapper"},e.createElement("span",{style:{fontWeight:"500",minWidth:"fit-content",fontSize:"14px"}},"Sort By"),e.createElement("select",{value:D,onChange:e=>A(e.target.value),style:{width:"100%",color:"#333",fontSize:"14px",outline:"none",cursor:"pointer",appearance:"none",boxSizing:"border-box",lineHeight:"normal",border:"none",fontFamily:"inherit"},className:"yt-collection-bundle-sort-selector"},e.createElement("option",{value:"none"}," Featured"),e.createElement("option",{value:"asc"},"Price: Low to High"),e.createElement("option",{value:"desc"},"Price: High to Low"),e.createElement("option",{value:"alpha-asc"},"Alphabetical: A-Z"),e.createElement("option",{value:"alpha-desc"},"Alphabetical: Z-A")),e.createElement("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",color:"#888",pointerEvents:"none"}},e.createElement(V,null))),R.enableSearch&&e.createElement("div",{style:{position:"relative",flex:"0 1 300px"},className:"yt-collection-bundle-search-wrapper"},e.createElement("input",{type:"text",placeholder:"Search products...",value:B,onChange:e=>z(e.target.value),style:{width:"100%",padding:"10px 16px",paddingRight:"40px",borderRadius:R.borderRadius||"8px",border:"1px solid #878787",background:R.productCardBg||"#fff",color:"#333",fontSize:"14px",outline:"none",boxSizing:"border-box",lineHeight:"normal"},className:"yt-collection-bundle-search-input"}),e.createElement("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",color:"#888"}},e.createElement(K,null))))),e.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:v?"grid":"flex",gridTemplateColumns:v?"repeat(2,1fr)":"",flexWrap:v?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:`${S}px`}},0===l.length&&""!==N.trim()?e.createElement("div",{style:{padding:"60px 20px",textAlign:"center",width:"100%",gridColumn:"1 / -1"}},e.createElement("div",{style:{fontSize:"18px",color:"#333",marginBottom:"8px",fontWeight:600}},'No results found for "',B,'"'),e.createElement("div",{style:{fontSize:"14px",color:"#666",marginBottom:"24px"}},"Try checking your spelling or using more general terms."),e.createElement("button",{onClick:()=>{z(""),I(""),P(!1)},style:{background:R.atcBg||"#000",color:R.atcText||"#fff",padding:"12px 32px",borderRadius:R.borderRadius||"8px",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:600,transition:"opacity 0.2s"},onMouseEnter:e=>e.currentTarget.style.opacity="0.8",onMouseLeave:e=>e.currentTarget.style.opacity="1"},"Clear Search")):q?E.flatMap(t=>t.variants.filter(e=>!H||e.available).map(n=>e.createElement(Zp,{key:`${t.id}-${n.id}`,product:{...t,variants:[n]},tierIdx:w,customizations:R,isMobile:v,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:oe,canAddProduct:ae,allowMultipleQty:W,handleVariantChange:re,canIncrement:ce,setSelectedProducts:m,splitVariants:!0}))):E.map(t=>e.createElement(Zp,{key:t.id,product:t,tierIdx:w,customizations:R,isMobile:v,hoveredCard:g,setHoveredCard:x,selectedProducts:u,handleAddToBundle:oe,canAddProduct:ae,allowMultipleQty:W,handleVariantChange:re,canIncrement:ce,setSelectedProducts:m,splitVariants:!1})),c===t&&(C[t]||0)<l.length&&e.createElement("div",{ref:e=>{const n=T.current.get(t);n&&k.current?.unobserve(n),e?(T.current.set(t,e),k.current?.observe(e)):T.current.delete(t)},"data-sentinel-step":t.toString(),style:{height:"20px",width:"100%",display:"block"}}))),c===t&&e.createElement(Kp,{config:r,selectedProducts:u,selectedByTier:me,totalItems:Z,totalPrice:ee,totalCompareAtPrice:te,currentStep:c,totalSteps:M,currentTierMax:ue,tierSelectedCounts:le,isMobile:v,bundleAddToCartLoading:a,isUploading:b,hoveredCard:g,setHoveredCard:x,hideSelectedProducts:j,getProductStep:ne,setCurrentStep:s,handleRemoveItem:se,handleCheckout:de,hasForm:O,onHeightChange:X}))}))},Xp=({totalSteps:t,isFormStep:r,currentStep:o,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"})},[o,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 "+(o===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:o===n?1:.5,transition:"opacity 0.2s"},onClick:()=>s(n)},e.createElement("div",{className:"yt-collection-bundle-step-icon "+(o===n?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:o===n?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},c&&n===t?e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:o===n?"#fff":"#999"}},e.createElement("path",{d:"M20 6h-2.18c.11-.31.18-.65.18-1a2.996 2.996 0 0 0-5.5-1.65l-.5.67-.5-.67C10.96 2.54 10.05 2 9 2c-1.66 0-3 1.34-3 3 0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2zm-5-2c.55 0 1 .45 1 1s-.45 1-1 1h-2c-.55 0-1-.45-1-1s.45-1 1-1h2zm-6 0c.55 0 1 .45 1 1s-.45 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2zM20 19H4V8h16v11z"})):e.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:o===n?"#fff":"#999"}},e.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),e.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600",lineHeight:"normal"}},i(n))))),l&&c&&r&&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))},Zp=({product:n,tierIdx:r,customizations:o,isMobile:i,hoveredCard:a,setHoveredCard:l,selectedProducts:c,handleAddToBundle:s,canAddProduct:d,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:g,splitVariants:x=!1})=>{const[f,y]=t(!1),b=x?null:document.querySelector(`[data-product-id="${n.id}"]`),h=x?n.variants[0].id.toString():b?.dataset.selectedVariant??n.variants[0].id.toString(),v=n.variants.find(e=>e.id.toString()===h)||n.variants[0],w=x?`${n.id}-${v.id}`:n.id,C=c.some(e=>e.productId===n.id.toString()&&e.variantId===h&&e.tierIndex===r),E=a===w,k=c.filter(e=>e.productId===n.id.toString()&&e.variantId===v.id.toString()&&e.tierIndex===r).reduce((e,t)=>e+t.quantity,0);return e.createElement(e.Fragment,null,e.createElement("div",{key:w,className:"yt-collection-bundle-product-item","data-product-id":n.id,"data-selected-variant":v.id,"data-current-price":v.price,style:{display:"flex",flexDirection:"column",border:o?.productCardBorder||"1px solid #ddd",background:o?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:i?0:"250px",maxWidth:i?"none":"250px",borderRadius:o?.borderRadius||"8px",boxShadow:"spread"===o?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===o?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:i?"100%":""}},e.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:o?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>y(!0),onMouseEnter:()=>l(w),onMouseLeave:()=>l(null)},e.createElement("img",{src:nu(n.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px"),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:E?0:1,transform:E?"scale(1.05)":"scale(1)"},alt:n.title}),e.createElement("img",{src:nu(n.images[1]||n.images[0]),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:E?1:0,transform:"scale(1.05)"},alt:n.title}),!x&&n.variants.length>1&&e.createElement("select",{className:"yt-collection-bundle-variant-selector",style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"8px",fontSize:"12px",fontWeight:"600",zIndex:2,lineHeight:"normal"},onChange:e=>u(n,e.target.value),defaultValue:v.id,onClick:e=>{e.stopPropagation()}},n.variants.map(t=>e.createElement("option",{key:t.id,value:t.id,disabled:!t.available},t.title," ",!t.available&&"(Out of stock)")))),e.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},o.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:x?0:1}},n.title),x&&"Default Title"!==v.title&&e.createElement("p",{className:"yt-collection-bundle-variant-label",style:{fontSize:i?"10px":"12px",color:"#666",margin:"0 0 4px",lineHeight:"normal",flexGrow:1}},v.title),e.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden",lineHeight:"normal"}},e.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:i?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0,lineHeight:"normal"}},"₹",(v.price/100).toLocaleString()),v.compare_at_price&&0!==v.compare_at_price&&v.compare_at_price>v.price?e.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0,lineHeight:"normal"}},"₹",(v.compare_at_price/100).toLocaleString()):null)),p&&k>0?e.createElement("div",{className:"yt-collection-bundle-quantity-row",style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-minus",style:{width:"40%",height:v.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{g(e=>{const t=`${n.id}-${v.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o&&o.quantity>1?e.map(e=>e===o?{...e,quantity:e.quantity-1}:e):o?e.filter(e=>e!==o):e})}},"-"),e.createElement("span",{className:"yt-collection-bundle-qty-display",style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%",lineHeight:"normal"}},k),e.createElement("button",{className:"yt-collection-bundle-qty-btn yt-collection-bundle-qty-plus",style:{width:"40%",height:v.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:i?"6px":"12px",fontSize:i?"12px":"14px",textAlign:"center",lineHeight:"normal"},onClick:()=>{v.available&&m(n,v.id.toString(),r)&&g(e=>{const t=`${n.id}-${v.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o?e.map(e=>e===o?{...e,quantity:e.quantity+1}:e):[...e,{productId:n.id.toString(),variantId:v.id.toString(),price:v.price,quantity:1,tierIndex:r}]})},disabled:!v.available||!m(n,v.id.toString(),r)},"+")):e.createElement("button",{className:"yt-collection-bundle-add-btn "+(C?"yt-collection-bundle-add-btn-added":""),style:{background:C?"#28a745":d(n,r)&&v.available?o?.atcBg||"#007bff":"#ccc",color:o?.atcText||"#fff",border:"none",padding:i?"6px":"12px",fontSize:i?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:v.available?1:.6,lineHeight:"normal",textAlign:"center"},onClick:()=>{if(x)v.available&&d(n,r)&&g(e=>{const t=`${n.id}-${v.id}-${r}`,o=e.find(e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===t);return o?e.filter(e=>e!==o):[...e,{productId:n.id.toString(),variantId:v.id.toString(),price:v.price,quantity:1,tierIndex:r}]});else{if(!v.available||!d(n,r))return;s(n,r)}},disabled:!v.available||!d(n,r)},C?"Added":v.available?"ADD TO BOX":"Out of Stock")),f&&e.createElement(Qp,{product:n,tierIdx:r,isOpen:f,onClose:()=>y(!1),onAddToBundle:(e,t)=>{s(e,t),y(!1)},canAdd:d(n,r),isSelected:C,customizations:o,isMobile:i,splitVariants:x}))},Kp=r=>{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}=r,{customizations:S}=i,[$,B]=t(!1),z=o(null),N=o(null),{totalOriginal:I,hasSavings:F,formattedSavings:P,totalAfterDiscount:D}=(e=>{let t=0,n=0;e.forEach(({items:e,tier:r})=>{const o=r?.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"===o?.type&&o.tiers?.length){const e=[...o.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 r=Math.round(t-n),o=r>0;return{savings:r,totalOriginal:t,totalAfterDiscount:n,hasSavings:o,formattedSavings:o?`₹${r.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 r=e.discountData;if(!r||!r.tiers?.length)return null;const o=[...r.tiers].sort((e,t)=>e.minimumQuantity-t.minimumQuantity),i=[];if("mov_percentage"===r.type){if("number"!=typeof n)return null;const e=o.filter(e=>n>=e.minimumQuantity).pop();e&&i.push(`${e.discountValue}% OFF`);const t=o.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=o.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(r.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=o.find(e=>t<e.minimumQuantity);if(l){const e=l.minimumQuantity-t;let n=null;switch(r.type){case"percentage_discount_coupon":n=`${l.discountValue}% OFF`;break;case"amount_discount_coupon":n=`₹${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(z.current&&T){const e=z.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,r=(e?.discountData?.tiers||[]).filter(e=>n>=e.minimumQuantity).sort((e,t)=>t.discountValue-e.discountValue)[0];return r?.discountValue??0}));if(e<(N.current??0)&&(N.current=e),e>(N.current??0)){N.current=e;const t=document.querySelector(".yt-collection-bundle-next-btn");if(!t)return;const n=t.getBoundingClientRect(),r=(n.left+n.width/2)/window.innerWidth,o=(n.top+n.height/2)/window.innerHeight;ke({particleCount:100,spread:70,origin:{x:r,y:o},zIndex:9999})}},[l]),e.createElement("div",{ref:z,className:"yt-collection-bundle-bar",style:{background:S?.bundleBg||"#fff",color:S?.bundleText||"#333",border:S?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"sticky",bottom:"10px",left:"0",right:"0",marginInline:"auto",width:"compact"==S.stickyBarWidth?"600px":"90%",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},A.length>0&&e.createElement("div",{style:{padding:"4px 8px",background:"#dbdbdbc5",color:"#6c757d",textAlign:"center",fontSize:"12px",fontWeight:500}},A.join(" + ")),e.createElement("div",{className:"yt-collection-bundle-bar-header",style:{position:"relative",textAlign:"center"}},$&&e.createElement(e.Fragment,null,e.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; transform: translateX(-50%) translateY(10px); }\n to { opacity: 1; transform: translateX(-50%) translateY(0); }\n }\n "),e.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:S?.atcBg||"#007bff",color:S?.atcText||"#fff",padding:"4px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"14px",whiteSpace:"nowrap",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",animation:"fadeIn 0.3s ease-out",minWidth:"300px",textAlign:"center",border:"1px solid rgba(0,0,0,0.1)",lineHeight:"normal"}},"Add up to"," ",e.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),a.length>0&&e.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:S?.borderRadius||"8px"}},e.createElement("div",{className:"yt-collection-bundle-images",style:{display:"flex",flex:1,gap:"5px",justifyContent:"center",alignItems:"center",overflowX:"auto",padding:"4px 0",scrollbarWidth:"none"}},l.filter(({count:e})=>e>0).map(({items:t},n,r)=>e.createElement(e.Fragment,{key:n},e.createElement("div",{className:"yt-collection-bundle-tier-images",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",minWidth:"fit-content"}},e.createElement("div",{style:{display:"flex",gap:"4px"}},t.map((t,r)=>{const o=i.config.builderTiers.collectionTier.flatMap(e=>e.products).find(e=>e.id.toString()===t.productId);if(!o)return null;const a=v(t.productId),l=p===a;return e.createElement("div",{key:r,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},e.createElement("div",{style:{position:"relative",width:"67px",height:"67px",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,overflow:"hidden",cursor:l?"default":"pointer",transition:"transform 0.2s ease"},onMouseEnter:e=>!l&&(e.currentTarget.style.transform="scale(1.08)"),onMouseLeave:e=>e.currentTarget.style.transform="scale(1)",onClick:()=>!l&&w(a)},e.createElement("img",{src:nu(o.images[0]),style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${S?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none",border:"1px solid #ddd"},alt:"Selected"}),t.quantity>1&&e.createElement("div",{className:"yt-collection-bundle-qty-badge",style:{position:"absolute",bottom:"4px",right:"4px",background:"rgba(0,0,0,0.7)",color:"#fff",borderRadius:"10px",padding:"2px 6px",fontSize:"10px",fontWeight:600,lineHeight:"normal"}},"x",t.quantity),e.createElement("button",{className:"yt-collection-bundle-remove-btn",style:{position:"absolute",top:"4px",right:"4px",width:"20px",height:"20px",background:"rgba(220,53,69,0.95)",color:"white",border:"none",borderRadius:"50%",fontSize:"12px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",textAlign:"center",lineHeight:"normal"},onClick:e=>{e.stopPropagation(),C(t.productId,t.variantId,n)}},"×")))}))),n<r.length-1&&r[n+1].count>0&&e.createElement("div",{style:{color:"#666",paddingInline:"6px",lineHeight:"normal"}},e.createElement(Q,null)))))),x?e.createElement("div",{className:"yt-collection-bundle-mobile-bar-content",style:{display:"flex",flexDirection:c>0&&(k||i?.config?.builderTiers?.collectionTier?.length>1)?"column":"row",margin:"4px",gap:c>0?"10px":"0",background:"#dbdbdb",borderRadius:S?.borderRadius||"8px",overflow:"hidden"}},e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.length>0?"space-between":"center",alignItems:"center",borderRadius:S?.borderRadius||"8px"}},e.createElement(e.Fragment,null,0===c&&e.createElement("div",{style:{fontSize:"14px",color:"#6c757d",lineHeight:"normal",...0===c&&{padding:"8px 0 12px 0",background:"#dbdbdb",color:"#6c757d",width:"100%",borderRadius:S?.borderRadius||"8px"}}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px",width:"100%",justifyContent:"center",flexWrap:"wrap"}},e.createElement("div",{style:{fontSize:"14px",color:"#000",fontWeight:600}},"₹",(D??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",I.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",P)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",d.toLocaleString())),e.createElement("span",{style:{fontSize:"12px",color:"#000",fontWeight:500}},"(",c," items)")))),e.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},(i?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:1===p?"not-allowed":"pointer",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===c||y?.6:1,textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(gs,null)):p===u?"Checkout":"Next"))):e.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:S?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},(i?.config?.builderTiers?.collectionTier?.length>1||k)&&c>0&&e.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:1===p?"#515151":"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:1===p?"not-allowed":"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===b&&{filter:"brightness(60%)"},textAlign:"center",lineHeight:"normal"},onClick:()=>w(e=>Math.max(1,e-1)),onMouseEnter:()=>h(-1),onMouseLeave:()=>h(null),disabled:1===p},"Back"),e.createElement("div",{className:"yt-collection-bundle-selected-info",style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:a.length>0?"space-between":"center",paddingInline:"6px",alignItems:"center",...0===c&&{padding:"12px 24px"}}},0===c&&e.createElement("div",{style:{fontSize:"16px",color:"#6c757d",lineHeight:"normal"}},"Add Items to Checkout"),c>0&&e.createElement("div",{className:"yt-collection-bundle-price-display",style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",justifyContent:"center"}},e.createElement("div",{style:{fontSize:"16px",color:"#000",fontWeight:600}},"₹",(D??s).toLocaleString()),F?e.createElement(e.Fragment,null,e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",I.toLocaleString()),e.createElement("div",{style:{background:"#d32f2f",color:"#fff",padding:"2px 8px",borderRadius:S?.borderRadius||"8px",fontSize:"10px",fontWeight:600}},"SAVE ",P)):e.createElement(e.Fragment,null,d>s&&e.createElement("div",{style:{fontSize:"14px",color:"#787878",textDecoration:"line-through"}},"₹",d.toLocaleString())),e.createElement("span",{style:{fontSize:"16px",color:"#000",fontWeight:500}},"(",c," items)"))),c>0&&e.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===c||y?"yt-collection-bundle-next-btn-disabled":""),style:{background:S?.btnPrimaryBg||"#28a745",color:S?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===c||y?.6:1,...-2===b&&{filter:"brightness(90%)"},textAlign:"center",lineHeight:"normal"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===c||f||y,onMouseEnter:()=>h(-2),onMouseLeave:()=>h(null)},f?e.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},e.createElement(gs,null)):p===u?"Checkout":"Next")))},Jp=window?.Shopify?.currency||{rate:1,active:"INR"},eu=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Jp.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},tu=(e,t)=>t==Jp.active?e:pe(Jp.active)||Jp.active,nu=(e,t)=>{if(!e||!e.includes("cdn.shopify")&&!e.includes("/cdn/shop/files/"))return e;try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality",t?.toString()||"70"),r.has("width")||r.set("width","600"),n.toString()}catch{const n=e.includes("?")?"&":"?";return e+n+`format=webp&quality=70&width=${t?.toString()||"600"}`}},ru=(e,t,n,r,o,i,a)=>{const l=r.findIndex(t=>t.variantId===e&&(void 0===a||t.tierIndex===a));o(0===n?e=>e.filter((e,t)=>t!==l):-1===l?r=>[...r,{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))},ou=({bundle:t,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:i,setSelectedItems:a,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p,dispatchAnalyticsEvent:u,fetchStoreDetails:m,productsPagination:g})=>"fixed"!==t.type&&t.type&&0!==t?.type?.length?"builder"===t.type?e.createElement(Cs,{bundleAddToCartLoading:l,bundle:t,selectedItems:i,setSelectedItems:a,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0},dispatchAnalyticsEvent:u,fetchStoreDetails:m,productsPagination:g}):"combo"===t.type?e.createElement(Ts,{bundle:t,addToCartFunction:r,dispatchAnalyticsEvent:u}):"mixAndMatch"===t.type?e.createElement(Ad,{bundle:t,addToCartFunction:r,dispatchAnalyticsEvent:u}):"collection"===t.type?e.createElement(Gp,{config:t,addCustomBundleToCart:o,bundleAddToCartLoading:l}):e.createElement(nd,{bundle:t,currentProductId:n,addToCartFunction:r,dispatchAnalyticsEvent:u}):e.createElement(qp,{addToCartFunction:r,bundle:t,dispatchAnalyticsEvent:u}),iu=c.div`
|
|
4677
4677
|
position: relative;
|
|
4678
4678
|
`,au=c.button`
|
|
4679
4679
|
border: 1px solid #ccc;
|