@cleartrip/ct-platform-login-module 0.1.42-b5

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.
@@ -0,0 +1,551 @@
1
+ import { __assign, __awaiter, __generator, __spreadArray, __rest } from 'tslib';
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { useRef, useState, useEffect, useCallback } from 'react';
4
+ import { Drawer } from '@cleartrip/ct-platform-drawer';
5
+ import { ThemeProvider } from '@cleartrip/ct-design-theme';
6
+ import { AlertCallout, Typography, FieldV2, Spacer, Spinner, PhoneField, Button, Divider, Toast } from '@cleartrip/ct-design-components';
7
+ import { LOGIN_CONSTANTS, NAVIGATION_ROUTES } from '@cleartrip/ct-platform-constants';
8
+ import { getRavenEventProps, ravenSDKTrigger, isIOSApp, autoReadOtp, isEmpty, updateNativeOnLogin, validateOtp, isHTMLInputElement, isNumeric, isFKSSOEnabled, isAndroidApp, handleFKSSO, MULTI_SPACE, isValidMobileNumber, showMobileNumberHint, getQueryParam, updateNativeAndroidOnSignIn, triggerOTPListener, sendLoginOtp, getCurrentPathName } from '@cleartrip/ct-platform-utils';
9
+ import { InfoIcon, Edit, CheckCircle } from '@cleartrip/ct-design-icons';
10
+ import classNames from 'classnames';
11
+ import { FlipkartLogo } from '@cleartrip/ct-platform-assets';
12
+ import { Swiper, SwiperSlide } from 'swiper/react';
13
+
14
+ function styleInject(css, ref) {
15
+ if (ref === void 0) ref = {};
16
+ var insertAt = ref.insertAt;
17
+ if (!css || typeof document === 'undefined') {
18
+ return;
19
+ }
20
+ var head = document.head || document.getElementsByTagName('head')[0];
21
+ var style = document.createElement('style');
22
+ style.type = 'text/css';
23
+ if (insertAt === 'top') {
24
+ if (head.firstChild) {
25
+ head.insertBefore(style, head.firstChild);
26
+ } else {
27
+ head.appendChild(style);
28
+ }
29
+ } else {
30
+ head.appendChild(style);
31
+ }
32
+ if (style.styleSheet) {
33
+ style.styleSheet.cssText = css;
34
+ } else {
35
+ style.appendChild(document.createTextNode(css));
36
+ }
37
+ }
38
+
39
+ var css_248z$1 = ".index-module_mobileinput_footertext__jPQ-g a{color:#0f6bff;text-decoration:none}.index-module_mobileinput-seperator__7Ewok{position:relative}.index-module_mobileinput_seperatortext__-KDOp{background:#fff;left:0;margin:0 auto;position:absolute;right:0;text-align:center;top:-10px;width:40px}.index-module_slider_carousel_wrapper__0SuGB{border-top-left-radius:16px;border-top-right-radius:16px;width:100dvw}.index-module_login_form__tpSDz{background-color:#fff;padding-left:16px;padding-right:16px}.index-module_nonUtilsSelector_toast__lvWmB{bottom:12px!important;margin-bottom:12px;margin:0 auto!important;padding:12px 16px!important;width:calc(100% - 48px)!important;z-index:2000}.index-module_login_otp_error__o3y2L{padding-top:4px}.index-module_login_otp_input__L-3P8{font-size:24px!important;font-style:normal;font-weight:600!important;height:56px!important;line-height:28px;padding:auto;text-align:center;width:56px!important}.index-module_footer_text__nkeJv{color:grey!important;font-size:12px!important}.index-module_swiper-custom-pagination__Ma1gV{--swiper-pagination-color:#fff;--swiper-pagination-bullet-inactive-color:#999;--swiper-pagination-bullet-inactive-opacity:1}.index-module_otp_box_wrapper__sM2Ba{margin-right:8px}.index-module_otp_container__1CE4N{display:flex;flex-direction:column;margin-top:24px}.index-module_swiper__r5-8U{height:100%;width:100%}.index-module_swiper__r5-8U .index-module_swiper-slide__Zchn0{height:auto}.index-module_swiper-slide__Zchn0 img{display:block;height:100%;object-fit:fill;width:100%}";
40
+ var styles = {"mobileinput_footertext":"index-module_mobileinput_footertext__jPQ-g","mobileinput-seperator":"index-module_mobileinput-seperator__7Ewok","mobileinput_seperatortext":"index-module_mobileinput_seperatortext__-KDOp","slider_carousel_wrapper":"index-module_slider_carousel_wrapper__0SuGB","login_form":"index-module_login_form__tpSDz","nonUtilsSelector_toast":"index-module_nonUtilsSelector_toast__lvWmB","login_otp_error":"index-module_login_otp_error__o3y2L","login_otp_input":"index-module_login_otp_input__L-3P8","footer_text":"index-module_footer_text__nkeJv","swiper-custom-pagination":"index-module_swiper-custom-pagination__Ma1gV","otp_box_wrapper":"index-module_otp_box_wrapper__sM2Ba","otp_container":"index-module_otp_container__1CE4N","swiper":"index-module_swiper__r5-8U","swiper-slide":"index-module_swiper-slide__Zchn0"};
41
+ styleInject(css_248z$1);
42
+
43
+ var AutoDetectState;
44
+ (function (AutoDetectState) {
45
+ AutoDetectState[AutoDetectState["DETECTING"] = 0] = "DETECTING";
46
+ AutoDetectState[AutoDetectState["FAILED"] = 1] = "FAILED";
47
+ AutoDetectState[AutoDetectState["DETECTED"] = 2] = "DETECTED";
48
+ })(AutoDetectState || (AutoDetectState = {}));
49
+ var OtpInput = function (_a) {
50
+ var mobileNumber = _a.mobileNumber, errorCallout = _a.errorCallout, ravenPayload = _a.ravenPayload, otpInputHeight = _a.otpInputHeight, skipProfileFlow = _a.skipProfileFlow, otpResendDisabled = _a.otpResendDisabled, getOTP = _a.getOTP, setCtaDisabled = _a.setCtaDisabled, setErrorCallout = _a.setErrorCallout, setMobileNumber = _a.setMobileNumber, setShowMobilePage = _a.setShowMobilePage, handleLoginSuccess = _a.handleLoginSuccess, handleLoginFailure = _a.handleLoginFailure;
51
+ var inputRefs = useRef(Array(4).fill(null));
52
+ var _b = useState(AutoDetectState.DETECTING), autoDetecting = _b[0], setAutoDetecting = _b[1];
53
+ var _c = useState(LOGIN_CONSTANTS.OTP_COUNTDOWN), countdown = _c[0], setCountdown = _c[1];
54
+ var _d = useState(''), otp = _d[0], setOtp = _d[1];
55
+ var _f = useState(true), countdownEnabled = _f[0], setCountdownEnabled = _f[1];
56
+ var _g = useState(false), verifiedOtp = _g[0], setVerifiedOtp = _g[1];
57
+ var _h = useState(''), otpErrorMessage = _h[0], setOtpErrorMessage = _h[1];
58
+ var _j = useState(true), enableAutoDetect = _j[0], setEnableAutoDetect = _j[1];
59
+ var lastOtpRequest = useRef();
60
+ var lastOtpRequestTimeStamp = useRef();
61
+ var loginMethod = 'CT';
62
+ useEffect(function () {
63
+ autoDetect();
64
+ var eventProps = getRavenEventProps();
65
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'login_otp_screen_opened', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
66
+ }, []);
67
+ useEffect(function () {
68
+ if (isIOSApp()) {
69
+ setEnableAutoDetect(false);
70
+ }
71
+ }, []);
72
+ useEffect(function () {
73
+ autoDetect();
74
+ }, []);
75
+ useEffect(function () {
76
+ if (countdown === 0) {
77
+ setCountdownEnabled(false);
78
+ }
79
+ }, [countdown]);
80
+ useEffect(function () {
81
+ var interval;
82
+ if (countdownEnabled && countdown > 0) {
83
+ interval = setInterval(function () {
84
+ setCountdown(function (prevCountdown) { return prevCountdown - 1; });
85
+ }, 1000);
86
+ }
87
+ return function () {
88
+ clearInterval(interval);
89
+ };
90
+ }, [countdownEnabled, countdown]);
91
+ var autoDetect = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
92
+ var otp_1, _e_1;
93
+ return __generator(this, function (_a) {
94
+ switch (_a.label) {
95
+ case 0:
96
+ _a.trys.push([0, 2, , 3]);
97
+ return [4, autoReadOtp()];
98
+ case 1:
99
+ otp_1 = _a.sent();
100
+ setOtp(otp_1);
101
+ setAutoDetecting(AutoDetectState.DETECTED);
102
+ if ((otp_1 === null || otp_1 === void 0 ? void 0 : otp_1.length) === LOGIN_CONSTANTS.OTP_LENGTH &&
103
+ handleOtpComplete) {
104
+ handleOtpComplete(otp_1, true);
105
+ }
106
+ return [3, 3];
107
+ case 2:
108
+ _e_1 = _a.sent();
109
+ if (_e_1 === 'NOT_SUPPORTED') {
110
+ setEnableAutoDetect(false);
111
+ }
112
+ return [3, 3];
113
+ case 3: return [2];
114
+ }
115
+ });
116
+ }); }, [enableAutoDetect]);
117
+ var handleOtpValidationError = useCallback(function (e) {
118
+ var eventProps = getRavenEventProps();
119
+ ravenSDKTrigger('u_login_error', __assign({ action_name: 'otp_incorrect', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
120
+ var message = e === null || e === void 0 ? void 0 : e.message;
121
+ if (message !== 'OTP_VALIDATE_LIMIT_EXCEEDED') {
122
+ setOtp('');
123
+ }
124
+ inputRefs.current[0].focus();
125
+ inputRefs.current[0].click();
126
+ var messageValue = LOGIN_CONSTANTS[message];
127
+ var toastMessage = typeof messageValue === 'string'
128
+ ? messageValue
129
+ : LOGIN_CONSTANTS.INVALID_OTP;
130
+ setOtpErrorMessage(toastMessage);
131
+ }, [inputRefs]);
132
+ var handleOtpComplete = useCallback(function (otp, autodetected) { return __awaiter(void 0, void 0, void 0, function () {
133
+ var eventProps, response, status_1, action, e_1;
134
+ return __generator(this, function (_a) {
135
+ switch (_a.label) {
136
+ case 0:
137
+ _a.trys.push([0, 2, , 3]);
138
+ eventProps = getRavenEventProps();
139
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'otp_entered', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', entry_type: !autodetected ? 'manual_entry' : 'autodetected', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
140
+ if (otp === lastOtpRequest.current &&
141
+ lastOtpRequestTimeStamp.current &&
142
+ lastOtpRequestTimeStamp.current - Date.now() <= 100) {
143
+ return [2];
144
+ }
145
+ lastOtpRequest.current = otp;
146
+ lastOtpRequestTimeStamp.current = Date.now();
147
+ return [4, validateOtp(mobileNumber, otp)];
148
+ case 1:
149
+ response = _a.sent();
150
+ status_1 = response.status, action = response.action;
151
+ if (Number(status_1) === 200 && !isEmpty(action)) {
152
+ setVerifiedOtp(true);
153
+ setOtpErrorMessage('');
154
+ updateNativeOnLogin();
155
+ if (action === 'SIGNUP') {
156
+ if (!skipProfileFlow) {
157
+ window.location.href =
158
+ NAVIGATION_ROUTES.PERSONAL_DETAILS +
159
+ '?onboardingFlow=true';
160
+ }
161
+ handleLoginSuccess(loginMethod, true);
162
+ }
163
+ else {
164
+ handleLoginSuccess(loginMethod);
165
+ }
166
+ }
167
+ else {
168
+ handleLoginFailure(loginMethod);
169
+ }
170
+ return [3, 3];
171
+ case 2:
172
+ e_1 = _a.sent();
173
+ handleLoginFailure(loginMethod);
174
+ handleOtpValidationError(e_1);
175
+ return [3, 3];
176
+ case 3: return [2];
177
+ }
178
+ });
179
+ }); }, [
180
+ lastOtpRequest,
181
+ lastOtpRequestTimeStamp,
182
+ setVerifiedOtp,
183
+ setAutoDetecting,
184
+ setOtpErrorMessage,
185
+ handleOtpValidationError,
186
+ ]);
187
+ var handleOnPaste = function () { return __awaiter(void 0, void 0, void 0, function () {
188
+ var clipboardData, pastedArr, pastedString;
189
+ var _a, _b;
190
+ return __generator(this, function (_c) {
191
+ switch (_c.label) {
192
+ case 0: return [4, navigator.clipboard.readText()];
193
+ case 1:
194
+ clipboardData = _c.sent();
195
+ if (clipboardData && isNumeric(clipboardData)) {
196
+ pastedArr = clipboardData
197
+ .slice(0, LOGIN_CONSTANTS.OTP_LENGTH)
198
+ .split('');
199
+ (_a = inputRefs.current[LOGIN_CONSTANTS.OTP_LENGTH - 1]) === null || _a === void 0 ? void 0 : _a.focus();
200
+ (_b = inputRefs.current[LOGIN_CONSTANTS.OTP_LENGTH - 1]) === null || _b === void 0 ? void 0 : _b.click();
201
+ pastedString = pastedArr.join('');
202
+ setOtp(pastedString);
203
+ if (pastedString.length === LOGIN_CONSTANTS.OTP_LENGTH) {
204
+ handleOtpComplete(pastedString, false);
205
+ }
206
+ }
207
+ return [2];
208
+ }
209
+ });
210
+ }); };
211
+ var handleInput = useCallback(function (event, index) {
212
+ var _a, _b;
213
+ setErrorCallout('');
214
+ var value = event.target.value;
215
+ if (value !== '' && index < inputRefs.current.length - 1) {
216
+ (_a = inputRefs.current[index + 1]) === null || _a === void 0 ? void 0 : _a.focus();
217
+ (_b = inputRefs.current[index + 1]) === null || _b === void 0 ? void 0 : _b.click();
218
+ }
219
+ var inputValues = inputRefs.current.map(function (ref) {
220
+ if (isHTMLInputElement(ref)) {
221
+ return ref.value;
222
+ }
223
+ return '';
224
+ });
225
+ var otpValue = inputValues.join('').slice(0, 4);
226
+ setOtp(otpValue);
227
+ if (otpValue.length === LOGIN_CONSTANTS.OTP_LENGTH) {
228
+ handleOtpComplete(otpValue, false);
229
+ }
230
+ }, [setOtp, handleOtpComplete]);
231
+ var handleKeyDown = useCallback(function (e, index) {
232
+ var _a, _b, _c;
233
+ if (e.key === 'Backspace' &&
234
+ index > 0 &&
235
+ ((_a = inputRefs.current[index]) === null || _a === void 0 ? void 0 : _a.value) === '') {
236
+ e.preventDefault();
237
+ (_b = inputRefs.current[index - 1]) === null || _b === void 0 ? void 0 : _b.focus();
238
+ (_c = inputRefs.current[index - 1]) === null || _c === void 0 ? void 0 : _c.click();
239
+ }
240
+ }, [inputRefs]);
241
+ var onResendOtpClick = useCallback(function () {
242
+ setCountdown(LOGIN_CONSTANTS.OTP_COUNTDOWN);
243
+ setCountdownEnabled(true);
244
+ getOTP(mobileNumber);
245
+ var eventProps = getRavenEventProps();
246
+ ravenSDKTrigger('u_login_error', __assign({ action_name: 'resend_otp_clicked', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
247
+ }, [setCountdown, setCountdownEnabled]);
248
+ var onEditCLick = useCallback(function () {
249
+ setCtaDisabled(true);
250
+ setShowMobilePage(true);
251
+ setMobileNumber('');
252
+ }, [setShowMobilePage]);
253
+ return (jsxs("div", __assign({ className: 'flex flex-column bg-neutral-100', style: { height: otpInputHeight } }, { children: [errorCallout && (jsx(AlertCallout, { variant: 'error', textNode: errorCallout, prefixIconNode: jsx(InfoIcon, { fill: 'red' }), style: {
254
+ color: '#ffff',
255
+ backgroundColor: '#db201e',
256
+ }, className: 'fs-12' })), jsxs("div", __assign({ className: 'flex flex-bottom' }, { children: [jsxs(Typography, __assign({ variant: 'HM1', color: 'heading' }, { children: [LOGIN_CONSTANTS.OTP_TEXT, " ", jsx("br", {}), mobileNumber] })), jsx("div", __assign({ className: 'pl-2', onClick: onEditCLick }, { children: jsx(Edit, {}) }))] })), jsxs("div", __assign({ className: styles.otp_container }, { children: [jsx("div", __assign({ className: 'flex' }, { children: __spreadArray([], Array(LOGIN_CONSTANTS.OTP_LENGTH), true).map(function (_, i) { return (jsx("div", __assign({ className: styles.otp_box_wrapper }, { children: jsx(FieldV2, { prompt: {
257
+ hasError: !!otpErrorMessage,
258
+ }, type: 'number', placeholder: '', value: otp[i], max: 1, inputMode: 'numeric', className: styles.login_otp_input, variant: 'md', ref: function (ref) {
259
+ if (ref) {
260
+ inputRefs.current[i] = ref;
261
+ }
262
+ }, onKeyDown: function (e) { return handleKeyDown(e, i); }, onChange: function (e) { return handleInput(e, i); }, onPaste: handleOnPaste, autoFocus: i === 0 }) }), i)); }) })), !!otpErrorMessage && (jsx(Typography, __assign({ variant: 'P1', color: 'warning', className: styles.login_otp_error }, { children: otpErrorMessage })))] })), jsx(Spacer, { className: 'pt-2' }), autoDetecting === AutoDetectState.DETECTING &&
263
+ !verifiedOtp &&
264
+ enableAutoDetect &&
265
+ countdown >
266
+ LOGIN_CONSTANTS.RESEND_OTP_COUNTDOWN && (jsxs("div", __assign({ className: 'flex flex-middle' }, { children: [jsx(Spinner, { width: '20px', height: '20px', borderColor: '#11a670', className: 'bg-neutral-900 bc-black' }), jsx(Typography, __assign({ variant: 'B3', className: 'fs-12 fw-500 ml-1 c-neutral-700' }, { children: LOGIN_CONSTANTS.AUTO_DETECTING_TEXT }))] }))), autoDetecting === AutoDetectState.DETECTING &&
267
+ countdown <= LOGIN_CONSTANTS.RESEND_OTP_COUNTDOWN &&
268
+ enableAutoDetect &&
269
+ !verifiedOtp && (jsx(Fragment, { children: jsxs("div", __assign({ className: 'flex' }, { children: [jsx(Typography, __assign({ variant: 'B3', className: 'fs-12 fw-500 c-neutral-700 ' }, { children: LOGIN_CONSTANTS.OTP_RESEND_TEXT })), jsx(Spacer, { className: 'ml-1' }), otpResendDisabled ? (jsx(Typography, __assign({ className: 'color-neutral-200 fw-500', variant: 'B3' }, { children: LOGIN_CONSTANTS.RESEND_CTA }))) : (jsxs(Fragment, { children: [countdown === 0 && (jsx(Fragment, { children: jsx(Typography, __assign({ isClickable: true, variant: 'B3', onClick: onResendOtpClick, color: 'link', className: '\n fs-12 fw-500 c-pointer' }, { children: LOGIN_CONSTANTS.RESEND_CTA })) })), countdown > 0 && (jsx(Typography, __assign({ color: 'disabled', variant: 'B3' }, { children: ' Resend (' + countdown + 's)' })))] }))] })) })), !otpErrorMessage && verifiedOtp && (jsx(Fragment, { children: jsxs("div", __assign({ className: 'flex flex-middle' }, { children: [jsx(CheckCircle, {}), jsx(Typography, __assign({ variant: 'P1', color: 'success', className: 'fs-12' }, { children: autoDetecting === AutoDetectState.DETECTED
270
+ ? LOGIN_CONSTANTS.AUTO_DETECTED_TEXT
271
+ : LOGIN_CONSTANTS.VERIFIED_MESSAGE }))] })) })), jsx(Spacer, { className: 'mt-24' })] })));
272
+ };
273
+
274
+ var css_248z = ".index-module_loader__63LeU{align-items:center;background-color:hsla(0,0%,100%,.95);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:0}.index-module_loader__63LeU.index-module_With-full-opacity__ZSY-U{background-color:#fff}.index-module_loader__content__Q6kJl{max-width:280px;text-align:center}.index-module_loader__spinner__6B3AR{animation:index-module_loader-rotate__efcf3 .8s linear infinite;border:2px solid rgba(51,102,204,.3);border-radius:50%;border-top-color:#36c;display:inline-block;height:30px;margin-bottom:10px;position:relative;width:30px}.index-module_loader__heading__7YZ3N{color:#000;font-size:18px;font-weight:600;margin-bottom:5px}.index-module_loader__text__1QcLi{color:rgba(0,0,0,.8);font-size:16px;line-height:1.5}";
275
+ var Styles = {"loader":"index-module_loader__63LeU","With-full-opacity":"index-module_With-full-opacity__ZSY-U","loader__content":"index-module_loader__content__Q6kJl","loader__spinner":"index-module_loader__spinner__6B3AR","loader-rotate":"index-module_loader-rotate__efcf3","loader__heading":"index-module_loader__heading__7YZ3N","loader__text":"index-module_loader__text__1QcLi"};
276
+ styleInject(css_248z);
277
+
278
+ var Loader = function (_a) {
279
+ var title = _a.title, message = _a.message, className = _a.className;
280
+ return (jsx("div", __assign({ className: "".concat(Styles['utilswrapper'], " utilswrapper") }, { children: jsx("div", __assign({ className: classNames(Styles['loader'], className) }, { children: jsxs("div", __assign({ className: Styles['loader__content'] }, { children: [jsx("div", { className: Styles['loader__spinner'] }), jsx("h5", __assign({ className: Styles['loader__heading'] }, { children: title })), jsx("p", __assign({ className: Styles['loader__text'] }, { children: message }))] })) })) })));
281
+ };
282
+
283
+ var MobileInput = function (_a) {
284
+ var sendingOtp = _a.sendingOtp, ctaDisabled = _a.ctaDisabled, getOTP = _a.getOTP, setErrorCallout = _a.setErrorCallout, errorCallout = _a.errorCallout, mobileNumber = _a.mobileNumber, setMobileInputHeight = _a.setMobileInputHeight, setMobileNumber = _a.setMobileNumber, fallbackUri = _a.fallbackUri, skipProfileFlow = _a.skipProfileFlow, currentPageUri = _a.currentPageUri, ravenPayload = _a.ravenPayload;
285
+ var fkSSOEnabled = useState(isFKSSOEnabled)[0];
286
+ var _b = useState(false), fkButtonLoading = _b[0], setFkButtonLoading = _b[1];
287
+ var inputRef = useRef(null);
288
+ var mobileViewRef = useRef(null);
289
+ useEffect(function () {
290
+ if (mobileViewRef.current) {
291
+ var height = mobileViewRef.current.clientHeight;
292
+ setMobileInputHeight(height);
293
+ }
294
+ }, [mobileViewRef.current]);
295
+ useEffect(function () {
296
+ var timeout;
297
+ if (inputRef.current) {
298
+ timeout = setTimeout(function () {
299
+ var _a;
300
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
301
+ }, 100);
302
+ }
303
+ return function () {
304
+ clearTimeout(timeout);
305
+ };
306
+ }, []);
307
+ useEffect(function () {
308
+ if (isAndroidApp()) {
309
+ autoDetectMobileNumber();
310
+ }
311
+ }, []);
312
+ var handleFKSSOClick = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
313
+ var eventProps, redirectUrl;
314
+ return __generator(this, function (_a) {
315
+ switch (_a.label) {
316
+ case 0:
317
+ _a.trys.push([0, 2, , 3]);
318
+ eventProps = getRavenEventProps();
319
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'login_with_flipkart_clicked', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'fk_sso', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
320
+ setFkButtonLoading(true);
321
+ return [4, handleFKSSO(fallbackUri, skipProfileFlow
322
+ ? currentPageUri
323
+ : NAVIGATION_ROUTES.PERSONAL_DETAILS +
324
+ '?onboardingFlow=true', currentPageUri)];
325
+ case 1:
326
+ redirectUrl = _a.sent();
327
+ window.location.href = redirectUrl;
328
+ return [3, 3];
329
+ case 2:
330
+ _a.sent();
331
+ setFkButtonLoading(false);
332
+ return [3, 3];
333
+ case 3: return [2];
334
+ }
335
+ });
336
+ }); }, []);
337
+ var handleInputChange = useCallback(function (event, autoDetected) {
338
+ if (autoDetected === void 0) { autoDetected = false; }
339
+ setErrorCallout('');
340
+ var value = event.target.value || '';
341
+ value = value.replace(MULTI_SPACE, ' ').trimStart();
342
+ setMobileNumber(value);
343
+ var validMobileNo = isValidMobileNumber(event.target.value);
344
+ if (validMobileNo) {
345
+ getOTP(value);
346
+ var eventProps = getRavenEventProps();
347
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'get_otp_clicked', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', entry_type: 'auto_click', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
348
+ if (!autoDetected) {
349
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'phone_number_entered', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', entry_type: 'manual_entry', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
350
+ }
351
+ else {
352
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'phone_number_autodetected', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', entry_type: 'autodetected', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
353
+ }
354
+ }
355
+ }, [setMobileNumber]);
356
+ var autoDetectMobileNumber = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
357
+ var autoDetectedNumber, simulatedEvent;
358
+ return __generator(this, function (_a) {
359
+ switch (_a.label) {
360
+ case 0: return [4, showMobileNumberHint()];
361
+ case 1:
362
+ autoDetectedNumber = _a.sent();
363
+ simulatedEvent = {
364
+ target: {
365
+ value: autoDetectedNumber,
366
+ },
367
+ };
368
+ if (autoDetectedNumber) {
369
+ handleInputChange(simulatedEvent, true);
370
+ }
371
+ return [2];
372
+ }
373
+ });
374
+ }); }, [handleInputChange]);
375
+ var handlePrivacyPolicyClick = useCallback(function () {
376
+ var eventProps = getRavenEventProps();
377
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'policy_click', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
378
+ window.location.href = NAVIGATION_ROUTES.PRIVACY_POLICY;
379
+ }, []);
380
+ var handleTermsOfUseClick = useCallback(function () {
381
+ var eventProps = getRavenEventProps();
382
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'tnc_click', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
383
+ window.location.href = NAVIGATION_ROUTES.TERMS;
384
+ }, []);
385
+ return (jsxs("div", __assign({ className: 'flex flex-column', ref: mobileViewRef }, { children: [errorCallout && (jsx(AlertCallout, { variant: 'error', textNode: errorCallout, prefixIconNode: jsx(InfoIcon, { fill: 'red' }), style: {
386
+ color: '#ffff',
387
+ backgroundColor: '#db201e',
388
+ }, className: 'fs-12' })), jsx(Typography, __assign({ variant: 'HM1', color: 'heading', className: 'mb-4 fs-24' }, { children: LOGIN_CONSTANTS.LOGIN_TO_CT })), jsx(PhoneField, { onChange: handleInputChange, value: mobileNumber, placeholder: '', inputMode: 'numeric', ref: inputRef, min: 0, max: 10, autoFocus: true, countryCode: LOGIN_CONSTANTS.COUNTRY_CODE }), jsx(Button, __assign({ color: 'primary', size: 'medium', minWidth: '160px', disabled: ctaDisabled, loading: sendingOtp, className: 'my-6', onClick: function () { return getOTP(mobileNumber); } }, { children: LOGIN_CONSTANTS.GET_OTP })), fkSSOEnabled && (jsxs(Fragment, { children: [jsxs("div", __assign({ className: 'my-6 p-relative' }, { children: [jsx(Divider, {}), jsx("span", __assign({ className: "".concat(styles.mobileinput_seperatortext) }, { children: "or" }))] })), jsx(Button, __assign({ variant: 'outline', size: 'medium', className: 'my-6', loading: fkButtonLoading, onClick: handleFKSSOClick, showLeftIcon: !fkButtonLoading, LeftIcon: jsx("img", { src: FlipkartLogo }) }, { children: LOGIN_CONSTANTS.FK_LOGIN_CTA }))] })), jsxs("div", __assign({ className: 'pt-8 pb-6' }, { children: [jsx(Divider, {}), jsxs("div", __assign({ className: 'flex flex-middle \n flex-center flex-wrap pt-2' }, { children: [jsx(Typography, __assign({ variant: 'P1', className: styles.footer_text }, { children: LOGIN_CONSTANTS.FOOTER_TEXT })), jsx(Typography, __assign({ variant: 'P1', color: 'link', className: 'pl-1 fs-12', isClickable: true, onClick: handlePrivacyPolicyClick }, { children: LOGIN_CONSTANTS.PRIVACY_CTA })), jsx(Typography, __assign({ className: 'px-1 fs-12 c-neutral-700', variant: 'P1' }, { children: '& ' })), jsx(Typography, __assign({ variant: 'P1', color: 'link', isClickable: true, onClick: handleTermsOfUseClick, className: 'fs-12' }, { children: LOGIN_CONSTANTS.TNC_CTA }))] }))] }))] })));
389
+ };
390
+
391
+ const imagePlaceHolderURI =
392
+ // eslint-disable-next-line max-len
393
+ 'data:image/png;base64,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';
394
+ const ImageUrls = [{
395
+ src: 'https://fastui.cltpstatic.com/image/upload/offermgmt/images/carousel1.png',
396
+ placeholder: imagePlaceHolderURI
397
+ }, {
398
+ src: 'https://fastui.cltpstatic.com/image/upload/offermgmt/images/carousel2.png',
399
+ placeholder: imagePlaceHolderURI
400
+ }, {
401
+ src: 'https://fastui.cltpstatic.com/image/upload/offermgmt/images/carousel3.png',
402
+ placeholder: imagePlaceHolderURI
403
+ }];
404
+
405
+ var ImageWithPlaceholder = function (_a) {
406
+ var src = _a.src, placeholderSrc = _a.placeholderSrc, onLoad = _a.onLoad, props = __rest(_a, ["src", "placeholderSrc", "onLoad"]);
407
+ var _b = useState(placeholderSrc || src), imgSrc = _b[0], setImgSrc = _b[1];
408
+ var onLoadRef = useRef(onLoad);
409
+ useEffect(function () {
410
+ onLoadRef.current = onLoad;
411
+ }, [onLoad]);
412
+ useEffect(function () {
413
+ var img = new Image();
414
+ img.onload = function () {
415
+ setImgSrc(src);
416
+ if (onLoadRef.current) {
417
+ onLoadRef.current();
418
+ }
419
+ };
420
+ img.src = src;
421
+ }, [src]);
422
+ return jsx("img", __assign({ src: imgSrc }, props));
423
+ };
424
+
425
+ var CarouselWrapper = function () {
426
+ return (jsx("div", __assign({ className: " o-hidden p-relative ".concat(styles.slider_carousel_wrapper) }, { children: jsx(Swiper, __assign({ autoplay: true, slidesPerView: 1, navigation: false, loop: true, pagination: { clickable: true }, className: "".concat(styles['swiper'], " ").concat(styles['swiper-custom-pagination']), lazy: {
427
+ loadPrevNextAmount: 1,
428
+ } }, { children: ImageUrls.map(function (item, index) {
429
+ return (jsx(SwiperSlide, __assign({ className: styles['swiper-slide'] }, { children: jsx(Fragment, { children: index < 1 ? (jsx(ImageWithPlaceholder, { src: item.src, placeholderSrc: item.placeholder, alt: "Slide ".concat(index + 1), rel: 'preload', fetchPriority: 'high' })) : (jsx(ImageWithPlaceholder, { src: item.src, placeholderSrc: item.placeholder, alt: "Slide ".concat(index + 1), loading: 'lazy', className: 'lazy' })) }) }), index));
430
+ }) })) })));
431
+ };
432
+
433
+ var LoginModule = function (_a) {
434
+ var fallbackUri = _a.fallbackUri, isDrawerOpen = _a.isDrawerOpen, skipProfileFlow = _a.skipProfileFlow, handleLoginClose = _a.handleLoginClose, onAuthSuccess = _a.onAuthSuccess, onAuthFailure = _a.onAuthFailure, _b = _a.ravenPayload, ravenPayload = _b === void 0 ? {} : _b;
435
+ var _c = useState(true), showMobilePage = _c[0], setShowMobilePage = _c[1];
436
+ var _d = useState(true), ctaDisabled = _d[0], setCtaDisabled = _d[1];
437
+ var _e = useState(false), sendingOtp = _e[0], setSendingOtp = _e[1];
438
+ var _f = useState(isDrawerOpen), showLoginForm = _f[0], setShowLoginForm = _f[1];
439
+ var _g = useState(''), mobileNumber = _g[0], setMobileNumber = _g[1];
440
+ var _h = useState(0), mobileInputHeight = _h[0], setMobileInputHeight = _h[1];
441
+ var _j = useState(false), otpResendDisabled = _j[0], setOtpResendDisabled = _j[1];
442
+ var _k = useState(''), errorCallout = _k[0], setErrorCallout = _k[1];
443
+ var _l = useState(false), showSuccess = _l[0], setShowSuccess = _l[1];
444
+ var _m = useState(false), showSigninLoader = _m[0], setShowSigninLoader = _m[1];
445
+ var showSigninLoaderScreen = function () {
446
+ setShowSigninLoader(true);
447
+ };
448
+ useEffect(function () {
449
+ if (window) {
450
+ window['showSigninLoaderScreen'] = showSigninLoaderScreen;
451
+ }
452
+ var queryValue = getQueryParam('fkSSOstatus');
453
+ var loginMethod = 'FK';
454
+ if (queryValue === 'signin') {
455
+ if (isAndroidApp()) {
456
+ updateNativeAndroidOnSignIn();
457
+ }
458
+ handleLoginSuccess(loginMethod);
459
+ }
460
+ if (queryValue === 'signup') {
461
+ if (isAndroidApp()) {
462
+ updateNativeAndroidOnSignIn();
463
+ }
464
+ handleLoginSuccess(loginMethod, true);
465
+ }
466
+ if (queryValue === 'failure') {
467
+ handleLoginFailure(loginMethod);
468
+ }
469
+ }, []);
470
+ var getOTP = useCallback(function (mobileNumber) { return __awaiter(void 0, void 0, void 0, function () {
471
+ var res, status_1, err_1, message, errorMessage;
472
+ return __generator(this, function (_a) {
473
+ switch (_a.label) {
474
+ case 0:
475
+ _a.trys.push([0, 2, , 3]);
476
+ setCtaDisabled(false);
477
+ setSendingOtp(true);
478
+ triggerOTPListener();
479
+ return [4, sendLoginOtp(mobileNumber)];
480
+ case 1:
481
+ res = _a.sent();
482
+ status_1 = (res || {}).status;
483
+ if (status_1 === 'SUCCESS') {
484
+ setShowMobilePage(false);
485
+ setSendingOtp(false);
486
+ }
487
+ return [3, 3];
488
+ case 2:
489
+ err_1 = _a.sent();
490
+ console.error(err_1);
491
+ message = (err_1 || {}).message;
492
+ setSendingOtp(false);
493
+ errorMessage = message && LOGIN_CONSTANTS[message];
494
+ if (errorMessage) {
495
+ setErrorCallout(String(errorMessage));
496
+ }
497
+ else {
498
+ setErrorCallout(String(LOGIN_CONSTANTS.GENERIC_ERROR_MESSAGE));
499
+ }
500
+ if (message === 'OTP_SEND_LIMIT_EXCEEDED') {
501
+ setOtpResendDisabled(true);
502
+ }
503
+ return [3, 3];
504
+ case 3: return [2];
505
+ }
506
+ });
507
+ }); }, [showMobilePage, setShowMobilePage]);
508
+ var handleLoginSuccess = useCallback(function (loginMethod, action) {
509
+ var eventProps = getRavenEventProps();
510
+ ravenSDKTrigger('u_login_success', __assign({ action_name: 'login_successful', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', login_new: action ? 'sign_up' : 'sign_in', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
511
+ onAuthSuccess(loginMethod, action);
512
+ if (action && !skipProfileFlow) ;
513
+ else {
514
+ handleDrawerClose();
515
+ setShowSuccess(true);
516
+ }
517
+ }, []);
518
+ var handleLoginFailure = useCallback(function (loginMethod) {
519
+ onAuthFailure(loginMethod);
520
+ }, []);
521
+ var handleDrawerClose = function (evt) {
522
+ evt === null || evt === void 0 ? void 0 : evt.stopPropagation();
523
+ setShowLoginForm(false);
524
+ setMobileNumber('');
525
+ setCtaDisabled(true);
526
+ var eventProps = getRavenEventProps();
527
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'login_prompt_dismissed', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
528
+ if (handleLoginClose && typeof handleLoginClose === 'function') {
529
+ handleLoginClose();
530
+ }
531
+ };
532
+ useEffect(function () {
533
+ if (isDrawerOpen) {
534
+ setShowMobilePage(true);
535
+ setShowLoginForm(true);
536
+ var eventProps = getRavenEventProps();
537
+ ravenSDKTrigger('u_login_popup', __assign({ action_name: 'login_prompt_opened', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
538
+ }
539
+ else {
540
+ setShowLoginForm(false);
541
+ }
542
+ }, [isDrawerOpen]);
543
+ return (jsx(ThemeProvider, { children: jsxs("div", { children: [jsx(Drawer, __assign({ direction: 'bottom', isOpen: showLoginForm, showClose: true, overlay: true, handleClose: handleDrawerClose, onClose: function () { } }, { children: jsx("div", __assign({ className: "".concat(styles['utilswrapper'], " utilswrapper") }, { children: jsxs("div", __assign({ style: {
544
+ maxHeight: 'calc(100dvh - 60px)',
545
+ overflowY: 'auto',
546
+ borderRadius: '16px 16px 0 0',
547
+ } }, { children: [jsx(CarouselWrapper, {}), jsxs("div", __assign({ className: styles['login_form'] }, { children: [jsx("div", { children: jsx(Spacer, { className: 'pt-6' }) }), showMobilePage ? (jsx(MobileInput, { device: 'PWA', ctaDisabled: ctaDisabled, sendingOtp: sendingOtp, getOTP: getOTP, mobileNumber: mobileNumber, setMobileNumber: setMobileNumber, setMobileInputHeight: setMobileInputHeight, fallbackUri: fallbackUri, skipProfileFlow: skipProfileFlow, currentPageUri: getCurrentPathName, setErrorCallout: setErrorCallout, errorCallout: errorCallout, ravenPayload: ravenPayload })) : (jsx(OtpInput, { mobileNumber: mobileNumber, getOTP: getOTP, setCtaDisabled: setCtaDisabled, setShowMobilePage: setShowMobilePage, handleLoginSuccess: handleLoginSuccess, handleLoginFailure: handleLoginFailure, otpInputHeight: mobileInputHeight, setMobileNumber: setMobileNumber, setErrorCallout: setErrorCallout, errorCallout: errorCallout, otpResendDisabled: otpResendDisabled, ravenPayload: ravenPayload, skipProfileFlow: skipProfileFlow }))] }))] })) })) })), showSuccess && (jsx(Toast, { text: 'Logged in successfully!', show: showSuccess, className: "".concat(styles.nonUtilsSelector_toast), closeTimeout: 2000 })), showSigninLoader && (jsx(Loader, { title: 'Please wait', message: 'Signing in...', className: 'z-2 bg-white' }))] }) }));
548
+ };
549
+
550
+ export { LoginModule };
551
+ //# sourceMappingURL=ct-platform-login-module.esm.js.map