@onairos/react-native 3.7.1 → 3.7.3
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/lib/commonjs/api/index.js +219 -9
- package/lib/commonjs/assets/icons/spotify.png +0 -0
- package/lib/commonjs/assets/images/spotify.png +0 -0
- package/lib/commonjs/components/BodyText.js +27 -9
- package/lib/commonjs/components/BrandMark.js +111 -10
- package/lib/commonjs/components/CodeInput.js +116 -9
- package/lib/commonjs/components/EmailInput.js +30 -8
- package/lib/commonjs/components/GoogleButton.js +56 -9
- package/lib/commonjs/components/HeadingGroup.js +43 -9
- package/lib/commonjs/components/LLMDataInputModal.js +664 -14
- package/lib/commonjs/components/ModalHeader.js +99 -9
- package/lib/commonjs/components/ModalSheet.js +47 -9
- package/lib/commonjs/components/Onairos.js +380 -14
- package/lib/commonjs/components/OnairosButton.js +313 -13
- package/lib/commonjs/components/OnairosSignInButton.js +130 -12
- package/lib/commonjs/components/Overlay.js +465 -13
- package/lib/commonjs/components/PersonaImage.js +137 -10
- package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
- package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
- package/lib/commonjs/components/PinCreationScreen.js +403 -12
- package/lib/commonjs/components/PinInput.js +464 -9
- package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
- package/lib/commonjs/components/PlatformList.js +137 -10
- package/lib/commonjs/components/PlatformToggle.js +180 -9
- package/lib/commonjs/components/PrimaryButton.js +180 -10
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
- package/lib/commonjs/components/SignInStep.js +345 -12
- package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
- package/lib/commonjs/components/VerificationStep.js +176 -11
- package/lib/commonjs/components/WelcomeScreen.js +461 -22
- package/lib/commonjs/components/icons/Basicproficon.js +37 -8
- package/lib/commonjs/components/icons/Basicprofile.js +21 -8
- package/lib/commonjs/components/icons/Checkbox.js +21 -8
- package/lib/commonjs/components/icons/Checkmark.js +27 -8
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
- package/lib/commonjs/components/icons/Contenticon.js +39 -8
- package/lib/commonjs/components/icons/EnochE.js +41 -8
- package/lib/commonjs/components/icons/Personalityicon.js +30 -8
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
- package/lib/commonjs/components/icons/Userpreferences.js +21 -8
- package/lib/commonjs/components/icons/index.js +84 -17
- package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
- package/lib/commonjs/components/onboarding/PinInput.js +283 -10
- package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
- package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
- package/lib/commonjs/config/api.js +56 -7
- package/lib/commonjs/constants/index.js +120 -7
- package/lib/commonjs/context/AuthContext.js +345 -10
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
- package/lib/commonjs/hooks/useConnections.js +102 -8
- package/lib/commonjs/hooks/useCredentials.js +178 -10
- package/lib/commonjs/hooks/useUserConnections.js +148 -10
- package/lib/commonjs/index.js +439 -34
- package/lib/commonjs/services/apiClient.js +298 -8
- package/lib/commonjs/services/biometricPinService.js +180 -8
- package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
- package/lib/commonjs/services/chatGPTConversationService.js +275 -9
- package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
- package/lib/commonjs/services/claudeConversationService.js +158 -9
- package/lib/commonjs/services/connectedAccountsService.js +310 -10
- package/lib/commonjs/services/googleAuthService.js +252 -11
- package/lib/commonjs/services/hingeDataExtractor.js +105 -8
- package/lib/commonjs/services/hingeDataService.js +150 -9
- package/lib/commonjs/services/imageCompressionService.js +260 -7
- package/lib/commonjs/services/instagramDataExtractor.js +126 -8
- package/lib/commonjs/services/instagramDataService.js +163 -9
- package/lib/commonjs/services/jwtStorageService.js +276 -7
- package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
- package/lib/commonjs/services/linkedinProfileService.js +222 -9
- package/lib/commonjs/services/linkedinScrapingService.js +230 -8
- package/lib/commonjs/services/llmDataStorage.js +294 -8
- package/lib/commonjs/services/mobileTrainingService.js +186 -8
- package/lib/commonjs/services/netflixDataExtractor.js +120 -8
- package/lib/commonjs/services/netflixDataService.js +198 -9
- package/lib/commonjs/services/pinEncryptionService.js +84 -8
- package/lib/commonjs/services/pinStorageUtils.js +105 -7
- package/lib/commonjs/services/platformAuthService.js +1484 -12
- package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
- package/lib/commonjs/services/sephoraDataService.js +200 -9
- package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
- package/lib/commonjs/services/spotifyDataService.js +241 -9
- package/lib/commonjs/services/storageService.js +404 -8
- package/lib/commonjs/services/telegramDataExtractor.js +115 -8
- package/lib/commonjs/services/telegramDataService.js +499 -9
- package/lib/commonjs/services/trainingApiHelpers.js +73 -7
- package/lib/commonjs/services/userConnectionsService.js +340 -10
- package/lib/commonjs/services/youtubeMigrationService.js +416 -10
- package/lib/commonjs/theme/index.js +250 -7
- package/lib/commonjs/types/ambient.d.js +2 -1
- package/lib/commonjs/types/declarations.d.js +2 -1
- package/lib/commonjs/types/index.js +6 -1
- package/lib/commonjs/types/node-fix.d.js +2 -1
- package/lib/commonjs/types/node-override.d.js +2 -1
- package/lib/commonjs/types/opacity.d.js +2 -1
- package/lib/commonjs/types.js +14 -1
- package/lib/commonjs/utils/Portal.js +98 -8
- package/lib/commonjs/utils/api.js +130 -9
- package/lib/commonjs/utils/assetRegistry.js +210 -35
- package/lib/commonjs/utils/auth.js +112 -9
- package/lib/commonjs/utils/connectorTests.js +613 -29
- package/lib/commonjs/utils/crypto.js +62 -8
- package/lib/commonjs/utils/debugHelper.js +64 -1
- package/lib/commonjs/utils/encryption.js +76 -7
- package/lib/commonjs/utils/eventUtils.js +288 -1
- package/lib/commonjs/utils/haptics.js +66 -9
- package/lib/commonjs/utils/imagePreloader.js +6 -1
- package/lib/commonjs/utils/networkDiagnostics.js +226 -8
- package/lib/commonjs/utils/onairosApi.js +350 -9
- package/lib/commonjs/utils/programmaticFlow.js +117 -9
- package/lib/commonjs/utils/retryHelper.js +220 -1
- package/lib/commonjs/utils/secureStorage.js +349 -10
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
- package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
- package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
- package/lib/commonjs/utils/webviewScripts/index.js +698 -15
- package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
- package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
- package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
- package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
- package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
- package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
- package/lib/module/api/index.js +211 -1
- package/lib/module/assets/icons/spotify.png +0 -0
- package/lib/module/assets/images/spotify.png +0 -0
- package/lib/module/components/BodyText.js +20 -1
- package/lib/module/components/BrandMark.js +104 -1
- package/lib/module/components/CodeInput.js +109 -1
- package/lib/module/components/EmailInput.js +23 -1
- package/lib/module/components/GoogleButton.js +49 -1
- package/lib/module/components/HeadingGroup.js +36 -1
- package/lib/module/components/LLMDataInputModal.js +656 -7
- package/lib/module/components/ModalHeader.js +92 -1
- package/lib/module/components/ModalSheet.js +39 -1
- package/lib/module/components/Onairos.js +373 -1
- package/lib/module/components/OnairosButton.js +305 -1
- package/lib/module/components/OnairosSignInButton.js +121 -1
- package/lib/module/components/Overlay.js +456 -1
- package/lib/module/components/PersonaImage.js +129 -1
- package/lib/module/components/PersonaLoadingScreen.js +310 -1
- package/lib/module/components/PersonalizationConsentScreen.js +460 -1
- package/lib/module/components/PinCreationScreen.js +396 -1
- package/lib/module/components/PinInput.js +456 -1
- package/lib/module/components/PlatformConnectorsStep.js +1302 -6
- package/lib/module/components/PlatformList.js +129 -1
- package/lib/module/components/PlatformToggle.js +173 -1
- package/lib/module/components/PrimaryButton.js +172 -1
- package/lib/module/components/SignInMatchAnimation.js +189 -1
- package/lib/module/components/SignInStep.js +338 -1
- package/lib/module/components/UniversalOnboarding.js +2770 -1
- package/lib/module/components/VerificationStep.js +168 -1
- package/lib/module/components/WelcomeScreen.js +453 -1
- package/lib/module/components/icons/Basicproficon.js +30 -1
- package/lib/module/components/icons/Basicprofile.js +14 -1
- package/lib/module/components/icons/Checkbox.js +14 -1
- package/lib/module/components/icons/Checkmark.js +20 -1
- package/lib/module/components/icons/Contentanalysis.js +14 -1
- package/lib/module/components/icons/Contenticon.js +32 -1
- package/lib/module/components/icons/EnochE.js +34 -1
- package/lib/module/components/icons/Personalityicon.js +23 -1
- package/lib/module/components/icons/Personalityprofile.js +14 -1
- package/lib/module/components/icons/Personalitytraits.js +14 -1
- package/lib/module/components/icons/Userpreferences.js +14 -1
- package/lib/module/components/icons/index.js +13 -1
- package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
- package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
- package/lib/module/components/onboarding/PinInput.js +274 -1
- package/lib/module/components/onboarding/PlatformConnector.js +240 -1
- package/lib/module/config/PLATFORM_APIS.md +849 -0
- package/lib/module/config/api.js +47 -1
- package/lib/module/constants/index.js +114 -1
- package/lib/module/context/AuthContext.js +335 -1
- package/lib/module/hooks/useConnectedAccounts.js +106 -1
- package/lib/module/hooks/useConnections.js +95 -1
- package/lib/module/hooks/useCredentials.js +171 -6
- package/lib/module/hooks/useUserConnections.js +140 -1
- package/lib/module/index.js +172 -1
- package/lib/module/services/apiClient.js +295 -1
- package/lib/module/services/biometricPinService.js +169 -1
- package/lib/module/services/chatGPTConversationExtractor.js +149 -1
- package/lib/module/services/chatGPTConversationService.js +268 -1
- package/lib/module/services/claudeConversationExtractor.js +97 -1
- package/lib/module/services/claudeConversationService.js +151 -1
- package/lib/module/services/connectedAccountsService.js +293 -1
- package/lib/module/services/googleAuthService.js +241 -1
- package/lib/module/services/hingeDataExtractor.js +99 -1
- package/lib/module/services/hingeDataService.js +143 -1
- package/lib/module/services/imageCompressionService.js +250 -1
- package/lib/module/services/instagramDataExtractor.js +120 -1
- package/lib/module/services/instagramDataService.js +156 -1
- package/lib/module/services/jwtStorageService.js +257 -1
- package/lib/module/services/linkedinDOMExtractor.js +234 -1
- package/lib/module/services/linkedinProfileService.js +210 -1
- package/lib/module/services/linkedinScrapingService.js +219 -1
- package/lib/module/services/llmDataStorage.js +277 -1
- package/lib/module/services/mobileTrainingService.js +173 -1
- package/lib/module/services/netflixDataExtractor.js +114 -1
- package/lib/module/services/netflixDataService.js +191 -1
- package/lib/module/services/pinEncryptionService.js +74 -6
- package/lib/module/services/pinStorageUtils.js +93 -1
- package/lib/module/services/platformAuthService.js +1461 -1
- package/lib/module/services/sephoraDataExtractor.js +134 -1
- package/lib/module/services/sephoraDataService.js +193 -1
- package/lib/module/services/spotifyDataExtractor.js +142 -1
- package/lib/module/services/spotifyDataService.js +234 -1
- package/lib/module/services/storageService.js +383 -1
- package/lib/module/services/telegramDataExtractor.js +109 -1
- package/lib/module/services/telegramDataService.js +493 -1
- package/lib/module/services/trainingApiHelpers.js +67 -1
- package/lib/module/services/userConnectionsService.js +329 -1
- package/lib/module/services/youtubeMigrationService.js +405 -1
- package/lib/module/theme/index.js +245 -1
- package/lib/module/types.js +10 -1
- package/lib/module/utils/Portal.js +90 -1
- package/lib/module/utils/api.js +118 -1
- package/lib/module/utils/assetRegistry.js +200 -34
- package/lib/module/utils/auth.js +100 -1
- package/lib/module/utils/connectorTests.js +600 -27
- package/lib/module/utils/crypto.js +54 -1
- package/lib/module/utils/debugHelper.js +54 -1
- package/lib/module/utils/encryption.js +67 -1
- package/lib/module/utils/eventUtils.js +270 -1
- package/lib/module/utils/haptics.js +59 -8
- package/lib/module/utils/imagePreloader.js +3 -1
- package/lib/module/utils/networkDiagnostics.js +217 -1
- package/lib/module/utils/onairosApi.js +333 -1
- package/lib/module/utils/programmaticFlow.js +111 -1
- package/lib/module/utils/retryHelper.js +211 -1
- package/lib/module/utils/secureStorage.js +330 -6
- package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
- package/lib/module/utils/webviewScripts/claude.js +370 -1
- package/lib/module/utils/webviewScripts/hinge.js +405 -1
- package/lib/module/utils/webviewScripts/index.js +434 -1
- package/lib/module/utils/webviewScripts/instagram.js +448 -1
- package/lib/module/utils/webviewScripts/linkedin.js +874 -1
- package/lib/module/utils/webviewScripts/netflix.js +376 -1
- package/lib/module/utils/webviewScripts/sephora.js +510 -1
- package/lib/module/utils/webviewScripts/spotify.js +413 -1
- package/lib/module/utils/webviewScripts/telegram.js +672 -1
- package/package.json +2 -2
|
@@ -1 +1,92 @@
|
|
|
1
|
-
import React from'react';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import { COLORS, SPACING } from '../theme';
|
|
4
|
+
const ModalHeader = ({
|
|
5
|
+
onClose,
|
|
6
|
+
onBack,
|
|
7
|
+
showGrabber = true,
|
|
8
|
+
showBackButton = false
|
|
9
|
+
}) => {
|
|
10
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, showGrabber && /*#__PURE__*/React.createElement(View, {
|
|
11
|
+
style: styles.grabberContainer
|
|
12
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
13
|
+
style: styles.grabber
|
|
14
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
15
|
+
style: styles.container
|
|
16
|
+
}, showBackButton ? /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
17
|
+
style: styles.closeButton,
|
|
18
|
+
onPress: onBack,
|
|
19
|
+
activeOpacity: 0.7,
|
|
20
|
+
accessibilityLabel: "Go back",
|
|
21
|
+
accessibilityRole: "button"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
23
|
+
style: styles.backText
|
|
24
|
+
}, "\u2190")) : /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
25
|
+
style: styles.closeButton,
|
|
26
|
+
onPress: onClose,
|
|
27
|
+
activeOpacity: 0.7,
|
|
28
|
+
accessibilityLabel: "Close",
|
|
29
|
+
accessibilityRole: "button"
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
31
|
+
style: styles.closeText
|
|
32
|
+
}, "\u2715")), /*#__PURE__*/React.createElement(View, {
|
|
33
|
+
style: styles.centerSpacer
|
|
34
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
35
|
+
style: styles.spacer
|
|
36
|
+
})));
|
|
37
|
+
};
|
|
38
|
+
const styles = StyleSheet.create({
|
|
39
|
+
grabberContainer: {
|
|
40
|
+
width: '100%',
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
paddingTop: 12,
|
|
43
|
+
paddingBottom: 4
|
|
44
|
+
},
|
|
45
|
+
grabber: {
|
|
46
|
+
width: 100,
|
|
47
|
+
// Made even longer (was 80)
|
|
48
|
+
height: 6,
|
|
49
|
+
backgroundColor: '#D0D0D0',
|
|
50
|
+
borderRadius: 3
|
|
51
|
+
},
|
|
52
|
+
container: {
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
alignItems: 'flex-start',
|
|
55
|
+
justifyContent: 'flex-start',
|
|
56
|
+
height: 44,
|
|
57
|
+
paddingTop: 0,
|
|
58
|
+
// Keep X button high
|
|
59
|
+
paddingLeft: 4,
|
|
60
|
+
// Move X button even further left
|
|
61
|
+
marginBottom: SPACING.md
|
|
62
|
+
},
|
|
63
|
+
closeButton: {
|
|
64
|
+
width: 36,
|
|
65
|
+
// Slightly larger for better touch
|
|
66
|
+
height: 36,
|
|
67
|
+
justifyContent: 'center',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
marginTop: 0 // Remove top margin to move X higher
|
|
70
|
+
// Remove background and border radius
|
|
71
|
+
},
|
|
72
|
+
closeText: {
|
|
73
|
+
fontSize: 20,
|
|
74
|
+
color: COLORS.grey800,
|
|
75
|
+
fontWeight: '500'
|
|
76
|
+
},
|
|
77
|
+
backText: {
|
|
78
|
+
fontSize: 24,
|
|
79
|
+
color: COLORS.grey800,
|
|
80
|
+
fontWeight: '500'
|
|
81
|
+
},
|
|
82
|
+
centerSpacer: {
|
|
83
|
+
flex: 1
|
|
84
|
+
},
|
|
85
|
+
spacer: {
|
|
86
|
+
width: 44,
|
|
87
|
+
height: 44
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
export { ModalHeader };
|
|
91
|
+
export default ModalHeader;
|
|
92
|
+
//# sourceMappingURL=ModalHeader.js.map
|
|
@@ -1 +1,39 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
// Temporarily remove safe area hook to fix RCTEventEmitter error
|
|
4
|
+
// import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
|
+
import { COLORS, BORDER_RADIUS, SPACING } from '../theme';
|
|
6
|
+
const ModalSheet = ({
|
|
7
|
+
children,
|
|
8
|
+
topPadding = SPACING.modalTopPadding,
|
|
9
|
+
onClose,
|
|
10
|
+
showGrabber = true,
|
|
11
|
+
style
|
|
12
|
+
}) => {
|
|
13
|
+
// Use fallback values instead of safe area hook to avoid RCTEventEmitter error
|
|
14
|
+
const insets = {
|
|
15
|
+
bottom: 20
|
|
16
|
+
}; // Fallback safe area
|
|
17
|
+
|
|
18
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
19
|
+
style: [styles.container, {
|
|
20
|
+
paddingTop: topPadding,
|
|
21
|
+
paddingBottom: insets.bottom || SPACING.lg
|
|
22
|
+
}, style]
|
|
23
|
+
}, children);
|
|
24
|
+
};
|
|
25
|
+
const styles = StyleSheet.create({
|
|
26
|
+
container: {
|
|
27
|
+
backgroundColor: COLORS.surface,
|
|
28
|
+
borderTopLeftRadius: BORDER_RADIUS.modalTop,
|
|
29
|
+
borderTopRightRadius: BORDER_RADIUS.modalTop,
|
|
30
|
+
borderBottomLeftRadius: 0,
|
|
31
|
+
borderBottomRightRadius: 0,
|
|
32
|
+
paddingHorizontal: SPACING.modalHorizontal,
|
|
33
|
+
flex: 1,
|
|
34
|
+
minHeight: '80%' // Ensure modal takes substantial screen space
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export { ModalSheet };
|
|
38
|
+
export default ModalSheet;
|
|
39
|
+
//# sourceMappingURL=ModalSheet.js.map
|
|
@@ -1 +1,373 @@
|
|
|
1
|
-
import React,{forwardRef,useImperativeHandle,useState,useCallback,useEffect}from'react';import{StyleSheet,View,TouchableOpacity,Text,Image,Alert}from'react-native';import{UniversalOnboarding}from'./UniversalOnboarding';import{COLORS}from'../constants';import{hasCredentials,getCredentials}from'../utils/secureStorage';import{initializeApiKey,isApiKeyInitialized,getApiConfig}from'../services/apiKeyService';import{API_CONFIG}from'../config/api';import{BRAND_IMAGES}from'../utils/assetRegistry';export const Onairos=forwardRef((_0x5ee2ec,_0x1f88c3)=>{const _0x232b5a={'GmWUo':_0x3229(0x0),'TWDpc':function(_0x3dc97b,_0x22ef22){return _0x3dc97b(_0x22ef22);},'VZKyM':function(_0x48ac77,_0x10ed7f){return _0x48ac77===_0x10ed7f;},'Yubcr':_0x3229(0x1),'NgSGx':_0x3229(0x2),'gOUts':function(_0x35c1f3,_0x5e5820){return _0x35c1f3(_0x5e5820);},'MoyCD':function(_0x4ed6a6,_0x1eb418){return _0x4ed6a6(_0x1eb418);},'dONMH':_0x3229(0x3),'GZTXy':_0x3229(0x4),'SLAlY':_0x3229(0x5),'VGEKv':function(_0x65d8ca,_0x30c0b6){return _0x65d8ca===_0x30c0b6;},'OyVzN':_0x3229(0x6),'TEGTA':function(_0x2dddce,_0x2327ab){return _0x2dddce instanceof _0x2327ab;},'jvzhp':'Unknown\x20initialization\x20error','cWSed':_0x3229(0x7),'yVykQ':function(_0xe68190,_0x397fc9){return _0xe68190(_0x397fc9);},'TCavp':_0x3229(0x8),'nIOQG':_0x3229(0x9),'ehhRE':_0x3229(0xa),'OniSB':_0x3229(0xb),'URNtr':_0x3229(0xc),'iacaH':_0x3229(0xd),'mYuEo':function(_0x2d2da9,_0xc365ce){return _0x2d2da9===_0xc365ce;},'ZjoKM':_0x3229(0xe),'DGcPg':function(_0x4af4b3,_0x3ffe00){return _0x4af4b3===_0x3ffe00;},'DYAAc':'uuZjX','EybiN':_0x3229(0xf),'iLEPs':function(_0x510ae9,_0x5f1947){return _0x510ae9(_0x5f1947);},'TWpVX':function(_0x78bff,_0x473430){return _0x78bff(_0x473430);},'gbxEu':function(_0x1473c6,_0x4ccca0){return _0x1473c6(_0x4ccca0);},'rabrC':'✅\x20Onairos\x20SDK:\x20API\x20key\x20initialization\x20completed\x20successfully','BtMDk':function(_0x49ea39,_0x5261e2){return _0x49ea39||_0x5261e2;},'BrGqR':_0x3229(0x10),'OfFcs':function(_0x4fef10){return _0x4fef10();},'vJPeP':function(_0x5419d8,_0x3318f5){return _0x5419d8!==_0x3318f5;},'KSJnD':function(_0x4664fd,_0x4f79f7){return _0x4664fd===_0x4f79f7;},'wCxPx':function(_0x5b34c0){return _0x5b34c0();},'SBPZd':'McdCb','tQzbd':function(_0x409e66,_0xc53098){return _0x409e66(_0xc53098);},'tcXdL':function(_0x21329e,_0x8ea576){return _0x21329e(_0x8ea576);},'meImy':_0x3229(0x11),'sbhrz':_0x3229(0x12),'AioAJ':function(_0x15840f,_0x41b615){return _0x15840f/_0x41b615;},'gGUwx':_0x3229(0x13),'kAFGB':_0x3229(0x14),'wLgif':_0x3229(0x15),'IPMtK':_0x3229(0x16),'kjoVy':_0x3229(0x17),'SKUXq':_0x3229(0x18),'YrMGt':'API\x20key\x20is\x20required.\x20Please\x20provide\x20a\x20valid\x20API\x20key\x20from\x20your\x20Onairos\x20dashboard.','iCZAU':function(_0x4ea03b,_0x198017){return _0x4ea03b(_0x198017);},'RCuhC':'existing_user_token','JCGOC':function(_0x2f3512,_0x53f46b,_0x175c13,_0x6b7342){return _0x2f3512(_0x53f46b,_0x175c13,_0x6b7342);},'HxJci':_0x3229(0x19),'updxe':function(_0x1219a6,_0x8d9a23){return _0x1219a6(_0x8d9a23);},'ExAlG':'⛔\x20Pre-check\x20failed,\x20aborting\x20overlay','FMDgo':_0x3229(0x1a),'zaaxV':function(_0x456e2a,_0xf31a5d){return _0x456e2a!==_0xf31a5d;},'CkxAl':_0x3229(0x1b),'mHiWf':_0x3229(0x1c),'ROrRT':_0x3229(0x1d),'edPhD':function(_0x3033ea,_0x1241ea){return _0x3033ea!==_0x1241ea;},'FOjzI':_0x3229(0x1e),'SspTa':'rikdf','LehjW':function(_0xbc02b4,_0x48f04d){return _0xbc02b4||_0x48f04d;},'Dsesa':_0x3229(0x1f),'IWBDO':'❌\x20Cannot\x20open\x20overlay:\x20SDK\x20not\x20initialized','HqzdE':function(_0x3f7a8f,_0x1ff1a8){return _0x3f7a8f(_0x1ff1a8);},'hBoKP':_0x3229(0x20),'RvzcW':_0x3229(0x21),'JgBEo':_0x3229(0x22),'xrBJf':function(_0x4c7044,_0x4fa846){return _0x4c7044!==_0x4fa846;},'hndyg':_0x3229(0x23),'mpgNC':'🔍\x20Checking\x20for\x20existing\x20credentials...','egHah':function(_0x10b5e4){return _0x10b5e4();},'GAYnV':'JujkO','bCWeq':_0x3229(0x24),'PIlbG':_0x3229(0x25),'cOnai':function(_0x1d69ab,_0x48cf1a){return _0x1d69ab&&_0x48cf1a;},'CxheC':function(_0x2d3966,_0x967147){return _0x2d3966!==_0x967147;},'sMBUW':'BMsKx','tYzQh':_0x3229(0x26),'WlZVu':function(_0x2054a6,_0xcdaa55,_0x18dbe8,_0x13c24e){return _0x2054a6(_0xcdaa55,_0x18dbe8,_0x13c24e);},'OjoVX':_0x3229(0x27),'uFrkK':_0x3229(0x28),'HVqWr':'❌\x20Error\x20opening\x20overlay:','JsKfL':_0x3229(0x29),'acpKc':function(_0x11f00e,_0x5097ec){return _0x11f00e(_0x5097ec);},'NhaPe':function(_0x3fd1c3,_0x272e68){return _0x3fd1c3===_0x272e68;},'TBiUU':_0x3229(0x2a),'SjNUA':_0x3229(0x2b),'IjLmP':_0x3229(0x2c),'NmikH':function(_0x41b1b6,_0x5e57af){return _0x41b1b6&&_0x5e57af;},'JFwZF':function(_0x32d899,_0x4851b7,_0x281c06,_0x2e48e0){return _0x32d899(_0x4851b7,_0x281c06,_0x2e48e0);},'UBuRq':function(_0x46bd74,_0x2ef6ee){return _0x46bd74===_0x2ef6ee;},'YxPKQ':_0x3229(0x2d),'TvvIv':'tEWYy','zPjkc':function(_0x2d6b7a,_0xa8724e){return _0x2d6b7a(_0xa8724e);},'QhCHU':_0x3229(0x2e),'DkbzB':_0x3229(0x2f),'OQiRr':function(_0xe6f206,_0x36b471){return _0xe6f206/_0x36b471;},'poeNd':_0x3229(0x30),'oMfbE':'tWSnI','zAKXK':_0x3229(0x31),'WRcHS':_0x3229(0x32),'Ylfqa':_0x3229(0x33),'VRaEZ':_0x3229(0x34),'Nswxk':'default','UDcpU':function(_0x33232a,_0x1bcaeb,_0x4442df){return _0x33232a(_0x1bcaeb,_0x4442df);},'ZIiRo':function(_0xd29b68,_0x2ea020,_0x56da4f){return _0xd29b68(_0x2ea020,_0x56da4f);},'GAYAp':function(_0x18a428,_0x29b6d0,_0x2445d2){return _0x18a428(_0x29b6d0,_0x2445d2);},'uXulb':function(_0x49a0e6,_0x20138e,_0xc5906f){return _0x49a0e6(_0x20138e,_0xc5906f);},'xPcZT':function(_0x48d964,_0x1e5ab2){return _0x48d964===_0x1e5ab2;},'XgyNL':function(_0x59505d,_0xeccacb){return _0x59505d===_0xeccacb;},'TtzAS':_0x3229(0x35),'EVfrG':function(_0x9d99db){return _0x9d99db();},'DApQu':'contain'},{returnLink:_0x3a98a5,prefillUrl:_0x3e6eb5,AppName:_0x4d6003,buttonType:buttonType=_0x232b5a[_0x3229(0x36)],requestData:_0x3a8b80,buttonWidth:buttonWidth=0xc8,buttonHeight:buttonHeight=0x30,hasStroke:hasStroke=![],enabled:enabled=!![],buttonForm:buttonForm=_0x232b5a[_0x3229(0x37)],onRejection:_0x152fa2,onResolved:_0x4f094c,preCheck:_0x12416a,color:color=COLORS[_0x3229(0x38)],debug:debug=![],darkMode:darkMode=![],preferredPlatform:_0x276170,testMode:testMode=![],apiKey:_0x1abc9f,environment:environment=_0x3229(0x39),enableLogging:enableLogging=!![],timeout:timeout=0x7530,retryAttempts:retryAttempts=0x3}=_0x5ee2ec,[_0x83bfba,_0xc069d8]=_0x232b5a[_0x3229(0x3a)](useState,![]),[_0x373bf8,_0x3bf6d2]=_0x232b5a['zPjkc'](useState,![]),[_0x2f9fd5,_0x494425]=useState(null),[_0xa90039,_0x3d8158]=useState(![]);useEffect(()=>{const _0x9f97a6={'JTCUs':function(_0x43cb4a,_0x513303){return _0x232b5a[_0x3229(0x3b)](_0x43cb4a,_0x513303);},'xoyAq':function(_0x4298de,_0x361f34){return _0x232b5a['gbxEu'](_0x4298de,_0x361f34);},'OnNqI':_0x232b5a[_0x3229(0x3c)],'UEUhT':function(_0x41e5df,_0x151021){return _0x232b5a[_0x3229(0x3d)](_0x41e5df,_0x151021);},'NMopr':_0x3229(0x3e),'ZvKib':function(_0x4c5d44,_0x37817c){return _0x232b5a['gbxEu'](_0x4c5d44,_0x37817c);},'CmZRm':_0x3229(0x21),'bKMsc':_0x232b5a[_0x3229(0x3f)]};var _0x57ce59;let _0x5dfaa2=!![];const _0x2298fd=async()=>{const _0x1ec573={'ZcXvr':'#999','OUfIh':_0x232b5a[_0x3229(0x40)]};if(_0xa90039)return;_0x232b5a[_0x3229(0x41)](_0x3d8158,!![]),_0x232b5a[_0x3229(0x41)](_0x494425,null);try{if(_0x232b5a[_0x3229(0x42)](_0x232b5a[_0x3229(0x43)],_0x232b5a[_0x3229(0x43)])){console[_0x3229(0x44)](_0x232b5a[_0x3229(0x45)]);if(!_0x1abc9f)throw new Error(_0x3229(0x46));const _0x175308={'apiKey':_0x1abc9f,'environment':environment,'enableLogging':enableLogging,'timeout':timeout,'retryAttempts':retryAttempts};await _0x232b5a[_0x3229(0x41)](initializeApiKey,_0x175308),_0x5dfaa2&&(_0x232b5a[_0x3229(0x47)](_0x3bf6d2,!![]),_0x232b5a[_0x3229(0x48)](_0x494425,null),enableLogging&&(_0x232b5a['dONMH']!==_0x232b5a[_0x3229(0x49)]?(console['log'](_0x3229(0x4a)),console[_0x3229(0x44)](_0x232b5a[_0x3229(0x4b)],{'environment':environment,'enableLogging':enableLogging,'timeout':timeout,'retryAttempts':retryAttempts,'apiKeyLength':_0x1abc9f[_0x3229(0x4c)]})):(_0x9f97a6[_0x3229(0x4d)](_0x47009e,!![]),_0x9f97a6[_0x3229(0x4e)](_0x2b6cf0,null),_0x2113e6&&(_0x476e66['log'](_0x9f97a6['OnNqI']),_0xf04eac[_0x3229(0x44)](_0x3229(0x5),{'environment':_0x1ddcf6,'enableLogging':_0x320e25,'timeout':_0x5afbf8,'retryAttempts':_0x413048,'apiKeyLength':_0x37a607[_0x3229(0x4c)]})))));}else return React[_0x3229(0x4f)](View,{'style':_0x4c384c[_0x3229(0x50)]},React['createElement'](TouchableOpacity,{'style':[_0xf7a621[_0x3229(0x51)],{'backgroundColor':_0x1ec573[_0x3229(0x52)]}],'disabled':!![]},React['createElement'](Text,{'style':_0x112f3d[_0x3229(0x53)]},_0x1ec573['OUfIh'])));}catch(_0x10937b){if(_0x232b5a['VGEKv']('KSyyB',_0x232b5a[_0x3229(0x54)])){const _0x30c0bb=_0x232b5a[_0x3229(0x55)](_0x10937b,Error)?_0x10937b[_0x3229(0x56)]:_0x232b5a[_0x3229(0x57)];console[_0x3229(0x58)](_0x232b5a[_0x3229(0x59)],_0x30c0bb),_0x5dfaa2&&(_0x232b5a['yVykQ'](_0x3bf6d2,![]),_0x494425(_0x30c0bb),enableLogging&&(_0x232b5a[_0x3229(0x5a)]('wGWKl',_0x232b5a['TCavp'])?(console[_0x3229(0x5b)](_0x3229(0x11)),console['log'](_0x232b5a[_0x3229(0x5c)]),console['log'](_0x232b5a['ehhRE']),console[_0x3229(0x44)](_0x232b5a['OniSB']),console[_0x3229(0x44)](_0x232b5a['URNtr']),console[_0x3229(0x44)](_0x232b5a[_0x3229(0x5d)]),console['groupEnd']()):_0x9f97a6[_0x3229(0x4d)](_0x2a7c3e,_0x3229(0x5e)+_0x4cb316)),_0x152fa2&&_0x152fa2(_0x3229(0x5e)+_0x30c0bb));}else{const _0xc15051=_0x9f97a6[_0x3229(0x5f)](_0x43d52b,_0x3229(0x1f));_0x2a3832['error'](_0x9f97a6[_0x3229(0x60)]);_0x3b9157?_0x9f97a6['ZvKib'](_0x98d89a,_0xc15051):Alert[_0x3229(0x61)](_0x3229(0x16),_0xc15051,[{'text':'OK'}]);return;}}finally{_0x232b5a[_0x3229(0x62)]('vrIwr',_0x232b5a[_0x3229(0x63)])?_0x2e84cd():_0x5dfaa2&&(_0x232b5a[_0x3229(0x64)](_0x232b5a[_0x3229(0x65)],_0x232b5a[_0x3229(0x66)])?_0x261269[_0x3229(0x44)](_0x9f97a6['CmZRm']):_0x232b5a[_0x3229(0x67)](_0x3d8158,![]));}};if(_0x1abc9f&&(!_0x232b5a['OfFcs'](isApiKeyInitialized)||_0x232b5a[_0x3229(0x68)](_0x232b5a['KSJnD'](_0x57ce59=_0x232b5a[_0x3229(0x69)](getApiConfig),null)||_0x232b5a['VGEKv'](_0x57ce59,void 0x0)?void 0x0:_0x57ce59['apiKey'],_0x1abc9f)))_0x232b5a[_0x3229(0x6a)]===_0x3229(0x6b)?(_0x261cff&&_0x797977[_0x3229(0x44)](_0x9f97a6[_0x3229(0x6c)],_0x189b5b),_0x4ceb9e(![]),_0x32fa33&&_0x2d88d8(_0x1d0be1)):_0x232b5a[_0x3229(0x69)](_0x2298fd);else _0x232b5a['OfFcs'](isApiKeyInitialized)&&(_0x3bf6d2(!![]),_0x232b5a[_0x3229(0x6d)](_0x3d8158,![]),enableLogging&&console[_0x3229(0x44)](_0x3229(0x1a)));return()=>{_0x5dfaa2=![];};},[_0x1abc9f,environment,enableLogging,timeout,retryAttempts,_0x152fa2]),_0x232b5a['UDcpU'](useImperativeHandle,_0x1f88c3,()=>({'openOverlay':_0x5af011,'closeOverlay':_0x485426,'isInitialized':()=>_0x373bf8,'getApiConfig':()=>getApiConfig()}));const _0x5af011=_0x232b5a[_0x3229(0x6e)](useCallback,async()=>{const _0x4415a2={'KoNcE':_0x232b5a[_0x3229(0x6f)],'ogBMW':_0x232b5a[_0x3229(0x70)]};if(_0x232b5a[_0x3229(0x71)]('QhAhS',_0x232b5a[_0x3229(0x72)])){const _0x3125d4=_0x232b5a[_0x3229(0x55)](_0x4fa109,_0x38ecae)?_0x59b85a[_0x3229(0x56)]:_0x232b5a[_0x3229(0x57)];_0x1ad56a[_0x3229(0x58)](_0x232b5a['cWSed'],_0x3125d4);if(_0xcf4aa4){_0x232b5a[_0x3229(0x67)](_0x457916,![]),_0x232b5a[_0x3229(0x73)](_0x19e44b,_0x3125d4);if(_0x4fded4){const _0x355d73=_0x3229(0x74)[_0x3229(0x75)]('|');let _0x2214aa=0x0;while(!![]){switch(_0x355d73[_0x2214aa++]){case'0':_0x549ade[_0x3229(0x5b)](_0x232b5a[_0x3229(0x76)]);continue;case'1':_0x1e445c[_0x3229(0x77)]();continue;case'2':_0x2b3020['log'](_0x232b5a[_0x3229(0x5c)]);continue;case'3':_0xe02aa[_0x3229(0x44)](_0x232b5a[_0x3229(0x78)]);continue;case'4':_0x25663f[_0x3229(0x44)](_0x3229(0xc));continue;case'5':_0x365398[_0x3229(0x44)](_0x232b5a[_0x3229(0x79)]);continue;case'6':_0x3bbeb4[_0x3229(0x44)](_0x232b5a[_0x3229(0x5d)]);continue;}break;}}_0x420b04&&_0x2c5087(_0x3229(0x5e)+_0x3125d4);}}else{console[_0x3229(0x44)](_0x232b5a[_0x3229(0x7a)],_0x373bf8,'isInitializing:',_0xa90039,_0x232b5a[_0x3229(0x7b)],_0x83bfba);try{if(!_0x373bf8){if(_0x232b5a[_0x3229(0x7c)](_0x232b5a['FOjzI'],_0x232b5a[_0x3229(0x7d)])){const _0x386db9=_0x232b5a[_0x3229(0x7e)](_0x2f9fd5,_0x232b5a[_0x3229(0x7f)]);console[_0x3229(0x58)](_0x232b5a['IWBDO']);_0x152fa2?_0x232b5a[_0x3229(0x80)](_0x152fa2,_0x386db9):Alert[_0x3229(0x61)](_0x232b5a[_0x3229(0x81)],_0x386db9,[{'text':'OK'}]);return;}else{const _0x4d979b={'width':_0x43ac56,'height':_0x5e65e2,'backgroundColor':_0x3574f8,'borderRadius':_0x13836f===_0x232b5a[_0x3229(0x82)]?_0x232b5a[_0x3229(0x83)](_0x5ed9c0,0x2):0x8,'alignItems':_0x232b5a[_0x3229(0x84)],'justifyContent':_0x232b5a[_0x3229(0x84)],'flexDirection':_0x3229(0x30),'opacity':_0x5f3899?0x1:0.6};return _0x8f4440&&(_0x4d979b[_0x3229(0x85)]=0x2,_0x4d979b['borderColor']=_0x254e27?_0x232b5a[_0x3229(0x86)]:_0x232b5a['wLgif']),_0x4d979b;}}if(_0x12416a){if(_0x232b5a[_0x3229(0x71)](_0x232b5a[_0x3229(0x87)],_0x232b5a[_0x3229(0x87)])){const _0x4dd39f={'AJXYi':_0x232b5a['IPMtK']};return React[_0x3229(0x4f)](View,{'style':_0x2aac94[_0x3229(0x88)]},React[_0x3229(0x4f)](TouchableOpacity,{'style':[_0x5115cd[_0x3229(0x89)],{'backgroundColor':_0x232b5a['kjoVy']}],'onPress':()=>{Alert[_0x3229(0x61)](_0x4dd39f[_0x3229(0x8a)],'Onairos\x20SDK\x20initialization\x20failed:\x0a\x0a'+_0x5ada3a+_0x3229(0x8b),[{'text':'OK'}]);}},React[_0x3229(0x4f)](Text,{'style':_0x479868[_0x3229(0x8c)]},_0x232b5a['SKUXq'])));}else{enableLogging&&console[_0x3229(0x44)](_0x232b5a[_0x3229(0x8d)]);try{const _0x1d5ce3=await _0x232b5a[_0x3229(0x8e)](_0x12416a);if(!_0x1d5ce3){if(enableLogging){if(_0x232b5a[_0x3229(0x62)]('LOrfc',_0x232b5a[_0x3229(0x8f)]))throw new _0x3f9380(_0x232b5a[_0x3229(0x90)]);else console[_0x3229(0x44)](_0x232b5a[_0x3229(0x6f)]);}return;}enableLogging&&console[_0x3229(0x44)]('✅\x20Pre-check\x20passed');}catch(_0x38aa83){console[_0x3229(0x58)](_0x232b5a['HxJci'],_0x38aa83);_0x152fa2&&(_0x232b5a[_0x3229(0x91)](_0x232b5a[_0x3229(0x92)],_0x232b5a[_0x3229(0x92)])?_0x232b5a[_0x3229(0x93)](_0x548a6a,_0x44966b):_0x232b5a[_0x3229(0x93)](_0x152fa2,'Pre-check\x20failed:\x20'+_0x38aa83[_0x3229(0x56)]));return;}}}enableLogging&&console[_0x3229(0x44)](_0x232b5a[_0x3229(0x94)]);const _0x2d9f9e=await _0x232b5a[_0x3229(0x95)](hasCredentials);if(_0x2d9f9e){enableLogging&&(_0x232b5a[_0x3229(0x68)](_0x232b5a[_0x3229(0x96)],_0x232b5a[_0x3229(0x96)])?Alert[_0x3229(0x61)](_0x232b5a[_0x3229(0x81)],_0x3b88fd,[{'text':'OK'}]):console[_0x3229(0x44)](_0x232b5a[_0x3229(0x97)]));try{if(_0x232b5a['mYuEo'](_0x232b5a[_0x3229(0x98)],_0x232b5a[_0x3229(0x98)])){const _0x59016a=await _0x232b5a[_0x3229(0x8e)](getCredentials);if(_0x232b5a[_0x3229(0x99)](_0x59016a,_0x4f094c)){if(_0x232b5a[_0x3229(0x9a)](_0x232b5a['sMBUW'],_0x232b5a['sMBUW'])){const _0x127ee2=_0x352206[_0x3229(0x9b)]+'/user/data',_0x2f4f46=_0x232b5a[_0x3229(0x9c)];_0x38b12d&&_0x4b0910[_0x3229(0x44)](_0x3229(0x26));_0x232b5a[_0x3229(0x9d)](_0x454b7c,_0x127ee2,_0x2f4f46,_0x111da0);return;}else{const _0x2f0529=API_CONFIG['BASE_URL']+_0x3229(0x9e),_0x4f4ef5=_0x232b5a[_0x3229(0x9c)];if(enableLogging){if(_0x3229(0x9f)!==_0x3229(0x9f)){_0x161298&&_0x3fdb74[_0x3229(0x44)](_0x4415a2[_0x3229(0xa0)]);return;}else console[_0x3229(0x44)](_0x232b5a[_0x3229(0xa1)]);}_0x232b5a[_0x3229(0xa2)](_0x4f094c,_0x2f0529,_0x4f4ef5,_0x59016a);return;}}}else _0x3f100d(_0x3306c3);}catch(_0x68572c){if(_0x232b5a[_0x3229(0xa3)](_0x232b5a[_0x3229(0xa4)],_0x232b5a[_0x3229(0xa4)]))console[_0x3229(0xa5)](_0x232b5a[_0x3229(0xa6)],_0x68572c);else{_0x2af242[_0x3229(0x58)](_0x232b5a[_0x3229(0xa7)],_0x129651);_0x17b42d&&_0x232b5a[_0x3229(0xa8)](_0x56ae59,'Pre-check\x20failed:\x20'+_0x3a1f7a[_0x3229(0x56)]);return;}}}enableLogging&&console[_0x3229(0x44)](_0x3229(0xa9)),_0x232b5a[_0x3229(0x6d)](_0xc069d8,!![]);}catch(_0x360651){console[_0x3229(0x58)](_0x232b5a[_0x3229(0xaa)],_0x360651),_0x152fa2&&(_0x3229(0xab)===_0x232b5a[_0x3229(0xac)]?_0x2031c1[_0x3229(0x44)](_0x4415a2['ogBMW']):_0x232b5a[_0x3229(0xad)](_0x152fa2,_0x3229(0xae)+_0x360651['message']));}}},[_0x373bf8,_0x2f9fd5,_0x12416a,enableLogging,_0x152fa2,_0x4f094c]),_0x485426=_0x232b5a[_0x3229(0xaf)](useCallback,_0x818c06=>{const _0x5b1be6={'bojBn':_0x232b5a[_0x3229(0x6f)]};_0x232b5a['NhaPe'](_0x232b5a['TBiUU'],_0x232b5a['SjNUA'])?_0x41f4ab[_0x3229(0x44)](_0x5b1be6[_0x3229(0xb0)]):(console[_0x3229(0x44)](_0x232b5a[_0x3229(0xb1)],_0x818c06),_0x232b5a['iLEPs'](_0xc069d8,![]),console[_0x3229(0x44)](_0x3229(0xb2)),_0x232b5a[_0x3229(0xb3)](_0x818c06,_0x4f094c)&&_0x232b5a[_0x3229(0xb4)](_0x4f094c,_0x818c06[_0x3229(0xb5)],_0x818c06[_0x3229(0xb6)],_0x818c06[_0x3229(0xb7)]));},[enableLogging,_0x4f094c]),_0x50310f=_0x232b5a['uXulb'](useCallback,_0x3317a0=>{_0x232b5a[_0x3229(0xb8)](_0x232b5a[_0x3229(0xb9)],_0x232b5a['YxPKQ'])?(enableLogging&&(_0x232b5a[_0x3229(0xba)]!==_0x3229(0xbb)?_0x40d65d[_0x3229(0x44)](_0x3229(0xa9)):console[_0x3229(0x44)](_0x3229(0x10),_0x3317a0)),_0x232b5a[_0x3229(0xbc)](_0xc069d8,![]),_0x152fa2&&_0x152fa2(_0x3317a0)):_0xb3c498(_0x3229(0xae)+_0x409cca[_0x3229(0x56)]);},[enableLogging,_0x152fa2]);if(_0x232b5a[_0x3229(0xb3)](_0x2f9fd5,!_0xa90039)){if(_0x232b5a[_0x3229(0xbd)](_0x3229(0xbe),_0x3229(0xbf)))_0x3a58e9[_0x3229(0x44)](_0x232b5a[_0x3229(0xa1)]);else return React['createElement'](View,{'style':styles['errorContainer']},React[_0x3229(0x4f)](TouchableOpacity,{'style':[styles[_0x3229(0x89)],{'backgroundColor':_0x3229(0x17)}],'onPress':()=>{const _0x6bfbd5={'YDOVr':_0x232b5a[_0x3229(0x81)]};_0x232b5a['CxheC'](_0x3229(0x2e),_0x232b5a[_0x3229(0xc0)])?Alert[_0x3229(0x61)](_0x6bfbd5[_0x3229(0xc1)],_0x3229(0xc2)+_0x330923+_0x3229(0x8b),[{'text':'OK'}]):Alert['alert'](_0x232b5a[_0x3229(0x81)],_0x3229(0xc2)+_0x2f9fd5+_0x3229(0x8b),[{'text':'OK'}]);}},React[_0x3229(0x4f)](Text,{'style':styles[_0x3229(0x8c)]},_0x232b5a[_0x3229(0xc3)])));}if(_0xa90039||!_0x373bf8){if(_0x232b5a[_0x3229(0xc4)]('jqAiJ',_0x232b5a[_0x3229(0xc5)]))_0x9de021[_0x3229(0x58)](_0x3229(0xc6),_0x3921bd),_0x1248b2&&_0x232b5a[_0x3229(0x47)](_0x3d70b0,_0x3229(0xae)+_0x550b7f[_0x3229(0x56)]);else return React[_0x3229(0x4f)](View,{'style':styles[_0x3229(0x50)]},React[_0x3229(0x4f)](TouchableOpacity,{'style':[styles[_0x3229(0x51)],{'backgroundColor':'#999'}],'disabled':!![]},React['createElement'](Text,{'style':styles[_0x3229(0x53)]},_0x3229(0x0))));}const _0x2109cb=()=>{const _0x3a6018={'VVdtR':_0x3229(0xc7)};if(_0x232b5a[_0x3229(0x64)](_0x232b5a[_0x3229(0xc8)],_0x3229(0xc9)))_0x329c26['log'](_0x3a6018['VVdtR']);else{const _0x1c3cb9={'width':buttonWidth,'height':buttonHeight,'backgroundColor':color,'borderRadius':buttonType===_0x232b5a[_0x3229(0x82)]?_0x232b5a[_0x3229(0xca)](buttonHeight,0x2):0x8,'alignItems':_0x232b5a['gGUwx'],'justifyContent':_0x232b5a[_0x3229(0x84)],'flexDirection':_0x232b5a[_0x3229(0xcb)],'opacity':enabled?0x1:0.6};return hasStroke&&(_0x232b5a[_0x3229(0x91)](_0x3229(0xcc),_0x232b5a[_0x3229(0xcd)])?_0x1b54d7&&_0x232b5a[_0x3229(0x3b)](_0x4edeb1,![]):(_0x1c3cb9[_0x3229(0x85)]=0x2,_0x1c3cb9[_0x3229(0xce)]=darkMode?_0x232b5a[_0x3229(0x86)]:_0x232b5a[_0x3229(0xcf)])),_0x1c3cb9;}},_0x23fcda=()=>{switch(buttonForm){case _0x232b5a[_0x3229(0xd0)]:return _0x232b5a[_0x3229(0xd1)];default:return _0x232b5a['Ylfqa'];}};return React[_0x3229(0x4f)](React['Fragment'],null,React[_0x3229(0x4f)](TouchableOpacity,{'style':_0x232b5a[_0x3229(0xd2)](_0x2109cb),'onPress':_0x5af011,'disabled':_0x232b5a[_0x3229(0x7e)](!enabled,_0xa90039)||!_0x373bf8,'activeOpacity':0.8},React['createElement'](Image,{'source':BRAND_IMAGES[_0x3229(0xd3)],'style':styles[_0x3229(0xd4)],'resizeMode':_0x232b5a[_0x3229(0xd5)]}),React['createElement'](Text,{'style':[styles[_0x3229(0xd6)],{'color':darkMode?_0x232b5a[_0x3229(0xcf)]:_0x232b5a[_0x3229(0x86)]}]},_0x23fcda())),React[_0x3229(0x4f)](UniversalOnboarding,{'visible':_0x83bfba,'onClose':_0x485426,'AppName':_0x4d6003,'requestData':_0x232b5a[_0x3229(0x3d)](_0x3a8b80,{}),'returnLink':_0x3a98a5,'onComplete':_0x485426,'embedd':![],'debug':debug,'testMode':testMode,'preferredPlatform':_0x276170}));});function _0x5d71(){const _0x2f1efa=['🔄\x20Initializing...','ljgKo','🚀\x20Onairos\x20SDK:\x20Starting\x20API\x20key\x20initialization...','yDFcF','dQkkh','📊\x20Configuration:','KSyyB','❌\x20Onairos\x20SDK:\x20API\x20key\x20initialization\x20failed:','wGWKl','1.\x20Check\x20that\x20your\x20API\x20key\x20is\x20correct\x20and\x20not\x20expired','2.\x20Verify\x20you\x20have\x20the\x20right\x20permissions\x20for\x20your\x20use\x20case','3.\x20Ensure\x20your\x20environment\x20setting\x20matches\x20your\x20API\x20key','4.\x20Check\x20your\x20internet\x20connection','5.\x20Visit\x20https://dashboard.onairos.uk\x20to\x20manage\x20your\x20API\x20keys','jRuBY','QGZCj','❌\x20Overlay\x20rejected:','🔧\x20API\x20Key\x20Troubleshooting\x20Guide','pill','center','#fff','#000','SDK\x20Error','#FF6B6B','⚠️\x20SDK\x20Error','❌\x20Pre-check\x20error:','✅\x20Onairos\x20component:\x20SDK\x20already\x20initialized,\x20syncing\x20state','QhAhS','🔘\x20Button\x20pressed!\x20isInitialized:','showOverlay:','hVofj','SDK\x20not\x20initialized.\x20Please\x20check\x20your\x20API\x20key.','OxiPt','🔍\x20Running\x20pre-check\x20validation...','MKlBB','STQxM','🔑\x20Existing\x20credentials\x20found,\x20attempting\x20automatic\x20resolution...','eNmPw','✅\x20Resolving\x20with\x20existing\x20credentials','lRnRA','⚠️\x20Failed\x20to\x20retrieve\x20existing\x20credentials:','tKXPJ','GAtxc','FhfnG','🔽\x20Closing\x20Onairos\x20overlay,\x20result:','ofCwz','rqvAo','kiHqQ','row','connect','Connect\x20with\x20Onairos','Continue\x20with\x20Onairos','normal','kQQch','VRaEZ','Nswxk','primary','production','yVykQ','TWpVX','rabrC','BtMDk','❌\x20Cannot\x20open\x20overlay:\x20SDK\x20not\x20initialized','BrGqR','GmWUo','TWDpc','VZKyM','Yubcr','log','NgSGx','API\x20key\x20is\x20required.\x20Please\x20provide\x20a\x20valid\x20API\x20key\x20from\x20your\x20Onairos\x20dashboard.','gOUts','MoyCD','GZTXy','✅\x20Onairos\x20SDK:\x20API\x20key\x20initialization\x20completed\x20successfully','SLAlY','length','JTCUs','xoyAq','createElement','loadingContainer','loadingButton','ZcXvr','loadingButtonText','OyVzN','TEGTA','message','jvzhp','error','cWSed','VGEKv','group','nIOQG','iacaH','SDK\x20initialization\x20failed:\x20','UEUhT','NMopr','alert','mYuEo','ZjoKM','DGcPg','DYAAc','EybiN','iLEPs','vJPeP','wCxPx','SBPZd','CseJB','bKMsc','tQzbd','ZIiRo','ExAlG','FMDgo','zaaxV','CkxAl','tcXdL','0|2|3|5|4|6|1','split','meImy','groupEnd','ehhRE','OniSB','mHiWf','ROrRT','edPhD','SspTa','LehjW','Dsesa','HqzdE','IPMtK','sbhrz','AioAJ','gGUwx','borderWidth','kAFGB','hBoKP','errorContainer','errorButton','AJXYi','\x0a\x0aPlease\x20check\x20your\x20API\x20key\x20and\x20try\x20again.','errorButtonText','RvzcW','OfFcs','JgBEo','YrMGt','xrBJf','hndyg','iCZAU','mpgNC','egHah','GAYnV','bCWeq','PIlbG','cOnai','CxheC','BASE_URL','RCuhC','JCGOC','/user/data','CTMno','KoNcE','tYzQh','WlZVu','KSJnD','OjoVX','warn','uFrkK','HxJci','updxe','🎨\x20Opening\x20Onairos\x20overlay...','HVqWr','mWOST','JsKfL','acpKc','Failed\x20to\x20open\x20overlay:\x20','GAYAp','bojBn','IjLmP','🔽\x20showOverlay\x20set\x20to\x20false','NmikH','JFwZF','apiUrl','token','userData','UBuRq','YxPKQ','TvvIv','tEWYy','zPjkc','xPcZT','rpITZ','UaEok','QhCHU','YDOVr','Onairos\x20SDK\x20initialization\x20failed:\x0a\x0a','SKUXq','XgyNL','TtzAS','❌\x20Error\x20opening\x20overlay:','✅\x20Pre-check\x20passed','DkbzB','YuWUP','OQiRr','poeNd','tWSnI','oMfbE','borderColor','wLgif','zAKXK','WRcHS','EVfrG','onairosLogoAlt','logo','DApQu','buttonText','create','600'];_0x5d71=function(){return _0x2f1efa;};return _0x5d71();}function _0x3229(_0x5d71c4,_0x32292e){_0x5d71c4=_0x5d71c4-0x0;const _0x1c4cf=_0x5d71();let _0x55d1ab=_0x1c4cf[_0x5d71c4];return _0x55d1ab;}const styles=StyleSheet[_0x3229(0xd7)]({'button':{'flexDirection':_0x3229(0x30),'alignItems':_0x3229(0x13),'justifyContent':'center','paddingVertical':0xc,'paddingHorizontal':0x10,'shadowColor':_0x3229(0x15),'shadowOffset':{'width':0x0,'height':0x2},'shadowOpacity':0.1,'shadowRadius':0x4,'elevation':0x2},'buttonContent':{'flexDirection':_0x3229(0x30),'alignItems':_0x3229(0x13),'justifyContent':'center'},'logo':{'width':0x18,'height':0x18,'marginRight':0x8},'buttonText':{'fontSize':0x10,'fontWeight':'600','textAlign':_0x3229(0x13)},'errorContainer':{'flex':0x1,'justifyContent':'center','alignItems':'center'},'errorButton':{'padding':0x10,'borderRadius':0x8},'errorButtonText':{'fontSize':0x10,'fontWeight':'600','color':_0x3229(0x14)},'loadingContainer':{'flex':0x1,'justifyContent':_0x3229(0x13),'alignItems':_0x3229(0x13)},'loadingButton':{'padding':0x10,'borderRadius':0x8},'loadingButtonText':{'fontSize':0x10,'fontWeight':_0x3229(0xd8),'color':'#fff'}});
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useState, useCallback, useEffect } from 'react';
|
|
2
|
+
import { StyleSheet, View, TouchableOpacity, Text, Image, Alert } from 'react-native';
|
|
3
|
+
import { UniversalOnboarding } from './UniversalOnboarding';
|
|
4
|
+
import { COLORS } from '../constants';
|
|
5
|
+
import { hasCredentials, getCredentials } from '../utils/secureStorage';
|
|
6
|
+
import { initializeApiKey, isApiKeyInitialized, getApiConfig } from '../services/apiKeyService';
|
|
7
|
+
import { API_CONFIG } from '../config/api';
|
|
8
|
+
import { BRAND_IMAGES } from '../utils/assetRegistry';
|
|
9
|
+
export const Onairos = /*#__PURE__*/forwardRef((props, ref) => {
|
|
10
|
+
const {
|
|
11
|
+
returnLink,
|
|
12
|
+
prefillUrl,
|
|
13
|
+
AppName,
|
|
14
|
+
buttonType = 'normal',
|
|
15
|
+
requestData,
|
|
16
|
+
buttonWidth = 200,
|
|
17
|
+
buttonHeight = 48,
|
|
18
|
+
hasStroke = false,
|
|
19
|
+
enabled = true,
|
|
20
|
+
buttonForm = 'default',
|
|
21
|
+
onRejection,
|
|
22
|
+
onResolved,
|
|
23
|
+
preCheck,
|
|
24
|
+
color = COLORS.primary,
|
|
25
|
+
debug = false,
|
|
26
|
+
darkMode = false,
|
|
27
|
+
preferredPlatform,
|
|
28
|
+
testMode = false,
|
|
29
|
+
// API Key props
|
|
30
|
+
apiKey,
|
|
31
|
+
environment = 'production',
|
|
32
|
+
enableLogging = true,
|
|
33
|
+
timeout = 30000,
|
|
34
|
+
retryAttempts = 3
|
|
35
|
+
} = props;
|
|
36
|
+
const [showOverlay, setShowOverlay] = useState(false);
|
|
37
|
+
const [isInitialized, setIsInitialized] = useState(false);
|
|
38
|
+
const [initializationError, setInitializationError] = useState(null);
|
|
39
|
+
const [isInitializing, setIsInitializing] = useState(false);
|
|
40
|
+
|
|
41
|
+
// Initialize API key when component mounts or API key changes
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
var _getApiConfig;
|
|
44
|
+
let isMounted = true;
|
|
45
|
+
const initializeApi = async () => {
|
|
46
|
+
// Skip if already initializing
|
|
47
|
+
if (isInitializing) return;
|
|
48
|
+
setIsInitializing(true);
|
|
49
|
+
setInitializationError(null);
|
|
50
|
+
try {
|
|
51
|
+
console.log('🚀 Onairos SDK: Starting API key initialization...');
|
|
52
|
+
if (!apiKey) {
|
|
53
|
+
throw new Error('API key is required. Please provide a valid API key from your Onairos dashboard.');
|
|
54
|
+
}
|
|
55
|
+
const config = {
|
|
56
|
+
apiKey,
|
|
57
|
+
environment,
|
|
58
|
+
enableLogging,
|
|
59
|
+
timeout,
|
|
60
|
+
retryAttempts
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// Initialize the API key service
|
|
64
|
+
await initializeApiKey(config);
|
|
65
|
+
if (isMounted) {
|
|
66
|
+
setIsInitialized(true);
|
|
67
|
+
setInitializationError(null);
|
|
68
|
+
if (enableLogging) {
|
|
69
|
+
console.log('✅ Onairos SDK: API key initialization completed successfully');
|
|
70
|
+
console.log('📊 Configuration:', {
|
|
71
|
+
environment,
|
|
72
|
+
enableLogging,
|
|
73
|
+
timeout,
|
|
74
|
+
retryAttempts,
|
|
75
|
+
apiKeyLength: apiKey.length
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
} catch (error) {
|
|
80
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown initialization error';
|
|
81
|
+
console.error('❌ Onairos SDK: API key initialization failed:', errorMessage);
|
|
82
|
+
if (isMounted) {
|
|
83
|
+
setIsInitialized(false);
|
|
84
|
+
setInitializationError(errorMessage);
|
|
85
|
+
|
|
86
|
+
// Show developer-friendly error
|
|
87
|
+
if (enableLogging) {
|
|
88
|
+
console.group('🔧 API Key Troubleshooting Guide');
|
|
89
|
+
console.log('1. Check that your API key is correct and not expired');
|
|
90
|
+
console.log('2. Verify you have the right permissions for your use case');
|
|
91
|
+
console.log('3. Ensure your environment setting matches your API key');
|
|
92
|
+
console.log('4. Check your internet connection');
|
|
93
|
+
console.log('5. Visit https://dashboard.onairos.uk to manage your API keys');
|
|
94
|
+
console.groupEnd();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Call rejection callback if provided
|
|
98
|
+
if (onRejection) {
|
|
99
|
+
onRejection(`SDK initialization failed: ${errorMessage}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
} finally {
|
|
103
|
+
if (isMounted) {
|
|
104
|
+
setIsInitializing(false);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// Only initialize if we have an API key and aren't already initialized correctly
|
|
110
|
+
if (apiKey && (!isApiKeyInitialized() || ((_getApiConfig = getApiConfig()) === null || _getApiConfig === void 0 ? void 0 : _getApiConfig.apiKey) !== apiKey)) {
|
|
111
|
+
initializeApi();
|
|
112
|
+
} else if (isApiKeyInitialized()) {
|
|
113
|
+
// SDK already initialized (e.g., from App.tsx), sync internal state
|
|
114
|
+
setIsInitialized(true);
|
|
115
|
+
setIsInitializing(false);
|
|
116
|
+
if (enableLogging) {
|
|
117
|
+
console.log('✅ Onairos component: SDK already initialized, syncing state');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return () => {
|
|
121
|
+
isMounted = false;
|
|
122
|
+
};
|
|
123
|
+
}, [apiKey, environment, enableLogging, timeout, retryAttempts, onRejection]);
|
|
124
|
+
|
|
125
|
+
// Imperative methods
|
|
126
|
+
useImperativeHandle(ref, () => ({
|
|
127
|
+
openOverlay: handleShowOverlay,
|
|
128
|
+
closeOverlay: handleCloseOverlay,
|
|
129
|
+
isInitialized: () => isInitialized,
|
|
130
|
+
getApiConfig: () => getApiConfig()
|
|
131
|
+
}));
|
|
132
|
+
const handleShowOverlay = useCallback(async () => {
|
|
133
|
+
console.log('🔘 Button pressed! isInitialized:', isInitialized, 'isInitializing:', isInitializing, 'showOverlay:', showOverlay);
|
|
134
|
+
try {
|
|
135
|
+
// Check if SDK is initialized
|
|
136
|
+
if (!isInitialized) {
|
|
137
|
+
const errorMessage = initializationError || 'SDK not initialized. Please check your API key.';
|
|
138
|
+
console.error('❌ Cannot open overlay: SDK not initialized');
|
|
139
|
+
if (onRejection) {
|
|
140
|
+
onRejection(errorMessage);
|
|
141
|
+
} else {
|
|
142
|
+
Alert.alert('SDK Error', errorMessage, [{
|
|
143
|
+
text: 'OK'
|
|
144
|
+
}]);
|
|
145
|
+
}
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Run pre-check if provided
|
|
150
|
+
if (preCheck) {
|
|
151
|
+
if (enableLogging) {
|
|
152
|
+
console.log('🔍 Running pre-check validation...');
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const preCheckPassed = await preCheck();
|
|
156
|
+
if (!preCheckPassed) {
|
|
157
|
+
if (enableLogging) {
|
|
158
|
+
console.log('⛔ Pre-check failed, aborting overlay');
|
|
159
|
+
}
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (enableLogging) {
|
|
163
|
+
console.log('✅ Pre-check passed');
|
|
164
|
+
}
|
|
165
|
+
} catch (preCheckError) {
|
|
166
|
+
console.error('❌ Pre-check error:', preCheckError);
|
|
167
|
+
if (onRejection) {
|
|
168
|
+
onRejection(`Pre-check failed: ${preCheckError.message}`);
|
|
169
|
+
}
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Check for existing credentials
|
|
175
|
+
if (enableLogging) {
|
|
176
|
+
console.log('🔍 Checking for existing credentials...');
|
|
177
|
+
}
|
|
178
|
+
const hasExistingCredentials = await hasCredentials();
|
|
179
|
+
if (hasExistingCredentials) {
|
|
180
|
+
if (enableLogging) {
|
|
181
|
+
console.log('🔑 Existing credentials found, attempting automatic resolution...');
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
const credentials = await getCredentials();
|
|
185
|
+
if (credentials && onResolved) {
|
|
186
|
+
// For existing users, we can resolve immediately with cached data
|
|
187
|
+
const mockApiUrl = `${API_CONFIG.BASE_URL}/user/data`;
|
|
188
|
+
const mockToken = 'existing_user_token';
|
|
189
|
+
if (enableLogging) {
|
|
190
|
+
console.log('✅ Resolving with existing credentials');
|
|
191
|
+
}
|
|
192
|
+
onResolved(mockApiUrl, mockToken, credentials);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
} catch (credentialsError) {
|
|
196
|
+
console.warn('⚠️ Failed to retrieve existing credentials:', credentialsError);
|
|
197
|
+
// Continue with normal flow
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
if (enableLogging) {
|
|
201
|
+
console.log('🎨 Opening Onairos overlay...');
|
|
202
|
+
}
|
|
203
|
+
setShowOverlay(true);
|
|
204
|
+
} catch (error) {
|
|
205
|
+
console.error('❌ Error opening overlay:', error);
|
|
206
|
+
if (onRejection) {
|
|
207
|
+
onRejection(`Failed to open overlay: ${error.message}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}, [isInitialized, initializationError, preCheck, enableLogging, onRejection, onResolved]);
|
|
211
|
+
const handleCloseOverlay = useCallback(result => {
|
|
212
|
+
console.log('🔽 Closing Onairos overlay, result:', result);
|
|
213
|
+
setShowOverlay(false);
|
|
214
|
+
console.log('🔽 showOverlay set to false');
|
|
215
|
+
if (result && onResolved) {
|
|
216
|
+
onResolved(result.apiUrl, result.token, result.userData);
|
|
217
|
+
}
|
|
218
|
+
}, [enableLogging, onResolved]);
|
|
219
|
+
const handleOverlayRejection = useCallback(error => {
|
|
220
|
+
if (enableLogging) {
|
|
221
|
+
console.log('❌ Overlay rejected:', error);
|
|
222
|
+
}
|
|
223
|
+
setShowOverlay(false);
|
|
224
|
+
if (onRejection) {
|
|
225
|
+
onRejection(error);
|
|
226
|
+
}
|
|
227
|
+
}, [enableLogging, onRejection]);
|
|
228
|
+
|
|
229
|
+
// Show error state if initialization failed
|
|
230
|
+
if (initializationError && !isInitializing) {
|
|
231
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
232
|
+
style: styles.errorContainer
|
|
233
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
234
|
+
style: [styles.errorButton, {
|
|
235
|
+
backgroundColor: '#FF6B6B'
|
|
236
|
+
}],
|
|
237
|
+
onPress: () => {
|
|
238
|
+
Alert.alert('SDK Error', `Onairos SDK initialization failed:\n\n${initializationError}\n\nPlease check your API key and try again.`, [{
|
|
239
|
+
text: 'OK'
|
|
240
|
+
}]);
|
|
241
|
+
}
|
|
242
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
243
|
+
style: styles.errorButtonText
|
|
244
|
+
}, "\u26A0\uFE0F SDK Error")));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Show loading state while initializing
|
|
248
|
+
if (isInitializing || !isInitialized) {
|
|
249
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
250
|
+
style: styles.loadingContainer
|
|
251
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
252
|
+
style: [styles.loadingButton, {
|
|
253
|
+
backgroundColor: '#999'
|
|
254
|
+
}],
|
|
255
|
+
disabled: true
|
|
256
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
257
|
+
style: styles.loadingButtonText
|
|
258
|
+
}, "\uD83D\uDD04 Initializing...")));
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Get button style based on type
|
|
262
|
+
const getButtonStyle = () => {
|
|
263
|
+
const baseStyle = {
|
|
264
|
+
width: buttonWidth,
|
|
265
|
+
height: buttonHeight,
|
|
266
|
+
backgroundColor: color,
|
|
267
|
+
borderRadius: buttonType === 'pill' ? buttonHeight / 2 : 8,
|
|
268
|
+
alignItems: 'center',
|
|
269
|
+
justifyContent: 'center',
|
|
270
|
+
flexDirection: 'row',
|
|
271
|
+
opacity: enabled ? 1 : 0.6
|
|
272
|
+
};
|
|
273
|
+
if (hasStroke) {
|
|
274
|
+
baseStyle.borderWidth = 2;
|
|
275
|
+
baseStyle.borderColor = darkMode ? '#fff' : '#000';
|
|
276
|
+
}
|
|
277
|
+
return baseStyle;
|
|
278
|
+
};
|
|
279
|
+
const getButtonText = () => {
|
|
280
|
+
switch (buttonForm) {
|
|
281
|
+
case 'connect':
|
|
282
|
+
return 'Connect with Onairos';
|
|
283
|
+
default:
|
|
284
|
+
return 'Continue with Onairos';
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
288
|
+
style: getButtonStyle(),
|
|
289
|
+
onPress: handleShowOverlay,
|
|
290
|
+
disabled: !enabled || isInitializing || !isInitialized,
|
|
291
|
+
activeOpacity: 0.8
|
|
292
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
293
|
+
source: BRAND_IMAGES.onairosLogoAlt,
|
|
294
|
+
style: styles.logo,
|
|
295
|
+
resizeMode: "contain"
|
|
296
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
297
|
+
style: [styles.buttonText, {
|
|
298
|
+
color: darkMode ? '#000' : '#fff'
|
|
299
|
+
}]
|
|
300
|
+
}, getButtonText())), /*#__PURE__*/React.createElement(UniversalOnboarding, {
|
|
301
|
+
visible: showOverlay,
|
|
302
|
+
onClose: handleCloseOverlay,
|
|
303
|
+
AppName: AppName,
|
|
304
|
+
requestData: requestData || {},
|
|
305
|
+
returnLink: returnLink,
|
|
306
|
+
onComplete: handleCloseOverlay,
|
|
307
|
+
embedd: false,
|
|
308
|
+
debug: debug,
|
|
309
|
+
testMode: testMode,
|
|
310
|
+
preferredPlatform: preferredPlatform
|
|
311
|
+
}));
|
|
312
|
+
});
|
|
313
|
+
const styles = StyleSheet.create({
|
|
314
|
+
button: {
|
|
315
|
+
flexDirection: 'row',
|
|
316
|
+
alignItems: 'center',
|
|
317
|
+
justifyContent: 'center',
|
|
318
|
+
paddingVertical: 12,
|
|
319
|
+
paddingHorizontal: 16,
|
|
320
|
+
shadowColor: '#000',
|
|
321
|
+
shadowOffset: {
|
|
322
|
+
width: 0,
|
|
323
|
+
height: 2
|
|
324
|
+
},
|
|
325
|
+
shadowOpacity: 0.1,
|
|
326
|
+
shadowRadius: 4,
|
|
327
|
+
elevation: 2
|
|
328
|
+
},
|
|
329
|
+
buttonContent: {
|
|
330
|
+
flexDirection: 'row',
|
|
331
|
+
alignItems: 'center',
|
|
332
|
+
justifyContent: 'center'
|
|
333
|
+
},
|
|
334
|
+
logo: {
|
|
335
|
+
width: 24,
|
|
336
|
+
height: 24,
|
|
337
|
+
marginRight: 8
|
|
338
|
+
},
|
|
339
|
+
buttonText: {
|
|
340
|
+
fontSize: 16,
|
|
341
|
+
fontWeight: '600',
|
|
342
|
+
textAlign: 'center'
|
|
343
|
+
},
|
|
344
|
+
errorContainer: {
|
|
345
|
+
flex: 1,
|
|
346
|
+
justifyContent: 'center',
|
|
347
|
+
alignItems: 'center'
|
|
348
|
+
},
|
|
349
|
+
errorButton: {
|
|
350
|
+
padding: 16,
|
|
351
|
+
borderRadius: 8
|
|
352
|
+
},
|
|
353
|
+
errorButtonText: {
|
|
354
|
+
fontSize: 16,
|
|
355
|
+
fontWeight: '600',
|
|
356
|
+
color: '#fff'
|
|
357
|
+
},
|
|
358
|
+
loadingContainer: {
|
|
359
|
+
flex: 1,
|
|
360
|
+
justifyContent: 'center',
|
|
361
|
+
alignItems: 'center'
|
|
362
|
+
},
|
|
363
|
+
loadingButton: {
|
|
364
|
+
padding: 16,
|
|
365
|
+
borderRadius: 8
|
|
366
|
+
},
|
|
367
|
+
loadingButtonText: {
|
|
368
|
+
fontSize: 16,
|
|
369
|
+
fontWeight: '600',
|
|
370
|
+
color: '#fff'
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
//# sourceMappingURL=Onairos.js.map
|