@onairos/react-native 3.7.2 → 3.7.4
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/components/BodyText.js +27 -9
- package/lib/commonjs/components/BrandMark.js +111 -10
- package/lib/commonjs/components/CodeInput.js +120 -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/components/BodyText.js +20 -1
- package/lib/module/components/BrandMark.js +104 -1
- package/lib/module/components/CodeInput.js +113 -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
|
-
function _0x3c4b(){const _0x246464=['defineProperty','__esModule','Onairos','object','function','kfdxL','xwWDQ','ZyjFK','oFujE','KXMmO','FuvAQ','qXVHo','has','set','NIedW','call','get','forwardRef','#999','🔄\x20Initializing...','KNsky','API\x20key\x20is\x20required.\x20Please\x20provide\x20a\x20valid\x20API\x20key\x20from\x20your\x20Onairos\x20dashboard.','✅\x20Onairos\x20SDK:\x20API\x20key\x20initialization\x20completed\x20successfully','📊\x20Configuration:','❌\x20Onairos\x20SDK:\x20API\x20key\x20initialization\x20failed:','iKwJg','1.\x20Check\x20that\x20your\x20API\x20key\x20is\x20correct\x20and\x20not\x20expired','4.\x20Check\x20your\x20internet\x20connection','5.\x20Visit\x20https://dashboard.onairos.uk\x20to\x20manage\x20your\x20API\x20keys','boORA','mGMQx','BnXPG','center','row','#fff','NXLFF','default','✅\x20Onairos\x20component:\x20SDK\x20already\x20initialized,\x20syncing\x20state','SDK\x20not\x20initialized.\x20Please\x20check\x20your\x20API\x20key.','❌\x20Cannot\x20open\x20overlay:\x20SDK\x20not\x20initialized','connect','Continue\x20with\x20Onairos','⚠️\x20SDK\x20Error','uhhoN','🔘\x20Button\x20pressed!\x20isInitialized:','isInitializing:','showOverlay:','KlbhB','QjrbA','lihiH','suiNU','🔍\x20Running\x20pre-check\x20validation...','EJNHR','rlOui','❌\x20Pre-check\x20error:','QZPpx','MTOhS','🔑\x20Existing\x20credentials\x20found,\x20attempting\x20automatic\x20resolution...','✅\x20Resolving\x20with\x20existing\x20credentials','⚠️\x20Failed\x20to\x20retrieve\x20existing\x20credentials:','🎨\x20Opening\x20Onairos\x20overlay...','❌\x20Error\x20opening\x20overlay:','svDFV','🔽\x20Closing\x20Onairos\x20overlay,\x20result:','6|0|2|5|4|1|3','2.\x20Verify\x20you\x20have\x20the\x20right\x20permissions\x20for\x20your\x20use\x20case','3.\x20Ensure\x20your\x20environment\x20setting\x20matches\x20your\x20API\x20key','izLFV','kOvMA','#000','normal','jxqWf','#FF6B6B','LitEd','lcVuC','COLORS','primary','production','useState','useEffect','tXMHg','kIWYx','dmLHD','DaxhS','kDDLo','GznEn','View','loadingContainer','createElement','TouchableOpacity','loadingButton','LVexu','Text','YvcRW','jVPkf','log','diJgL','initializeApiKey','wBxUz','length','ojxaG','message','Unknown\x20initialization\x20error','error','jjxKL','MhMFt','ktPOJ','UDHIv','ITucK','eXzaf','hasOwnProperty','getOwnPropertyDescriptor','TYEnl','group','🔧\x20API\x20Key\x20Troubleshooting\x20Guide','Khbst','fAaYc','SDK\x20initialization\x20failed:\x20','IkCJr','uQEMy','uNlEV','AAGsD','pkqwN','Pre-check\x20failed:\x20','isApiKeyInitialized','getApiConfig','aWVQC','JIBVD','RfJYm','zXaLz','ghpZo','EpcwA','vZcgD','VIoSR','QuMri','DEZPv','borderWidth','borderColor','wyutM','useImperativeHandle','useCallback','wBkIb','QWGtI','hoGgh','UfNjG','DKxUR','zPUHc','alert','LrfDy','lnqqt','bBxJy','bRWhh','Mydvq','rAtoz','ToLGp','zWAzg','zGrgr','OQmlh','SDK\x20Error','ppmkK','GZHuT','aezfp','vcWpq','⛔\x20Pre-check\x20failed,\x20aborting\x20overlay','DbGty','jmiiA','✅\x20Pre-check\x20passed','BSHlo','VLCce','sjfHT','NyaLL','tGCRc','apiUrl','spFQH','hasCredentials','gtTjU','jzsAx','errorContainer','zmBEg','Onairos\x20SDK\x20initialization\x20failed:\x0a\x0a','\x0a\x0aPlease\x20check\x20your\x20API\x20key\x20and\x20try\x20again.','errorButtonText','auNIi','ZIcTT','ciuPD','WeZYQ','getCredentials','BASE_URL','/user/data','existing_user_token','sjLdh','LYJWv','WnpNA','XLOfd','WSvmA','afuAd','MBSrx','Failed\x20to\x20open\x20overlay:\x20','VJPox','deTkR','EHuaj','🔽\x20showOverlay\x20set\x20to\x20false','OGOTP','token','userData','yqIxp','ScjSL','qxjwU','psMgA','viqmy','ekZfi','groupEnd','CZFDu','IVXsl','PSICt','hQtlK','errorButton','Alert','WFhpm','SqrqN','loadingButtonText','VqdDF','vIpdG','KgGXq','BJqFp','tMxRs','Connect\x20with\x20Onairos','gggVM','Fragment','isQIR','qrhJc','Image','BRAND_IMAGES','onairosLogoAlt','logo','contain','buttonText','PvcED','UniversalOnboarding','JpEKj','StyleSheet','600'];_0x3c4b=function(){return _0x246464;};return _0x3c4b();}Object[_0x5c7d(0x0)](exports,_0x5c7d(0x1),{'value':!![]}),exports[_0x5c7d(0x2)]=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 _interopRequireWildcard(_0x3f31fe,_0xad5fc7){const _0x73ddb2={'xwWDQ':function(_0x573741,_0x17179e){return _0x573741&&_0x17179e;},'ZyjFK':function(_0x15dbaf,_0x1bfb9f){return _0x15dbaf===_0x1bfb9f;},'oFujE':function(_0x355e87,_0x934eeb){return _0x355e87!=_0x934eeb;},'KXMmO':_0x5c7d(0x3),'FuvAQ':function(_0x31a06d,_0x40f1e5){return _0x31a06d!=_0x40f1e5;},'qXVHo':_0x5c7d(0x4),'NIedW':'default','kfdxL':function(_0x5d82a5,_0x1d6c53){return _0x5d82a5==_0x1d6c53;}};if(_0x73ddb2[_0x5c7d(0x5)](_0x5c7d(0x4),typeof WeakMap))var _0xecee99=new WeakMap(),_0xd090d9=new WeakMap();return(_interopRequireWildcard=function(_0xb99169,_0x1758dc){if(_0x73ddb2[_0x5c7d(0x6)](!_0x1758dc,_0xb99169)&&_0xb99169[_0x5c7d(0x1)])return _0xb99169;var _0x4dbdfc,_0xd5f1ae,_0x5d8eb5={'__proto__':null,'default':_0xb99169};if(_0x73ddb2[_0x5c7d(0x7)](null,_0xb99169)||_0x73ddb2[_0x5c7d(0x8)](_0x73ddb2[_0x5c7d(0x9)],typeof _0xb99169)&&_0x73ddb2[_0x5c7d(0xa)](_0x73ddb2[_0x5c7d(0xb)],typeof _0xb99169))return _0x5d8eb5;if(_0x4dbdfc=_0x1758dc?_0xd090d9:_0xecee99){if(_0x4dbdfc[_0x5c7d(0xc)](_0xb99169))return _0x4dbdfc['get'](_0xb99169);_0x4dbdfc[_0x5c7d(0xd)](_0xb99169,_0x5d8eb5);}for(const _0x1f8c73 in _0xb99169)_0x73ddb2[_0x5c7d(0xe)]!==_0x1f8c73&&{}['hasOwnProperty'][_0x5c7d(0xf)](_0xb99169,_0x1f8c73)&&((_0xd5f1ae=(_0x4dbdfc=Object[_0x5c7d(0x0)])&&Object['getOwnPropertyDescriptor'](_0xb99169,_0x1f8c73))&&(_0xd5f1ae[_0x5c7d(0x10)]||_0xd5f1ae[_0x5c7d(0xd)])?_0x4dbdfc(_0x5d8eb5,_0x1f8c73,_0xd5f1ae):_0x5d8eb5[_0x1f8c73]=_0xb99169[_0x1f8c73]);return _0x5d8eb5;})(_0x3f31fe,_0xad5fc7);}function _0x5c7d(_0x3c4ba1,_0x5c7dd5){_0x3c4ba1=_0x3c4ba1-0x0;const _0x3d06e2=_0x3c4b();let _0x17dfb4=_0x3d06e2[_0x3c4ba1];return _0x17dfb4;}const Onairos=exports[_0x5c7d(0x2)]=(0x0,_react[_0x5c7d(0x11)])((_0x346559,_0x69400b)=>{const _0x3dcd1e={'LVexu':_0x5c7d(0x12),'YvcRW':_0x5c7d(0x13),'jVPkf':function(_0x38bfd9,_0x32f3b9){return _0x38bfd9(_0x32f3b9);},'IkCJr':function(_0x522797,_0x340e28){return _0x522797!==_0x340e28;},'diJgL':_0x5c7d(0x14),'Cgdoy':_0x5c7d(0x15),'Iwpwa':_0x5c7d(0x16),'wBxUz':_0x5c7d(0x17),'ojxaG':function(_0x561aed,_0x4fd801){return _0x561aed instanceof _0x4fd801;},'cjviV':_0x5c7d(0x18),'tXMHg':function(_0xb5b483,_0x132ff0){return _0xb5b483===_0x132ff0;},'ToMGh':_0x5c7d(0x19),'UunNO':_0x5c7d(0x1a),'vMfhl':_0x5c7d(0x1b),'Khbst':_0x5c7d(0x1c),'fAaYc':function(_0x29e301,_0x21beb8){return _0x29e301(_0x21beb8);},'uQEMy':_0x5c7d(0x1d),'uNlEV':_0x5c7d(0x1e),'AAGsD':_0x5c7d(0x1f),'zXaLz':'pill','tMxRs':_0x5c7d(0x20),'ghpZo':_0x5c7d(0x21),'EpcwA':_0x5c7d(0x22),'NfIPN':'CuNgb','vZcgD':_0x5c7d(0x23),'tGCRc':function(_0xffe50e,_0x416dd8){return _0xffe50e&&_0x416dd8;},'kIWYx':function(_0x1fd82c,_0x49f2c5){return _0x1fd82c!=_0x49f2c5;},'vWgUO':_0x5c7d(0x3),'dmLHD':_0x5c7d(0x4),'lcVuC':_0x5c7d(0x24),'DaxhS':function(_0x15dec0,_0x517c34,_0x4c9e90,_0x2fa5e2){return _0x15dec0(_0x517c34,_0x4c9e90,_0x2fa5e2);},'kDDLo':function(_0x18780c,_0x24a98c){return _0x18780c(_0x24a98c);},'GznEn':'UCctL','ewddB':function(_0x5cd4a1,_0xe12ba){return _0x5cd4a1===_0xe12ba;},'aWVQC':function(_0x52391a,_0x215398){return _0x52391a===_0x215398;},'FatKs':function(_0xc6ebb7){return _0xc6ebb7();},'JIBVD':function(_0x2bd50f,_0x2a0443){return _0x2bd50f(_0x2a0443);},'RfJYm':_0x5c7d(0x25),'DKxUR':_0x5c7d(0x26),'zPUHc':_0x5c7d(0x27),'wBkIb':'SDK\x20Error','rAtoz':function(_0x1682e9,_0x2fa293){return _0x1682e9(_0x2fa293);},'VJPox':'❌\x20Overlay\x20rejected:','tEezm':function(_0xac8c56,_0x238570){return _0xac8c56(_0x238570);},'BSHlo':function(_0x33b227,_0x8f8473){return _0x33b227(_0x8f8473);},'sjfHT':function(_0xb8fc0b,_0xa9f917){return _0xb8fc0b(_0xa9f917);},'NyaLL':'🔽\x20showOverlay\x20set\x20to\x20false','WeZYQ':_0x5c7d(0x28),'lUMRM':'Connect\x20with\x20Onairos','gggVM':_0x5c7d(0x29),'QWGtI':_0x5c7d(0x2a),'hoGgh':function(_0x569e33,_0x3e69a3){return _0x569e33===_0x3e69a3;},'UfNjG':_0x5c7d(0x2b),'LrfDy':_0x5c7d(0x2c),'lnqqt':_0x5c7d(0x2d),'bBxJy':_0x5c7d(0x2e),'bRWhh':function(_0x2d000a,_0x49956a){return _0x2d000a===_0x49956a;},'xIYdI':_0x5c7d(0x2f),'Mydvq':_0x5c7d(0x30),'byuvu':function(_0x544077,_0x9d01c1){return _0x544077||_0x9d01c1;},'ToLGp':function(_0x4e3b55,_0x516d44){return _0x4e3b55!==_0x516d44;},'zWAzg':_0x5c7d(0x31),'WOnhw':function(_0x289a00,_0x295036){return _0x289a00(_0x295036);},'ppkld':function(_0x4e2d43,_0x52f544){return _0x4e2d43!==_0x52f544;},'OQmlh':_0x5c7d(0x32),'ppmkK':_0x5c7d(0x33),'GZHuT':function(_0x2fc53d){return _0x2fc53d();},'aezfp':_0x5c7d(0x34),'DbGty':function(_0x39c919,_0x14c129){return _0x39c919===_0x14c129;},'jmiiA':'SmkQP','VLCce':_0x5c7d(0x35),'spFQH':_0x5c7d(0x36),'gtTjU':_0x5c7d(0x37),'jzsAx':'nuKOI','ZIcTT':function(_0x32bbbd,_0x445ead){return _0x32bbbd===_0x445ead;},'BOidX':_0x5c7d(0x38),'ciuPD':_0x5c7d(0x39),'sjLdh':_0x5c7d(0x3a),'LYJWv':_0x5c7d(0x3b),'WnpNA':_0x5c7d(0x3c),'XLOfd':function(_0x3b5d4c,_0x512c84){return _0x3b5d4c(_0x512c84);},'WSvmA':_0x5c7d(0x3d),'afuAd':_0x5c7d(0x3e),'MBSrx':function(_0x4c16a5,_0x12d7cd){return _0x4c16a5(_0x12d7cd);},'deTkR':_0x5c7d(0x3f),'EHuaj':function(_0x4c5f20,_0x1c18ef){return _0x4c5f20(_0x1c18ef);},'OGOTP':function(_0x519279,_0x125150,_0x4396be,_0xeaf0f){return _0x519279(_0x125150,_0x4396be,_0xeaf0f);},'yqIxp':_0x5c7d(0x40),'CcIoV':_0x5c7d(0x41),'ScjSL':_0x5c7d(0x42),'hQtlK':function(_0x13e9b4,_0x31ac11){return _0x13e9b4(_0x31ac11);},'FibpH':'PPGqg','VqdDF':function(_0x490e51,_0x4da0d5){return _0x490e51===_0x4da0d5;},'NfLHr':_0x5c7d(0x43),'vIpdG':_0x5c7d(0x44),'KgGXq':function(_0x2093e5,_0x6011af){return _0x2093e5===_0x6011af;},'BJqFp':function(_0x4b9263,_0x480498){return _0x4b9263/_0x480498;},'PvcED':_0x5c7d(0x45),'LitEd':_0x5c7d(0x46),'IVXsl':function(_0x14446e,_0xbbaf8d){return _0x14446e&&_0xbbaf8d;},'PSICt':_0x5c7d(0x47),'EIFDT':_0x5c7d(0x48),'SqrqN':function(_0x39f183,_0x6a364b){return _0x39f183||_0x6a364b;},'isQIR':function(_0x115e1d){return _0x115e1d();},'qrhJc':function(_0x9e6713,_0x295cfa){return _0x9e6713||_0x295cfa;},'JpEKj':function(_0x2dbd3f,_0x35f0c4){return _0x2dbd3f||_0x35f0c4;}},{returnLink:_0x42976a,prefillUrl:_0x507036,AppName:_0x404024,buttonType:buttonType=_0x3dcd1e[_0x5c7d(0x49)],requestData:_0x5498ea,buttonWidth:buttonWidth=0xc8,buttonHeight:buttonHeight=0x30,hasStroke:hasStroke=![],enabled:enabled=!![],buttonForm:buttonForm=_0x3dcd1e[_0x5c7d(0x4a)],onRejection:_0x1ed6d,onResolved:_0x249645,preCheck:_0x5f5bd3,color:color=_constants[_0x5c7d(0x4b)][_0x5c7d(0x4c)],debug:debug=![],darkMode:darkMode=![],preferredPlatform:_0x340e49,testMode:testMode=![],apiKey:_0x2c9b98,environment:environment=_0x5c7d(0x4d),enableLogging:enableLogging=!![],timeout:timeout=0x7530,retryAttempts:retryAttempts=0x3}=_0x346559,[_0x2d4c31,_0x4ed11f]=(0x0,_react['useState'])(![]),[_0x49f317,_0x18bf4d]=(0x0,_react['useState'])(![]),[_0x42ca34,_0x5ddd1b]=(0x0,_react[_0x5c7d(0x4e)])(null),[_0x2ebf60,_0x1bb6d4]=(0x0,_react[_0x5c7d(0x4e)])(![]);(0x0,_react[_0x5c7d(0x4f)])(()=>{const _0xdfa48c={'oEbhg':function(_0x1c4187,_0x3a2846){return _0x1c4187(_0x3a2846);},'DaWeH':function(_0x31c4b0,_0x50f5d1){return _0x3dcd1e['tGCRc'](_0x31c4b0,_0x50f5d1);},'MhMFt':function(_0x2e63d1,_0x1c0080){return _0x3dcd1e[_0x5c7d(0x50)](_0x2e63d1,_0x1c0080);},'ktPOJ':function(_0x415d4c,_0x50b683){return _0x3dcd1e[_0x5c7d(0x51)](_0x415d4c,_0x50b683);},'UDHIv':_0x3dcd1e['vWgUO'],'qGYJa':_0x3dcd1e[_0x5c7d(0x52)],'ITucK':function(_0x55c533,_0x37cdb8){return _0x3dcd1e['IkCJr'](_0x55c533,_0x37cdb8);},'eXzaf':_0x3dcd1e[_0x5c7d(0x4a)],'TYEnl':function(_0x5c1c95,_0xd7fc2b,_0x220046,_0x2d4543){return _0x3dcd1e[_0x5c7d(0x53)](_0x5c1c95,_0xd7fc2b,_0x220046,_0x2d4543);},'pkqwN':function(_0x14f484,_0x5ebf99){return _0x3dcd1e[_0x5c7d(0x54)](_0x14f484,_0x5ebf99);}};if(_0x3dcd1e[_0x5c7d(0x55)]!==_0x3dcd1e[_0x5c7d(0x55)])return _0x214e6c[_0x5c7d(0x24)]['createElement'](_0x1a5201[_0x5c7d(0x56)],{'style':_0x16856a[_0x5c7d(0x57)]},_0x3453a6[_0x5c7d(0x24)][_0x5c7d(0x58)](_0x23b7e8[_0x5c7d(0x59)],{'style':[_0x2b7cc8[_0x5c7d(0x5a)],{'backgroundColor':_0x3dcd1e[_0x5c7d(0x5b)]}],'disabled':!![]},_0x3e23b0[_0x5c7d(0x24)][_0x5c7d(0x58)](_0x334ad4[_0x5c7d(0x5c)],{'style':_0x5b26f5['loadingButtonText']},_0x3dcd1e[_0x5c7d(0x5d)])));else{var _0x5c38a0;let _0x17d88f=!![];const _0x199586=async()=>{if(_0x2ebf60)return;_0x1bb6d4(!![]),_0x3dcd1e[_0x5c7d(0x5e)](_0x5ddd1b,null);try{console[_0x5c7d(0x5f)]('🚀\x20Onairos\x20SDK:\x20Starting\x20API\x20key\x20initialization...');if(!_0x2c9b98){if(_0x3dcd1e['IkCJr'](_0x5c7d(0x14),_0x3dcd1e[_0x5c7d(0x60)]))_0x20f72a&&_0xdfa48c['oEbhg'](_0x5a5248,![]);else throw new Error(_0x3dcd1e['Cgdoy']);}const _0x2c650f={'apiKey':_0x2c9b98,'environment':environment,'enableLogging':enableLogging,'timeout':timeout,'retryAttempts':retryAttempts};await(0x0,_apiKeyService[_0x5c7d(0x61)])(_0x2c650f),_0x17d88f&&(_0x18bf4d(!![]),_0x3dcd1e[_0x5c7d(0x5e)](_0x5ddd1b,null),enableLogging&&(console[_0x5c7d(0x5f)](_0x3dcd1e['Iwpwa']),console[_0x5c7d(0x5f)](_0x3dcd1e[_0x5c7d(0x62)],{'environment':environment,'enableLogging':enableLogging,'timeout':timeout,'retryAttempts':retryAttempts,'apiKeyLength':_0x2c9b98[_0x5c7d(0x63)]})));}catch(_0x3b2db6){const _0x47732c=_0x3dcd1e[_0x5c7d(0x64)](_0x3b2db6,Error)?_0x3b2db6[_0x5c7d(0x65)]:_0x5c7d(0x66);console[_0x5c7d(0x67)](_0x3dcd1e['cjviV'],_0x47732c);if(_0x17d88f){if(_0x3dcd1e['tXMHg'](_0x5c7d(0x68),_0x3dcd1e['ToMGh'])){if(_0xdfa48c['DaWeH'](!_0x47772d,_0x40b95f)&&_0x4d902d[_0x5c7d(0x1)])return _0x50b2c3;var _0x3a1e1b,_0x58f6eb,_0x5f3035={'__proto__':null,'default':_0x3458c1};if(_0xdfa48c[_0x5c7d(0x69)](null,_0xfac815)||_0xdfa48c[_0x5c7d(0x6a)](_0xdfa48c[_0x5c7d(0x6b)],typeof _0x497d01)&&_0xdfa48c[_0x5c7d(0x6a)](_0xdfa48c['qGYJa'],typeof _0x2032f8))return _0x5f3035;if(_0x3a1e1b=_0x1efbb0?_0x1ec389:_0x48fc60){if(_0x3a1e1b[_0x5c7d(0xc)](_0x1f7ad6))return _0x3a1e1b[_0x5c7d(0x10)](_0x1d8227);_0x3a1e1b[_0x5c7d(0xd)](_0xa36143,_0x5f3035);}for(const _0x1eb1fe in _0x362556)_0xdfa48c[_0x5c7d(0x6c)](_0xdfa48c[_0x5c7d(0x6d)],_0x1eb1fe)&&{}[_0x5c7d(0x6e)][_0x5c7d(0xf)](_0x5146c6,_0x1eb1fe)&&((_0x58f6eb=(_0x3a1e1b=_0x30b05c[_0x5c7d(0x0)])&&_0x556cea[_0x5c7d(0x6f)](_0x230a36,_0x1eb1fe))&&(_0x58f6eb[_0x5c7d(0x10)]||_0x58f6eb[_0x5c7d(0xd)])?_0xdfa48c[_0x5c7d(0x70)](_0x3a1e1b,_0x5f3035,_0x1eb1fe,_0x58f6eb):_0x5f3035[_0x1eb1fe]=_0x264cad[_0x1eb1fe]);return _0x5f3035;}else _0x18bf4d(![]),_0x3dcd1e['jVPkf'](_0x5ddd1b,_0x47732c),enableLogging&&(console[_0x5c7d(0x71)](_0x5c7d(0x72)),console['log'](_0x3dcd1e['UunNO']),console['log']('2.\x20Verify\x20you\x20have\x20the\x20right\x20permissions\x20for\x20your\x20use\x20case'),console['log'](_0x5c7d(0x42)),console[_0x5c7d(0x5f)](_0x3dcd1e['vMfhl']),console[_0x5c7d(0x5f)](_0x3dcd1e[_0x5c7d(0x73)]),console['groupEnd']()),_0x1ed6d&&_0x3dcd1e[_0x5c7d(0x74)](_0x1ed6d,_0x5c7d(0x75)+_0x47732c);}}finally{_0x3dcd1e[_0x5c7d(0x76)](_0x3dcd1e[_0x5c7d(0x77)],_0x3dcd1e[_0x5c7d(0x78)])?_0x17d88f&&(_0x3dcd1e[_0x5c7d(0x50)](_0x5c7d(0x1f),_0x3dcd1e[_0x5c7d(0x79)])?_0x3dcd1e[_0x5c7d(0x74)](_0x1bb6d4,![]):_0xafc56d['warn']('⚠️\x20Failed\x20to\x20retrieve\x20existing\x20credentials:',_0x3488c4)):_0xdfa48c[_0x5c7d(0x7a)](_0x1bbe61,_0x5c7d(0x7b)+_0x40ff37[_0x5c7d(0x65)]);}};if(_0x2c9b98&&(!(0x0,_apiKeyService[_0x5c7d(0x7c)])()||_0x3dcd1e['IkCJr'](_0x3dcd1e['ewddB'](_0x5c38a0=(0x0,_apiKeyService[_0x5c7d(0x7d)])(),null)||_0x3dcd1e[_0x5c7d(0x7e)](_0x5c38a0,void 0x0)?void 0x0:_0x5c38a0['apiKey'],_0x2c9b98)))_0x3dcd1e['FatKs'](_0x199586);else(0x0,_apiKeyService[_0x5c7d(0x7c)])()&&(_0x18bf4d(!![]),_0x3dcd1e[_0x5c7d(0x7f)](_0x1bb6d4,![]),enableLogging&&console[_0x5c7d(0x5f)](_0x3dcd1e[_0x5c7d(0x80)]));return()=>{const _0x239a2b={'VIoSR':_0x3dcd1e[_0x5c7d(0x81)],'QuMri':_0x3dcd1e['tMxRs'],'DEZPv':_0x3dcd1e[_0x5c7d(0x82)],'wyutM':_0x3dcd1e[_0x5c7d(0x83)]};if(_0x3dcd1e['NfIPN']===_0x3dcd1e[_0x5c7d(0x84)]){const _0x2c422f={'width':_0x13c2d5,'height':_0xdeb5d6,'backgroundColor':_0x357170,'borderRadius':_0x1b6e74===_0x239a2b[_0x5c7d(0x85)]?_0x1f8107/0x2:0x8,'alignItems':_0x5c7d(0x20),'justifyContent':_0x239a2b[_0x5c7d(0x86)],'flexDirection':_0x239a2b[_0x5c7d(0x87)],'opacity':_0xca34b3?0x1:0.6};return _0x16d74d&&(_0x2c422f[_0x5c7d(0x88)]=0x2,_0x2c422f[_0x5c7d(0x89)]=_0x25b5f6?_0x239a2b[_0x5c7d(0x8a)]:'#000'),_0x2c422f;}else _0x17d88f=![];};}},[_0x2c9b98,environment,enableLogging,timeout,retryAttempts,_0x1ed6d]),(0x0,_react[_0x5c7d(0x8b)])(_0x69400b,()=>({'openOverlay':_0x44d696,'closeOverlay':_0x236544,'isInitialized':()=>_0x49f317,'getApiConfig':()=>(0x0,_apiKeyService[_0x5c7d(0x7d)])()}));const _0x44d696=(0x0,_react[_0x5c7d(0x8c)])(async()=>{const _0x955db7={'vcWpq':_0x3dcd1e[_0x5c7d(0x8d)],'auNIi':_0x3dcd1e[_0x5c7d(0x8e)]};if(_0x3dcd1e[_0x5c7d(0x8f)](_0x3dcd1e[_0x5c7d(0x90)],'dBYQS')){const _0x4c6c8c=_0x4d23d5||_0x3dcd1e[_0x5c7d(0x91)];_0xfa9b72[_0x5c7d(0x67)](_0x3dcd1e[_0x5c7d(0x92)]);_0x149bdd?_0x3dcd1e['kDDLo'](_0x2b9191,_0x4c6c8c):_0x22c574['Alert'][_0x5c7d(0x93)](_0x3dcd1e[_0x5c7d(0x8d)],_0x4c6c8c,[{'text':'OK'}]);return;}else{console[_0x5c7d(0x5f)](_0x3dcd1e[_0x5c7d(0x94)],_0x49f317,_0x3dcd1e[_0x5c7d(0x95)],_0x2ebf60,_0x3dcd1e[_0x5c7d(0x96)],_0x2d4c31);try{if(_0x3dcd1e[_0x5c7d(0x97)](_0x3dcd1e['xIYdI'],_0x3dcd1e[_0x5c7d(0x98)]))_0x3dcd1e[_0x5c7d(0x99)](_0x418827,_0x5c7d(0x75)+_0x20d05f);else{if(!_0x49f317){const _0x4f91d7=_0x3dcd1e['byuvu'](_0x42ca34,_0x3dcd1e[_0x5c7d(0x91)]);console[_0x5c7d(0x67)](_0x5c7d(0x27));_0x1ed6d?_0x3dcd1e[_0x5c7d(0x9a)](_0x3dcd1e[_0x5c7d(0x9b)],_0x5c7d(0x9c))?_0x3dcd1e['WOnhw'](_0x1ed6d,_0x4f91d7):_0x109ddc['log'](_0x3dcd1e[_0x5c7d(0x80)]):_0x3dcd1e['ppkld'](_0x3dcd1e[_0x5c7d(0x9d)],'suiNU')?(_0x43b858&&_0x239797['log'](_0x3dcd1e['VJPox'],_0x3cbff8),_0x3dcd1e[_0x5c7d(0x74)](_0x4c7c04,![]),_0x45da46&&_0x3dcd1e['tEezm'](_0x598eb4,_0x29da00)):_reactNative['Alert'][_0x5c7d(0x93)](_0x5c7d(0x9e),_0x4f91d7,[{'text':'OK'}]);return;}if(_0x5f5bd3){enableLogging&&console[_0x5c7d(0x5f)](_0x3dcd1e[_0x5c7d(0x9f)]);try{const _0x4f02fc=await _0x3dcd1e[_0x5c7d(0xa0)](_0x5f5bd3);if(!_0x4f02fc){if(_0x3dcd1e[_0x5c7d(0x9a)](_0x3dcd1e[_0x5c7d(0xa1)],_0x3dcd1e[_0x5c7d(0xa1)]))_0x3b1fb2['Alert'][_0x5c7d(0x93)](_0x955db7[_0x5c7d(0xa2)],_0x31fd0e,[{'text':'OK'}]);else{enableLogging&&console['log'](_0x5c7d(0xa3));return;}}enableLogging&&(_0x3dcd1e[_0x5c7d(0xa4)](_0x3dcd1e[_0x5c7d(0xa5)],_0x3dcd1e[_0x5c7d(0xa5)])?console[_0x5c7d(0x5f)](_0x5c7d(0xa6)):_0x3dcd1e[_0x5c7d(0xa7)](_0x483582,_0x462dc3));}catch(_0xd8ad41){if(_0x5c7d(0x35)!==_0x3dcd1e[_0x5c7d(0xa8)])_0x34df6a[_0x5c7d(0x5f)]('🔽\x20Closing\x20Onairos\x20overlay,\x20result:',_0xead3e2),_0x3dcd1e[_0x5c7d(0xa9)](_0x398258,![]),_0x4620fb[_0x5c7d(0x5f)](_0x3dcd1e[_0x5c7d(0xaa)]),_0x3dcd1e[_0x5c7d(0xab)](_0x484367,_0x2d3325)&&_0x3dcd1e[_0x5c7d(0x53)](_0x26b67f,_0x3f0ef0[_0x5c7d(0xac)],_0x558ce8['token'],_0x51901f['userData']);else{console[_0x5c7d(0x67)](_0x3dcd1e[_0x5c7d(0xad)],_0xd8ad41);_0x1ed6d&&_0x3dcd1e[_0x5c7d(0xa7)](_0x1ed6d,'Pre-check\x20failed:\x20'+_0xd8ad41[_0x5c7d(0x65)]);return;}}}enableLogging&&console['log']('🔍\x20Checking\x20for\x20existing\x20credentials...');const _0x18a8dd=await(0x0,_secureStorage[_0x5c7d(0xae)])();if(_0x18a8dd){if(_0x3dcd1e[_0x5c7d(0x8f)](_0x3dcd1e[_0x5c7d(0xaf)],_0x3dcd1e[_0x5c7d(0xb0)])){const _0x1686c4={'zmBEg':_0x955db7[_0x5c7d(0xa2)]};return _0x349a28[_0x5c7d(0x24)]['createElement'](_0x573336[_0x5c7d(0x56)],{'style':_0x51e19b[_0x5c7d(0xb1)]},_0x28133d[_0x5c7d(0x24)]['createElement'](_0x753f7f[_0x5c7d(0x59)],{'style':[_0xaa5dc3['errorButton'],{'backgroundColor':_0x5c7d(0x48)}],'onPress':()=>{_0x1e5fa6['Alert']['alert'](_0x1686c4[_0x5c7d(0xb2)],_0x5c7d(0xb3)+_0x4e5ef7+_0x5c7d(0xb4),[{'text':'OK'}]);}},_0x5de3b7[_0x5c7d(0x24)][_0x5c7d(0x58)](_0x16967c[_0x5c7d(0x5c)],{'style':_0x52ef86[_0x5c7d(0xb5)]},_0x955db7[_0x5c7d(0xb6)])));}else{if(enableLogging){if(_0x3dcd1e[_0x5c7d(0xb7)]('MTOhS',_0x3dcd1e['BOidX']))console[_0x5c7d(0x5f)](_0x3dcd1e[_0x5c7d(0xb8)]);else switch(_0x5327c7){case _0x3dcd1e[_0x5c7d(0xb9)]:return _0x3dcd1e['lUMRM'];default:return _0x3dcd1e['gggVM'];}}try{const _0x29581b=await(0x0,_secureStorage[_0x5c7d(0xba)])();if(_0x3dcd1e['tGCRc'](_0x29581b,_0x249645)){const _0x1fdf0f=_api['API_CONFIG'][_0x5c7d(0xbb)]+_0x5c7d(0xbc),_0xc6fe10=_0x5c7d(0xbd);enableLogging&&console[_0x5c7d(0x5f)](_0x3dcd1e[_0x5c7d(0xbe)]);_0x249645(_0x1fdf0f,_0xc6fe10,_0x29581b);return;}}catch(_0x2f21ee){console['warn'](_0x3dcd1e[_0x5c7d(0xbf)],_0x2f21ee);}}}enableLogging&&console[_0x5c7d(0x5f)](_0x3dcd1e[_0x5c7d(0xc0)]),_0x3dcd1e[_0x5c7d(0xc1)](_0x4ed11f,!![]);}}catch(_0x37beee){console['error'](_0x3dcd1e[_0x5c7d(0xc2)],_0x37beee),_0x1ed6d&&('svDFV'===_0x3dcd1e[_0x5c7d(0xc3)]?_0x3dcd1e[_0x5c7d(0xc4)](_0x1ed6d,_0x5c7d(0xc5)+_0x37beee['message']):_0x1fecea['log'](_0x3dcd1e[_0x5c7d(0xc6)],_0x14921d));}}},[_0x49f317,_0x42ca34,_0x5f5bd3,enableLogging,_0x1ed6d,_0x249645]),_0x236544=(0x0,_react[_0x5c7d(0x8c)])(_0x928a4c=>{console['log'](_0x3dcd1e[_0x5c7d(0xc7)],_0x928a4c),_0x3dcd1e[_0x5c7d(0xc8)](_0x4ed11f,![]),console[_0x5c7d(0x5f)](_0x5c7d(0xc9)),_0x928a4c&&_0x249645&&_0x3dcd1e[_0x5c7d(0xca)](_0x249645,_0x928a4c[_0x5c7d(0xac)],_0x928a4c[_0x5c7d(0xcb)],_0x928a4c[_0x5c7d(0xcc)]);},[enableLogging,_0x249645]),_0x3f8721=(0x0,_react[_0x5c7d(0x8c)])(_0x26e8e5=>{const _0x115fe9={'qxjwU':function(_0x15ed08,_0x410e41){return _0x3dcd1e[_0x5c7d(0xc4)](_0x15ed08,_0x410e41);},'ssvNU':function(_0x2806a8,_0x1d666d){return _0x2806a8(_0x1d666d);},'psMgA':_0x3dcd1e[_0x5c7d(0xcd)],'viqmy':_0x3dcd1e[_0x5c7d(0x73)],'ekZfi':_0x3dcd1e['CcIoV'],'CZFDu':_0x5c7d(0x1b),'yNsbv':_0x3dcd1e[_0x5c7d(0xce)],'qPIpg':function(_0x428b9c,_0x464916){return _0x3dcd1e[_0x5c7d(0x54)](_0x428b9c,_0x464916);}};enableLogging&&console[_0x5c7d(0x5f)](_0x3dcd1e['VJPox'],_0x26e8e5);_0x3dcd1e['hQtlK'](_0x4ed11f,![]);if(_0x1ed6d){if(_0x3dcd1e['FibpH']===_0x3dcd1e['FibpH'])_0x1ed6d(_0x26e8e5);else{_0x115fe9[_0x5c7d(0xcf)](_0xec0c4d,![]),_0x115fe9['ssvNU'](_0x36f663,_0x2c184f);if(_0x17631c){const _0xb96e87=_0x115fe9[_0x5c7d(0xd0)]['split']('|');let _0x66be77=0x0;while(!![]){switch(_0xb96e87[_0x66be77++]){case'0':_0x373a21[_0x5c7d(0x5f)](_0x5c7d(0x1a));continue;case'1':_0x256122[_0x5c7d(0x5f)](_0x115fe9[_0x5c7d(0xd1)]);continue;case'2':_0x46529e[_0x5c7d(0x5f)](_0x115fe9[_0x5c7d(0xd2)]);continue;case'3':_0x34f740[_0x5c7d(0xd3)]();continue;case'4':_0x492406[_0x5c7d(0x5f)](_0x115fe9[_0x5c7d(0xd4)]);continue;case'5':_0x67e405[_0x5c7d(0x5f)](_0x115fe9['yNsbv']);continue;case'6':_0x13f4dd[_0x5c7d(0x71)]('🔧\x20API\x20Key\x20Troubleshooting\x20Guide');continue;}break;}}_0x1ece62&&_0x115fe9['qPIpg'](_0x1ac02f,_0x5c7d(0x75)+_0x62be67);}}},[enableLogging,_0x1ed6d]);if(_0x3dcd1e[_0x5c7d(0xd5)](_0x42ca34,!_0x2ebf60)){if(_0x3dcd1e['IkCJr'](_0x3dcd1e[_0x5c7d(0xd6)],_0x3dcd1e[_0x5c7d(0xd6)]))_0x3dcd1e[_0x5c7d(0xd7)](_0x48554e,![]);else return _react[_0x5c7d(0x24)][_0x5c7d(0x58)](_reactNative['View'],{'style':styles[_0x5c7d(0xb1)]},_react[_0x5c7d(0x24)][_0x5c7d(0x58)](_reactNative[_0x5c7d(0x59)],{'style':[styles[_0x5c7d(0xd8)],{'backgroundColor':_0x3dcd1e['EIFDT']}],'onPress':()=>{const _0x5d1be2={'WFhpm':_0x5c7d(0x9e)};_0x3dcd1e['VqdDF'](_0x3dcd1e['NfLHr'],_0x5c7d(0x43))?_reactNative['Alert'][_0x5c7d(0x93)](_0x3dcd1e[_0x5c7d(0x8d)],_0x5c7d(0xb3)+_0x42ca34+_0x5c7d(0xb4),[{'text':'OK'}]):_0x3930c4[_0x5c7d(0xd9)]['alert'](_0x5d1be2[_0x5c7d(0xda)],_0x5c7d(0xb3)+_0x57406c+'\x0a\x0aPlease\x20check\x20your\x20API\x20key\x20and\x20try\x20again.',[{'text':'OK'}]);}},_react[_0x5c7d(0x24)][_0x5c7d(0x58)](_reactNative[_0x5c7d(0x5c)],{'style':styles[_0x5c7d(0xb5)]},_0x3dcd1e[_0x5c7d(0x8e)])));}if(_0x3dcd1e[_0x5c7d(0xdb)](_0x2ebf60,!_0x49f317))return _react[_0x5c7d(0x24)][_0x5c7d(0x58)](_reactNative[_0x5c7d(0x56)],{'style':styles['loadingContainer']},_react[_0x5c7d(0x24)][_0x5c7d(0x58)](_reactNative[_0x5c7d(0x59)],{'style':[styles[_0x5c7d(0x5a)],{'backgroundColor':_0x3dcd1e['LVexu']}],'disabled':!![]},_react[_0x5c7d(0x24)][_0x5c7d(0x58)](_reactNative[_0x5c7d(0x5c)],{'style':styles[_0x5c7d(0xdc)]},_0x5c7d(0x13))));const _0xa6bcae=()=>{if(_0x3dcd1e[_0x5c7d(0xdd)](_0x3dcd1e[_0x5c7d(0xde)],_0x3dcd1e[_0x5c7d(0xde)])){const _0x598324={'width':buttonWidth,'height':buttonHeight,'backgroundColor':color,'borderRadius':_0x3dcd1e[_0x5c7d(0xdf)](buttonType,_0x3dcd1e[_0x5c7d(0x81)])?_0x3dcd1e[_0x5c7d(0xe0)](buttonHeight,0x2):0x8,'alignItems':_0x5c7d(0x20),'justifyContent':_0x3dcd1e[_0x5c7d(0xe1)],'flexDirection':_0x3dcd1e[_0x5c7d(0x82)],'opacity':enabled?0x1:0.6};return hasStroke&&(_0x598324[_0x5c7d(0x88)]=0x2,_0x598324['borderColor']=darkMode?_0x3dcd1e[_0x5c7d(0x83)]:_0x3dcd1e['PvcED']),_0x598324;}else _0x462ff4['log'](_0x3dcd1e[_0x5c7d(0xbe)]);},_0x2a9501=()=>{switch(buttonForm){case _0x3dcd1e[_0x5c7d(0xb9)]:return _0x5c7d(0xe2);default:return _0x3dcd1e[_0x5c7d(0xe3)];}};return _react['default']['createElement'](_react[_0x5c7d(0x24)][_0x5c7d(0xe4)],null,_react[_0x5c7d(0x24)][_0x5c7d(0x58)](_reactNative['TouchableOpacity'],{'style':_0x3dcd1e[_0x5c7d(0xe5)](_0xa6bcae),'onPress':_0x44d696,'disabled':_0x3dcd1e[_0x5c7d(0xe6)](!enabled,_0x2ebf60)||!_0x49f317,'activeOpacity':0.8},_react[_0x5c7d(0x24)]['createElement'](_reactNative[_0x5c7d(0xe7)],{'source':_assetRegistry[_0x5c7d(0xe8)][_0x5c7d(0xe9)],'style':styles[_0x5c7d(0xea)],'resizeMode':_0x5c7d(0xeb)}),_react[_0x5c7d(0x24)][_0x5c7d(0x58)](_reactNative[_0x5c7d(0x5c)],{'style':[styles[_0x5c7d(0xec)],{'color':darkMode?_0x3dcd1e[_0x5c7d(0xed)]:_0x3dcd1e[_0x5c7d(0x83)]}]},_0x2a9501())),_react[_0x5c7d(0x24)]['createElement'](_UniversalOnboarding[_0x5c7d(0xee)],{'visible':_0x2d4c31,'onClose':_0x236544,'AppName':_0x404024,'requestData':_0x3dcd1e[_0x5c7d(0xef)](_0x5498ea,{}),'returnLink':_0x42976a,'onComplete':_0x236544,'embedd':![],'debug':debug,'testMode':testMode,'preferredPlatform':_0x340e49}));}),styles=_reactNative[_0x5c7d(0xf0)]['create']({'button':{'flexDirection':_0x5c7d(0x21),'alignItems':'center','justifyContent':_0x5c7d(0x20),'paddingVertical':0xc,'paddingHorizontal':0x10,'shadowColor':_0x5c7d(0x45),'shadowOffset':{'width':0x0,'height':0x2},'shadowOpacity':0.1,'shadowRadius':0x4,'elevation':0x2},'buttonContent':{'flexDirection':_0x5c7d(0x21),'alignItems':_0x5c7d(0x20),'justifyContent':_0x5c7d(0x20)},'logo':{'width':0x18,'height':0x18,'marginRight':0x8},'buttonText':{'fontSize':0x10,'fontWeight':'600','textAlign':_0x5c7d(0x20)},'errorContainer':{'flex':0x1,'justifyContent':_0x5c7d(0x20),'alignItems':_0x5c7d(0x20)},'errorButton':{'padding':0x10,'borderRadius':0x8},'errorButtonText':{'fontSize':0x10,'fontWeight':'600','color':_0x5c7d(0x22)},'loadingContainer':{'flex':0x1,'justifyContent':_0x5c7d(0x20),'alignItems':_0x5c7d(0x20)},'loadingButton':{'padding':0x10,'borderRadius':0x8},'loadingButtonText':{'fontSize':0x10,'fontWeight':_0x5c7d(0xf1),'color':_0x5c7d(0x22)}});
|
|
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
|