@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,9 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.ModalHeader = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _theme = require("../theme");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const ModalHeader = ({
|
|
12
|
+
onClose,
|
|
13
|
+
onBack,
|
|
14
|
+
showGrabber = true,
|
|
15
|
+
showBackButton = false
|
|
16
|
+
}) => {
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showGrabber && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
18
|
+
style: styles.grabberContainer
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
20
|
+
style: styles.grabber
|
|
21
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
22
|
+
style: styles.container
|
|
23
|
+
}, showBackButton ? /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
24
|
+
style: styles.closeButton,
|
|
25
|
+
onPress: onBack,
|
|
26
|
+
activeOpacity: 0.7,
|
|
27
|
+
accessibilityLabel: "Go back",
|
|
28
|
+
accessibilityRole: "button"
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
30
|
+
style: styles.backText
|
|
31
|
+
}, "\u2190")) : /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
32
|
+
style: styles.closeButton,
|
|
33
|
+
onPress: onClose,
|
|
34
|
+
activeOpacity: 0.7,
|
|
35
|
+
accessibilityLabel: "Close",
|
|
36
|
+
accessibilityRole: "button"
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
38
|
+
style: styles.closeText
|
|
39
|
+
}, "\u2715")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
40
|
+
style: styles.centerSpacer
|
|
41
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
42
|
+
style: styles.spacer
|
|
43
|
+
})));
|
|
44
|
+
};
|
|
45
|
+
exports.ModalHeader = ModalHeader;
|
|
46
|
+
const styles = _reactNative.StyleSheet.create({
|
|
47
|
+
grabberContainer: {
|
|
48
|
+
width: '100%',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
paddingTop: 12,
|
|
51
|
+
paddingBottom: 4
|
|
52
|
+
},
|
|
53
|
+
grabber: {
|
|
54
|
+
width: 100,
|
|
55
|
+
// Made even longer (was 80)
|
|
56
|
+
height: 6,
|
|
57
|
+
backgroundColor: '#D0D0D0',
|
|
58
|
+
borderRadius: 3
|
|
59
|
+
},
|
|
60
|
+
container: {
|
|
61
|
+
flexDirection: 'row',
|
|
62
|
+
alignItems: 'flex-start',
|
|
63
|
+
justifyContent: 'flex-start',
|
|
64
|
+
height: 44,
|
|
65
|
+
paddingTop: 0,
|
|
66
|
+
// Keep X button high
|
|
67
|
+
paddingLeft: 4,
|
|
68
|
+
// Move X button even further left
|
|
69
|
+
marginBottom: _theme.SPACING.md
|
|
70
|
+
},
|
|
71
|
+
closeButton: {
|
|
72
|
+
width: 36,
|
|
73
|
+
// Slightly larger for better touch
|
|
74
|
+
height: 36,
|
|
75
|
+
justifyContent: 'center',
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
marginTop: 0 // Remove top margin to move X higher
|
|
78
|
+
// Remove background and border radius
|
|
79
|
+
},
|
|
80
|
+
closeText: {
|
|
81
|
+
fontSize: 20,
|
|
82
|
+
color: _theme.COLORS.grey800,
|
|
83
|
+
fontWeight: '500'
|
|
84
|
+
},
|
|
85
|
+
backText: {
|
|
86
|
+
fontSize: 24,
|
|
87
|
+
color: _theme.COLORS.grey800,
|
|
88
|
+
fontWeight: '500'
|
|
89
|
+
},
|
|
90
|
+
centerSpacer: {
|
|
91
|
+
flex: 1
|
|
92
|
+
},
|
|
93
|
+
spacer: {
|
|
94
|
+
width: 44,
|
|
95
|
+
height: 44
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
var _default = exports.default = ModalHeader;
|
|
99
|
+
//# sourceMappingURL=ModalHeader.js.map
|
|
@@ -1,9 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.ModalSheet = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _theme = require("../theme");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
// Temporarily remove safe area hook to fix RCTEventEmitter error
|
|
12
|
+
// import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
13
|
+
|
|
14
|
+
const ModalSheet = ({
|
|
15
|
+
children,
|
|
16
|
+
topPadding = _theme.SPACING.modalTopPadding,
|
|
17
|
+
onClose,
|
|
18
|
+
showGrabber = true,
|
|
19
|
+
style
|
|
20
|
+
}) => {
|
|
21
|
+
// Use fallback values instead of safe area hook to avoid RCTEventEmitter error
|
|
22
|
+
const insets = {
|
|
23
|
+
bottom: 20
|
|
24
|
+
}; // Fallback safe area
|
|
25
|
+
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
27
|
+
style: [styles.container, {
|
|
28
|
+
paddingTop: topPadding,
|
|
29
|
+
paddingBottom: insets.bottom || _theme.SPACING.lg
|
|
30
|
+
}, style]
|
|
31
|
+
}, children);
|
|
32
|
+
};
|
|
33
|
+
exports.ModalSheet = ModalSheet;
|
|
34
|
+
const styles = _reactNative.StyleSheet.create({
|
|
35
|
+
container: {
|
|
36
|
+
backgroundColor: _theme.COLORS.surface,
|
|
37
|
+
borderTopLeftRadius: _theme.BORDER_RADIUS.modalTop,
|
|
38
|
+
borderTopRightRadius: _theme.BORDER_RADIUS.modalTop,
|
|
39
|
+
borderBottomLeftRadius: 0,
|
|
40
|
+
borderBottomRightRadius: 0,
|
|
41
|
+
paddingHorizontal: _theme.SPACING.modalHorizontal,
|
|
42
|
+
flex: 1,
|
|
43
|
+
minHeight: '80%' // Ensure modal takes substantial screen space
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
var _default = exports.default = ModalSheet;
|
|
47
|
+
//# sourceMappingURL=ModalSheet.js.map
|
|
@@ -1,14 +1,380 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Object[_0x2c8e(0x0)](exports,_0x2c8e(0x1),{'value':!![]}),exports['Onairos']=void 0x0;var _react=_interopRequireWildcard(__ONAIROS_REQ_FUNC__(0x0)),_reactNative=__ONAIROS_REQ_FUNC__(0x1),_UniversalOnboarding=__ONAIROS_REQ_FUNC__(0x2),_constants=__ONAIROS_REQ_FUNC__(0x3),_secureStorage=__ONAIROS_REQ_FUNC__(0x4),_apiKeyService=__ONAIROS_REQ_FUNC__(0x5),_api=__ONAIROS_REQ_FUNC__(0x6),_assetRegistry=__ONAIROS_REQ_FUNC__(0x7);function _0x2c8e(_0x1f891e,_0x2c8eac){_0x1f891e=_0x1f891e-0x0;const _0x389086=_0x1f89();let _0x11ff3c=_0x389086[_0x1f891e];return _0x11ff3c;}function _interopRequireWildcard(_0x340b90,_0x34ebf4){const _0x22c736={'gIErw':function(_0x3f00c0,_0x4f9c0c){return _0x3f00c0&&_0x4f9c0c;},'rlhEW':function(_0x3e47fc,_0x4c61fd){return _0x3e47fc===_0x4c61fd;},'TBfrc':function(_0x16f026,_0xcd9539){return _0x16f026!=_0xcd9539;},'aISOR':function(_0x1467a4,_0x4ef568){return _0x1467a4!=_0x4ef568;},'axRzu':_0x2c8e(0x2),'uvsBv':function(_0x1fc16a,_0x594b16){return _0x1fc16a!==_0x594b16;},'aCSGj':_0x2c8e(0x3),'CEeZO':function(_0x3bcf36,_0x515c9b,_0x43388d,_0x3fbfae){return _0x3bcf36(_0x515c9b,_0x43388d,_0x3fbfae);},'ExKcZ':function(_0x4ed228,_0x57ca08){return _0x4ed228==_0x57ca08;}};if(_0x22c736['ExKcZ'](_0x22c736[_0x2c8e(0x4)],typeof WeakMap))var _0x348eca=new WeakMap(),_0x243332=new WeakMap();return(_interopRequireWildcard=function(_0x3fc4cc,_0x3e3858){if(_0x22c736[_0x2c8e(0x5)](!_0x3e3858,_0x3fc4cc)&&_0x3fc4cc[_0x2c8e(0x1)])return _0x3fc4cc;var _0x2681ac,_0x2494ac,_0x5f58c8={'__proto__':null,'default':_0x3fc4cc};if(_0x22c736[_0x2c8e(0x6)](null,_0x3fc4cc)||_0x22c736['TBfrc'](_0x2c8e(0x7),typeof _0x3fc4cc)&&_0x22c736[_0x2c8e(0x8)](_0x22c736[_0x2c8e(0x4)],typeof _0x3fc4cc))return _0x5f58c8;if(_0x2681ac=_0x3e3858?_0x243332:_0x348eca){if(_0x2681ac[_0x2c8e(0x9)](_0x3fc4cc))return _0x2681ac[_0x2c8e(0xa)](_0x3fc4cc);_0x2681ac[_0x2c8e(0xb)](_0x3fc4cc,_0x5f58c8);}for(const _0x2ecb43 in _0x3fc4cc)_0x22c736['uvsBv'](_0x22c736[_0x2c8e(0xc)],_0x2ecb43)&&{}['hasOwnProperty']['call'](_0x3fc4cc,_0x2ecb43)&&((_0x2494ac=(_0x2681ac=Object['defineProperty'])&&Object[_0x2c8e(0xd)](_0x3fc4cc,_0x2ecb43))&&(_0x2494ac[_0x2c8e(0xa)]||_0x2494ac[_0x2c8e(0xb)])?_0x22c736[_0x2c8e(0xe)](_0x2681ac,_0x5f58c8,_0x2ecb43,_0x2494ac):_0x5f58c8[_0x2ecb43]=_0x3fc4cc[_0x2ecb43]);return _0x5f58c8;})(_0x340b90,_0x34ebf4);}function _0x1f89(){const _0x286933=['defineProperty','__esModule','function','default','axRzu','gIErw','rlhEW','object','aISOR','has','get','set','aCSGj','getOwnPropertyDescriptor','CEeZO','forwardRef','wuqLr','4.\x20Check\x20your\x20internet\x20connection','5.\x20Visit\x20https://dashboard.onairos.uk\x20to\x20manage\x20your\x20API\x20keys','1.\x20Check\x20that\x20your\x20API\x20key\x20is\x20correct\x20and\x20not\x20expired','✅\x20Pre-check\x20passed','3.\x20Ensure\x20your\x20environment\x20setting\x20matches\x20your\x20API\x20key','🚀\x20Onairos\x20SDK:\x20Starting\x20API\x20key\x20initialization...','XIipd','TalWN','✅\x20Onairos\x20SDK:\x20API\x20key\x20initialization\x20completed\x20successfully','📊\x20Configuration:','❌\x20Onairos\x20SDK:\x20API\x20key\x20initialization\x20failed:','etuGA','LToRP','bAIZu','jRxvy','✅\x20Onairos\x20component:\x20SDK\x20already\x20initialized,\x20syncing\x20state','❌\x20Overlay\x20rejected:','existing_user_token','#fff','⚠️\x20Failed\x20to\x20retrieve\x20existing\x20credentials:','zgBoE','isInitializing:','showOverlay:','hkJjK','❌\x20Cannot\x20open\x20overlay:\x20SDK\x20not\x20initialized','kACKx','UqGON','dfwwv','yhCVU','⛔\x20Pre-check\x20failed,\x20aborting\x20overlay','❌\x20Pre-check\x20error:','BWYBO','jHNVS','vIkkE','🎨\x20Opening\x20Onairos\x20overlay...','🔽\x20Closing\x20Onairos\x20overlay,\x20result:','DtFHZ','Wyptz','🔽\x20showOverlay\x20set\x20to\x20false','wfXPx','eNiVS','PYdem','JmoYW','WjDZL','tzsOf','VIfUO','Continue\x20with\x20Onairos','production','#999','🔄\x20Initializing...','COLORS','primary','esinA','useState','useEffect','EyELe','ouIIz','HMvKz','ciWCM','bUWzr','cXElA','xsepO','TPYSp','yXvAu','cGfZr','JUeVb','zNopP','MiJzE','szIMY','MWmgq','tcLbA','DGqMK','EqcDe','mNIrp','tfKnr','mETYz','TpzAY','tUSeI','UlHdU','nZYDe','nZZmZ','WWJQo','DBjPj','qkmGi','ewBXW','UDVup','log','Klnzh','UzGJC','bZVxV','PQliQ','XhoOM','split','ZmjyW','Failed\x20to\x20open\x20overlay:\x20','message','Unknown\x20initialization\x20error','hSany','LCFuw','mMpbZ','bSAbP','FwSjm','group','EDjru','taOgB','DtePn','wbkUq','nromq','NeWMV','groupEnd','SDK\x20initialization\x20failed:\x20','aBGjO','LQqPB','UtVkk','WXrRA','YiVaD','ioEZF','jdRoN','yzLdF','getApiConfig','apiKey','isApiKeyInitialized','qARhd','🔍\x20Running\x20pre-check\x20validation...','RtiYw','zJwgl','BQSKR','appGI','CiFde','center','borderWidth','#000','dGlAr','WyxrC','XiZBb','Alert','alert','GLDae','useImperativeHandle','useCallback','gftEl','dLqBB','zaVCZ','Onairos\x20SDK\x20initialization\x20failed:\x0a\x0a','\x0a\x0aPlease\x20check\x20your\x20API\x20key\x20and\x20try\x20again.','🔘\x20Button\x20pressed!\x20isInitialized:','GRzAR','xvVvP','KqrFS','SyfOe','QaLog','xYhJE','NXWAY','WwCLN','iHEfQ','ycwpU','juUMK','uQhmZ','MBaTG','PAiyD','pPsuc','hetEb','pAXFl','BQeKd','qJytn','error','oeBCJ','YYnBd','Pre-check\x20failed:\x20','length','dphYM','ZWyGw','🔍\x20Checking\x20for\x20existing\x20credentials...','hasCredentials','LzWGe','API_CONFIG','rUwBg','pckuA','🔑\x20Existing\x20credentials\x20found,\x20attempting\x20automatic\x20resolution...','djoHy','EsmQb','BASE_URL','/user/data','✅\x20Resolving\x20with\x20existing\x20credentials','warn','rYxyq','oWGTu','KKaSl','SDK\x20Error','Rxztl','JQQqg','vkLGx','dBLOq','oUwom','userData','WZLae','KcLAG','apiUrl','token','xBfwq','rDiTy','mrwuI','Hibwh','createElement','View','errorContainer','TouchableOpacity','errorButton','GPvYV','sIsFL','PBwhj','Text','errorButtonText','⚠️\x20SDK\x20Error','SngIJ','loadingContainer','loadingButton','jXUtk','loadingButtonText','fmdyK','jvaLQ','lRkEL','bSyjU','VHARH','borderColor','HRTDr','BRAND_IMAGES','onairosLogoAlt','logo','contain','buttonText','StyleSheet','create','row','600'];_0x1f89=function(){return _0x286933;};return _0x1f89();}const Onairos=exports['Onairos']=(0x0,_react[_0x2c8e(0xf)])((_0x514c65,_0x53206a)=>{const _0x1eae2a={'BQSKR':function(_0x1c47da,_0x36027b){return _0x1c47da===_0x36027b;},'appGI':'pill','CiFde':function(_0x554ff5,_0x33cc10){return _0x554ff5/_0x33cc10;},'dGlAr':'SDK\x20Error','mNIrp':function(_0x451694,_0x2ed21c){return _0x451694!==_0x2ed21c;},'XiZBb':_0x2c8e(0x10),'EyELe':_0x2c8e(0x11),'ouIIz':_0x2c8e(0x12),'HMvKz':'2.\x20Verify\x20you\x20have\x20the\x20right\x20permissions\x20for\x20your\x20use\x20case','LWWxe':_0x2c8e(0x13),'ciWCM':_0x2c8e(0x14),'bUWzr':_0x2c8e(0x15),'JHHkO':function(_0x173570,_0x2392a5){return _0x173570===_0x2392a5;},'xsepO':function(_0x358160,_0x5f3673){return _0x358160!=_0x5f3673;},'cXElA':_0x2c8e(0x7),'KKaSl':function(_0x4a4093,_0x3644c6){return _0x4a4093(_0x3644c6);},'TPYSp':function(_0x250240,_0x3377da){return _0x250240(_0x3377da);},'yXvAu':_0x2c8e(0x16),'cGfZr':_0x2c8e(0x17),'gFcaX':'API\x20key\x20is\x20required.\x20Please\x20provide\x20a\x20valid\x20API\x20key\x20from\x20your\x20Onairos\x20dashboard.','zNopP':_0x2c8e(0x18),'MiJzE':_0x2c8e(0x19),'szIMY':_0x2c8e(0x1a),'tcLbA':function(_0x6008bc,_0x2dd1a9){return _0x6008bc instanceof _0x2dd1a9;},'DGqMK':_0x2c8e(0x1b),'EqcDe':function(_0x699fb0,_0x23ae7b){return _0x699fb0(_0x23ae7b);},'mlhed':_0x2c8e(0x1c),'tfKnr':_0x2c8e(0x1d),'cKExs':'gCROR','mETYz':function(_0x20bd00,_0x17b321){return _0x20bd00(_0x17b321);},'wolcP':function(_0x3c714f,_0x543705){return _0x3c714f!==_0x543705;},'yzLdF':function(_0x63064,_0x4fe311){return _0x63064===_0x4fe311;},'qARhd':_0x2c8e(0x1e),'RtiYw':function(_0x426c57,_0xaf3a0e){return _0x426c57!==_0xaf3a0e;},'ZIDFF':_0x2c8e(0x1f),'zJwgl':_0x2c8e(0x20),'hetEb':function(_0x528abd){return _0x528abd();},'dphYM':_0x2c8e(0x21),'ZWyGw':function(_0x584bab,_0x2b355f){return _0x584bab(_0x2b355f);},'rUwBg':_0x2c8e(0x22),'pckuA':'✅\x20Resolving\x20with\x20existing\x20credentials','oUwom':function(_0x329a93,_0x123edf,_0x40b425,_0x4e423d){return _0x329a93(_0x123edf,_0x40b425,_0x4e423d);},'gftEl':_0x2c8e(0x23),'dLqBB':_0x2c8e(0x24),'zaVCZ':_0x2c8e(0x25),'GRzAR':_0x2c8e(0x26),'xvVvP':_0x2c8e(0x27),'KqrFS':function(_0x519405,_0x448d36){return _0x519405===_0x448d36;},'IQsqt':_0x2c8e(0x28),'QaLog':function(_0x4190b0,_0x113b8f){return _0x4190b0||_0x113b8f;},'xYhJE':'SDK\x20not\x20initialized.\x20Please\x20check\x20your\x20API\x20key.','NXWAY':_0x2c8e(0x29),'WwCLN':function(_0x473dc4,_0x4e1af6){return _0x473dc4!==_0x4e1af6;},'iHEfQ':_0x2c8e(0x2a),'juUMK':_0x2c8e(0x2b),'MBaTG':_0x2c8e(0x2c),'PAiyD':function(_0xde9bc6,_0x5a4af9){return _0xde9bc6===_0x5a4af9;},'pPsuc':_0x2c8e(0x2d),'pAXFl':_0x2c8e(0x2e),'HvSMF':_0x2c8e(0x2f),'oeBCJ':'YYnBd','xBfwq':function(_0x1c2446,_0x27e43c){return _0x1c2446(_0x27e43c);},'gdipv':function(_0x2b97f4,_0x413110){return _0x2b97f4!==_0x413110;},'LzWGe':_0x2c8e(0x30),'LEvJZ':function(_0x4b8be4,_0x2f61ae){return _0x4b8be4&&_0x2f61ae;},'RicBr':function(_0x23fddb,_0x3472d3){return _0x23fddb!==_0x3472d3;},'djoHy':_0x2c8e(0x31),'EsmQb':_0x2c8e(0x32),'rYxyq':_0x2c8e(0x33),'oWGTu':function(_0x5ddcb1,_0x51abd3){return _0x5ddcb1(_0x51abd3);},'dgLVp':'❌\x20Error\x20opening\x20overlay:','SRxQb':function(_0x5eee78,_0x2d4e2e){return _0x5eee78(_0x2d4e2e);},'Rxztl':_0x2c8e(0x34),'BuNIP':_0x2c8e(0x35),'ypHzx':_0x2c8e(0x36),'IQxVB':_0x2c8e(0x37),'mEpJs':function(_0x4f6e83,_0x57f37b){return _0x4f6e83&&_0x57f37b;},'Hibwh':'🔑\x20Existing\x20credentials\x20found,\x20attempting\x20automatic\x20resolution...','WZLae':_0x2c8e(0x38),'KcLAG':_0x2c8e(0x39),'soKul':_0x2c8e(0x3a),'rDiTy':function(_0xa112b0,_0x32743f){return _0xa112b0!==_0x32743f;},'qFhMT':_0x2c8e(0x3b),'sIsFL':function(_0x3fb706,_0x17a20d){return _0x3fb706(_0x17a20d);},'WBjeu':_0x2c8e(0x3c),'fmdyK':function(_0x3760de,_0x330bf4){return _0x3760de/_0x330bf4;},'jvaLQ':'center','lRkEL':'row','Zcnpb':function(_0x524cb6,_0x17dfa4){return _0x524cb6===_0x17dfa4;},'bSyjU':_0x2c8e(0x3d),'VHARH':_0x2c8e(0x3e),'dPQRr':'#000','VErZB':'connect','HRTDr':_0x2c8e(0x3f),'NOuQP':_0x2c8e(0x3),'esinA':_0x2c8e(0x40),'GPvYV':'#FF6B6B','SngIJ':function(_0x7189b7,_0x507d22){return _0x7189b7||_0x507d22;},'jXUtk':_0x2c8e(0x41),'DZbXi':_0x2c8e(0x42),'MvrZn':function(_0x8ab365,_0x4fa60b){return _0x8ab365||_0x4fa60b;}},{returnLink:_0x2a4731,prefillUrl:_0x50b057,AppName:_0x74b6ab,buttonType:buttonType='normal',requestData:_0x4209af,buttonWidth:buttonWidth=0xc8,buttonHeight:buttonHeight=0x30,hasStroke:hasStroke=![],enabled:enabled=!![],buttonForm:buttonForm=_0x1eae2a['NOuQP'],onRejection:_0x11500d,onResolved:_0x554862,preCheck:_0x4ad310,color:color=_constants[_0x2c8e(0x43)][_0x2c8e(0x44)],debug:debug=![],darkMode:darkMode=![],preferredPlatform:_0xa78ee3,testMode:testMode=![],apiKey:_0x3620bc,environment:environment=_0x1eae2a[_0x2c8e(0x45)],enableLogging:enableLogging=!![],timeout:timeout=0x7530,retryAttempts:retryAttempts=0x3}=_0x514c65,[_0x51a075,_0x4433ea]=(0x0,_react[_0x2c8e(0x46)])(![]),[_0x470702,_0x11722c]=(0x0,_react[_0x2c8e(0x46)])(![]),[_0x580939,_0x41f612]=(0x0,_react[_0x2c8e(0x46)])(null),[_0x5f27b5,_0x4afded]=(0x0,_react['useState'])(![]);(0x0,_react[_0x2c8e(0x47)])(()=>{const _0x3db4c2={'sUEnU':'6|5|3|2|0|1|4','taOgB':_0x1eae2a[_0x2c8e(0x48)],'nZYDe':_0x1eae2a[_0x2c8e(0x49)],'EDjru':_0x1eae2a[_0x2c8e(0x4a)],'UlHdU':_0x1eae2a['LWWxe'],'tUSeI':'🔧\x20API\x20Key\x20Troubleshooting\x20Guide','TpzAY':_0x1eae2a[_0x2c8e(0x4b)],'MQNeg':_0x1eae2a[_0x2c8e(0x4c)],'nZZmZ':function(_0x503c97,_0x34f6f6){return _0x1eae2a['JHHkO'](_0x503c97,_0x34f6f6);},'RvpMM':function(_0x3ff24f,_0xb360d3){return _0x1eae2a['xsepO'](_0x3ff24f,_0xb360d3);},'WWJQo':_0x1eae2a[_0x2c8e(0x4d)],'DBjPj':function(_0x4d9a92,_0x3f6e84){return _0x1eae2a[_0x2c8e(0x4e)](_0x4d9a92,_0x3f6e84);},'qkmGi':_0x2c8e(0x3),'ewBXW':'YNZdC','guKFl':function(_0x2ec016,_0x358e4c){return _0x1eae2a['KKaSl'](_0x2ec016,_0x358e4c);},'UDVup':function(_0x4c7960,_0x47aa39){return _0x1eae2a[_0x2c8e(0x4f)](_0x4c7960,_0x47aa39);},'aTsxh':_0x1eae2a[_0x2c8e(0x50)],'hxCsc':_0x1eae2a[_0x2c8e(0x51)],'HjfeH':_0x1eae2a['gFcaX'],'UzGJC':function(_0x1d8017,_0x78ba7d){return _0x1d8017!==_0x78ba7d;},'XXZLH':_0x2c8e(0x52),'qDejM':_0x1eae2a[_0x2c8e(0x53)],'bZVxV':_0x1eae2a[_0x2c8e(0x54)],'PQliQ':_0x1eae2a[_0x2c8e(0x55)],'ZmjyW':_0x2c8e(0x56),'wVnXW':function(_0x5b9bdf,_0xc6272a){return _0x1eae2a[_0x2c8e(0x57)](_0x5b9bdf,_0xc6272a);},'hSany':_0x1eae2a[_0x2c8e(0x58)],'LCFuw':function(_0x54238a,_0x480bbd){return _0x1eae2a[_0x2c8e(0x59)](_0x54238a,_0x480bbd);},'mMpbZ':function(_0x49b95c,_0x2b1fc7){return _0x1eae2a[_0x2c8e(0x5a)](_0x49b95c,_0x2b1fc7);},'bSAbP':_0x1eae2a['mlhed'],'FwSjm':_0x1eae2a[_0x2c8e(0x5b)],'dzZjn':_0x1eae2a['cKExs'],'LQqPB':function(_0xab7541,_0x276f74){return _0x1eae2a[_0x2c8e(0x5c)](_0xab7541,_0x276f74);}};var _0x4e800a;let _0x4bc37e=!![];const _0x58a503=async()=>{const _0x389107={'Klnzh':function(_0x52235e,_0xa078dc){return _0x52235e(_0xa078dc);},'XhoOM':_0x3db4c2[_0x2c8e(0x5d)],'DtePn':_0x3db4c2[_0x2c8e(0x5e)],'wbkUq':_0x3db4c2[_0x2c8e(0x5f)],'nromq':_0x3db4c2['MQNeg'],'NeWMV':_0x3db4c2[_0x2c8e(0x60)],'aBGjO':function(_0x4c6fd8,_0x8e2420){return _0x4c6fd8(_0x8e2420);},'UtVkk':function(_0x381045,_0x1c16fb){return _0x3db4c2[_0x2c8e(0x61)](_0x381045,_0x1c16fb);},'WXrRA':function(_0x364a69,_0x46d027){return _0x3db4c2['RvpMM'](_0x364a69,_0x46d027);},'YiVaD':_0x3db4c2[_0x2c8e(0x62)],'ioEZF':function(_0x39ed70,_0x45726e){return _0x3db4c2[_0x2c8e(0x63)](_0x39ed70,_0x45726e);},'jdRoN':_0x3db4c2[_0x2c8e(0x64)]};if(_0x3db4c2[_0x2c8e(0x65)]===_0x3db4c2[_0x2c8e(0x65)]){if(_0x5f27b5)return;_0x3db4c2['guKFl'](_0x4afded,!![]),_0x3db4c2[_0x2c8e(0x66)](_0x41f612,null);try{console[_0x2c8e(0x67)](_0x3db4c2['aTsxh']);if(!_0x3620bc){if(_0x3db4c2['hxCsc']===_0x3db4c2['hxCsc'])throw new Error(_0x3db4c2['HjfeH']);else _0x389107[_0x2c8e(0x68)](_0x118033,'SDK\x20initialization\x20failed:\x20'+_0x812896);}const _0x3290c5={'apiKey':_0x3620bc,'environment':environment,'enableLogging':enableLogging,'timeout':timeout,'retryAttempts':retryAttempts};await(0x0,_apiKeyService['initializeApiKey'])(_0x3290c5);if(_0x4bc37e){if(_0x3db4c2[_0x2c8e(0x69)]('BQPTA','SzPWb'))_0x11722c(!![]),_0x3db4c2[_0x2c8e(0x66)](_0x41f612,null),enableLogging&&(_0x3db4c2[_0x2c8e(0x69)](_0x3db4c2['XXZLH'],_0x3db4c2['qDejM'])?(console['log'](_0x3db4c2[_0x2c8e(0x6a)]),console['log'](_0x3db4c2[_0x2c8e(0x6b)],{'environment':environment,'enableLogging':enableLogging,'timeout':timeout,'retryAttempts':retryAttempts,'apiKeyLength':_0x3620bc['length']})):_0x5d8859[_0x2c8e(0x67)](_0x389107[_0x2c8e(0x6c)]));else{const _0x16541b=_0x3db4c2['sUEnU'][_0x2c8e(0x6d)]('|');let _0xcbe34d=0x0;while(!![]){switch(_0x16541b[_0xcbe34d++]){case'0':_0x1c351f[_0x2c8e(0x67)](_0x3db4c2['taOgB']);continue;case'1':_0x425e0e[_0x2c8e(0x67)](_0x3db4c2[_0x2c8e(0x60)]);continue;case'2':_0x445427['log'](_0x2c8e(0x15));continue;case'3':_0x140706[_0x2c8e(0x67)](_0x3db4c2['EDjru']);continue;case'4':_0x3430e3['groupEnd']();continue;case'5':_0x1dcad2[_0x2c8e(0x67)](_0x3db4c2[_0x2c8e(0x5f)]);continue;case'6':_0x466648['group'](_0x3db4c2[_0x2c8e(0x5e)]);continue;}break;}}}}catch(_0xb190a1){if(_0x3db4c2['UzGJC'](_0x2c8e(0x56),_0x3db4c2[_0x2c8e(0x6e)]))_0x389107[_0x2c8e(0x68)](_0x3701f9,_0x2c8e(0x6f)+_0x5c279b['message']);else{const _0x4854ba=_0x3db4c2['wVnXW'](_0xb190a1,Error)?_0xb190a1[_0x2c8e(0x70)]:_0x2c8e(0x71);console['error'](_0x3db4c2[_0x2c8e(0x72)],_0x4854ba),_0x4bc37e&&(_0x3db4c2[_0x2c8e(0x66)](_0x11722c,![]),_0x3db4c2[_0x2c8e(0x73)](_0x41f612,_0x4854ba),enableLogging&&(_0x3db4c2[_0x2c8e(0x74)](_0x3db4c2[_0x2c8e(0x75)],_0x3db4c2[_0x2c8e(0x76)])?(console[_0x2c8e(0x77)](_0x3db4c2[_0x2c8e(0x5e)]),console[_0x2c8e(0x67)](_0x3db4c2[_0x2c8e(0x5f)]),console[_0x2c8e(0x67)](_0x3db4c2[_0x2c8e(0x78)]),console[_0x2c8e(0x67)](_0x2c8e(0x15)),console['log'](_0x3db4c2[_0x2c8e(0x79)]),console[_0x2c8e(0x67)](_0x3db4c2['nZYDe']),console['groupEnd']()):(_0x389107['Klnzh'](_0x5dbe4c,![]),_0x389107['Klnzh'](_0x4acfe2,_0x47f2a9),_0x4b7c7e&&(_0xe1227['group'](_0x389107[_0x2c8e(0x7a)]),_0x41a522['log'](_0x389107[_0x2c8e(0x7b)]),_0x1cd715[_0x2c8e(0x67)]('2.\x20Verify\x20you\x20have\x20the\x20right\x20permissions\x20for\x20your\x20use\x20case'),_0x520cff['log'](_0x389107[_0x2c8e(0x7c)]),_0x265d0a[_0x2c8e(0x67)]('4.\x20Check\x20your\x20internet\x20connection'),_0x26443e[_0x2c8e(0x67)](_0x389107[_0x2c8e(0x7d)]),_0x5ed7eb[_0x2c8e(0x7e)]()),_0x167ff6&&_0x389107['Klnzh'](_0xdb242c,_0x2c8e(0x7f)+_0x1a0f56))),_0x11500d&&_0x3db4c2['LCFuw'](_0x11500d,'SDK\x20initialization\x20failed:\x20'+_0x4854ba));}}finally{_0x3db4c2[_0x2c8e(0x69)](_0x3db4c2['dzZjn'],'gCROR')?_0x389107[_0x2c8e(0x80)](_0x54e124,_0x5d6136):_0x4bc37e&&_0x3db4c2[_0x2c8e(0x81)](_0x4afded,![]);}}else{if(!_0x5e4636&&_0x5e1912&&_0x205b70['__esModule'])return _0x5bcf6e;var _0xa57bd3,_0x3ca8c7,_0x512013={'__proto__':null,'default':_0x195224};if(_0x389107[_0x2c8e(0x82)](null,_0x1653d3)||_0x389107[_0x2c8e(0x83)](_0x389107[_0x2c8e(0x84)],typeof _0x22a48e)&&_0x389107[_0x2c8e(0x85)]('function',typeof _0x58fcba))return _0x512013;if(_0xa57bd3=_0x269a37?_0x440cc8:_0x509795){if(_0xa57bd3[_0x2c8e(0x9)](_0x15d415))return _0xa57bd3['get'](_0x2fb319);_0xa57bd3[_0x2c8e(0xb)](_0x1f4d5e,_0x512013);}for(const _0x3de111 in _0x12569f)_0x389107[_0x2c8e(0x86)]!==_0x3de111&&{}['hasOwnProperty']['call'](_0x1e5650,_0x3de111)&&((_0x3ca8c7=(_0xa57bd3=_0x77742b['defineProperty'])&&_0xd6512e[_0x2c8e(0xd)](_0x2afe8e,_0x3de111))&&(_0x3ca8c7[_0x2c8e(0xa)]||_0x3ca8c7[_0x2c8e(0xb)])?_0xa57bd3(_0x512013,_0x3de111,_0x3ca8c7):_0x512013[_0x3de111]=_0x18e586[_0x3de111]);return _0x512013;}};if(_0x3620bc&&(!(0x0,_apiKeyService['isApiKeyInitialized'])()||_0x1eae2a['wolcP'](_0x1eae2a[_0x2c8e(0x87)](_0x4e800a=(0x0,_apiKeyService[_0x2c8e(0x88)])(),null)||_0x1eae2a['yzLdF'](_0x4e800a,void 0x0)?void 0x0:_0x4e800a[_0x2c8e(0x89)],_0x3620bc)))_0x58a503();else{if((0x0,_apiKeyService[_0x2c8e(0x8a)])()){if(_0x2c8e(0x1e)!==_0x1eae2a[_0x2c8e(0x8b)])_0x2e4b77[_0x2c8e(0x67)](_0x2c8e(0x8c));else{_0x1eae2a[_0x2c8e(0x5c)](_0x11722c,!![]),_0x4afded(![]);if(enableLogging){if(_0x1eae2a[_0x2c8e(0x8d)](_0x1eae2a['ZIDFF'],'HQaJz'))console[_0x2c8e(0x67)](_0x1eae2a[_0x2c8e(0x8e)]);else{const _0x43f54c={'width':_0xd941f8,'height':_0x38f0b3,'backgroundColor':_0xb453c0,'borderRadius':_0x1eae2a[_0x2c8e(0x8f)](_0x3db655,_0x1eae2a[_0x2c8e(0x90)])?_0x1eae2a[_0x2c8e(0x91)](_0x4f15ee,0x2):0x8,'alignItems':_0x2c8e(0x92),'justifyContent':_0x2c8e(0x92),'flexDirection':'row','opacity':_0x2397b4?0x1:0.6};return _0x29aaa2&&(_0x43f54c[_0x2c8e(0x93)]=0x2,_0x43f54c['borderColor']=_0x2dbd9d?_0x2c8e(0x23):_0x2c8e(0x94)),_0x43f54c;}}}}}return()=>{const _0x50fd8b={'GLDae':_0x1eae2a[_0x2c8e(0x95)]};_0x1eae2a[_0x2c8e(0x5a)](_0x2c8e(0x96),_0x1eae2a[_0x2c8e(0x97)])?_0x4bc37e=![]:_0x23182f[_0x2c8e(0x98)][_0x2c8e(0x99)](_0x50fd8b[_0x2c8e(0x9a)],_0xd9c120,[{'text':'OK'}]);};},[_0x3620bc,environment,enableLogging,timeout,retryAttempts,_0x11500d]),(0x0,_react[_0x2c8e(0x9b)])(_0x53206a,()=>({'openOverlay':_0x5f0bf9,'closeOverlay':_0x33112a,'isInitialized':()=>_0x470702,'getApiConfig':()=>(0x0,_apiKeyService[_0x2c8e(0x88)])()}));const _0x5f0bf9=(0x0,_react[_0x2c8e(0x9c)])(async()=>{const _0x5717b6={'ycwpU':_0x1eae2a[_0x2c8e(0x54)],'mxgPO':_0x1eae2a['szIMY'],'uQhmZ':_0x2c8e(0x20),'BQeKd':_0x1eae2a[_0x2c8e(0x9d)],'qJytn':_0x2c8e(0x94),'hsRZq':_0x1eae2a[_0x2c8e(0x9e)]};if(_0x1eae2a[_0x2c8e(0x5a)](_0x1eae2a[_0x2c8e(0x9f)],_0x1eae2a[_0x2c8e(0x9f)]))_0x194bab['Alert']['alert'](_0x1eae2a[_0x2c8e(0x95)],_0x2c8e(0xa0)+_0x424de1+_0x2c8e(0xa1),[{'text':'OK'}]);else{console[_0x2c8e(0x67)](_0x2c8e(0xa2),_0x470702,_0x1eae2a[_0x2c8e(0xa3)],_0x5f27b5,_0x1eae2a[_0x2c8e(0xa4)],_0x51a075);try{if(!_0x470702){if(_0x1eae2a[_0x2c8e(0xa5)](_0x1eae2a['IQsqt'],_0x2c8e(0xa6)))_0x1eae2a['hetEb'](_0x80129d);else{const _0x3038c7=_0x1eae2a[_0x2c8e(0xa7)](_0x580939,_0x1eae2a[_0x2c8e(0xa8)]);console['error'](_0x1eae2a[_0x2c8e(0xa9)]);_0x11500d?_0x1eae2a[_0x2c8e(0xaa)](_0x1eae2a[_0x2c8e(0xab)],_0x1eae2a['iHEfQ'])?(_0x3cd0d4(!![]),_0x5268dd(null),_0x1b3089&&(_0x3cf202['log'](_0x5717b6[_0x2c8e(0xac)]),_0x59ff66[_0x2c8e(0x67)](_0x5717b6['mxgPO'],{'environment':_0x2c46d7,'enableLogging':_0x502dba,'timeout':_0x2b9743,'retryAttempts':_0x122564,'apiKeyLength':_0x4aceaf['length']}))):_0x1eae2a[_0x2c8e(0x4f)](_0x11500d,_0x3038c7):_0x1eae2a[_0x2c8e(0x5a)](_0x1eae2a[_0x2c8e(0xad)],_0x2c8e(0x2b))?_0x45cd74[_0x2c8e(0x67)](_0x5717b6[_0x2c8e(0xae)]):_reactNative[_0x2c8e(0x98)]['alert'](_0x1eae2a['dGlAr'],_0x3038c7,[{'text':'OK'}]);return;}}if(_0x4ad310){if(_0x1eae2a[_0x2c8e(0xa5)](_0x1eae2a[_0x2c8e(0xaf)],_0x1eae2a[_0x2c8e(0xaf)])){enableLogging&&console[_0x2c8e(0x67)](_0x2c8e(0x8c));try{if(_0x1eae2a[_0x2c8e(0xb0)](_0x1eae2a[_0x2c8e(0xb1)],_0x1eae2a[_0x2c8e(0xb1)])){const _0x3ca314=await _0x1eae2a[_0x2c8e(0xb2)](_0x4ad310);if(!_0x3ca314){enableLogging&&console[_0x2c8e(0x67)](_0x1eae2a[_0x2c8e(0xb3)]);return;}enableLogging&&console[_0x2c8e(0x67)](_0x1eae2a[_0x2c8e(0x4b)]);}else _0x420ede[_0x2c8e(0x93)]=0x2,_0x4d9f58['borderColor']=_0xaebf78?_0x5717b6[_0x2c8e(0xb4)]:_0x5717b6[_0x2c8e(0xb5)];}catch(_0x2102ed){console[_0x2c8e(0xb6)](_0x1eae2a['HvSMF'],_0x2102ed);_0x11500d&&(_0x1eae2a[_0x2c8e(0x8f)](_0x1eae2a[_0x2c8e(0xb7)],_0x2c8e(0xb8))?_0x1eae2a['xBfwq'](_0x11500d,_0x2c8e(0xb9)+_0x2102ed[_0x2c8e(0x70)]):(_0x29019c['log'](_0x2c8e(0x19)),_0x4cdccf[_0x2c8e(0x67)]('📊\x20Configuration:',{'environment':_0x21f9e8,'enableLogging':_0x1ca1bc,'timeout':_0x394510,'retryAttempts':_0x5b688f,'apiKeyLength':_0x2cf911[_0x2c8e(0xba)]})));return;}}else _0x84f01c&&_0x385f26[_0x2c8e(0x67)](_0x1eae2a[_0x2c8e(0xbb)],_0x2f4fd3),_0x1eae2a['EqcDe'](_0x34adda,![]),_0xbf064c&&_0x1eae2a[_0x2c8e(0xbc)](_0x2ab1a1,_0xab4a3b);}enableLogging&&console[_0x2c8e(0x67)](_0x2c8e(0xbd));const _0xbfd3d4=await(0x0,_secureStorage[_0x2c8e(0xbe)])();if(_0xbfd3d4){if(_0x1eae2a['gdipv'](_0x1eae2a['LzWGe'],_0x1eae2a[_0x2c8e(0xbf)])){const _0x58a1a0=_0x403d71[_0x2c8e(0xc0)]['BASE_URL']+'/user/data',_0x79fa4d=_0x1eae2a[_0x2c8e(0xc1)];_0x49f3c8&&_0x375a9[_0x2c8e(0x67)](_0x1eae2a[_0x2c8e(0xc2)]);_0x1eae2a['oUwom'](_0x3662d5,_0x58a1a0,_0x79fa4d,_0x125081);return;}else{enableLogging&&console[_0x2c8e(0x67)](_0x2c8e(0xc3));try{const _0x15ddfb=await(0x0,_secureStorage['getCredentials'])();if(_0x1eae2a['LEvJZ'](_0x15ddfb,_0x554862)){if(_0x1eae2a['RicBr'](_0x1eae2a[_0x2c8e(0xc4)],_0x1eae2a[_0x2c8e(0xc5)])){const _0x420c64=_api[_0x2c8e(0xc0)][_0x2c8e(0xc6)]+_0x2c8e(0xc7),_0x1b9d26=_0x1eae2a[_0x2c8e(0xc1)];enableLogging&&console[_0x2c8e(0x67)](_0x2c8e(0xc8));_0x554862(_0x420c64,_0x1b9d26,_0x15ddfb);return;}else _0x41ad17[_0x2c8e(0xc9)](_0x5717b6['hsRZq'],_0x47629b);}}catch(_0x19d781){console[_0x2c8e(0xc9)](_0x1eae2a[_0x2c8e(0x9e)],_0x19d781);}}}enableLogging&&console[_0x2c8e(0x67)](_0x1eae2a[_0x2c8e(0xca)]),_0x1eae2a[_0x2c8e(0xcb)](_0x4433ea,!![]);}catch(_0x4acc95){console['error'](_0x1eae2a['dgLVp'],_0x4acc95),_0x11500d&&_0x1eae2a['SRxQb'](_0x11500d,_0x2c8e(0x6f)+_0x4acc95['message']);}}},[_0x470702,_0x580939,_0x4ad310,enableLogging,_0x11500d,_0x554862]),_0x33112a=(0x0,_react[_0x2c8e(0x9c)])(_0x424fd0=>{const _0x3c17fa={'cwJdb':function(_0x5c72e6,_0x2c50fe){return _0x5c72e6||_0x2c50fe;},'iCncn':_0x1eae2a['xYhJE'],'JQQqg':_0x2c8e(0x29),'vkLGx':function(_0x57d01a,_0x4bd143){return _0x1eae2a[_0x2c8e(0xcc)](_0x57d01a,_0x4bd143);},'dBLOq':_0x2c8e(0xcd)};console[_0x2c8e(0x67)](_0x1eae2a[_0x2c8e(0xce)],_0x424fd0),_0x4433ea(![]),console[_0x2c8e(0x67)](_0x2c8e(0x37));if(_0x424fd0&&_0x554862){if(_0x1eae2a[_0x2c8e(0x87)](_0x1eae2a['BuNIP'],_0x1eae2a['ypHzx'])){const _0x2b957c=_0x3c17fa['cwJdb'](_0x89e3d,_0x3c17fa['iCncn']);_0x3dddf1[_0x2c8e(0xb6)](_0x3c17fa[_0x2c8e(0xcf)]);_0x55ba08?_0x3c17fa[_0x2c8e(0xd0)](_0x573ef4,_0x2b957c):_0x22cf3b['Alert'][_0x2c8e(0x99)](_0x3c17fa[_0x2c8e(0xd1)],_0x2b957c,[{'text':'OK'}]);return;}else _0x1eae2a[_0x2c8e(0xd2)](_0x554862,_0x424fd0['apiUrl'],_0x424fd0['token'],_0x424fd0[_0x2c8e(0xd3)]);}},[enableLogging,_0x554862]),_0x5caa0b=(0x0,_react['useCallback'])(_0x3ae061=>{_0x1eae2a[_0x2c8e(0xd4)]===_0x1eae2a[_0x2c8e(0xd5)]?_0x5cfbc7[_0x2c8e(0x67)](_0x1eae2a[_0x2c8e(0xca)]):(enableLogging&&(_0x1eae2a['soKul']===_0x1eae2a['soKul']?console[_0x2c8e(0x67)](_0x1eae2a[_0x2c8e(0xbb)],_0x3ae061):(_0x4b7124[_0x2c8e(0x67)](_0x2c8e(0x34),_0x527d55),_0x1eae2a[_0x2c8e(0xbc)](_0x559bef,![]),_0x528159[_0x2c8e(0x67)](_0x1eae2a['IQxVB']),_0x1eae2a['mEpJs'](_0x140d00,_0x5bae76)&&_0x1581bc(_0x3cc3f2[_0x2c8e(0xd6)],_0x388200[_0x2c8e(0xd7)],_0x6a4940[_0x2c8e(0xd3)]))),_0x1eae2a[_0x2c8e(0xd8)](_0x4433ea,![]),_0x11500d&&(_0x1eae2a[_0x2c8e(0xd9)](_0x1eae2a['qFhMT'],_0x2c8e(0xda))?_0x1eae2a[_0x2c8e(0xbc)](_0x11500d,_0x3ae061):_0x24abf8['log'](_0x1eae2a[_0x2c8e(0xdb)])));},[enableLogging,_0x11500d]);if(_0x580939&&!_0x5f27b5)return _react[_0x2c8e(0x3)][_0x2c8e(0xdc)](_reactNative[_0x2c8e(0xdd)],{'style':styles[_0x2c8e(0xde)]},_react[_0x2c8e(0x3)][_0x2c8e(0xdc)](_reactNative[_0x2c8e(0xdf)],{'style':[styles[_0x2c8e(0xe0)],{'backgroundColor':_0x1eae2a[_0x2c8e(0xe1)]}],'onPress':()=>{const _0x75d9ac={'PBwhj':function(_0x5634e7,_0x1794b0){return _0x1eae2a[_0x2c8e(0xe2)](_0x5634e7,_0x1794b0);}};_0x1eae2a[_0x2c8e(0x87)](_0x1eae2a['WBjeu'],'ffhYX')?_0x43f738&&_0x75d9ac[_0x2c8e(0xe3)](_0x3301d0,![]):_reactNative['Alert'][_0x2c8e(0x99)](_0x1eae2a[_0x2c8e(0x95)],'Onairos\x20SDK\x20initialization\x20failed:\x0a\x0a'+_0x580939+_0x2c8e(0xa1),[{'text':'OK'}]);}},_react[_0x2c8e(0x3)][_0x2c8e(0xdc)](_reactNative[_0x2c8e(0xe4)],{'style':styles[_0x2c8e(0xe5)]},_0x2c8e(0xe6))));if(_0x1eae2a[_0x2c8e(0xe7)](_0x5f27b5,!_0x470702))return _react[_0x2c8e(0x3)][_0x2c8e(0xdc)](_reactNative[_0x2c8e(0xdd)],{'style':styles[_0x2c8e(0xe8)]},_react[_0x2c8e(0x3)]['createElement'](_reactNative['TouchableOpacity'],{'style':[styles[_0x2c8e(0xe9)],{'backgroundColor':_0x1eae2a[_0x2c8e(0xea)]}],'disabled':!![]},_react[_0x2c8e(0x3)]['createElement'](_reactNative[_0x2c8e(0xe4)],{'style':styles[_0x2c8e(0xeb)]},_0x1eae2a['DZbXi'])));const _0x1c4474=()=>{const _0x287676={'width':buttonWidth,'height':buttonHeight,'backgroundColor':color,'borderRadius':_0x1eae2a['BQSKR'](buttonType,_0x1eae2a[_0x2c8e(0x90)])?_0x1eae2a[_0x2c8e(0xec)](buttonHeight,0x2):0x8,'alignItems':_0x1eae2a[_0x2c8e(0xed)],'justifyContent':_0x2c8e(0x92),'flexDirection':_0x1eae2a[_0x2c8e(0xee)],'opacity':enabled?0x1:0.6};return hasStroke&&(_0x1eae2a['Zcnpb'](_0x1eae2a[_0x2c8e(0xef)],_0x1eae2a[_0x2c8e(0xf0)])?_0x2ebd7e=![]:(_0x287676[_0x2c8e(0x93)]=0x2,_0x287676[_0x2c8e(0xf1)]=darkMode?_0x2c8e(0x23):_0x1eae2a['dPQRr'])),_0x287676;},_0x20fd53=()=>{switch(buttonForm){case _0x1eae2a['VErZB']:return'Connect\x20with\x20Onairos';default:return _0x1eae2a[_0x2c8e(0xf2)];}};return _react[_0x2c8e(0x3)][_0x2c8e(0xdc)](_react[_0x2c8e(0x3)]['Fragment'],null,_react[_0x2c8e(0x3)]['createElement'](_reactNative[_0x2c8e(0xdf)],{'style':_0x1c4474(),'onPress':_0x5f0bf9,'disabled':_0x1eae2a['MvrZn'](!enabled,_0x5f27b5)||!_0x470702,'activeOpacity':0.8},_react[_0x2c8e(0x3)][_0x2c8e(0xdc)](_reactNative['Image'],{'source':_assetRegistry[_0x2c8e(0xf3)][_0x2c8e(0xf4)],'style':styles[_0x2c8e(0xf5)],'resizeMode':_0x2c8e(0xf6)}),_react[_0x2c8e(0x3)]['createElement'](_reactNative[_0x2c8e(0xe4)],{'style':[styles[_0x2c8e(0xf7)],{'color':darkMode?'#000':_0x1eae2a[_0x2c8e(0x9d)]}]},_0x1eae2a[_0x2c8e(0xb2)](_0x20fd53))),_react[_0x2c8e(0x3)]['createElement'](_UniversalOnboarding['UniversalOnboarding'],{'visible':_0x51a075,'onClose':_0x33112a,'AppName':_0x74b6ab,'requestData':_0x1eae2a['QaLog'](_0x4209af,{}),'returnLink':_0x2a4731,'onComplete':_0x33112a,'embedd':![],'debug':debug,'testMode':testMode,'preferredPlatform':_0xa78ee3}));}),styles=_reactNative[_0x2c8e(0xf8)][_0x2c8e(0xf9)]({'button':{'flexDirection':_0x2c8e(0xfa),'alignItems':_0x2c8e(0x92),'justifyContent':_0x2c8e(0x92),'paddingVertical':0xc,'paddingHorizontal':0x10,'shadowColor':'#000','shadowOffset':{'width':0x0,'height':0x2},'shadowOpacity':0.1,'shadowRadius':0x4,'elevation':0x2},'buttonContent':{'flexDirection':_0x2c8e(0xfa),'alignItems':_0x2c8e(0x92),'justifyContent':_0x2c8e(0x92)},'logo':{'width':0x18,'height':0x18,'marginRight':0x8},'buttonText':{'fontSize':0x10,'fontWeight':_0x2c8e(0xfb),'textAlign':'center'},'errorContainer':{'flex':0x1,'justifyContent':_0x2c8e(0x92),'alignItems':_0x2c8e(0x92)},'errorButton':{'padding':0x10,'borderRadius':0x8},'errorButtonText':{'fontSize':0x10,'fontWeight':'600','color':_0x2c8e(0x23)},'loadingContainer':{'flex':0x1,'justifyContent':_0x2c8e(0x92),'alignItems':_0x2c8e(0x92)},'loadingButton':{'padding':0x10,'borderRadius':0x8},'loadingButtonText':{'fontSize':0x10,'fontWeight':'600','color':'#fff'}});
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Onairos = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _UniversalOnboarding = require("./UniversalOnboarding");
|
|
10
|
+
var _constants = require("../constants");
|
|
11
|
+
var _secureStorage = require("../utils/secureStorage");
|
|
12
|
+
var _apiKeyService = require("../services/apiKeyService");
|
|
13
|
+
var _api = require("../config/api");
|
|
14
|
+
var _assetRegistry = require("../utils/assetRegistry");
|
|
15
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
|
+
const Onairos = exports.Onairos = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => {
|
|
17
|
+
const {
|
|
18
|
+
returnLink,
|
|
19
|
+
prefillUrl,
|
|
20
|
+
AppName,
|
|
21
|
+
buttonType = 'normal',
|
|
22
|
+
requestData,
|
|
23
|
+
buttonWidth = 200,
|
|
24
|
+
buttonHeight = 48,
|
|
25
|
+
hasStroke = false,
|
|
26
|
+
enabled = true,
|
|
27
|
+
buttonForm = 'default',
|
|
28
|
+
onRejection,
|
|
29
|
+
onResolved,
|
|
30
|
+
preCheck,
|
|
31
|
+
color = _constants.COLORS.primary,
|
|
32
|
+
debug = false,
|
|
33
|
+
darkMode = false,
|
|
34
|
+
preferredPlatform,
|
|
35
|
+
testMode = false,
|
|
36
|
+
// API Key props
|
|
37
|
+
apiKey,
|
|
38
|
+
environment = 'production',
|
|
39
|
+
enableLogging = true,
|
|
40
|
+
timeout = 30000,
|
|
41
|
+
retryAttempts = 3
|
|
42
|
+
} = props;
|
|
43
|
+
const [showOverlay, setShowOverlay] = (0, _react.useState)(false);
|
|
44
|
+
const [isInitialized, setIsInitialized] = (0, _react.useState)(false);
|
|
45
|
+
const [initializationError, setInitializationError] = (0, _react.useState)(null);
|
|
46
|
+
const [isInitializing, setIsInitializing] = (0, _react.useState)(false);
|
|
47
|
+
|
|
48
|
+
// Initialize API key when component mounts or API key changes
|
|
49
|
+
(0, _react.useEffect)(() => {
|
|
50
|
+
var _getApiConfig;
|
|
51
|
+
let isMounted = true;
|
|
52
|
+
const initializeApi = async () => {
|
|
53
|
+
// Skip if already initializing
|
|
54
|
+
if (isInitializing) return;
|
|
55
|
+
setIsInitializing(true);
|
|
56
|
+
setInitializationError(null);
|
|
57
|
+
try {
|
|
58
|
+
console.log('🚀 Onairos SDK: Starting API key initialization...');
|
|
59
|
+
if (!apiKey) {
|
|
60
|
+
throw new Error('API key is required. Please provide a valid API key from your Onairos dashboard.');
|
|
61
|
+
}
|
|
62
|
+
const config = {
|
|
63
|
+
apiKey,
|
|
64
|
+
environment,
|
|
65
|
+
enableLogging,
|
|
66
|
+
timeout,
|
|
67
|
+
retryAttempts
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Initialize the API key service
|
|
71
|
+
await (0, _apiKeyService.initializeApiKey)(config);
|
|
72
|
+
if (isMounted) {
|
|
73
|
+
setIsInitialized(true);
|
|
74
|
+
setInitializationError(null);
|
|
75
|
+
if (enableLogging) {
|
|
76
|
+
console.log('✅ Onairos SDK: API key initialization completed successfully');
|
|
77
|
+
console.log('📊 Configuration:', {
|
|
78
|
+
environment,
|
|
79
|
+
enableLogging,
|
|
80
|
+
timeout,
|
|
81
|
+
retryAttempts,
|
|
82
|
+
apiKeyLength: apiKey.length
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
} catch (error) {
|
|
87
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown initialization error';
|
|
88
|
+
console.error('❌ Onairos SDK: API key initialization failed:', errorMessage);
|
|
89
|
+
if (isMounted) {
|
|
90
|
+
setIsInitialized(false);
|
|
91
|
+
setInitializationError(errorMessage);
|
|
92
|
+
|
|
93
|
+
// Show developer-friendly error
|
|
94
|
+
if (enableLogging) {
|
|
95
|
+
console.group('🔧 API Key Troubleshooting Guide');
|
|
96
|
+
console.log('1. Check that your API key is correct and not expired');
|
|
97
|
+
console.log('2. Verify you have the right permissions for your use case');
|
|
98
|
+
console.log('3. Ensure your environment setting matches your API key');
|
|
99
|
+
console.log('4. Check your internet connection');
|
|
100
|
+
console.log('5. Visit https://dashboard.onairos.uk to manage your API keys');
|
|
101
|
+
console.groupEnd();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Call rejection callback if provided
|
|
105
|
+
if (onRejection) {
|
|
106
|
+
onRejection(`SDK initialization failed: ${errorMessage}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
} finally {
|
|
110
|
+
if (isMounted) {
|
|
111
|
+
setIsInitializing(false);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// Only initialize if we have an API key and aren't already initialized correctly
|
|
117
|
+
if (apiKey && (!(0, _apiKeyService.isApiKeyInitialized)() || ((_getApiConfig = (0, _apiKeyService.getApiConfig)()) === null || _getApiConfig === void 0 ? void 0 : _getApiConfig.apiKey) !== apiKey)) {
|
|
118
|
+
initializeApi();
|
|
119
|
+
} else if ((0, _apiKeyService.isApiKeyInitialized)()) {
|
|
120
|
+
// SDK already initialized (e.g., from App.tsx), sync internal state
|
|
121
|
+
setIsInitialized(true);
|
|
122
|
+
setIsInitializing(false);
|
|
123
|
+
if (enableLogging) {
|
|
124
|
+
console.log('✅ Onairos component: SDK already initialized, syncing state');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return () => {
|
|
128
|
+
isMounted = false;
|
|
129
|
+
};
|
|
130
|
+
}, [apiKey, environment, enableLogging, timeout, retryAttempts, onRejection]);
|
|
131
|
+
|
|
132
|
+
// Imperative methods
|
|
133
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
134
|
+
openOverlay: handleShowOverlay,
|
|
135
|
+
closeOverlay: handleCloseOverlay,
|
|
136
|
+
isInitialized: () => isInitialized,
|
|
137
|
+
getApiConfig: () => (0, _apiKeyService.getApiConfig)()
|
|
138
|
+
}));
|
|
139
|
+
const handleShowOverlay = (0, _react.useCallback)(async () => {
|
|
140
|
+
console.log('🔘 Button pressed! isInitialized:', isInitialized, 'isInitializing:', isInitializing, 'showOverlay:', showOverlay);
|
|
141
|
+
try {
|
|
142
|
+
// Check if SDK is initialized
|
|
143
|
+
if (!isInitialized) {
|
|
144
|
+
const errorMessage = initializationError || 'SDK not initialized. Please check your API key.';
|
|
145
|
+
console.error('❌ Cannot open overlay: SDK not initialized');
|
|
146
|
+
if (onRejection) {
|
|
147
|
+
onRejection(errorMessage);
|
|
148
|
+
} else {
|
|
149
|
+
_reactNative.Alert.alert('SDK Error', errorMessage, [{
|
|
150
|
+
text: 'OK'
|
|
151
|
+
}]);
|
|
152
|
+
}
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Run pre-check if provided
|
|
157
|
+
if (preCheck) {
|
|
158
|
+
if (enableLogging) {
|
|
159
|
+
console.log('🔍 Running pre-check validation...');
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
const preCheckPassed = await preCheck();
|
|
163
|
+
if (!preCheckPassed) {
|
|
164
|
+
if (enableLogging) {
|
|
165
|
+
console.log('⛔ Pre-check failed, aborting overlay');
|
|
166
|
+
}
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (enableLogging) {
|
|
170
|
+
console.log('✅ Pre-check passed');
|
|
171
|
+
}
|
|
172
|
+
} catch (preCheckError) {
|
|
173
|
+
console.error('❌ Pre-check error:', preCheckError);
|
|
174
|
+
if (onRejection) {
|
|
175
|
+
onRejection(`Pre-check failed: ${preCheckError.message}`);
|
|
176
|
+
}
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Check for existing credentials
|
|
182
|
+
if (enableLogging) {
|
|
183
|
+
console.log('🔍 Checking for existing credentials...');
|
|
184
|
+
}
|
|
185
|
+
const hasExistingCredentials = await (0, _secureStorage.hasCredentials)();
|
|
186
|
+
if (hasExistingCredentials) {
|
|
187
|
+
if (enableLogging) {
|
|
188
|
+
console.log('🔑 Existing credentials found, attempting automatic resolution...');
|
|
189
|
+
}
|
|
190
|
+
try {
|
|
191
|
+
const credentials = await (0, _secureStorage.getCredentials)();
|
|
192
|
+
if (credentials && onResolved) {
|
|
193
|
+
// For existing users, we can resolve immediately with cached data
|
|
194
|
+
const mockApiUrl = `${_api.API_CONFIG.BASE_URL}/user/data`;
|
|
195
|
+
const mockToken = 'existing_user_token';
|
|
196
|
+
if (enableLogging) {
|
|
197
|
+
console.log('✅ Resolving with existing credentials');
|
|
198
|
+
}
|
|
199
|
+
onResolved(mockApiUrl, mockToken, credentials);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
} catch (credentialsError) {
|
|
203
|
+
console.warn('⚠️ Failed to retrieve existing credentials:', credentialsError);
|
|
204
|
+
// Continue with normal flow
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (enableLogging) {
|
|
208
|
+
console.log('🎨 Opening Onairos overlay...');
|
|
209
|
+
}
|
|
210
|
+
setShowOverlay(true);
|
|
211
|
+
} catch (error) {
|
|
212
|
+
console.error('❌ Error opening overlay:', error);
|
|
213
|
+
if (onRejection) {
|
|
214
|
+
onRejection(`Failed to open overlay: ${error.message}`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}, [isInitialized, initializationError, preCheck, enableLogging, onRejection, onResolved]);
|
|
218
|
+
const handleCloseOverlay = (0, _react.useCallback)(result => {
|
|
219
|
+
console.log('🔽 Closing Onairos overlay, result:', result);
|
|
220
|
+
setShowOverlay(false);
|
|
221
|
+
console.log('🔽 showOverlay set to false');
|
|
222
|
+
if (result && onResolved) {
|
|
223
|
+
onResolved(result.apiUrl, result.token, result.userData);
|
|
224
|
+
}
|
|
225
|
+
}, [enableLogging, onResolved]);
|
|
226
|
+
const handleOverlayRejection = (0, _react.useCallback)(error => {
|
|
227
|
+
if (enableLogging) {
|
|
228
|
+
console.log('❌ Overlay rejected:', error);
|
|
229
|
+
}
|
|
230
|
+
setShowOverlay(false);
|
|
231
|
+
if (onRejection) {
|
|
232
|
+
onRejection(error);
|
|
233
|
+
}
|
|
234
|
+
}, [enableLogging, onRejection]);
|
|
235
|
+
|
|
236
|
+
// Show error state if initialization failed
|
|
237
|
+
if (initializationError && !isInitializing) {
|
|
238
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
239
|
+
style: styles.errorContainer
|
|
240
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
241
|
+
style: [styles.errorButton, {
|
|
242
|
+
backgroundColor: '#FF6B6B'
|
|
243
|
+
}],
|
|
244
|
+
onPress: () => {
|
|
245
|
+
_reactNative.Alert.alert('SDK Error', `Onairos SDK initialization failed:\n\n${initializationError}\n\nPlease check your API key and try again.`, [{
|
|
246
|
+
text: 'OK'
|
|
247
|
+
}]);
|
|
248
|
+
}
|
|
249
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
250
|
+
style: styles.errorButtonText
|
|
251
|
+
}, "\u26A0\uFE0F SDK Error")));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Show loading state while initializing
|
|
255
|
+
if (isInitializing || !isInitialized) {
|
|
256
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
257
|
+
style: styles.loadingContainer
|
|
258
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
259
|
+
style: [styles.loadingButton, {
|
|
260
|
+
backgroundColor: '#999'
|
|
261
|
+
}],
|
|
262
|
+
disabled: true
|
|
263
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
264
|
+
style: styles.loadingButtonText
|
|
265
|
+
}, "\uD83D\uDD04 Initializing...")));
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Get button style based on type
|
|
269
|
+
const getButtonStyle = () => {
|
|
270
|
+
const baseStyle = {
|
|
271
|
+
width: buttonWidth,
|
|
272
|
+
height: buttonHeight,
|
|
273
|
+
backgroundColor: color,
|
|
274
|
+
borderRadius: buttonType === 'pill' ? buttonHeight / 2 : 8,
|
|
275
|
+
alignItems: 'center',
|
|
276
|
+
justifyContent: 'center',
|
|
277
|
+
flexDirection: 'row',
|
|
278
|
+
opacity: enabled ? 1 : 0.6
|
|
279
|
+
};
|
|
280
|
+
if (hasStroke) {
|
|
281
|
+
baseStyle.borderWidth = 2;
|
|
282
|
+
baseStyle.borderColor = darkMode ? '#fff' : '#000';
|
|
283
|
+
}
|
|
284
|
+
return baseStyle;
|
|
285
|
+
};
|
|
286
|
+
const getButtonText = () => {
|
|
287
|
+
switch (buttonForm) {
|
|
288
|
+
case 'connect':
|
|
289
|
+
return 'Connect with Onairos';
|
|
290
|
+
default:
|
|
291
|
+
return 'Continue with Onairos';
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
295
|
+
style: getButtonStyle(),
|
|
296
|
+
onPress: handleShowOverlay,
|
|
297
|
+
disabled: !enabled || isInitializing || !isInitialized,
|
|
298
|
+
activeOpacity: 0.8
|
|
299
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
300
|
+
source: _assetRegistry.BRAND_IMAGES.onairosLogoAlt,
|
|
301
|
+
style: styles.logo,
|
|
302
|
+
resizeMode: "contain"
|
|
303
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
304
|
+
style: [styles.buttonText, {
|
|
305
|
+
color: darkMode ? '#000' : '#fff'
|
|
306
|
+
}]
|
|
307
|
+
}, getButtonText())), /*#__PURE__*/_react.default.createElement(_UniversalOnboarding.UniversalOnboarding, {
|
|
308
|
+
visible: showOverlay,
|
|
309
|
+
onClose: handleCloseOverlay,
|
|
310
|
+
AppName: AppName,
|
|
311
|
+
requestData: requestData || {},
|
|
312
|
+
returnLink: returnLink,
|
|
313
|
+
onComplete: handleCloseOverlay,
|
|
314
|
+
embedd: false,
|
|
315
|
+
debug: debug,
|
|
316
|
+
testMode: testMode,
|
|
317
|
+
preferredPlatform: preferredPlatform
|
|
318
|
+
}));
|
|
319
|
+
});
|
|
320
|
+
const styles = _reactNative.StyleSheet.create({
|
|
321
|
+
button: {
|
|
322
|
+
flexDirection: 'row',
|
|
323
|
+
alignItems: 'center',
|
|
324
|
+
justifyContent: 'center',
|
|
325
|
+
paddingVertical: 12,
|
|
326
|
+
paddingHorizontal: 16,
|
|
327
|
+
shadowColor: '#000',
|
|
328
|
+
shadowOffset: {
|
|
329
|
+
width: 0,
|
|
330
|
+
height: 2
|
|
331
|
+
},
|
|
332
|
+
shadowOpacity: 0.1,
|
|
333
|
+
shadowRadius: 4,
|
|
334
|
+
elevation: 2
|
|
335
|
+
},
|
|
336
|
+
buttonContent: {
|
|
337
|
+
flexDirection: 'row',
|
|
338
|
+
alignItems: 'center',
|
|
339
|
+
justifyContent: 'center'
|
|
340
|
+
},
|
|
341
|
+
logo: {
|
|
342
|
+
width: 24,
|
|
343
|
+
height: 24,
|
|
344
|
+
marginRight: 8
|
|
345
|
+
},
|
|
346
|
+
buttonText: {
|
|
347
|
+
fontSize: 16,
|
|
348
|
+
fontWeight: '600',
|
|
349
|
+
textAlign: 'center'
|
|
350
|
+
},
|
|
351
|
+
errorContainer: {
|
|
352
|
+
flex: 1,
|
|
353
|
+
justifyContent: 'center',
|
|
354
|
+
alignItems: 'center'
|
|
355
|
+
},
|
|
356
|
+
errorButton: {
|
|
357
|
+
padding: 16,
|
|
358
|
+
borderRadius: 8
|
|
359
|
+
},
|
|
360
|
+
errorButtonText: {
|
|
361
|
+
fontSize: 16,
|
|
362
|
+
fontWeight: '600',
|
|
363
|
+
color: '#fff'
|
|
364
|
+
},
|
|
365
|
+
loadingContainer: {
|
|
366
|
+
flex: 1,
|
|
367
|
+
justifyContent: 'center',
|
|
368
|
+
alignItems: 'center'
|
|
369
|
+
},
|
|
370
|
+
loadingButton: {
|
|
371
|
+
padding: 16,
|
|
372
|
+
borderRadius: 8
|
|
373
|
+
},
|
|
374
|
+
loadingButtonText: {
|
|
375
|
+
fontSize: 16,
|
|
376
|
+
fontWeight: '600',
|
|
377
|
+
color: '#fff'
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
//# sourceMappingURL=Onairos.js.map
|