@cleartrip/ct-platform-supercoins-chip 2.2.0-beta.17 → 2.2.0-beta.19
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/SupercoinsChip.d.ts.map +1 -1
- package/dist/ct-platform-supercoins-chip.cjs.js +1 -1
- package/dist/ct-platform-supercoins-chip.cjs.js.map +1 -1
- package/dist/ct-platform-supercoins-chip.esm.js +1 -1
- package/dist/ct-platform-supercoins-chip.esm.js.map +1 -1
- package/dist/utils/setWalletCssVariables.d.ts +2 -0
- package/dist/utils/setWalletCssVariables.d.ts.map +1 -0
- package/dist/utils/shouldRenderFloatingIsland.d.ts.map +1 -1
- package/dist/walletAnimation/index.d.ts +3 -1
- package/dist/walletAnimation/index.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupercoinsChip.d.ts","sourceRoot":"","sources":["../packages/components/SupercoinsChip/src/SupercoinsChip.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
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,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 s(e){return e&&e.__esModule?e:{default:e}}var t=s(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('@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");*{font-family:inter}.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:rgba(0,62,162,0)}}@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 _="https://rukmini-ct.flixcart.com/f_auto,q_auto,dpr_2/offermgmt-prod/offermgmt/images/banner/supercoins-chip-icon.png",u="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/wallet-pill-icon.png",p="island_rendered_frquency",d="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(){var e=localStorage.getItem(p);e||(e="0");var n=parseInt(e)+1;if(localStorage.setItem(p,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","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"};function B(i){var o=i.supercoinBalance;return n.jsxs("div",e.__assign({className:S.chipWrapper},{children:[n.jsx("img",{src:_,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 w(i){var o=i.walletBalance;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.jsxs(r.Typography,e.__assign({variant:"B2",className:S.textWrapper},{children:["₹",o]}))}))]}))}function k(i){var r=i.supercoinBalance,o=i.walletBalance,a=i.handleClick,s=0===o&&r>0||0===r&&0===o,t=s?S["spring-up-wallet-sc"]:S["spring-up-wallet"];return n.jsx("div",e.__assign({onClick:a},{children:n.jsx("div",e.__assign({className:"".concat(S.pillContainer),style:{height:"32px"}},{children:n.jsxs("div",e.__assign({className:t},{children:[n.jsx(B,{supercoinBalance:r}),n.jsx(w,{walletBalance:o}),s?n.jsx(B,{supercoinBalance:r}):null]}))}))}))}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)}}.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=t.default.lazy((function(){return import("@cleartrip/ct-platform-supercoins-floating-island").then((function(e){return{default:e.SupercoinsFloatingIsland}}))}));exports.SupercoinsChip=function(s){var t=s.supercoinsLoading,l=s.supercoinBurnBalance,u=s.ravenPayload,p=void 0===u?{}:u,m=s.onSupercoinsClick,S=s.supercoinsExpiryCount,B=s.renderFloatingIsland,w=void 0===B||B,T=s.walletEnabled,j=void 0!==T&&T,E=s.walletBalance,I=i.useMemo((function(){var e;return null!==(e=a.getQueryParam("utm_source"))&&void 0!==e?e:"organic"}),[]),N=i.useState(!1),W=N[0],q=N[1],A=i.useState(0),P=A[0],F=A[1],Y=i.useState(!1),U=Y[0],H=Y[1],K=i.useState(!1),L=K[0],G=K[1],J=i.useMemo((function(){return"number"==typeof l&&l>=0&&!t}),[l,t]),M=i.useState(!1),O=M[0],D=M[1],V=i.useState(null),z=V[0],Q=V[1],Z=i.useState(!1),X=Z[0],R=Z[1],$="entry"===z?c.supercoinsBalanceBackgroundColorShift:"exit"===z?c.supercoinsBalanceBackgroundColorShift_exit:"",ee="entry"===z?c.supercoinsBalanceTextColorShift:"exit"===z?c.supercoinsBalanceTextColorShift_exit:"";function ne(){var n;m&&"function"==typeof m&&m();var i=p.action_event_name;p.impression_event_name;var r=e.__rest(p,["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:I},r))}if(i.useEffect((function(){F(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(d)||(R(!0),Q(null)))};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[]),i.useEffect((function(){var e;return q("number"==typeof S&&S>=x&&!1),sessionStorage.setItem("disable_floater","true"),X?j&&G(!0):(Q("entry"),e=setTimeout((function(){D(!0)}),1500)),function(){clearTimeout(e)}}),[l,S]),i.useEffect((function(){if(w&&O){var e=setTimeout((function(){sessionStorage.getItem(d)||(D(!1),Q("exit"),G(!0))}),y.cutoffTimeInMs);return function(){clearTimeout(e)}}}),[]),i.useEffect((function(){var n;if("number"==typeof l&&l>=0&&!t){p.action_event_name;var i=p.impression_event_name,r=e.__rest(p,["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:I,supercoinsExpiryCount:S||"N/A"},r))}}),[t]),i.useEffect((function(){if(W&&!(P>=f)){var e=setTimeout((function(){H(!0);var e=setTimeout((function(){H(!1);var e=P+1;F(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),v);return function(){return clearTimeout(e)}}),0===P?h:g);return function(){return clearTimeout(e)}}}),[W,P]),t)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 ie=W?"HM4":"B2",re=W?c.supercoinsExpiryPill:c.supercoinsBalance,oe=W?c.supercoinBurnExpiryColor:"";return L?n.jsx(k,{walletBalance:E,supercoinBalance:Number(l),handleClick:ne}):n.jsxs("div",e.__assign({style:{position:"relative"}},{children:[n.jsx("div",e.__assign({className:"".concat(re," ").concat($),onClick:ne},{children:n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx("img",{src:_,alt:"supercoin_icon",width:18,height:18}),n.jsxs("div",e.__assign({className:c.supercoinChipWrapper},{children:[n.jsx(r.Typography,e.__assign({variant:ie,className:[ee,c.supercoinBurnTextAlign,oe].join(" ")},{children:U?S:l})),W&&n.jsx(r.Typography,e.__assign({variant:"HM4",className:"".concat(c.supercoinExpiryText," ").concat(U?c.supercoinExpiryAnimating:"")},{children:"expiring soon"}))]}))]}))})),O&&!X&&n.jsx("div",e.__assign({className:c.superCoinsFloatingIslandContainer},{children:n.jsx(i.Suspense,e.__assign({fallback:n.jsx(n.Fragment,{})},{children:n.jsx(C,{superCoins:l,onAnimationStart:function(){return function(n){var i,r=n.supercoins,o=n.ravenPayload,s=void 0===o?{}:o,t=n.utmSource,l=void 0===t?"":t;s.action_event_name;var c=s.impression_event_name,_=e.__rest(s,["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},_)),sessionStorage.setItem("islandAnimationPlayed","true"),b()}({supercoins:l,ravenPayload:p,utmSource:I})},onAnimationEnd:function(){setTimeout((function(){j&&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",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")}})}))}))]}))};
|
|
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/onIslandAnimationStart.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],"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","incrementAnimationPlayedFrequency","localStorage","getItem","currentFrequency","parseInt","setItem","toString","expiry","Math","floor","Date","now","SupercoinChip","_a","supercoinBalance","_jsxs","className","styles","chipWrapper","children","_jsx","jsx","src","alt","width","height","__assign","chipTextWrapper","Typography","variant","textWrapper","WalletChip","walletBalance","WalletAnimation","handleClick","renderSupercoinPillOnAnimationEnd","wrapperAnimation","onClick","concat","pillContainer","LazySuperCoinsFloatingIsland","React","lazy","import","then","module","default","SupercoinsFloatingIsland","supercoinsLoading","supercoinBurnBalance","_b","ravenPayload","onSupercoinsClick","supercoinsExpiryCount","_c","renderFloatingIsland","_d","walletEnabled","utmSource","useMemo","getQueryParam","_e","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_f","animationCount","setAnimationCount","_g","isAnimating","setIsAnimating","_h","startWalletAnimation","setStartWalletAnimation","shouldRenderSupercoins","_j","renderSuperCoinIsland","setRenderSuperCoinIsland","_k","chipAnimationType","setChipAnimationType","_l","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","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","sessionStorage","handleScroll","window","scrollY","addEventListener","removeEventListener","timeout","setTimeout","clearTimeout","startTimer","switchBackTimer","newCount","supercoinsBalance","jsxs","display","alignItems","gap","Shimmer","typographyVariant","chipClassName","supercoinsExpiryPill","expiryColorClass","supercoinBurnExpiryColor","position","supercoinChipWrapper","supercoinBurnTextAlign","join","supercoinExpiryText","supercoinExpiryAnimating","superCoinsFloatingIslandContainer","Suspense","fallback","superCoins","onAnimationStart","supercoins","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,4rICzBO,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,eA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AAA,CAAKV,UAAWC,EAAOkH,mCACnB,CAAAhH,SAAAC,EAAAA,IAACgH,EAAAA,SAAQ1G,EAAAA,SAAA,CAAC2G,SAAUjH,EAAAA,oBAChB,CAAAD,SAAAC,EAAAA,IAACoB,EAA4B,CACzB8F,WAAYrF,EACZsF,iBAAkB,WACd,OFnS1B,SAAiC1H,SACnC2H,EAAU3H,EAAA2H,WACVlF,EAAiBzC,EAAAsC,aAAjBA,OAAe,IAAAG,EAAA,CAAE,EAAAA,EACjBE,EAAc3C,EAAA6C,UAAdA,OAAS,IAAAF,EAAG,GAAEA,EAKVL,EADqBwC,sBAAEC,EACvBzC,EAD4CyC,sBAAKC,EACjDC,EAAAA,OAAA3C,EADE,CAAA,oBAAA,0BAEN4C,kBAAqD,QAApC7C,EAAA0C,SAAoC,IAAA1C,EAAAA,EAAA,2BACjD8C,YAAa,8BACbC,UAAW,mBACXC,kBAAmBsC,EACnBrC,aAAczC,GACXmC,IAIPS,eAAejG,QAAQ,wBAAyB,QAGhDL,GACJ,CE6QgCyI,CAAuB,CACnBD,WAAYvF,EACZE,aAAYA,EACZO,UAASA,KAGjBgF,eAlQxB,WACI7B,YAAW,WACHpD,GAAegB,GAAwB,EAC9C,GAAE,KACHO,EAAqB,OACxB,aAoQL","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,sHAESC,EACT,4GAESC,EAAsC,2BAEtCC,EAAoC,wBAEpCC,E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YvF,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,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as n}from"tslib";import{jsx as i,jsxs as r,Fragment as o}from"react/jsx-runtime";import a,{useMemo as t,useState as s,useEffect as l,Suspense as c}from"react";import{Typography as u}from"@cleartrip/ct-design-typography";import{Shimmer as p}from"@cleartrip/ct-platform-shimmer";import{ravenSDKTrigger as _,getQueryParam as d}from"@cleartrip/ct-platform-utils";function m(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 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"};m('@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");*{font-family:inter}.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:rgba(0,62,162,0)}}@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 f="https://rukmini-ct.flixcart.com/f_auto,q_auto,dpr_2/offermgmt-prod/offermgmt/images/banner/supercoins-chip-icon.png",g="https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/wallet-pill-icon.png",h="island_rendered_frquency",v="islandAnimationPlayed",y="island_expiration_frquency",b=5,B=2,w=2e3,k=500,C=1500,S={requiredSupercoins:50,frequency:1,frequencyGapInDays:1,cutoffTimeInMs:5e3,isVisibleOnScroll:!1};function T(){var e=localStorage.getItem(h);e||(e="0");var n=parseInt(e)+1;if(localStorage.setItem(h,n.toString()),n>=S.frequency){var i=Math.floor(Date.now()/1e3)+86400*S.frequencyGapInDays;localStorage.setItem(y,i.toString())}}var E={chipWrapper:"index-module_chipWrapper__EwpUk",chipTextWrapper:"index-module_chipTextWrapper__Uburn",textWrapper:"index-module_textWrapper__BysJP",pillContainer:"index-module_pillContainer__bz7P4","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"};function I(e){var o=e.supercoinBalance;return r("div",n({className:E.chipWrapper},{children:[i("img",{src:f,alt:"supercoin_icon",width:18,height:18}),i("div",n({className:E.chipTextWrapper},{children:i(u,n({variant:"B2",className:E.textWrapper},{children:o}))}))]}))}function N(e){var o=e.walletBalance;return r("div",n({className:E.chipWrapper},{children:[i("img",{src:g,alt:"supercoin_icon",width:18,height:18}),i("div",n({className:E.chipTextWrapper},{children:r(u,n({variant:"B2",className:E.textWrapper},{children:["₹",o]}))}))]}))}function W(e){var o=e.supercoinBalance,a=e.walletBalance,t=e.handleClick,s=0===a&&o>0||0===o&&0===a,l=s?E["spring-up-wallet-sc"]:E["spring-up-wallet"];return i("div",n({onClick:t},{children:i("div",n({className:"".concat(E.pillContainer),style:{height:"32px"}},{children:r("div",n({className:l},{children:[i(I,{supercoinBalance:o}),i(N,{walletBalance:a}),s?i(I,{supercoinBalance:o}):null]}))}))}))}m(".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)}}.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 A=a.lazy((function(){return import("@cleartrip/ct-platform-supercoins-floating-island").then((function(e){return{default:e.SupercoinsFloatingIsland}}))})),q=function(a){var m=a.supercoinsLoading,g=a.supercoinBurnBalance,h=a.ravenPayload,y=void 0===h?{}:h,E=a.onSupercoinsClick,I=a.supercoinsExpiryCount,N=a.renderFloatingIsland,q=void 0===N||N,P=a.walletEnabled,Y=void 0!==P&&P,F=a.walletBalance,U=t((function(){var e;return null!==(e=d("utm_source"))&&void 0!==e?e:"organic"}),[]),H=s(!1),L=H[0],j=H[1],G=s(0),J=G[0],K=G[1],O=s(!1),V=O[0],z=O[1],M=s(!1),D=M[0],Z=M[1],Q=t((function(){return"number"==typeof g&&g>=0&&!m}),[g,m]),X=s(!1),R=X[0],$=X[1],ee=s(null),ne=ee[0],ie=ee[1],re=s(!1),oe=re[0],ae=re[1],te="entry"===ne?x.supercoinsBalanceBackgroundColorShift:"exit"===ne?x.supercoinsBalanceBackgroundColorShift_exit:"",se="entry"===ne?x.supercoinsBalanceTextColorShift:"exit"===ne?x.supercoinsBalanceTextColorShift_exit:"";function le(){var i;E&&"function"==typeof E&&E();var r=y.action_event_name;y.impression_event_name;var o=e(y,["action_event_name","impression_event_name"]);_(null!==(i=r)&&void 0!==i?i:"u_ui_action",n({action_name:"supercoin_icon_click",page_name:"unified_homepage",supercoin_balance:g,u_utm_source:U},o))}if(l((function(){K(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(v)||(ae(!0),ie(null)))};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[]),l((function(){var e;return j("number"==typeof I&&I>=b&&!1),sessionStorage.setItem("disable_floater","true"),oe?Y&&Z(!0):(ie("entry"),e=setTimeout((function(){$(!0)}),1500)),function(){clearTimeout(e)}}),[g,I]),l((function(){if(q&&R){var e=setTimeout((function(){sessionStorage.getItem(v)||($(!1),ie("exit"),Z(!0))}),S.cutoffTimeInMs);return function(){clearTimeout(e)}}}),[]),l((function(){var i;if("number"==typeof g&&g>=0&&!m){y.action_event_name;var r=y.impression_event_name,o=e(y,["action_event_name","impression_event_name"]);_(null!==(i=r)&&void 0!==i?i:"u_impression",n({action_name:"supercoin_pill_impression",page_name:"unified_homepage",supercoin_balance:g,u_utm_source:U,supercoinsExpiryCount:I||"N/A"},o))}}),[m]),l((function(){if(L&&!(J>=B)){var e=setTimeout((function(){z(!0);var e=setTimeout((function(){z(!1);var e=J+1;K(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),C);return function(){return clearTimeout(e)}}),0===J?k:w);return function(){return clearTimeout(e)}}}),[L,J]),m)return i("div",n({className:x.supercoinsBalance},{children:r("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(!Q)return null;var ce=L?"HM4":"B2",ue=L?x.supercoinsExpiryPill:x.supercoinsBalance,pe=L?x.supercoinBurnExpiryColor:"";return D?i(W,{walletBalance:F,supercoinBalance:Number(g),handleClick:le}):r("div",n({style:{position:"relative"}},{children:[i("div",n({className:"".concat(ue," ").concat(te),onClick:le},{children:r("div",n({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[i("img",{src:f,alt:"supercoin_icon",width:18,height:18}),r("div",n({className:x.supercoinChipWrapper},{children:[i(u,n({variant:ce,className:[se,x.supercoinBurnTextAlign,pe].join(" ")},{children:V?I:g})),L&&i(u,n({variant:"HM4",className:"".concat(x.supercoinExpiryText," ").concat(V?x.supercoinExpiryAnimating:"")},{children:"expiring soon"}))]}))]}))})),R&&!oe&&i("div",n({className:x.superCoinsFloatingIslandContainer},{children:i(c,n({fallback:i(o,{})},{children:i(A,{superCoins:g,onAnimationStart:function(){return function(i){var r,o=i.supercoins,a=i.ravenPayload,t=void 0===a?{}:a,s=i.utmSource,l=void 0===s?"":s;t.action_event_name;var c=t.impression_event_name,u=e(t,["action_event_name","impression_event_name"]);_(null!==(r=c)&&void 0!==r?r:"u_impression",n({action_name:"supercoin_banner_impression",page_name:"unified_homepage",supercoin_balance:o,u_utm_source:l},u)),sessionStorage.setItem("islandAnimationPlayed","true"),T()}({supercoins:g,ravenPayload:y,utmSource:U})},onAnimationEnd:function(){setTimeout((function(){Y&&Z(!0)}),500),ie("exit")}})}))}))]}))};export{q 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",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};
|
|
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/onIslandAnimationStart.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],"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","incrementAnimationPlayedFrequency","localStorage","getItem","currentFrequency","parseInt","setItem","toString","expiry","Math","floor","Date","now","SupercoinChip","_a","supercoinBalance","_jsxs","className","styles","chipWrapper","children","_jsx","src","alt","width","height","__assign","chipTextWrapper","Typography","variant","textWrapper","WalletChip","walletBalance","WalletAnimation","handleClick","renderSupercoinPillOnAnimationEnd","wrapperAnimation","onClick","concat","pillContainer","LazySuperCoinsFloatingIsland","React","lazy","import","then","module","default","SupercoinsFloatingIsland","SupercoinsChip","supercoinsLoading","supercoinBurnBalance","_b","ravenPayload","onSupercoinsClick","supercoinsExpiryCount","_c","renderFloatingIsland","_d","walletEnabled","utmSource","useMemo","getQueryParam","_e","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_f","animationCount","setAnimationCount","_g","isAnimating","setIsAnimating","_h","startWalletAnimation","setStartWalletAnimation","shouldRenderSupercoins","_j","renderSuperCoinIsland","setRenderSuperCoinIsland","_k","chipAnimationType","setChipAnimationType","_l","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","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","sessionStorage","handleScroll","window","scrollY","addEventListener","removeEventListener","timeout","setTimeout","clearTimeout","startTimer","switchBackTimer","newCount","supercoinsBalance","display","alignItems","gap","Shimmer","typographyVariant","chipClassName","supercoinsExpiryPill","expiryColorClass","supercoinBurnExpiryColor","position","supercoinChipWrapper","supercoinBurnTextAlign","join","supercoinExpiryText","supercoinExpiryAnimating","superCoinsFloatingIslandContainer","Suspense","fallback","superCoins","onAnimationStart","supercoins","onIslandAnimationStart","onAnimationEnd"],"mappings":"mYAAA,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,EAA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qF,iBAAkB,WACd,OFnS1B,SAAiCzH,SACnC0H,EAAU1H,EAAA0H,WACVjF,EAAiBzC,EAAAsC,aAAjBA,OAAe,IAAAG,EAAA,CAAE,EAAAA,EACjBE,EAAc3C,EAAA6C,UAAdA,OAAS,IAAAF,EAAG,GAAEA,EAKVL,EADqBwC,sBAAEC,EACvBzC,EAD4CyC,sBAAKC,EACjDC,EAAA3C,EADE,CAAA,oBAAA,0BAEN4C,EAAqD,QAApC7C,EAAA0C,SAAoC,IAAA1C,EAAAA,EAAA,kBACjD8C,YAAa,8BACbC,UAAW,mBACXC,kBAAmBqC,EACnBpC,aAAczC,GACXmC,IAIPS,eAAejG,QAAQ,wBAAyB,QAGhDL,GACJ,CE6QgCwI,CAAuB,CACnBD,WAAYtF,EACZE,aAAYA,EACZO,UAASA,KAGjB+E,eAlQxB,WACI5B,YAAW,WACHpD,GAAegB,GAAwB,EAC9C,GAAE,KACHO,GAAqB,OACxB,aAoQL","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,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,OALzC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AAE,KACHO,GAAqB,OACxB,aA4SL","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setWalletCssVariables.d.ts","sourceRoot":"","sources":["../../packages/components/SupercoinsChip/src/utils/setWalletCssVariables.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,UAAU,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,MAAM,QAU7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shouldRenderFloatingIsland.d.ts","sourceRoot":"","sources":["../../packages/components/SupercoinsChip/src/utils/shouldRenderFloatingIsland.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAcxE,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EAC/C,oBAAoB,EACpB,UAAU,GACb,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"shouldRenderFloatingIsland.d.ts","sourceRoot":"","sources":["../../packages/components/SupercoinsChip/src/utils/shouldRenderFloatingIsland.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAcxE,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAC,EAC/C,oBAAoB,EACpB,UAAU,GACb,EAAE,6BAA6B,WAmC/B"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
1
2
|
interface IWalletAnimation {
|
|
2
3
|
supercoinBalance: number;
|
|
3
4
|
walletBalance: number;
|
|
4
5
|
handleClick: () => void;
|
|
6
|
+
chipWidthRef: MutableRefObject<number>;
|
|
5
7
|
}
|
|
6
|
-
export default function WalletAnimation({ supercoinBalance, walletBalance, handleClick, }: IWalletAnimation): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default function WalletAnimation({ supercoinBalance, walletBalance, handleClick, chipWidthRef, }: IWalletAnimation): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/components/SupercoinsChip/src/walletAnimation/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/components/SupercoinsChip/src/walletAnimation/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAMhD,UAAU,gBAAgB;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;CAC1C;AAsCD,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACpC,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,YAAY,GACf,EAAE,gBAAgB,2CA0ClB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleartrip/ct-platform-supercoins-chip",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.19",
|
|
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-
|
|
15
|
-
"@cleartrip/ct-platform-shimmer": "4.2.0-beta.
|
|
16
|
-
"@cleartrip/ct-platform-
|
|
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"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": ">=16.8.0",
|