yt-uikit 0.7.348-bundle-image.4 → 0.7.348-bundle-image.5

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
@@ -1295,7 +1295,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
1295
1295
  padding: 2px 0px 4px 0px;
1296
1296
  border-bottom-left-radius: 8px;
1297
1297
  border-bottom-right-radius: 8px;
1298
- `,_a=({imageUrl:e,overlayText:n,themeColor:r,themeTextColor:o})=>t.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},t.createElement("img",{src:e,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),t.createElement(Da,{themeColor:r,themeTextColor:o},n)),Ia=({product:e,handleDecrement:n,handleIncrement:r,removeCartItem:a,addCartItem:i,isDev:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:f,showQtySelector:g=!0,themeTextColor:h,showEditOptionOnProducts:x,percentageOff:y,tags:b,removeFreebieFromCart:v,showDeleteOnFreebies:w,imageAspectSelector:C,cartComponentsCornerType:E,cartComponentsCornerRadius:k,backgroundSubdued:T,backgroundColor:S,showDiscountOnMRP:$})=>{const{setLoading:z}=nn(),B=Wt(Yt),[D,_]=Gt(ca),[I,P]=c(!1),O=Ut(rn),[F,A]=c(null);l((()=>{const e=localStorage.getItem("yt_variant_options");if(e)try{const t=JSON.parse(e);Array.isArray(t)?A({options:t}):t&&Array.isArray(t.options)&&A(t)}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}}),[]);const N=!!e.properties?._isYtFreebie&&"number"==typeof e.final_line_price&&e.final_line_price>0&&"number"==typeof e.original_line_price&&e.original_line_price>e.final_line_price;l((()=>{function e(){const e=window.innerWidth;P(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const M=o(null),[R,L]=c(0);l((()=>{let e=null;return M.current&&(e=new ResizeObserver((e=>{e[0]&&L(e[0].contentRect.width)})),e.observe(M.current)),()=>{e&&e.disconnect()}}),[]),l((()=>{const e=setTimeout((()=>{M.current&&L(M.current.offsetWidth)}),100);return()=>clearTimeout(e)}),[]);const j=hn(e.product_title,R<200?100:120,R,"","16px"),V=()=>{if(e.line_level_discount_allocations&&e.line_level_discount_allocations.length>0&&e.line_level_discount_allocations[0].discount_application)switch(e.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${e.line_level_discount_allocations[0].discount_application.title})`;case"percentage":case"fixed_amount":return`${e.line_level_discount_allocations[0].discount_application.title}`;default:return""}};let H=un(B,B?.currency);const W=["__Added with Frequently Bought Together button","_has_gpo","_y"],U="66839544050"===window?.ytapp?.storeId;function G(e,t){e=e.replace(/^#/,"");return`rgba(${parseInt(e.substring(0,2),16)}, ${parseInt(e.substring(2,4),16)}, ${parseInt(e.substring(4,6),16)}, ${t})`}const Y=e?.options_with_values&&e.options_with_values.filter((e=>"Title"!==e.name)).length>0||e?.properties&&Object.keys(e.properties).filter((e=>!W.includes(e)&&!e.startsWith("_")&&!e.startsWith("__"))).length>0||x,Q=R?70/R*100:100,q=V(),Z=q&&(q.length>25||!I)?hn(q,Q,R,"","10px"):q,K=(()=>{const t=e?.properties?._bundleImage;if(!t||"string"!=typeof t)return;const n=t.trim();return n.length>0?n:void 0})(),X=!!K,J=(()=>{const t=e?.properties?.itemsInBundle;return"string"!=typeof t?[]:t.split(/,\s*/).map((e=>e.trim())).filter((e=>e.length>0))})(),ee=(()=>{const t=e?.properties?._bundleItems;if("string"==typeof t&&t.trim().length>0)try{const e=JSON.parse(t);if(Array.isArray(e)){const t=e.reduce(((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)}),0);if(t>0)return t}}catch(e){}let n=0;for(const e of J){const t=e.match(/^(\d+)\s*x\s*/i);n+=t?parseInt(t[1],10)||0:1}return n})(),[te,ne]=c(!0);return t.createElement(ga,{$hasVariantInfo:Y||X,$backgroundColor:S,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem"}},t.createElement(xa,null,X&&t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"absolute",inset:0,borderRadius:"8px",border:"1.14px solid #969696CF",background:"#FFFFFF",transform:"translate(-4px, -4px)",zIndex:0}}),t.createElement("div",{style:{position:"absolute",inset:0,borderRadius:"8px",border:"1.14px solid #969696CF",background:"#FFFFFF",transform:"translate(-8px, -8px)",zIndex:0}})),t.createElement(ha,{className:"yt-cart-product-image",$imageAspectSelector:C},g?t.createElement("img",{style:{height:"100%",width:"100%",opacity:0===e.quantity?.5:1},src:kn(K??e.image,150,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(e),loading:"lazy"}):t.createElement(_a,{imageUrl:kn(K??e.image??e?.featuredImage?.url??"/placeholder.svg",150,85,"webp"),overlayText:N||y?"Special Offer":"Free Gift",themeColor:d,themeTextColor:h})),(g||e?.quantity>1)&&t.createElement(ya,null,e.quantity)),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},t.createElement(fa,{$themeColor:d,$primaryTextColor:p,href:`${window.location.origin}${e.url}`,ref:M},j),t.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(g||w)&&t.createElement(wa,{onClick:g?async()=>{z&&z(!0,!0);try{a&&await a(e.key)}catch(e){}z&&z(!1,!1)}:async()=>{z&&z(!0,!0);try{v&&await v(e.key)}catch(e){}z&&z(!1,!1)}},t.createElement(ba,null,t.createElement(mt,{className:"outline"}),t.createElement(ut,{className:"filled"})))))),X?t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},t.createElement("div",{role:"button",onClick:()=>ne(!te),style:{display:"inline-flex",alignItems:"center",gap:"8px",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"6px 8px",width:"fit-content",cursor:"pointer",userSelect:"none",fontSize:"12px",fontWeight:600,color:u??"#1a1a1a"}},t.createElement("span",null,`Contain ${ee} Items`),te?t.createElement(tt,null):t.createElement(et,null)),te&&J.length>0&&t.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:"300px",width:"fit-content"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:"300px"}},J.map(((e,n)=>t.createElement("div",{key:`${e}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:e},e)))))):Y&&t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},t.createElement(sa,null,e?.options_with_values?.filter((e=>"Title"!==e.name&&e.value.length<=15)).map((e=>{const n=F?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase())),r=n?.values?.find((t=>t.name.trim().toLowerCase()===e.value.trim().toLowerCase()));return"color"===n?.type?.toLowerCase()&&r?t.createElement(da,{key:e.name,$colorValue:r.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&r?t.createElement(pa,{key:e.name,src:kn(r.value,36,85,"webp"),alt:e.value}):t.createElement(va,{className:"yt-cart-variant-text",key:e.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},e.value)})),e?.properties&&Object.entries(e.properties).filter((([e])=>!W.includes(e)&&!e.startsWith("_")&&!e.startsWith("__"))).map((([e,n])=>t.createElement(va,{key:e,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},String(n)))),x&&!e?.product_has_only_default_variant&&t.createElement(wa,{onClick:()=>{const t=!!e.properties?._isYtFreebie;let n;if(t){const t=e.properties?._yt_allowed_variants;if(t&&"string"==typeof t)try{n=JSON.parse(t)}catch(r){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${e.key}:`,t,r),n=[String(e.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${e.key}. Defaulting to current variant.`),n=[String(e.variant_id)]}O({open:!0,variantId:String(e.variant_id),quantity:e.quantity,handle:e.handle,lineItemKey:e.key,freebieSelection:t,productId:String(e.product_id),allowedVariantIds:n})},style:{display:"flex",alignItems:"center"}},t.createElement(Kr,null))),e?.options_with_values?.filter((e=>"Title"!==e.name&&e.value.length>15)).map((e=>{const n=I?e.value:hn(e.value,R?120/R*100:100,R,"","10px");return t.createElement(va,{key:e.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px",width:"fit-content"}},n)}))),t.createElement(Ca,null,t.createElement("div",{style:{display:"flex",flexDirection:I?"row":"column",alignItems:I?"center":"flex-start",gap:I?"0px":"4px"}},t.createElement(Ea,null,X?t.createElement(t.Fragment,null,t.createElement(ka,{$primaryTextColor:p},H,Cn(Number(e?.properties?._finalBundlePrice)??0)),e?.properties?._originalBundlePrice&&t.createElement(Ta,null,H,Cn(Number(e?.properties?._originalBundlePrice)??0))):t.createElement(ka,{$primaryTextColor:p},0===dn(e.final_line_price,B?.currency)?t.createElement(Ba,{$primaryColor:p,$themeColor:d,$backgroundSubdued:T},"FREE"):t.createElement(t.Fragment,null,H,Cn(dn(e.final_line_price,B?.currency)))),(e.compare_at_price&&Number(e.compare_at_price)*e.quantity>Number(e.final_line_price)||!e.compare_at_price&&V()&&e.original_line_price)&&$&&t.createElement(Ta,null,H,e.compare_at_price?Cn(dn(Number(e.compare_at_price)*e.quantity,B?.currency)):Cn(dn(e.original_line_price,B?.currency))),I&&(X?t.createElement($a,{$tertiaryColor:m},t.createElement(qr,{size:14,color:f}),t.createElement(za,{$tertiaryTextColor:f},"Bundle")):(g||N)&&V()&&t.createElement($a,{$tertiaryColor:m},t.createElement(qr,{size:14,color:f}),t.createElement(za,{$tertiaryTextColor:f},Z)))),!I&&(X?t.createElement($a,{$tertiaryColor:m},t.createElement(qr,{size:12,color:f}),t.createElement(za,{$tertiaryTextColor:f},"Bundle")):(g||N)&&V()&&t.createElement($a,{$tertiaryColor:m},t.createElement(qr,{size:12,color:f}),t.createElement(za,{$tertiaryTextColor:f},Z))),b&&b.length>0&&U&&t.createElement("div",{style:{display:"flex",flexWrap:"wrap",columnGap:"2px",rowGap:"2px",marginTop:I?"0px":"4px"}},b.filter((e=>"Delhi-NCR"===e)).map((e=>t.createElement("span",{key:e,style:{fontSize:"10px",padding:"3px 8px",backgroundColor:G(d,.15),color:d,borderRadius:"4px"}},"Delhi-NCR"===e?"Only For Delhi NCR":e))))),t.createElement(Sa,null,g?t.createElement(la,{handleItemQuantityDecrement:async()=>{z&&z(!0,!0);try{n&&await n(e.key,e.quantity-1)}catch(e){}z&&z(!1,!1)},handleItemQuantityIncrement:async()=>{z&&z(!0,!0);try{if(r){-1===await r(e.id,e.quantity+1,e.properties)&&(_(e?.key),setTimeout((()=>_(void 0)),3e3))}}catch(e){}z&&z(!1,!1)},value:e.quantity,isDev:s,themeColor:d,cartComponentsCornerType:E,cartComponentsCornerRadius:k,backgroundSubdued:T}):t.createElement("span",{style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:f??"#000",borderRadius:"4px"}},N&&e.original_line_price?`${((e.original_line_price-e.final_line_price)/e.original_line_price*100).toFixed(0)}% off`:y&&e?.properties?._isYtFreebie?`${y}% Off`:"Freebie"))),D&&D===e?.key&&t.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))};function Pa(e){return I({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M7 11V7a5 5 0 0 1 10 0v4"},child:[]}]})(e)}function Oa(e){return I({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]}]})(e)}const Fa=x.div`
1298
+ `,_a=({imageUrl:e,overlayText:n,themeColor:r,themeTextColor:o})=>t.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},t.createElement("img",{src:e,alt:"Free Gift",style:{width:"100%",height:"100%",objectFit:"fill",borderRadius:"8px"}}),t.createElement(Da,{themeColor:r,themeTextColor:o},n)),Ia=({product:e,handleDecrement:n,handleIncrement:r,removeCartItem:a,addCartItem:i,isDev:s,themeColor:d,primaryTextColor:p,secondaryTextColor:u,tertiaryColor:m,tertiaryTextColor:f,showQtySelector:g=!0,themeTextColor:h,showEditOptionOnProducts:x,percentageOff:y,tags:b,removeFreebieFromCart:v,showDeleteOnFreebies:w,imageAspectSelector:C,cartComponentsCornerType:E,cartComponentsCornerRadius:k,backgroundSubdued:T,backgroundColor:S,showDiscountOnMRP:$})=>{const{setLoading:z}=nn(),B=Wt(Yt),[D,_]=Gt(ca),[I,P]=c(!1),O=Ut(rn),[F,A]=c(null);l((()=>{const e=localStorage.getItem("yt_variant_options");if(e)try{const t=JSON.parse(e);Array.isArray(t)?A({options:t}):t&&Array.isArray(t.options)&&A(t)}catch(e){console.error("Failed to parse yt_variant_options from localStorage",e)}}),[]);const N=!!e.properties?._isYtFreebie&&"number"==typeof e.final_line_price&&e.final_line_price>0&&"number"==typeof e.original_line_price&&e.original_line_price>e.final_line_price;l((()=>{function e(){const e=window.innerWidth;P(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const M=o(null),[R,L]=c(0);l((()=>{let e=null;return M.current&&(e=new ResizeObserver((e=>{e[0]&&L(e[0].contentRect.width)})),e.observe(M.current)),()=>{e&&e.disconnect()}}),[]),l((()=>{const e=setTimeout((()=>{M.current&&L(M.current.offsetWidth)}),100);return()=>clearTimeout(e)}),[]);const j=hn(e.product_title,R<200?100:120,R,"","16px"),V=()=>{if(e.line_level_discount_allocations&&e.line_level_discount_allocations.length>0&&e.line_level_discount_allocations[0].discount_application)switch(e.line_level_discount_allocations[0].discount_application.value_type){case"amount":return`${e.line_level_discount_allocations[0].discount_application.title})`;case"percentage":case"fixed_amount":return`${e.line_level_discount_allocations[0].discount_application.title}`;default:return""}};let H=un(B,B?.currency);const W=["__Added with Frequently Bought Together button","_has_gpo","_y"],U="66839544050"===window?.ytapp?.storeId;function G(e,t){e=e.replace(/^#/,"");return`rgba(${parseInt(e.substring(0,2),16)}, ${parseInt(e.substring(2,4),16)}, ${parseInt(e.substring(4,6),16)}, ${t})`}const Y=e?.options_with_values&&e.options_with_values.filter((e=>"Title"!==e.name)).length>0||e?.properties&&Object.keys(e.properties).filter((e=>!W.includes(e)&&!e.startsWith("_")&&!e.startsWith("__"))).length>0||x,Q=R?70/R*100:100,q=V(),Z=q&&(q.length>25||!I)?hn(q,Q,R,"","10px"):q,K=(()=>{const t=e?.properties?._bundleImage;if(!t||"string"!=typeof t)return;const n=t.trim();return n.length>0?n:void 0})(),X=!!K,J=(()=>{const t=e?.properties?.itemsInBundle;return"string"!=typeof t?[]:t.split(/,\s*/).map((e=>e.trim())).filter((e=>e.length>0))})(),ee=(()=>{const t=e?.properties?._bundleItems;if("string"==typeof t&&t.trim().length>0)try{const e=JSON.parse(t);if(Array.isArray(e)){const t=e.reduce(((e,t)=>{const n=Number(t?.quantity);return e+(isNaN(n)?0:n)}),0);if(t>0)return t}}catch(e){}let n=0;for(const e of J){const t=e.match(/^(\d+)\s*x\s*/i);n+=t?parseInt(t[1],10)||0:1}return n})(),[te,ne]=c(!0);return t.createElement(ga,{$hasVariantInfo:Y||X,$backgroundColor:S,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"0 1rem"}},t.createElement(xa,null,X&&t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"absolute",inset:0,borderRadius:"8px",border:"1.14px solid #969696CF",background:"#FFFFFF",transform:"translate(-4px, -4px)",zIndex:1}}),t.createElement("div",{style:{position:"absolute",inset:0,borderRadius:"8px",border:"1.14px solid #969696CF",background:"#FFFFFF",transform:"translate(-8px, -8px)",zIndex:0}})),t.createElement(ha,{className:"yt-cart-product-image",$imageAspectSelector:C,style:{position:X?"relative":void 0,zIndex:X?2:void 0}},g?t.createElement("img",{style:{height:"100%",width:"100%",opacity:0===e.quantity?.5:1},src:kn(K??e.image,150,85,"webp"),alt:(e=>e.title?`Product image - ${e.title}`:"Product image")(e),loading:"lazy"}):t.createElement(_a,{imageUrl:kn(K??e.image??e?.featuredImage?.url??"/placeholder.svg",150,85,"webp"),overlayText:N||y?"Special Offer":"Free Gift",themeColor:d,themeTextColor:h})),(g||e?.quantity>1)&&t.createElement(ya,null,e.quantity)),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,padding:"4px 0"}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"flex-start"}},t.createElement(fa,{$themeColor:d,$primaryTextColor:p,href:`${window.location.origin}${e.url}`,ref:M},j),t.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",justifyContent:"center"}},t.createElement("div",{style:{marginLeft:"3px",display:"flex",alignItems:"center",justifyContent:"center"}},(g||w)&&t.createElement(wa,{onClick:g?async()=>{z&&z(!0,!0);try{a&&await a(e.key)}catch(e){}z&&z(!1,!1)}:async()=>{z&&z(!0,!0);try{v&&await v(e.key)}catch(e){}z&&z(!1,!1)}},t.createElement(ba,null,t.createElement(mt,{className:"outline"}),t.createElement(ut,{className:"filled"})))))),X?t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},t.createElement("div",{role:"button",onClick:()=>ne(!te),style:{display:"inline-flex",alignItems:"center",gap:"8px",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"4px 6px",width:"fit-content",cursor:"pointer",userSelect:"none",fontSize:"12px",fontWeight:600,color:u??"#1a1a1a"}},t.createElement("span",null,`Contain ${ee} Items`),te?t.createElement(tt,null):t.createElement(et,null)),te&&J.length>0&&t.createElement("div",{style:{marginTop:"4px",backgroundColor:"#F8F9FA",borderRadius:"8px",padding:"8px 10px",border:"1px solid rgba(0,0,0,0.06)",maxWidth:"300px",width:"fit-content"}},t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxWidth:"300px"}},J.map(((e,n)=>t.createElement("div",{key:`${e}-${n}`,style:{color:u??"#1a1a1a",fontSize:"12px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:e},e)))))):Y&&t.createElement("div",{style:{display:"flex",flexDirection:"column",marginBottom:"4px"}},t.createElement(sa,null,e?.options_with_values?.filter((e=>"Title"!==e.name&&e.value.length<=15)).map((e=>{const n=F?.options?.find((t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase())),r=n?.values?.find((t=>t.name.trim().toLowerCase()===e.value.trim().toLowerCase()));return"color"===n?.type?.toLowerCase()&&r?t.createElement(da,{key:e.name,$colorValue:r.value,style:{display:"block"}}):"image"===n?.type?.toLowerCase()&&r?t.createElement(pa,{key:e.name,src:kn(r.value,36,85,"webp"),alt:e.value}):t.createElement(va,{className:"yt-cart-variant-text",key:e.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",borderRadius:"6px",border:"1px solid rgb(117 117 117 / 50%)",padding:"1px 3px"}},e.value)})),e?.properties&&Object.entries(e.properties).filter((([e])=>!W.includes(e)&&!e.startsWith("_")&&!e.startsWith("__"))).map((([e,n])=>t.createElement(va,{key:e,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px"}},String(n)))),x&&!e?.product_has_only_default_variant&&t.createElement(wa,{onClick:()=>{const t=!!e.properties?._isYtFreebie;let n;if(t){const t=e.properties?._yt_allowed_variants;if(t&&"string"==typeof t)try{n=JSON.parse(t)}catch(r){console.error(`ProductCard: Failed to parse _yt_allowed_variants for ${e.key}:`,t,r),n=[String(e.variant_id)]}else console.warn(`ProductCard: No allowed variants property found for freebie ${e.key}. Defaulting to current variant.`),n=[String(e.variant_id)]}O({open:!0,variantId:String(e.variant_id),quantity:e.quantity,handle:e.handle,lineItemKey:e.key,freebieSelection:t,productId:String(e.product_id),allowedVariantIds:n})},style:{display:"flex",alignItems:"center"}},t.createElement(Kr,null))),e?.options_with_values?.filter((e=>"Title"!==e.name&&e.value.length>15)).map((e=>{const n=I?e.value:hn(e.value,R?120/R*100:100,R,"","10px");return t.createElement(va,{key:e.name,$secondaryTextColor:u,style:{display:"flex",alignItems:"center",backgroundColor:"#F8F9FA",borderRadius:"6px",border:"1px solid rgba(0,0,0,0.1)",padding:"1px 3px",width:"fit-content"}},n)}))),t.createElement(Ca,null,t.createElement("div",{style:{display:"flex",flexDirection:I?"row":"column",alignItems:I?"center":"flex-start",gap:I?"0px":"4px"}},t.createElement(Ea,null,X?t.createElement(t.Fragment,null,t.createElement(ka,{$primaryTextColor:p},H,Cn(Number(e?.properties?._finalBundlePrice)??0)),e?.properties?._originalBundlePrice&&t.createElement(Ta,null,H,Cn(Number(e?.properties?._originalBundlePrice)??0))):t.createElement(ka,{$primaryTextColor:p},0===dn(e.final_line_price,B?.currency)?t.createElement(Ba,{$primaryColor:p,$themeColor:d,$backgroundSubdued:T},"FREE"):t.createElement(t.Fragment,null,H,Cn(dn(e.final_line_price,B?.currency)))),(e.compare_at_price&&Number(e.compare_at_price)*e.quantity>Number(e.final_line_price)||!e.compare_at_price&&V()&&e.original_line_price)&&$&&t.createElement(Ta,null,H,e.compare_at_price?Cn(dn(Number(e.compare_at_price)*e.quantity,B?.currency)):Cn(dn(e.original_line_price,B?.currency))),I&&(g||N)&&V()&&t.createElement($a,{$tertiaryColor:m},t.createElement(qr,{size:14,color:f}),t.createElement(za,{$tertiaryTextColor:f},Z))),!I&&(g||N)&&V()&&t.createElement($a,{$tertiaryColor:m},t.createElement(qr,{size:12,color:f}),t.createElement(za,{$tertiaryTextColor:f},Z)),b&&b.length>0&&U&&t.createElement("div",{style:{display:"flex",flexWrap:"wrap",columnGap:"2px",rowGap:"2px",marginTop:I?"0px":"4px"}},b.filter((e=>"Delhi-NCR"===e)).map((e=>t.createElement("span",{key:e,style:{fontSize:"10px",padding:"3px 8px",backgroundColor:G(d,.15),color:d,borderRadius:"4px"}},"Delhi-NCR"===e?"Only For Delhi NCR":e))))),t.createElement(Sa,null,g?t.createElement(la,{handleItemQuantityDecrement:async()=>{z&&z(!0,!0);try{n&&await n(e.key,e.quantity-1)}catch(e){}z&&z(!1,!1)},handleItemQuantityIncrement:async()=>{z&&z(!0,!0);try{if(r){-1===await r(e.id,e.quantity+1,e.properties)&&(_(e?.key),setTimeout((()=>_(void 0)),3e3))}}catch(e){}z&&z(!1,!1)},value:e.quantity,isDev:s,themeColor:d,cartComponentsCornerType:E,cartComponentsCornerRadius:k,backgroundSubdued:T}):t.createElement("span",{style:{padding:"2px 8px",fontSize:"10px",backgroundColor:m,color:f??"#000",borderRadius:"4px"}},N&&e.original_line_price?`${((e.original_line_price-e.final_line_price)/e.original_line_price*100).toFixed(0)}% off`:y&&e?.properties?._isYtFreebie?`${y}% Off`:"Freebie"))),D&&D===e?.key&&t.createElement("span",{style:{fontSize:"10px",color:"red",marginTop:"4px"}},"⚠️You've reached the maximum quantity for this item")))};function Pa(e){return I({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"},child:[]},{tag:"path",attr:{d:"M7 11V7a5 5 0 0 1 10 0v4"},child:[]}]})(e)}function Oa(e){return I({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"3 6 5 6 21 6"},child:[]},{tag:"path",attr:{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"},child:[]}]})(e)}const Fa=x.div`
1299
1299
  margin: 8px 0 6px 0;
1300
1300
  padding: 12px;
1301
1301
  background: ${e=>e.$backgroundColor??"rgba(0,0,0,0.04)"};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.7.348-bundle-image.4",
3
+ "version": "0.7.348-bundle-image.5",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",