manage-app-sdk 0.0.2

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.
Files changed (133) hide show
  1. package/README.md +2 -0
  2. package/dist/Constants/Home.js +85 -0
  3. package/dist/assets/AppConstant.js +293 -0
  4. package/dist/assets/androidResources/Connectivity.java +52 -0
  5. package/dist/assets/androidResources/ConnectivityPackage.java +25 -0
  6. package/dist/assets/fonts/VoltePlay-Bold.ttf +0 -0
  7. package/dist/assets/fonts/VoltePlay-Light.ttf +0 -0
  8. package/dist/assets/fonts/VoltePlay-Medium.ttf +0 -0
  9. package/dist/assets/fonts/VoltePlay-Regular.ttf +0 -0
  10. package/dist/assets/fonts/VoltePlay-SemiBold.ttf +0 -0
  11. package/dist/assets/gif/loader.gif +0 -0
  12. package/dist/assets/images/PartnerLogosSmall.png +0 -0
  13. package/dist/assets/images/Union.png +0 -0
  14. package/dist/assets/images/appIcon.png +0 -0
  15. package/dist/assets/images/desktop-alert.png +0 -0
  16. package/dist/assets/images/desktop-cross.png +0 -0
  17. package/dist/assets/images/mobile-bg.png +0 -0
  18. package/dist/assets/images/stepper-one-small.png +0 -0
  19. package/dist/assets/images/stepper-one.png +0 -0
  20. package/dist/assets/images/stepper-two-small.png +0 -0
  21. package/dist/assets/images/stepper-two.png +0 -0
  22. package/dist/assets/images/tablet-bg.png +0 -0
  23. package/dist/assets/png/Tataplay-Binge.png +0 -0
  24. package/dist/assets/png/arrowBack.png +0 -0
  25. package/dist/assets/png/backArrowPng.png +0 -0
  26. package/dist/assets/svg/BingeLogoSvg.js +44 -0
  27. package/dist/assets/svg/CrossSvg.js +32 -0
  28. package/dist/assets/svg/OfferSvg.js +31 -0
  29. package/dist/assets/svg/PlansSvg.js +75 -0
  30. package/dist/assets/svg/TickSvg.js +28 -0
  31. package/dist/assets/svg/arrowBack.js +27 -0
  32. package/dist/assets/svg/arrowSvg.js +31 -0
  33. package/dist/components/AppIcon/AppIcon.js +70 -0
  34. package/dist/components/AppleBanner/AppleMusicBanner.js +36 -0
  35. package/dist/components/AppleBanner/AppleMusicBannerStyles.js +32 -0
  36. package/dist/components/AppleBanner/AppleMusicBlackBanner.js +66 -0
  37. package/dist/components/AppsContainer/AppsContainer.js +112 -0
  38. package/dist/components/BottomSheet/BottomSheet.js +173 -0
  39. package/dist/components/BottomSheet/BottomSheetStyles.js +48 -0
  40. package/dist/components/Buttons/PrimaryButton/PrimaryButton.js +50 -0
  41. package/dist/components/Buttons/RadioButton/RadioButton.js +24 -0
  42. package/dist/components/Buttons/TextButton/TextButton.js +44 -0
  43. package/dist/components/CheckButton/CheckButton.js +36 -0
  44. package/dist/components/CommonModal/CommonModel.js +79 -0
  45. package/dist/components/CommonModal/ModalTypes.js +10 -0
  46. package/dist/components/Confetti/ConfettiBurst.js +120 -0
  47. package/dist/components/Confetti/FallingConfetti.js +190 -0
  48. package/dist/components/Confetti/MultiConfettiBurst.js +73 -0
  49. package/dist/components/Coupon/CouponCard.js +47 -0
  50. package/dist/components/Coupon/CouponStyles.js +54 -0
  51. package/dist/components/Footer/Footer.js +177 -0
  52. package/dist/components/Footer/MServiceFooter/MServiceFooter.js +103 -0
  53. package/dist/components/Footer/OnButtonFooter/OneButtonFooter.js +65 -0
  54. package/dist/components/Footer/PlanSummaryFooter/SummaryFooter.js +180 -0
  55. package/dist/components/Footer/PrimeAoFooter/PrimeAoFooter.js +193 -0
  56. package/dist/components/Footer/UpgradeFooter/UpgradeFooter.js +89 -0
  57. package/dist/components/Footer/UpgradeFooter/styles.js +73 -0
  58. package/dist/components/GradientBorderContainer/GradientBorderContainer.js +79 -0
  59. package/dist/components/GradientText/GradientText.js +60 -0
  60. package/dist/components/Header/ManageAppHeader.js +71 -0
  61. package/dist/components/HighlightedText/HighlightedText.js +53 -0
  62. package/dist/components/Input/OtpInput.js +105 -0
  63. package/dist/components/Loader/Loader.js +39 -0
  64. package/dist/components/MServicePaymentMethod/MServicePaymentMethod.js +395 -0
  65. package/dist/components/MicroDrama/MicroDramaBanner.js +67 -0
  66. package/dist/components/MicroDrama/MicroDramaCard.js +33 -0
  67. package/dist/components/MicroDrama/styles.js +29 -0
  68. package/dist/components/OfferCard/OfferCard.js +100 -0
  69. package/dist/components/PaymentMethod/PaymentMethod.js +370 -0
  70. package/dist/components/Plan/CurrentPlanCard.js +138 -0
  71. package/dist/components/Plan/PlanCard.js +268 -0
  72. package/dist/components/Plan/PlanCardStyles.js +371 -0
  73. package/dist/components/Plan/RenderAppIcons.js +115 -0
  74. package/dist/components/Plan/SpecialPlanCard.js +272 -0
  75. package/dist/components/PopUps/CancelPopUp/CancelPopUp.js +190 -0
  76. package/dist/components/PopUps/ConfettiAnimation.js +172 -0
  77. package/dist/components/PopUps/ConfettiBurst.js +142 -0
  78. package/dist/components/PopUps/CouponPopUp/CouponPopUp.js +185 -0
  79. package/dist/components/PopUps/ErrorMsgPopup/ErrorMsgPopup.js +104 -0
  80. package/dist/components/PopUps/InternetErrorPopUp/InternetErrorPopUp.js +122 -0
  81. package/dist/components/PopUps/MServicePopUp/MServicePopUp.js +155 -0
  82. package/dist/components/PopUps/MpinPopUp/MpinPopUp.js +193 -0
  83. package/dist/components/PopUps/OtpPopup/OtpPopup.js +345 -0
  84. package/dist/components/PopUps/PlanCancelledPopUp/PlanCancelledPopUp.js +183 -0
  85. package/dist/components/PopUps/PlanDetailPopup/PlanDetailPopup.js +121 -0
  86. package/dist/components/PopUps/PopUp/PopUp.js +171 -0
  87. package/dist/components/PrimeAddOn/PrimeAddOn.js +72 -0
  88. package/dist/components/PrimeAddOn/PrimeAddOnStyles.js +79 -0
  89. package/dist/components/PrimeAddOn/SummaryPage/PrimeAddOnBanner.js +109 -0
  90. package/dist/components/PrimeBanner/PrimeBanner.js +27 -0
  91. package/dist/components/PrimeBanner/PrimeBannerStyles.js +36 -0
  92. package/dist/components/SectionItem/SectionItem.js +42 -0
  93. package/dist/components/Toast/Toast.js +71 -0
  94. package/dist/components/Toast/ToastStyle.js +62 -0
  95. package/dist/navigation/Routes.js +84 -0
  96. package/dist/navigation/RoutesConstants.js +18 -0
  97. package/dist/screens/AppDiscontinue/ChooseApp.js +325 -0
  98. package/dist/screens/AppDiscontinue/styles.js +89 -0
  99. package/dist/screens/AppsReplacement/AppsReplacement.js +359 -0
  100. package/dist/screens/AppsReplacement/styles.js +92 -0
  101. package/dist/screens/ChooseYourPlan/ChooseYourPlan.js +596 -0
  102. package/dist/screens/ChooseYourPlan/ChooseYourPlanStyles.js +28 -0
  103. package/dist/screens/ChooseYourPlan/OffersCarousel.js +146 -0
  104. package/dist/screens/CreateSession/CreateSession.js +620 -0
  105. package/dist/screens/MyPlan/MyPlan.js +429 -0
  106. package/dist/screens/MyPlan/MyPlanStyles.js +227 -0
  107. package/dist/screens/PaymentStatus/PaymentStatus.js +492 -0
  108. package/dist/screens/PaymentStatus/styles.js +68 -0
  109. package/dist/screens/PlanCancellation/CancelPlan.js +127 -0
  110. package/dist/screens/PlanCancellation/InfiniteAutoScroll.js +67 -0
  111. package/dist/screens/PlanCancellation/styles.js +83 -0
  112. package/dist/screens/PlanSummary/PlanSummary.js +748 -0
  113. package/dist/screens/PlanSummary/PlanSummaryStyles.js +385 -0
  114. package/dist/screens/PrimePlanSummary/PrimePlanSummary.js +252 -0
  115. package/dist/screens/PrimePlanSummary/PrimePlanSummaryStyles.js +102 -0
  116. package/dist/screens/SelectApps/SelectApps.js +513 -0
  117. package/dist/screens/SelectApps/SelectAppsStyles.js +165 -0
  118. package/dist/screens/SplashScreen/SplashScreen.js +82 -0
  119. package/dist/services/apiCall/action.js +718 -0
  120. package/dist/services/apiCall/apiServiceUtils.js +136 -0
  121. package/dist/services/apiCall/constants.js +42 -0
  122. package/dist/services/apiCall/parser.js +92 -0
  123. package/dist/services/apiCall/reducer.js +591 -0
  124. package/dist/services/global/action.js +111 -0
  125. package/dist/services/global/commonReducer.js +97 -0
  126. package/dist/services/global/constants.js +22 -0
  127. package/dist/services/serviceCommonHandler.js +220 -0
  128. package/dist/store/configureStore.js +13 -0
  129. package/dist/store/rootReducer.js +14 -0
  130. package/dist/utils/commonUtils.js +381 -0
  131. package/dist/utils/fontUtils.js +13 -0
  132. package/dist/utils/string.js +101 -0
  133. package/package.json +53 -0
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _reactNative = require("react-native");
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _commonUtils = require("../../utils/commonUtils");
11
+ var _AppConstant = require("../../assets/AppConstant");
12
+ var _reactNativeSvg = _interopRequireWildcard(require("react-native-svg"));
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ const ratio = _AppConstant.AppConstant.dimension.aspectRatio;
15
+ const OfferCard = ({
16
+ children
17
+ }) => {
18
+ const containerWidth = ratio * ((0, _commonUtils.isTablet)() ? 400 : 300);
19
+ const containerHeight = 70 * ratio;
20
+ const cutRadius = 9 * ratio;
21
+ const borderWidth = 2.5 * ratio;
22
+ const rectBorderWidth = 4 * ratio;
23
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
24
+ style: styles.container
25
+ }, /*#__PURE__*/_react.default.createElement(_reactNativeSvg.default, {
26
+ width: containerWidth,
27
+ height: containerHeight,
28
+ style: _reactNative.StyleSheet.absoluteFillObject
29
+ }, /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Mask, {
30
+ id: "ticketMask"
31
+ }, /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Rect, {
32
+ width: containerWidth,
33
+ height: containerHeight,
34
+ fill: "white",
35
+ rx: 12 * ratio,
36
+ stroke: "gray",
37
+ strokeWidth: rectBorderWidth,
38
+ strokeLinecap: "round",
39
+ strokeDasharray: `${10 * ratio}, ${10 * ratio}`
40
+ }), /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Circle, {
41
+ cx: 0,
42
+ cy: containerHeight / 2,
43
+ r: cutRadius,
44
+ fill: "black"
45
+ }), /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Circle, {
46
+ cx: containerWidth + 0 * ratio,
47
+ cy: containerHeight / 2,
48
+ r: cutRadius,
49
+ fill: "black"
50
+ })), /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Rect, {
51
+ width: containerWidth,
52
+ height: containerHeight,
53
+ fill: "white",
54
+ rx: 12 * ratio,
55
+ mask: "url(#ticketMask)"
56
+ }), /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Circle, {
57
+ cx: 0 * ratio,
58
+ cy: containerHeight / 2,
59
+ r: cutRadius,
60
+ stroke: "gray",
61
+ strokeLinecap: "round",
62
+ strokeWidth: borderWidth,
63
+ strokeDasharray: `${5 * ratio}, ${6 * ratio}`,
64
+ fill: "none"
65
+ }), /*#__PURE__*/_react.default.createElement(_reactNativeSvg.Circle, {
66
+ cx: containerWidth + 0 * ratio,
67
+ cy: containerHeight / 2,
68
+ r: cutRadius,
69
+ strokeLinecap: "round",
70
+ stroke: "gray",
71
+ strokeWidth: borderWidth,
72
+ strokeDasharray: `${5 * ratio}, ${6 * ratio}`,
73
+ fill: "none"
74
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
75
+ style: styles.innerContainer
76
+ }, children));
77
+ };
78
+ var _default = exports.default = /*#__PURE__*/_react.default.memo(OfferCard);
79
+ const styles = _reactNative.StyleSheet.create({
80
+ container: {
81
+ position: "relative",
82
+ height: 70 * ratio,
83
+ width: ratio * ((0, _commonUtils.isTablet)() ? 400 : 300),
84
+ alignSelf: "center",
85
+ overflow: "hidden",
86
+ marginRight: 12 * ratio
87
+ },
88
+ innerContainer: {
89
+ width: "100%",
90
+ height: "100%",
91
+ paddingHorizontal: 18 * ratio,
92
+ padding: ratio * 10,
93
+ borderRadius: ratio * 12,
94
+ // borderWidth: ratio * 2,
95
+ // borderStyle: "dashed",
96
+ // borderColor: "gray",
97
+ flexDirection: "row",
98
+ alignItems: "center"
99
+ }
100
+ });
@@ -0,0 +1,370 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _reactNative = require("react-native");
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _reactRedux = require("react-redux");
11
+ var _native = require("@react-navigation/native");
12
+ var _AppConstant = require("../../assets/AppConstant");
13
+ var _commonUtils = require("../../utils/commonUtils");
14
+ var _action = require("../../services/global/action");
15
+ var _action2 = require("../../services/apiCall/action");
16
+ var _serviceCommonHandler = require("../../services/serviceCommonHandler");
17
+ var _OtpPopup = _interopRequireDefault(require("../PopUps/OtpPopup/OtpPopup"));
18
+ var _Home = require("../../Constants/Home");
19
+ var _string = require("../../utils/string");
20
+ var _BingeLogoSvg = _interopRequireDefault(require("../../assets/svg/BingeLogoSvg"));
21
+ var _CrossSvg = _interopRequireDefault(require("../../assets/svg/CrossSvg"));
22
+ var _arrowBack = _interopRequireDefault(require("../../assets/svg/arrowBack"));
23
+ var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
24
+ var _fontUtils = require("../../utils/fontUtils");
25
+ var _RadioButton = _interopRequireDefault(require("../Buttons/RadioButton/RadioButton"));
26
+ var _lodash = require("lodash");
27
+ var _PrimaryButton = _interopRequireDefault(require("../Buttons/PrimaryButton/PrimaryButton"));
28
+ var _PopUp = _interopRequireDefault(require("../PopUps/PopUp/PopUp"));
29
+ var _ModalTypes = require("../CommonModal/ModalTypes");
30
+ var _MpinPopUp = _interopRequireDefault(require("../PopUps/MpinPopUp/MpinPopUp"));
31
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
32
+ const PaymentMethod = ({
33
+ pageData,
34
+ modalData,
35
+ identifyMixpanelId,
36
+ onClose
37
+ }) => {
38
+ var _AppConstant$getManif, _pageData$paymentPopu;
39
+ const dispatch = (0, _reactRedux.useDispatch)();
40
+ const navigation = (0, _native.useNavigation)();
41
+ const [error, setError] = (0, _react.useState)(false);
42
+ const [lowBlsError, setLowBlsError] = (0, _react.useState)(false);
43
+ const {
44
+ selectedPayment = "",
45
+ createSessionResponse,
46
+ cartId
47
+ } = (0, _reactRedux.useSelector)(state => state.manageAppReducer);
48
+ const scaleAnim = (0, _reactNative.useAnimatedValue)(0.8);
49
+ const opacityAnim = (0, _reactNative.useAnimatedValue)(0);
50
+ (0, _react.useEffect)(() => {
51
+ if (!(0, _commonUtils.isTablet)()) return;
52
+ _reactNative.Animated.parallel([_reactNative.Animated.spring(scaleAnim, {
53
+ toValue: 1,
54
+ friction: 6,
55
+ useNativeDriver: true
56
+ }), _reactNative.Animated.timing(opacityAnim, {
57
+ toValue: 1,
58
+ duration: 250,
59
+ useNativeDriver: true
60
+ })]).start();
61
+ }, [scaleAnim, opacityAnim]);
62
+ const {
63
+ source = "",
64
+ agentType = "",
65
+ subscriberId,
66
+ accountId,
67
+ mixpanelId,
68
+ journeyType = "",
69
+ journey,
70
+ rmn = ""
71
+ } = createSessionResponse;
72
+ const errorData = (_AppConstant$getManif = _AppConstant.AppConstant.getManifestJson()) === null || _AppConstant$getManif === void 0 ? void 0 : _AppConstant$getManif.errorMsg;
73
+ const closeModal = () => {
74
+ if ((0, _commonUtils.isTablet)()) {
75
+ _reactNative.Animated.parallel([_reactNative.Animated.timing(scaleAnim, {
76
+ toValue: 0.8,
77
+ duration: 150,
78
+ useNativeDriver: true
79
+ }), _reactNative.Animated.timing(opacityAnim, {
80
+ toValue: 0,
81
+ duration: 150,
82
+ useNativeDriver: true
83
+ })]).start(() => {
84
+ onClose();
85
+ });
86
+ } else {
87
+ onClose();
88
+ }
89
+ };
90
+ const selectPack = (rechargeType, checked) => {
91
+ setError(false);
92
+ setLowBlsError(false);
93
+ if (checked) {
94
+ dispatch((0, _action2.setSelectedPayment)(rechargeType));
95
+ }
96
+ };
97
+ const fetchOtpApi = async () => {
98
+ try {
99
+ const apiPath = _AppConstant.AppConstant.getApiUrlFromManifest("getOtp");
100
+ const getPlansApi = (0, _commonUtils.replaceStringWithParams)(apiPath, {
101
+ "<source>": `${source}`
102
+ });
103
+ const resObj = await (0, _commonUtils.fetchWithHeaders)(getPlansApi, _serviceCommonHandler.serviceConsts.method.post, {});
104
+ if (resObj !== null && resObj !== void 0 && resObj.status) {
105
+ dispatch((0, _action.showModal)({
106
+ modalType: (0, _commonUtils.isTablet)() ? _ModalTypes.MODAL_TYPES.Modal : _ModalTypes.MODAL_TYPES.BottomSheet,
107
+ pageData: pageData,
108
+ type: "mService",
109
+ Component: _OtpPopup.default
110
+ }));
111
+ }
112
+ } catch (error) {
113
+ (0, _commonUtils.handleError)(error);
114
+ }
115
+ };
116
+ const fetchDthApi = async () => {
117
+ if (["APPDISCONTINUE", "APPREPLACE", "ZEROAPPSELECTION"].includes(journey)) {
118
+ fetchOtpApi();
119
+ } else {
120
+ try {
121
+ const apiPath = _AppConstant.AppConstant.getApiUrlFromManifest("validateDhamaka");
122
+ const dhamakaApi = (0, _commonUtils.replaceStringWithParams)(apiPath, {
123
+ "<source>": `${source}`
124
+ });
125
+ const payload = {
126
+ uuid: cartId,
127
+ subscriberId: subscriberId,
128
+ rmn: rmn
129
+ };
130
+ const responseObj = await (0, _commonUtils.fetchWithHeaders)(dhamakaApi, _serviceCommonHandler.serviceConsts.method.post, payload);
131
+ if (responseObj && responseObj.status) {
132
+ fetchOtpApi();
133
+ } else {
134
+ dispatch((0, _action.showModal)({
135
+ modalData: responseObj.error,
136
+ type: "success",
137
+ Component: _PopUp.default,
138
+ popType: "msales"
139
+ }));
140
+ }
141
+ } catch (error) {
142
+ (0, _commonUtils.handleError)(error);
143
+ }
144
+ }
145
+ };
146
+ const redirectionApi = () => {
147
+ const apiPath1 = _AppConstant.AppConstant.getApiUrlFromManifest("pageRedirection");
148
+ const type = source === "MSALES" && journeyType === "CUSTOMER" ? journeyType : "";
149
+ const redirectionApi = (0, _commonUtils.replaceStringWithParams)(apiPath1, {
150
+ "<source>": `${source}`
151
+ });
152
+ (0, _commonUtils.fetchRedirectionApi)(_Home.pageConstants.PlanSummaryPage, cartId, navigation, redirectionApi, type);
153
+ };
154
+ const redirecToPayment = () => {
155
+ if (selectedPayment === _Home.mSalesConstants.EVD && (modalData === null || modalData === void 0 ? void 0 : modalData.evdBalAvailable) === false) {
156
+ setError(true);
157
+ } else {
158
+ if (selectedPayment === _Home.mSalesConstants.EVD && (modalData === null || modalData === void 0 ? void 0 : modalData.evdBalAvailable) === true) {
159
+ dispatch((0, _action.showModal)({
160
+ modalType: (0, _commonUtils.isTablet)() ? _ModalTypes.MODAL_TYPES.Modal : _ModalTypes.MODAL_TYPES.BottomSheet,
161
+ pageData: pageData,
162
+ type: "MSALES",
163
+ Component: _MpinPopUp.default
164
+ }));
165
+ } else if (selectedPayment === _Home.mSalesConstants.DTH && !(0, _lodash.isEmpty)(modalData === null || modalData === void 0 ? void 0 : modalData.rechargeUrl) && (source !== "MSALES" || source === "MSALES" && journeyType === "CUSTOMER")) {
166
+ // TODO rechargeFormSubmit(modalData?.rechargeUrl)
167
+ } else if (selectedPayment === _Home.mSalesConstants.DTH && !(0, _lodash.isEmpty)(modalData === null || modalData === void 0 ? void 0 : modalData.rechargeUrl) && source === "MSALES" && journeyType !== "CUSTOMER") {
168
+ setLowBlsError(true);
169
+ } else if (selectedPayment === _Home.mSalesConstants.DTH && (0, _lodash.isEmpty)(modalData === null || modalData === void 0 ? void 0 : modalData.rechargeUrl)) {
170
+ fetchDthApi();
171
+ } else if (selectedPayment === _Home.mSalesConstants.LINK) {
172
+ (0, _commonUtils.fetchSendLinkApi)(pageData);
173
+ } else {
174
+ if ((0, _lodash.isEmpty)(accountId) && (0, _lodash.isEmpty)(mixpanelId)) {
175
+ // fetchMixpanelId();
176
+ } else {
177
+ redirectionApi();
178
+ }
179
+ }
180
+ }
181
+ };
182
+ const Data = (0, _string.jsonCopy)(pageData.paymentData);
183
+ const paymentData = Data.map(item => {
184
+ if (item.id === "EVD" && ["Binge EVD"].includes(agentType)) {
185
+ return {
186
+ ...item,
187
+ isSelect: true
188
+ };
189
+ } else if (item.id === "DTH") {
190
+ return {
191
+ ...item,
192
+ isSelect: (modalData === null || modalData === void 0 ? void 0 : modalData.redirectionFlag) === false ? true : false
193
+ };
194
+ } else if (item.id === "OTHER") {
195
+ return {
196
+ ...item,
197
+ isSelect: false
198
+ };
199
+ } else if (item.id === "LINK") {
200
+ return {
201
+ ...item,
202
+ isSelect: true
203
+ };
204
+ } else {
205
+ return {
206
+ ...item,
207
+ isSelect: false
208
+ };
209
+ }
210
+ });
211
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
212
+ style: [styles.container, (0, _commonUtils.isTablet)() && styles.tabletStyle, (0, _commonUtils.isTablet)() && {
213
+ transform: [{
214
+ scale: scaleAnim
215
+ }],
216
+ opacity: opacityAnim
217
+ }]
218
+ }, (0, _commonUtils.isTablet)() && /*#__PURE__*/_react.default.createElement(_reactNativeLinearGradient.default, {
219
+ colors: ["#200042", "#170134ff", "#0a0013ff"],
220
+ start: {
221
+ x: 0,
222
+ y: 0
223
+ },
224
+ end: {
225
+ x: 1,
226
+ y: 0
227
+ },
228
+ style: styles.backgroundGradient
229
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
230
+ style: styles.header
231
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
232
+ onPress: closeModal,
233
+ activeOpacity: 0.7
234
+ }, (0, _commonUtils.isTablet)() ? /*#__PURE__*/_react.default.createElement(_CrossSvg.default, {
235
+ style: styles.navigationSvg
236
+ }) : /*#__PURE__*/_react.default.createElement(_arrowBack.default, {
237
+ style: styles.navigationSvg
238
+ })), !(0, _commonUtils.isTablet)() && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
239
+ style: styles.bingeLogo
240
+ }, /*#__PURE__*/_react.default.createElement(_BingeLogoSvg.default, {
241
+ width: 100,
242
+ height: 20
243
+ }))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
244
+ style: styles.content
245
+ }, (0, _commonUtils.isTablet)() && /*#__PURE__*/_react.default.createElement(_BingeLogoSvg.default, null), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
246
+ style: styles.heading
247
+ }, pageData === null || pageData === void 0 || (_pageData$paymentPopu = pageData.paymentPopup) === null || _pageData$paymentPopu === void 0 ? void 0 : _pageData$paymentPopu.heading), !(0, _lodash.isEmpty)(paymentData) && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
248
+ style: styles.paymentOptions
249
+ }, paymentData.map((item, index) => item.isSelect && /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
250
+ activeOpacity: 0.9,
251
+ key: `${index}_${item.id}`,
252
+ style: styles.paymentOption,
253
+ onPress: () => selectPack(item.title, !(selectedPayment == item.title))
254
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
255
+ style: styles.buttonNdText
256
+ }, /*#__PURE__*/_react.default.createElement(_RadioButton.default, {
257
+ selected: selectedPayment == item.title,
258
+ onPress: checked => selectPack(item.title, checked)
259
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
260
+ style: styles.optionText
261
+ }, item.title)), item.id != "OTHER" && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
262
+ style: styles.balanceText
263
+ }, item.id === "EVD" ? (modalData === null || modalData === void 0 ? void 0 : modalData.evdBalance) && `₹${modalData === null || modalData === void 0 ? void 0 : modalData.evdBalance}` : item.id === "LINK" ? "" : `₹${modalData === null || modalData === void 0 ? void 0 : modalData.dthBalance}`)))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
264
+ style: styles.buttonContainer
265
+ }, error && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
266
+ style: styles.error
267
+ }, pageData === null || pageData === void 0 ? void 0 : pageData.evdMessage), lowBlsError && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
268
+ style: styles.error
269
+ }, pageData === null || pageData === void 0 ? void 0 : pageData.insufficientBls), /*#__PURE__*/_react.default.createElement(_PrimaryButton.default, {
270
+ style: styles.button,
271
+ title: pageData === null || pageData === void 0 ? void 0 : pageData.btnLabel,
272
+ onPress: redirecToPayment
273
+ }))));
274
+ };
275
+ var _default = exports.default = PaymentMethod;
276
+ const ratio = _AppConstant.AppConstant.dimension.aspectRatio;
277
+ const styles = _reactNative.StyleSheet.create({
278
+ container: {
279
+ padding: 15 * ratio,
280
+ paddingHorizontal: 20 * ratio,
281
+ alignItems: "center"
282
+ },
283
+ header: {
284
+ flexDirection: "row",
285
+ width: "100%",
286
+ alignItems: "center",
287
+ marginBottom: 15 * ratio
288
+ },
289
+ navigationSvg: {
290
+ paddingStart: 20 * ratio,
291
+ width: 50,
292
+ height: 50
293
+ },
294
+ bingeLogo: {
295
+ width: "100%",
296
+ position: "absolute",
297
+ left: 0,
298
+ right: 0,
299
+ alignItems: "center",
300
+ justifyContent: "center"
301
+ },
302
+ backgroundGradient: {
303
+ borderRadius: 14 * ratio,
304
+ position: "absolute",
305
+ top: 0,
306
+ left: 0,
307
+ right: 0,
308
+ bottom: 0
309
+ },
310
+ tabletStyle: {
311
+ width: ratio * 450,
312
+ borderWidth: 1,
313
+ borderColor: "#554372",
314
+ borderRadius: 14 * ratio,
315
+ padding: 25 * ratio
316
+ },
317
+ content: {
318
+ width: "100%",
319
+ alignItems: "center"
320
+ },
321
+ heading: {
322
+ color: "white",
323
+ fontSize: (0, _AppConstant.normalizeFont)(23),
324
+ fontFamily: _fontUtils.FONTS.Medium,
325
+ marginTop: 15 * ratio
326
+ },
327
+ paymentOptions: {
328
+ gap: 15 * ratio,
329
+ alignItems: "center",
330
+ marginTop: 40 * ratio,
331
+ width: "90%"
332
+ },
333
+ paymentOption: {
334
+ flexDirection: "row",
335
+ alignItems: "center",
336
+ width: "100%",
337
+ justifyContent: "space-between"
338
+ },
339
+ optionText: {
340
+ fontSize: (0, _AppConstant.normalizeFont)(18),
341
+ color: "white",
342
+ fontFamily: _fontUtils.FONTS.Medium,
343
+ marginLeft: 10 * ratio
344
+ },
345
+ balanceText: {
346
+ fontSize: (0, _AppConstant.normalizeFont)(18),
347
+ color: "#8e82a1",
348
+ fontFamily: _fontUtils.FONTS.Medium,
349
+ marginLeft: 10 * ratio
350
+ },
351
+ buttonNdText: {
352
+ flexDirection: "row",
353
+ alignItems: "center"
354
+ },
355
+ buttonContainer: {
356
+ width: "100%",
357
+ alignItems: "center",
358
+ marginTop: 25 * ratio,
359
+ paddingHorizontal: 15 * ratio
360
+ },
361
+ error: {
362
+ color: "#e53835cf",
363
+ fontSize: (0, _AppConstant.normalizeFont)(13),
364
+ fontFamily: _fontUtils.FONTS.Medium,
365
+ alignSelf: "baseline"
366
+ },
367
+ button: {
368
+ width: "100%"
369
+ }
370
+ });
@@ -0,0 +1,138 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _reactNative = require("react-native");
9
+ var _PlanCardStyles = _interopRequireDefault(require("./PlanCardStyles"));
10
+ var _reactRedux = require("react-redux");
11
+ var _string = require("../../utils/string");
12
+ var _lodash = require("lodash");
13
+ var _RenderAppIcons = require("./RenderAppIcons");
14
+ var _react = _interopRequireWildcard(require("react"));
15
+ var _commonUtils = require("../../utils/commonUtils");
16
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
17
+ var _PrimaryButton = _interopRequireDefault(require("../Buttons/PrimaryButton/PrimaryButton"));
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
19
+ const CurrentPlanCard = ({
20
+ drupal,
21
+ plan,
22
+ userExistingPacks,
23
+ selectTenure,
24
+ onButtonClick
25
+ }) => {
26
+ var _plan$appList, _appsList$BUCKET, _appsList$BUCKET2, _plan$devicesList, _plan$deviceListInfo2;
27
+ const {
28
+ journey,
29
+ existingPacks: {
30
+ appsList = {},
31
+ entitledAppCount = ""
32
+ } = {}
33
+ } = (0, _reactRedux.useSelector)(state => state.manageAppReducer.createSessionResponse);
34
+ const planAppList = (plan === null || plan === void 0 || (_plan$appList = plan.appList) === null || _plan$appList === void 0 ? void 0 : _plan$appList["BUCKET1"]) ?? [];
35
+ const tenuresList = (plan === null || plan === void 0 ? void 0 : plan.tenureList) ?? [];
36
+ const complimentaryCount = planAppList === null || planAppList === void 0 ? void 0 : planAppList.filter(it => it.isComplimentary).length;
37
+ const appCount = (plan === null || plan === void 0 ? void 0 : plan.productType) === "Flexi" ? ((_appsList$BUCKET = appsList["BUCKET1"]) === null || _appsList$BUCKET === void 0 ? void 0 : _appsList$BUCKET.length) || entitledAppCount : planAppList.length;
38
+ const isSportsPlus = ["BINGEMON86", "BINGEMON71"].find(id => (plan === null || plan === void 0 ? void 0 : plan.packId) == id);
39
+ const couponCodeExist = () => {
40
+ const couponOfferExist = tenuresList.filter(item => item.couponOfferId !== null);
41
+ if (!(0, _lodash.isEmpty)(couponOfferExist) && Array.isArray(couponOfferExist)) {
42
+ return true;
43
+ }
44
+ return false;
45
+ };
46
+ const tagArray = (0, _react.useMemo)(() => {
47
+ const tags = [];
48
+ if (plan !== null && plan !== void 0 && plan.isCurrentPlan && drupal !== null && drupal !== void 0 && drupal.currentPlanTag) tags.push(drupal === null || drupal === void 0 ? void 0 : drupal.currentPlanTag);
49
+ if (couponCodeExist() && drupal !== null && drupal !== void 0 && drupal.superSaverTag) tags.push(drupal === null || drupal === void 0 ? void 0 : drupal.superSaverTag);
50
+ if (journey !== "COUPONS" && !couponCodeExist() && (plan === null || plan === void 0 ? void 0 : plan.packType.toUpperCase()) == "BS" && drupal !== null && drupal !== void 0 && drupal.BingeBestsellers) tags.push(drupal === null || drupal === void 0 ? void 0 : drupal.BingeBestsellers);
51
+ if (isSportsPlus && drupal !== null && drupal !== void 0 && drupal.SportsTagName) tags.push(drupal === null || drupal === void 0 ? void 0 : drupal.SportsTagName);
52
+ if (["BINGEMON112"].includes(plan === null || plan === void 0 ? void 0 : plan.packId)) tags.push(drupal === null || drupal === void 0 ? void 0 : drupal.englishTag);
53
+ return tags;
54
+ }, [isSportsPlus, plan, drupal]);
55
+ const getMainHeading = () => {
56
+ const text = (0, _string.replacePlaceholderInString)(drupal === null || drupal === void 0 ? void 0 : drupal.choosePlanTitle, "appCount", appCount + complimentaryCount);
57
+ return text;
58
+ };
59
+ const getBenefitsText = () => {
60
+ if ((plan === null || plan === void 0 ? void 0 : plan.productType) === "Flexi") {
61
+ return appCount + " Apps + " + complimentaryCount + " Complimentary";
62
+ } else {
63
+ return appCount + " Apps included";
64
+ }
65
+ };
66
+ const getWatchOnDevices = () => (0, _string.replacePlaceholderInString)((0, _commonUtils.isTablet)() ? drupal === null || drupal === void 0 ? void 0 : drupal.watchLDevice : drupal === null || drupal === void 0 ? void 0 : drupal.watchDevice, "deviceCount", plan === null || plan === void 0 ? void 0 : plan.totalDevices);
67
+ const getWatchDevices = () => {
68
+ var _plan$deviceListInfo;
69
+ return (plan === null || plan === void 0 || (_plan$deviceListInfo = plan.deviceListInfo) === null || _plan$deviceListInfo === void 0 ? void 0 : _plan$deviceListInfo.title) ?? "";
70
+ };
71
+ const appsToRender = (plan === null || plan === void 0 ? void 0 : plan.productType) == "Flexi" ? appsList === null || appsList === void 0 || (_appsList$BUCKET2 = appsList["BUCKET1"]) === null || _appsList$BUCKET2 === void 0 ? void 0 : _appsList$BUCKET2.slice(0, 3) : planAppList;
72
+ const shouldAlignCenter = !((appsToRender === null || appsToRender === void 0 ? void 0 : appsToRender.length) > ((0, _commonUtils.isTablet)() ? 5 : 4));
73
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
74
+ style: _PlanCardStyles.default.container
75
+ }, !(0, _lodash.isEmpty)(tagArray) && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
76
+ style: {
77
+ flexDirection: "row",
78
+ gap: 2
79
+ }
80
+ }, tagArray.map((tag, idx) => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
81
+ key: idx,
82
+ style: _PlanCardStyles.default.tagContainer
83
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
84
+ style: _PlanCardStyles.default.tagText
85
+ }, tag)))), /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.View, {
86
+ layout: _reactNativeReanimated.LinearTransition.easing(_reactNativeReanimated.Easing.linear).duration(120),
87
+ style: _PlanCardStyles.default.card
88
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, null, (plan === null || plan === void 0 ? void 0 : plan.packId) === "BINGETRL04" ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
89
+ style: _PlanCardStyles.default.heading
90
+ }, (plan === null || plan === void 0 ? void 0 : plan.productType) == "Flexi" ? (0, _string.replacePlaceholderInString)(drupal === null || drupal === void 0 ? void 0 : drupal.flexiHeading, "appCount", appCount) : (0, _string.replacePlaceholderInString)(drupal === null || drupal === void 0 ? void 0 : drupal.fixedHeading, "appCount", appCount)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
91
+ style: [_PlanCardStyles.default.watchDevicesContainer, (0, _commonUtils.isTablet)() && _PlanCardStyles.default.flexDirectionRow]
92
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
93
+ style: _PlanCardStyles.default.deviceText
94
+ }, (0, _string.replacePlaceholderInString)((0, _commonUtils.isTablet)() ? drupal === null || drupal === void 0 ? void 0 : drupal.watchLDevice : drupal === null || drupal === void 0 ? void 0 : drupal.watchDevice, "deviceCount", plan === null || plan === void 0 || (_plan$devicesList = plan.devicesList) === null || _plan$devicesList === void 0 ? void 0 : _plan$devicesList.length)), (0, _commonUtils.isTablet)() && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
95
+ style: _PlanCardStyles.default.deviceText
96
+ }, " | "), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
97
+ style: _PlanCardStyles.default.deviceText
98
+ }, plan === null || plan === void 0 || (_plan$deviceListInfo2 = plan.deviceListInfo) === null || _plan$deviceListInfo2 === void 0 ? void 0 : _plan$deviceListInfo2.title))) : /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
99
+ style: _PlanCardStyles.default.heading
100
+ }, getMainHeading()), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
101
+ style: _PlanCardStyles.default.benefitsContainer
102
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
103
+ style: _PlanCardStyles.default.benefitsText
104
+ }, getBenefitsText()))), /*#__PURE__*/_react.default.createElement(_reactNative.View, null, (plan === null || plan === void 0 ? void 0 : plan.packId) !== "BINGETRL04" && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
105
+ style: [_PlanCardStyles.default.watchDevicesContainer, (0, _commonUtils.isTablet)() && _PlanCardStyles.default.flexDirectionRow]
106
+ }, (plan === null || plan === void 0 ? void 0 : plan.totalDevices) && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
107
+ style: _PlanCardStyles.default.deviceText
108
+ }, getWatchOnDevices()), (0, _commonUtils.isTablet)() && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
109
+ style: _PlanCardStyles.default.deviceText
110
+ }, " | "), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
111
+ style: _PlanCardStyles.default.deviceText
112
+ }, getWatchDevices())), /*#__PURE__*/_react.default.createElement(_RenderAppIcons.RenderAppIcons, {
113
+ appList: appsToRender,
114
+ productType: plan === null || plan === void 0 ? void 0 : plan.productType,
115
+ isFreeTrialPack: plan === null || plan === void 0 ? void 0 : plan.isFreeTrialPack,
116
+ drupal: drupal,
117
+ iconWidth: 56,
118
+ iconHeight: 56,
119
+ rowStyle: [_PlanCardStyles.default.currentPlanAppRowPadding, shouldAlignCenter && {
120
+ justifyContent: "center"
121
+ }],
122
+ maxSlots: (0, _commonUtils.isTablet)() ? 10 : 8
123
+ }), !(0, _lodash.isEmpty)(entitledAppCount) && (plan === null || plan === void 0 ? void 0 : plan.productType) === "Flexi" && (plan === null || plan === void 0 ? void 0 : plan.isCurrentPlan) && (plan === null || plan === void 0 ? void 0 : plan.packId) !== "BINGETRL04" && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
124
+ style: _PlanCardStyles.default.app
125
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
126
+ style: _PlanCardStyles.default.appIconsRow
127
+ }, Array.from({
128
+ length: entitledAppCount
129
+ }).map((_, index) => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
130
+ key: `entitled-app-${index}`,
131
+ style: _PlanCardStyles.default.appIconWrapper
132
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
133
+ source: require("../../assets/images/PartnerLogosSmall.png"),
134
+ style: _PlanCardStyles.default.appIcon,
135
+ resizeMode: "contain"
136
+ })))))))));
137
+ };
138
+ var _default = exports.default = /*#__PURE__*/_react.default.memo(CurrentPlanCard);