@cleartrip/ct-platform-supercoins-chip 2.2.0-beta.19 → 2.2.0-beta.20

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SupercoinsChip.d.ts","sourceRoot":"","sources":["../packages/components/SupercoinsChip/src/SupercoinsChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAe9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAc7D,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAuXjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"SupercoinsChip.d.ts","sourceRoot":"","sources":["../packages/components/SupercoinsChip/src/SupercoinsChip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAe9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAc7D,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwXjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),r=require("@cleartrip/ct-design-typography"),o=require("@cleartrip/ct-platform-shimmer"),a=require("@cleartrip/ct-platform-utils");function t(e){return e&&e.__esModule?e:{default:e}}var s=t(i);function l(e,n){void 0===n&&(n={});var i=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var c={supercoinsBalance:"index-module_supercoinsBalance__w9srh",supercoinsExpiryPill:"index-module_supercoinsExpiryPill__v4w06",supercoinChipWrapper:"index-module_supercoinChipWrapper__QPdUS",supercoinBurnTextAlign:"index-module_supercoinBurnTextAlign__g-go5",supercoinBurnExpiryColor:"index-module_supercoinBurnExpiryColor__FTFjA",supercoinExpiryText:"index-module_supercoinExpiryText__rkVbG",supercoinExpiryAnimating:"index-module_supercoinExpiryAnimating__Gdq0n",superCoinsFloatingIslandContainer:"index-module_superCoinsFloatingIslandContainer__5FNNa",supercoinsBalanceBackgroundColorShift:"index-module_supercoinsBalanceBackgroundColorShift__r6YWa",supercoins_balance_background_color_shift:"index-module_supercoins_balance_background_color_shift__1NHEU",supercoinsBalanceTextColorShift:"index-module_supercoinsBalanceTextColorShift__y7vva",supercoins_balance_text_color_shift:"index-module_supercoins_balance_text_color_shift__V8yxU",supercoinsBalanceBackgroundColorShift_exit:"index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ",supercoins_balance_background_color_shift_exit:"index-module_supercoins_balance_background_color_shift_exit__qAHuv",supercoinsBalanceTextColorShift_exit:"index-module_supercoinsBalanceTextColorShift_exit__JKt90",supercoins_balance_text_color_shift_exit:"index-module_supercoins_balance_text_color_shift_exit__rluZH",supercoin_chip_loading_shimmer:"index-module_supercoin_chip_loading_shimmer__0jquY",supercoins_balance_background_shimmer:"index-module_supercoins_balance_background_shimmer__2lOFp"};l('.index-module_supercoinsBalance__w9srh{background-color:#fff;border:1px solid #e6e6e6;border-radius:16px;display:inline-block;overflow:hidden;padding:6px 8px}.index-module_supercoinsExpiryPill__v4w06{background-color:#fbefef;border:1.5px solid #c83232;border-radius:16px;display:inline-block;overflow:hidden;padding:6px 0 6px 8px}.index-module_supercoinChipWrapper__QPdUS{align-items:center;display:flex;justify-content:center;padding:0 4px}.index-module_supercoinBurnTextAlign__g-go5{line-height:18px;margin-right:4px}.index-module_supercoinBurnExpiryColor__FTFjA{color:#c83232!important}.index-module_supercoinExpiryText__rkVbG{color:#c83232!important;display:inline-block;line-height:18px;opacity:0;overflow:hidden;transition:width .5s ease-in-out,opacity .5s ease-in-out;white-space:nowrap;width:0}.index-module_supercoinExpiryAnimating__Gdq0n{opacity:1;width:97px}.index-module_superCoinsFloatingIslandContainer__5FNNa{margin-left:100%;position:relative;width:1px}.index-module_supercoinsBalanceBackgroundColorShift__r6YWa{animation:index-module_supercoins_balance_background_color_shift__1NHEU .6s forwards;overflow:hidden;position:relative}.index-module_supercoinsBalanceTextColorShift__y7vva{animation:index-module_supercoins_balance_text_color_shift__V8yxU .6s forwards}.index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ{animation:index-module_supercoins_balance_background_color_shift_exit__qAHuv .6s forwards;overflow:hidden;position:relative}.index-module_supercoinsBalanceTextColorShift_exit__JKt90{animation:index-module_supercoins_balance_text_color_shift_exit__rluZH .6s forwards}.index-module_supercoinsBalanceBackgroundColorShift__r6YWa:before{animation:index-module_supercoin_chip_loading_shimmer__0jquY .4s ease-in .5s;background:hsla(0,0%,100%,.8);content:"";height:64px;left:-30%;position:absolute;top:-10px;transform:rotate(25deg);width:8px}@keyframes index-module_supercoin_chip_loading_shimmer__0jquY{0%{left:-30%}to{left:120%}}@keyframes index-module_supercoins_balance_background_color_shift__1NHEU{0%{background-color:rgba(0,62,162,.1)}to{background-color:#003ea2}}@keyframes index-module_supercoins_balance_background_color_shift_exit__qAHuv{0%{background-color:#003ea2}to{background-color:#fff}}@keyframes index-module_supercoins_balance_text_color_shift__V8yxU{0%{color:#000}to{color:#fff}}@keyframes index-module_supercoins_balance_text_color_shift_exit__rluZH{0%{color:#fff}to{color:#000}}@keyframes index-module_supercoins_balance_background_shimmer__2lOFp{0%{background-color:rgba(0,62,162,.1)}to{background-color:#003ea2}}');var u="https://rukmini-ct.flixcart.com/f_auto,q_auto,dpr_2/offermgmt-prod/offermgmt/images/banner/supercoins-chip-icon.png",d="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/wallet-pill-icon.png",_="island_rendered_frquency",p="islandAnimationPlayed",m="island_expiration_frquency",x=5,f=2,g=2e3,h=500,v=1500,y={requiredSupercoins:50,frequency:1,frequencyGapInDays:1,cutoffTimeInMs:5e3,isVisibleOnScroll:!1};function b(e){var n,i=e.renderFloatingIsland,r=e.supercoins;if(!i)return!1;if(r<y.requiredSupercoins)return!1;if(!("true"===a.getQueryParam("isMobileApp")))return!1;if(function(){var e=localStorage.getItem(_);return e&&"number"==typeof parseInt(e)?parseInt(e):0}()>=y.frequency){var o=(n=localStorage.getItem(m))&&"number"==typeof parseInt(n)?parseInt(n):null;return!o||!(o>Math.floor(Date.now()/1e3))&&(localStorage.removeItem(_),localStorage.removeItem(m),!0)}return!sessionStorage.getItem(p)}function w(){var e=localStorage.getItem(_);e||(e="0");var n=parseInt(e)+1;if(localStorage.setItem(_,n.toString()),n>=y.frequency){var i=Math.floor(Date.now()/1e3)+86400*y.frequencyGapInDays;localStorage.setItem(m,i.toString())}}var S={chipWrapper:"index-module_chipWrapper__EwpUk",chipTextWrapper:"index-module_chipTextWrapper__Uburn",textWrapper:"index-module_textWrapper__BysJP",pillContainer:"index-module_pillContainer__bz7P4","width-animation":"index-module_width-animation__Ap-Ga",test:"index-module_test__KekL9","spring-up-wallet":"index-module_spring-up-wallet__GJrXW","spring-up1":"index-module_spring-up1__OLe4L","spring-up-wallet-sc":"index-module_spring-up-wallet-sc__KKKf0","spring-up2":"index-module_spring-up2__SIbCp"};l(".index-module_chipWrapper__EwpUk{align-items:center;display:flex;gap:4px;margin-bottom:20px;text-align:center}.index-module_chipTextWrapper__Uburn{align-items:center;display:flex;justify-content:center;padding:0 4px;text-align:center;width:100%}.index-module_textWrapper__BysJP{margin-right:4px}.index-module_pillContainer__bz7P4{background-color:#fff;border:1px solid #e6e6e6;border-radius:16px;box-sizing:border-box;display:inline-block;overflow:hidden;padding:5px 8px}@keyframes index-module_spring-up1__OLe4L{0%{transform:translateY(0)}60%{transform:translateY(-44px)}90%{transform:translateY(-40px)}to{transform:translateY(-40px)}}@keyframes index-module_spring-up2__SIbCp{0%{transform:translateY(-40px)}60%{transform:translateY(-84px)}90%{transform:translateY(-80px)}to{transform:translateY(-80px)}}@keyframes index-module_width-animation__Ap-Ga{0%{width:var(--wallet-initial-width)}to{width:var(--wallet-final-width)}}.index-module_width-animation__Ap-Ga{animation:index-module_test__KekL9 .7s ease-in-out forwards}.index-module_spring-up-wallet__GJrXW{animation:index-module_spring-up1__OLe4L .7s ease-in-out 2s forwards}.index-module_spring-up-wallet-sc__KKKf0{animation:index-module_spring-up1__OLe4L .7s ease-in-out 2s forwards,index-module_spring-up2__SIbCp .7s ease-in-out 5s forwards}");var C={2:58,3:66,4:74,5:82,6:90,7:120};function B(i){var o=i.supercoinBalance;return n.jsxs("div",e.__assign({className:S.chipWrapper},{children:[n.jsx("img",{src:u,alt:"supercoin_icon",width:18,height:18}),n.jsx("div",e.__assign({className:S.chipTextWrapper},{children:n.jsx(r.Typography,e.__assign({variant:"B2",className:S.textWrapper},{children:o}))}))]}))}function k(i){var o=i.walletBalance;return n.jsxs("div",e.__assign({className:S.chipWrapper},{children:[n.jsx("img",{src:d,alt:"supercoin_icon",width:18,height:18}),n.jsx("div",e.__assign({className:S.chipTextWrapper},{children:n.jsxs(r.Typography,e.__assign({variant:"B2",className:S.textWrapper},{children:["₹",o]}))}))]}))}function I(i){var r,o=i.supercoinBalance,a=i.walletBalance,t=i.handleClick,s=i.chipWidthRef,l=0===a&&o>0||0===o&&0===a,c=l?S["spring-up-wallet-sc"]:S["spring-up-wallet"],u=Math.max(a.toString().length,o.toString().length)+1;!function(e,n){var i=document.querySelector(":root");null==i||i.style.setProperty("--wallet-initial-width","".concat(e,"px"));var r=C[n];null==i||i.style.setProperty("--wallet-final-width","".concat(Math.max(r,e),"px"))}(null!==(r=null==s?void 0:s.current)&&void 0!==r?r:0,u);var d=0===(null==s?void 0:s.current)?"auto":"".concat(null==s?void 0:s.current,"px"),_=0===(null==s?void 0:s.current)?"":S["width-animation"];return n.jsx("div",e.__assign({onClick:t},{children:n.jsx("div",e.__assign({className:"".concat(S.pillContainer," ").concat(_),style:{height:"32px",width:d}},{children:n.jsxs("div",e.__assign({className:c},{children:[n.jsx(B,{supercoinBalance:o}),n.jsx(k,{walletBalance:a}),l?n.jsx(B,{supercoinBalance:o}):null]}))}))}))}var T=s.default.lazy((function(){return import("@cleartrip/ct-platform-supercoins-floating-island").then((function(e){return{default:e.SupercoinsFloatingIsland}}))}));exports.SupercoinsChip=function(t){var s=t.supercoinsLoading,l=t.supercoinBurnBalance,d=t.ravenPayload,_=void 0===d?{}:d,m=t.onSupercoinsClick,S=t.supercoinsExpiryCount,C=t.renderFloatingIsland,B=void 0===C||C,k=t.walletEnabled,E=void 0!==k&&k,j=t.walletBalance;console.log("l1130 SupercoinsChip recieved props",{supercoinsLoading:s,supercoinBurnBalance:l,ravenPayload:_,onSupercoinsClick:m,supercoinsExpiryCount:S,renderFloatingIsland:B,walletEnabled:E,walletBalance:j});var A=i.useMemo((function(){var e;return null!==(e=a.getQueryParam("utm_source"))&&void 0!==e?e:"organic"}),[]),W=i.useState(!1),q=W[0],N=W[1],F=i.useState(0),P=F[0],Y=F[1],L=i.useState(!1),U=L[0],K=L[1],H=i.useState(!1),M=H[0],G=H[1],J=i.useMemo((function(){return"number"==typeof l&&l>=0&&!s}),[l,s]),R=i.useState(!1),D=R[0],O=R[1],V=i.useState(null),z=V[0],Q=V[1],Z=i.useState(!1),X=Z[0],$=Z[1],ee=i.useRef(0),ne="entry"===z?c.supercoinsBalanceBackgroundColorShift:"exit"===z?c.supercoinsBalanceBackgroundColorShift_exit:"",ie="entry"===z?c.supercoinsBalanceTextColorShift:"exit"===z?c.supercoinsBalanceTextColorShift_exit:"";function re(){var n;m&&"function"==typeof m&&m();var i=_.action_event_name;_.impression_event_name;var r=e.__rest(_,["action_event_name","impression_event_name"]);a.ravenSDKTrigger(null!==(n=i)&&void 0!==n?n:"u_ui_action",e.__assign({action_name:"supercoin_icon_click",page_name:"unified_homepage",supercoin_balance:l,u_utm_source:A},r))}if(i.useEffect((function(){Y(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(p)||(console.log("setHasScrolledBeforeAnimation called"),$(!0),Q(null)))};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[]),i.useEffect((function(){var e=b({renderFloatingIsland:B,supercoins:l});console.log("l1130 shouldRenderFloatingIsland called with renderFloatingIsland value",B,"and supercoins value",l,"returned value",e);var n,i="number"==typeof S&&S>=x&&!e;return console.log("l1130 renderSupercoinExpiry called with supercoinsExpiryCount value",S,"and shouldRender value",e,"returned value",i),N(i),e&&sessionStorage.setItem("disable_floater","true"),e&&!X?(console.log("l1130 setChipAnimationType called with entry"),Q("entry"),n=setTimeout((function(){console.log("l1130 setRenderSuperCoinIsland called with true"),O(!0)}),1500)):(console.log("l1130 setStartWalletAnimation called with true"),E&&G(!0)),function(){clearTimeout(n)}}),[l,S]),i.useEffect((function(){if(console.log("l1130 useEffect called with renderFloatingIsland value",B,"and renderSuperCoinIsland value",D),B&&D){var e=setTimeout((function(){sessionStorage.getItem(p)||(console.log("l1130 setRenderSuperCoinIsland called with false"),O(!1),Q("exit"),G(!0))}),y.cutoffTimeInMs);return function(){clearTimeout(e)}}}),[]),i.useEffect((function(){var n;if("number"==typeof l&&l>=0&&!s){_.action_event_name;var i=_.impression_event_name,r=e.__rest(_,["action_event_name","impression_event_name"]);a.ravenSDKTrigger(null!==(n=i)&&void 0!==n?n:"u_impression",e.__assign({action_name:"supercoin_pill_impression",page_name:"unified_homepage",supercoin_balance:l,u_utm_source:A,supercoinsExpiryCount:S||"N/A"},r))}}),[s]),i.useEffect((function(){if(q&&!(P>=f)){var e=setTimeout((function(){K(!0),console.log("l1130 setIsAnimating called with true");var e=setTimeout((function(){K(!1),console.log("l1130 setIsAnimating called with false");var e=P+1;Y(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),v);return function(){return clearTimeout(e)}}),0===P?h:g);return function(){return clearTimeout(e)}}}),[q,P]),s||!D&&!M)return n.jsx("div",e.__assign({className:c.supercoinsBalance},{children:n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(o.Shimmer,{width:18,height:18,type:"rounded"}),n.jsx(o.Shimmer,{width:44,height:18,type:"rounded"})]}))}));if(!J)return null;var oe=q?"HM4":"B2",ae=q?c.supercoinsExpiryPill:c.supercoinsBalance,te=q?c.supercoinBurnExpiryColor:"";return M?(console.log("l1130 startWalletAnimation called with true"),n.jsx(I,{walletBalance:j,supercoinBalance:Number(l),handleClick:re,chipWidthRef:ee})):n.jsxs("div",e.__assign({style:{position:"relative"}},{children:[n.jsx("div",e.__assign({ref:function(e){var n;ee.current=null!==(n=null==e?void 0:e.offsetWidth)&&void 0!==n?n:0,console.log("l1130 chipWidthRef called with offsetWidth",null==e?void 0:e.offsetWidth)},className:"".concat(ae," ").concat(ne),onClick:re},{children:n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx("img",{src:u,alt:"supercoin_icon",width:18,height:18}),n.jsxs("div",e.__assign({className:c.supercoinChipWrapper},{children:[n.jsx(r.Typography,e.__assign({variant:oe,className:[ie,c.supercoinBurnTextAlign,te].join(" ")},{children:U?S:l})),q&&n.jsx(r.Typography,e.__assign({variant:"HM4",className:"".concat(c.supercoinExpiryText," ").concat(U?c.supercoinExpiryAnimating:"")},{children:"expiring soon"}))]}))]}))})),D&&!X&&n.jsx("div",e.__assign({className:c.superCoinsFloatingIslandContainer},{children:n.jsx(i.Suspense,e.__assign({fallback:n.jsx(n.Fragment,{})},{children:n.jsx(T,{superCoins:l,onAnimationStart:function(){return function(n){var i,r=n.supercoins,o=n.ravenPayload,t=void 0===o?{}:o,s=n.utmSource,l=void 0===s?"":s;t.action_event_name;var c=t.impression_event_name,u=e.__rest(t,["action_event_name","impression_event_name"]);a.ravenSDKTrigger(null!==(i=c)&&void 0!==i?i:"u_impression",e.__assign({action_name:"supercoin_banner_impression",page_name:"unified_homepage",supercoin_balance:r,u_utm_source:l},u)),sessionStorage.setItem("islandAnimationPlayed","true"),w()}({supercoins:l,ravenPayload:_,utmSource:A})},onAnimationEnd:function(){console.log("l1130 onAnimationEnd called with walletEnabled value",E),setTimeout((function(){console.log("l1130 setStartWalletAnimation setting to true from \n onAnimationEnd with walletEnabled value ".concat(E)),E&&G(!0)}),500),Q("exit")}})}))}))]}))};
1
+ "use strict";var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),r=require("@cleartrip/ct-design-typography"),o=require("@cleartrip/ct-platform-shimmer"),a=require("@cleartrip/ct-platform-utils");function t(e){return e&&e.__esModule?e:{default:e}}var s=t(i);function l(e,n){void 0===n&&(n={});var i=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var c={supercoinsBalance:"index-module_supercoinsBalance__w9srh",supercoinsExpiryPill:"index-module_supercoinsExpiryPill__v4w06",supercoinChipWrapper:"index-module_supercoinChipWrapper__QPdUS",supercoinBurnTextAlign:"index-module_supercoinBurnTextAlign__g-go5",supercoinBurnExpiryColor:"index-module_supercoinBurnExpiryColor__FTFjA",supercoinExpiryText:"index-module_supercoinExpiryText__rkVbG",supercoinExpiryAnimating:"index-module_supercoinExpiryAnimating__Gdq0n",superCoinsFloatingIslandContainer:"index-module_superCoinsFloatingIslandContainer__5FNNa",supercoinsBalanceBackgroundColorShift:"index-module_supercoinsBalanceBackgroundColorShift__r6YWa",supercoins_balance_background_color_shift:"index-module_supercoins_balance_background_color_shift__1NHEU",supercoinsBalanceTextColorShift:"index-module_supercoinsBalanceTextColorShift__y7vva",supercoins_balance_text_color_shift:"index-module_supercoins_balance_text_color_shift__V8yxU",supercoinsBalanceBackgroundColorShift_exit:"index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ",supercoins_balance_background_color_shift_exit:"index-module_supercoins_balance_background_color_shift_exit__qAHuv",supercoinsBalanceTextColorShift_exit:"index-module_supercoinsBalanceTextColorShift_exit__JKt90",supercoins_balance_text_color_shift_exit:"index-module_supercoins_balance_text_color_shift_exit__rluZH",supercoin_chip_loading_shimmer:"index-module_supercoin_chip_loading_shimmer__0jquY",supercoins_balance_background_shimmer:"index-module_supercoins_balance_background_shimmer__2lOFp"};l('.index-module_supercoinsBalance__w9srh{background-color:#fff;border:1px solid #e6e6e6;border-radius:16px;display:inline-block;overflow:hidden;padding:6px 8px}.index-module_supercoinsExpiryPill__v4w06{background-color:#fbefef;border:1.5px solid #c83232;border-radius:16px;display:inline-block;overflow:hidden;padding:6px 0 6px 8px}.index-module_supercoinChipWrapper__QPdUS{align-items:center;display:flex;justify-content:center;padding:0 4px}.index-module_supercoinBurnTextAlign__g-go5{line-height:18px;margin-right:4px}.index-module_supercoinBurnExpiryColor__FTFjA{color:#c83232!important}.index-module_supercoinExpiryText__rkVbG{color:#c83232!important;display:inline-block;line-height:18px;opacity:0;overflow:hidden;transition:width .5s ease-in-out,opacity .5s ease-in-out;white-space:nowrap;width:0}.index-module_supercoinExpiryAnimating__Gdq0n{opacity:1;width:97px}.index-module_superCoinsFloatingIslandContainer__5FNNa{margin-left:100%;position:relative;width:1px}.index-module_supercoinsBalanceBackgroundColorShift__r6YWa{animation:index-module_supercoins_balance_background_color_shift__1NHEU .6s forwards;overflow:hidden;position:relative}.index-module_supercoinsBalanceTextColorShift__y7vva{animation:index-module_supercoins_balance_text_color_shift__V8yxU .6s forwards}.index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ{animation:index-module_supercoins_balance_background_color_shift_exit__qAHuv .6s forwards;overflow:hidden;position:relative}.index-module_supercoinsBalanceTextColorShift_exit__JKt90{animation:index-module_supercoins_balance_text_color_shift_exit__rluZH .6s forwards}.index-module_supercoinsBalanceBackgroundColorShift__r6YWa:before{animation:index-module_supercoin_chip_loading_shimmer__0jquY .4s ease-in .5s;background:hsla(0,0%,100%,.8);content:"";height:64px;left:-30%;position:absolute;top:-10px;transform:rotate(25deg);width:8px}@keyframes index-module_supercoin_chip_loading_shimmer__0jquY{0%{left:-30%}to{left:120%}}@keyframes index-module_supercoins_balance_background_color_shift__1NHEU{0%{background-color:rgba(0,62,162,.1)}to{background-color:#003ea2}}@keyframes index-module_supercoins_balance_background_color_shift_exit__qAHuv{0%{background-color:#003ea2}to{background-color:#fff}}@keyframes index-module_supercoins_balance_text_color_shift__V8yxU{0%{color:#000}to{color:#fff}}@keyframes index-module_supercoins_balance_text_color_shift_exit__rluZH{0%{color:#fff}to{color:#000}}@keyframes index-module_supercoins_balance_background_shimmer__2lOFp{0%{background-color:rgba(0,62,162,.1)}to{background-color:#003ea2}}');var u="https://rukmini-ct.flixcart.com/f_auto,q_auto,dpr_2/offermgmt-prod/offermgmt/images/banner/supercoins-chip-icon.png",d="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/wallet-pill-icon.png",_="island_rendered_frquency",p="islandAnimationPlayed",m="island_expiration_frquency",x=5,f=2,g=2e3,h=500,v=1500,y={requiredSupercoins:50,frequency:1,frequencyGapInDays:1,cutoffTimeInMs:5e3,isVisibleOnScroll:!1};function b(e){var n,i=e.renderFloatingIsland,r=e.supercoins;if(!i)return!1;if(r<y.requiredSupercoins)return!1;if(!("true"===a.getQueryParam("isMobileApp")))return!1;if(function(){var e=localStorage.getItem(_);return e&&"number"==typeof parseInt(e)?parseInt(e):0}()>=y.frequency){var o=(n=localStorage.getItem(m))&&"number"==typeof parseInt(n)?parseInt(n):null;return!o||!(o>Math.floor(Date.now()/1e3))&&(localStorage.removeItem(_),localStorage.removeItem(m),!0)}return!sessionStorage.getItem(p)}function w(){var e=localStorage.getItem(_);e||(e="0");var n=parseInt(e)+1;if(localStorage.setItem(_,n.toString()),n>=y.frequency){var i=Math.floor(Date.now()/1e3)+86400*y.frequencyGapInDays;localStorage.setItem(m,i.toString())}}var S={chipWrapper:"index-module_chipWrapper__EwpUk",chipTextWrapper:"index-module_chipTextWrapper__Uburn",textWrapper:"index-module_textWrapper__BysJP",pillContainer:"index-module_pillContainer__bz7P4","width-animation":"index-module_width-animation__Ap-Ga","spring-up-wallet":"index-module_spring-up-wallet__GJrXW","spring-up1":"index-module_spring-up1__OLe4L","spring-up-wallet-sc":"index-module_spring-up-wallet-sc__KKKf0","spring-up2":"index-module_spring-up2__SIbCp"};l(".index-module_chipWrapper__EwpUk{align-items:center;display:flex;gap:4px;margin-bottom:20px;text-align:center}.index-module_chipTextWrapper__Uburn{align-items:center;display:flex;justify-content:center;padding:0 4px;text-align:center;width:100%}.index-module_textWrapper__BysJP{margin-right:4px}.index-module_pillContainer__bz7P4{background-color:#fff;border:1px solid #e6e6e6;border-radius:16px;box-sizing:border-box;display:inline-block;overflow:hidden;padding:5px 8px}@keyframes index-module_spring-up1__OLe4L{0%{transform:translateY(0)}60%{transform:translateY(-44px)}90%{transform:translateY(-40px)}to{transform:translateY(-40px)}}@keyframes index-module_spring-up2__SIbCp{0%{transform:translateY(-40px)}60%{transform:translateY(-84px)}90%{transform:translateY(-80px)}to{transform:translateY(-80px)}}@keyframes index-module_width-animation__Ap-Ga{0%{width:var(--wallet-initial-width)}to{width:var(--wallet-final-width)}}.index-module_width-animation__Ap-Ga{animation:index-module_width-animation__Ap-Ga .7s ease-in-out forwards}.index-module_spring-up-wallet__GJrXW{animation:index-module_spring-up1__OLe4L .7s ease-in-out 2s forwards}.index-module_spring-up-wallet-sc__KKKf0{animation:index-module_spring-up1__OLe4L .7s ease-in-out 2s forwards,index-module_spring-up2__SIbCp .7s ease-in-out 5s forwards}");var C={2:58,3:66,4:74,5:82,6:90,7:120};function B(i){var o=i.supercoinBalance;return n.jsxs("div",e.__assign({className:S.chipWrapper},{children:[n.jsx("img",{src:u,alt:"supercoin_icon",width:18,height:18}),n.jsx("div",e.__assign({className:S.chipTextWrapper},{children:n.jsx(r.Typography,e.__assign({variant:"B2",className:S.textWrapper},{children:o}))}))]}))}function k(i){var o=i.walletBalance;return n.jsxs("div",e.__assign({className:S.chipWrapper},{children:[n.jsx("img",{src:d,alt:"supercoin_icon",width:18,height:18}),n.jsx("div",e.__assign({className:S.chipTextWrapper},{children:n.jsxs(r.Typography,e.__assign({variant:"B2",className:S.textWrapper},{children:["₹",o]}))}))]}))}function I(i){var r,o=i.supercoinBalance,a=i.walletBalance,t=i.handleClick,s=i.chipWidthRef,l=0===a&&o>0||0===o&&0===a,c=l?S["spring-up-wallet-sc"]:S["spring-up-wallet"],u=Math.max(a.toString().length,o.toString().length)+1;!function(e,n){var i=document.querySelector(":root");null==i||i.style.setProperty("--wallet-initial-width","".concat(e,"px"));var r=C[n];null==i||i.style.setProperty("--wallet-final-width","".concat(Math.max(r,e),"px"))}(null!==(r=null==s?void 0:s.current)&&void 0!==r?r:0,u);var d=0===(null==s?void 0:s.current)?"auto":"".concat(null==s?void 0:s.current,"px"),_=0===(null==s?void 0:s.current)?"":S["width-animation"];return n.jsx("div",e.__assign({onClick:t},{children:n.jsx("div",e.__assign({className:"".concat(S.pillContainer," ").concat(_),style:{height:"32px",width:d}},{children:n.jsxs("div",e.__assign({className:c},{children:[n.jsx(B,{supercoinBalance:o}),n.jsx(k,{walletBalance:a}),l?n.jsx(B,{supercoinBalance:o}):null]}))}))}))}var T=s.default.lazy((function(){return import("@cleartrip/ct-platform-supercoins-floating-island").then((function(e){return{default:e.SupercoinsFloatingIsland}}))}));exports.SupercoinsChip=function(t){var s=t.supercoinsLoading,l=t.supercoinBurnBalance,d=t.ravenPayload,_=void 0===d?{}:d,m=t.onSupercoinsClick,S=t.supercoinsExpiryCount,C=t.renderFloatingIsland,B=void 0===C||C,k=t.walletEnabled,E=void 0!==k&&k,j=t.walletBalance;console.log("l1130 SupercoinsChip recieved props",{supercoinsLoading:s,supercoinBurnBalance:l,ravenPayload:_,onSupercoinsClick:m,supercoinsExpiryCount:S,renderFloatingIsland:B,walletEnabled:E,walletBalance:j});var A=i.useMemo((function(){var e;return null!==(e=a.getQueryParam("utm_source"))&&void 0!==e?e:"organic"}),[]),W=i.useState(!1),q=W[0],N=W[1],F=i.useState(0),P=F[0],Y=F[1],U=i.useState(!1),G=U[0],H=U[1],L=i.useState(!1),M=L[0],K=L[1],J=i.useMemo((function(){return"number"==typeof l&&l>=0&&!s}),[l,s]),R=i.useState(!1),D=R[0],O=R[1],V=i.useState(null),z=V[0],Q=V[1],Z=i.useState(!1),X=Z[0],$=Z[1],ee=i.useRef(0),ne="entry"===z?c.supercoinsBalanceBackgroundColorShift:"exit"===z?c.supercoinsBalanceBackgroundColorShift_exit:"",ie="entry"===z?c.supercoinsBalanceTextColorShift:"exit"===z?c.supercoinsBalanceTextColorShift_exit:"";function re(){var n;m&&"function"==typeof m&&m();var i=_.action_event_name;_.impression_event_name;var r=e.__rest(_,["action_event_name","impression_event_name"]);a.ravenSDKTrigger(null!==(n=i)&&void 0!==n?n:"u_ui_action",e.__assign({action_name:"supercoin_icon_click",page_name:"unified_homepage",supercoin_balance:l,u_utm_source:A},r))}if(i.useEffect((function(){Y(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(p)||(console.log("setHasScrolledBeforeAnimation called"),$(!0),Q(null)))};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[]),i.useEffect((function(){if(!s){var e=b({renderFloatingIsland:B,supercoins:l});console.log("l1130 shouldRenderFloatingIsland called with renderFloatingIsland value",B,"and supercoins value",l,"returned value",e);var n,i="number"==typeof S&&S>=x&&!e;return console.log("l1130 renderSupercoinExpiry called with supercoinsExpiryCount value",S,"and shouldRender value",e,"returned value",i),N(i),e&&sessionStorage.setItem("disable_floater","true"),e&&!X?(console.log("l1130 setChipAnimationType called with entry"),Q("entry"),n=setTimeout((function(){console.log("l1130 setRenderSuperCoinIsland called with true"),O(!0)}),1500)):(console.log("l1130 setStartWalletAnimation called with true"),E&&K(!0)),function(){clearTimeout(n)}}}),[l,S,s]),i.useEffect((function(){if(console.log("l1130 useEffect called with renderFloatingIsland value",B,"and renderSuperCoinIsland value",D),B&&D){var e=setTimeout((function(){sessionStorage.getItem(p)||(console.log("l1130 setRenderSuperCoinIsland called with false"),O(!1),Q("exit"),K(!0))}),y.cutoffTimeInMs);return function(){clearTimeout(e)}}}),[]),i.useEffect((function(){var n;if("number"==typeof l&&l>=0&&!s){_.action_event_name;var i=_.impression_event_name,r=e.__rest(_,["action_event_name","impression_event_name"]);a.ravenSDKTrigger(null!==(n=i)&&void 0!==n?n:"u_impression",e.__assign({action_name:"supercoin_pill_impression",page_name:"unified_homepage",supercoin_balance:l,u_utm_source:A,supercoinsExpiryCount:S||"N/A"},r))}}),[s]),i.useEffect((function(){if(q&&!(P>=f)){var e=setTimeout((function(){H(!0),console.log("l1130 setIsAnimating called with true");var e=setTimeout((function(){H(!1),console.log("l1130 setIsAnimating called with false");var e=P+1;Y(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),v);return function(){return clearTimeout(e)}}),0===P?h:g);return function(){return clearTimeout(e)}}}),[q,P]),s||!D&&!M)return n.jsx("div",e.__assign({className:c.supercoinsBalance},{children:n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(o.Shimmer,{width:18,height:18,type:"rounded"}),n.jsx(o.Shimmer,{width:44,height:18,type:"rounded"})]}))}));if(!J)return null;var oe=q?"HM4":"B2",ae=q?c.supercoinsExpiryPill:c.supercoinsBalance,te=q?c.supercoinBurnExpiryColor:"";return M?(console.log("l1130 startWalletAnimation called with true"),n.jsx(I,{walletBalance:j,supercoinBalance:Number(l),handleClick:re,chipWidthRef:ee})):n.jsxs("div",e.__assign({style:{position:"relative"}},{children:[n.jsx("div",e.__assign({ref:function(e){var n;ee.current=null!==(n=null==e?void 0:e.offsetWidth)&&void 0!==n?n:0,console.log("l1130 chipWidthRef called with offsetWidth",null==e?void 0:e.offsetWidth)},className:"".concat(ae," ").concat(ne),onClick:re},{children:n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx("img",{src:u,alt:"supercoin_icon",width:18,height:18}),n.jsxs("div",e.__assign({className:c.supercoinChipWrapper},{children:[n.jsx(r.Typography,e.__assign({variant:oe,className:[ie,c.supercoinBurnTextAlign,te].join(" ")},{children:G?S:l})),q&&n.jsx(r.Typography,e.__assign({variant:"HM4",className:"".concat(c.supercoinExpiryText," ").concat(G?c.supercoinExpiryAnimating:"")},{children:"expiring soon"}))]}))]}))})),D&&!X&&n.jsx("div",e.__assign({className:c.superCoinsFloatingIslandContainer},{children:n.jsx(i.Suspense,e.__assign({fallback:n.jsx(n.Fragment,{})},{children:n.jsx(T,{superCoins:l,onAnimationStart:function(){return function(n){var i,r=n.supercoins,o=n.ravenPayload,t=void 0===o?{}:o,s=n.utmSource,l=void 0===s?"":s;t.action_event_name;var c=t.impression_event_name,u=e.__rest(t,["action_event_name","impression_event_name"]);a.ravenSDKTrigger(null!==(i=c)&&void 0!==i?i:"u_impression",e.__assign({action_name:"supercoin_banner_impression",page_name:"unified_homepage",supercoin_balance:r,u_utm_source:l},u)),sessionStorage.setItem("islandAnimationPlayed","true"),w()}({supercoins:l,ravenPayload:_,utmSource:A})},onAnimationEnd:function(){console.log("l1130 onAnimationEnd called with walletEnabled value",E),setTimeout((function(){console.log("l1130 setStartWalletAnimation setting to true from \n onAnimationEnd with walletEnabled value ".concat(E)),E&&K(!0)}),500),Q("exit")}})}))}))]}))};
2
2
  //# sourceMappingURL=ct-platform-supercoins-chip.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-supercoins-chip.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/SupercoinsChip/src/constants.ts","../packages/components/SupercoinsChip/src/utils/shouldRenderFloatingIsland.ts","../packages/components/SupercoinsChip/src/utils/onIslandAnimationStart.ts","../packages/components/SupercoinsChip/src/utils/setWalletCssVariables.ts","../packages/components/SupercoinsChip/src/walletAnimation/index.tsx","../packages/components/SupercoinsChip/src/SupercoinsChip.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","SUPERCOINS_CHIP_ICON","WALLET_CHIP_ICON","SUPERCOIN_ISLAND_RENDERED_FREQUENCY","SUPERCOIN_ISLAND_ANIMATION_PLAYED","SUPERCOIN_ISLAND_EXPIRATION_FREQUENCY","SUPERCOIN_EXPIRY_CONFIG","SUPERCOIN_FLOATING_ISLAND_CONFIG","requiredSupercoins","frequency","frequencyGapInDays","cutoffTimeInMs","isVisibleOnScroll","shouldRenderFloatingIsland","_a","expiry","renderFloatingIsland","supercoins","getQueryParam","localStorage","getItem","parseInt","getIslandShownFrequency","expiryEpoch","Math","floor","Date","now","removeItem","sessionStorage","incrementAnimationPlayedFrequency","currentFrequency","setItem","toString","widthByNumberOfCharactersMap","SupercoinChip","supercoinBalance","_jsxs","className","styles","chipWrapper","children","_jsx","jsx","src","alt","width","height","__assign","chipTextWrapper","Typography","variant","textWrapper","WalletChip","walletBalance","WalletAnimation","handleClick","chipWidthRef","renderSupercoinPillOnAnimationEnd","wrapperAnimation","maxNumberOfCharacters","max","length","chipWidth","numberOfCharacters","ctx","querySelector","setProperty","concat","setWalletCSSVariables","_b","current","containerClass","onClick","pillContainer","LazySuperCoinsFloatingIsland","React","lazy","import","then","module","default","SupercoinsFloatingIsland","supercoinsLoading","supercoinBurnBalance","ravenPayload","onSupercoinsClick","supercoinsExpiryCount","_c","_d","walletEnabled","console","log","utmSource","useMemo","_e","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_f","animationCount","setAnimationCount","_g","isAnimating","setIsAnimating","_h","startWalletAnimation","setStartWalletAnimation","shouldRenderSupercoins","_j","renderSuperCoinIsland","setRenderSuperCoinIsland","_k","chipAnimationType","setChipAnimationType","_l","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","useRef","chipBackgroundAnimationClassname","supercoinsBalanceBackgroundColorShift","supercoinsBalanceBackgroundColorShift_exit","chipTextAnimationClassname","supercoinsBalanceTextColorShift","supercoinsBalanceTextColorShift_exit","handleSupercoinsClick","action_event_name","impression_event_name","restPayload","__rest","ravenSDKTrigger","action_name","page_name","supercoin_balance","u_utm_source","useEffect","Number","handleScroll","window","scrollY","addEventListener","removeEventListener","shouldRender","timeout","renderSupercoinExpiry","setTimeout","clearTimeout","startTimer","switchBackTimer","newCount","supercoinsBalance","jsxs","display","alignItems","gap","Shimmer","typographyVariant","chipClassName","supercoinsExpiryPill","expiryColorClass","supercoinBurnExpiryColor","position","offsetWidth","supercoinChipWrapper","supercoinBurnTextAlign","join","supercoinExpiryText","supercoinExpiryAnimating","superCoinsFloatingIslandContainer","Suspense","fallback","superCoins","onAnimationStart","onIslandAnimationStart","onAnimationEnd"],"mappings":"uRAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO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SAAA,CAAKV,UAAWC,EAAOiI,mCACnB,CAAA/H,SAAAC,EAAAA,IAAC+H,EAAAA,SAAQzH,EAAAA,SAAA,CAAC0H,SAAUhI,EAAAA,oBAChB,CAAAD,SAAAC,EAAAA,IAACiC,EAA4B,CACzBgG,WAAYvF,EACZwF,iBAAkB,WACd,OH/V1B,SAAiC9J,SACnCG,EAAUH,EAAAG,WACVuE,EAAiB1E,EAAAuE,aAAjBA,OAAe,IAAAG,EAAA,CAAE,EAAAA,EACjBC,EAAc3E,EAAA+E,UAAdA,OAAS,IAAAJ,EAAG,GAAEA,EAKVJ,EADqByC,sBAAEC,EACvB1C,EAD4C0C,sBAAKC,EACjDC,EAAAA,OAAA5C,EADE,CAAA,oBAAA,0BAEN6C,kBAAqD,QAApC5D,EAAAyD,SAAoC,IAAAzD,EAAAA,EAAA,2BACjD6D,YAAa,8BACbC,UAAW,mBACXC,kBAAmBpH,EACnBqH,aAAczC,GACXmC,IAIPnG,eAAeG,QAAQ,wBAAyB,QAGhDF,GACJ,CGyUgC+I,CAAuB,CACnB5J,WAAYmE,EACZC,aAAYA,EACZQ,UAASA,KAGjBiF,eAlTxB,WACInF,QAAQC,IACJ,uDACAF,GAEJuD,YAAW,WACPtD,QAAQC,IACJ,uHAC0CF,IAE1CA,GAAeiB,GAAwB,EAC9C,GAAE,KACHO,EAAqB,OACxB,aA4SL","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ct-platform-supercoins-chip.cjs.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/SupercoinsChip/src/constants.ts","../packages/components/SupercoinsChip/src/utils/shouldRenderFloatingIsland.ts","../packages/components/SupercoinsChip/src/utils/onIslandAnimationStart.ts","../packages/components/SupercoinsChip/src/utils/setWalletCssVariables.ts","../packages/components/SupercoinsChip/src/walletAnimation/index.tsx","../packages/components/SupercoinsChip/src/SupercoinsChip.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","SUPERCOINS_CHIP_ICON","WALLET_CHIP_ICON","SUPERCOIN_ISLAND_RENDERED_FREQUENCY","SUPERCOIN_ISLAND_ANIMATION_PLAYED","SUPERCOIN_ISLAND_EXPIRATION_FREQUENCY","SUPERCOIN_EXPIRY_CONFIG","SUPERCOIN_FLOATING_ISLAND_CONFIG","requiredSupercoins","frequency","frequencyGapInDays","cutoffTimeInMs","isVisibleOnScroll","shouldRenderFloatingIsland","_a","expiry","renderFloatingIsland","supercoins","getQueryParam","localStorage","getItem","parseInt","getIslandShownFrequency","expiryEpoch","Math","floor","Date","now","removeItem","sessionStorage","incrementAnimationPlayedFrequency","currentFrequency","setItem","toString","widthByNumberOfCharactersMap","SupercoinChip","supercoinBalance","_jsxs","className","styles","chipWrapper","children","_jsx","jsx","src","alt","width","height","__assign","chipTextWrapper","Typography","variant","textWrapper","WalletChip","walletBalance","WalletAnimation","handleClick","chipWidthRef","renderSupercoinPillOnAnimationEnd","wrapperAnimation","maxNumberOfCharacters","max","length","chipWidth","numberOfCharacters","ctx","querySelector","setProperty","concat","setWalletCSSVariables","_b","current","containerClass","onClick","pillContainer","LazySuperCoinsFloatingIsland","React","lazy","import","then","module","default","SupercoinsFloatingIsland","supercoinsLoading","supercoinBurnBalance","ravenPayload","onSupercoinsClick","supercoinsExpiryCount","_c","_d","walletEnabled","console","log","utmSource","useMemo","_e","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_f","animationCount","setAnimationCount","_g","isAnimating","setIsAnimating","_h","startWalletAnimation","setStartWalletAnimation","shouldRenderSupercoins","_j","renderSuperCoinIsland","setRenderSuperCoinIsland","_k","chipAnimationType","setChipAnimationType","_l","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","useRef","chipBackgroundAnimationClassname","supercoinsBalanceBackgroundColorShift","supercoinsBalanceBackgroundColorShift_exit","chipTextAnimationClassname","supercoinsBalanceTextColorShift","supercoinsBalanceTextColorShift_exit","handleSupercoinsClick","action_event_name","impression_event_name","restPayload","__rest","ravenSDKTrigger","action_name","page_name","supercoin_balance","u_utm_source","useEffect","Number","handleScroll","window","scrollY","addEventListener","removeEventListener","shouldRender","timeout","renderSupercoinExpiry","setTimeout","clearTimeout","startTimer","switchBackTimer","newCount","supercoinsBalance","jsxs","display","alignItems","gap","Shimmer","typographyVariant","chipClassName","supercoinsExpiryPill","expiryColorClass","supercoinBurnExpiryColor","position","offsetWidth","supercoinChipWrapper","supercoinBurnTextAlign","join","supercoinExpiryText","supercoinExpiryAnimating","superCoinsFloatingIslandContainer","Suspense","fallback","superCoins","onAnimationStart","onIslandAnimationStart","onAnimationEnd"],"mappings":"uRAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,8hICzBO,IAAMe,EACT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QzH,EAAAA,SAAA,CAAC0H,SAAUhI,EAAAA,oBAChB,CAAAD,SAAAC,EAAAA,IAACiC,EAA4B,CACzBgG,WAAYvF,EACZwF,iBAAkB,WACd,OHhW1B,SAAiC9J,SACnCG,EAAUH,EAAAG,WACVuE,EAAiB1E,EAAAuE,aAAjBA,OAAe,IAAAG,EAAA,CAAE,EAAAA,EACjBC,EAAc3E,EAAA+E,UAAdA,OAAS,IAAAJ,EAAG,GAAEA,EAKVJ,EADqByC,sBAAEC,EACvB1C,EAD4C0C,sBAAKC,EACjDC,EAAAA,OAAA5C,EADE,CAAA,oBAAA,0BAEN6C,kBAAqD,QAApC5D,EAAAyD,SAAoC,IAAAzD,EAAAA,EAAA,2BACjD6D,YAAa,8BACbC,UAAW,mBACXC,kBAAmBpH,EACnBqH,aAAczC,GACXmC,IAIPnG,eAAeG,QAAQ,wBAAyB,QAGhDF,GACJ,CG0UgC+I,CAAuB,CACnB5J,WAAYmE,EACZC,aAAYA,EACZQ,UAASA,KAGjBiF,eAnTxB,WACInF,QAAQC,IACJ,uDACAF,GAEJuD,YAAW,WACPtD,QAAQC,IACJ,uHAC0CF,IAE1CA,GAAeiB,GAAwB,EAC9C,GAAE,KACHO,EAAqB,OACxB,aA6SL","x_google_ignoreList":[0]}
@@ -1,2 +1,2 @@
1
- import{__rest as e,__assign as n}from"tslib";import{jsx as i,jsxs as o,Fragment as r}from"react/jsx-runtime";import t,{useMemo as a,useState as l,useRef as s,useEffect as c,Suspense as u}from"react";import{Typography as d}from"@cleartrip/ct-design-typography";import{Shimmer as p}from"@cleartrip/ct-platform-shimmer";import{getQueryParam as _,ravenSDKTrigger as m}from"@cleartrip/ct-platform-utils";function f(e,n){void 0===n&&(n={});var i=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var x={supercoinsBalance:"index-module_supercoinsBalance__w9srh",supercoinsExpiryPill:"index-module_supercoinsExpiryPill__v4w06",supercoinChipWrapper:"index-module_supercoinChipWrapper__QPdUS",supercoinBurnTextAlign:"index-module_supercoinBurnTextAlign__g-go5",supercoinBurnExpiryColor:"index-module_supercoinBurnExpiryColor__FTFjA",supercoinExpiryText:"index-module_supercoinExpiryText__rkVbG",supercoinExpiryAnimating:"index-module_supercoinExpiryAnimating__Gdq0n",superCoinsFloatingIslandContainer:"index-module_superCoinsFloatingIslandContainer__5FNNa",supercoinsBalanceBackgroundColorShift:"index-module_supercoinsBalanceBackgroundColorShift__r6YWa",supercoins_balance_background_color_shift:"index-module_supercoins_balance_background_color_shift__1NHEU",supercoinsBalanceTextColorShift:"index-module_supercoinsBalanceTextColorShift__y7vva",supercoins_balance_text_color_shift:"index-module_supercoins_balance_text_color_shift__V8yxU",supercoinsBalanceBackgroundColorShift_exit:"index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ",supercoins_balance_background_color_shift_exit:"index-module_supercoins_balance_background_color_shift_exit__qAHuv",supercoinsBalanceTextColorShift_exit:"index-module_supercoinsBalanceTextColorShift_exit__JKt90",supercoins_balance_text_color_shift_exit:"index-module_supercoins_balance_text_color_shift_exit__rluZH",supercoin_chip_loading_shimmer:"index-module_supercoin_chip_loading_shimmer__0jquY",supercoins_balance_background_shimmer:"index-module_supercoins_balance_background_shimmer__2lOFp"};f('.index-module_supercoinsBalance__w9srh{background-color:#fff;border:1px solid #e6e6e6;border-radius:16px;display:inline-block;overflow:hidden;padding:6px 8px}.index-module_supercoinsExpiryPill__v4w06{background-color:#fbefef;border:1.5px solid #c83232;border-radius:16px;display:inline-block;overflow:hidden;padding:6px 0 6px 8px}.index-module_supercoinChipWrapper__QPdUS{align-items:center;display:flex;justify-content:center;padding:0 4px}.index-module_supercoinBurnTextAlign__g-go5{line-height:18px;margin-right:4px}.index-module_supercoinBurnExpiryColor__FTFjA{color:#c83232!important}.index-module_supercoinExpiryText__rkVbG{color:#c83232!important;display:inline-block;line-height:18px;opacity:0;overflow:hidden;transition:width .5s ease-in-out,opacity .5s ease-in-out;white-space:nowrap;width:0}.index-module_supercoinExpiryAnimating__Gdq0n{opacity:1;width:97px}.index-module_superCoinsFloatingIslandContainer__5FNNa{margin-left:100%;position:relative;width:1px}.index-module_supercoinsBalanceBackgroundColorShift__r6YWa{animation:index-module_supercoins_balance_background_color_shift__1NHEU .6s forwards;overflow:hidden;position:relative}.index-module_supercoinsBalanceTextColorShift__y7vva{animation:index-module_supercoins_balance_text_color_shift__V8yxU .6s forwards}.index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ{animation:index-module_supercoins_balance_background_color_shift_exit__qAHuv .6s forwards;overflow:hidden;position:relative}.index-module_supercoinsBalanceTextColorShift_exit__JKt90{animation:index-module_supercoins_balance_text_color_shift_exit__rluZH .6s forwards}.index-module_supercoinsBalanceBackgroundColorShift__r6YWa:before{animation:index-module_supercoin_chip_loading_shimmer__0jquY .4s ease-in .5s;background:hsla(0,0%,100%,.8);content:"";height:64px;left:-30%;position:absolute;top:-10px;transform:rotate(25deg);width:8px}@keyframes index-module_supercoin_chip_loading_shimmer__0jquY{0%{left:-30%}to{left:120%}}@keyframes index-module_supercoins_balance_background_color_shift__1NHEU{0%{background-color:rgba(0,62,162,.1)}to{background-color:#003ea2}}@keyframes index-module_supercoins_balance_background_color_shift_exit__qAHuv{0%{background-color:#003ea2}to{background-color:#fff}}@keyframes index-module_supercoins_balance_text_color_shift__V8yxU{0%{color:#000}to{color:#fff}}@keyframes index-module_supercoins_balance_text_color_shift_exit__rluZH{0%{color:#fff}to{color:#000}}@keyframes index-module_supercoins_balance_background_shimmer__2lOFp{0%{background-color:rgba(0,62,162,.1)}to{background-color:#003ea2}}');var g="https://rukmini-ct.flixcart.com/f_auto,q_auto,dpr_2/offermgmt-prod/offermgmt/images/banner/supercoins-chip-icon.png",h="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/wallet-pill-icon.png",v="island_rendered_frquency",y="islandAnimationPlayed",b="island_expiration_frquency",w=5,S=2,B=2e3,C=500,k=1500,I={requiredSupercoins:50,frequency:1,frequencyGapInDays:1,cutoffTimeInMs:5e3,isVisibleOnScroll:!1};function E(e){var n,i=e.renderFloatingIsland,o=e.supercoins;if(!i)return!1;if(o<I.requiredSupercoins)return!1;if(!("true"===_("isMobileApp")))return!1;if(function(){var e=localStorage.getItem(v);return e&&"number"==typeof parseInt(e)?parseInt(e):0}()>=I.frequency){var r=(n=localStorage.getItem(b))&&"number"==typeof parseInt(n)?parseInt(n):null;return!r||!(r>Math.floor(Date.now()/1e3))&&(localStorage.removeItem(v),localStorage.removeItem(b),!0)}return!sessionStorage.getItem(y)}function T(){var e=localStorage.getItem(v);e||(e="0");var n=parseInt(e)+1;if(localStorage.setItem(v,n.toString()),n>=I.frequency){var i=Math.floor(Date.now()/1e3)+86400*I.frequencyGapInDays;localStorage.setItem(b,i.toString())}}var A={chipWrapper:"index-module_chipWrapper__EwpUk",chipTextWrapper:"index-module_chipTextWrapper__Uburn",textWrapper:"index-module_textWrapper__BysJP",pillContainer:"index-module_pillContainer__bz7P4","width-animation":"index-module_width-animation__Ap-Ga",test:"index-module_test__KekL9","spring-up-wallet":"index-module_spring-up-wallet__GJrXW","spring-up1":"index-module_spring-up1__OLe4L","spring-up-wallet-sc":"index-module_spring-up-wallet-sc__KKKf0","spring-up2":"index-module_spring-up2__SIbCp"};f(".index-module_chipWrapper__EwpUk{align-items:center;display:flex;gap:4px;margin-bottom:20px;text-align:center}.index-module_chipTextWrapper__Uburn{align-items:center;display:flex;justify-content:center;padding:0 4px;text-align:center;width:100%}.index-module_textWrapper__BysJP{margin-right:4px}.index-module_pillContainer__bz7P4{background-color:#fff;border:1px solid #e6e6e6;border-radius:16px;box-sizing:border-box;display:inline-block;overflow:hidden;padding:5px 8px}@keyframes index-module_spring-up1__OLe4L{0%{transform:translateY(0)}60%{transform:translateY(-44px)}90%{transform:translateY(-40px)}to{transform:translateY(-40px)}}@keyframes index-module_spring-up2__SIbCp{0%{transform:translateY(-40px)}60%{transform:translateY(-84px)}90%{transform:translateY(-80px)}to{transform:translateY(-80px)}}@keyframes index-module_width-animation__Ap-Ga{0%{width:var(--wallet-initial-width)}to{width:var(--wallet-final-width)}}.index-module_width-animation__Ap-Ga{animation:index-module_test__KekL9 .7s ease-in-out forwards}.index-module_spring-up-wallet__GJrXW{animation:index-module_spring-up1__OLe4L .7s ease-in-out 2s forwards}.index-module_spring-up-wallet-sc__KKKf0{animation:index-module_spring-up1__OLe4L .7s ease-in-out 2s forwards,index-module_spring-up2__SIbCp .7s ease-in-out 5s forwards}");var W={2:58,3:66,4:74,5:82,6:90,7:120};function N(e){var r=e.supercoinBalance;return o("div",n({className:A.chipWrapper},{children:[i("img",{src:g,alt:"supercoin_icon",width:18,height:18}),i("div",n({className:A.chipTextWrapper},{children:i(d,n({variant:"B2",className:A.textWrapper},{children:r}))}))]}))}function q(e){var r=e.walletBalance;return o("div",n({className:A.chipWrapper},{children:[i("img",{src:h,alt:"supercoin_icon",width:18,height:18}),i("div",n({className:A.chipTextWrapper},{children:o(d,n({variant:"B2",className:A.textWrapper},{children:["₹",r]}))}))]}))}function F(e){var r,t=e.supercoinBalance,a=e.walletBalance,l=e.handleClick,s=e.chipWidthRef,c=0===a&&t>0||0===t&&0===a,u=c?A["spring-up-wallet-sc"]:A["spring-up-wallet"],d=Math.max(a.toString().length,t.toString().length)+1;!function(e,n){var i=document.querySelector(":root");null==i||i.style.setProperty("--wallet-initial-width","".concat(e,"px"));var o=W[n];null==i||i.style.setProperty("--wallet-final-width","".concat(Math.max(o,e),"px"))}(null!==(r=null==s?void 0:s.current)&&void 0!==r?r:0,d);var p=0===(null==s?void 0:s.current)?"auto":"".concat(null==s?void 0:s.current,"px"),_=0===(null==s?void 0:s.current)?"":A["width-animation"];return i("div",n({onClick:l},{children:i("div",n({className:"".concat(A.pillContainer," ").concat(_),style:{height:"32px",width:p}},{children:o("div",n({className:u},{children:[i(N,{supercoinBalance:t}),i(q,{walletBalance:a}),c?i(N,{supercoinBalance:t}):null]}))}))}))}var P=t.lazy((function(){return import("@cleartrip/ct-platform-supercoins-floating-island").then((function(e){return{default:e.SupercoinsFloatingIsland}}))})),Y=function(t){var f=t.supercoinsLoading,h=t.supercoinBurnBalance,v=t.ravenPayload,b=void 0===v?{}:v,A=t.onSupercoinsClick,W=t.supercoinsExpiryCount,N=t.renderFloatingIsland,q=void 0===N||N,Y=t.walletEnabled,L=void 0!==Y&&Y,U=t.walletBalance;console.log("l1130 SupercoinsChip recieved props",{supercoinsLoading:f,supercoinBurnBalance:h,ravenPayload:b,onSupercoinsClick:A,supercoinsExpiryCount:W,renderFloatingIsland:q,walletEnabled:L,walletBalance:U});var H=a((function(){var e;return null!==(e=_("utm_source"))&&void 0!==e?e:"organic"}),[]),G=l(!1),K=G[0],j=G[1],M=l(0),J=M[0],O=M[1],R=l(!1),V=R[0],z=R[1],D=l(!1),Z=D[0],Q=D[1],X=a((function(){return"number"==typeof h&&h>=0&&!f}),[h,f]),$=l(!1),ee=$[0],ne=$[1],ie=l(null),oe=ie[0],re=ie[1],te=l(!1),ae=te[0],le=te[1],se=s(0),ce="entry"===oe?x.supercoinsBalanceBackgroundColorShift:"exit"===oe?x.supercoinsBalanceBackgroundColorShift_exit:"",ue="entry"===oe?x.supercoinsBalanceTextColorShift:"exit"===oe?x.supercoinsBalanceTextColorShift_exit:"";function de(){var i;A&&"function"==typeof A&&A();var o=b.action_event_name;b.impression_event_name;var r=e(b,["action_event_name","impression_event_name"]);m(null!==(i=o)&&void 0!==i?i:"u_ui_action",n({action_name:"supercoin_icon_click",page_name:"unified_homepage",supercoin_balance:h,u_utm_source:H},r))}if(c((function(){O(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(y)||(console.log("setHasScrolledBeforeAnimation called"),le(!0),re(null)))};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[]),c((function(){var e=E({renderFloatingIsland:q,supercoins:h});console.log("l1130 shouldRenderFloatingIsland called with renderFloatingIsland value",q,"and supercoins value",h,"returned value",e);var n,i="number"==typeof W&&W>=w&&!e;return console.log("l1130 renderSupercoinExpiry called with supercoinsExpiryCount value",W,"and shouldRender value",e,"returned value",i),j(i),e&&sessionStorage.setItem("disable_floater","true"),e&&!ae?(console.log("l1130 setChipAnimationType called with entry"),re("entry"),n=setTimeout((function(){console.log("l1130 setRenderSuperCoinIsland called with true"),ne(!0)}),1500)):(console.log("l1130 setStartWalletAnimation called with true"),L&&Q(!0)),function(){clearTimeout(n)}}),[h,W]),c((function(){if(console.log("l1130 useEffect called with renderFloatingIsland value",q,"and renderSuperCoinIsland value",ee),q&&ee){var e=setTimeout((function(){sessionStorage.getItem(y)||(console.log("l1130 setRenderSuperCoinIsland called with false"),ne(!1),re("exit"),Q(!0))}),I.cutoffTimeInMs);return function(){clearTimeout(e)}}}),[]),c((function(){var i;if("number"==typeof h&&h>=0&&!f){b.action_event_name;var o=b.impression_event_name,r=e(b,["action_event_name","impression_event_name"]);m(null!==(i=o)&&void 0!==i?i:"u_impression",n({action_name:"supercoin_pill_impression",page_name:"unified_homepage",supercoin_balance:h,u_utm_source:H,supercoinsExpiryCount:W||"N/A"},r))}}),[f]),c((function(){if(K&&!(J>=S)){var e=setTimeout((function(){z(!0),console.log("l1130 setIsAnimating called with true");var e=setTimeout((function(){z(!1),console.log("l1130 setIsAnimating called with false");var e=J+1;O(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),k);return function(){return clearTimeout(e)}}),0===J?C:B);return function(){return clearTimeout(e)}}}),[K,J]),f||!ee&&!Z)return i("div",n({className:x.supercoinsBalance},{children:o("div",n({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[i(p,{width:18,height:18,type:"rounded"}),i(p,{width:44,height:18,type:"rounded"})]}))}));if(!X)return null;var pe=K?"HM4":"B2",_e=K?x.supercoinsExpiryPill:x.supercoinsBalance,me=K?x.supercoinBurnExpiryColor:"";return Z?(console.log("l1130 startWalletAnimation called with true"),i(F,{walletBalance:U,supercoinBalance:Number(h),handleClick:de,chipWidthRef:se})):o("div",n({style:{position:"relative"}},{children:[i("div",n({ref:function(e){var n;se.current=null!==(n=null==e?void 0:e.offsetWidth)&&void 0!==n?n:0,console.log("l1130 chipWidthRef called with offsetWidth",null==e?void 0:e.offsetWidth)},className:"".concat(_e," ").concat(ce),onClick:de},{children:o("div",n({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[i("img",{src:g,alt:"supercoin_icon",width:18,height:18}),o("div",n({className:x.supercoinChipWrapper},{children:[i(d,n({variant:pe,className:[ue,x.supercoinBurnTextAlign,me].join(" ")},{children:V?W:h})),K&&i(d,n({variant:"HM4",className:"".concat(x.supercoinExpiryText," ").concat(V?x.supercoinExpiryAnimating:"")},{children:"expiring soon"}))]}))]}))})),ee&&!ae&&i("div",n({className:x.superCoinsFloatingIslandContainer},{children:i(u,n({fallback:i(r,{})},{children:i(P,{superCoins:h,onAnimationStart:function(){return function(i){var o,r=i.supercoins,t=i.ravenPayload,a=void 0===t?{}:t,l=i.utmSource,s=void 0===l?"":l;a.action_event_name;var c=a.impression_event_name,u=e(a,["action_event_name","impression_event_name"]);m(null!==(o=c)&&void 0!==o?o:"u_impression",n({action_name:"supercoin_banner_impression",page_name:"unified_homepage",supercoin_balance:r,u_utm_source:s},u)),sessionStorage.setItem("islandAnimationPlayed","true"),T()}({supercoins:h,ravenPayload:b,utmSource:H})},onAnimationEnd:function(){console.log("l1130 onAnimationEnd called with walletEnabled value",L),setTimeout((function(){console.log("l1130 setStartWalletAnimation setting to true from \n onAnimationEnd with walletEnabled value ".concat(L)),L&&Q(!0)}),500),re("exit")}})}))}))]}))};export{Y as SupercoinsChip};
1
+ import{__rest as e,__assign as n}from"tslib";import{jsx as i,jsxs as o,Fragment as r}from"react/jsx-runtime";import t,{useMemo as a,useState as l,useRef as s,useEffect as c,Suspense as u}from"react";import{Typography as d}from"@cleartrip/ct-design-typography";import{Shimmer as p}from"@cleartrip/ct-platform-shimmer";import{getQueryParam as _,ravenSDKTrigger as m}from"@cleartrip/ct-platform-utils";function f(e,n){void 0===n&&(n={});var i=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var x={supercoinsBalance:"index-module_supercoinsBalance__w9srh",supercoinsExpiryPill:"index-module_supercoinsExpiryPill__v4w06",supercoinChipWrapper:"index-module_supercoinChipWrapper__QPdUS",supercoinBurnTextAlign:"index-module_supercoinBurnTextAlign__g-go5",supercoinBurnExpiryColor:"index-module_supercoinBurnExpiryColor__FTFjA",supercoinExpiryText:"index-module_supercoinExpiryText__rkVbG",supercoinExpiryAnimating:"index-module_supercoinExpiryAnimating__Gdq0n",superCoinsFloatingIslandContainer:"index-module_superCoinsFloatingIslandContainer__5FNNa",supercoinsBalanceBackgroundColorShift:"index-module_supercoinsBalanceBackgroundColorShift__r6YWa",supercoins_balance_background_color_shift:"index-module_supercoins_balance_background_color_shift__1NHEU",supercoinsBalanceTextColorShift:"index-module_supercoinsBalanceTextColorShift__y7vva",supercoins_balance_text_color_shift:"index-module_supercoins_balance_text_color_shift__V8yxU",supercoinsBalanceBackgroundColorShift_exit:"index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ",supercoins_balance_background_color_shift_exit:"index-module_supercoins_balance_background_color_shift_exit__qAHuv",supercoinsBalanceTextColorShift_exit:"index-module_supercoinsBalanceTextColorShift_exit__JKt90",supercoins_balance_text_color_shift_exit:"index-module_supercoins_balance_text_color_shift_exit__rluZH",supercoin_chip_loading_shimmer:"index-module_supercoin_chip_loading_shimmer__0jquY",supercoins_balance_background_shimmer:"index-module_supercoins_balance_background_shimmer__2lOFp"};f('.index-module_supercoinsBalance__w9srh{background-color:#fff;border:1px solid #e6e6e6;border-radius:16px;display:inline-block;overflow:hidden;padding:6px 8px}.index-module_supercoinsExpiryPill__v4w06{background-color:#fbefef;border:1.5px solid #c83232;border-radius:16px;display:inline-block;overflow:hidden;padding:6px 0 6px 8px}.index-module_supercoinChipWrapper__QPdUS{align-items:center;display:flex;justify-content:center;padding:0 4px}.index-module_supercoinBurnTextAlign__g-go5{line-height:18px;margin-right:4px}.index-module_supercoinBurnExpiryColor__FTFjA{color:#c83232!important}.index-module_supercoinExpiryText__rkVbG{color:#c83232!important;display:inline-block;line-height:18px;opacity:0;overflow:hidden;transition:width .5s ease-in-out,opacity .5s ease-in-out;white-space:nowrap;width:0}.index-module_supercoinExpiryAnimating__Gdq0n{opacity:1;width:97px}.index-module_superCoinsFloatingIslandContainer__5FNNa{margin-left:100%;position:relative;width:1px}.index-module_supercoinsBalanceBackgroundColorShift__r6YWa{animation:index-module_supercoins_balance_background_color_shift__1NHEU .6s forwards;overflow:hidden;position:relative}.index-module_supercoinsBalanceTextColorShift__y7vva{animation:index-module_supercoins_balance_text_color_shift__V8yxU .6s forwards}.index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ{animation:index-module_supercoins_balance_background_color_shift_exit__qAHuv .6s forwards;overflow:hidden;position:relative}.index-module_supercoinsBalanceTextColorShift_exit__JKt90{animation:index-module_supercoins_balance_text_color_shift_exit__rluZH .6s forwards}.index-module_supercoinsBalanceBackgroundColorShift__r6YWa:before{animation:index-module_supercoin_chip_loading_shimmer__0jquY .4s ease-in .5s;background:hsla(0,0%,100%,.8);content:"";height:64px;left:-30%;position:absolute;top:-10px;transform:rotate(25deg);width:8px}@keyframes index-module_supercoin_chip_loading_shimmer__0jquY{0%{left:-30%}to{left:120%}}@keyframes index-module_supercoins_balance_background_color_shift__1NHEU{0%{background-color:rgba(0,62,162,.1)}to{background-color:#003ea2}}@keyframes index-module_supercoins_balance_background_color_shift_exit__qAHuv{0%{background-color:#003ea2}to{background-color:#fff}}@keyframes index-module_supercoins_balance_text_color_shift__V8yxU{0%{color:#000}to{color:#fff}}@keyframes index-module_supercoins_balance_text_color_shift_exit__rluZH{0%{color:#fff}to{color:#000}}@keyframes index-module_supercoins_balance_background_shimmer__2lOFp{0%{background-color:rgba(0,62,162,.1)}to{background-color:#003ea2}}');var g="https://rukmini-ct.flixcart.com/f_auto,q_auto,dpr_2/offermgmt-prod/offermgmt/images/banner/supercoins-chip-icon.png",h="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/wallet-pill-icon.png",v="island_rendered_frquency",y="islandAnimationPlayed",b="island_expiration_frquency",w=5,S=2,B=2e3,C=500,k=1500,I={requiredSupercoins:50,frequency:1,frequencyGapInDays:1,cutoffTimeInMs:5e3,isVisibleOnScroll:!1};function E(e){var n,i=e.renderFloatingIsland,o=e.supercoins;if(!i)return!1;if(o<I.requiredSupercoins)return!1;if(!("true"===_("isMobileApp")))return!1;if(function(){var e=localStorage.getItem(v);return e&&"number"==typeof parseInt(e)?parseInt(e):0}()>=I.frequency){var r=(n=localStorage.getItem(b))&&"number"==typeof parseInt(n)?parseInt(n):null;return!r||!(r>Math.floor(Date.now()/1e3))&&(localStorage.removeItem(v),localStorage.removeItem(b),!0)}return!sessionStorage.getItem(y)}function T(){var e=localStorage.getItem(v);e||(e="0");var n=parseInt(e)+1;if(localStorage.setItem(v,n.toString()),n>=I.frequency){var i=Math.floor(Date.now()/1e3)+86400*I.frequencyGapInDays;localStorage.setItem(b,i.toString())}}var A={chipWrapper:"index-module_chipWrapper__EwpUk",chipTextWrapper:"index-module_chipTextWrapper__Uburn",textWrapper:"index-module_textWrapper__BysJP",pillContainer:"index-module_pillContainer__bz7P4","width-animation":"index-module_width-animation__Ap-Ga","spring-up-wallet":"index-module_spring-up-wallet__GJrXW","spring-up1":"index-module_spring-up1__OLe4L","spring-up-wallet-sc":"index-module_spring-up-wallet-sc__KKKf0","spring-up2":"index-module_spring-up2__SIbCp"};f(".index-module_chipWrapper__EwpUk{align-items:center;display:flex;gap:4px;margin-bottom:20px;text-align:center}.index-module_chipTextWrapper__Uburn{align-items:center;display:flex;justify-content:center;padding:0 4px;text-align:center;width:100%}.index-module_textWrapper__BysJP{margin-right:4px}.index-module_pillContainer__bz7P4{background-color:#fff;border:1px solid #e6e6e6;border-radius:16px;box-sizing:border-box;display:inline-block;overflow:hidden;padding:5px 8px}@keyframes index-module_spring-up1__OLe4L{0%{transform:translateY(0)}60%{transform:translateY(-44px)}90%{transform:translateY(-40px)}to{transform:translateY(-40px)}}@keyframes index-module_spring-up2__SIbCp{0%{transform:translateY(-40px)}60%{transform:translateY(-84px)}90%{transform:translateY(-80px)}to{transform:translateY(-80px)}}@keyframes index-module_width-animation__Ap-Ga{0%{width:var(--wallet-initial-width)}to{width:var(--wallet-final-width)}}.index-module_width-animation__Ap-Ga{animation:index-module_width-animation__Ap-Ga .7s ease-in-out forwards}.index-module_spring-up-wallet__GJrXW{animation:index-module_spring-up1__OLe4L .7s ease-in-out 2s forwards}.index-module_spring-up-wallet-sc__KKKf0{animation:index-module_spring-up1__OLe4L .7s ease-in-out 2s forwards,index-module_spring-up2__SIbCp .7s ease-in-out 5s forwards}");var W={2:58,3:66,4:74,5:82,6:90,7:120};function N(e){var r=e.supercoinBalance;return o("div",n({className:A.chipWrapper},{children:[i("img",{src:g,alt:"supercoin_icon",width:18,height:18}),i("div",n({className:A.chipTextWrapper},{children:i(d,n({variant:"B2",className:A.textWrapper},{children:r}))}))]}))}function q(e){var r=e.walletBalance;return o("div",n({className:A.chipWrapper},{children:[i("img",{src:h,alt:"supercoin_icon",width:18,height:18}),i("div",n({className:A.chipTextWrapper},{children:o(d,n({variant:"B2",className:A.textWrapper},{children:["₹",r]}))}))]}))}function F(e){var r,t=e.supercoinBalance,a=e.walletBalance,l=e.handleClick,s=e.chipWidthRef,c=0===a&&t>0||0===t&&0===a,u=c?A["spring-up-wallet-sc"]:A["spring-up-wallet"],d=Math.max(a.toString().length,t.toString().length)+1;!function(e,n){var i=document.querySelector(":root");null==i||i.style.setProperty("--wallet-initial-width","".concat(e,"px"));var o=W[n];null==i||i.style.setProperty("--wallet-final-width","".concat(Math.max(o,e),"px"))}(null!==(r=null==s?void 0:s.current)&&void 0!==r?r:0,d);var p=0===(null==s?void 0:s.current)?"auto":"".concat(null==s?void 0:s.current,"px"),_=0===(null==s?void 0:s.current)?"":A["width-animation"];return i("div",n({onClick:l},{children:i("div",n({className:"".concat(A.pillContainer," ").concat(_),style:{height:"32px",width:p}},{children:o("div",n({className:u},{children:[i(N,{supercoinBalance:t}),i(q,{walletBalance:a}),c?i(N,{supercoinBalance:t}):null]}))}))}))}var P=t.lazy((function(){return import("@cleartrip/ct-platform-supercoins-floating-island").then((function(e){return{default:e.SupercoinsFloatingIsland}}))})),Y=function(t){var f=t.supercoinsLoading,h=t.supercoinBurnBalance,v=t.ravenPayload,b=void 0===v?{}:v,A=t.onSupercoinsClick,W=t.supercoinsExpiryCount,N=t.renderFloatingIsland,q=void 0===N||N,Y=t.walletEnabled,U=void 0!==Y&&Y,G=t.walletBalance;console.log("l1130 SupercoinsChip recieved props",{supercoinsLoading:f,supercoinBurnBalance:h,ravenPayload:b,onSupercoinsClick:A,supercoinsExpiryCount:W,renderFloatingIsland:q,walletEnabled:U,walletBalance:G});var H=a((function(){var e;return null!==(e=_("utm_source"))&&void 0!==e?e:"organic"}),[]),L=l(!1),j=L[0],M=L[1],J=l(0),K=J[0],O=J[1],R=l(!1),V=R[0],z=R[1],D=l(!1),Z=D[0],Q=D[1],X=a((function(){return"number"==typeof h&&h>=0&&!f}),[h,f]),$=l(!1),ee=$[0],ne=$[1],ie=l(null),oe=ie[0],re=ie[1],te=l(!1),ae=te[0],le=te[1],se=s(0),ce="entry"===oe?x.supercoinsBalanceBackgroundColorShift:"exit"===oe?x.supercoinsBalanceBackgroundColorShift_exit:"",ue="entry"===oe?x.supercoinsBalanceTextColorShift:"exit"===oe?x.supercoinsBalanceTextColorShift_exit:"";function de(){var i;A&&"function"==typeof A&&A();var o=b.action_event_name;b.impression_event_name;var r=e(b,["action_event_name","impression_event_name"]);m(null!==(i=o)&&void 0!==i?i:"u_ui_action",n({action_name:"supercoin_icon_click",page_name:"unified_homepage",supercoin_balance:h,u_utm_source:H},r))}if(c((function(){O(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(y)||(console.log("setHasScrolledBeforeAnimation called"),le(!0),re(null)))};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[]),c((function(){if(!f){var e=E({renderFloatingIsland:q,supercoins:h});console.log("l1130 shouldRenderFloatingIsland called with renderFloatingIsland value",q,"and supercoins value",h,"returned value",e);var n,i="number"==typeof W&&W>=w&&!e;return console.log("l1130 renderSupercoinExpiry called with supercoinsExpiryCount value",W,"and shouldRender value",e,"returned value",i),M(i),e&&sessionStorage.setItem("disable_floater","true"),e&&!ae?(console.log("l1130 setChipAnimationType called with entry"),re("entry"),n=setTimeout((function(){console.log("l1130 setRenderSuperCoinIsland called with true"),ne(!0)}),1500)):(console.log("l1130 setStartWalletAnimation called with true"),U&&Q(!0)),function(){clearTimeout(n)}}}),[h,W,f]),c((function(){if(console.log("l1130 useEffect called with renderFloatingIsland value",q,"and renderSuperCoinIsland value",ee),q&&ee){var e=setTimeout((function(){sessionStorage.getItem(y)||(console.log("l1130 setRenderSuperCoinIsland called with false"),ne(!1),re("exit"),Q(!0))}),I.cutoffTimeInMs);return function(){clearTimeout(e)}}}),[]),c((function(){var i;if("number"==typeof h&&h>=0&&!f){b.action_event_name;var o=b.impression_event_name,r=e(b,["action_event_name","impression_event_name"]);m(null!==(i=o)&&void 0!==i?i:"u_impression",n({action_name:"supercoin_pill_impression",page_name:"unified_homepage",supercoin_balance:h,u_utm_source:H,supercoinsExpiryCount:W||"N/A"},r))}}),[f]),c((function(){if(j&&!(K>=S)){var e=setTimeout((function(){z(!0),console.log("l1130 setIsAnimating called with true");var e=setTimeout((function(){z(!1),console.log("l1130 setIsAnimating called with false");var e=K+1;O(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),k);return function(){return clearTimeout(e)}}),0===K?C:B);return function(){return clearTimeout(e)}}}),[j,K]),f||!ee&&!Z)return i("div",n({className:x.supercoinsBalance},{children:o("div",n({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[i(p,{width:18,height:18,type:"rounded"}),i(p,{width:44,height:18,type:"rounded"})]}))}));if(!X)return null;var pe=j?"HM4":"B2",_e=j?x.supercoinsExpiryPill:x.supercoinsBalance,me=j?x.supercoinBurnExpiryColor:"";return Z?(console.log("l1130 startWalletAnimation called with true"),i(F,{walletBalance:G,supercoinBalance:Number(h),handleClick:de,chipWidthRef:se})):o("div",n({style:{position:"relative"}},{children:[i("div",n({ref:function(e){var n;se.current=null!==(n=null==e?void 0:e.offsetWidth)&&void 0!==n?n:0,console.log("l1130 chipWidthRef called with offsetWidth",null==e?void 0:e.offsetWidth)},className:"".concat(_e," ").concat(ce),onClick:de},{children:o("div",n({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[i("img",{src:g,alt:"supercoin_icon",width:18,height:18}),o("div",n({className:x.supercoinChipWrapper},{children:[i(d,n({variant:pe,className:[ue,x.supercoinBurnTextAlign,me].join(" ")},{children:V?W:h})),j&&i(d,n({variant:"HM4",className:"".concat(x.supercoinExpiryText," ").concat(V?x.supercoinExpiryAnimating:"")},{children:"expiring soon"}))]}))]}))})),ee&&!ae&&i("div",n({className:x.superCoinsFloatingIslandContainer},{children:i(u,n({fallback:i(r,{})},{children:i(P,{superCoins:h,onAnimationStart:function(){return function(i){var o,r=i.supercoins,t=i.ravenPayload,a=void 0===t?{}:t,l=i.utmSource,s=void 0===l?"":l;a.action_event_name;var c=a.impression_event_name,u=e(a,["action_event_name","impression_event_name"]);m(null!==(o=c)&&void 0!==o?o:"u_impression",n({action_name:"supercoin_banner_impression",page_name:"unified_homepage",supercoin_balance:r,u_utm_source:s},u)),sessionStorage.setItem("islandAnimationPlayed","true"),T()}({supercoins:h,ravenPayload:b,utmSource:H})},onAnimationEnd:function(){console.log("l1130 onAnimationEnd called with walletEnabled value",U),setTimeout((function(){console.log("l1130 setStartWalletAnimation setting to true from \n onAnimationEnd with walletEnabled value ".concat(U)),U&&Q(!0)}),500),re("exit")}})}))}))]}))};export{Y as SupercoinsChip};
2
2
  //# sourceMappingURL=ct-platform-supercoins-chip.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-platform-supercoins-chip.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/SupercoinsChip/src/constants.ts","../packages/components/SupercoinsChip/src/utils/shouldRenderFloatingIsland.ts","../packages/components/SupercoinsChip/src/utils/onIslandAnimationStart.ts","../packages/components/SupercoinsChip/src/utils/setWalletCssVariables.ts","../packages/components/SupercoinsChip/src/walletAnimation/index.tsx","../packages/components/SupercoinsChip/src/SupercoinsChip.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","SUPERCOINS_CHIP_ICON","WALLET_CHIP_ICON","SUPERCOIN_ISLAND_RENDERED_FREQUENCY","SUPERCOIN_ISLAND_ANIMATION_PLAYED","SUPERCOIN_ISLAND_EXPIRATION_FREQUENCY","SUPERCOIN_EXPIRY_CONFIG","SUPERCOIN_FLOATING_ISLAND_CONFIG","requiredSupercoins","frequency","frequencyGapInDays","cutoffTimeInMs","isVisibleOnScroll","shouldRenderFloatingIsland","_a","expiry","renderFloatingIsland","supercoins","getQueryParam","localStorage","getItem","parseInt","getIslandShownFrequency","expiryEpoch","Math","floor","Date","now","removeItem","sessionStorage","incrementAnimationPlayedFrequency","currentFrequency","setItem","toString","widthByNumberOfCharactersMap","SupercoinChip","supercoinBalance","_jsxs","className","styles","chipWrapper","children","_jsx","src","alt","width","height","__assign","chipTextWrapper","Typography","variant","textWrapper","WalletChip","walletBalance","WalletAnimation","handleClick","chipWidthRef","renderSupercoinPillOnAnimationEnd","wrapperAnimation","maxNumberOfCharacters","max","length","chipWidth","numberOfCharacters","ctx","querySelector","setProperty","concat","setWalletCSSVariables","_b","current","containerClass","onClick","pillContainer","LazySuperCoinsFloatingIsland","React","lazy","import","then","module","default","SupercoinsFloatingIsland","SupercoinsChip","supercoinsLoading","supercoinBurnBalance","ravenPayload","onSupercoinsClick","supercoinsExpiryCount","_c","_d","walletEnabled","console","log","utmSource","useMemo","_e","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_f","animationCount","setAnimationCount","_g","isAnimating","setIsAnimating","_h","startWalletAnimation","setStartWalletAnimation","shouldRenderSupercoins","_j","renderSuperCoinIsland","setRenderSuperCoinIsland","_k","chipAnimationType","setChipAnimationType","_l","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","useRef","chipBackgroundAnimationClassname","supercoinsBalanceBackgroundColorShift","supercoinsBalanceBackgroundColorShift_exit","chipTextAnimationClassname","supercoinsBalanceTextColorShift","supercoinsBalanceTextColorShift_exit","handleSupercoinsClick","action_event_name","impression_event_name","restPayload","__rest","ravenSDKTrigger","action_name","page_name","supercoin_balance","u_utm_source","useEffect","Number","handleScroll","window","scrollY","addEventListener","removeEventListener","shouldRender","timeout","renderSupercoinExpiry","setTimeout","clearTimeout","startTimer","switchBackTimer","newCount","supercoinsBalance","display","alignItems","gap","Shimmer","typographyVariant","chipClassName","supercoinsExpiryPill","expiryColorClass","supercoinBurnExpiryColor","position","offsetWidth","supercoinChipWrapper","supercoinBurnTextAlign","join","supercoinExpiryText","supercoinExpiryAnimating","superCoinsFloatingIslandContainer","Suspense","fallback","superCoins","onAnimationStart","onIslandAnimationStart","onAnimationEnd"],"mappings":"+YAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAAYL,GAGfA,EAAMM,WACRN,EAAMM,WAAWC,QAAUb,EAE3BM,EAAMK,YAAYR,SAASW,eAAed,GAnBW,CAqBzD,8hICzBO,IAAMe,EACT,sHAESC,EACT,4GAESC,EAAsC,2BAEtCC,EAAoC,wBAEpCC,EACT,6BAISC,EACkB,EADlBA,EAEK,EAFLA,EAGyB,IAHzBA,EAIkB,IAJlBA,EAKkB,KAGlBC,EAAmC,CAC5CC,mBAAoB,GACpBC,UAAW,EACXC,mBAAoB,EACpBC,eAAgB,IAChBC,mBAAmB,GCPC,SAAAC,EAA2BC,OALzCC,EAMNC,EAAoBF,EAAAE,qBACpBC,EAAUH,EAAAG,WAGV,IAAKD,EAAsB,OAAO,EAElC,GAAIC,EAAaV,EAAiCC,mBAC9C,OAAO,EAIX,KADqD,SAAjCU,EAAc,gBAChB,OAAO,EAIzB,GA5BJ,WACI,IAAMT,EAAYU,aAAaC,QAAQjB,GACvC,OAAKM,GAA4C,iBAAxBY,SAASZ,GAC3BY,SAASZ,GADkD,CAEtE,CAuBsBa,IACDf,EAAiC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PG,QAAQ,MACRZ,UAAW,GAAA6B,OAAG5B,EAAO8H,oBAAmB,KAAAlG,OAAIoC,EAAchE,EAAO+H,yBAA2B,KAGnF,CAAA7H,SAAA,8BAM5BqE,KAA0BM,IACvB1E,EAAA,MAAAK,EAAA,CAAKT,UAAWC,EAAOgI,mCACnB,CAAA9H,SAAAC,EAAC8H,EAAQzH,EAAA,CAAC0H,SAAU/H,SAChB,CAAAD,SAAAC,EAACgC,EAA4B,CACzBgG,WAAYtF,EACZuF,iBAAkB,WACd,OH/V1B,SAAiC7J,SACnCG,EAAUH,EAAAG,WACVuE,EAAiB1E,EAAAuE,aAAjBA,OAAe,IAAAG,EAAA,CAAE,EAAAA,EACjBC,EAAc3E,EAAA+E,UAAdA,OAAS,IAAAJ,EAAG,GAAEA,EAKVJ,EADqByC,sBAAEC,EACvB1C,EAD4C0C,sBAAKC,EACjDC,EAAA5C,EADE,CAAA,oBAAA,0BAEN6C,EAAqD,QAApC7D,EAAA0D,SAAoC,IAAA1D,EAAAA,EAAA,kBACjD8D,YAAa,8BACbC,UAAW,mBACXC,kBAAmBpH,EACnBqH,aAAczC,GACXmC,IAIPnG,eAAeG,QAAQ,wBAAyB,QAGhDF,GACJ,CGyUgC8I,CAAuB,CACnB3J,WAAYmE,EACZC,aAAYA,EACZQ,UAASA,KAGjBgF,eAlTxB,WACIlF,QAAQC,IACJ,uDACAF,GAEJuD,YAAW,WACPtD,QAAQC,IACJ,uHAC0CF,IAE1CA,GAAeiB,GAAwB,EAC9C,GAAE,KACHO,GAAqB,OACxB,aA4SL","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"ct-platform-supercoins-chip.esm.js","sources":["../../../../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js","../packages/components/SupercoinsChip/src/constants.ts","../packages/components/SupercoinsChip/src/utils/shouldRenderFloatingIsland.ts","../packages/components/SupercoinsChip/src/utils/onIslandAnimationStart.ts","../packages/components/SupercoinsChip/src/utils/setWalletCssVariables.ts","../packages/components/SupercoinsChip/src/walletAnimation/index.tsx","../packages/components/SupercoinsChip/src/SupercoinsChip.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n",null,null,null,null,null,null],"names":["styleInject","css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","SUPERCOINS_CHIP_ICON","WALLET_CHIP_ICON","SUPERCOIN_ISLAND_RENDERED_FREQUENCY","SUPERCOIN_ISLAND_ANIMATION_PLAYED","SUPERCOIN_ISLAND_EXPIRATION_FREQUENCY","SUPERCOIN_EXPIRY_CONFIG","SUPERCOIN_FLOATING_ISLAND_CONFIG","requiredSupercoins","frequency","frequencyGapInDays","cutoffTimeInMs","isVisibleOnScroll","shouldRenderFloatingIsland","_a","expiry","renderFloatingIsland","supercoins","getQueryParam","localStorage","getItem","parseInt","getIslandShownFrequency","expiryEpoch","Math","floor","Date","now","removeItem","sessionStorage","incrementAnimationPlayedFrequency","currentFrequency","setItem","toString","widthByNumberOfCharactersMap","SupercoinChip","supercoinBalance","_jsxs","className","styles","chipWrapper","children","_jsx","src","alt","width","height","__assign","chipTextWrapper","Typography","variant","textWrapper","WalletChip","walletBalance","WalletAnimation","handleClick","chipWidthRef","renderSupercoinPillOnAnimationEnd","wrapperAnimation","maxNumberOfCharacters","max","length","chipWidth","numberOfCharacters","ctx","querySelector","setProperty","concat","setWalletCSSVariables","_b","current","containerClass","onClick","pillContainer","LazySuperCoinsFloatingIsland","React","lazy","import","then","module","default","SupercoinsFloatingIsland","SupercoinsChip","supercoinsLoading","supercoinBurnBalance","ravenPayload","onSupercoinsClick","supercoinsExpiryCount","_c","_d","walletEnabled","console","log","utmSource","useMemo","_e","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_f","animationCount","setAnimationCount","_g","isAnimating","setIsAnimating","_h","startWalletAnimation","setStartWalletAnimation","shouldRenderSupercoins","_j","renderSuperCoinIsland","setRenderSuperCoinIsland","_k","chipAnimationType","setChipAnimationType","_l","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","useRef","chipBackgroundAnimationClassname","supercoinsBalanceBackgroundColorShift","supercoinsBalanceBackgroundColorShift_exit","chipTextAnimationClassname","supercoinsBalanceTextColorShift","supercoinsBalanceTextColorShift_exit","handleSupercoinsClick","action_event_name","impression_event_name","restPayload","__rest","ravenSDKTrigger","action_name","page_name","supercoin_balance","u_utm_source","useEffect","Number","handleScroll","window","scrollY","addEventListener","removeEventListener","shouldRender","timeout","renderSupercoinExpiry","setTimeout","clearTimeout","startTimer","switchBackTimer","newCount","supercoinsBalance","display","alignItems","gap","Shimmer","typographyVariant","chipClassName","supercoinsExpiryPill","expiryColorClass","supercoinBurnExpiryColor","position","offsetWidth","supercoinChipWrapper","supercoinBurnTextAlign","join","supercoinExpiryText","supercoinExpiryAnimating","superCoinsFloatingIslandContainer","Suspense","fallback","superCoins","onAnimationStart","onIslandAnimationStart","onAnimationEnd"],"mappings":"+YAAA,SAASA,EAAYC,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAKF,GAA2B,oBAAbG,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SACnCD,EAAME,KAAO,WAEI,QAAbN,GACEE,EAAKK,WACPL,EAAKM,aAAaJ,EAAOF,EAAKK,YAKhCL,EAAKO,YAA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,sBAAKC,EACjDC,EAAA5C,EADE,CAAA,oBAAA,0BAEN6C,EAAqD,QAApC7D,EAAA0D,SAAoC,IAAA1D,EAAAA,EAAA,kBACjD8D,YAAa,8BACbC,UAAW,mBACXC,kBAAmBpH,EACnBqH,aAAczC,GACXmC,IAIPnG,eAAeG,QAAQ,wBAAyB,QAGhDF,GACJ,CG0UgC8I,CAAuB,CACnB3J,WAAYmE,EACZC,aAAYA,EACZQ,UAASA,KAGjBgF,eAnTxB,WACIlF,QAAQC,IACJ,uDACAF,GAEJuD,YAAW,WACPtD,QAAQC,IACJ,uHAC0CF,IAE1CA,GAAeiB,GAAwB,EAC9C,GAAE,KACHO,GAAqB,OACxB,aA6SL","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-platform-supercoins-chip",
3
- "version": "2.2.0-beta.19",
3
+ "version": "2.2.0-beta.20",
4
4
  "description": "SuperCoins Chip Component",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/ct-platform-supercoins-chip.cjs.js",
@@ -11,9 +11,9 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "@cleartrip/ct-design-typography": "2.6.0",
14
- "@cleartrip/ct-platform-supercoins-floating-island": "2.2.0-beta.19",
15
- "@cleartrip/ct-platform-shimmer": "4.2.0-beta.19",
16
- "@cleartrip/ct-platform-utils": "4.2.0-beta.19"
14
+ "@cleartrip/ct-platform-utils": "4.2.0-beta.20",
15
+ "@cleartrip/ct-platform-supercoins-floating-island": "2.2.0-beta.20",
16
+ "@cleartrip/ct-platform-shimmer": "4.2.0-beta.20"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": ">=16.8.0",