yt-uikit 0.7.403-feature-product-offer-refactor.26 → 0.7.403-feature-product-offer-refactor.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -4939,4 +4939,4 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
4939
4939
  }
4940
4940
  `,Dh=x.span`
4941
4941
  font-size: 12px;
4942
- `,Ih=({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(hh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(xh,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(yh,{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(vh,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(wh,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[r]?.node?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(Ch,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(Eh,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(Th,{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(Sh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Dh,{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_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(Bh,{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(Sh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Dh,{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(zh,{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(Bh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},e))))):t.createElement(Sh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Dh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,o)=>t.createElement(Bh,{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(kh,{className:"yt-fixedBundle-variant-modal_divider"})))),t.createElement(bh,{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)},_h=({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(lh,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(ch,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(eh,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:s},t.createElement(th,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>d(!i)},t.createElement(nh,{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(rh,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(oh,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map((e=>t.createElement(ah,{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(ih,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name))))))},Oh=({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(dh,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map(((n,r)=>t.createElement(sh,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(_h,{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)})))))},Ph=({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(fh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(uh,{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(mh,{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(ct,null))),t.createElement(Sg,{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($g,{className:"yt-fixedBundle-product-card-horizontal_image",src: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(Bg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(zg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Dg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(Ig,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Mh(a.general.currencySymbol,h)," ",Fh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(_g,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Mh(a.general.currencySymbol,h),Fh(b?.compareAtPrice))),t.createElement(Oh,{product:e,variantOptions:m,selectedVariants:w,onVariantChange:e=>{i(e)},variantId:y,primaryProductId:x})))):t.createElement(t.Fragment,null,t.createElement(jg,{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(gh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:E},t.createElement(uh,{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(mh,{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(ct,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Vg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(Wg,{className:"yt-fixedBundle-product-card_image--vertical",src:k,style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(Hg,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(Ug,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(Qg,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(qg,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(Gg,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(Yg,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Kg,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(Zg,{className:"yt-fixedBundle-product-card-vertical_price--new"},Mh(a.general.currencySymbol,h),Fh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(_g,{className:"yt-fixedBundle-product-card-vertical_price--old"},Mh(a.general.currencySymbol,h),Fh(b?.compareAtPrice))))),(f<=3||!s)&&u<f-1&&t.createElement(Xg,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(Jg,{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:D}=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]),I=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 O=e.customizations,P=O.fixedBundle?.cardLayoutStyle||"auto",N="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(Cg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:O.fixedBundle.sectionBackgroundColor,..."transparent"!==O.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},A&&t.createElement(Eg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:O.fixedBundle?.titleBackgroundColor||"none",color:O.fixedBundle?.titleTextColor||"black",textAlign:O.fixedBundle.infoAlignment??"center",fontSize:O.fixedBundle?.titleFontSize,..."transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===O.fixedBundle.infoAlignment&&"transparent"===O.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},A),F&&t.createElement(kg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:O.fixedBundle?.subtitleFontSize,textAlign:O.fixedBundle.infoAlignment??"center",..."left"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===O.fixedBundle.infoAlignment&&"transparent"===O.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},F),N?t.createElement(Tg,{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(Ph,{isChecked:C.has(r),product:n.productDetails,selectedVariantId:y[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:O,onVariantChange:e=>k(r,e),onCheckChange:e=>{T(e,r)},isMobile:d,index:r,isHorizontal:N,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0}))))):t.createElement(Rg,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(Lg,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===O.fixedBundle.infoAlignment?"flex-start":"right"===O.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map(((n,r)=>t.createElement(Ph,{key:`${n.productId}-${r}`,isChecked:C.has(r),product:n.productDetails,selectedVariantId:y[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:O,onVariantChange:e=>k(r,e),onCheckChange:e=>T(e,r),isMobile:d,index:r,isHorizontal:N,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0}))),$&&t.createElement(Ih,{productsWithIndices:_,isOpen:m,onClose:()=>f(!1),variantOptions:e.variantOptions,cta:{textColor:O.general.ctaTextColor,backgroundColor:O.general.ctaBackgroundColor},onVariantChange:k,handleAddToCart:I,primaryProductId:x,variantId:p||void 0}))),t.createElement(Og,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===O.fixedBundle.infoAlignment?"flex-start":"right"===O.fixedBundle.infoAlignment?"flex-end":"center"}},Number(B)>0&&Number(D)>0&&O.fixedBundle.compareAtPriceVisibility&&t.createElement(Pg,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(Ag,{className:"yt-fixedBundle-summary_price"},Mh(O.general.currencySymbol,e?.storeCurrencyCode),Fh(B))),0!==C.size&&t.createElement(Ng,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(Ag,{className:"yt-fixedBundle-summary_price"},Mh(O.general.currencySymbol,e?.storeCurrencyCode),Fh(z))," ",Number(D)>0&&t.createElement(Fg,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",Mh(O.general.currencySymbol,e?.storeCurrencyCode),Fh(D)))),t.createElement(Mg,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),N||!$?I(e):f(!0)},disabled:C.size<1||r,style:{backgroundColor:O.general?.ctaBackgroundColor||"#121212",color:O.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${O.general?.ctaBackgroundColor||"#121212"}`,boxShadow:O.general.ctaShadowType,paddingTop:O.general?.ctaPadding,paddingBottom:O.general?.ctaPadding,borderRadius:O.general.ctaBorderRadius,width:O.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{O.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=O.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=O.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{O.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=O.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=O.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(Xo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,O.fixedBundle?.ctaTitle??"Add Bundle to cart")))},Ah=window?.Shopify?.currency||{rate:1,active:"INR"},Fh=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Ah.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},Mh=(e,t)=>t==Ah.active?e:fn(Ah.active)||Ah.active,Rh=(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)))},Lh=({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(df,{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(pf,{bundle:e,addToCartFunction:r}):"mixAndMatch"===e.type?t.createElement(wg,{bundle:e,addToCartFunction:r}):t.createElement(Vf,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(Nh,{addToCartFunction:r,bundle:e});U(".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 jh=()=>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"},"‎"))))),Vh=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:o},t.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},t.createElement("img",{src:"https://feature-products-offers.shopify-product-blocks.pages.dev/assets/confetti.jpg",alt:"confetti",style:{width:"100%",height:"clamp(150px, 20vh, 230px)",objectFit:"cover",objectPosition:"top",borderTopLeftRadius:"12px",borderTopRightRadius:"12px",marginBottom:"10px",flexShrink:0}}),t.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"clamp(-150px, -20vh, -200px)",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" ")),t.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},n.name),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),t.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),t.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},t.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),t.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map(((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e))))),t.createElement("button",{onClick:o,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return w(i,document.body)},Wh=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:o},t.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),t.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},t.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),t.createElement("div",{style:{overflowY:"auto",flex:1}},t.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},t.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" ")),t.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},n.name),t.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage)),t.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},t.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),t.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},t.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map(((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e)))))),t.createElement("button",{onClick:o,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return w(i,document.body)},Hh=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:a,setShowPopup:i})=>{const d=o(null),[s,p]=c(!1),[u,m]=c(!0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=768),h=()=>{if(d.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=d.current;p(e>0),m(e<t-n-10)}};l((()=>{h();const e=d.current;if(e)return e.addEventListener("scroll",h),()=>e.removeEventListener("scroll",h)}),[e]),l((()=>{const e=()=>{g(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const x=e=>{if(d.current){const t=f?280:365,n=16,r="right"===e?t+n:-(t+n);d.current.scrollBy({left:r,behavior:"smooth"})}};return t.createElement("div",{style:{position:"relative"}},t.createElement("svg",{style:{position:"absolute",width:0,height:0}},t.createElement("defs",null,t.createElement("mask",{id:"coupon-cut-mask-desktop"},t.createElement("rect",{width:"365",height:"500",fill:"white"}),t.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),t.createElement("circle",{cx:"80",cy:"200",r:"12",fill:"black"})),t.createElement("mask",{id:"coupon-cut-mask-mobile"},t.createElement("rect",{width:"280",height:"500",fill:"white"}),t.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),t.createElement("circle",{cx:"60",cy:"180",r:"10",fill:"black"})))),s&&t.createElement("button",{onClick:()=>x("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},t.createElement(M,{size:20})),u&&t.createElement("button",{onClick:()=>x("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},t.createElement(j,{size:20})),t.createElement("div",{ref:d,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",paddingTop:"15px",paddingBottom:"10px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:f?"110px":"128px"}},e?.map((e=>t.createElement("div",{key:e.discountId,style:{flexShrink:0,width:f?"280px":"365px",minWidth:f?"280px":"365px",backgroundColor:"transparent",borderRadius:`${n?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},t.createElement("div",{style:{width:f?"60px":"80px",backgroundColor:n?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:f?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${n?.roundness||0}px`,borderBottomLeftRadius:`${n?.roundness||0}px`}},t.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),n?.iconVisibility&&t.createElement("div",{style:{position:"absolute",left:f?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:f?"32px":"40px",height:f?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:f?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===e.couponType?t.createElement(W,null):t.createElement(co,null)),t.createElement("div",{style:{flex:1,padding:f?"12px 12px":"15px 15px",paddingLeft:f?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${n?.roundness||0}px`,borderBottomRightRadius:`${n?.roundness||0}px`,overflow:"hidden",backgroundColor:"#ffffff",minWidth:0}},t.createElement("div",{style:{fontSize:f?"9px":"10px",color:"#666666",marginBottom:"3px",fontWeight:"400",lineHeight:"1.2"}},"free_product"===e.couponType?"Free Gift":"Special Deal"),t.createElement("div",{style:{fontSize:f?"13px":"15px",fontWeight:"600",color:n?.textColor||"#2c3e50",lineHeight:"1.2",marginBottom:"3px",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},e.name||"Free Tote Bag"),t.createElement("div",{style:{fontSize:f?"11px":"12px",color:n?.accentColor||"#EE8E35",marginBottom:"6px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},r(e)),t.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",marginBottom:"4px",width:"100%",height:"0",display:"block",flexShrink:0}}),t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),a(e),i(!0)},style:{fontSize:f?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0",flexShrink:0}},n?.viewDetailsTitle||"View Details")))))),t.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},Uh=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:o,setShowPopup:a})=>{const[i,d]=c("undefined"!=typeof window&&window.innerWidth<=768);return l((()=>{const e=()=>{d(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),t.createElement("div",{style:{borderRadius:`${n?.roundness||8}px`}},e?.map(((l,c)=>t.createElement("div",{key:l.discountId,style:{display:"flex",alignItems:"flex-start",gap:i?"8px":"12px",padding:i?"12px 0":"16px 0",paddingLeft:i?"10px":"20px",backgroundColor:!0===n?.cardBackgroundTransparent||"true"===String(n?.cardBackgroundTransparent)?"transparent":n?.cardBackgroundColor||"#ffffff",borderBottom:c<(e?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${n?.roundness||0}px`}},n?.iconVisibility&&t.createElement("div",{style:{width:i?"40px":"50px",height:i?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:i?"20px":"25px",marginTop:i?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===l.couponType?t.createElement(W,null):t.createElement(co,null)),t.createElement("div",{style:{flex:1}},t.createElement("div",{style:{fontSize:i?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},l.couponType.replace(/_/g," ").split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" "),":"," ",t.createElement("span",{style:{fontWeight:600,color:n?.textColor||"#34495e"}},l.name)),t.createElement("div",{style:{fontSize:i?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},r(l)),t.createElement("div",{style:{fontSize:i?"11px":"12px",color:"#000000"}},"offer auto applied",t.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),o(l),a(!0)},style:{color:n?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},n?.viewDetailsTitle||"T&C")))))))},Qh=e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const r=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?r.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&r.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&r.push("Combines with other order discounts"),t||r.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:r}},qh=e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available",Gh=({offersConfig:e,offers:n})=>{const[r,a]=c(!1),[i,d]=c(null),[s,p]=c(null),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=768),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=450),h=o(null);return l((()=>{const e=()=>{m(window.innerWidth<=768),g(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),l((()=>{h.current&&Sn(h.current)}),[e?.sectionBgContrastColor]),t.createElement("div",null,t.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===e?.sectionType?`${e?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:e?.sectionBackgroundColor||"#fff"}},t.createElement("div",{style:{border:"coupon"===e?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=e?.cardPadding?`${e.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===e?.sectionType?`${e?.roundness||8}px`:"0px"}},t.createElement("span",{ref:h,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"right"===e?.alignment?"auto":"50%",right:"right"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===e?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:e?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},e?.sectionTitle||"Available Deals and Offers"),(()=>{const r=e?.sectionType;return"list"===r?t.createElement(Uh,{offersToShow:n||[],offersConfig:e||{},getOfferCardMessage:qh,setSelectedOffer:e=>{d(e),e&&p(Qh(e))},setShowPopup:a}):"coupon"===r?t.createElement(Hh,{offersToShow:n||[],offersConfig:e||{},getOfferCardMessage:qh,setSelectedOffer:e=>{d(e),e&&p(Qh(e))},setShowPopup:a}):null})(),f?t.createElement(Wh,{selectedOffer:i,selectedOfferTerms:s,showPopup:r,offersConfig:e,onClose:()=>{a(!1),d(null),p(null)}}):t.createElement(Vh,{selectedOffer:i,selectedOfferTerms:s,showPopup:r,offersConfig:e,onClose:()=>{a(!1),d(null),p(null)}}))))};export{Lh as Bundle,jh as BundleLoader,gu as Cart,sa as CouponFrame,Ke as Nudge,Gh as ProductOffers,ot as SpinnerWheel};
4942
+ `,Ih=({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(hh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(xh,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(yh,{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(vh,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(wh,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[r]?.node?.image?.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(Ch,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(Eh,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(Th,{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(Sh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Dh,{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_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(Bh,{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(Sh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Dh,{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(zh,{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(Bh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[r][n]==e,onClick:()=>{h(r,e,n)}},e))))):t.createElement(Sh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(Dh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," :"," "),e.values.map(((e,o)=>t.createElement(Bh,{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(kh,{className:"yt-fixedBundle-variant-modal_divider"})))),t.createElement(bh,{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)},_h=({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(lh,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(ch,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(eh,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:s},t.createElement(th,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>d(!i)},t.createElement(nh,{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(rh,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(oh,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map((e=>t.createElement(ah,{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(ih,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name))))))},Oh=({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(dh,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map(((n,r)=>t.createElement(sh,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(_h,{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)})))))},Ph=({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(fh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(uh,{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(mh,{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(ct,null))),t.createElement(Sg,{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($g,{className:"yt-fixedBundle-product-card-horizontal_image",src: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(Bg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(zg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Dg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(Ig,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Mh(a.general.currencySymbol,h)," ",Fh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(_g,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Mh(a.general.currencySymbol,h),Fh(b?.compareAtPrice))),t.createElement(Oh,{product:e,variantOptions:m,selectedVariants:w,onVariantChange:e=>{i(e)},variantId:y,primaryProductId:x})))):t.createElement(t.Fragment,null,t.createElement(jg,{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(gh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:E},t.createElement(uh,{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(mh,{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(ct,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Vg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(Wg,{className:"yt-fixedBundle-product-card_image--vertical",src:k,style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(Hg,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(Ug,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(Qg,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(qg,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(Gg,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(Yg,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Kg,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(Zg,{className:"yt-fixedBundle-product-card-vertical_price--new"},Mh(a.general.currencySymbol,h),Fh(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(_g,{className:"yt-fixedBundle-product-card-vertical_price--old"},Mh(a.general.currencySymbol,h),Fh(b?.compareAtPrice))))),(f<=3||!s)&&u<f-1&&t.createElement(Xg,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(Jg,{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:D}=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]),I=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 O=e.customizations,P=O.fixedBundle?.cardLayoutStyle||"auto",N="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(Cg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:O.fixedBundle.sectionBackgroundColor,..."transparent"!==O.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},A&&t.createElement(Eg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:O.fixedBundle?.titleBackgroundColor||"none",color:O.fixedBundle?.titleTextColor||"black",textAlign:O.fixedBundle.infoAlignment??"center",fontSize:O.fixedBundle?.titleFontSize,..."transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===O.fixedBundle.infoAlignment&&"transparent"===O.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},A),F&&t.createElement(kg,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:O.fixedBundle?.subtitleFontSize,textAlign:O.fixedBundle.infoAlignment??"center",..."left"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===O.fixedBundle.infoAlignment&&"transparent"!==O.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===O.fixedBundle.infoAlignment&&"transparent"===O.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},F),N?t.createElement(Tg,{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(Ph,{isChecked:C.has(r),product:n.productDetails,selectedVariantId:y[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:O,onVariantChange:e=>k(r,e),onCheckChange:e=>{T(e,r)},isMobile:d,index:r,isHorizontal:N,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0}))))):t.createElement(Rg,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(Lg,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===O.fixedBundle.infoAlignment?"flex-start":"right"===O.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map(((n,r)=>t.createElement(Ph,{key:`${n.productId}-${r}`,isChecked:C.has(r),product:n.productDetails,selectedVariantId:y[r.toString()]||"",canCustomize:e?.canCustomizeFixedBundle||!1,styles:O,onVariantChange:e=>k(r,e),onCheckChange:e=>T(e,r),isMobile:d,index:r,isHorizontal:N,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:x,variantId:p||void 0}))),$&&t.createElement(Ih,{productsWithIndices:_,isOpen:m,onClose:()=>f(!1),variantOptions:e.variantOptions,cta:{textColor:O.general.ctaTextColor,backgroundColor:O.general.ctaBackgroundColor},onVariantChange:k,handleAddToCart:I,primaryProductId:x,variantId:p||void 0}))),t.createElement(Og,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===O.fixedBundle.infoAlignment?"flex-start":"right"===O.fixedBundle.infoAlignment?"flex-end":"center"}},Number(B)>0&&Number(D)>0&&O.fixedBundle.compareAtPriceVisibility&&t.createElement(Pg,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(Ag,{className:"yt-fixedBundle-summary_price"},Mh(O.general.currencySymbol,e?.storeCurrencyCode),Fh(B))),0!==C.size&&t.createElement(Ng,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(Ag,{className:"yt-fixedBundle-summary_price"},Mh(O.general.currencySymbol,e?.storeCurrencyCode),Fh(z))," ",Number(D)>0&&t.createElement(Fg,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",Mh(O.general.currencySymbol,e?.storeCurrencyCode),Fh(D)))),t.createElement(Mg,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),N||!$?I(e):f(!0)},disabled:C.size<1||r,style:{backgroundColor:O.general?.ctaBackgroundColor||"#121212",color:O.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${O.general?.ctaBackgroundColor||"#121212"}`,boxShadow:O.general.ctaShadowType,paddingTop:O.general?.ctaPadding,paddingBottom:O.general?.ctaPadding,borderRadius:O.general.ctaBorderRadius,width:O.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{O.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=O.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=O.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{O.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=O.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=O.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(Xo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,O.fixedBundle?.ctaTitle??"Add Bundle to cart")))},Ah=window?.Shopify?.currency||{rate:1,active:"INR"},Fh=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Ah.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},Mh=(e,t)=>t==Ah.active?e:fn(Ah.active)||Ah.active,Rh=(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)))},Lh=({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(df,{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(pf,{bundle:e,addToCartFunction:r}):"mixAndMatch"===e.type?t.createElement(wg,{bundle:e,addToCartFunction:r}):t.createElement(Vf,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(Nh,{addToCartFunction:r,bundle:e});U(".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 jh=()=>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"},"‎"))))),Vh=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2147483647},onClick:o},t.createElement("div",{style:{width:"90vw",minWidth:"375px",maxWidth:"480px",maxHeight:"90vh",backgroundColor:"#fff",borderRadius:"12px",padding:"16px",boxShadow:"0 4px 15px rgba(0,0,0,0.3)",position:"relative",flexDirection:"column",display:"flex"},onClick:e=>e.stopPropagation()},t.createElement("img",{src:"https://feature-products-offers.shopify-product-blocks.pages.dev/assets/confetti.jpg",alt:"confetti",style:{width:"100%",height:"clamp(150px, 20vh, 230px)",objectFit:"cover",objectPosition:"top",borderTopLeftRadius:"12px",borderTopRightRadius:"12px",marginBottom:"10px",flexShrink:0}}),t.createElement("div",{style:{fontSize:"clamp(32px, 8vw, 40px)",color:"#4C4C4C",marginTop:"clamp(-150px, -20vh, -200px)",marginBottom:"8px",display:"flex",justifyContent:"center",position:"relative"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",fontWeight:500,color:"#4C4C4C",lineHeight:"normal",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" ")),t.createElement("div",{style:{fontSize:"clamp(28px, 7vw, 40px)",fontWeight:"600",color:a?.textColor||"#EE8E35",lineHeight:"normal",textAlign:"center"}},n.name),t.createElement("div",{style:{fontSize:"clamp(16px, 4vw, 20px)",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage),t.createElement("hr",{style:{border:"none",height:"2px",width:"100%",margin:"10px 0 18px 0",backgroundColor:"transparent",backgroundImage:"repeating-linear-gradient(to right, #ccc 0, #ccc 12px, transparent 12px, transparent 20px)",backgroundSize:"100% 2px",backgroundPosition:"0 0",backgroundRepeat:"repeat-x"}}),t.createElement("div",{style:{marginTop:"15px",fontSize:"clamp(14px, 3.5vw, 16px)",textAlign:"center",display:"flex",flexDirection:"column"}},t.createElement("strong",{style:{color:"#888"}},"Terms & Conditions"),t.createElement("ul",{style:{marginTop:"5px",paddingLeft:"20px",textAlign:"left",display:"inline-block",color:"#000",lineHeight:"1.3",marginBottom:"0"}},r.terms.map(((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e))))),t.createElement("button",{onClick:o,style:{width:"100%",padding:"10px 20px",marginTop:"10px",backgroundColor:"#fff",border:"none",borderTop:"1px solid #ddd",borderRadius:"0",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",flexShrink:0}},"Close")));return w(i,document.body)},Wh=({showPopup:e,selectedOffer:n,selectedOfferTerms:r,onClose:o,offersConfig:a})=>{if(!e||!n||!r)return null;const i=t.createElement("div",{className:"yt-product-offers-isolated",style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:2147483647,animation:"fadeIn 0.3s ease"},onClick:o},t.createElement("style",null,"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n "),t.createElement("div",{style:{width:"100%",maxHeight:"85vh",backgroundColor:"#fff",borderTopLeftRadius:"20px",borderTopRightRadius:"20px",borderTop:"1px solid #E5E5E5",position:"relative",flexDirection:"column",display:"flex",animation:"slideUp 0.3s ease",overflow:"hidden"},onClick:e=>e.stopPropagation()},t.createElement("div",{style:{width:"40px",height:"4px",backgroundColor:"#ddd",borderRadius:"2px",margin:"12px auto 16px",flexShrink:0}}),t.createElement("div",{style:{overflowY:"auto",flex:1}},t.createElement("div",{style:{padding:"0 20px 20px",backgroundColor:"#fff"}},t.createElement("div",{style:{fontSize:"48px",color:"#4C4C4C",display:"flex",justifyContent:"center",margin:"16px"}},t.createElement(H,null)),t.createElement("div",{style:{fontSize:"14px",fontWeight:500,color:"#888",textAlign:"center"}},n.couponType.replace(/_/g," ").split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" ")),t.createElement("div",{style:{fontSize:"32px",fontWeight:"700",color:a?.textColor||"#EE8E35",textAlign:"center",lineHeight:"1.2"}},n.name),t.createElement("div",{style:{fontSize:"18px",color:"#000000",textAlign:"center",fontWeight:500}},r.offerMessage)),t.createElement("div",{style:{backgroundColor:"#F5F5F5",padding:"16px 20px"}},t.createElement("div",{style:{fontSize:"16px",fontWeight:"600",color:"#333",textAlign:"center"}},"Terms & Conditions")),t.createElement("div",{style:{padding:"20px",backgroundColor:"#fff"}},t.createElement("ul",{style:{margin:"0",paddingLeft:"20px",color:"#333",lineHeight:"1.6",fontSize:"14px"}},r.terms.map(((e,n)=>t.createElement("li",{key:n,style:{marginBottom:"4px"}},e)))))),t.createElement("button",{onClick:o,style:{width:"100%",padding:"18px 20px",backgroundColor:"#F5F5F5",border:"none",borderTop:"1px solid #E5E5E5",fontSize:"16px",fontWeight:"600",color:"#333",cursor:"pointer",textAlign:"center",fontFamily:"'Poppins', sans-serif",flexShrink:0}},"Close")));return w(i,document.body)},Hh=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:a,setShowPopup:i})=>{const d=o(null),[s,p]=c(!1),[u,m]=c(!0),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=768),h=()=>{if(d.current){const{scrollLeft:e,scrollWidth:t,clientWidth:n}=d.current;p(e>0),m(e<t-n-10)}};l((()=>{h();const e=d.current;if(e)return e.addEventListener("scroll",h),()=>e.removeEventListener("scroll",h)}),[e]),l((()=>{const e=()=>{g(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]);const x=e=>{if(d.current){const t=f?280:365,n=16,r="right"===e?t+n:-(t+n);d.current.scrollBy({left:r,behavior:"smooth"})}};return t.createElement("div",{style:{position:"relative"}},t.createElement("svg",{style:{position:"absolute",width:0,height:0}},t.createElement("defs",null,t.createElement("mask",{id:"coupon-cut-mask-desktop"},t.createElement("rect",{width:"365",height:"500",fill:"white"}),t.createElement("circle",{cx:"80",cy:"0",r:"12",fill:"black"}),t.createElement("circle",{cx:"80",cy:"200",r:"12",fill:"black"})),t.createElement("mask",{id:"coupon-cut-mask-mobile"},t.createElement("rect",{width:"280",height:"500",fill:"white"}),t.createElement("circle",{cx:"60",cy:"0",r:"10",fill:"black"}),t.createElement("circle",{cx:"60",cy:"180",r:"10",fill:"black"})))),s&&t.createElement("button",{onClick:()=>x("left"),style:{position:"absolute",left:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},t.createElement(M,{size:20})),u&&t.createElement("button",{onClick:()=>x("right"),style:{position:"absolute",right:"5px",top:"50%",transform:"translateY(-50%)",background:"#fff",border:"1px solid #e0e0e0",borderRadius:"50%",width:"clamp(28px, 5vw, 38px)",height:"clamp(28px, 5vw, 38px)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",zIndex:10,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",color:"#333"}},t.createElement(j,{size:20})),t.createElement("div",{ref:d,className:"hide-scrollbar",style:{display:"flex",alignItems:"stretch",overflowX:"auto",gap:"16px",paddingTop:"15px",paddingBottom:"10px",scrollbarWidth:"none",msOverflowStyle:"none",minHeight:f?"110px":"128px"}},e?.map((e=>t.createElement("div",{key:e.discountId,style:{flexShrink:0,width:f?"280px":"365px",minWidth:f?"280px":"365px",backgroundColor:"transparent",borderRadius:`${n?.roundness||0}px`,border:"1px solid #e0e0e0",display:"flex",position:"relative",overflow:"visible",mask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMask:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,maskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`,WebkitMaskImage:`url(#${f?"coupon-cut-mask-mobile":"coupon-cut-mask-desktop"})`}},t.createElement("div",{style:{width:f?"60px":"80px",backgroundColor:n?.accentColor||"#EE8E35",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:f?"10px 6px":"12px 8px",position:"relative",borderTopLeftRadius:`${n?.roundness||0}px`,borderBottomLeftRadius:`${n?.roundness||0}px`}},t.createElement("div",{style:{position:"absolute",left:"100%",bottom:0,width:f?"20px":"24px",height:f?"20px":"24px",backgroundColor:n?.sectionBackgroundColor||"#fff",borderRadius:"50%",transform:"translate(-50%, 50%)",zIndex:2147483647}}),t.createElement("div",{style:{position:"absolute",right:"-2px",top:"12px",bottom:"12px",width:"2px",borderLeft:"2px dashed #FFFFFF"}})),n?.iconVisibility&&t.createElement("div",{style:{position:"absolute",left:f?"42.5px":"57.5px",top:"35%",transform:"translateY(-50%)",width:f?"32px":"40px",height:f?"32px":"40px",backgroundColor:"#FFFFFF",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:f?"16px":"20px",color:"#333333",zIndex:10,boxShadow:"0 2px 5px rgba(0,0,0,0.1)",border:"1px solid #E0E0E0"}},"free_product"===e.couponType?t.createElement(W,null):t.createElement(co,null)),t.createElement("div",{style:{flex:1,padding:f?"12px 12px":"15px 15px",paddingLeft:f?"25px":"35px",display:"flex",flexDirection:"column",justifyContent:"space-between",borderTopRightRadius:`${n?.roundness||0}px`,borderBottomRightRadius:`${n?.roundness||0}px`,overflow:"hidden",backgroundColor:"#ffffff",minWidth:0}},t.createElement("div",{style:{fontSize:f?"9px":"10px",color:"#666666",marginBottom:"3px",fontWeight:"400",lineHeight:"1.2"}},"free_product"===e.couponType?"Free Gift":"Special Deal"),t.createElement("div",{style:{fontSize:f?"13px":"15px",fontWeight:"600",color:n?.textColor||"#2c3e50",lineHeight:"1.2",marginBottom:"3px",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},e.name||"Free Tote Bag"),t.createElement("div",{style:{fontSize:f?"11px":"12px",color:n?.accentColor||"#EE8E35",marginBottom:"6px",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"}},r(e)),t.createElement("div",{style:{borderTop:"1px solid #999999",marginTop:"4px",marginBottom:"4px",width:"100%",height:"0",display:"block",flexShrink:0}}),t.createElement("a",{href:"#",onClick:t=>{t.preventDefault(),a(e),i(!0)},style:{fontSize:f?"11px":"12px",color:"#2c3e50",fontWeight:"500",textDecoration:"none",cursor:"pointer",textAlign:"center",marginTop:"0",flexShrink:0}},n?.viewDetailsTitle||"View Details")))))),t.createElement("style",null,"\n .hide-scrollbar::-webkit-scrollbar {\n display: none;\n }\n .hide-scrollbar {\n -ms-overflow-style: none;\n scrollbar-width: none;\n }\n "))},Uh=({offersToShow:e,offersConfig:n,getOfferCardMessage:r,setSelectedOffer:o,setShowPopup:a})=>{const[i,d]=c("undefined"!=typeof window&&window.innerWidth<=768);return l((()=>{const e=()=>{d(window.innerWidth<=768)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),t.createElement("div",{style:{borderRadius:`${n?.roundness||8}px`}},e?.map(((l,c)=>t.createElement("div",{key:l.discountId,style:{display:"flex",alignItems:"flex-start",gap:i?"8px":"12px",padding:i?"12px 0":"16px 0",paddingLeft:i?"10px":"20px",backgroundColor:!0===n?.cardBackgroundTransparent||"true"===String(n?.cardBackgroundTransparent)?"transparent":n?.cardBackgroundColor||"#ffffff",borderBottom:c<(e?.length||0)-1?"1px solid rgb(225 218 218)":"none",marginBottom:"4px",borderRadius:`${n?.roundness||0}px`}},n?.iconVisibility&&t.createElement("div",{style:{width:i?"40px":"50px",height:i?"40px":"50px",backgroundColor:"#f8f9fa",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:i?"20px":"25px",marginTop:i?"5px":"10px",border:"2px solid #4a4a4a",color:"#4a4a4a"}},"free_product"===l.couponType?t.createElement(W,null):t.createElement(co,null)),t.createElement("div",{style:{flex:1}},t.createElement("div",{style:{fontSize:i?"14px":"15px",fontWeight:600,color:"#000000",lineHeight:"1"}},l.couponType.replace(/_/g," ").split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase())).join(" "),":"," ",t.createElement("span",{style:{fontWeight:600,color:n?.textColor||"#34495e"}},l.name)),t.createElement("div",{style:{fontSize:i?"12px":"13px",color:"#7f8c8d",marginBottom:"6px"}},r(l)),t.createElement("div",{style:{fontSize:i?"11px":"12px",color:"#000000"}},"offer auto applied",t.createElement("a",{href:"#",onClick:e=>{e.preventDefault(),o(l),a(!0)},style:{color:n?.accentColor||"#7f8c8d",fontWeight:700,textDecoration:"none",marginLeft:"2px"}},n?.viewDetailsTitle||"T&C")))))))},Qh=e=>{const t="free_product"===e.couponType;let n="";t?n="Get this product for free!":e.discountPercentage?n=`Get ${e.discountPercentage}% off`:e.discountValue&&(n=`Get ${e.discountValue} off`);const r=["Limited Time Offer","Applies automatically when criteria is met"];return"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?r.push(`Unlock when you add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to cart`):"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue&&r.push(`Unlock at order value of ${e.minimumOrderValue}`),t&&r.push("Combines with other order discounts"),t||r.push("Not applicable if other offer with higher discount applied on same product"),{offerMessage:n,terms:r}},qh=e=>"quantity"===e.customCartProgressBarCriteria&&e.quantityThreshold?`add ${e.quantityThreshold} ${e.quantityThreshold>1?"items":"item"} to unlock`:"minimum_order_value"===e.customCartProgressBarCriteria&&e.minimumOrderValue?`unlocks on orders above ${e.minimumOrderValue}`:"Special offer available",Gh=({offersConfig:e,offers:n})=>{const[r,a]=c(!1),[i,d]=c(null),[s,p]=c(null),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=768),[f,g]=c("undefined"!=typeof window&&window.innerWidth<=450),h=o(null);return l((()=>{const e=()=>{m(window.innerWidth<=768),g(window.innerWidth<=450)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),l((()=>{h.current&&Sn(h.current)}),[e?.sectionBgContrastColor]),t.createElement("div",null,t.createElement("div",{style:{position:"relative",width:"100%",maxWidth:"450px",borderRadius:"list"===e?.sectionType?`${e?.roundness||0}px`:"0px",boxSizing:"border-box",backgroundColor:e?.sectionBackgroundColor||"#fff"}},t.createElement("div",{style:{border:"coupon"===e?.sectionType?"none":"1px solid rgb(169, 163, 163)",borderTop:"1px solid rgb(169, 163, 163)",padding:null!=e?.cardPadding?`${e.cardPadding}px`:u?"20px 10px 15px":"30px 15px 20px",position:"relative",borderRadius:"list"===e?.sectionType?`${e?.roundness||8}px`:"0px"}},t.createElement("span",{ref:h,className:"yt-product-offers-section-title",style:{position:"absolute",top:"0",left:"left"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"right"===e?.alignment?"auto":"50%",right:"right"===e?.alignment?"coupon"===e?.sectionType?"0px":u?"10px":"20px":"auto",transform:"middle"===e?.alignment?"translateX(-50%) translateY(-50%)":"translateY(-50%)",background:e?.sectionBgContrastColor||"#fff",padding:u?"0 8px":"0 10px",fontWeight:"500",fontSize:u?"14px":"16px",textTransform:"uppercase",textAlign:"center"}},e?.sectionTitle||"Available Deals and Offers"),(()=>{const r=e?.sectionType;return"list"===r?t.createElement(Uh,{offersToShow:n||[],offersConfig:e||{},getOfferCardMessage:qh,setSelectedOffer:e=>{d(e),e&&p(Qh(e))},setShowPopup:a}):"coupon"===r?t.createElement(Hh,{offersToShow:n||[],offersConfig:e||{},getOfferCardMessage:qh,setSelectedOffer:e=>{d(e),e&&p(Qh(e))},setShowPopup:a}):null})(),f?t.createElement(Wh,{selectedOffer:i,selectedOfferTerms:s,showPopup:r,offersConfig:e,onClose:()=>{a(!1),d(null),p(null)}}):t.createElement(Vh,{selectedOffer:i,selectedOfferTerms:s,showPopup:r,offersConfig:e,onClose:()=>{a(!1),d(null),p(null)}}))))};export{Lh as Bundle,jh as BundleLoader,gu as Cart,sa as CouponFrame,Ke as Nudge,Gh as ProductOffers,ot as SpinnerWheel};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.7.403-feature-product-offer-refactor.26",
3
+ "version": "0.7.403-feature-product-offer-refactor.28",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",