yt-uikit 0.9.26-progress-bar-ui.2 → 0.9.26-progress-bar-ui.3

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
@@ -985,7 +985,7 @@ import e,{useState as t,useEffect as n,useMemo as r,useRef as o,useCallback as i
985
985
  flex-wrap: wrap;
986
986
  text-align: center;
987
987
  }
988
- `,Cr=({prefixMessageText:t="You are",suffixMessageText:n="away from",successMessageText:r="Best reward unlocked",...o})=>{const i=(r,o)=>e.createElement(wr,null,t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},r)," ",n&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},n," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},o));let a=-1;const l=void 0!==o.currentCartAmount?o.currentCartAmount:o.cartData?.items_subtotal_price,c=void 0!==o.effectiveQuantityForProgressBar?o.effectiveQuantityForProgressBar:o.cartData?.item_count,s=sn(o.cartData,o.cartData?.currency)??"Rs .";if("minimum_order_value"===o.customCartProgressBarCriteria){if(0===l&&o.cartData?.items_subtotal_price>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(l<o.checkpoints?.[e]?.minimumOrderValue){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},r);const t=o.checkpoints?.[a];return i(`${s}${yn((t?.minimumOrderValue-l).toFixed(0))}`,t?.name)}if(0===c&&o.cartData?.item_count>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(c<o.checkpoints?.[e]?.quantityThreshold){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},r);const d=o.checkpoints?.[a];return i(`${d?.quantityThreshold-c}`,d?.name)},Er=t=>e.createElement(gr,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(Cr,{...t})),kr=({particleCount:t,spread:r,origin:i,checkpointPosition:a=.5})=>{const l=o(null),c=o(!1);return n(()=>{if(l.current&&!c.current){ke.create(l.current,{resize:!0})({particleCount:10*t,spread:r,origin:{x:1,y:.8}}),c.current=!0}},[t,r,i,a]),e.createElement("canvas",{ref:l,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},Tr=({prefixMessageText:r,suffixMessageText:i,successMessageText:a,enableConfetti:l,...c})=>{const{currentCartAmount:s,checkpoints:d,themeColor:p,customCartProgressBarCriteria:u,primaryTextColor:m,effectiveQuantityForProgressBar:g,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}=c,y=ce(Kt),[b,h]=t(!1),[v,w]=t(-1),C=o({});return n(()=>{d?.forEach((e,t)=>{const n=vr(e,0,d??[],y?.item_count,c),r=String(e.couponTemplateId);(C.current[r]||0)<100&&n.progressPercentage>=100&&(w(t),h(!0),setTimeout(()=>h(!1),5e3)),C.current[r]=n.progressPercentage})},[y,d]),e.createElement(e.Fragment,null,e.createElement(Er,{currentCartAmount:s,checkpoints:d,cartData:y,customCartProgressBarCriteria:u,effectiveQuantityForProgressBar:g,themeColor:p,primaryTextColor:m,showMOVForProgressTiers:!1,prefixMessageText:r,suffixMessageText:i,successMessageText:a,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}),e.createElement(xr,null,b&&l&&e.createElement(kr,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v+1)/(d?.length??1)}),e.createElement(fr,null,e.createElement(mr,null,d?.sort((e,t)=>"minimum_order_value"===u?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[hr(u)]&&("minimum_order_value"!==u||1!==e?.[hr(u)]))?.map((...e)=>vr(...e,y?.item_count,c))?.map((t,n)=>e.createElement(yr,{key:t?.couponTemplateId,$numberOfCheckpoints:d?.length??1},e.createElement(br,null,n<d?.length&&e.createElement(ur,{className:"yt-cart-single-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:d?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:x}))))))))},Sr=t=>e.createElement(lr,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(Cr,{...t})),$r=(t,n,r,o,i,a)=>{let l;if(l="free_product"===t?Br?.[o]:zr?.[t],a)return e.createElement(et,{style:{width:"24px",height:"24px",color:"black"}});if(!l)return e.createElement(Te,{style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${tr(r)}px`,width:"24px",height:"24px",marginLeft:"-2px"}});const c=(()=>{try{if("undefined"==typeof window)return!0;const e=window?.Shopify?.shop||window?.ytapp?.storeDomain;return!!e&&new Set(["h1gvdy-t0.myshopify.com","aayush-new-store.myshopify.com"]).has(e)}catch(e){return!1}})();return e.createElement(l,{style:{padding:"4px",border:"2px solid black",backgroundColor:c?"#000":"white",borderColor:c?"#fff":n,color:c?"#fff":n,borderRadius:"9999px",width:"24px",height:"24px",fontSize:`${tr(r??3)}px`,marginLeft:"-2px"}})},Br={tshirt:De,box:Ae,cup:Qe,gift:Fe,emptyCircle:tt},zr={percentage_discount_coupon:we,amount_discount_coupon:we,free_delivery:_,free_gift:Fe,dummy_coupon:tt},Nr=({checkpointWithProgress:t,themeColor:n,checkpointsLength:r,progressBarFreeProductIconType:o,themeTextColor:i,ctaButtonTextColor:a,isLineTierIconVisible:l})=>t?.progressPercentage>=100?e.createElement(Te,{style:{padding:"4px",border:"2px solid black",backgroundColor:n,color:a,borderColor:n,borderRadius:"9999px",fontSize:`${tr(r)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):$r(t?.couponType,"#707070",r,o??"tshirt",0,l),Ir=({showMOVForProgressTiers:t,minimumOrderValue:n,customCartProgressBarCriteria:r,cartData:o,quantityThreshold:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l})=>t?e.createElement(ar,{$visible:n>1||i>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:a},"minimum_order_value"===r?`${sn(o,o?.currency)} ${yn(n)}`:`${i} item${i>1?"s":""}`):null,Fr="undefined"!=typeof window?a:n,Pr=({prefixMessageText:r,suffixMessageText:a,successMessageText:l,enableConfetti:c,...s})=>{const{currentCartAmount:d,checkpoints:p,themeColor:u,themeTextColor:m,customCartProgressBarCriteria:g,primaryTextColor:x,effectiveQuantityForProgressBar:f,progressBarFreeProductIconType:y,ctaButtonBackgroundColor:b,showMOVForProgressTiers:h,ctaButtonTextColor:v,isLineTierIconVisible:w}=s,C=ce(Kt),[E,k]=t(!1),[T,S]=t(-1),$=o({}),[B,z]=t(0),[N,I]=t(0),F=o(null),P=o([]);P.current.length=0;const D=i(()=>{if("undefined"==typeof window)return;const e=P.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return z(e=>0!==e?0:e),void I(e=>0!==e?0:e);let t=0;e.forEach(e=>{const n=window.getComputedStyle(e),r=parseFloat(n.lineHeight||""),o=parseFloat(n.fontSize||""),i=Number.isNaN(r)?Number.isNaN(o)?0:1.2*o:r,a=e.getBoundingClientRect(),l=i>0?Math.max(0,a.height-i):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const n=t>1?Math.min(32,Math.round(t+6)):0;z(e=>e!==n?n:e);const r=F.current,o=e[e.length-1];if(!r||!o)return void I(e=>0!==e?0:e);const i=r.getBoundingClientRect(),a=o.getBoundingClientRect(),l=Math.ceil(a.right-i.right),c=l>0?l:0;I(e=>e!==c?c:e)},[]);return Fr(()=>{D()}),n(()=>{if("undefined"==typeof window)return;const e=()=>{D()};window.addEventListener("resize",e);const t=F.current,n="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>D()):null;return n&&t&&n.observe(t),()=>{window.removeEventListener("resize",e),n?.disconnect()}},[D]),n(()=>{s.checkpoints?.forEach((e,t)=>{const n=vr(e,0,s.checkpoints??[],C?.item_count,s),r=String(e.couponTemplateId);($.current[r]||0)<100&&n.progressPercentage>=100&&(S(t),k(!0),setTimeout(()=>k(!1),5e3)),$.current[r]=n.progressPercentage})},[C,s.checkpoints]),e.createElement(e.Fragment,null,e.createElement(Sr,{currentCartAmount:d,checkpoints:s.checkpoints,cartData:C,customCartProgressBarCriteria:s.customCartProgressBarCriteria,effectiveQuantityForProgressBar:s.effectiveQuantityForProgressBar,themeColor:u,primaryTextColor:x,showMOVForProgressTiers:s.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:b,prefixMessageText:r,suffixMessageText:a,successMessageText:l,ctaButtonTextColor:v}),e.createElement(cr,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:s.showMOVForProgressTiers??!1,$rightMarginOffsetPx:N,ref:F},E&&c&&e.createElement(kr,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(T+1)/(s.checkpoints?.length??1)}),e.createElement(sr,{$tagWrapOffsetPx:B},e.createElement(nr,null,s.checkpoints?.sort((e,t)=>"minimum_order_value"===s.customCartProgressBarCriteria?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[hr(s.customCartProgressBarCriteria)])?.map((...e)=>vr(...e,C?.item_count,s))?.map((t,n)=>e.createElement(dr,{key:t?.couponTemplateId,$numberOfCheckpoints:s.checkpoints?.length??1},e.createElement(pr,null,n<s.checkpoints?.length&&e.createElement(or,{className:"yt-cart-multi-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:s.checkpoints?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:b}),("minimum_order_value"!==s.customCartProgressBarCriteria||t?.minimumOrderValue>1)&&e.createElement(rr,{$isDummy:t?.isDummyCouponTemplate},e.createElement(ir,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{P.current[n]=e},$isCompleted:t?.progressPercentage>=100,$ctaButtonTextColor:v,$ctaButtonBackgroundColor:b,$primaryTextColor:x,style:{display:s.checkpoints?.length>1?"block":"none"}},t?.name),s.checkpoints?.length>1&&e.createElement(Nr,{checkpointWithProgress:t,themeColor:b,themeTextColor:m,checkpointsLength:s.checkpoints?.length,progressBarFreeProductIconType:y,ctaButtonTextColor:v,isLineTierIconVisible:w}),e.createElement(Ir,{showMOVForProgressTiers:s.showMOVForProgressTiers,minimumOrderValue:t?.minimumOrderValue,customCartProgressBarCriteria:s.customCartProgressBarCriteria,cartData:C,quantityThreshold:t?.quantityThreshold,ctaButtonBackgroundColor:b,ctaButtonTextColor:v})))))))))},Dr=t=>t?.checkpoints&&t.checkpoints.length>0?1===t.checkpoints.length?e.createElement(Tr,{...t}):e.createElement(Pr,{...t}):null,Ar=c(c.span`
988
+ `,Cr=({prefixMessageText:t="You are",suffixMessageText:n="away from",successMessageText:r="Best reward unlocked",...o})=>{const i=(r,o)=>e.createElement(wr,null,t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},r)," ",n&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},n," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},o));let a=-1;const l=void 0!==o.currentCartAmount?o.currentCartAmount:o.cartData?.items_subtotal_price,c=void 0!==o.effectiveQuantityForProgressBar?o.effectiveQuantityForProgressBar:o.cartData?.item_count,s=sn(o.cartData,o.cartData?.currency)??"Rs .";if("minimum_order_value"===o.customCartProgressBarCriteria){if(0===l&&o.cartData?.items_subtotal_price>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(l<o.checkpoints?.[e]?.minimumOrderValue){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},r);const t=o.checkpoints?.[a];return i(`${s}${yn((t?.minimumOrderValue-l).toFixed(0))}`,t?.name)}if(0===c&&o.cartData?.item_count>0)return null;for(let e=0;e<o.checkpoints?.length;e++)if(c<o.checkpoints?.[e]?.quantityThreshold){a=e;break}if(-1===a)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},r);const d=o.checkpoints?.[a];return i(`${d?.quantityThreshold-c}`,d?.name)},Er=t=>e.createElement(gr,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(Cr,{...t})),kr=({particleCount:t,spread:r,origin:i,checkpointPosition:a=.5})=>{const l=o(null),c=o(!1);return n(()=>{if(l.current&&!c.current){ke.create(l.current,{resize:!0})({particleCount:10*t,spread:r,origin:{x:1,y:.8}}),c.current=!0}},[t,r,i,a]),e.createElement("canvas",{ref:l,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},Tr=({prefixMessageText:r,suffixMessageText:i,successMessageText:a,enableConfetti:l,...c})=>{const{currentCartAmount:s,checkpoints:d,themeColor:p,customCartProgressBarCriteria:u,primaryTextColor:m,effectiveQuantityForProgressBar:g,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}=c,y=ce(Kt),[b,h]=t(!1),[v,w]=t(-1),C=o({});return n(()=>{d?.forEach((e,t)=>{const n=vr(e,0,d??[],y?.item_count,c),r=String(e.couponTemplateId);(C.current[r]||0)<100&&n.progressPercentage>=100&&(w(t),h(!0),setTimeout(()=>h(!1),5e3)),C.current[r]=n.progressPercentage})},[y,d]),e.createElement(e.Fragment,null,e.createElement(Er,{currentCartAmount:s,checkpoints:d,cartData:y,customCartProgressBarCriteria:u,effectiveQuantityForProgressBar:g,themeColor:p,primaryTextColor:m,showMOVForProgressTiers:!1,prefixMessageText:r,suffixMessageText:i,successMessageText:a,ctaButtonBackgroundColor:x,ctaButtonTextColor:f}),e.createElement(xr,null,b&&l&&e.createElement(kr,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v+1)/(d?.length??1)}),e.createElement(fr,null,e.createElement(mr,null,d?.sort((e,t)=>"minimum_order_value"===u?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[hr(u)]&&("minimum_order_value"!==u||1!==e?.[hr(u)]))?.map((...e)=>vr(...e,y?.item_count,c))?.map((t,n)=>e.createElement(yr,{key:t?.couponTemplateId,$numberOfCheckpoints:d?.length??1},e.createElement(br,null,n<d?.length&&e.createElement(ur,{className:"yt-cart-single-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:d?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:x}))))))))},Sr=t=>e.createElement(lr,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(Cr,{...t})),$r=(t,n,r,o,i,a)=>{let l;if(l="free_product"===t?Br?.[o]:zr?.[t],a)return e.createElement(et,{style:{position:"absolute",transform:"translateX(-50%)",width:"30px",height:"24px",color:"black",zIndex:10}});if(!l)return e.createElement(Te,{style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${tr(r)}px`,width:"24px",height:"24px",marginLeft:"-2px"}});const c=(()=>{try{if("undefined"==typeof window)return!0;const e=window?.Shopify?.shop||window?.ytapp?.storeDomain;return!!e&&new Set(["h1gvdy-t0.myshopify.com","aayush-new-store.myshopify.com"]).has(e)}catch(e){return!1}})();return e.createElement(l,{style:{padding:"4px",border:"2px solid black",backgroundColor:c?"#000":"white",borderColor:c?"#fff":n,color:c?"#fff":n,borderRadius:"9999px",width:"24px",height:"24px",fontSize:`${tr(r??3)}px`,marginLeft:"-2px"}})},Br={tshirt:De,box:Ae,cup:Qe,gift:Fe,emptyCircle:tt},zr={percentage_discount_coupon:we,amount_discount_coupon:we,free_delivery:_,free_gift:Fe,dummy_coupon:tt},Nr=({checkpointWithProgress:t,themeColor:n,checkpointsLength:r,progressBarFreeProductIconType:o,themeTextColor:i,ctaButtonTextColor:a,isLineTierIconVisible:l})=>t?.progressPercentage>=100?e.createElement(Te,{style:{padding:"4px",border:"2px solid black",backgroundColor:n,color:a,borderColor:n,borderRadius:"9999px",fontSize:`${tr(r)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):$r(t?.couponType,"#707070",r,o??"tshirt",0,l),Ir=({showMOVForProgressTiers:t,minimumOrderValue:n,customCartProgressBarCriteria:r,cartData:o,quantityThreshold:i,ctaButtonBackgroundColor:a,ctaButtonTextColor:l})=>t?e.createElement(ar,{$visible:n>1||i>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:a},"minimum_order_value"===r?`${sn(o,o?.currency)} ${yn(n)}`:`${i} item${i>1?"s":""}`):null,Fr="undefined"!=typeof window?a:n,Pr=({prefixMessageText:r,suffixMessageText:a,successMessageText:l,enableConfetti:c,...s})=>{const{currentCartAmount:d,checkpoints:p,themeColor:u,themeTextColor:m,customCartProgressBarCriteria:g,primaryTextColor:x,effectiveQuantityForProgressBar:f,progressBarFreeProductIconType:y,ctaButtonBackgroundColor:b,showMOVForProgressTiers:h,ctaButtonTextColor:v,isLineTierIconVisible:w}=s,C=ce(Kt),[E,k]=t(!1),[T,S]=t(-1),$=o({}),[B,z]=t(0),[N,I]=t(0),F=o(null),P=o([]);P.current.length=0;const D=i(()=>{if("undefined"==typeof window)return;const e=P.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return z(e=>0!==e?0:e),void I(e=>0!==e?0:e);let t=0;e.forEach(e=>{const n=window.getComputedStyle(e),r=parseFloat(n.lineHeight||""),o=parseFloat(n.fontSize||""),i=Number.isNaN(r)?Number.isNaN(o)?0:1.2*o:r,a=e.getBoundingClientRect(),l=i>0?Math.max(0,a.height-i):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const n=t>1?Math.min(32,Math.round(t+6)):0;z(e=>e!==n?n:e);const r=F.current,o=e[e.length-1];if(!r||!o)return void I(e=>0!==e?0:e);const i=r.getBoundingClientRect(),a=o.getBoundingClientRect(),l=Math.ceil(a.right-i.right),c=l>0?l:0;I(e=>e!==c?c:e)},[]);return Fr(()=>{D()}),n(()=>{if("undefined"==typeof window)return;const e=()=>{D()};window.addEventListener("resize",e);const t=F.current,n="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>D()):null;return n&&t&&n.observe(t),()=>{window.removeEventListener("resize",e),n?.disconnect()}},[D]),n(()=>{s.checkpoints?.forEach((e,t)=>{const n=vr(e,0,s.checkpoints??[],C?.item_count,s),r=String(e.couponTemplateId);($.current[r]||0)<100&&n.progressPercentage>=100&&(S(t),k(!0),setTimeout(()=>k(!1),5e3)),$.current[r]=n.progressPercentage})},[C,s.checkpoints]),e.createElement(e.Fragment,null,e.createElement(Sr,{currentCartAmount:d,checkpoints:s.checkpoints,cartData:C,customCartProgressBarCriteria:s.customCartProgressBarCriteria,effectiveQuantityForProgressBar:s.effectiveQuantityForProgressBar,themeColor:u,primaryTextColor:x,showMOVForProgressTiers:s.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:b,prefixMessageText:r,suffixMessageText:a,successMessageText:l,ctaButtonTextColor:v}),e.createElement(cr,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:s.showMOVForProgressTiers??!1,$rightMarginOffsetPx:N,ref:F},E&&c&&e.createElement(kr,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(T+1)/(s.checkpoints?.length??1)}),e.createElement(sr,{$tagWrapOffsetPx:B},e.createElement(nr,null,s.checkpoints?.sort((e,t)=>"minimum_order_value"===s.customCartProgressBarCriteria?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold)?.filter(e=>0!==e?.[hr(s.customCartProgressBarCriteria)])?.map((...e)=>vr(...e,C?.item_count,s))?.map((t,n)=>e.createElement(dr,{key:t?.couponTemplateId,$numberOfCheckpoints:s.checkpoints?.length??1},e.createElement(pr,null,n<s.checkpoints?.length&&e.createElement(or,{className:"yt-cart-multi-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:s.checkpoints?.length??1,$isFirstCheckpoint:0===n,$ctaButtonBackgroundColor:b}),("minimum_order_value"!==s.customCartProgressBarCriteria||t?.minimumOrderValue>1)&&e.createElement(rr,{$isDummy:t?.isDummyCouponTemplate},e.createElement(ir,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{P.current[n]=e},$isCompleted:t?.progressPercentage>=100,$ctaButtonTextColor:v,$ctaButtonBackgroundColor:b,$primaryTextColor:x,style:{display:s.checkpoints?.length>1?"block":"none"}},t?.name),s.checkpoints?.length>1&&e.createElement(Nr,{checkpointWithProgress:t,themeColor:b,themeTextColor:m,checkpointsLength:s.checkpoints?.length,progressBarFreeProductIconType:y,ctaButtonTextColor:v,isLineTierIconVisible:w}),e.createElement(Ir,{showMOVForProgressTiers:s.showMOVForProgressTiers,minimumOrderValue:t?.minimumOrderValue,customCartProgressBarCriteria:s.customCartProgressBarCriteria,cartData:C,quantityThreshold:t?.quantityThreshold,ctaButtonBackgroundColor:b,ctaButtonTextColor:v})))))))))},Dr=t=>t?.checkpoints&&t.checkpoints.length>0?1===t.checkpoints.length?e.createElement(Tr,{...t}):e.createElement(Pr,{...t}):null,Ar=c(c.span`
989
989
  display: flex !important;
990
990
  gap: 4px;
991
991
  `)`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.9.26-progress-bar-ui.2",
3
+ "version": "0.9.26-progress-bar-ui.3",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "rm -rf dist && tsc && rollup -c",