yt-uikit 0.7.415-mixandmatchUIChanges.0 → 0.7.416-collection-bundle-fixes.0

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.
@@ -65,9 +65,9 @@ export type BundleConfig = {
65
65
  products: Product[];
66
66
  }[];
67
67
  };
68
- form: {
69
- title: string;
70
- sections: {
68
+ form?: {
69
+ title?: string;
70
+ sections?: {
71
71
  title: string;
72
72
  type: "text" | "image";
73
73
  fields: {
@@ -3,3 +3,4 @@ import { Checkpoint } from "../Cart";
3
3
  import { MultiStepProgressBarProps } from "./types";
4
4
  export declare const criteriaCheckpointFieldMap: (customCartProgressBarCriteria: string) => "minimumOrderValue" | "quantityThreshold";
5
5
  export declare function processCheckpoint(checkpoint: Checkpoint, index: number, sortedCheckpoints: Checkpoint[], itemCount: number, props: MultiStepProgressBarProps): CheckpointWithProgress;
6
+ export declare function hasAnyProgress(checkpoints: Checkpoint[] | undefined, currentCartAmount: number, effectiveQuantityForProgressBar: number | undefined, customCartProgressBarCriteria: string, itemCount: number): boolean;
package/dist/esm/index.js CHANGED
@@ -993,7 +993,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
993
993
  width: 100%;
994
994
  gap: 10px;
995
995
  margin-top: 16px;
996
- `;function $o({showLoyaltyCta:e,exploreCTAColor:n="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:o,isUserSignedIn:a=!1,joinNowFunction:i,exploreCtaRedirectLink:l,themeColor:d,emptyCartButtons:s=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:f,addCartItem:g,productRecsCtaButtonText:h,ctaButtonBackgroundColor:x,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:E="Empty cart Recommendations",backgroundSubdued:k,showEmptyCartRecommendations:T=!1,tertiaryColor:S,tertiaryTextColor:$}){const[B,z]=c(!1),[I,D]=c(null);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},t.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},t.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),t.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:S??"#D9D9D9"}),t.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:$??"black"})),t.createElement("span",{style:{color:b,fontWeight:"semibold"}},r),o&&t.createElement("span",{style:{color:"#929292",fontSize:"14px"}},o),!a&&e&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},t.createElement(ko,{color:n,fontSize:"14px",strokeWidth:2}),t.createElement(To,null,t.createElement("span",{onClick:i,style:{color:n,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",t.createElement("span",{style:{color:"black"}},"to avail offers"))),s&&s.length>0&&t.createElement(So,null,s.map(((e,n)=>t.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>D(n),onMouseLeave:()=>D(null),onClick:()=>window.location.href=e.link,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:I===n?d||"#73DABB":"#CACACA30",color:I===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},e.title))))),T&&f&&f.length>0&&g&&t.createElement("div",{style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},t.createElement(gr,{products:f,addCartItem:g,productRecsTitleText:E,productRecsCtaButtonText:h,ctaButtonBackgroundColor:x,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:k,tertiaryColor:S,tertiaryTextColor:$}))),t.createElement("button",{onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),onClick:()=>window.location.replace(l??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:B?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},t.createElement(Eo,{color:b}),t.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:b,cursor:"pointer"}},"Continue Shopping")))}function Bo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M12,18 L12,6 M6,12 L18,12"},child:[]}]})(e)}function zo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"polyline",attr:{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"},child:[]}]})(e)}function Io(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M6,12 L18,12"},child:[]}]})(e)}const Do=Xt("gstNumber",""),_o=Xt("gstCompanyName",""),No=Nt("");L("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const Po=Xt("postalCode",void 0);function Oo({checkoutButtonColor:e,checkoutFontSize:n,checkoutFunction:r,discountApplied:a,discountInCheckoutButton:d,discountAmountApplied:s,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:f,applyNoteToCart:g,showNoteOption:h,enableGeoLocationDeliveryRestriction:x,applyPostalCodeAndDeliverySlotToCart:y,enableSlotPicker:b,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:E,checkoutSectionMessageDisplay:k,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:B,cartCheckpoints:z,toggleDecimal:I,disableCheckoutButton:D,checkoutButtonBottomSpacing:_=8,showPoweredByBadge:N=!0,showCheckoutButtonPaymentIcons:P,primaryTextColor:O}){const A=Ut(Gt),F=Ut(Do),M=Ut(_o),R=Ut(No),L=Ut(Jt),j=Ut(Kt),V=Ut(Po),W=Ut(tn),H=Ut(en),[U,q]=c(!1),Q=mn(A,A?.currency),[G,Y]=c("closed"),Z=o(null),[X,K]=c(!1),J=i((()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),r=parseInt(n.slice(3,5),16),o=parseInt(n.slice(5,7),16),a=9===n.length?parseInt(n.slice(7,9),16):void 0,i=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),d=`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==a?`${d}${a.toString(16).padStart(2,"0")}`:d}return e}catch{return e}})($,.22)),[$]),ee=i((()=>pn(p??0,A?.currency??"INR")),[p,A?.currency]),te=i((()=>kn(I?ee.toFixed(2):ee.toFixed(0))),[ee,I]),ne=o(null),re=o(null),oe=o(null),ae=()=>{Y("closing"),setTimeout((()=>{Y("closed")}),300)},ie=pn(A?.original_total_price,A?.currency),le=i((()=>z?.find((e=>"free_delivery"===e.couponType&&void 0!==e.discountValue))),[z]),ce=i((()=>!(!le||!le.minimumOrderValue)&&ie>=le.minimumOrderValue),[le,ie]),de=ce&&le&&le.discountValue||0,se=s?pn(s,A?.currency??"INR"):0,pe=Number((ie-se).toFixed(2)),ue=i((()=>{if(!A?.items?.length)return 0;const e=A.items.reduce(((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity),0);return pn(e,A?.currency)}),[A?.items,S]),me=i((()=>ce?ue+de:ue),[ce,ue,de]),fe=i((()=>ee&&ee>0?`Add products worth more than ${Q}${te}`:""),[ee,Q,te]),ge=i((()=>A?.items?.length?A.items.reduce(((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e),0):0),[A?.items]),he=pn(ge,A?.currency??"INR");l((()=>{ne.current&&En(ne.current),re.current&&En(re.current),oe.current&&En(oe.current)}),[e,se,S,he,G,de]);const xe=i((()=>{const e={};return A?.items?.length?(A.items.forEach((t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach((t=>{e[t.title]=(e[t.title]||0)+t.amount}))})),e):e}),[A?.items]),ye=i((()=>{const e=[];for(const t in xe)if(Object.prototype.hasOwnProperty.call(xe,t)){const n=xe[t],r=pn(n,A?.currency??"INR"),o=$n(t);e.push({title:o,amount:r})}return e}),[xe,A?.currency]),be=i((()=>{let e=0;return e+=S?se+he:se,ce&&(e+=de),e}),[se,he,S,ce,de]),ve=async e=>{if(q(!0),pe<=0)q(!1);else{if(x){if("standard"!==H&&(b?!L:!j.isPostalCodeValid))return void q(!1);if(y)try{"standard"===H?await y(H):await y(H,String(V)||"",W&&b?new Date(W).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}f&&m&&""!==M&&""!==F&&await m(F,M),h&&g&&""!==R&&await g(R),await r(e),q(!1)}},[we,Ce]=c(!1);l((()=>{Ce(pe<=0||(!!D||!!x&&("standard"!==H&&(b?!L:!j.isPostalCodeValid))))}),[j,H,x,b,L,W,D,pe]);const[Ee,ke]=c(!1),Te=o(null),[Se,$e]=c("0px");l((()=>{Te.current&&$e(Ee?`${Te.current.scrollHeight}px`:"0px")}),[Ee,ye,ce]);const Be=()=>{ke(!Ee)};l((()=>{function e(e){Z.current&&!Z.current.contains(e.target)&&ae()}return"open"!==G&&"opening"!==G||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[G]);const ze=e=>e?t.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},"Checkout"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(zo,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):t.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},t.createElement(qr,{fontSize:"20px"}),t.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},"Checkout"));return t.createElement("div",{style:{position:"relative"}},!!E&&E.length>0&&!Tn()&&(()=>{const e=k||"ribbon";if("ribbon"===e)return t.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:B,marginBottom:"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},E);const n=({children:n})=>t.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",padding:"0 55px",marginBottom:"4px",position:"bookmark"===e?"absolute":"static",top:"bookmark"===e?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===e?t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},t.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:J}),t.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},E),t.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},t.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:J}),t.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:J}),t.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:$})),t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},E),t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:J}),t.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:$}))))})(),(!0===d||"true"===d)&&"closed"!==G&&t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===G?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ae}),t.createElement("div",{ref:Z,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===G?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},t.createElement("div",{style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},t.createElement("span",null,"Price Summary"),t.createElement("button",{onClick:ae,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),t.createElement("div",{style:{backgroundColor:"white",padding:"10px 1rem 0"}},t.createElement(t.Fragment,null,(S&&he>0||a&&ye.length>0||ce&&de>0)&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},Q,kn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(se>0||S&&he>0||ce&&de>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&he>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?he.toFixed(2):he.toFixed(0)))),ce&&de>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?de.toFixed(2):de.toFixed(0)))),ye.map((e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?e.amount.toFixed(2):e.amount.toFixed(0)))))),be>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},t.createElement("span",null,"Total Savings"),t.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",Q,kn(I?be.toFixed(2):be.toFixed(0))))),(se>0||S&&he>0||ce&&de>0)&&t.createElement("div",{style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:se>0||S&&he>0||ce&&de>0?"10px":"0"}},t.createElement("div",{style:{display:"flex",flexDirection:"column"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),t.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),t.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},Q,kn(I?pe.toFixed(2):pe.toFixed(0)))),t.createElement("div",{style:{display:"flex",background:$,color:B,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},t.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",t.createElement("span",null,Q,kn(I?be.toFixed(2):be.toFixed(0)))," ","on your order")),t.createElement("button",{ref:re,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},ze(U)))),(!0===d||"true"===d)&&D&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),!0===d||"true"===d?t.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${_}px 8px`}},t.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(se>0||S&&he>0||ce&&de>0)&&t.createElement("div",{className:"yt-cart-checkout-save-badge",ref:oe,style:{fontSize:"9px",backgroundColor:e,width:"max-content",padding:"2px 8px"}},"Saving ",Q,kn(I?be.toFixed(2):be.toFixed(0))),U?t.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):a||ce&&le?t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},t.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},Q,kn(I?pe.toFixed(2):pe.toFixed(0))),(se>0||he>0||ce&&de>0)&&t.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},Q,kn(ce?me.toFixed(0):ue.toFixed(0))))):t.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},Q,kn(I?pe.toFixed(2):pe.toFixed(0))),S&&he>0||a&&se>0||ce&&de>0?t.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),Y("opening"),requestAnimationFrame((()=>{Y("open")})),K(!X)}},"See Details"):t.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),t.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{backgroundColor:e,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(zo,{fontSize:"24px"}))):"CHECKOUT"))),N&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}}))):t.createElement(t.Fragment,null,D&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),t.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:O}},(he>0||a&&ye.length>0||ce&&de>0)&&be>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px"}},Q,kn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(se>0||he>0||ce&&de>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",t.createElement("button",{onClick:Be,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},Ee?"Hide details":"See details")),t.createElement("span",{style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",Q,kn(I?be.toFixed(2):be.toFixed(0)))),t.createElement("div",{ref:Te,style:{height:Se,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:Ee?1:0,marginTop:Ee?"5px":"0",borderTop:Ee?"1px solid #E5E7EB":"none",paddingTop:Ee?"5px":"0",fontWeight:"600"}},S&&he>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?he.toFixed(2):he.toFixed(0)))),ce&&de>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?de.toFixed(2):de.toFixed(0)))),ye.map((e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?e.amount.toFixed(2):e.amount.toFixed(0)))))))),t.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600"}},"Total"),t.createElement("span",{style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},Q,kn(I?pe.toFixed(2):pe.toFixed(0))))),t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==G||v?"0":`4px 1rem ${_}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,color:u??"white",textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"closed"!==G?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},ze(U)),N&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}})))))}const Ao=x.button`
996
+ `;function $o({showLoyaltyCta:e,exploreCTAColor:n="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:o,isUserSignedIn:a=!1,joinNowFunction:i,exploreCtaRedirectLink:l,themeColor:d,emptyCartButtons:s=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:f,addCartItem:g,productRecsCtaButtonText:h,ctaButtonBackgroundColor:x,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:E="Empty cart Recommendations",backgroundSubdued:k,showEmptyCartRecommendations:T=!1,tertiaryColor:S,tertiaryTextColor:$}){const[B,z]=c(!1),[I,D]=c(null);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},t.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},t.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),t.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:S??"#D9D9D9"}),t.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:$??"black"})),t.createElement("span",{style:{color:b,fontWeight:"semibold"}},r),o&&t.createElement("span",{style:{color:"#929292",fontSize:"14px"}},o),!a&&e&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},t.createElement(ko,{color:n,fontSize:"14px",strokeWidth:2}),t.createElement(To,null,t.createElement("span",{onClick:i,style:{color:n,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",t.createElement("span",{style:{color:"black"}},"to avail offers"))),s&&s.length>0&&t.createElement(So,null,s.map(((e,n)=>t.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>D(n),onMouseLeave:()=>D(null),onClick:()=>window.location.href=e.link,style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:I===n?d||"#73DABB":"#CACACA30",color:I===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},e.title))))),T&&f&&f.length>0&&g&&t.createElement("div",{style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},t.createElement(gr,{products:f,addCartItem:g,productRecsTitleText:E,productRecsCtaButtonText:h,ctaButtonBackgroundColor:x,ctaButtonTextColor:y,primaryTextColor:b,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:k,tertiaryColor:S,tertiaryTextColor:$}))),t.createElement("button",{onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1),onClick:()=>window.location.replace(l??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:B?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},t.createElement(Eo,{color:b}),t.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:b,cursor:"pointer"}},"Continue Shopping")))}function Bo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M12,18 L12,6 M6,12 L18,12"},child:[]}]})(e)}function zo(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"polyline",attr:{fill:"none",strokeWidth:"2",points:"9 6 15 12 9 18"},child:[]}]})(e)}function Io(e){return _({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M6,12 L18,12"},child:[]}]})(e)}const Do=Xt("gstNumber",""),_o=Xt("gstCompanyName",""),No=Nt("");L("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const Po=Xt("postalCode",void 0);function Oo({checkoutButtonColor:e,checkoutFontSize:n,checkoutFunction:r,discountApplied:a,discountInCheckoutButton:d,discountAmountApplied:s,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:f,applyNoteToCart:g,showNoteOption:h,enableGeoLocationDeliveryRestriction:x,applyPostalCodeAndDeliverySlotToCart:y,enableSlotPicker:b,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:E,checkoutSectionMessageDisplay:k,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:B,cartCheckpoints:z,toggleDecimal:I,disableCheckoutButton:D,checkoutButtonBottomSpacing:_=8,showPoweredByBadge:N=!0,showCheckoutButtonPaymentIcons:P,primaryTextColor:O}){const A=Ut(Gt),F=Ut(Do),M=Ut(_o),R=Ut(No),L=Ut(Jt),j=Ut(Kt),V=Ut(Po),W=Ut(tn),H=Ut(en),[U,q]=c(!1),Q=mn(A,A?.currency),[G,Y]=c("closed"),Z=o(null),[X,K]=c(!1),J=i((()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),r=parseInt(n.slice(3,5),16),o=parseInt(n.slice(5,7),16),a=9===n.length?parseInt(n.slice(7,9),16):void 0,i=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),d=`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==a?`${d}${a.toString(16).padStart(2,"0")}`:d}return e}catch{return e}})($,.22)),[$]),ee=i((()=>pn(p??0,A?.currency??"INR")),[p,A?.currency]),te=i((()=>kn(I?ee.toFixed(2):ee.toFixed(0))),[ee,I]),ne=o(null),re=o(null),oe=o(null),ae=()=>{Y("closing"),setTimeout((()=>{Y("closed")}),300)},ie=pn(A?.original_total_price,A?.currency),le=i((()=>z?.find((e=>"free_delivery"===e.couponType&&void 0!==e.discountValue))),[z]),ce=i((()=>!(!le||!le.minimumOrderValue)&&ie>=le.minimumOrderValue),[le,ie]),de=ce&&le&&le.discountValue||0,se=s?pn(s,A?.currency??"INR"):0,pe=Number((ie-se).toFixed(2)),ue=i((()=>{if(!A?.items?.length)return 0;const e=A.items.reduce(((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity),0);return pn(e,A?.currency)}),[A?.items,S]),me=i((()=>ce?ue+de:ue),[ce,ue,de]),fe=i((()=>ee&&ee>0?`Add products worth more than ${Q}${te}`:""),[ee,Q,te]),ge=i((()=>A?.items?.length?A.items.reduce(((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e),0):0),[A?.items]),he=pn(ge,A?.currency??"INR");l((()=>{ne.current&&En(ne.current),re.current&&En(re.current),oe.current&&En(oe.current)}),[e,se,S,he,G,de]);const xe=i((()=>{const e={};return A?.items?.length?(A.items.forEach((t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach((t=>{e[t.title]=(e[t.title]||0)+t.amount}))})),e):e}),[A?.items]),ye=i((()=>{const e=[];for(const t in xe)if(Object.prototype.hasOwnProperty.call(xe,t)){const n=xe[t],r=pn(n,A?.currency??"INR"),o=$n(t);e.push({title:o,amount:r})}return e}),[xe,A?.currency]),be=i((()=>{let e=0;return e+=S?se+he:se,ce&&(e+=de),e}),[se,he,S,ce,de]),ve=async e=>{if(q(!0),pe<=0)q(!1);else{if(x){if("standard"!==H&&(b?!L:!j.isPostalCodeValid))return void q(!1);if(y)try{"standard"===H?await y(H):await y(H,String(V)||"",W&&b?new Date(W).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}f&&m&&""!==M&&""!==F&&await m(F,M),h&&g&&""!==R&&await g(R),await r(e),q(!1)}},[we,Ce]=c(!1);l((()=>{Ce(pe<=0||(!!D||!!x&&("standard"!==H&&(b?!L:!j.isPostalCodeValid))))}),[j,H,x,b,L,W,D,pe]);const[Ee,ke]=c(!1),Te=o(null),[Se,$e]=c("0px");l((()=>{Te.current&&$e(Ee?`${Te.current.scrollHeight}px`:"0px")}),[Ee,ye,ce]);const Be=()=>{ke(!Ee)};l((()=>{function e(e){Z.current&&!Z.current.contains(e.target)&&ae()}return"open"!==G&&"opening"!==G||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[G]);const ze=e=>e?t.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},"Checkout"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(zo,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):t.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},t.createElement(qr,{fontSize:"20px"}),t.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},"Checkout"));return t.createElement("div",{style:{position:"relative"}},!!E&&E.length>0&&!Tn()&&(()=>{const e=k||"ribbon";if("ribbon"===e)return t.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:B,marginBottom:"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},E);const n=({children:n})=>t.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",padding:"0 55px",marginBottom:"4px",position:"bookmark"===e?"absolute":"static",top:"bookmark"===e?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===e?t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},t.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:J}),t.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:$})),t.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},E),t.createElement("svg",{width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},t.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:J}),t.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),t.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:$})))):t.createElement(n,null,t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:J}),t.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:$})),t.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:B,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},E),t.createElement("svg",{width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:J}),t.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:$}))))})(),(!0===d||"true"===d)&&"closed"!==G&&t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===G?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ae}),t.createElement("div",{ref:Z,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===G?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},t.createElement("div",{style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},t.createElement("span",null,"Price Summary"),t.createElement("button",{onClick:ae,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),t.createElement("div",{style:{backgroundColor:"white",padding:"10px 1rem 0"}},t.createElement(t.Fragment,null,(S&&he>0||a&&ye.length>0||ce&&de>0)&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px",color:"#212529"}},Q,kn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(se>0||S&&he>0||ce&&de>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&he>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?he.toFixed(2):he.toFixed(0)))),ce&&de>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?de.toFixed(2):de.toFixed(0)))),ye.map((e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?e.amount.toFixed(2):e.amount.toFixed(0)))))),be>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},t.createElement("span",null,"Total Savings"),t.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",Q,kn(I?be.toFixed(2):be.toFixed(0))))),(se>0||S&&he>0||ce&&de>0)&&t.createElement("div",{style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:se>0||S&&he>0||ce&&de>0?"10px":"0"}},t.createElement("div",{style:{display:"flex",flexDirection:"column"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),t.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),t.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},Q,kn(I?pe.toFixed(2):pe.toFixed(0)))),t.createElement("div",{style:{display:"flex",background:$,color:B,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},t.createElement("img",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",t.createElement("span",null,Q,kn(I?be.toFixed(2):be.toFixed(0)))," ","on your order")),t.createElement("button",{ref:re,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},ze(U)))),(!0===d||"true"===d)&&D&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),!0===d||"true"===d?t.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${_}px 8px`}},t.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(se>0||S&&he>0||ce&&de>0)&&t.createElement("div",{className:"yt-cart-checkout-save-badge",ref:oe,style:{fontSize:"9px",backgroundColor:e,width:"max-content",padding:"2px 8px"}},"Saving ",Q,kn(I?be.toFixed(2):be.toFixed(0))),U?t.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):a||ce&&le?t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},t.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},Q,kn(I?pe.toFixed(2):pe.toFixed(0))),(se>0||he>0||ce&&de>0)&&t.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},Q,kn(ce?me.toFixed(0):ue.toFixed(0))))):t.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},Q,kn(I?pe.toFixed(2):pe.toFixed(0))),S&&he>0||a&&se>0||ce&&de>0?t.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),Y("opening"),requestAnimationFrame((()=>{Y("open")})),K(!X)}},"See Details"):t.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),t.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{backgroundColor:e,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},P?t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},t.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),t.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},t.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),t.createElement(zo,{fontSize:"24px"}))):"CHECKOUT"))),N&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}}))):t.createElement(t.Fragment,null,D&&we&&fe&&t.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},fe),t.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:O}},(he>0||a&&ye.length>0||ce&&de>0)&&be>0&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px"}},"Subtotal"),t.createElement("span",{style:{fontSize:"14px"}},Q,kn(ce?I?me.toFixed(2):me.toFixed(0):I?ue.toFixed(2):ue.toFixed(0)))),(se>0||he>0||ce&&de>0)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",t.createElement("button",{onClick:Be,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},Ee?"Hide details":"See details")),t.createElement("span",{style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",Q,kn(I?be.toFixed(2):be.toFixed(0)))),t.createElement("div",{ref:Te,style:{height:Se,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:Ee?1:0,marginTop:Ee?"5px":"0",borderTop:Ee?"1px solid #E5E7EB":"none",paddingTop:Ee?"5px":"0",fontWeight:"600"}},S&&he>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Discount on MRP"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?he.toFixed(2):he.toFixed(0)))),ce&&de>0&&t.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,"Free Shipping"),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?de.toFixed(2):de.toFixed(0)))),ye.map((e=>t.createElement("div",{key:e.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},t.createElement("span",null,e.title),t.createElement("span",{style:{color:"#D3122A"}},"-",Q,kn(I?e.amount.toFixed(2):e.amount.toFixed(0)))))))),t.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},t.createElement("span",{style:{fontSize:"14px",fontWeight:"600"}},"Total"),t.createElement("span",{style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},Q,kn(I?pe.toFixed(2):pe.toFixed(0))))),t.createElement("button",{ref:ne,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ve,disabled:we,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==G||v?"0":`4px 1rem ${_}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:e,border:0,color:u??"white",textTransform:"uppercase",fontSize:n,letterSpacing:"1px",opacity:we?.5:1,cursor:we?"not-allowed":"pointer",borderRadius:"closed"!==G?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},ze(U)),N&&t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},t.createElement("img",{src:"https://r2.yourtoken.io/badge.png",alt:"Powered by YourToken",style:{height:"48px",width:"auto"}})))))}const Ao=x.button`
997
997
  background-color: ${e=>e.$ctaButtonBackgroundColor||"#BEB8EC"};
998
998
  color: ${e=>e.$ctaButtonTextColor||"black"};
999
999
  font-size: 11px;
@@ -2235,7 +2235,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
2235
2235
  font-weight: 400;
2236
2236
  min-width: 14px;
2237
2237
  line-height: 14px;
2238
- `,Cp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:h,handleIncrement:x,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,showCouponOptions:C,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:I,applyDiscount:D,rewardCoupons:_,userTotalPoints:N,checkoutFunction:P,joinNowFunction:O,guestLoyaltyPercentage:A,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:U,applyTemplateDiscount:q,exploreCtaRedirectLink:Q,discountAmountApplied:G,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:X,showDiscountsListToGuestUsers:K,showApplyCouponsButtonToGuestUsers:J,handleCheckpointCrossed:ee,customCartProgressBarCriteria:te,checkoutButtonColor:ne="#252E69",ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,productRecsCtaButtonText:le,productRecsTitleText:ce,emptyProductRecsTitleText:de,showProductRecsOnDesktop:se,showProductRecsOnMobile:pe,themeColor:ue,themeTextColor:me,companyName:fe,gstNumber:ge,showGSTOption:he,applyGSTToCart:xe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:ve=!1,freeProductAdjustedCartTotal:we,minimumOrderValueToAvailDiscount:Ce,signinCTAButtonVisible:Ee,cartSigninCTAMainText:ke,applyNoteToCart:Te,note:Se,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ie,showEditOptionOnProducts:De,onSetLoading:_e,showVariantSelectionDropdownInProductRecs:Ne,originalCartSubtotal:Pe,freebieProductsInCart:Oe,showFreebieClaim:Ae,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:Ue,applyPostalCodeAndDeliverySlotToCart:qe,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:it,enableCustomCartOnCartPage:lt,isCartPage:ct,showCartTimer:dt,showFreebieMilestone:pt,freebieMilestoneData:mt,cartTimerInMinutes:ft,cartTimerCustomText:gt,productRecsCardLayout:ht,productRecsCardListVariant:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:Et,checkoutSectionMessage:kt,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:It,prefixMessageText:Dt,suffixMessageText:_t,successMessageText:Nt,toggleDecimal:Pt,cartOffersCarouselHeight:Ot,disableCheckoutButton:At,showEmptyCartRecommendations:Ft=!1,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht,shouldCheckInventoryQuantity:qt})=>{const Yt=Ut(Gt),Zt=Ut(nn),[Xt,ln]=c(!1),[cn,dn]=Qt(an),[sn,un]=c(!1),[mn,fn]=c(!0),{setLoading:gn}=rn();t.useEffect((()=>{_e&&_e(gn)}),[_e]),l((()=>{const t=()=>{n(!1)};return e&&(window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t)),()=>{window.removeEventListener("popstate",t),"open"===window.history.state?.ytCustomCartDrawer&&window.history.back()}}),[e,n]);const[hn,xn]=c(!1);l((()=>{const t=document.querySelector("body");if(t)return lt&&ct?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(hn?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))}),[e,lt,ct,hn]),l((()=>{function e(){const e=window.innerWidth;xn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const yn=Yt?.items?.reduce(((e,t)=>e+t?.quantity),0),bn=o(null);l((()=>{function e(e){bn.current&&!bn.current.contains(e.target)&&dn(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),l((()=>{const e=()=>{ln(!0),window.setTimeout((()=>ln(!1)),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)}),[]);const[vn,wn]=c("normal"),[Cn,En]=c("normal"),[kn,Tn]=c("auto");l((()=>{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")}),[]),l((()=>{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]=Qt(Kt);Ut(Jt);const[$n]=Qt(tn),[Bn]=Qt(en);l((()=>{const e=Yt?.items.some((e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR")));un(e)}),[Yt?.items,je]);l((()=>{fn(!("all-products"!==Xe&&("specific-tags"!==Xe||Sn.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||Sn.isPostalCodeValid||$n||!Ke)&&("specific-tags"===Xe&&"standard"===Bn||sn&&(Ke?Sn.isPostalCodeValid&&$n:Sn.isPostalCodeValid))))}),[Sn.isPostalCodeValid,$n,sn,Xe,Ke]),Qt(on);const[zn,In]=c(!0);l((()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&In(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&In(!1)}),[]);const Dn=new Date("2024-11-01");return pn(Yt?.items_subtotal_price,Yt?.currency),t.createElement(vp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:lt,$isCartPage:ct,$isLargeScreen:hn,$switchWidthVariant:It},Zt.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Zt.showLoader&&!Zt.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,cn&&t.createElement("div",{style:{position:"fixed",inset:0,zIndex:40,backgroundColor:"rgba(128,128,128,0.7)"}},"‎"),t.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",{style:{}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ae,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Yt?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(yp,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),yn>0&&t.createElement(wp,{$backgroundSubdued:a},yn)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(lt&&ct)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(ut,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),Zt&&t.createElement(fp,{$themeColor:ue,show:Zt.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(sp,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:Ot,cartData:Yt}),dt&&zn&&Yt?.item_count?t.createElement(Ws,{minutes:ft,customText:gt,onTimerComplete:()=>{In(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Xt&&Vt&&t.createElement(Vr,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(yl,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ie,themeTextColor:me}):null),R&&Yt?.items_subtotal_price>0&&Yt?.currency&&!!L&&t.createElement(t.Fragment,null,t.createElement(wo,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?Yt?.item_count:Re,currentCartAmount:pn(void 0!==Pe?Pe:Yt?.items_subtotal_price,Yt.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:it,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:Dt,suffixMessageText:_t,successMessageText:Nt,enableConfetti:Vt})),Yt?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Yt?.items?.length&&0===Yt?.item_count&&!1===Zt?.showSkeletonLoader?t.createElement($o,{showLoyaltyCta:ve,joinNowFunction:O,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:Q,themeColor:ue,emptyCartButtons:g,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,themeTextColor:me,recProductsList:M,addCartItem:b,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Ne,emptyProductRecsTitleText:de,backgroundSubdued:a,showEmptyCartRecommendations:Ft,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(Za,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:De,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge??[],freebieFlowCheckpoints:Ye??[],cartCheckpoints:L,freeProductAdjustedCartTotal:we,imageAspectSelector:yt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:kt,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:pt,freebieMilestoneData:mt}),hn&&se&&!!M&&M?.length>0&&Yt?.item_count>0&&b&&t.createElement(gr,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Ne,cardLayout:ht,variant:xt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!hn&&pe&&!!M&&M?.length>0&&Yt?.item_count>0&&b&&t.createElement(gr,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Ne,cardLayout:ht,variant:xt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d})),t.createElement(Vo,null,Yt?.item_count>0&&w&&E&&t.createElement(Ka,{bundleProducts:E}),he&&!!xe&&Yt?.item_count>0&&t.createElement(pi,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!Yt&&Yt?.item_count>0&&!!Fe&&!!Oe&&!!Me&&Oe.length>0&&t.createElement(xl,{freebieProductsInCart:Oe,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:yt,freebieCouponTemplates:Ge,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e,shouldCheckInventoryQuantity:qt}),He&&(We?.length??0)>0&&!!qe&&Yt?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>fn(!mn)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(st,null)),t.createElement("div",{className:"icon-transition"},mn?t.createElement(ot,null):t.createElement(at,null))),"all-products"===Xe&&mn?t.createElement(Ds,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):mn&&(sn?t.createElement(Ds,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):t.createElement(_s,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:Dn}))),$e&&!!Te&&Yt?.item_count>0&&t.createElement(ui,{note:Se,noteSectionTitle:Et}),nt?.showGiftWrapOption&&Yt?.item_count>0&&t.createElement(Ls,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),Yt?.item_count>0&&jt&&!ve&&Lt&&t.createElement(bp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:I,enableConfetti:Vt}),Yt?.item_count>0&&C&&D&&!$t&&q&&_&&_?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(pa,{themeColor:ue,showGuestDiscountCoupon:U,guestRewardCoupon:H,ref:bn,discountAmountOff:k,userTotalPoints:N??0,applyDiscount:D,applyTemplateDiscount:q,rewardCoupons:_,isCouponSelectionOpen:cn,setIsCouponSelectionOpen:dn,pointsToBeUsed:S,joinNowFunction:O,guestLoyaltyPercentage:A,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!A&&ve&&!!O&&t.createElement(Lo,{cartSigninCTAMainText:ke,signinCTAButtonVisible:Ee,guestLoyaltyPercentage:A,joinNowFunction:O,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):Yt?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&Yt?.item_count>0&&void 0!==k&&void 0!==S&&!!T&&ve&&!!D&&t.createElement(aa,{themeColor:ue,applyDiscount:D,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:W,redemptionMultiplier:B}):Yt?.item_count>0&&!!A&&!!O&&t.createElement(Lo,{cartSigninCTAMainText:ke,signinCTAButtonVisible:Ee,themeColor:ue,joinNowFunction:O,guestLoyaltyPercentage:A,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),Yt?.item_count>0&&!!$t&&!!I&&ve&&$t&&void 0!==S&&t.createElement(ta,{themeColor:ue,removeDiscount:I,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:Bt,showCartLevelAltPay:W}),ve&&W&&j&&T&&Yt?.item_count>0&&t.createElement(hp,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&Yt&&Yt.item_count>0&&!!Ce&&Ce>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:ue??"#50D1AA",fontWeight:600,display:"flex",justifyContent:Ee?"space-between":"center"}},"Minimum order value to use ",Bt,":"," ",Ce),Yt&&P&&Yt?.item_count>0&&t.createElement("div",null,t.createElement(Oo,{disableCheckoutButton:!!At||Zt.cartLoading,discountApplied:z,checkoutFunction:P,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:G,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:$e,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:qe,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:kt,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:L,toggleDecimal:Pt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},Ep=x.div`
2238
+ `,Cp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:h,handleIncrement:x,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,showCouponOptions:C,bundleProducts:E,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:I,applyDiscount:D,rewardCoupons:_,userTotalPoints:N,checkoutFunction:P,joinNowFunction:O,guestLoyaltyPercentage:A,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:U,applyTemplateDiscount:q,exploreCtaRedirectLink:Q,discountAmountApplied:G,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:X,showDiscountsListToGuestUsers:K,showApplyCouponsButtonToGuestUsers:J,handleCheckpointCrossed:ee,customCartProgressBarCriteria:te,checkoutButtonColor:ne="#252E69",ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,productRecsCtaButtonText:le,productRecsTitleText:ce,emptyProductRecsTitleText:de,showProductRecsOnDesktop:se,showProductRecsOnMobile:pe,themeColor:ue,themeTextColor:me,companyName:fe,gstNumber:ge,showGSTOption:he,applyGSTToCart:xe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:ve=!1,freeProductAdjustedCartTotal:we,minimumOrderValueToAvailDiscount:Ce,signinCTAButtonVisible:Ee,cartSigninCTAMainText:ke,applyNoteToCart:Te,note:Se,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ie,showEditOptionOnProducts:De,onSetLoading:_e,showVariantSelectionDropdownInProductRecs:Ne,originalCartSubtotal:Pe,freebieProductsInCart:Oe,showFreebieClaim:Ae,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:Ue,applyPostalCodeAndDeliverySlotToCart:qe,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:it,enableCustomCartOnCartPage:lt,isCartPage:ct,showCartTimer:dt,showFreebieMilestone:pt,freebieMilestoneData:mt,cartTimerInMinutes:ft,cartTimerCustomText:gt,productRecsCardLayout:ht,productRecsCardListVariant:xt,imageAspectSelector:yt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:Et,checkoutSectionMessage:kt,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:It,prefixMessageText:Dt,suffixMessageText:_t,successMessageText:Nt,toggleDecimal:Pt,cartOffersCarouselHeight:Ot,disableCheckoutButton:At,showEmptyCartRecommendations:Ft=!1,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht,shouldCheckInventoryQuantity:qt})=>{const Yt=Ut(Gt),Zt=Ut(nn),[Xt,ln]=c(!1),[cn,dn]=Qt(an),[sn,un]=c(!1),[mn,fn]=c(!0),{setLoading:gn}=rn();t.useEffect((()=>{_e&&_e(gn)}),[_e]),l((()=>{const t=()=>{n(!1)};return e&&(window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t)),()=>{window.removeEventListener("popstate",t),"open"===window.history.state?.ytCustomCartDrawer&&window.history.back()}}),[e,n]);const[hn,xn]=c(!1);l((()=>{const t=document.querySelector("body");if(t)return lt&&ct?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(hn?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))}),[e,lt,ct,hn]),l((()=>{function e(){const e=window.innerWidth;xn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const yn=Yt?.items?.reduce(((e,t)=>e+t?.quantity),0),bn=o(null);l((()=>{function e(e){bn.current&&!bn.current.contains(e.target)&&dn(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]),l((()=>{const e=()=>{ln(!0),window.setTimeout((()=>ln(!1)),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)}),[]);const[vn,wn]=c("normal"),[Cn,En]=c("normal"),[kn,Tn]=c("auto");l((()=>{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")}),[]),l((()=>{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]=Qt(Kt);Ut(Jt);const[$n]=Qt(tn),[Bn]=Qt(en);l((()=>{const e=Yt?.items.some((e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR")));un(e)}),[Yt?.items,je]);l((()=>{fn(!("all-products"!==Xe&&("specific-tags"!==Xe||Sn.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||Sn.isPostalCodeValid||$n||!Ke)&&("specific-tags"===Xe&&"standard"===Bn||sn&&(Ke?Sn.isPostalCodeValid&&$n:Sn.isPostalCodeValid))))}),[Sn.isPostalCodeValid,$n,sn,Xe,Ke]),Qt(on);const[zn,In]=c(!0);l((()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&In(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&In(!1)}),[]);const Dn=new Date("2024-11-01");return pn(Yt?.items_subtotal_price,Yt?.currency),t.createElement(vp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:lt,$isCartPage:ct,$isLargeScreen:hn,$switchWidthVariant:It},Zt.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Zt.showLoader&&!Zt.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,cn&&t.createElement("div",{style:{position:"fixed",inset:0,zIndex:40,backgroundColor:"rgba(128,128,128,0.7)"}},"‎"),t.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",{style:{}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ae,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Yt?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(yp,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),yn>0&&t.createElement(wp,{$backgroundSubdued:a},yn)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(lt&&ct)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(ut,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),Zt&&t.createElement(fp,{$themeColor:ue,show:Zt.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(sp,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:Ot,cartData:Yt}),dt&&zn&&Yt?.item_count?t.createElement(Ws,{minutes:ft,customText:gt,onTimerComplete:()=>{In(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Xt&&Vt&&t.createElement(Vr,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(yl,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ie,themeTextColor:me}):null),R&&Yt?.items_subtotal_price>0&&Yt?.currency&&!!L&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const a=[...e].sort(((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold));return a.filter((e=>0!==e?.[Or(r)]&&("minimum_order_value"!==r||1!==e?.[Or(r)]))).some(((e,i)=>Ar(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0))}(L,pn(void 0!==Pe?Pe:Yt?.items_subtotal_price,Yt.currency),void 0===Re?Yt?.item_count:Re,te??"minimum_order_value",Yt?.item_count)&&t.createElement(t.Fragment,null,t.createElement(wo,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?Yt?.item_count:Re,currentCartAmount:pn(void 0!==Pe?Pe:Yt?.items_subtotal_price,Yt.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:it,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:Dt,suffixMessageText:_t,successMessageText:Nt,enableConfetti:Vt})),Yt?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Yt?.items?.length&&0===Yt?.item_count&&!1===Zt?.showSkeletonLoader?t.createElement($o,{showLoyaltyCta:ve,joinNowFunction:O,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:Q,themeColor:ue,emptyCartButtons:g,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,themeTextColor:me,recProductsList:M,addCartItem:b,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Ne,emptyProductRecsTitleText:de,backgroundSubdued:a,showEmptyCartRecommendations:Ft,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(Za,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:De,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Qe,freebieCouponTemplates:Ge??[],freebieFlowCheckpoints:Ye??[],cartCheckpoints:L,freeProductAdjustedCartTotal:we,imageAspectSelector:yt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:kt,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:pt,freebieMilestoneData:mt}),hn&&se&&!!M&&M?.length>0&&Yt?.item_count>0&&b&&t.createElement(gr,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Ne,cardLayout:ht,variant:xt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!hn&&pe&&!!M&&M?.length>0&&Yt?.item_count>0&&b&&t.createElement(gr,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:Ne,cardLayout:ht,variant:xt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d})),t.createElement(Vo,null,Yt?.item_count>0&&w&&E&&t.createElement(Ka,{bundleProducts:E}),he&&!!xe&&Yt?.item_count>0&&t.createElement(pi,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!Yt&&Yt?.item_count>0&&!!Fe&&!!Oe&&!!Me&&Oe.length>0&&t.createElement(xl,{freebieProductsInCart:Oe,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:yt,freebieCouponTemplates:Ge,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e,shouldCheckInventoryQuantity:qt}),He&&(We?.length??0)>0&&!!qe&&Yt?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>fn(!mn)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(st,null)),t.createElement("div",{className:"icon-transition"},mn?t.createElement(ot,null):t.createElement(at,null))),"all-products"===Xe&&mn?t.createElement(Ds,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):mn&&(sn?t.createElement(Ds,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Dn}):t.createElement(_s,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:Dn}))),$e&&!!Te&&Yt?.item_count>0&&t.createElement(ui,{note:Se,noteSectionTitle:Et}),nt?.showGiftWrapOption&&Yt?.item_count>0&&t.createElement(Ls,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),Yt?.item_count>0&&jt&&!ve&&Lt&&t.createElement(bp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:I,enableConfetti:Vt}),Yt?.item_count>0&&C&&D&&!$t&&q&&_&&_?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(pa,{themeColor:ue,showGuestDiscountCoupon:U,guestRewardCoupon:H,ref:bn,discountAmountOff:k,userTotalPoints:N??0,applyDiscount:D,applyTemplateDiscount:q,rewardCoupons:_,isCouponSelectionOpen:cn,setIsCouponSelectionOpen:dn,pointsToBeUsed:S,joinNowFunction:O,guestLoyaltyPercentage:A,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!A&&ve&&!!O&&t.createElement(Lo,{cartSigninCTAMainText:ke,signinCTAButtonVisible:Ee,guestLoyaltyPercentage:A,joinNowFunction:O,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):Yt?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&Yt?.item_count>0&&void 0!==k&&void 0!==S&&!!T&&ve&&!!D&&t.createElement(aa,{themeColor:ue,applyDiscount:D,discountAmountOff:k,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:W,redemptionMultiplier:B}):Yt?.item_count>0&&!!A&&!!O&&t.createElement(Lo,{cartSigninCTAMainText:ke,signinCTAButtonVisible:Ee,themeColor:ue,joinNowFunction:O,guestLoyaltyPercentage:A,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),Yt?.item_count>0&&!!$t&&!!I&&ve&&$t&&void 0!==S&&t.createElement(ta,{themeColor:ue,removeDiscount:I,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:Bt,showCartLevelAltPay:W}),ve&&W&&j&&T&&Yt?.item_count>0&&t.createElement(hp,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&Yt&&Yt.item_count>0&&!!Ce&&Ce>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:ue??"#50D1AA",fontWeight:600,display:"flex",justifyContent:Ee?"space-between":"center"}},"Minimum order value to use ",Bt,":"," ",Ce),Yt&&P&&Yt?.item_count>0&&t.createElement("div",null,t.createElement(Oo,{disableCheckoutButton:!!At||Zt.cartLoading,discountApplied:z,checkoutFunction:P,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:G,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:$e,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:qe,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:kt,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:L,toggleDecimal:Pt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},Ep=x.div`
2239
2239
  position: relative;
2240
2240
  `,kp=x.button`
2241
2241
  border: 1px solid #ccc;
@@ -4229,17 +4229,26 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4229
4229
  `,ag=x.div`
4230
4230
  position: relative;
4231
4231
  width: 90%;
4232
- max-height: 57vh;
4232
+ max-height: 55vh;
4233
4233
  max-width: 800px;
4234
4234
  background-color: white;
4235
4235
  border-radius: 8px;
4236
- overflow-y: hidden;
4236
+ padding: 12px 10px;
4237
+ overflow-y: auto;
4237
4238
  z-index: 1001;
4238
4239
 
4240
+ /* Hide scrollbar (Chrome, Safari) */
4241
+ &::-webkit-scrollbar {
4242
+ display: none;
4243
+ }
4244
+
4245
+ /* Hide scrollbar (Firefox) */
4246
+ scrollbar-width: none;
4247
+ -ms-overflow-style: none;
4239
4248
 
4240
4249
  @media (max-width: 600px) {
4241
- box-sizing: border-box;
4242
- width: 100% ;
4250
+ padding: 12px;
4251
+ width: 100%;
4243
4252
  max-height: 37vh;
4244
4253
  position: absolute;
4245
4254
  left: 0;
@@ -4252,7 +4261,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4252
4261
  display: flex;
4253
4262
  flex-direction: column;
4254
4263
  align-items: center;
4255
- padding: 10px 7px 0px 7px;
4264
+ padding: 8px 0px;
4256
4265
  `,lg=x.input`
4257
4266
  flex-grow: 1;
4258
4267
  padding: 8px 12px;
@@ -4269,11 +4278,10 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4269
4278
  padding: 6px 10px;
4270
4279
  }
4271
4280
  `,cg=x.button`
4272
- font-weight: 600;
4273
- font-size: 12px;
4274
4281
  background: none;
4275
4282
  border: none;
4276
4283
  color: #666;
4284
+ font-size: 14px;
4277
4285
  padding: 5.36px 10.7px;
4278
4286
  cursor: pointer;
4279
4287
  `;x.div`
@@ -4302,24 +4310,18 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4302
4310
  margin-left: 4px;
4303
4311
  }
4304
4312
  `;const dg=x.div`
4305
- max-height: calc(57vh - 80px);
4306
- overflow-y: auto;
4307
4313
  display: flex;
4308
4314
  flex-direction: column;
4309
4315
  gap: 12px;
4310
- @media (max-width: 600px) {
4311
- max-height: calc(37vh - 80px);
4312
- }
4313
-
4314
4316
  `,sg=x.div`
4315
4317
  display: flex;
4316
4318
  align-items: center;
4317
- padding: 8px 4px;
4319
+ padding: 8px;
4318
4320
  border-radius: 8px;
4319
4321
  cursor: pointer;
4320
4322
  transition: background-color 0.2s ease;
4321
- margin: 0px 6px;
4322
- background-color: ${e=>e.isSelected?e.primaryBgColor+"10":"transparent"};
4323
+
4324
+ background-color: ${e=>e.isSelected?e.primaryBgColor+"10":"transparent"};
4323
4325
  border: ${e=>e.isSelected?"1px solid "+(e.primaryBgColor+"40"):"1px solid transparent"};
4324
4326
 
4325
4327
  &:hover {
@@ -4364,7 +4366,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4364
4366
  cursor: pointer;
4365
4367
  white-space: nowrap;
4366
4368
  transition: background-color 0.2s ease;
4367
- font-weight: 600;
4369
+
4368
4370
  &:hover {
4369
4371
  background-color: ${e=>e.primaryBgColor?e.primaryBgColor+"20":"#e75a87cc"};
4370
4372
  cursor: pointer;
@@ -4411,7 +4413,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4411
4413
  font-size: 11px;
4412
4414
  padding: 4px 8px;
4413
4415
  }
4414
- `,bg=({bundle:e,addToCartFunction:n})=>{const[r,a]=c({}),[d,s]=c(!1),[p,u]=c(0),[m,f]=c(0),[g,h]=c(""),[x,y]=c([]),[b,v]=c({}),[w,C]=c(!1),[E,k]=c(window.innerWidth<450),T=e.builderTiers?.productTier||[],{originalPrice:S,dealPrice:$,offerValue:B}=i((()=>{const t=[];let n=0;Object.values(r).forEach((e=>{e.productId&&e.variantId&&(t.push({productId:e.productId,variantId:e.variantId}),n++)}));let o=0,a=0;for(const{productId:n,variantId:r}of t){const t=e.products.find((e=>e.productId===n));if(!t)continue;const i=t.productDetails.variants.edges.find((e=>e.node.id===r))?.node;if(!i)continue;const l=Number.parseFloat(i.price||"0"),c=Number.parseFloat(i.compareAtPrice||"0");o+=l,a+=c>0?c:l}let i=o;(n===T.length||e?.dealAmount)&&(e?.percentageOff?i=o*(1-e.percentageOff/100):e?.dealAmount?i=e.dealAmount:e?.amountOff&&e.amountOff<o&&(i=o-e.amountOff));const l=a||o,c=l-i;return{originalPrice:l.toFixed(2),dealPrice:i.toFixed(2),offerValue:c.toFixed(2)}}),[e,r,T.length]);l((()=>{u(T.length-Object.keys(r).length)}),[r]),l((()=>{const e={};let t=!1;T.forEach(((n,r)=>{if(n.isFixed&&n.products&&n.products.length>0){const o=n.products[0];if(o&&o.productId){const n=o.variantIds?.[0]||I(o.productId);n&&(e[r]={productId:o.productId,variantId:n},t=!0)}}})),t&&a((t=>({...t,...e})))}),[T]),l((()=>{if(null===m||0===T.length)return;const t=T[m].products.map((e=>e.productId)),n=new Map;e.products.forEach((e=>{t.includes(e.productId)&&!n.has(e.productId)&&n.set(e.productId,e)}));let r=Array.from(n.values());if(""!==g.trim()){const e=g.toLowerCase();r=r.filter((t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some((t=>t.node.title.toLowerCase().includes(e)))))}y(r)}),[g,e.products,m,T]);const z=t=>{const n=e.products.find((e=>e.productId===t));return n?.productDetails},I=t=>{const n=e.products.find((e=>e.productId===t));if(!n||!n.productDetails.variants.edges.length)return"";const r=n.productDetails.variants.edges.find((e=>e.node.inventoryQuantity>0))?.node;return r?r.id:n.productDetails.variants.edges[0].node.id},D=(e,t)=>{if(null==m)return;const n=t||I(e);a((t=>({...t,[m]:{productId:e,variantId:n}}))),s(!1),h("")},_=e=>{a((t=>{const n={...t};return delete n[e],n})),v({})};console.log("version 8 ");const N=t=>{const n=T[t];if(console.log("Opening product selection for tier:",t,n),n.isFixed)return;f(t),s(!0),h("");const r=n.products.map((e=>e.productId)),o=e.products.filter((e=>r.includes(e.productId))),a=new Map;o.forEach((e=>{a.has(e.productId)||a.set(e.productId,e)})),console.log("Filtered products for tier:",Array.from(a.values())),y(Array.from(a.values()))};l((()=>{const e=()=>{k(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const P=e.customizations,O=E,A="bundles"===e.appName?e.pageHeader?.title:e?.title,F="bundles"===e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(jf,{verticalMargin:P.comboBundle.verticalMargin,borderRadius:"20px"},P.comboBundle.embedContentVisibility&&t.createElement(Vf,null,P.comboBundle?.embedContentVisibility&&P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:P.comboBundle.infoAlignment||"left"}},t.createElement("h2",{style:{fontSize:"28px",color:P.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},A)),P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number($)>1&&t.createElement(t.Fragment,null,t.createElement(Wf,{infoAlignment:P.comboBundle.infoAlignment},t.createElement(Hf,null,Wh(P.general.currencySymbol,e.storeCurrencyCode),Vh($)),Number($)<Number(S)&&t.createElement(Uf,{style:{minWidth:"fit-content"}},Wh(P.general.currencySymbol,e.storeCurrencyCode)," ",Vh(S)),t.createElement(qf,{style:{minWidth:"fit-content"}},"In Stock")),t.createElement(Qf,{style:{textAlign:P.comboBundle.infoAlignment||"left",fontSize:P.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),t.createElement(Gf,{gridSize:T.length,isHorizontal:O},T.map(((e,n)=>{const a=(e=>!!r[e]&&!!r[e].productId)(n),{product:i,variantId:c}=(e=>{const t=r?.[e];return t?{product:z(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(n),d=i?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find((e=>e.node.id===t));return n?.node})(i,c):null,s=e.isFixed,p=o(null);return l((()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,r=t.scrollWidth;if(r<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const o=-(r-n);e.style.setProperty("--scroll-end",`${o}px`);const a=2*Math.max(1,Math.abs(o)/40)+3;e.style.setProperty("--duration",`${a}s`),e.setAttribute("data-overflow","true")}),[d?.displayName,d?.title]),a&&i?t.createElement(Yf,{key:`tier-${n}`,onClick:()=>!s&&N(n),style:{borderRadius:"20px",cursor:s?"default":"pointer"},isHorizontal:O,infoAlignment:P.comboBundle.infoAlignment},!s&&t.createElement(tg,{onClick:e=>{e.stopPropagation(),_(n)}},"×"),t.createElement(Xf,{src:i?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:i?.title,style:{aspectRatio:P?.general.imageAspectRatio||"1/1"},isHorizontal:O}),t.createElement(Kf,{style:{color:"#1e1e1e",textAlign:"center",...O&&"right"===P.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...O&&"left"===P.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!O&&"left"===P.comboBundle.infoAlignment&&{padding:"0 10px"},...O&&"center"===P.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:O},t.createElement(eg,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},t.createElement("span",null,i?.title," - ",d?.title)))):t.createElement(Zf,{key:`tier-${n}`,onClick:()=>!s&&N(n),isHorizontal:O,infoAlignment:P.comboBundle.infoAlignment,style:{cursor:s?"default":"pointer"}},s?t.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),t.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},e.title||`Product ${n+1}`)):t.createElement(t.Fragment,null,t.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},t.createElement(ng,null,"+")),t.createElement(Jf,{style:{fontSize:"15px",fontWeight:"600",color:P.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:O,infoAlignment:P.comboBundle.infoAlignment},t.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},e.title?`${e.title}`:`Select Product ${n+1}`))))}))),t.createElement(rg,{hoverProperties:{customizeHoverState:P.general.customizeHoverState,backgroundColor:P.general.ctaHoverBackgroundColor,textColor:P.general.ctaHoverTextColor},borderRadius:P.general.ctaBorderRadius,primaryBgColor:P.general.ctaBackgroundColor,onClick:async()=>{C(!0);try{if(p>0)return console.log("Please select all products"),void C(!1);const t=Object.values(r).map((e=>e.variantId)),o=Object.values(r).map((t=>{const n=e.products.find((e=>e.productId===t.productId));if(!n)return null;const r=n?.productDetails?.variants?.edges?.find((e=>e.node.id===t.variantId))?.node;return r?{variantId:t.variantId,price:Number(r.price)}:null})).filter(Boolean);await n(t.length,t,Number($),o)}catch(e){console.log("Add to cart error:",e)}finally{C(!1)}},textColor:P.general.ctaTextColor,borderColor:P.general.ctaBorderColor},0===p?w?t.createElement(Yo,{color:"white",loading:w,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,P.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${p} more item(s)`),P.comboBundle?.embedContentVisibility&&P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:P.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:P.general.primaryColor+"20",textAlign:P.comboBundle.infoAlignment||"left"}},"Description"),t.createElement("div",{style:{fontSize:P.comboBundle.productDescriptionFontSize||"16px",color:P.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:P.general.primaryColor+"08",textAlign:P.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:F}})),d&&t.createElement(og,{onClick:()=>s(!1)},t.createElement(ag,{onClick:e=>e.stopPropagation()},t.createElement(ig,{style:{position:"sticky",top:0,background:"#fff",zIndex:10}},t.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},t.createElement(lg,{placeholder:"Search",value:g,onChange:e=>{h(e.target.value)}}),t.createElement(cg,{onClick:()=>s(!1)},"Cancel")),t.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),t.createElement(dg,null,x.length>0?x.map((n=>{const o=n.productDetails,a=(e=>{if(null==m)return!1;const t=r?.[m];return!!t&&t.productId===e})(n.productId),i=I(n.productId);let l=i||"";return l=a&&null!==m?r?.[m]?.variantId||l:b[n.productId]||i,t.createElement(sg,{className:"mixAndMatch-product-item",primaryBgColor:P.general.primaryColor||"#1e1e1e",key:o.id,isSelected:a,onClick:()=>{D(n.productId,l)}},t.createElement(pg,{className:"mixAndMatch-vendor-image",src:o.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:o.title}),t.createElement(ug,{className:"mixAndMatch-vendor-info"},t.createElement(mg,{className:"mixAndMatch-vendor-name"},o.title),t.createElement(xg,{className:"mixAndMatch-variant-options"},o.variants.edges.map((({node:e})=>e.inventoryQuantity>0&&t.createElement(yg,{className:"mixAndMatch-variant-button "+(l===e.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:P.general?.primaryColor,disabled:!!a,key:e.id,isSelected:l===e.id,tierHasProductId:!!a,onClick:t=>{var r,o;t.stopPropagation(),r=n.productId,o=e.id,v((e=>({...e,[r]:o})))}},e.title))))),t.createElement(fg,{cornerRadiusType:e?.cornerRadiusType??"",primaryBgColor:P.general?.primaryColor||"#1e1e1e",onClick:()=>a?_(m||0):D(n.productId,l)},a?t.createElement(gg,null,"Added"):" + Add"))})):t.createElement(hg,null,'No products found matching "',g,'"')))))},vg=x.div`
4416
+ `,bg=({bundle:e,addToCartFunction:n})=>{const[r,a]=c({}),[d,s]=c(!1),[p,u]=c(0),[m,f]=c(0),[g,h]=c(""),[x,y]=c([]),[b,v]=c({}),[w,C]=c(!1),[E,k]=c(window.innerWidth<450),T=e.builderTiers?.productTier||[],{originalPrice:S,dealPrice:$,offerValue:B}=i((()=>{const t=[];let n=0;Object.values(r).forEach((e=>{e.productId&&e.variantId&&(t.push({productId:e.productId,variantId:e.variantId}),n++)}));let o=0,a=0;for(const{productId:n,variantId:r}of t){const t=e.products.find((e=>e.productId===n));if(!t)continue;const i=t.productDetails.variants.edges.find((e=>e.node.id===r))?.node;if(!i)continue;const l=Number.parseFloat(i.price||"0"),c=Number.parseFloat(i.compareAtPrice||"0");o+=l,a+=c>0?c:l}let i=o;(n===T.length||e?.dealAmount)&&(e?.percentageOff?i=o*(1-e.percentageOff/100):e?.dealAmount?i=e.dealAmount:e?.amountOff&&e.amountOff<o&&(i=o-e.amountOff));const l=a||o,c=l-i;return{originalPrice:l.toFixed(2),dealPrice:i.toFixed(2),offerValue:c.toFixed(2)}}),[e,r,T.length]);l((()=>{u(T.length-Object.keys(r).length)}),[r]),l((()=>{const e={};let t=!1;T.forEach(((n,r)=>{if(n.isFixed&&n.products&&n.products.length>0){const o=n.products[0];if(o&&o.productId){const n=o.variantIds?.[0]||I(o.productId);n&&(e[r]={productId:o.productId,variantId:n},t=!0)}}})),t&&a((t=>({...t,...e})))}),[T]),l((()=>{if(null===m||0===T.length)return;const t=T[m].products.map((e=>e.productId)),n=new Map;e.products.forEach((e=>{t.includes(e.productId)&&!n.has(e.productId)&&n.set(e.productId,e)}));let r=Array.from(n.values());if(""!==g.trim()){const e=g.toLowerCase();r=r.filter((t=>t.productDetails.title.toLowerCase().includes(e)||t.productDetails.selectedVariant?.displayName?.toLowerCase().includes(e)||t.productDetails.collections?.edges?.some((t=>t.node.title.toLowerCase().includes(e)))))}y(r)}),[g,e.products,m,T]);const z=t=>{const n=e.products.find((e=>e.productId===t));return n?.productDetails},I=t=>{const n=e.products.find((e=>e.productId===t));return n&&n.productDetails.variants.edges.length?n.productDetails.variants.edges[0].node.id:""},D=(e,t)=>{if(null==m)return;const n=t||I(e);a((t=>({...t,[m]:{productId:e,variantId:n}}))),s(!1),h("")},_=e=>{a((t=>{const n={...t};return delete n[e],n})),v({})};console.log("version 8 ");const N=t=>{const n=T[t];if(console.log("Opening product selection for tier:",t,n),n.isFixed)return;f(t),s(!0),h("");const r=n.products.map((e=>e.productId)),o=e.products.filter((e=>r.includes(e.productId))),a=new Map;o.forEach((e=>{a.has(e.productId)||a.set(e.productId,e)})),console.log("Filtered products for tier:",Array.from(a.values())),y(Array.from(a.values()))};l((()=>{const e=()=>{k(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const P=e.customizations,O=E,A="bundles"===e.appName?e.pageHeader?.title:e?.title,F="bundles"===e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(jf,{verticalMargin:P.comboBundle.verticalMargin,borderRadius:"20px"},P.comboBundle.embedContentVisibility&&t.createElement(Vf,null,P.comboBundle?.embedContentVisibility&&P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",marginBottom:"10px",width:"100%",textAlign:P.comboBundle.infoAlignment||"left"}},t.createElement("h2",{style:{fontSize:"28px",color:P.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},A)),P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&Number($)>1&&t.createElement(t.Fragment,null,t.createElement(Wf,{infoAlignment:P.comboBundle.infoAlignment},t.createElement(Hf,null,Wh(P.general.currencySymbol,e.storeCurrencyCode),Vh($)),Number($)<Number(S)&&t.createElement(Uf,{style:{minWidth:"fit-content"}},Wh(P.general.currencySymbol,e.storeCurrencyCode)," ",Vh(S)),t.createElement(qf,{style:{minWidth:"fit-content"}},"In Stock")),t.createElement(Qf,{style:{textAlign:P.comboBundle.infoAlignment||"left",fontSize:P.comboBundle.productDescriptionFontSize}},"Tax included. Shipping calculated at checkout."))),t.createElement(Gf,{gridSize:T.length,isHorizontal:O},T.map(((e,n)=>{const a=(e=>!!r[e]&&!!r[e].productId)(n),{product:i,variantId:c}=(e=>{const t=r?.[e];return t?{product:z(t.productId),variantId:t.variantId}:{product:void 0,variantId:""}})(n),d=i?((e,t)=>{if(!e||!e.variants.edges)return null;const n=e.variants.edges.find((e=>e.node.id===t));return n?.node})(i,c):null;console.log("Selected Variants",d);const s=e.isFixed,p=o(null);return l((()=>{const e=p.current;if(!e)return;const t=e.querySelector("span");if(!t)return;const n=e.clientWidth,r=t.scrollWidth;if(r<=n)return e.setAttribute("data-overflow","false"),e.style.removeProperty("--scroll-end"),void e.style.removeProperty("--duration");const o=-(r-n);e.style.setProperty("--scroll-end",`${o}px`);const a=2*Math.max(1,Math.abs(o)/40)+3;e.style.setProperty("--duration",`${a}s`),e.setAttribute("data-overflow","true")}),[d?.displayName,d?.title]),console.log(d),a&&i?t.createElement(Yf,{key:`tier-${n}`,onClick:()=>!s&&N(n),style:{borderRadius:"20px",cursor:s?"default":"pointer"},isHorizontal:O,infoAlignment:P.comboBundle.infoAlignment},!s&&t.createElement(tg,{onClick:e=>{e.stopPropagation(),_(n)}},"×"),t.createElement(Xf,{src:i?.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=200&width=200",alt:i?.title,style:{aspectRatio:P?.general.imageAspectRatio||"1/1"},isHorizontal:O}),t.createElement(Kf,{style:{color:"#1e1e1e",textAlign:"center",...O&&"right"===P.comboBundle.infoAlignment&&{padding:"0 8px",textAlign:"right",alignItems:"flex-end"},...O&&"left"===P.comboBundle.infoAlignment&&{padding:"0 5px",textAlign:"left",alignItems:"flex-start"},...!O&&"left"===P.comboBundle.infoAlignment&&{padding:"0 10px"},...O&&"center"===P.comboBundle.infoAlignment&&{textAlign:"left",alignItems:"flex-start",padding:"0 5px"}},isHorizontal:O},t.createElement(eg,{style:{fontSize:"15px",width:"100%",display:"flex",alignItems:"center",fontWeight:"600",textAlign:"center",lineHeight:"normal"},ref:p},t.createElement("span",null,i?.title," - ",d?.title)))):t.createElement(Zf,{key:`tier-${n}`,onClick:()=>!s&&N(n),isHorizontal:O,infoAlignment:P.comboBundle.infoAlignment,style:{cursor:s?"default":"pointer"}},s?t.createElement("div",{style:{textAlign:"center",width:"100%",height:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}},t.createElement("div",{style:{fontSize:"12px",color:"#666",marginBottom:"8px"}},"Fixed Product"),t.createElement("div",{style:{fontSize:"14px",fontWeight:"600"}},e.title||`Product ${n+1}`)):t.createElement(t.Fragment,null,t.createElement("div",{style:{width:"100%",height:"80%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderTopLeftRadius:"18px",borderTopRightRadius:"18px",flexShrink:0,backgroundColor:"#f8f9fa"}},t.createElement(ng,null,"+")),t.createElement(Jf,{style:{fontSize:"15px",fontWeight:"600",color:P.comboBundle.titleTextColor||"#1e1e1e",lineHeight:"normal",height:"20%",display:"flex",alignItems:"center",justifyContent:"center"},isHorizontal:O,infoAlignment:P.comboBundle.infoAlignment},t.createElement("p",{style:{width:"80%",margin:"0",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},e.title?`${e.title}`:`Select Product ${n+1}`))))}))),t.createElement(rg,{hoverProperties:{customizeHoverState:P.general.customizeHoverState,backgroundColor:P.general.ctaHoverBackgroundColor,textColor:P.general.ctaHoverTextColor},borderRadius:P.general.ctaBorderRadius,primaryBgColor:P.general.ctaBackgroundColor,onClick:async()=>{C(!0);try{if(p>0)return console.log("Please select all products"),void C(!1);const t=Object.values(r).map((e=>e.variantId)),o=Object.values(r).map((t=>{const n=e.products.find((e=>e.productId===t.productId));if(!n)return null;const r=n?.productDetails?.variants?.edges?.find((e=>e.node.id===t.variantId))?.node;return r?{variantId:t.variantId,price:Number(r.price)}:null})).filter(Boolean);await n(t.length,t,Number($),o)}catch(e){console.log("Add to cart error:",e)}finally{C(!1)}},textColor:P.general.ctaTextColor,borderColor:P.general.ctaBorderColor},0===p?w?t.createElement(Yo,{color:"white",loading:w,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,P.comboBundle.ctaTitle||"Add Bundle to cart"):`Add ${p} more item(s)`),P.comboBundle?.embedContentVisibility&&P.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:P.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:P.general.primaryColor+"20",textAlign:P.comboBundle.infoAlignment||"left"}},"Description"),t.createElement("div",{style:{fontSize:P.comboBundle.productDescriptionFontSize||"16px",color:P.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:P.general.primaryColor+"08",textAlign:P.comboBundle.infoAlignment||"left"},dangerouslySetInnerHTML:{__html:F}})),d&&t.createElement(og,{onClick:()=>s(!1)},t.createElement(ag,{onClick:e=>e.stopPropagation()},t.createElement(ig,null,t.createElement("div",{style:{display:"flex",width:"100%",gap:"2px",alignItems:"center",marginBottom:"8px"}},t.createElement(lg,{placeholder:"Search",value:g,onChange:e=>{h(e.target.value)}}),t.createElement(cg,{onClick:()=>s(!1)},"Cancel")),t.createElement("div",{style:{height:"1px",width:"100%",backgroundColor:"#EBEBEB"}})),t.createElement(dg,null,x.length>0?x.map((n=>{const o=n.productDetails,a=(e=>{if(null==m)return!1;const t=r?.[m];return!!t&&t.productId===e})(n.productId);let i=o.variants.edges[0].node.id;return i=a&&null!==m?r?.[m]?.variantId||i:b[n.productId]||(o.variants.edges.length>0?o.variants.edges[0].node.id:""),t.createElement(sg,{className:"mixAndMatch-product-item",primaryBgColor:P.general.primaryColor||"#1e1e1e",key:o.id,isSelected:a,onClick:()=>{D(n.productId,i)}},t.createElement(pg,{className:"mixAndMatch-vendor-image",src:o.featuredMedia?.preview?.image?.url||"/placeholder.svg?height=50&width=50",alt:o.title}),t.createElement(ug,{className:"mixAndMatch-vendor-info"},t.createElement(mg,{className:"mixAndMatch-vendor-name"},o.title),t.createElement(xg,{className:"mixAndMatch-variant-options"},o.variants.edges.map((({node:e})=>e.inventoryQuantity>0&&t.createElement(yg,{className:"mixAndMatch-variant-button "+(i===e.id?"mixAndMatch-variant-button--selected":""),primaryBgColor:P.general?.primaryColor,disabled:!!a,key:e.id,isSelected:i===e.id,tierHasProductId:!!a,onClick:t=>{var r,o;t.stopPropagation(),r=n.productId,o=e.id,v((e=>({...e,[r]:o})))}},e.title))))),t.createElement(fg,{cornerRadiusType:e?.cornerRadiusType??"",primaryBgColor:P.general?.primaryColor||"#1e1e1e",onClick:()=>a?_(m||0):D(n.productId,i)},a?t.createElement(gg,null,"Added"):" + Add"))})):t.createElement(hg,null,'No products found matching "',g,'"')))))},vg=x.div`
4415
4417
  border-radius: 8px;
4416
4418
  container-type: inline-size;
4417
4419
  `,wg=x.div`
@@ -5082,4 +5084,4 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
5082
5084
  }
5083
5085
  `,Bh=x.span`
5084
5086
  font-size: 12px;
5085
- `,zh=({productsWithIndices:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:i,handleAddToCart:d,primaryProductId:s,variantId:p})=>{const[u,m]=c((()=>{const t={};return e?.forEach((({product:e,index:n})=>{let r=e?.productDetails?.options?.map((e=>e.values[0]??""));if(e.productId===s&&p){const t=e?.productDetails?.variants?.edges.find((e=>e?.node?.id?.includes(p)))?.node;t&&(r=t.title.split(" / "))}t[n]=r})),t}));l((()=>{if(!s||!p)return;const t=e?.find((({product:e})=>e?.productId===s));if(!t)return;const{product:n,index:r}=t,o=n?.productDetails?.variants?.edges?.find((e=>e.node.id.includes(p)))?.node;if(o){const e=o.title.split(" / ");m((t=>({...t,[r]:e}))),g((e=>({...e,[r]:{node:o}}))),i(r,o.id)}}),[p,s,e,i]);const[f,g]=c({}),h=(t,n,r)=>{const o={...u};o[t][r]=n,m(o);const{product:a}=e?.find((e=>e.index===t))||{product:{productDetails:{variants:{edges:[]}}}};if(!a?.productDetails)return;const l=a?.productDetails?.variants?.edges?.find((e=>e.node.title===o[t].join(" / ")))?.node;l&&(i(t,l.id),g((e=>({...e,[t]:{node:l}}))))};if(!n)return null;const x=t.createElement(fh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(gh,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(hh,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map((({product:n,index:r},o)=>t.createElement(t.Fragment,null,t.createElement(yh,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(bh,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[r]?.node?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(vh,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(wh,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(Eh,{className:"yt-fixedBundle-variant-modal_selected-value"},u[r].join(" / "))),n.productDetails.options.map(((e,n)=>{const o=a&&a?.options?.find((t=>t.name===e.name));return e.values.length<=1?t.createElement(t.Fragment,null):o&&"color"===o?.type?t.createElement(kh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Bh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o.values.find((t=>t.name===e))?.value?t.createElement(Th,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:o.values.find((t=>t.name===e))?.value||e,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},t.createElement("span",null)):t.createElement(Sh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},e))))):o&&"image"===o?.type?t.createElement(kh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Bh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o?.values.find((t=>t.name===e))?.value?t.createElement($h,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:u[r][n]==e,onClick:()=>{h(r,e,n)},src:o.values.find((t=>t.name===e))?.value},t.createElement("span",null)):t.createElement(Sh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},e))))):t.createElement(kh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Bh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,o)=>t.createElement(Sh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:o,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},e))))})))),o<e.length-1&&t.createElement(Ch,{className:"yt-fixedBundle-variant-modal_divider"})))),t.createElement(xh,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:d},"Add bundle to cart")));return v.createPortal(x,document.body)},Ih=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,d]=c(!1),s=o(null);l((()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]);const p=e=>"color"===a?t.createElement(ah,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(ih,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(Kg,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:s},t.createElement(Jg,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>d(!i)},t.createElement(eh,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(th,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(nh,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map((e=>t.createElement(rh,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),d(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(oh,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name))))))},Dh=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:d="dropdown"})=>{const[s,p]=c(r||[]);l((()=>{if(a&&e.variants.edges.some((e=>e.node.id.includes(a)))){const t=e.variants.edges.find((e=>e.node.id.includes(a)))?.node;if(t){const e=t.title.split(" / ");p(e)}}}),[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find((t=>t.name===e));return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map((e=>({name:e,value:e})));const r=n.options.find((t=>t.name===e.name));return e.values.map((e=>{const t=r?.values?.find((t=>t.name===e));return{name:e,value:t?.value||e}}))},f=(e,t)=>{const n=s[t];if(!n)return null;return m(e).find((e=>e.name===n))||null};return t.createElement(lh,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map(((n,r)=>t.createElement(ch,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(Ih,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...s];r[t]=n.name,p(r);const a=e.variants.edges.find((n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t])))?.node.id;o(a||"")})(r,t)},type:u(n.name)})))))},_h=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:i,onCheckChange:d,isMobile:s,isHorizontal:p,index:u,variantOptions:m,productsLength:f,handleOpenModal:g,storeCurrencyCode:h,primaryProductId:x,variantId:y})=>{const[b,v]=c(e?.variants?.edges.find((e=>e?.node?.id===n))?.node),[w]=c(e?.options?.map((e=>e?.values?.[0]))||[]),C=e?.id===x;l((()=>{if(y&&e.id===x){const t=e?.variants?.edges?.find((e=>e?.node?.id?.includes(y)))?.node;t&&(v(t),i(t.id))}else{const t=e?.variants?.edges?.find((e=>e?.node?.id===n))?.node;v(t)}}),[e,x,n,y,i]);const E="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,k=b?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,p?t.createElement("div",{className:""+(e.id===x?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(uh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(sh,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${u}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:C}),t.createElement(ph,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}-${u}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,null))),t.createElement(kg,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Tg,{className:"yt-fixedBundle-product-card-horizontal_image",src:Hh(k),alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(Sg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement($g,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Bg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(zg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Wh(a.general.currencySymbol,h)," ",Vh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(Ig,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Wh(a.general.currencySymbol,h),Vh(b?.compareAtPrice))),t.createElement(Dh,{product:e,variantOptions:m,selectedVariants:w,onVariantChange:e=>{i(e)},variantId:y,primaryProductId:x})))):t.createElement(t.Fragment,null,t.createElement(Rg,{className:""+(e.id===x?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...E&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(mh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:E},t.createElement(sh,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${u}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:C}),t.createElement(ph,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}-${u}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Lg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(jg,{className:"yt-fixedBundle-product-card_image--vertical",src:Hh(k),style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(Vg,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(Wg,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(Hg,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(Ug,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(qg,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(Qg,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Yg,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(Gg,{className:"yt-fixedBundle-product-card-vertical_price--new"},Wh(a.general.currencySymbol,h),Vh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(Ig,{className:"yt-fixedBundle-product-card-vertical_price--old"},Wh(a.general.currencySymbol,h),Vh(b?.compareAtPrice))))),(f<=3||!s)&&u<f-1&&t.createElement(Zg,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(Xg,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},Nh=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[d,s]=c(window.innerWidth<786),[p,u]=c(null),[m,f]=c(!1),g="undefined"!=typeof window?window.location.href:null,h=e?.products?.find((e=>e.productDetails?.handle===g?.split("/").pop()?.split("?")[0])),x=h?.productId,[y,b]=c(Object.fromEntries(e?.products?.map(((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find((e=>e?.node?.inventoryQuantity>0))?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id])))),v="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),w=e?.showIndividualProductSelector||!0,[C,E]=c(new Set(e.products.reduce(((e,t,n)=>(v&&t?.productId!==x&&!w||e.push(n),e)),[])));l((()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");u(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)}}),[]),l((()=>{p&&x&&b((t=>{const n={...t};return e?.products?.forEach(((e,t)=>{e.productId===x&&(n[t.toString()]=p)})),n}))}),[p,x,e?.products]),l((()=>{const e=()=>{s(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const k=a(((e,t)=>{b((n=>({...n,[e.toString()]:t})))}),[]),T=(t,n)=>{const r=e.products[n].productId;v&&w&&r===x||E((e=>{const r=new Set(e);return t?r.add(n):r.delete(n),r}))},S=e.disableInventoryTracking||e.products.every((e=>e.productDetails.variants.edges.some((e=>e.node.inventoryQuantity>0)))),$=i((()=>e.products.some(((e,t)=>C.has(t)&&e.productDetails.variants.edges.length>1))),[e.products,C]),{originalPrice:B,dealPrice:z,offerValue:I}=i((()=>{const{price:t,compareAtPrice:n}=e.products.reduce(((e,t,n)=>{if(!C.has(n))return e;const r=y[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find((e=>e.node.id===r))?.node;if(!o)return e;const a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);C.size===e.products.length&&(e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff));const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[e.products,y,C,e.percentageOff,e.dealAmount,e.amountOff]),D=async e=>{e.preventDefault(),e.stopPropagation(),o(!0),f(!1);try{const e=Object.entries(y).map((([e,t])=>{const n=parseInt(e);return isNaN(n)||!C.has(n)?null:t})).filter(Boolean);n&&await n(Number(B),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)},_=i((()=>e.products.map(((e,t)=>({product:e,index:t}))).filter((({index:e})=>C.has(e)))),[e.products,C]);if(!n)return t.createElement(t.Fragment,null);if(e?.customizations.general?.trackInventory&&!S)return t.createElement(t.Fragment,null);const N=e.customizations,P=N.fixedBundle?.cardLayoutStyle||"auto",O="horizontal"===P||"auto"===P&&d,A="bundles"==e.appName?e.pageHeader?.title:e?.title,F="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(vg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:N.fixedBundle.sectionBackgroundColor,..."transparent"!==N.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},A&&t.createElement(wg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:N.fixedBundle?.titleBackgroundColor||"none",color:N.fixedBundle?.titleTextColor||"black",textAlign:N.fixedBundle.infoAlignment??"center",fontSize:N.fixedBundle?.titleFontSize,..."transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===N.fixedBundle.infoAlignment&&"transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===N.fixedBundle.infoAlignment&&"transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===N.fixedBundle.infoAlignment&&"transparent"===N.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},A),F&&t.createElement(Cg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:N.fixedBundle?.subtitleFontSize,textAlign:N.fixedBundle.infoAlignment??"center",..."left"===N.fixedBundle.infoAlignment&&"transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===N.fixedBundle.infoAlignment&&"transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===N.fixedBundle.infoAlignment&&"transparent"===N.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},F),O?t.createElement(Eg,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map(((n,r)=>t.createElement(t.Fragment,{key:`${n.productId}-${r}`},t.createElement(_h,{isChecked:C.has(r),product:n.productDetails,selectedVariantId:y[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:N,onVariantChange:e=>k(r,e),onCheckChange:e=>{T(e,r)},isMobile:d,index:r,isHorizontal:O,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0}))))):t.createElement(Fg,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(Mg,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===N.fixedBundle.infoAlignment?"flex-start":"right"===N.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map(((n,r)=>t.createElement(_h,{key:`${n.productId}-${r}`,isChecked:C.has(r),product:n.productDetails,selectedVariantId:y[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:N,onVariantChange:e=>k(r,e),onCheckChange:e=>T(e,r),isMobile:d,index:r,isHorizontal:O,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0}))),$&&t.createElement(zh,{productsWithIndices:_,isOpen:m,onClose:()=>f(!1),variantOptions:e.variantOptions,cta:{textColor:N.general.ctaTextColor,backgroundColor:N.general.ctaBackgroundColor},onVariantChange:k,handleAddToCart:D,primaryProductId:x,variantId:p||void 0}))),t.createElement(Dg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===N.fixedBundle.infoAlignment?"flex-start":"right"===N.fixedBundle.infoAlignment?"flex-end":"center"}},Number(B)>0&&Number(I)>0&&N.fixedBundle.compareAtPriceVisibility&&t.createElement(_g,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(Pg,{className:"yt-fixedBundle-summary_price"},Wh(N.general.currencySymbol,e?.storeCurrencyCode),Vh(B))),0!==C.size&&t.createElement(Ng,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(Pg,{className:"yt-fixedBundle-summary_price"},Wh(N.general.currencySymbol,e?.storeCurrencyCode),Vh(z))," ",Number(I)>0&&t.createElement(Og,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",Wh(N.general.currencySymbol,e?.storeCurrencyCode),Vh(I)))),t.createElement(Ag,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),O||!$?D(e):f(!0)},disabled:C.size<1||r,style:{backgroundColor:N.general?.ctaBackgroundColor||"#121212",color:N.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${N.general?.ctaBackgroundColor||"#121212"}`,boxShadow:N.general.ctaShadowType,paddingTop:N.general?.ctaPadding,paddingBottom:N.general?.ctaPadding,borderRadius:N.general.ctaBorderRadius,width:N.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{N.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=N.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=N.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{N.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=N.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=N.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(Yo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,N.fixedBundle?.ctaTitle??"Add Bundle to cart")))},Ph=()=>t.createElement(t.Fragment,null,t.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),t.createElement("div",{style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),Oh=({product:e,tierIdx:n,isOpen:r,onClose:o,onAddToBundle:a,canAdd:i,isSelected:d,customizations:s,isMobile:p})=>{const[u,m]=c(0),[f,g]=c(e.variants[0].id.toString()),h=e.variants.find((e=>e.id.toString()===f))||e.variants[0],x=e.images.filter(Boolean);if(l((()=>(r&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""})),[r]),!r)return null;const y=t.createElement("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:o},t.createElement("div",{style:{background:"#fff",borderRadius:s?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{onClick:o,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"}},t.createElement(ct,{size:22})),t.createElement("div",{style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:s?.borderRadius||"12px"}},x.length>0&&t.createElement("img",{src:h.featured_image?.src||x[u]||e.images[0],alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:s?.borderRadius||"12px"}}),x.length>1&&t.createElement("div",{style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},x.map(((e,n)=>t.createElement("div",{key:n,onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer",display:"block"}}))))),t.createElement("div",{style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},t.createElement("h2",{style:{margin:"0 0 12px",fontSize:24,fontWeight:600}},e.title),e.variants.length>1&&t.createElement("div",{style:{position:"relative"}},t.createElement("div",{style:{padding:"8px 0",borderBottom:"1px solid #eee"}},e?.options?.join(" & "),":"," ",t.createElement("strong",null,h.title)),t.createElement("select",{value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},e.variants.map((e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)"))))),t.createElement("div",{style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(h.price/100).toFixed(0),h.compare_at_price&&h.compare_at_price>h.price&&t.createElement("span",{style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toFixed(0))),t.createElement("div",{style:{position:"sticky",bottom:0,background:"white"}},t.createElement("button",{onClick:()=>a(e,n),disabled:!i||!h.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:s?.borderRadius||"8px",background:h.available?d||!i?"#28a745":s?.atcBg||"#007bff":"rgb(204, 204, 204)",color:s?.atcText||"#fff",cursor:i&&h.available?"pointer":"not-allowed"}},d?"Added to Box":h.available?"Add to Box":"Out of Stock")),e.description&&t.createElement("div",{dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:1.7,color:"#444"}})))),b=t.createElement("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:o},t.createElement("div",{style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{onClick:o,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"}},t.createElement(ct,{size:22})),t.createElement("div",{style:{flex:1,overflowY:"auto",paddingBottom:100}},x.length>0&&t.createElement("div",{style:{position:"relative"}},t.createElement("img",{src:h.featured_image?.src||x[u]||e.images[0],alt:e.title,style:{width:"100%",display:"block",maxHeight:"50vh",objectFit:"cover",objectPosition:"center"}}),x.length>1&&t.createElement("div",{style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},x.map(((e,n)=>t.createElement("div",{key:n,onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer"}}))))),t.createElement("div",{style:{padding:"20px"}},t.createElement("h2",{style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},e.title),e.variants.length>1&&t.createElement("div",{style:{position:"relative",marginBottom:20}},t.createElement("div",{style:{padding:"8px 0",borderBottom:"1px solid #eee"}},"Variant: ",t.createElement("strong",null,h.title)),t.createElement("select",{value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},e.variants.map((e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)"))))),t.createElement("div",{style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(h.price/100).toFixed(0),h.compare_at_price&&h.compare_at_price>h.price&&t.createElement("span",{style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toFixed(0))),e.description&&t.createElement("div",{dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:1.7,color:"#444"}}))),t.createElement("div",{style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},t.createElement("button",{onClick:()=>a(e,n),disabled:!i||!h.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:s?.borderRadius||"8px",background:!d&&i&&h.available?s?.atcBg||"#007bff":"#28a745",color:s?.atcText||"#fff",cursor:i&&h.available?"pointer":"not-allowed"}},d?"Added to Box":h.available?"Add to Box":"Out of Stock"))));return v.createPortal(p?b:y,document.body)},Ah=({title:e,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return t.createElement("div",{style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},t.createElement("div",{style:{fontWeight:500,color:"#333",marginBottom:"4px"}},e),i&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},t.createElement(Ph,null)," Uploading ",n?.name,"...")),l&&t.createElement(t.Fragment,null,t.createElement("div",{style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),t.createElement("button",{type:"button",onClick:a,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!i&&!l&&t.createElement(t.Fragment,null,t.createElement("div",{style:{margin:"12px 0"}},t.createElement("img",{src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),t.createElement("div",{style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),t.createElement("button",{type:"button",onClick:o,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&t.createElement(t.Fragment,null,t.createElement("div",{style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),t.createElement("button",{type:"button",onClick:r,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},Fh=({config:e,bundleAddToCartLoading:n,addCustomBundleToCart:r})=>{const[a,i]=c(1),[d,s]=c([]),[p,u]=c(null),[m,f]=c({}),[g,h]=c(window.innerWidth<640),x=o(new Map),[y,b]=c(!1);l((()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>h(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[]);const{customizations:v}=e,w=e.config.builderTiers.collectionTier.sort(((e,t)=>e.tier-t.tier)),C=w.length+1,E=C,k=v.hideSelectedProducts,T=v.allowMultipleQty,S=v.hideOutOfStockProducts,$=d.reduce(((e,t)=>e+t.quantity),0),B=d.reduce(((e,t)=>e+t.price*t.quantity),0)/100,z=d.reduce(((e,t)=>{const n=w.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,I=(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())},D=(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());s((n=>{const a=`${e.id}-${r}-${t}`,i=n.find((e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===a));if(i)return n.filter((e=>e!==i));const l=P[t],c=_(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:r,price:o,quantity:1,tierIndex:t}]}))},_=e=>{const t=w[e];return t.minimumQuantity>0?t.minimumQuantity:1/0},N=(e,t)=>{const n=_(t);if(n===1/0)return!0;const r=P[t],o=d.some((n=>n.productId===e.id.toString()&&n.tierIndex===t));return!!o||r<n},P=w.map(((e,t)=>d.filter((e=>e.tierIndex===t)).reduce(((e,t)=>e+t.quantity),0))),O=(e,t,n)=>{const r=_(n);if(r===1/0)return!0;return P[n]<r},A=e=>{if(!x.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");f((t=>({...t,[e]:{loading:!0,name:n.name}})));try{const t=await(async e=>{const t=new FormData;t.append("file",e),b(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw b(!1),alert("Upload failed. Try again."),e}finally{b(!1)}})(n);f((r=>({...r,[e]:{url:t,name:n.name}})))}catch{f((t=>({...t,[e]:{error:!0,name:n.name}})))}}},document.body.appendChild(t),x.current.set(e,t)}return x.current.get(e)},F=a<=w.length?w[a-1]:null,M=F?_(a-1):0,R=w.map(((e,t)=>{const n=d.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}),[]);return{tier:e,items:n,count:P[t]}}));return t.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"20px auto",maxWidth:"1400px"}},t.createElement(Mh,{totalSteps:C,formStepIndex:E,currentStep:a,getStepTitle:e=>e===E?"Customize Gift Details":w[e-1]?.title||`Step ${e}`,isMobile:g,formTitle:e.config.form.title,onStepClick:e=>{if(e>1&&!d.length)return alert("Add at least one product first");i(e),window.scrollTo(0,0)}}),Array.from({length:C},((e,t)=>t+1)).map((n=>{const r=n===E,o=r?[]:(e=>w[e-1]?.products||[])(n),i=S?o.filter((e=>e.available)):o,l=n-1;return t.createElement("div",{key:n,className:"yt-collection-bundle-step-content "+(a===n?"yt-collection-bundle-step-content-active":""),style:{display:a===n?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},r&&e.config.form?t.createElement("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:g?"180px":"160px"}},e.config.form.sections.map(((e,n)=>t.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},t.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px"}},e.title),"text"===e.type&&t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px"}},e.fields.map(((e,n)=>{const r=e.title??"Field "+n;return t.createElement("textarea",{key:r,className:"yt-collection-bundle-textarea",placeholder:e.title,rows:3,maxLength:500,onChange:e=>f((t=>({...t,[r]:e.target.value}))),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical"}})}))),"image"===e.type&&t.createElement("div",{style:{marginBottom:"24px"}},t.createElement("sub",{style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px"}},"jpeg/png (max 5MB)"),t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},e.fields.map(((e,n)=>{const r=e.title??"Field "+n,o=m[r];return t.createElement(Ah,{key:r,title:e.title,uploadState:o,onUpload:()=>A(r).click(),onRemove:()=>f((e=>{const{[r]:t,...n}=e;return n})),onRetry:()=>A(r).click()})})))))))):t.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:g?"grid":"flex",gridTemplateColumns:g?"repeat(2,1fr)":"",flexWrap:g?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:g?"180px":"160px"}},i.map((e=>t.createElement(Rh,{key:e.id,product:e,tierIdx:l,customizations:v,isMobile:g,hoveredCard:p,setHoveredCard:u,selectedProducts:d,handleAddToBundle:D,canAddProduct:N,allowMultipleQty:T,handleVariantChange:I,canIncrement:O,setSelectedProducts:s})))))})),t.createElement(Lh,{config:e,selectedProducts:d,selectedByTier:R,totalItems:$,totalPrice:B,totalCompareAtPrice:z,currentStep:a,formStepIndex:E,currentTierMax:M,tierSelectedCounts:P,isMobile:g,bundleAddToCartLoading:n,isUploading:y,hoveredCard:p,setHoveredCard:u,hideSelectedProducts:k,getProductStep:e=>{for(let t=0;t<w.length;t++)if(w[t].products.some((t=>t.id.toString()===e)))return t+1;return E},setCurrentStep:i,handleRemoveItem:(e,t,n)=>{s((r=>r.filter((r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))))},handleCheckout:async()=>{if(a!==E||!d.length)return;const e={};Object.entries(m).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=d.map((t=>({variantId:t.variantId,quantity:t.quantity,properties:e})));r(t)}}))},Mh=({totalSteps:e,formStepIndex:n,currentStep:r,getStepTitle:o,isMobile:a,formTitle:i,onStepClick:l})=>t.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"}},t.createElement("div",{className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:"center",gap:a?"0":"2rem",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:e},((e,t)=>t+1)).map((e=>t.createElement("div",{key:e,className:"yt-collection-bundle-step-item "+(r===e?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:"120px",cursor:"pointer",opacity:r===e?1:.5,transition:"opacity 0.2s"},onClick:()=>l(e)},t.createElement("div",{className:"yt-collection-bundle-step-icon "+(r===e?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:r===e?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},e===n?t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===e?"#fff":"#999"}},t.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"})):t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===e?"#fff":"#999"}},t.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),t.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600"}},o(e)))))),i&&t.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000"}},i)),Rh=({product:e,tierIdx:n,customizations:r,isMobile:o,hoveredCard:a,setHoveredCard:i,selectedProducts:l,handleAddToBundle:d,canAddProduct:s,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:f})=>{const[g,h]=c(!1),x=document.querySelector(`[data-product-id="${e.id}"]`),y=x?.dataset.selectedVariant||e.variants[0].id.toString(),b=e.variants.find((e=>e.id.toString()===y))||e.variants[0],v=l.some((t=>t.productId===e.id.toString()&&t.variantId===y&&t.tierIndex===n)),w=a===e.id,C=l.filter((t=>t.productId===e.id.toString()&&t.variantId===b.id.toString()&&t.tierIndex===n)).reduce(((e,t)=>e+t.quantity),0);return t.createElement(t.Fragment,null,t.createElement("div",{key:e.id,className:"yt-collection-bundle-product-item","data-product-id":e.id,"data-selected-variant":b.id,"data-current-price":b.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:o?0:"250px",maxWidth:o?"none":"250px",borderRadius:r?.borderRadius||"8px",boxShadow:"spread"===r?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===r?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:o?"100%":""}},t.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:r?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>h(!0),onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null)},t.createElement("img",{src:e.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?0:1,transform:w?"scale(1.05)":"scale(1)"},alt:e.title}),t.createElement("img",{src:e.images[1]||e.images[0],style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?1:0,transform:"scale(1.05)"},alt:e.title}),e.variants.length>1&&t.createElement("select",{style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"10px",fontSize:"12px",zIndex:2},onChange:t=>u(e,t.target.value),defaultValue:b.id},e.variants.map((e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)"))))),t.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},t.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:o?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:1.3,color:"#333",flexGrow:1}},e.title),t.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden"}},t.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:o?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0}},"₹",(b.price/100).toFixed(0)),b.compare_at_price&&b.compare_at_price>b.price&&t.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0}},"₹",(b.compare_at_price/100).toFixed(0)))),p&&C>0?t.createElement("div",{style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},t.createElement("button",{style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px"},onClick:()=>{f((t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find((e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r));return o&&o.quantity>1?t.map((e=>e===o?{...e,quantity:e.quantity-1}:e)):o?t.filter((e=>e!==o)):t}))}},"-"),t.createElement("span",{style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%"}},C),t.createElement("button",{style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px"},onClick:()=>{b.available&&m(e,b.id.toString(),n)&&f((t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find((e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r));return o?t.map((e=>e===o?{...e,quantity:e.quantity+1}:e)):[...t,{productId:e.id.toString(),variantId:b.id.toString(),price:b.price,quantity:1,tierIndex:n}]}))},disabled:!b.available||!m(e,b.id.toString(),n)},"+")):t.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":s(e,n)&&b.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:o?"6px":"12px",fontSize:o?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:b.available?1:.6},onClick:()=>{b.available&&s(e,n)&&d(e,n)},disabled:!b.available||!s(e,n)},v?"Added":b.available?"ADD TO BOX":"Out of Stock")),g&&t.createElement(Oh,{product:e,tierIdx:n,isOpen:g,onClose:()=>h(!1),onAddToBundle:(e,t)=>{d(e,t),h(!1)},canAdd:s(e,n),isSelected:v,customizations:r,isMobile:o}))},Lh=e=>{const{config:n,selectedProducts:r,selectedByTier:a,totalItems:i,totalPrice:d,totalCompareAtPrice:s,currentStep:p,formStepIndex:u,currentTierMax:m,tierSelectedCounts:f,isMobile:g,bundleAddToCartLoading:h,isUploading:x,hoveredCard:y,setHoveredCard:b,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:E}=e,{customizations:k}=n,[T,S]=c(!0),[$,B]=c(!1),z=o(null);return l((()=>(m!==1/0&&f[p-1]===m-2&&m>1&&!$&&(B(!0),z.current=setTimeout((()=>{B(!1),z.current=null}),3e3)),()=>{z.current&&clearTimeout(z.current)})),[m,f,p]),t.createElement("div",{className:"yt-collection-bundle-bar",style:{background:k?.bundleBg||"#fff",color:k?.bundleText||"#333",border:k?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",width:"600px",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:k?.borderRadius||"8px"}},t.createElement("div",{style:{position:"relative",textAlign:"center"}},r.length>0&&t.createElement("button",{onClick:()=>S((e=>!e)),style:{background:"#87878766",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 12px",color:"#555555",borderRadius:"0 0 28px 28px"}},T?t.createElement(gn,null):t.createElement(at,null)),$&&t.createElement(t.Fragment,null,t.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 "),t.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:k?.atcBg||"#007bff",color:k?.atcText||"#fff",padding:"4px 8px",borderRadius:k?.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)"}},"Add up to"," ",t.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),T&&r.length>0&&t.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:k?.borderRadius||"8px"}},t.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"}},a.filter((({count:e})=>e>0)).map((({items:e},r,o)=>t.createElement(t.Fragment,{key:r},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",minWidth:"fit-content"}},t.createElement("div",{style:{display:"flex",gap:"4px"}},e.map(((e,o)=>{const a=n.config.builderTiers.collectionTier.flatMap((e=>e.products)).find((t=>t.id.toString()===e.productId));if(!a)return null;const i=v(e.productId),l=p===i;return t.createElement("div",{key:o,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},t.createElement("div",{style:{position:"relative",width:"65px",height:"65px",borderRadius:`calc(${k?.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(i)},t.createElement("img",{src:a.images[0],style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${k?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none"},alt:"Selected"}),e.quantity>1&&t.createElement("div",{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}},"x",e.quantity),t.createElement("button",{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)"},onClick:t=>{t.stopPropagation(),C(e.productId,e.variantId,r)}},"×")))})))),r<o.length-1&&o[r+1].count>0&&t.createElement("div",{style:{color:"#666",paddingInline:"6px"}},t.createElement(lt,null))))))),g?t.createElement("div",{style:{display:"flex",flexDirection:"column",padding:"4px",gap:"10px"}},t.createElement("div",{style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",paddingInline:"6px"}},t.createElement("div",{style:{fontSize:"14px",color:"#6c757d"}},i," items Selected"),i>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement("div",{style:{fontSize:"14px",color:"#6c757d",fontWeight:600}},"₹",d.toLocaleString()),t.createElement("div",{style:{fontSize:"14px",color:"#6c757dc9",fontWeight:500,textDecoration:"line-through"}},"₹",s.toLocaleString()))),t.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},t.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",borderRadius:k?.borderRadius||"8px"},onClick:()=>w((e=>Math.max(1,e-1))),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:k?.btnPrimaryBg||"#28a745",color:k?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===i||x?.6:1,borderRadius:k?.borderRadius||"8px"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===i||h||x},h?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(Ph,null)):p===u?"Checkout":"Next"))):t.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:k?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},t.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===y&&{filter:"brightness(60%)"}},onClick:()=>w((e=>Math.max(1,e-1))),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),t.createElement("div",{style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",paddingInline:"6px"}},t.createElement("div",{style:{fontSize:"14px",color:"#6c757d"}},i," items Selected"),i>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement("div",{style:{fontSize:"14px",color:"#6c757d",fontWeight:600}},"₹",d.toLocaleString()),t.createElement("div",{style:{fontSize:"14px",color:"#6c757dc9",fontWeight:500,textDecoration:"line-through"}},"₹",s.toLocaleString()))),t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:k?.btnPrimaryBg||"#28a745",color:k?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===i||x?.6:1,...-2===y&&{filter:"brightness(90%)"}},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===i||h||x,onMouseEnter:()=>b(-2),onMouseLeave:()=>b(null)},h?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(Ph,null)):p===u?"Checkout":"Next")))},jh=window?.Shopify?.currency||{rate:1,active:"INR"},Vh=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*jh.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},Wh=(e,t)=>t==jh.active?e:sn(jh.active)||jh.active,Hh=e=>{if(!e)return e;try{const t=new URL(e),n=t.searchParams;return n.has("format")||n.set("format","webp"),n.has("quality")||n.set("quality","70"),n.has("width")||n.set("width","600"),t.toString()}catch{const t=e.includes("?")?"&":"?";return e+t+"format=webp&quality=70&width=600"}},Uh=(e,t,n,r,o)=>{const a=r.findIndex((t=>t.variantId===e));o(0===n?e=>e.filter(((e,t)=>t!==a)):-1===a?r=>[...r,{product:t,variantId:e,quantity:n}]:e=>e.map(((e,t)=>t===a?{...e,quantity:e.quantity+n}:e)))},qh=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:d,renderingOnPage:s,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(lf,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:s,selectedItemsQuantity:d??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(df,{bundle:e,addToCartFunction:r}):"mixAndMatch"===e.type?t.createElement(bg,{bundle:e,addToCartFunction:r}):"collection"===e.type?t.createElement(Fh,{config:e,addCustomBundleToCart:o,bundleAddToCartLoading:l}):t.createElement(Lf,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(Nh,{addToCartFunction:r,bundle:e});L(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Qh=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},"‎"),t.createElement("div",{className:"side back"},"‎"),t.createElement("div",{className:"side left"},"‎"),t.createElement("div",{className:"side right"},"‎"),t.createElement("div",{className:"side bottom"},"‎"),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},"‎"),t.createElement("div",{className:"flap south"},"‎"),t.createElement("div",{className:"flap east"},"‎"),t.createElement("div",{className:"flap west"},"‎")))));export{qh as Bundle,Qh as BundleLoader,uu as Cart,la as CouponFrame,qe as Nudge,Je as SpinnerWheel};
5087
+ `,zh=({productsWithIndices:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:i,handleAddToCart:d,primaryProductId:s,variantId:p})=>{const[u,m]=c((()=>{const t={};return e?.forEach((({product:e,index:n})=>{let r=e?.productDetails?.options?.map((e=>e.values[0]??""));if(e.productId===s&&p){const t=e?.productDetails?.variants?.edges.find((e=>e?.node?.id?.includes(p)))?.node;t&&(r=t.title.split(" / "))}t[n]=r})),t}));l((()=>{if(!s||!p)return;const t=e?.find((({product:e})=>e?.productId===s));if(!t)return;const{product:n,index:r}=t,o=n?.productDetails?.variants?.edges?.find((e=>e.node.id.includes(p)))?.node;if(o){const e=o.title.split(" / ");m((t=>({...t,[r]:e}))),g((e=>({...e,[r]:{node:o}}))),i(r,o.id)}}),[p,s,e,i]);const[f,g]=c({}),h=(t,n,r)=>{const o={...u};o[t][r]=n,m(o);const{product:a}=e?.find((e=>e.index===t))||{product:{productDetails:{variants:{edges:[]}}}};if(!a?.productDetails)return;const l=a?.productDetails?.variants?.edges?.find((e=>e.node.title===o[t].join(" / ")))?.node;l&&(i(t,l.id),g((e=>({...e,[t]:{node:l}}))))};if(!n)return null;const x=t.createElement(fh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(gh,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(hh,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map((({product:n,index:r},o)=>t.createElement(t.Fragment,null,t.createElement(yh,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(bh,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[r]?.node?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(vh,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(wh,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(Eh,{className:"yt-fixedBundle-variant-modal_selected-value"},u[r].join(" / "))),n.productDetails.options.map(((e,n)=>{const o=a&&a?.options?.find((t=>t.name===e.name));return e.values.length<=1?t.createElement(t.Fragment,null):o&&"color"===o?.type?t.createElement(kh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Bh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o.values.find((t=>t.name===e))?.value?t.createElement(Th,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:o.values.find((t=>t.name===e))?.value||e,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},t.createElement("span",null)):t.createElement(Sh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},e))))):o&&"image"===o?.type?t.createElement(kh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Bh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o?.values.find((t=>t.name===e))?.value?t.createElement($h,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:u[r][n]==e,onClick:()=>{h(r,e,n)},src:o.values.find((t=>t.name===e))?.value},t.createElement("span",null)):t.createElement(Sh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},e))))):t.createElement(kh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Bh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,o)=>t.createElement(Sh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:o,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},e))))})))),o<e.length-1&&t.createElement(Ch,{className:"yt-fixedBundle-variant-modal_divider"})))),t.createElement(xh,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:d},"Add bundle to cart")));return v.createPortal(x,document.body)},Ih=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,d]=c(!1),s=o(null);l((()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&d(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]);const p=e=>"color"===a?t.createElement(ah,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(ih,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(Kg,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:s},t.createElement(Jg,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>d(!i)},t.createElement(eh,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(th,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(nh,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map((e=>t.createElement(rh,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),d(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(oh,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name))))))},Dh=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:d="dropdown"})=>{const[s,p]=c(r||[]);l((()=>{if(a&&e.variants.edges.some((e=>e.node.id.includes(a)))){const t=e.variants.edges.find((e=>e.node.id.includes(a)))?.node;if(t){const e=t.title.split(" / ");p(e)}}}),[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find((t=>t.name===e));return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map((e=>({name:e,value:e})));const r=n.options.find((t=>t.name===e.name));return e.values.map((e=>{const t=r?.values?.find((t=>t.name===e));return{name:e,value:t?.value||e}}))},f=(e,t)=>{const n=s[t];if(!n)return null;return m(e).find((e=>e.name===n))||null};return t.createElement(lh,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map(((n,r)=>t.createElement(ch,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(Ih,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...s];r[t]=n.name,p(r);const a=e.variants.edges.find((n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t])))?.node.id;o(a||"")})(r,t)},type:u(n.name)})))))},_h=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:i,onCheckChange:d,isMobile:s,isHorizontal:p,index:u,variantOptions:m,productsLength:f,handleOpenModal:g,storeCurrencyCode:h,primaryProductId:x,variantId:y})=>{const[b,v]=c(e?.variants?.edges.find((e=>e?.node?.id===n))?.node),[w]=c(e?.options?.map((e=>e?.values?.[0]))||[]),C=e?.id===x;l((()=>{if(y&&e.id===x){const t=e?.variants?.edges?.find((e=>e?.node?.id?.includes(y)))?.node;t&&(v(t),i(t.id))}else{const t=e?.variants?.edges?.find((e=>e?.node?.id===n))?.node;v(t)}}),[e,x,n,y,i]);const E="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,k=b?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,p?t.createElement("div",{className:""+(e.id===x?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(uh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(sh,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${u}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:C}),t.createElement(ph,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}-${u}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,null))),t.createElement(kg,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Tg,{className:"yt-fixedBundle-product-card-horizontal_image",src:Hh(k),alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(Sg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement($g,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Bg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(zg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Wh(a.general.currencySymbol,h)," ",Vh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(Ig,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Wh(a.general.currencySymbol,h),Vh(b?.compareAtPrice))),t.createElement(Dh,{product:e,variantOptions:m,selectedVariants:w,onVariantChange:e=>{i(e)},variantId:y,primaryProductId:x})))):t.createElement(t.Fragment,null,t.createElement(Rg,{className:""+(e.id===x?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...E&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(mh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:E},t.createElement(sh,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}-${u}`,defaultChecked:r,onChange:e=>d(e.target.checked),disabled:C}),t.createElement(ph,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}-${u}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Lg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(jg,{className:"yt-fixedBundle-product-card_image--vertical",src:Hh(k),style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(Vg,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(Wg,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(Hg,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(Ug,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(qg,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(Qg,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Yg,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(Gg,{className:"yt-fixedBundle-product-card-vertical_price--new"},Wh(a.general.currencySymbol,h),Vh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(Ig,{className:"yt-fixedBundle-product-card-vertical_price--old"},Wh(a.general.currencySymbol,h),Vh(b?.compareAtPrice))))),(f<=3||!s)&&u<f-1&&t.createElement(Zg,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(Xg,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},Nh=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[d,s]=c(window.innerWidth<786),[p,u]=c(null),[m,f]=c(!1),g="undefined"!=typeof window?window.location.href:null,h=e?.products?.find((e=>e.productDetails?.handle===g?.split("/").pop()?.split("?")[0])),x=h?.productId,[y,b]=c(Object.fromEntries(e?.products?.map(((e,t)=>[t.toString(),e?.productDetails?.variants?.edges?.find((e=>e?.node?.inventoryQuantity>0))?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id])))),v="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),w=e?.showIndividualProductSelector||!0,[C,E]=c(new Set(e.products.reduce(((e,t,n)=>(v&&t?.productId!==x&&!w||e.push(n),e)),[])));l((()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");u(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)}}),[]),l((()=>{p&&x&&b((t=>{const n={...t};return e?.products?.forEach(((e,t)=>{e.productId===x&&(n[t.toString()]=p)})),n}))}),[p,x,e?.products]),l((()=>{const e=()=>{s(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const k=a(((e,t)=>{b((n=>({...n,[e.toString()]:t})))}),[]),T=(t,n)=>{const r=e.products[n].productId;v&&w&&r===x||E((e=>{const r=new Set(e);return t?r.add(n):r.delete(n),r}))},S=e.disableInventoryTracking||e.products.every((e=>e.productDetails.variants.edges.some((e=>e.node.inventoryQuantity>0)))),$=i((()=>e.products.some(((e,t)=>C.has(t)&&e.productDetails.variants.edges.length>1))),[e.products,C]),{originalPrice:B,dealPrice:z,offerValue:I}=i((()=>{const{price:t,compareAtPrice:n}=e.products.reduce(((e,t,n)=>{if(!C.has(n))return e;const r=y[n.toString()];if(!r)return e;const o=t.productDetails.variants.edges?.find((e=>e.node.id===r))?.node;if(!o)return e;const a=parseFloat(o?.price??"0"),i=parseFloat(o?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=i,e}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);C.size===e.products.length&&(e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff));const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[e.products,y,C,e.percentageOff,e.dealAmount,e.amountOff]),D=async e=>{e.preventDefault(),e.stopPropagation(),o(!0),f(!1);try{const e=Object.entries(y).map((([e,t])=>{const n=parseInt(e);return isNaN(n)||!C.has(n)?null:t})).filter(Boolean);n&&await n(Number(B),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)},_=i((()=>e.products.map(((e,t)=>({product:e,index:t}))).filter((({index:e})=>C.has(e)))),[e.products,C]);if(!n)return t.createElement(t.Fragment,null);if(e?.customizations.general?.trackInventory&&!S)return t.createElement(t.Fragment,null);const N=e.customizations,P=N.fixedBundle?.cardLayoutStyle||"auto",O="horizontal"===P||"auto"===P&&d,A="bundles"==e.appName?e.pageHeader?.title:e?.title,F="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(vg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:N.fixedBundle.sectionBackgroundColor,..."transparent"!==N.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},A&&t.createElement(wg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:N.fixedBundle?.titleBackgroundColor||"none",color:N.fixedBundle?.titleTextColor||"black",textAlign:N.fixedBundle.infoAlignment??"center",fontSize:N.fixedBundle?.titleFontSize,..."transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===N.fixedBundle.infoAlignment&&"transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===N.fixedBundle.infoAlignment&&"transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===N.fixedBundle.infoAlignment&&"transparent"===N.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},A),F&&t.createElement(Cg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:N.fixedBundle?.subtitleFontSize,textAlign:N.fixedBundle.infoAlignment??"center",..."left"===N.fixedBundle.infoAlignment&&"transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===N.fixedBundle.infoAlignment&&"transparent"!==N.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===N.fixedBundle.infoAlignment&&"transparent"===N.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},F),O?t.createElement(Eg,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map(((n,r)=>t.createElement(t.Fragment,{key:`${n.productId}-${r}`},t.createElement(_h,{isChecked:C.has(r),product:n.productDetails,selectedVariantId:y[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:N,onVariantChange:e=>k(r,e),onCheckChange:e=>{T(e,r)},isMobile:d,index:r,isHorizontal:O,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0}))))):t.createElement(Fg,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(Mg,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===N.fixedBundle.infoAlignment?"flex-start":"right"===N.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map(((n,r)=>t.createElement(_h,{key:`${n.productId}-${r}`,isChecked:C.has(r),product:n.productDetails,selectedVariantId:y[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:N,onVariantChange:e=>k(r,e),onCheckChange:e=>T(e,r),isMobile:d,index:r,isHorizontal:O,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0}))),$&&t.createElement(zh,{productsWithIndices:_,isOpen:m,onClose:()=>f(!1),variantOptions:e.variantOptions,cta:{textColor:N.general.ctaTextColor,backgroundColor:N.general.ctaBackgroundColor},onVariantChange:k,handleAddToCart:D,primaryProductId:x,variantId:p||void 0}))),t.createElement(Dg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===N.fixedBundle.infoAlignment?"flex-start":"right"===N.fixedBundle.infoAlignment?"flex-end":"center"}},Number(B)>0&&Number(I)>0&&N.fixedBundle.compareAtPriceVisibility&&t.createElement(_g,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(Pg,{className:"yt-fixedBundle-summary_price"},Wh(N.general.currencySymbol,e?.storeCurrencyCode),Vh(B))),0!==C.size&&t.createElement(Ng,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(Pg,{className:"yt-fixedBundle-summary_price"},Wh(N.general.currencySymbol,e?.storeCurrencyCode),Vh(z))," ",Number(I)>0&&t.createElement(Og,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",Wh(N.general.currencySymbol,e?.storeCurrencyCode),Vh(I)))),t.createElement(Ag,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),O||!$?D(e):f(!0)},disabled:C.size<1||r,style:{backgroundColor:N.general?.ctaBackgroundColor||"#121212",color:N.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${N.general?.ctaBackgroundColor||"#121212"}`,boxShadow:N.general.ctaShadowType,paddingTop:N.general?.ctaPadding,paddingBottom:N.general?.ctaPadding,borderRadius:N.general.ctaBorderRadius,width:N.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{N.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=N.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=N.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{N.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=N.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=N.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(Yo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,N.fixedBundle?.ctaTitle??"Add Bundle to cart")))},Ph=()=>t.createElement(t.Fragment,null,t.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),t.createElement("div",{style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),Oh=({product:e,tierIdx:n,isOpen:r,onClose:o,onAddToBundle:a,canAdd:i,isSelected:d,customizations:s,isMobile:p})=>{const[u,m]=c(0),[f,g]=c(e.variants[0].id.toString()),h=e.variants.find((e=>e.id.toString()===f))||e.variants[0],x=e.images.filter(Boolean);if(l((()=>(r&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""})),[r]),!r)return null;const y=t.createElement("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:o},t.createElement("div",{style:{background:"#fff",borderRadius:s?.borderRadius||"12px",maxWidth:1e3,width:"100%",height:"72dvh",margin:"auto",display:"flex",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{onClick:o,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"}},t.createElement(ct,{size:22})),t.createElement("div",{style:{flex:1,position:"relative",margin:"20px 0 20px 20px",borderRadius:s?.borderRadius||"12px"}},x.length>0&&t.createElement("img",{src:h.featured_image?.src||x[u]||e.images[0],alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover",borderRadius:s?.borderRadius||"12px"}}),x.length>1&&t.createElement("div",{style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},x.map(((e,n)=>t.createElement("div",{key:n,onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer",display:"block"}}))))),t.createElement("div",{style:{flex:1,padding:"30px",overflowY:"auto",display:"flex",flexDirection:"column",scrollbarWidth:"none"}},t.createElement("h2",{style:{margin:"0 0 12px",fontSize:24,fontWeight:600}},e.title),e.variants.length>1&&t.createElement("div",{style:{position:"relative"}},t.createElement("div",{style:{padding:"8px 0",borderBottom:"1px solid #eee"}},e?.options?.join(" & "),":"," ",t.createElement("strong",null,h.title)),t.createElement("select",{value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},e.variants.map((e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)"))))),t.createElement("div",{style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(h.price/100).toFixed(0),h.compare_at_price&&h.compare_at_price>h.price&&t.createElement("span",{style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toFixed(0))),t.createElement("div",{style:{position:"sticky",bottom:0,background:"white"}},t.createElement("button",{onClick:()=>a(e,n),disabled:!i||!h.available,style:{width:"100%",padding:"12px",fontSize:17,fontWeight:600,border:"none",borderRadius:s?.borderRadius||"8px",background:h.available?d||!i?"#28a745":s?.atcBg||"#007bff":"rgb(204, 204, 204)",color:s?.atcText||"#fff",cursor:i&&h.available?"pointer":"not-allowed"}},d?"Added to Box":h.available?"Add to Box":"Out of Stock")),e.description&&t.createElement("div",{dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:1.7,color:"#444"}})))),b=t.createElement("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:9999,display:"flex"},onClick:o},t.createElement("div",{style:{background:"#fff",width:"100%",height:"100dvh",display:"flex",flexDirection:"column",overflow:"hidden",position:"relative"},onClick:e=>e.stopPropagation()},t.createElement("button",{onClick:o,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"}},t.createElement(ct,{size:22})),t.createElement("div",{style:{flex:1,overflowY:"auto",paddingBottom:100}},x.length>0&&t.createElement("div",{style:{position:"relative"}},t.createElement("img",{src:h.featured_image?.src||x[u]||e.images[0],alt:e.title,style:{width:"100%",display:"block",maxHeight:"50vh",objectFit:"cover",objectPosition:"center"}}),x.length>1&&t.createElement("div",{style:{position:"absolute",bottom:16,left:"50%",transform:"translateX(-50%)",display:"flex",gap:8,background:"rgba(0,0,0,0.4)",padding:"6px 12px",borderRadius:20}},x.map(((e,n)=>t.createElement("div",{key:n,onClick:()=>m(n),style:{width:10,height:10,borderRadius:"50%",background:n===u?"#fff":"#fff8",cursor:"pointer"}}))))),t.createElement("div",{style:{padding:"20px"}},t.createElement("h2",{style:{margin:"0 0 12px",fontSize:22,fontWeight:600}},e.title),e.variants.length>1&&t.createElement("div",{style:{position:"relative",marginBottom:20}},t.createElement("div",{style:{padding:"8px 0",borderBottom:"1px solid #eee"}},"Variant: ",t.createElement("strong",null,h.title)),t.createElement("select",{value:f,onChange:e=>g(e.target.value),style:{position:"absolute",inset:0,opacity:0,cursor:"pointer"}},e.variants.map((e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)"))))),t.createElement("div",{style:{fontSize:28,fontWeight:"bold",margin:"10px 0"}},"₹",(h.price/100).toFixed(0),h.compare_at_price&&h.compare_at_price>h.price&&t.createElement("span",{style:{marginLeft:12,fontSize:20,textDecoration:"line-through",color:"#999"}},"₹",(h.compare_at_price/100).toFixed(0))),e.description&&t.createElement("div",{dangerouslySetInnerHTML:{__html:e.description},style:{lineHeight:1.7,color:"#444"}}))),t.createElement("div",{style:{position:"sticky",bottom:0,background:"#fff",padding:"8px 10px",borderTop:"1px solid #eee",boxShadow:"0 -4px 10px rgba(0,0,0,0.05)"}},t.createElement("button",{onClick:()=>a(e,n),disabled:!i||!h.available,style:{width:"100%",padding:"10px",fontSize:14,fontWeight:600,border:"none",borderRadius:s?.borderRadius||"8px",background:!d&&i&&h.available?s?.atcBg||"#007bff":"#28a745",color:s?.atcText||"#fff",cursor:i&&h.available?"pointer":"not-allowed"}},d?"Added to Box":h.available?"Add to Box":"Out of Stock"))));return v.createPortal(p?b:y,document.body)},Ah=({title:e,uploadState:n,onUpload:r,onRemove:o,onRetry:a})=>{const i="object"==typeof n&&n?.loading,l="object"==typeof n&&n?.error,c="object"==typeof n&&n?.url;return t.createElement("div",{style:{padding:"20px",border:"2px dashed #ccc",borderRadius:"8px",textAlign:"center",background:"#fafafa"}},t.createElement("div",{style:{fontWeight:500,color:"#333",marginBottom:"4px"}},e),i&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",color:"#007bff",fontSize:"13px",margin:"12px 0"}},t.createElement(Ph,null)," Uploading ",n?.name,"...")),l&&t.createElement(t.Fragment,null,t.createElement("div",{style:{color:"#dc3545",fontSize:"13px",margin:"8px 0"}},"Upload failed. Try again."),t.createElement("button",{type:"button",onClick:a,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Retry Upload")),c&&!i&&!l&&t.createElement(t.Fragment,null,t.createElement("div",{style:{margin:"12px 0"}},t.createElement("img",{src:n.url,alt:"Uploaded",style:{maxWidth:"100%",maxHeight:"150px",borderRadius:"6px"}})),t.createElement("div",{style:{fontSize:"12px",color:"#28a745",marginBottom:"8px"}},n.name),t.createElement("button",{type:"button",onClick:o,style:{background:"#dc3545",color:"white",border:"none",padding:"6px 10px",borderRadius:"6px",fontSize:"12px",cursor:"pointer"}},"Remove")),!n&&t.createElement(t.Fragment,null,t.createElement("div",{style:{color:"#888",fontSize:"12px",marginBottom:"12px"}},"jpeg/png (max 5MB)"),t.createElement("button",{type:"button",onClick:r,style:{color:"#303030",fontSize:"12px",borderRadius:"10px",border:"1px solid #E3E3E3",fontWeight:550,padding:"8px 16px",background:"white",cursor:"pointer"}},"Upload")))},Fh=({config:e,bundleAddToCartLoading:n,addCustomBundleToCart:r})=>{const[a,i]=c(1),[d,s]=c([]),[p,u]=c(null),[m,f]=c({}),[g,h]=c(window.innerWidth<640),x=o(new Map),[y,b]=c(!1);l((()=>{const e=document.querySelector(".box-loader-scene");e&&e.setAttribute("style","display: none;");const t=()=>h(window.innerWidth<640);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}),[]);const{customizations:v}=e,w=e.config.builderTiers.collectionTier.sort(((e,t)=>e.tier-t.tier)),C=w.length+1,E=C,k=v.hideSelectedProducts,T=v.allowMultipleQty,S=v.hideOutOfStockProducts,$=d.reduce(((e,t)=>e+t.quantity),0),B=d.reduce(((e,t)=>e+t.price*t.quantity),0)/100,z=d.reduce(((e,t)=>{const n=w.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,I=(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())},D=(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());s((n=>{const a=`${e.id}-${r}-${t}`,i=n.find((e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===a));if(i)return n.filter((e=>e!==i));const l=P[t],c=_(t);return c!==1/0&&l>=c?n:[...n,{productId:e.id.toString(),variantId:r,price:o,quantity:1,tierIndex:t}]}))},_=e=>{const t=w[e];return t.minimumQuantity>0?t.minimumQuantity:1/0},N=(e,t)=>{const n=_(t);if(n===1/0)return!0;const r=P[t],o=d.some((n=>n.productId===e.id.toString()&&n.tierIndex===t));return!!o||r<n},P=w.map(((e,t)=>d.filter((e=>e.tierIndex===t)).reduce(((e,t)=>e+t.quantity),0))),O=(e,t,n)=>{const r=_(n);if(r===1/0)return!0;return P[n]<r},A=e=>{if(!x.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");f((t=>({...t,[e]:{loading:!0,name:n.name}})));try{const t=await(async e=>{const t=new FormData;t.append("file",e),b(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",r=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!r.ok)throw new Error("Upload failed");return(await r.json()).url}catch(e){throw b(!1),alert("Upload failed. Try again."),e}finally{b(!1)}})(n);f((r=>({...r,[e]:{url:t,name:n.name}})))}catch{f((t=>({...t,[e]:{error:!0,name:n.name}})))}}},document.body.appendChild(t),x.current.set(e,t)}return x.current.get(e)},F=a<=w.length?w[a-1]:null,M=F?_(a-1):0,R=w.map(((e,t)=>{const n=d.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}),[]);return{tier:e,items:n,count:P[t]}}));return t.createElement("div",{className:"yt-collection-bundle-builder",style:{margin:"20px auto",maxWidth:"1400px"}},t.createElement(Mh,{totalSteps:C,formStepIndex:E,currentStep:a,getStepTitle:e=>e===E?"Customize Gift Details":w[e-1]?.title||`Step ${e}`,isMobile:g,formTitle:e?.config?.form?.title,onStepClick:e=>{if(e>1&&!d.length)return alert("Add at least one product first");i(e),window.scrollTo(0,0)}}),Array.from({length:C},((e,t)=>t+1)).map((n=>{const r=n===E,o=r?[]:(e=>w[e-1]?.products||[])(n),i=S?o.filter((e=>e.available)):o,l=n-1;return t.createElement("div",{key:n,className:"yt-collection-bundle-step-content "+(a===n?"yt-collection-bundle-step-content-active":""),style:{display:a===n?"block":"none",padding:"1.5rem 0",minHeight:"40vh"}},r&&e.config.form?t.createElement("div",{className:"yt-collection-bundle-customize-form",style:{maxWidth:"80%",margin:"0 auto",padding:"1rem",marginBottom:g?"180px":"160px"}},e?.config?.form?.sections?.map(((e,n)=>t.createElement("div",{key:`sec_${n}`,className:"yt-collection-bundle-form-group",style:{marginBottom:"32px"}},t.createElement("label",{className:"yt-collection-bundle-label",style:{display:"block",fontWeight:600,marginBottom:"12px",color:"#333",fontSize:"16px"}},e?.title),"text"===e.type&&t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px"}},e.fields.map(((e,n)=>{const r=e?.title??"Field "+n;return t.createElement("textarea",{key:r,className:"yt-collection-bundle-textarea",placeholder:e?.title,rows:3,maxLength:500,onChange:e=>f((t=>({...t,[r]:e.target.value}))),style:{padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px",resize:"vertical"}})}))),"image"===e.type&&t.createElement("div",{style:{marginBottom:"24px"}},t.createElement("sub",{style:{display:"block",color:"#666",fontSize:"12px",marginBottom:"8px"}},"jpeg/png (max 5MB)"),t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"16px"}},e.fields.map(((e,n)=>{const r=e?.title??"Field "+n,o=m[r];return t.createElement(Ah,{key:r,title:e?.title,uploadState:o,onUpload:()=>A(r).click(),onRemove:()=>f((e=>{const{[r]:t,...n}=e;return n})),onRetry:()=>A(r).click()})})))))))):t.createElement("div",{className:"yt-collection-bundle-product-grid",style:{display:g?"grid":"flex",gridTemplateColumns:g?"repeat(2,1fr)":"",flexWrap:g?"unset":"wrap",justifyContent:"center",gap:"16px",padding:"16px",marginBottom:g?"180px":"160px"}},i.map((e=>t.createElement(Rh,{key:e.id,product:e,tierIdx:l,customizations:v,isMobile:g,hoveredCard:p,setHoveredCard:u,selectedProducts:d,handleAddToBundle:D,canAddProduct:N,allowMultipleQty:T,handleVariantChange:I,canIncrement:O,setSelectedProducts:s})))))})),t.createElement(Lh,{config:e,selectedProducts:d,selectedByTier:R,totalItems:$,totalPrice:B,totalCompareAtPrice:z,currentStep:a,formStepIndex:E,currentTierMax:M,tierSelectedCounts:P,isMobile:g,bundleAddToCartLoading:n,isUploading:y,hoveredCard:p,setHoveredCard:u,hideSelectedProducts:k,getProductStep:e=>{for(let t=0;t<w.length;t++)if(w[t].products.some((t=>t.id.toString()===e)))return t+1;return E},setCurrentStep:i,handleRemoveItem:(e,t,n)=>{s((r=>r.filter((r=>!(r.productId===e&&r.variantId===t&&r.tierIndex===n)))))},handleCheckout:async()=>{if(a!==E||!d.length)return;const e={};Object.entries(m).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=d.map((t=>({variantId:t.variantId,quantity:t.quantity,properties:e})));r(t)}}))},Mh=({totalSteps:e,formStepIndex:n,currentStep:r,getStepTitle:o,isMobile:a,formTitle:i,onStepClick:l})=>t.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"}},t.createElement("div",{className:"yt-collection-bundle-steps-nav",style:{display:"flex",justifyContent:"center",gap:a?"0":"2rem",overflowX:"auto",scrollbarWidth:"none"}},Array.from({length:e},((e,t)=>t+1)).map((e=>t.createElement("div",{key:e,className:"yt-collection-bundle-step-item "+(r===e?"yt-collection-bundle-step-item-active":""),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"0.5rem",minWidth:"120px",cursor:"pointer",opacity:r===e?1:.5,transition:"opacity 0.2s"},onClick:()=>l(e)},t.createElement("div",{className:"yt-collection-bundle-step-icon "+(r===e?"yt-collection-bundle-step-icon-active":""),style:{width:"40px",height:"40px",background:r===e?"#000":"#fff",border:"2px solid #ccc",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},e===n?t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===e?"#fff":"#999"}},t.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"})):t.createElement("svg",{viewBox:"0 0 24 24",style:{width:"20px",height:"20px",fill:r===e?"#fff":"#999"}},t.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))),t.createElement("div",{className:"yt-collection-bundle-step-label",style:{fontSize:"14px",textAlign:"center",color:"#333",fontWeight:"600"}},o(e)))))),i&&t.createElement("p",{className:"yt-collection-bundle-steps-nav-description",style:{fontSize:a?"14px":"16px",marginBottom:a?"0":"14px",fontWeight:"400",color:"#000"}},i)),Rh=({product:e,tierIdx:n,customizations:r,isMobile:o,hoveredCard:a,setHoveredCard:i,selectedProducts:l,handleAddToBundle:d,canAddProduct:s,allowMultipleQty:p,handleVariantChange:u,canIncrement:m,setSelectedProducts:f})=>{const[g,h]=c(!1),x=document.querySelector(`[data-product-id="${e.id}"]`),y=x?.dataset.selectedVariant||e.variants[0].id.toString(),b=e.variants.find((e=>e.id.toString()===y))||e.variants[0],v=l.some((t=>t.productId===e.id.toString()&&t.variantId===y&&t.tierIndex===n)),w=a===e.id,C=l.filter((t=>t.productId===e.id.toString()&&t.variantId===b.id.toString()&&t.tierIndex===n)).reduce(((e,t)=>e+t.quantity),0);return t.createElement(t.Fragment,null,t.createElement("div",{key:e.id,className:"yt-collection-bundle-product-item","data-product-id":e.id,"data-selected-variant":b.id,"data-current-price":b.price,style:{display:"flex",flexDirection:"column",border:r?.productCardBorder||"1px solid #ddd",background:r?.productCardBg||"#fff",overflow:"hidden",transition:"all 0.2s ease",minWidth:o?0:"250px",maxWidth:o?"none":"250px",borderRadius:r?.borderRadius||"8px",boxShadow:"spread"===r?.productCardShadow?"8px 8px 8px -6px #0000004D":"no-spread"===r?.productCardShadow?"6px 6px 0px -1px #00000033":"none",width:o?"100%":""}},t.createElement("div",{className:"yt-collection-bundle-product-image",style:{position:"relative",width:"100%",aspectRatio:r?.productImageRatio||"1/1",overflow:"hidden",cursor:"pointer",background:"#f9f9f9"},onClick:()=>h(!0),onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null)},t.createElement("img",{src:e.images[0]||"https://cdn.shopify.com/s/files/1/0750/9937/3789/files/placeholder-thumbnail.png?width=250px",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?0:1,transform:w?"scale(1.05)":"scale(1)"},alt:e.title}),t.createElement("img",{src:e.images[1]||e.images[0],style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",transition:"opacity 0.3s ease, transform 0.3s ease",opacity:w?1:0,transform:"scale(1.05)"},alt:e.title}),e.variants.length>1&&t.createElement("select",{style:{position:"absolute",bottom:"10px",left:"10px",right:"10px",background:"rgba(255,255,255,0.9)",border:"none",borderRadius:"4px",padding:"10px",fontSize:"12px",zIndex:2},onChange:t=>u(e,t.target.value),defaultValue:b.id},e.variants.map((e=>t.createElement("option",{key:e.id,value:e.id,disabled:!e.available},e.title," ",!e.available&&"(Out of stock)"))))),t.createElement("div",{className:"yt-collection-bundle-product-info",style:{padding:"12px",flexGrow:1,display:"flex",flexDirection:"column"}},t.createElement("h3",{className:"yt-collection-bundle-product-title",style:{fontSize:o?"12px":"14px",fontWeight:600,margin:"0 0 4px",lineHeight:1.3,color:"#333",flexGrow:1}},e.title),t.createElement("div",{className:"yt-collection-bundle-product-prices",style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"nowrap",whiteSpace:"nowrap",overflow:"hidden"}},t.createElement("span",{className:"yt-collection-bundle-product-price",style:{fontSize:o?"14px":"16px",fontWeight:"bold",color:"#000",flexShrink:0}},"₹",(b.price/100).toFixed(0)),b.compare_at_price&&b.compare_at_price>b.price&&t.createElement("span",{className:"yt-collection-bundle-product-compare",style:{fontSize:"14px",textDecoration:"line-through",color:"#999",flexShrink:0}},"₹",(b.compare_at_price/100).toFixed(0)))),p&&C>0?t.createElement("div",{style:{display:"flex",alignItems:"center",flexWrap:"nowrap",background:"#cccccc"}},t.createElement("button",{style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px"},onClick:()=>{f((t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find((e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r));return o&&o.quantity>1?t.map((e=>e===o?{...e,quantity:e.quantity-1}:e)):o?t.filter((e=>e!==o)):t}))}},"-"),t.createElement("span",{style:{minWidth:"24px",textAlign:"center",fontWeight:600,width:"100%"}},C),t.createElement("button",{style:{width:"40%",height:b.available?"fit-content":"36px",border:"1px solid #ddd",background:"#fff",fontWeight:"bold",cursor:"pointer",padding:o?"6px":"12px",fontSize:o?"12px":"14px"},onClick:()=>{b.available&&m(e,b.id.toString(),n)&&f((t=>{const r=`${e.id}-${b.id}-${n}`,o=t.find((e=>`${e.productId}-${e.variantId}-${e.tierIndex}`===r));return o?t.map((e=>e===o?{...e,quantity:e.quantity+1}:e)):[...t,{productId:e.id.toString(),variantId:b.id.toString(),price:b.price,quantity:1,tierIndex:n}]}))},disabled:!b.available||!m(e,b.id.toString(),n)},"+")):t.createElement("button",{className:"yt-collection-bundle-add-btn "+(v?"yt-collection-bundle-add-btn-added":""),style:{background:v?"#28a745":s(e,n)&&b.available?r?.atcBg||"#007bff":"#ccc",color:r?.atcText||"#fff",border:"none",padding:o?"6px":"12px",fontSize:o?"12px":"14px",fontWeight:600,cursor:"pointer",transition:"all 0.2s",opacity:b.available?1:.6},onClick:()=>{b.available&&s(e,n)&&d(e,n)},disabled:!b.available||!s(e,n)},v?"Added":b.available?"ADD TO BOX":"Out of Stock")),g&&t.createElement(Oh,{product:e,tierIdx:n,isOpen:g,onClose:()=>h(!1),onAddToBundle:(e,t)=>{d(e,t),h(!1)},canAdd:s(e,n),isSelected:v,customizations:r,isMobile:o}))},Lh=e=>{const{config:n,selectedProducts:r,selectedByTier:a,totalItems:i,totalPrice:d,totalCompareAtPrice:s,currentStep:p,formStepIndex:u,currentTierMax:m,tierSelectedCounts:f,isMobile:g,bundleAddToCartLoading:h,isUploading:x,hoveredCard:y,setHoveredCard:b,getProductStep:v,setCurrentStep:w,handleRemoveItem:C,handleCheckout:E}=e,{customizations:k}=n,[T,S]=c(!0),[$,B]=c(!1),z=o(null);return l((()=>(m!==1/0&&f[p-1]===m-2&&m>1&&!$&&(B(!0),z.current=setTimeout((()=>{B(!1),z.current=null}),3e3)),()=>{z.current&&clearTimeout(z.current)})),[m,f,p]),t.createElement("div",{className:"yt-collection-bundle-bar",style:{background:k?.bundleBg||"#fff",color:k?.bundleText||"#333",border:k?.bundleBorder||"1px solid #878787",display:"flex",flexDirection:"column",position:"fixed",bottom:"10px",left:"50%",transform:"translateX(-50%)",width:"600px",maxWidth:"95%",zIndex:899,boxShadow:"0 -2px 10px rgba(0,0,0,0.1)",transition:"bottom 0.3s ease",borderRadius:k?.borderRadius||"8px"}},t.createElement("div",{style:{position:"relative",textAlign:"center"}},r.length>0&&t.createElement("button",{onClick:()=>S((e=>!e)),style:{background:"#87878766",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 12px",color:"#555555",borderRadius:"0 0 28px 28px"}},T?t.createElement(gn,null):t.createElement(at,null)),$&&t.createElement(t.Fragment,null,t.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 "),t.createElement("div",{className:"yt-collection-bundle-ctx",style:{position:"absolute",top:"-40px",left:"50%",transform:"translateX(-50%)",background:k?.atcBg||"#007bff",color:k?.atcText||"#fff",padding:"4px 8px",borderRadius:k?.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)"}},"Add up to"," ",t.createElement("span",{style:{fontWeight:600}},m," item",m>1?"s":"")))),T&&r.length>0&&t.createElement("div",{className:"yt-collection-bundle-bar-top",style:{display:"flex",alignItems:"center",padding:"8px 8px 0",position:"relative",borderRadius:k?.borderRadius||"8px"}},t.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"}},a.filter((({count:e})=>e>0)).map((({items:e},r,o)=>t.createElement(t.Fragment,{key:r},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",minWidth:"fit-content"}},t.createElement("div",{style:{display:"flex",gap:"4px"}},e.map(((e,o)=>{const a=n.config.builderTiers.collectionTier.flatMap((e=>e.products)).find((t=>t.id.toString()===e.productId));if(!a)return null;const i=v(e.productId),l=p===i;return t.createElement("div",{key:o,className:"yt-collection-bundle-img-wrapper",style:{position:"relative",flexShrink:0,height:"65px"}},t.createElement("div",{style:{position:"relative",width:"65px",height:"65px",borderRadius:`calc(${k?.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(i)},t.createElement("img",{src:a.images[0],style:{width:"65px",height:"65px",objectFit:"cover",borderRadius:`calc(${k?.borderRadius||"8px"} / 2)`,transition:"opacity 0.2s",pointerEvents:"none"},alt:"Selected"}),e.quantity>1&&t.createElement("div",{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}},"x",e.quantity),t.createElement("button",{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)"},onClick:t=>{t.stopPropagation(),C(e.productId,e.variantId,r)}},"×")))})))),r<o.length-1&&o[r+1].count>0&&t.createElement("div",{style:{color:"#666",paddingInline:"6px"}},t.createElement(lt,null))))))),g?t.createElement("div",{style:{display:"flex",flexDirection:"column",padding:"4px",gap:"10px"}},t.createElement("div",{style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",paddingInline:"6px"}},t.createElement("div",{style:{fontSize:"14px",color:"#6c757d"}},i," items Selected"),i>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement("div",{style:{fontSize:"14px",color:"#6c757d",fontWeight:600}},"₹",d.toLocaleString()),t.createElement("div",{style:{fontSize:"14px",color:"#6c757dc9",fontWeight:500,textDecoration:"line-through"}},"₹",s.toLocaleString()))),t.createElement("div",{style:{display:"flex",flexWrap:"nowrap",gap:"4px"}},t.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",borderRadius:k?.borderRadius||"8px"},onClick:()=>w((e=>Math.max(1,e-1))),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:k?.btnPrimaryBg||"#28a745",color:k?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"100%",transition:"background 0.2s",opacity:p===u&&0===i||x?.6:1,borderRadius:k?.borderRadius||"8px"},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===i||h||x},h?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(Ph,null)):p===u?"Checkout":"Next"))):t.createElement("div",{className:"yt-collection-bundle-bar-bottom",style:{display:"flex",alignItems:"center",padding:"0px",background:"#dbdbdb",margin:"8px",borderRadius:k?.borderRadius||"8px",overflow:"hidden",scrollbarWidth:"none"}},t.createElement("button",{className:"yt-collection-bundle-back-btn",style:{background:"#000",color:"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",...-1===y&&{filter:"brightness(60%)"}},onClick:()=>w((e=>Math.max(1,e-1))),onMouseEnter:()=>b(-1),onMouseLeave:()=>b(null),disabled:1===p},"Back"),t.createElement("div",{style:{flex:1,textAlign:"center",display:"flex",flexDirection:"row",justifyContent:r.length>0?"space-between":"center",paddingInline:"6px"}},t.createElement("div",{style:{fontSize:"14px",color:"#6c757d"}},i," items Selected"),i>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px"}},t.createElement("div",{style:{fontSize:"14px",color:"#6c757d",fontWeight:600}},"₹",d.toLocaleString()),t.createElement("div",{style:{fontSize:"14px",color:"#6c757dc9",fontWeight:500,textDecoration:"line-through"}},"₹",s.toLocaleString()))),t.createElement("button",{className:"yt-collection-bundle-next-btn "+(p===u&&0===i||x?"yt-collection-bundle-next-btn-disabled":""),style:{background:k?.btnPrimaryBg||"#28a745",color:k?.btnPrimaryText||"#fff",border:"none",padding:"12px 24px",cursor:"pointer",fontWeight:600,width:"138px",transition:"all 0.2s",opacity:p===u&&0===i||x?.6:1,...-2===y&&{filter:"brightness(90%)"}},onClick:p===u?E:()=>w(p+1),disabled:p===u&&0===i||h||x,onMouseEnter:()=>b(-2),onMouseLeave:()=>b(null)},h?t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"center"}},t.createElement(Ph,null)):p===u?"Checkout":"Next")))},jh=window?.Shopify?.currency||{rate:1,active:"INR"},Vh=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*jh.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},Wh=(e,t)=>t==jh.active?e:sn(jh.active)||jh.active,Hh=e=>{if(!e)return e;try{const t=new URL(e),n=t.searchParams;return n.has("format")||n.set("format","webp"),n.has("quality")||n.set("quality","70"),n.has("width")||n.set("width","600"),t.toString()}catch{const t=e.includes("?")?"&":"?";return e+t+"format=webp&quality=70&width=600"}},Uh=(e,t,n,r,o)=>{const a=r.findIndex((t=>t.variantId===e));o(0===n?e=>e.filter(((e,t)=>t!==a)):-1===a?r=>[...r,{product:t,variantId:e,quantity:n}]:e=>e.map(((e,t)=>t===a?{...e,quantity:e.quantity+n}:e)))},qh=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:d,renderingOnPage:s,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(lf,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:s,selectedItemsQuantity:d??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(df,{bundle:e,addToCartFunction:r}):"mixAndMatch"===e.type?t.createElement(bg,{bundle:e,addToCartFunction:r}):"collection"===e.type?t.createElement(Fh,{config:e,addCustomBundleToCart:o,bundleAddToCartLoading:l}):t.createElement(Lf,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(Nh,{addToCartFunction:r,bundle:e});L(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Qh=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},"‎"),t.createElement("div",{className:"side back"},"‎"),t.createElement("div",{className:"side left"},"‎"),t.createElement("div",{className:"side right"},"‎"),t.createElement("div",{className:"side bottom"},"‎"),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},"‎"),t.createElement("div",{className:"flap south"},"‎"),t.createElement("div",{className:"flap east"},"‎"),t.createElement("div",{className:"flap west"},"‎")))));export{qh as Bundle,Qh as BundleLoader,uu as Cart,la as CouponFrame,qe as Nudge,Je as SpinnerWheel};
@@ -65,9 +65,9 @@ export type BundleConfig = {
65
65
  products: Product[];
66
66
  }[];
67
67
  };
68
- form: {
69
- title: string;
70
- sections: {
68
+ form?: {
69
+ title?: string;
70
+ sections?: {
71
71
  title: string;
72
72
  type: "text" | "image";
73
73
  fields: {
@@ -3,3 +3,4 @@ import { Checkpoint } from "../Cart";
3
3
  import { MultiStepProgressBarProps } from "./types";
4
4
  export declare const criteriaCheckpointFieldMap: (customCartProgressBarCriteria: string) => "minimumOrderValue" | "quantityThreshold";
5
5
  export declare function processCheckpoint(checkpoint: Checkpoint, index: number, sortedCheckpoints: Checkpoint[], itemCount: number, props: MultiStepProgressBarProps): CheckpointWithProgress;
6
+ export declare function hasAnyProgress(checkpoints: Checkpoint[] | undefined, currentCartAmount: number, effectiveQuantityForProgressBar: number | undefined, customCartProgressBarCriteria: string, itemCount: number): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.7.415-mixandmatchUIChanges.0",
3
+ "version": "0.7.416-collection-bundle-fixes.0",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import "./ProductGridSkeleton.css";
3
- type ProductGridSkeletonProps = {};
4
- declare const ProductGridSkeleton: React.FC<ProductGridSkeletonProps>;
5
- export default ProductGridSkeleton;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { BundleProps } from "../Bundle";
3
- export default function VolumeBundle({ bundle, addToCartFunction, currentProductId, }: BundleProps): React.JSX.Element;
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- type FreebieClaimProps = {
3
- freebieProductsInCart: any;
4
- freebieSectionTitle?: string;
5
- themeColor?: string;
6
- themeTextColor?: string;
7
- checkpoints?: any;
8
- addFreebieToCart?: (variantId: string, originalAllowedVariantIds?: string[]) => Promise<void>;
9
- freebiesInCart: string[];
10
- showFreebieClaimAsPopup?: boolean;
11
- productClaimCtaButtonText?: string;
12
- imageAspectSelector?: "square" | "portrait";
13
- freebieCouponTemplates?: any;
14
- };
15
- export declare const FreebieClaimPopup: React.ForwardRefExoticComponent<FreebieClaimProps & React.RefAttributes<HTMLDivElement>>;
16
- declare const FreebieClaim: React.FC<FreebieClaimProps>;
17
- export default FreebieClaim;
@@ -1,49 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const VariantSelectionPopupContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const ModalContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
- $themeColor?: string | undefined;
5
- $cornerRadius?: number | undefined;
6
- $backgroundColor?: string | undefined;
7
- }>> & string;
8
- export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
- export declare const ProductDetails: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
- export declare const ProductImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
11
- export declare const ProductInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
12
- export declare const ProductTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {
13
- $themeColor?: string | undefined;
14
- }>> & string;
15
- export declare const ProductPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
16
- primaryTextColor?: string | undefined;
17
- }>> & string;
18
- export declare const OriginalPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
19
- export declare const ViewDetailsLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
20
- export declare const OptionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
21
- export declare const OptionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
22
- export declare const OptionsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
23
- export declare const VariantOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
24
- $isSelected?: boolean | undefined;
25
- $isDisabled?: boolean | undefined;
26
- $themeColor?: string | undefined;
27
- backgroundColor?: string | undefined;
28
- }>> & string;
29
- export declare const CartButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
30
- $themeColor: string;
31
- }>> & string;
32
- export declare const LoaderContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
33
- export declare const QuantitySelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
34
- export declare const MainSelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
35
- $backgroundColor: string;
36
- }>> & string;
37
- export declare const FlexContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
38
- export declare const DetailsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
39
- export declare const PriceSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
40
- export declare const LinkSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
41
- export declare const ActionsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
42
- export declare const ReplaceButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
43
- export declare const ReplaceButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
44
- $themeColor?: string | undefined;
45
- $cornerRadius?: number | undefined;
46
- $cornerType?: string | undefined;
47
- $disabled?: boolean | undefined;
48
- }>> & string;
49
- export declare const ReplaceButtonContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1 +0,0 @@
1
- export declare function useShadowConfetti(): (options: any) => void;
@@ -1 +0,0 @@
1
- export declare const ytBundleShadowCss: string;
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import "./ProductGridSkeleton.css";
3
- type ProductGridSkeletonProps = {};
4
- declare const ProductGridSkeleton: React.FC<ProductGridSkeletonProps>;
5
- export default ProductGridSkeleton;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { BundleProps } from "../Bundle";
3
- export default function VolumeBundle({ bundle, addToCartFunction, currentProductId, }: BundleProps): React.JSX.Element;
@@ -1,17 +0,0 @@
1
- import React from "react";
2
- type FreebieClaimProps = {
3
- freebieProductsInCart: any;
4
- freebieSectionTitle?: string;
5
- themeColor?: string;
6
- themeTextColor?: string;
7
- checkpoints?: any;
8
- addFreebieToCart?: (variantId: string, originalAllowedVariantIds?: string[]) => Promise<void>;
9
- freebiesInCart: string[];
10
- showFreebieClaimAsPopup?: boolean;
11
- productClaimCtaButtonText?: string;
12
- imageAspectSelector?: "square" | "portrait";
13
- freebieCouponTemplates?: any;
14
- };
15
- export declare const FreebieClaimPopup: React.ForwardRefExoticComponent<FreebieClaimProps & React.RefAttributes<HTMLDivElement>>;
16
- declare const FreebieClaim: React.FC<FreebieClaimProps>;
17
- export default FreebieClaim;
@@ -1,49 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const VariantSelectionPopupContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const ModalContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
- $themeColor?: string | undefined;
5
- $cornerRadius?: number | undefined;
6
- $backgroundColor?: string | undefined;
7
- }>> & string;
8
- export declare const CloseButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
9
- export declare const ProductDetails: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
10
- export declare const ProductImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
11
- export declare const ProductInfo: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
12
- export declare const ProductTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, {
13
- $themeColor?: string | undefined;
14
- }>> & string;
15
- export declare const ProductPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
16
- primaryTextColor?: string | undefined;
17
- }>> & string;
18
- export declare const OriginalPrice: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
19
- export declare const ViewDetailsLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, never>> & string;
20
- export declare const OptionContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
21
- export declare const OptionTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
22
- export declare const OptionsWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
23
- export declare const VariantOption: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
24
- $isSelected?: boolean | undefined;
25
- $isDisabled?: boolean | undefined;
26
- $themeColor?: string | undefined;
27
- backgroundColor?: string | undefined;
28
- }>> & string;
29
- export declare const CartButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
30
- $themeColor: string;
31
- }>> & string;
32
- export declare const LoaderContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
33
- export declare const QuantitySelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
34
- export declare const MainSelectorContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
35
- $backgroundColor: string;
36
- }>> & string;
37
- export declare const FlexContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
38
- export declare const DetailsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
39
- export declare const PriceSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
40
- export declare const LinkSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
41
- export declare const ActionsSection: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
42
- export declare const ReplaceButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
43
- export declare const ReplaceButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
44
- $themeColor?: string | undefined;
45
- $cornerRadius?: number | undefined;
46
- $cornerType?: string | undefined;
47
- $disabled?: boolean | undefined;
48
- }>> & string;
49
- export declare const ReplaceButtonContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1 +0,0 @@
1
- export declare function useShadowConfetti(): (options: any) => void;
@@ -1 +0,0 @@
1
- export declare const ytBundleShadowCss: string;