@cleartrip/ct-platform-supercoins-chip 2.2.0-beta.4 → 2.2.0-beta.40
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/SupercoinsChip.types.d.ts +2 -0
- package/dist/SupercoinsChip.types.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.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/index.d.ts.map +1 -1
- package/dist/utils/onIslandAnimationStart.d.ts.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 +10 -0
- package/dist/walletAnimation/index.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupercoinsChip.d.ts","sourceRoot":"","sources":["../packages/components/
|
|
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,CA8YjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupercoinsChip.types.d.ts","sourceRoot":"","sources":["../packages/components/
|
|
1
|
+
{"version":3,"file":"SupercoinsChip.types.d.ts","sourceRoot":"","sources":["../packages/components/SupercoinsChip/src/SupercoinsChip.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,oBAAoB,EAAE,MAAM,GAAG,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAClD,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,6BAA6B;IAC1C,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,0BAA0B;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAClD,SAAS,EAAE,MAAM,CAAC;CACrB"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const SUPERCOINS_CHIP_ICON = "https://rukmini-ct.flixcart.com/f_auto,q_auto,dpr_2/offermgmt-prod/offermgmt/images/banner/supercoins-chip-icon.png";
|
|
2
|
+
export declare const WALLET_CHIP_ICON = "https://rukmini-ct.flixcart.com/f_auto,q_auto/offermgmt-prod/offermgmt/images/banner/wallet-pill-icon.png";
|
|
2
3
|
export declare const SUPERCOIN_ISLAND_RENDERED_FREQUENCY = "island_rendered_frquency";
|
|
3
4
|
export declare const SUPERCOIN_ISLAND_ANIMATION_PLAYED = "islandAnimationPlayed";
|
|
4
5
|
export declare const SUPERCOIN_ISLAND_EXPIRATION_FREQUENCY = "island_expiration_frquency";
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../packages/components/
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../packages/components/SupercoinsChip/src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,wHACwF,CAAC;AAE1H,eAAO,MAAM,gBAAgB,8GACkF,CAAC;AAEhH,eAAO,MAAM,mCAAmC,6BAA6B,CAAC;AAE9E,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AAEzE,eAAO,MAAM,qCAAqC,+BAClB,CAAC;AAEjC,eAAO,MAAM,gCAAgC,oBAAoB,CAAC;AAElE,eAAO,MAAM,uBAAuB;;;;;;CAMnC,CAAC;AAEF,eAAO,MAAM,gCAAgC;;;;;;CAM5C,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),i=require("react"),o=require("@cleartrip/ct-design-typography"),r=require("@cleartrip/ct-platform-shimmer"),t=require("@cleartrip/ct-platform-utils");function a(e){return e&&e.__esModule?e:{default:e}}var s=a(i);var u="index-module_supercoinsBalance__w9srh",c="index-module_supercoinsExpiryPill__v4w06",l="index-module_supercoinChipWrapper__QPdUS",_="index-module_supercoinBurnTextAlign__g-go5",d="index-module_supercoinBurnExpiryColor__FTFjA",p="index-module_supercoinExpiryText__rkVbG",m="index-module_supercoinExpiryAnimating__Gdq0n",f="index-module_superCoinsFloatingIslandContainer__5FNNa",g="index-module_supercoinsBalanceBackgroundColorShift__r6YWa",x="index-module_supercoinsBalanceTextColorShift__y7vva",h="index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ",v="index-module_supercoinsBalanceTextColorShift_exit__JKt90";!function(e,n){void 0===n&&(n={});var i=n.insertAt;if("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))}}('.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 y="island_rendered_frquency",b="islandAnimationPlayed",S="island_expiration_frquency",k=5,w=2,I=2e3,C=500,T=1500,B={requiredSupercoins:50,frequency:1,frequencyGapInDays:1,cutoffTimeInMs:5e3,isVisibleOnScroll:!1};function j(e){var n,i=e.renderFloatingIsland,o=e.supercoins;if(!i)return!1;if(o<B.requiredSupercoins)return!1;if(!("true"===t.getQueryParam("isMobileApp")))return!1;if(function(){var e=localStorage.getItem(y);return e&&"number"==typeof parseInt(e)?parseInt(e):0}()>=B.frequency){var r=(n=localStorage.getItem(S))&&"number"==typeof parseInt(n)?parseInt(n):null;return!r||!(r>Math.floor(Date.now()/1e3))&&(localStorage.removeItem(y),localStorage.removeItem(S),!0)}return!sessionStorage.getItem(b)}function q(){var e=localStorage.getItem(y);e||(e="0");var n=parseInt(e)+1;if(localStorage.setItem(y,n.toString()),n>=B.frequency){var i=Math.floor(Date.now()/1e3)+86400*B.frequencyGapInDays;localStorage.setItem(S,i.toString())}}var E=s.default.lazy((function(){return import("@cleartrip/ct-platform-supercoins-floating-island").then((function(e){return{default:e.SupercoinsFloatingIsland}}))}));exports.SupercoinsChip=function(a){var s=a.supercoinsLoading,y=a.supercoinBurnBalance,S=a.ravenPayload,A=void 0===S?{}:S,N=a.onSupercoinsClick,F=a.supercoinsExpiryCount,P=a.renderFloatingIsland,M=void 0===P||P,H=i.useMemo((function(){var e;return null!==(e=t.getQueryParam("utm_source"))&&void 0!==e?e:"organic"}),[]),U=i.useState(!1),D=U[0],G=U[1],Y=i.useState(0),K=Y[0],V=Y[1],W=i.useState(!1),J=W[0],Q=W[1],L=i.useMemo((function(){return"number"==typeof y&&y>=0&&!s}),[y,s]),O=i.useState(!1),Z=O[0],z=O[1],R=i.useState(null),X=R[0],$=R[1],ee=i.useState(!1),ne=ee[0],ie=ee[1],oe="entry"===X?g:"exit"===X?h:"",re="entry"===X?x:"exit"===X?v:"";return i.useEffect((function(){V(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(b)||(ie(!0),$(null)))};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[]),i.useEffect((function(){var e,n=j({renderFloatingIsland:M,supercoins:y});return G("number"==typeof F&&F>=k&&!n),n&&sessionStorage.setItem("disable_floater","true"),n&&!ne&&($("entry"),e=setTimeout((function(){z(!0)}),1500)),function(){clearTimeout(e)}}),[y,F]),i.useEffect((function(){if(M&&Z){var e=setTimeout((function(){sessionStorage.getItem(b)||(z(!1),$("exit"))}),B.cutoffTimeInMs);return function(){clearTimeout(e)}}}),[]),i.useEffect((function(){var n;if("number"==typeof y&&y>=0&&!s){A.action_event_name;var i=A.impression_event_name,o=e.__rest(A,["action_event_name","impression_event_name"]);t.ravenSDKTrigger(null!==(n=i)&&void 0!==n?n:"u_impression",e.__assign({action_name:"supercoin_pill_impression",page_name:"unified_homepage",supercoin_balance:y,u_utm_source:H,supercoinsExpiryCount:F||"N/A"},o))}}),[s]),i.useEffect((function(){if(D&&!(K>=w)){var e=setTimeout((function(){Q(!0);var e=setTimeout((function(){Q(!1);var e=K+1;V(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),T);return function(){return clearTimeout(e)}}),0===K?C:I);return function(){return clearTimeout(e)}}}),[D,K]),n.jsx(n.Fragment,{children:s?n.jsx("div",e.__assign({className:u},{children:n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx(r.Shimmer,{width:18,height:18,type:"rounded"}),n.jsx(r.Shimmer,{width:44,height:18,type:"rounded"})]}))})):L?n.jsxs("div",e.__assign({style:{position:"relative"}},{children:[n.jsx("div",e.__assign({className:"".concat(D?c:u," ").concat(oe),onClick:function(){var n;N&&"function"==typeof N&&N();var i=A.action_event_name;A.impression_event_name;var o=e.__rest(A,["action_event_name","impression_event_name"]);t.ravenSDKTrigger(null!==(n=i)&&void 0!==n?n:"u_ui_action",e.__assign({action_name:"supercoin_icon_click",page_name:"unified_homepage",supercoin_balance:y,u_utm_source:H},o))}},{children:n.jsxs("div",e.__assign({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[n.jsx("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,dpr_2/offermgmt-prod/offermgmt/images/banner/supercoins-chip-icon.png",alt:"supercoin_icon",width:18,height:18}),n.jsxs("div",e.__assign({className:l},{children:[n.jsx(o.Typography,e.__assign({variant:D?"HM4":"B2",className:"".concat(re," ").concat(_," ").concat(D?d:""," ")},{children:J?F:y})),D&&n.jsx(o.Typography,e.__assign({variant:"HM4",className:"".concat(p," ").concat(J?m:"")},{children:"expiring soon"}))]}))]}))})),Z&&!ne&&n.jsx("div",e.__assign({className:f},{children:n.jsx(i.Suspense,e.__assign({fallback:n.jsx(n.Fragment,{})},{children:n.jsx(E,{superCoins:y,onAnimationStart:function(){return function(n){var i,o=n.supercoins,r=n.ravenPayload,a=void 0===r?{}:r,s=n.utmSource,u=void 0===s?"":s;a.action_event_name;var c=a.impression_event_name,l=e.__rest(a,["action_event_name","impression_event_name"]);t.ravenSDKTrigger(null!==(i=c)&&void 0!==i?i:"u_impression",e.__assign({action_name:"supercoin_banner_impression",page_name:"unified_homepage",supercoin_balance:o,u_utm_source:u},l)),sessionStorage.setItem("islandAnimationPlayed","true"),q()}({supercoins:y,ravenPayload:A,utmSource:H})},onAnimationEnd:function(){$("exit")}})}))}))]})):null})};
|
|
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 T(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 I=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,A=t.supercoinsFetchError;console.log("l1130 SupercoinsChip recieved props",{supercoinsLoading:s,supercoinBurnBalance:l,ravenPayload:_,onSupercoinsClick:m,supercoinsExpiryCount:S,renderFloatingIsland:B,walletEnabled:E,walletBalance:j});var W=i.useMemo((function(){var e;return null!==(e=a.getQueryParam("utm_source"))&&void 0!==e?e:"organic"}),[]),q=i.useState(!1),N=q[0],F=q[1],P=i.useState(0),Y=P[0],U=P[1],G=i.useState(!1),H=G[0],L=G[1],M=i.useState(!1),K=M[0],R=M[1],J=i.useState(!1),D=J[0],O=J[1],V=i.useMemo((function(){return"number"==typeof l&&l>=0&&!s}),[l,s]),z=i.useState(!1),Q=z[0],Z=z[1],X=i.useState(null),$=X[0],ee=X[1],ne=i.useState(!1),ie=ne[0],re=ne[1],oe=i.useRef(0),ae=i.useRef(!1),te="entry"===$?c.supercoinsBalanceBackgroundColorShift:"exit"===$?c.supercoinsBalanceBackgroundColorShift_exit:"",se="entry"===$?c.supercoinsBalanceTextColorShift:"exit"===$?c.supercoinsBalanceTextColorShift_exit:"";function le(){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:W},r))}if(i.useEffect((function(){U(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(p)||(console.log("setHasScrolledBeforeAnimation called"),re(!0),ee(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),F(i),e&&sessionStorage.setItem("disable_floater","true"),e&&!ie?(console.log("l1130 setChipAnimationType called with entry"),ee("entry"),n=setTimeout((function(){console.log("l1130 setRenderSuperCoinIsland called with true"),Z(!0)}),1500),O(!0)):i?(O(!0),setTimeout((function(){E&&R(!0)}),1e4)):(E&&R(!0),O(!0)),function(){clearTimeout(n)}}}),[l,S,s]),i.useEffect((function(){if(console.log("l1130 useEffect called with renderFloatingIsland value",B,"and renderSuperCoinIsland value",Q),B&&Q){var e=setTimeout((function(){sessionStorage.getItem(p)||(console.log("l1130 setRenderSuperCoinIsland called with false"),Z(!1),ee("exit"),R(!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:W,supercoinsExpiryCount:S||"N/A"},r))}}),[s]),i.useEffect((function(){if(N&&!(Y>=f)){var e=setTimeout((function(){L(!0),console.log("l1130 setIsAnimating called with true");var e=setTimeout((function(){L(!1),console.log("l1130 setIsAnimating called with false");var e=Y+1;U(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),v);return function(){return clearTimeout(e)}}),0===Y?h:g);return function(){return clearTimeout(e)}}}),[N,Y]),A)return n.jsx(n.Fragment,{});if(s||!Q&&!K&&!D)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(!V)return null;var ce=N?"HM4":"B2",ue=N?c.supercoinsExpiryPill:c.supercoinsBalance,de=N?c.supercoinBurnExpiryColor:"";return K?(console.log("l1130 startWalletAnimation called with true"),n.jsx(T,{walletBalance:j,supercoinBalance:Number(l),handleClick:le,chipWidthRef:oe})):n.jsxs("div",e.__assign({style:{position:"relative"}},{children:[n.jsx("div",e.__assign({ref:function(e){var n;ae.current||(ae.current=!0,oe.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(ue," ").concat(te),onClick:le},{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:ce,className:[se,c.supercoinBurnTextAlign,de].join(" ")},{children:H?S:l})),N&&n.jsx(r.Typography,e.__assign({variant:"HM4",className:"".concat(c.supercoinExpiryText," ").concat(H?c.supercoinExpiryAnimating:"")},{children:"expiring soon"}))]}))]}))})),Q&&!ie&&n.jsx("div",e.__assign({className:c.superCoinsFloatingIslandContainer},{children:n.jsx(i.Suspense,e.__assign({fallback:n.jsx(n.Fragment,{})},{children:n.jsx(I,{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:W})},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&&R(!0)}),500),ee("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/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":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","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","LazySuperCoinsFloatingIsland","React","lazy","import","then","module","default","SupercoinsFloatingIsland","supercoinsLoading","supercoinBurnBalance","_b","ravenPayload","onSupercoinsClick","supercoinsExpiryCount","_c","utmSource","useMemo","_d","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_e","animationCount","setAnimationCount","_f","isAnimating","setIsAnimating","shouldRenderSupercoins","_g","renderSuperCoinIsland","setRenderSuperCoinIsland","_h","chipAnimationType","setChipAnimationType","_j","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","chipBackgroundAnimationClassname","styles","chipTextAnimationClassname","useEffect","Number","handleScroll","window","scrollY","addEventListener","removeEventListener","timeout","shouldRender","setTimeout","clearTimeout","action_event_name","impression_event_name","restPayload","__rest","ravenSDKTrigger","action_name","page_name","supercoin_balance","u_utm_source","startTimer","switchBackTimer","newCount","_jsx","_Fragment","children","jsx","__assign","className","_jsxs","jsxs","display","alignItems","gap","Shimmer","width","height","position","concat","onClick","src","alt","Typography","variant","Suspense","fallback","superCoins","onAnimationStart","onIslandAnimationStart","onAnimationEnd"],"mappings":"64BAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,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,6hFCzBO,IAGMe,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,GCJC,SAAAC,EAA2BC,OALzCC,EAMNC,EAAoBF,EAAAE,qBACpBC,EAAUH,EAAAG,WAGV,IAAKD,EAAsB,OAAO,EAElC,GAAIC,EAAaV,EAAiCC,mBAC9C,OAAO,EAIX,KADqD,SAAjCU,EAAAA,cAAc,gBAChB,OAAO,EAIzB,GA5BJ,WACI,IAAMT,EAAYU,aAAaC,QAAQjB,GACvC,OAAKM,GAA4C,iBAAxBY,SAASZ,GAC3BY,SAASZ,GADkD,CAEtE,CAuBsBa,IACDf,EAAiCE,UAAW,CAEzD,IAAMc,GAvBJR,EAASI,aAAaC,QAAQf,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iBAAkB,WACd,ODtQlC,SAAiC3G,SACnCG,EAAUH,EAAAG,WACV+B,EAAiBlC,EAAA+B,aAAjBA,OAAe,IAAAG,EAAA,CAAE,EAAAA,EACjBG,EAAcrC,EAAAmC,UAAdA,OAAS,IAAAE,EAAG,GAAEA,EAKVN,EADqBwC,sBAAEC,EACvBzC,EAD4CyC,sBAAKC,EACjDC,EAAAA,OAAA3C,EADE,CAAA,oBAAA,0BAEN4C,kBAAqD,QAApC7C,EAAA0C,SAAoC,IAAA1C,EAAAA,EAAA,2BACjD8C,YAAa,8BACbC,UAAW,mBACXC,kBAAmB3E,EACnB4E,aAAc5C,GACXsC,IAIP1D,eAAeG,QAAQ,wBAAyB,QAGhDF,GACJ,CCgPwC4F,CAAuB,CACnBzG,WACI0B,EACJE,aAAYA,EACZI,UAASA,GACX,EAEN0E,eAzOhC,WACIxD,EAAqB,OACxB,cA6OW,MAGhB","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","supercoinsFetchError","console","log","utmSource","useMemo","_e","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_f","animationCount","setAnimationCount","_g","isAnimating","setIsAnimating","_h","startWalletAnimation","setStartWalletAnimation","_j","calculatedAnimation","setCalculatedAnimation","shouldRenderSupercoins","_k","renderSuperCoinIsland","setRenderSuperCoinIsland","_l","chipAnimationType","setChipAnimationType","_m","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","useRef","chipWidthCalculatedRef","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,EACT,6BAISC,EACkB,EADlBA,EAEK,EAFLA,EAGyB,IAHzBA,EAIkB,IAJlBA,EAKkB,KAGlBC,EAAmC,CAC5CC,mBAAoB,GACpBC,UAAW,EACXC,mBAAoB,EACpBC,eAAgB,IAChBC,mBAAmB,GC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IAACoI,EAAAA,SAAQ9H,EAAAA,SAAA,CAAC+H,SAAUrI,EAAAA,oBAChB,CAAAD,SAAAC,EAAAA,IAACiC,EAA4B,CACzBqG,WAAY5F,EACZ6F,iBAAkB,WACd,OHtX1B,SAAiCnK,SACnCG,EAAUH,EAAAG,WACVuE,EAAiB1E,EAAAuE,aAAjBA,OAAe,IAAAG,EAAA,CAAE,EAAAA,EACjBC,EAAc3E,EAAAgF,UAAdA,OAAS,IAAAL,EAAG,GAAEA,EAKVJ,EADqB8C,sBAAEC,EACvB/C,EAD4C+C,sBAAKC,EACjDC,EAAAA,OAAAjD,EADE,CAAA,oBAAA,0BAENkD,kBAAqD,QAApCjE,EAAA8D,SAAoC,IAAA9D,EAAAA,EAAA,2BACjDkE,YAAa,8BACbC,UAAW,mBACXC,kBAAmBzH,EACnB0H,aAAc7C,GACXuC,IAIPxG,eAAeG,QAAQ,wBAAyB,QAGhDF,GACJ,CGgWgCoJ,CAAuB,CACnBjK,WAAYmE,EACZC,aAAYA,EACZS,UAASA,KAGjBqF,eAtUxB,WACIvF,QAAQC,IACJ,uDACAH,GAEJ4D,YAAW,WACP1D,QAAQC,IACJ,uHAC0CH,IAE1CA,GAAekB,GAAwB,EAC9C,GAAE,KACHU,GAAqB,OACxB,aAgUL","x_google_ignoreList":[0]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__assign as n}from"tslib";import{jsx as o,Fragment as i,jsxs as r}from"react/jsx-runtime";import t,{useMemo as a,useState as s,useEffect as c,Suspense as l}from"react";import{Typography as u}from"@cleartrip/ct-design-typography";import{Shimmer as d}from"@cleartrip/ct-platform-shimmer";import{getQueryParam as _,ravenSDKTrigger as p}from"@cleartrip/ct-platform-utils";var m="index-module_supercoinsBalance__w9srh",f="index-module_supercoinsExpiryPill__v4w06",x="index-module_supercoinChipWrapper__QPdUS",g="index-module_supercoinBurnTextAlign__g-go5",h="index-module_supercoinBurnExpiryColor__FTFjA",v="index-module_supercoinExpiryText__rkVbG",y="index-module_supercoinExpiryAnimating__Gdq0n",b="index-module_superCoinsFloatingIslandContainer__5FNNa",S="index-module_supercoinsBalanceBackgroundColorShift__r6YWa",k="index-module_supercoinsBalanceTextColorShift__y7vva",w="index-module_supercoinsBalanceBackgroundColorShift_exit__sinUJ",I="index-module_supercoinsBalanceTextColorShift_exit__JKt90";!function(e,n){void 0===n&&(n={});var o=n.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}('.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 C="island_rendered_frquency",B="islandAnimationPlayed",T="island_expiration_frquency",A=5,E=2,q=2e3,N=500,F=1500,P={requiredSupercoins:50,frequency:1,frequencyGapInDays:1,cutoffTimeInMs:5e3,isVisibleOnScroll:!1};function H(e){var n,o=e.renderFloatingIsland,i=e.supercoins;if(!o)return!1;if(i<P.requiredSupercoins)return!1;if(!("true"===_("isMobileApp")))return!1;if(function(){var e=localStorage.getItem(C);return e&&"number"==typeof parseInt(e)?parseInt(e):0}()>=P.frequency){var r=(n=localStorage.getItem(T))&&"number"==typeof parseInt(n)?parseInt(n):null;return!r||!(r>Math.floor(Date.now()/1e3))&&(localStorage.removeItem(C),localStorage.removeItem(T),!0)}return!sessionStorage.getItem(B)}function U(){var e=localStorage.getItem(C);e||(e="0");var n=parseInt(e)+1;if(localStorage.setItem(C,n.toString()),n>=P.frequency){var o=Math.floor(Date.now()/1e3)+86400*P.frequencyGapInDays;localStorage.setItem(T,o.toString())}}var M=t.lazy((function(){return import("@cleartrip/ct-platform-supercoins-floating-island").then((function(e){return{default:e.SupercoinsFloatingIsland}}))})),j=function(t){var C=t.supercoinsLoading,T=t.supercoinBurnBalance,j=t.ravenPayload,G=void 0===j?{}:j,Y=t.onSupercoinsClick,V=t.supercoinsExpiryCount,W=t.renderFloatingIsland,D=void 0===W||W,J=a((function(){var e;return null!==(e=_("utm_source"))&&void 0!==e?e:"organic"}),[]),L=s(!1),K=L[0],O=L[1],Q=s(0),Z=Q[0],z=Q[1],R=s(!1),X=R[0],$=R[1],ee=a((function(){return"number"==typeof T&&T>=0&&!C}),[T,C]),ne=s(!1),oe=ne[0],ie=ne[1],re=s(null),te=re[0],ae=re[1],se=s(!1),ce=se[0],le=se[1],ue="entry"===te?S:"exit"===te?w:"",de="entry"===te?k:"exit"===te?I:"";return c((function(){z(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(B)||(le(!0),ae(null)))};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[]),c((function(){var e,n=H({renderFloatingIsland:D,supercoins:T});return O("number"==typeof V&&V>=A&&!n),n&&sessionStorage.setItem("disable_floater","true"),n&&!ce&&(ae("entry"),e=setTimeout((function(){ie(!0)}),1500)),function(){clearTimeout(e)}}),[T,V]),c((function(){if(D&&oe){var e=setTimeout((function(){sessionStorage.getItem(B)||(ie(!1),ae("exit"))}),P.cutoffTimeInMs);return function(){clearTimeout(e)}}}),[]),c((function(){var o;if("number"==typeof T&&T>=0&&!C){G.action_event_name;var i=G.impression_event_name,r=e(G,["action_event_name","impression_event_name"]);p(null!==(o=i)&&void 0!==o?o:"u_impression",n({action_name:"supercoin_pill_impression",page_name:"unified_homepage",supercoin_balance:T,u_utm_source:J,supercoinsExpiryCount:V||"N/A"},r))}}),[C]),c((function(){if(K&&!(Z>=E)){var e=setTimeout((function(){$(!0);var e=setTimeout((function(){$(!1);var e=Z+1;z(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),F);return function(){return clearTimeout(e)}}),0===Z?N:q);return function(){return clearTimeout(e)}}}),[K,Z]),o(i,{children:C?o("div",n({className:m},{children:r("div",n({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[o(d,{width:18,height:18,type:"rounded"}),o(d,{width:44,height:18,type:"rounded"})]}))})):ee?r("div",n({style:{position:"relative"}},{children:[o("div",n({className:"".concat(K?f:m," ").concat(ue),onClick:function(){var o;Y&&"function"==typeof Y&&Y();var i=G.action_event_name;G.impression_event_name;var r=e(G,["action_event_name","impression_event_name"]);p(null!==(o=i)&&void 0!==o?o:"u_ui_action",n({action_name:"supercoin_icon_click",page_name:"unified_homepage",supercoin_balance:T,u_utm_source:J},r))}},{children:r("div",n({style:{display:"flex",alignItems:"center",gap:"4px"}},{children:[o("img",{src:"https://rukmini-ct.flixcart.com/f_auto,q_auto,dpr_2/offermgmt-prod/offermgmt/images/banner/supercoins-chip-icon.png",alt:"supercoin_icon",width:18,height:18}),r("div",n({className:x},{children:[o(u,n({variant:K?"HM4":"B2",className:"".concat(de," ").concat(g," ").concat(K?h:""," ")},{children:X?V:T})),K&&o(u,n({variant:"HM4",className:"".concat(v," ").concat(X?y:"")},{children:"expiring soon"}))]}))]}))})),oe&&!ce&&o("div",n({className:b},{children:o(l,n({fallback:o(i,{})},{children:o(M,{superCoins:T,onAnimationStart:function(){return function(o){var i,r=o.supercoins,t=o.ravenPayload,a=void 0===t?{}:t,s=o.utmSource,c=void 0===s?"":s;a.action_event_name;var l=a.impression_event_name,u=e(a,["action_event_name","impression_event_name"]);p(null!==(i=l)&&void 0!==i?i:"u_impression",n({action_name:"supercoin_banner_impression",page_name:"unified_homepage",supercoin_balance:r,u_utm_source:c},u)),sessionStorage.setItem("islandAnimationPlayed","true"),U()}({supercoins:T,ravenPayload:G,utmSource:J})},onAnimationEnd:function(){ae("exit")}})}))}))]})):null})};export{j 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,B=2,C=2e3,S=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 F(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 q(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(F,{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,F=void 0===N||N,Y=t.walletEnabled,U=void 0!==Y&&Y,G=t.walletBalance,H=t.supercoinsFetchError;console.log("l1130 SupercoinsChip recieved props",{supercoinsLoading:f,supercoinBurnBalance:h,ravenPayload:b,onSupercoinsClick:A,supercoinsExpiryCount:W,renderFloatingIsland:F,walletEnabled:U,walletBalance:G});var L=a((function(){var e;return null!==(e=_("utm_source"))&&void 0!==e?e:"organic"}),[]),j=l(!1),M=j[0],J=j[1],K=l(0),O=K[0],R=K[1],V=l(!1),z=V[0],D=V[1],Z=l(!1),Q=Z[0],X=Z[1],$=l(!1),ee=$[0],ne=$[1],ie=a((function(){return"number"==typeof h&&h>=0&&!f}),[h,f]),oe=l(!1),re=oe[0],te=oe[1],ae=l(null),le=ae[0],se=ae[1],ce=l(!1),ue=ce[0],de=ce[1],pe=s(0),_e=s(!1),me="entry"===le?x.supercoinsBalanceBackgroundColorShift:"exit"===le?x.supercoinsBalanceBackgroundColorShift_exit:"",fe="entry"===le?x.supercoinsBalanceTextColorShift:"exit"===le?x.supercoinsBalanceTextColorShift_exit:"";function xe(){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:L},r))}if(c((function(){R(Number(null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("expiryAnimationCount")));var e=function(){window.scrollY>0&&(sessionStorage.getItem(y)||(console.log("setHasScrolledBeforeAnimation called"),de(!0),se(null)))};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[]),c((function(){if(!f){var e=E({renderFloatingIsland:F,supercoins:h});console.log("l1130 shouldRenderFloatingIsland called with renderFloatingIsland value",F,"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&&!ue?(console.log("l1130 setChipAnimationType called with entry"),se("entry"),n=setTimeout((function(){console.log("l1130 setRenderSuperCoinIsland called with true"),te(!0)}),1500),ne(!0)):i?(ne(!0),setTimeout((function(){U&&X(!0)}),1e4)):(U&&X(!0),ne(!0)),function(){clearTimeout(n)}}}),[h,W,f]),c((function(){if(console.log("l1130 useEffect called with renderFloatingIsland value",F,"and renderSuperCoinIsland value",re),F&&re){var e=setTimeout((function(){sessionStorage.getItem(y)||(console.log("l1130 setRenderSuperCoinIsland called with false"),te(!1),se("exit"),X(!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:L,supercoinsExpiryCount:W||"N/A"},r))}}),[f]),c((function(){if(M&&!(O>=B)){var e=setTimeout((function(){D(!0),console.log("l1130 setIsAnimating called with true");var e=setTimeout((function(){D(!1),console.log("l1130 setIsAnimating called with false");var e=O+1;R(e),sessionStorage.setItem("expiryAnimationCount",e.toString())}),k);return function(){return clearTimeout(e)}}),0===O?S:C);return function(){return clearTimeout(e)}}}),[M,O]),H)return i(r,{});if(f||!re&&!Q&&!ee)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(!ie)return null;var ge=M?"HM4":"B2",he=M?x.supercoinsExpiryPill:x.supercoinsBalance,ve=M?x.supercoinBurnExpiryColor:"";return Q?(console.log("l1130 startWalletAnimation called with true"),i(q,{walletBalance:G,supercoinBalance:Number(h),handleClick:xe,chipWidthRef:pe})):o("div",n({style:{position:"relative"}},{children:[i("div",n({ref:function(e){var n;_e.current||(_e.current=!0,pe.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(he," ").concat(me),onClick:xe},{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:ge,className:[fe,x.supercoinBurnTextAlign,ve].join(" ")},{children:z?W:h})),M&&i(d,n({variant:"HM4",className:"".concat(x.supercoinExpiryText," ").concat(z?x.supercoinExpiryAnimating:"")},{children:"expiring soon"}))]}))]}))})),re&&!ue&&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:L})},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&&X(!0)}),500),se("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/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":["css","ref","insertAt","document","head","getElementsByTagName","style","createElement","type","firstChild","insertBefore","appendChild","styleSheet","cssText","createTextNode","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","LazySuperCoinsFloatingIsland","React","lazy","import","then","module","default","SupercoinsFloatingIsland","SupercoinsChip","supercoinsLoading","supercoinBurnBalance","_b","ravenPayload","onSupercoinsClick","supercoinsExpiryCount","_c","utmSource","useMemo","_d","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_e","animationCount","setAnimationCount","_f","isAnimating","setIsAnimating","shouldRenderSupercoins","_g","renderSuperCoinIsland","setRenderSuperCoinIsland","_h","chipAnimationType","setChipAnimationType","_j","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","chipBackgroundAnimationClassname","styles","chipTextAnimationClassname","useEffect","Number","handleScroll","window","scrollY","addEventListener","removeEventListener","timeout","shouldRender","setTimeout","clearTimeout","action_event_name","impression_event_name","restPayload","__rest","ravenSDKTrigger","action_name","page_name","supercoin_balance","u_utm_source","startTimer","switchBackTimer","newCount","_jsx","_Fragment","children","__assign","className","_jsxs","display","alignItems","gap","Shimmer","width","height","position","concat","onClick","src","alt","Typography","variant","Suspense","fallback","superCoins","onAnimationStart","onIslandAnimationStart","onAnimationEnd"],"mappings":"y/BAAA,SAAqBA,EAAKC,QACX,IAARA,IAAiBA,EAAM,CAAA,GAC5B,IAAIC,EAAWD,EAAIC,SAEnB,GAAgC,oBAAbC,SAAnB,CAEA,IAAIC,EAAOD,SAASC,MAAQD,SAASE,qBAAqB,QAAQ,GAC9DC,EAAQH,SAASI,cAAc,SAC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UAAW,UAAG5B,GAA0B,KAAAqC,OAAItC,EAA6B,KAAAsC,OAAIzD,EAA+BmB,EAAkC,GAAK,MAAA,CAAA2B,SAElJxC,EACKZ,EACAJ,KAGTU,GACG4C,EAACiB,EAAUd,EAAA,CACPe,QAAQ,MACRd,UAAW,GAAAS,OAAGtC,EAA0B,KAAAsC,OAAInD,EAAca,EAAkC,KAGnF,CAAA2B,SAAA,8BAK5BpC,KAA0BM,IACvB4B,EAAA,MAAAG,EAAA,CACIC,UAAW7B,GAEX,CAAA2B,SAAAF,EAACmB,EAAQhB,EAAA,CAACiB,SAAUpB,SAChB,CAAAE,SAAAF,EAAChE,EAA4B,CACzBqF,WAAY3E,EACZ4E,iBAAkB,WACd,ODtQlC,SAAiC1G,SACnCG,EAAUH,EAAAG,WACVgC,EAAiBnC,EAAAgC,aAAjBA,OAAe,IAAAG,EAAA,CAAE,EAAAA,EACjBG,EAActC,EAAAoC,UAAdA,OAAS,IAAAE,EAAG,GAAEA,EAKVN,EADqBwC,sBAAEC,EACvBzC,EAD4CyC,sBAAKC,EACjDC,EAAA3C,EADE,CAAA,oBAAA,0BAEN4C,EAAqD,QAApC7C,EAAA0C,SAAoC,IAAA1C,EAAAA,EAAA,kBACjD8C,YAAa,8BACbC,UAAW,mBACXC,kBAAmB5E,EACnB6E,aAAc5C,GACXsC,IAIP3D,eAAeG,QAAQ,wBAAyB,QAGhDF,GACJ,CCgPwC2F,CAAuB,CACnBxG,WACI2B,EACJE,aAAYA,EACZI,UAASA,GACX,EAENwE,eAzOhC,WACItD,GAAqB,OACxB,cA6OW,MAGhB","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","supercoinsFetchError","console","log","utmSource","useMemo","_e","useState","showSupercoinExpiryAnimation","setSupercoinExpiryAnimation","_f","animationCount","setAnimationCount","_g","isAnimating","setIsAnimating","_h","startWalletAnimation","setStartWalletAnimation","_j","calculatedAnimation","setCalculatedAnimation","shouldRenderSupercoins","_k","renderSuperCoinIsland","setRenderSuperCoinIsland","_l","chipAnimationType","setChipAnimationType","_m","hasScrolledBeforeAnimation","setHasScrolledBeforeAnimation","useRef","chipWidthCalculatedRef","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,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mI,EAAQ9H,EAAA,CAAC+H,SAAUpI,SAChB,CAAAD,SAAAC,EAACgC,EAA4B,CACzBqG,WAAY3F,EACZ4F,iBAAkB,WACd,OHtX1B,SAAiClK,SACnCG,EAAUH,EAAAG,WACVuE,EAAiB1E,EAAAuE,aAAjBA,OAAe,IAAAG,EAAA,CAAE,EAAAA,EACjBC,EAAc3E,EAAAgF,UAAdA,OAAS,IAAAL,EAAG,GAAEA,EAKVJ,EADqB8C,sBAAEC,EACvB/C,EAD4C+C,sBAAKC,EACjDC,EAAAjD,EADE,CAAA,oBAAA,0BAENkD,EAAqD,QAApClE,EAAA+D,SAAoC,IAAA/D,EAAAA,EAAA,kBACjDmE,YAAa,8BACbC,UAAW,mBACXC,kBAAmBzH,EACnB0H,aAAc7C,GACXuC,IAIPxG,eAAeG,QAAQ,wBAAyB,QAGhDF,GACJ,CGgWgCmJ,CAAuB,CACnBhK,WAAYmE,EACZC,aAAYA,EACZS,UAASA,KAGjBoF,eAtUxB,WACItF,QAAQC,IACJ,uDACAH,GAEJ4D,YAAW,WACP1D,QAAQC,IACJ,uHAC0CH,IAE1CA,GAAekB,GAAwB,EAC9C,GAAE,KACHU,GAAqB,OACxB,aAgUL","x_google_ignoreList":[0]}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../packages/components/
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../packages/components/SupercoinsChip/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onIslandAnimationStart.d.ts","sourceRoot":"","sources":["../../packages/components/
|
|
1
|
+
{"version":3,"file":"onIslandAnimationStart.d.ts","sourceRoot":"","sources":["../../packages/components/SupercoinsChip/src/utils/onIslandAnimationStart.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAkCrE,wBAAgB,sBAAsB,CAAC,EACnC,UAAU,EACV,YAAiB,EACjB,SAAc,GACjB,EAAE,0BAA0B,QAkB5B"}
|
|
@@ -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/
|
|
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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
interface IWalletAnimation {
|
|
3
|
+
supercoinBalance: number;
|
|
4
|
+
walletBalance: number;
|
|
5
|
+
handleClick: () => void;
|
|
6
|
+
chipWidthRef: MutableRefObject<number>;
|
|
7
|
+
}
|
|
8
|
+
export default function WalletAnimation({ supercoinBalance, walletBalance, handleClick, chipWidthRef, }: IWalletAnimation): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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.40",
|
|
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-shimmer": "4.2.0-beta.
|
|
15
|
-
"@cleartrip/ct-platform-supercoins-floating-island": "2.2.0-beta.
|
|
16
|
-
"@cleartrip/ct-platform-utils": "4.2.0-beta.
|
|
14
|
+
"@cleartrip/ct-platform-shimmer": "4.2.0-beta.40",
|
|
15
|
+
"@cleartrip/ct-platform-supercoins-floating-island": "2.2.0-beta.40",
|
|
16
|
+
"@cleartrip/ct-platform-utils": "4.2.0-beta.40"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"react": ">=16.8.0",
|