@onairos/react-native 3.4.1 → 3.5.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/README.md +62 -13
- package/lib/commonjs/api/index.js +9 -145
- package/lib/commonjs/assets/animations/loaderani.json +1 -0
- package/lib/commonjs/assets/animations/persona-animation.json +1 -0
- package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
- package/lib/commonjs/assets/icons/Gmail.png +0 -0
- package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/icons/Redditicon.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/icons/chatgpt.png +0 -0
- package/lib/commonjs/assets/icons/claude.png +0 -0
- package/lib/commonjs/assets/icons/gemini.png +0 -0
- package/lib/commonjs/assets/icons/grok.png +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +3 -0
- package/lib/commonjs/assets/images/EnochE.svg +19 -0
- package/lib/commonjs/assets/images/Enochicon1.png +0 -0
- package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
- package/lib/commonjs/assets/images/Facebookicon.png +0 -0
- package/lib/commonjs/assets/images/Gmail.png +0 -0
- package/lib/commonjs/assets/images/Googlelogo.png +0 -0
- package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
- package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +20 -0
- package/lib/commonjs/assets/images/basicproficon.svg +43 -0
- package/lib/commonjs/assets/images/basicprofile.svg +3 -0
- package/lib/commonjs/assets/images/chatgpt.png +0 -0
- package/lib/commonjs/assets/images/checkmark.svg +4 -0
- package/lib/commonjs/assets/images/claude.png +0 -0
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
- package/lib/commonjs/assets/images/contenticon.svg +23 -0
- package/lib/commonjs/assets/images/gemini.png +0 -0
- package/lib/commonjs/assets/images/grok.png +0 -0
- package/lib/commonjs/assets/images/persona1.png +0 -0
- package/lib/commonjs/assets/images/persona2.png +0 -0
- package/lib/commonjs/assets/images/persona3.png +0 -0
- package/lib/commonjs/assets/images/persona4.png +0 -0
- package/lib/commonjs/assets/images/persona5.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +18 -0
- package/lib/commonjs/assets/images/x-close.svg +3 -0
- package/lib/commonjs/components/BodyText.js +9 -0
- package/lib/commonjs/components/BrandMark.js +10 -0
- package/lib/commonjs/components/CodeInput.js +9 -0
- package/lib/commonjs/components/EmailInput.js +8 -0
- package/lib/commonjs/components/GoogleButton.js +9 -0
- package/lib/commonjs/components/HeadingGroup.js +9 -0
- package/lib/commonjs/components/LLMDataInputModal.js +14 -0
- package/lib/commonjs/components/ModalHeader.js +9 -0
- package/lib/commonjs/components/ModalSheet.js +9 -0
- package/lib/commonjs/components/Onairos.js +14 -374
- package/lib/commonjs/components/OnairosButton.js +13 -309
- package/lib/commonjs/components/OnairosSignInButton.js +12 -0
- package/lib/commonjs/components/Overlay.js +13 -483
- package/lib/commonjs/components/PersonaImage.js +10 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js +12 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js +13 -0
- package/lib/commonjs/components/PinCreationScreen.js +12 -0
- package/lib/commonjs/components/PinInput.js +9 -302
- package/lib/commonjs/components/PlatformConnectorsStep.js +22 -0
- package/lib/commonjs/components/PlatformList.js +10 -137
- package/lib/commonjs/components/PlatformToggle.js +9 -0
- package/lib/commonjs/components/PrimaryButton.js +10 -0
- package/lib/commonjs/components/SignInMatchAnimation.js +9 -0
- package/lib/commonjs/components/SignInStep.js +12 -0
- package/lib/commonjs/components/UniversalOnboarding.js +29 -1702
- package/lib/commonjs/components/VerificationStep.js +11 -0
- package/lib/commonjs/components/WelcomeScreen.js +21 -0
- package/lib/commonjs/components/icons/Basicproficon.js +8 -0
- package/lib/commonjs/components/icons/Basicprofile.js +8 -0
- package/lib/commonjs/components/icons/Checkbox.js +8 -0
- package/lib/commonjs/components/icons/Checkmark.js +8 -0
- package/lib/commonjs/components/icons/Contentanalysis.js +8 -0
- package/lib/commonjs/components/icons/Contenticon.js +8 -0
- package/lib/commonjs/components/icons/EnochE.js +8 -0
- package/lib/commonjs/components/icons/Personalityicon.js +8 -0
- package/lib/commonjs/components/icons/Personalityprofile.js +8 -0
- package/lib/commonjs/components/icons/Personalitytraits.js +8 -0
- package/lib/commonjs/components/icons/Userpreferences.js +8 -0
- package/lib/commonjs/components/icons/index.js +17 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +14 -827
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +10 -74
- package/lib/commonjs/components/onboarding/PinInput.js +10 -283
- package/lib/commonjs/components/onboarding/PlatformConnector.js +11 -249
- package/lib/commonjs/config/api.js +7 -0
- package/lib/commonjs/constants/index.js +7 -83
- package/lib/commonjs/context/AuthContext.js +10 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js +9 -0
- package/lib/commonjs/hooks/useConnections.js +8 -159
- package/lib/commonjs/hooks/useCredentials.js +10 -177
- package/lib/commonjs/hooks/useUserConnections.js +10 -0
- package/lib/commonjs/index.js +35 -106
- package/lib/commonjs/services/apiClient.js +8 -0
- package/lib/commonjs/services/apiKeyService.js +9 -952
- package/lib/commonjs/services/authService.js +10 -0
- package/lib/commonjs/services/biometricPinService.js +8 -0
- package/lib/commonjs/services/chatGPTConversationExtractor.js +8 -0
- package/lib/commonjs/services/chatGPTConversationService.js +9 -0
- package/lib/commonjs/services/claudeConversationExtractor.js +8 -0
- package/lib/commonjs/services/claudeConversationService.js +9 -0
- package/lib/commonjs/services/connectedAccountsService.js +10 -0
- package/lib/commonjs/services/googleAuthService.js +11 -0
- package/lib/commonjs/services/imageCompressionService.js +7 -0
- package/lib/commonjs/services/jwtStorageService.js +7 -0
- package/lib/commonjs/services/linkedinDOMExtractor.js +7 -0
- package/lib/commonjs/services/linkedinProfileService.js +9 -0
- package/lib/commonjs/services/linkedinScrapingService.js +8 -0
- package/lib/commonjs/services/llmDataStorage.js +8 -0
- package/lib/commonjs/services/mobileTrainingService.js +8 -0
- package/lib/commonjs/services/oauthService.js +11 -390
- package/lib/commonjs/services/pinEncryptionService.js +8 -0
- package/lib/commonjs/services/pinStorageUtils.js +7 -0
- package/lib/commonjs/services/platformAuthService.js +12 -1067
- package/lib/commonjs/services/storageService.js +8 -0
- package/lib/commonjs/services/trainingApiHelpers.js +7 -0
- package/lib/commonjs/services/userConnectionsService.js +10 -0
- package/lib/commonjs/services/youtubeMigrationService.js +10 -0
- package/lib/commonjs/theme/index.js +7 -0
- package/lib/commonjs/types/ambient.d.js +1 -2
- package/lib/commonjs/types/declarations.d.js +1 -2
- package/lib/commonjs/types/index.js +1 -6
- package/lib/commonjs/types/node-fix.d.js +1 -2
- package/lib/commonjs/types/node-override.d.js +1 -2
- package/lib/commonjs/types/opacity.d.js +1 -2
- package/lib/commonjs/types.js +1 -14
- package/lib/commonjs/utils/Portal.js +8 -98
- package/lib/commonjs/utils/api.js +9 -129
- package/lib/commonjs/utils/assetRegistry.js +33 -0
- package/lib/commonjs/utils/auth.js +9 -111
- package/lib/commonjs/utils/crypto.js +8 -62
- package/lib/commonjs/utils/debugHelper.js +1 -64
- package/lib/commonjs/utils/encryption.js +7 -76
- package/lib/commonjs/utils/eventUtils.js +1 -0
- package/lib/commonjs/utils/haptics.js +9 -0
- package/lib/commonjs/utils/imagePreloader.js +1 -0
- package/lib/commonjs/utils/networkDiagnostics.js +8 -0
- package/lib/commonjs/utils/onairosApi.js +9 -350
- package/lib/commonjs/utils/programmaticFlow.js +9 -117
- package/lib/commonjs/utils/retryHelper.js +1 -220
- package/lib/commonjs/utils/secureStorage.js +10 -349
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/commonjs/utils/webviewScripts/claude.js +1 -0
- package/lib/commonjs/utils/webviewScripts/index.js +9 -0
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
- package/lib/module/api/index.js +1 -139
- package/lib/module/assets/animations/loaderani.json +1 -0
- package/lib/module/assets/animations/persona-animation.json +1 -0
- package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/module/assets/icons/Facebookicon.png +0 -0
- package/lib/module/assets/icons/Gmail.png +0 -0
- package/lib/module/assets/icons/Linkedinicon.png +0 -0
- package/lib/module/assets/icons/Redditicon.png +0 -0
- package/lib/module/assets/icons/YouTubeicon2.png +0 -0
- package/lib/module/assets/icons/YouTubeicon3.png +0 -0
- package/lib/module/assets/icons/chatgpt.png +0 -0
- package/lib/module/assets/icons/claude.png +0 -0
- package/lib/module/assets/icons/farcaster.png +0 -0
- package/lib/module/assets/icons/gemini.png +0 -0
- package/lib/module/assets/icons/grok.png +0 -0
- package/lib/module/assets/icons/instagram.png +0 -0
- package/lib/module/assets/icons/pinterest.png +0 -0
- package/lib/module/assets/icons/swerv_logo.png +0 -0
- package/lib/module/assets/icons/twitter.jpg +0 -0
- package/lib/module/assets/images/Checkbox.svg +3 -0
- package/lib/module/assets/images/EnochE.svg +19 -0
- package/lib/module/assets/images/Enochicon1.png +0 -0
- package/lib/module/assets/images/Face_ID_logo.png +0 -0
- package/lib/module/assets/images/Facebookicon.png +0 -0
- package/lib/module/assets/images/Gmail.png +0 -0
- package/lib/module/assets/images/Googlelogo.png +0 -0
- package/lib/module/assets/images/Linkedinicon.png +0 -0
- package/lib/module/assets/images/Onairoslogo.png +0 -0
- package/lib/module/assets/images/Personalityprofile.svg +3 -0
- package/lib/module/assets/images/Personalitytraits.svg +3 -0
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +3 -0
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +20 -0
- package/lib/module/assets/images/basicproficon.svg +43 -0
- package/lib/module/assets/images/basicprofile.svg +3 -0
- package/lib/module/assets/images/chatgpt.png +0 -0
- package/lib/module/assets/images/checkmark.svg +4 -0
- package/lib/module/assets/images/claude.png +0 -0
- package/lib/module/assets/images/contentanalysis.svg +3 -0
- package/lib/module/assets/images/contenticon.svg +23 -0
- package/lib/module/assets/images/gemini.png +0 -0
- package/lib/module/assets/images/grok.png +0 -0
- package/lib/module/assets/images/persona1.png +0 -0
- package/lib/module/assets/images/persona2.png +0 -0
- package/lib/module/assets/images/persona3.png +0 -0
- package/lib/module/assets/images/persona4.png +0 -0
- package/lib/module/assets/images/persona5.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +18 -0
- package/lib/module/assets/images/x-close.svg +3 -0
- package/lib/module/components/BodyText.js +1 -0
- package/lib/module/components/BrandMark.js +1 -0
- package/lib/module/components/CodeInput.js +1 -0
- package/lib/module/components/EmailInput.js +1 -0
- package/lib/module/components/GoogleButton.js +1 -0
- package/lib/module/components/HeadingGroup.js +1 -0
- package/lib/module/components/LLMDataInputModal.js +8 -0
- package/lib/module/components/ModalHeader.js +1 -0
- package/lib/module/components/ModalSheet.js +1 -0
- package/lib/module/components/Onairos.js +1 -367
- package/lib/module/components/OnairosButton.js +1 -302
- package/lib/module/components/OnairosSignInButton.js +1 -0
- package/lib/module/components/Overlay.js +1 -474
- package/lib/module/components/PersonaImage.js +1 -0
- package/lib/module/components/PersonaLoadingScreen.js +1 -0
- package/lib/module/components/PersonalizationConsentScreen.js +1 -0
- package/lib/module/components/PinCreationScreen.js +1 -0
- package/lib/module/components/PinInput.js +1 -293
- package/lib/module/components/PlatformConnectorsStep.js +1 -0
- package/lib/module/components/PlatformList.js +1 -129
- package/lib/module/components/PlatformToggle.js +1 -0
- package/lib/module/components/PrimaryButton.js +1 -0
- package/lib/module/components/SignInMatchAnimation.js +1 -0
- package/lib/module/components/SignInStep.js +1 -0
- package/lib/module/components/UniversalOnboarding.js +1 -1693
- package/lib/module/components/VerificationStep.js +1 -0
- package/lib/module/components/WelcomeScreen.js +1 -0
- package/lib/module/components/icons/Basicproficon.js +1 -0
- package/lib/module/components/icons/Basicprofile.js +1 -0
- package/lib/module/components/icons/Checkbox.js +1 -0
- package/lib/module/components/icons/Checkmark.js +1 -0
- package/lib/module/components/icons/Contentanalysis.js +1 -0
- package/lib/module/components/icons/Contenticon.js +1 -0
- package/lib/module/components/icons/EnochE.js +1 -0
- package/lib/module/components/icons/Personalityicon.js +1 -0
- package/lib/module/components/icons/Personalityprofile.js +1 -0
- package/lib/module/components/icons/Personalitytraits.js +1 -0
- package/lib/module/components/icons/Userpreferences.js +1 -0
- package/lib/module/components/icons/index.js +1 -0
- package/lib/module/components/onboarding/OAuthWebView.js +1 -818
- package/lib/module/components/onboarding/OnboardingHeader.js +1 -66
- package/lib/module/components/onboarding/PinInput.js +1 -274
- package/lib/module/components/onboarding/PlatformConnector.js +1 -240
- package/lib/module/config/api.js +1 -0
- package/lib/module/constants/index.js +1 -77
- package/lib/module/context/AuthContext.js +1 -0
- package/lib/module/hooks/useConnectedAccounts.js +1 -0
- package/lib/module/hooks/useConnections.js +1 -152
- package/lib/module/hooks/useCredentials.js +6 -169
- package/lib/module/hooks/useUserConnections.js +1 -0
- package/lib/module/index.js +1 -32
- package/lib/module/services/apiClient.js +1 -0
- package/lib/module/services/apiKeyService.js +1 -925
- package/lib/module/services/authService.js +1 -0
- package/lib/module/services/biometricPinService.js +1 -0
- package/lib/module/services/chatGPTConversationExtractor.js +1 -0
- package/lib/module/services/chatGPTConversationService.js +1 -0
- package/lib/module/services/claudeConversationExtractor.js +1 -0
- package/lib/module/services/claudeConversationService.js +1 -0
- package/lib/module/services/connectedAccountsService.js +1 -0
- package/lib/module/services/googleAuthService.js +1 -0
- package/lib/module/services/imageCompressionService.js +1 -0
- package/lib/module/services/jwtStorageService.js +1 -0
- package/lib/module/services/linkedinDOMExtractor.js +1 -0
- package/lib/module/services/linkedinProfileService.js +1 -0
- package/lib/module/services/linkedinScrapingService.js +1 -0
- package/lib/module/services/llmDataStorage.js +1 -0
- package/lib/module/services/mobileTrainingService.js +1 -0
- package/lib/module/services/oauthService.js +1 -380
- package/lib/module/services/pinEncryptionService.js +7 -0
- package/lib/module/services/pinStorageUtils.js +1 -0
- package/lib/module/services/platformAuthService.js +1 -1041
- package/lib/module/services/storageService.js +1 -0
- package/lib/module/services/trainingApiHelpers.js +1 -0
- package/lib/module/services/userConnectionsService.js +1 -0
- package/lib/module/services/youtubeMigrationService.js +1 -0
- package/lib/module/theme/index.js +1 -0
- package/lib/module/types.js +1 -10
- package/lib/module/utils/Portal.js +1 -90
- package/lib/module/utils/api.js +1 -117
- package/lib/module/utils/assetRegistry.js +33 -0
- package/lib/module/utils/auth.js +1 -99
- package/lib/module/utils/crypto.js +1 -54
- package/lib/module/utils/debugHelper.js +1 -54
- package/lib/module/utils/encryption.js +1 -67
- package/lib/module/utils/eventUtils.js +1 -0
- package/lib/module/utils/haptics.js +8 -0
- package/lib/module/utils/imagePreloader.js +1 -0
- package/lib/module/utils/networkDiagnostics.js +1 -0
- package/lib/module/utils/onairosApi.js +1 -333
- package/lib/module/utils/programmaticFlow.js +1 -111
- package/lib/module/utils/retryHelper.js +1 -211
- package/lib/module/utils/secureStorage.js +6 -330
- package/lib/module/utils/webviewScripts/chatgpt.js +1 -0
- package/lib/module/utils/webviewScripts/claude.js +1 -0
- package/lib/module/utils/webviewScripts/index.js +1 -0
- package/lib/module/utils/webviewScripts/linkedin.js +1 -0
- package/package.json +62 -39
- package/lib/commonjs/api/index.js.map +0 -1
- package/lib/commonjs/assets/images/email.png +0 -0
- package/lib/commonjs/assets/images/linkedin.png +0 -0
- package/lib/commonjs/assets/images/reddit.png +0 -0
- package/lib/commonjs/assets/images/youtube.png +0 -0
- package/lib/commonjs/components/DataRequestModal.js +0 -228
- package/lib/commonjs/components/DataRequestModal.js.map +0 -1
- package/lib/commonjs/components/DataRequestScreen.js +0 -329
- package/lib/commonjs/components/DataRequestScreen.js.map +0 -1
- package/lib/commonjs/components/EmailVerificationModal.js +0 -320
- package/lib/commonjs/components/EmailVerificationModal.js.map +0 -1
- package/lib/commonjs/components/Onairos.js.map +0 -1
- package/lib/commonjs/components/OnairosButton.js.map +0 -1
- package/lib/commonjs/components/Overlay.js.map +0 -1
- package/lib/commonjs/components/PinInput.js.map +0 -1
- package/lib/commonjs/components/PlatformList.js.map +0 -1
- package/lib/commonjs/components/TrainingModal.js +0 -717
- package/lib/commonjs/components/TrainingModal.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.js.map +0 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/commonjs/components/onboarding/PinInput.js.map +0 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/commonjs/components/screens/ConnectorScreen.js +0 -146
- package/lib/commonjs/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/commonjs/components/screens/LoadingScreen.js +0 -91
- package/lib/commonjs/components/screens/LoadingScreen.js.map +0 -1
- package/lib/commonjs/components/screens/PinCreationScreen.js +0 -61
- package/lib/commonjs/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/commonjs/constants/index.js.map +0 -1
- package/lib/commonjs/hooks/useConnections.js.map +0 -1
- package/lib/commonjs/hooks/useCredentials.js.map +0 -1
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/services/apiKeyService.js.map +0 -1
- package/lib/commonjs/services/oauthService.js.map +0 -1
- package/lib/commonjs/services/platformAuthService.js.map +0 -1
- package/lib/commonjs/types/ambient.d.js.map +0 -1
- package/lib/commonjs/types/declarations.d.js.map +0 -1
- package/lib/commonjs/types/index.d.js.map +0 -1
- package/lib/commonjs/types/index.js.map +0 -1
- package/lib/commonjs/types/node-fix.d.js.map +0 -1
- package/lib/commonjs/types/node-override.d.js.map +0 -1
- package/lib/commonjs/types/opacity.d.js.map +0 -1
- package/lib/commonjs/types/types.d.js.map +0 -1
- package/lib/commonjs/types.js.map +0 -1
- package/lib/commonjs/utils/Portal.js.map +0 -1
- package/lib/commonjs/utils/api.js.map +0 -1
- package/lib/commonjs/utils/auth.js.map +0 -1
- package/lib/commonjs/utils/crypto.js.map +0 -1
- package/lib/commonjs/utils/debugHelper.js.map +0 -1
- package/lib/commonjs/utils/encryption.js.map +0 -1
- package/lib/commonjs/utils/onairosApi.js.map +0 -1
- package/lib/commonjs/utils/programmaticFlow.js.map +0 -1
- package/lib/commonjs/utils/retryHelper.js.map +0 -1
- package/lib/commonjs/utils/secureStorage.js.map +0 -1
- package/lib/module/api/index.js.map +0 -1
- package/lib/module/assets/images/email.png +0 -0
- package/lib/module/assets/images/linkedin.png +0 -0
- package/lib/module/assets/images/reddit.png +0 -0
- package/lib/module/assets/images/youtube.png +0 -0
- package/lib/module/components/DataRequestModal.js +0 -220
- package/lib/module/components/DataRequestModal.js.map +0 -1
- package/lib/module/components/DataRequestScreen.js +0 -321
- package/lib/module/components/DataRequestScreen.js.map +0 -1
- package/lib/module/components/EmailVerificationModal.js +0 -311
- package/lib/module/components/EmailVerificationModal.js.map +0 -1
- package/lib/module/components/Onairos.js.map +0 -1
- package/lib/module/components/OnairosButton.js.map +0 -1
- package/lib/module/components/Overlay.js.map +0 -1
- package/lib/module/components/PinInput.js.map +0 -1
- package/lib/module/components/PlatformList.js.map +0 -1
- package/lib/module/components/TrainingModal.js +0 -708
- package/lib/module/components/TrainingModal.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.js.map +0 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
- package/lib/module/components/onboarding/OAuthWebView.js.map +0 -1
- package/lib/module/components/onboarding/OnboardingHeader.js.map +0 -1
- package/lib/module/components/onboarding/PinInput.js.map +0 -1
- package/lib/module/components/onboarding/PlatformConnector.js.map +0 -1
- package/lib/module/components/screens/ConnectorScreen.js +0 -138
- package/lib/module/components/screens/ConnectorScreen.js.map +0 -1
- package/lib/module/components/screens/LoadingScreen.js +0 -83
- package/lib/module/components/screens/LoadingScreen.js.map +0 -1
- package/lib/module/components/screens/PinCreationScreen.js +0 -53
- package/lib/module/components/screens/PinCreationScreen.js.map +0 -1
- package/lib/module/constants/index.js.map +0 -1
- package/lib/module/hooks/useConnections.js.map +0 -1
- package/lib/module/hooks/useCredentials.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/services/apiKeyService.js.map +0 -1
- package/lib/module/services/oauthService.js.map +0 -1
- package/lib/module/services/platformAuthService.js.map +0 -1
- package/lib/module/types/ambient.d.js.map +0 -1
- package/lib/module/types/declarations.d.js.map +0 -1
- package/lib/module/types/index.d.js.map +0 -1
- package/lib/module/types/index.js.map +0 -1
- package/lib/module/types/node-fix.d.js.map +0 -1
- package/lib/module/types/node-override.d.js.map +0 -1
- package/lib/module/types/opacity.d.js.map +0 -1
- package/lib/module/types/types.d.js.map +0 -1
- package/lib/module/types.js.map +0 -1
- package/lib/module/utils/Portal.js.map +0 -1
- package/lib/module/utils/api.js.map +0 -1
- package/lib/module/utils/auth.js.map +0 -1
- package/lib/module/utils/crypto.js.map +0 -1
- package/lib/module/utils/debugHelper.js.map +0 -1
- package/lib/module/utils/encryption.js.map +0 -1
- package/lib/module/utils/onairosApi.js.map +0 -1
- package/lib/module/utils/programmaticFlow.js.map +0 -1
- package/lib/module/utils/retryHelper.js.map +0 -1
- package/lib/module/utils/secureStorage.js.map +0 -1
- package/lib/typescript/api/index.d.ts +0 -8
- package/lib/typescript/api/index.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestModal.d.ts +0 -11
- package/lib/typescript/components/DataRequestModal.d.ts.map +0 -1
- package/lib/typescript/components/DataRequestScreen.d.ts +0 -11
- package/lib/typescript/components/DataRequestScreen.d.ts.map +0 -1
- package/lib/typescript/components/EmailVerificationModal.d.ts +0 -11
- package/lib/typescript/components/EmailVerificationModal.d.ts.map +0 -1
- package/lib/typescript/components/Onairos.d.ts +0 -4
- package/lib/typescript/components/Onairos.d.ts.map +0 -1
- package/lib/typescript/components/OnairosButton.d.ts +0 -12
- package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
- package/lib/typescript/components/Overlay.d.ts +0 -4
- package/lib/typescript/components/Overlay.d.ts.map +0 -1
- package/lib/typescript/components/PinInput.d.ts +0 -4
- package/lib/typescript/components/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/PlatformList.d.ts +0 -4
- package/lib/typescript/components/PlatformList.d.ts.map +0 -1
- package/lib/typescript/components/TrainingModal.d.ts +0 -4
- package/lib/typescript/components/TrainingModal.d.ts.map +0 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +0 -4
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts +0 -10
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +0 -11
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PinInput.d.ts +0 -4
- package/lib/typescript/components/onboarding/PinInput.d.ts.map +0 -1
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts +0 -13
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts.map +0 -1
- package/lib/typescript/components/screens/ConnectorScreen.d.ts +0 -9
- package/lib/typescript/components/screens/ConnectorScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/LoadingScreen.d.ts +0 -9
- package/lib/typescript/components/screens/LoadingScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/PinCreationScreen.d.ts +0 -10
- package/lib/typescript/components/screens/PinCreationScreen.d.ts.map +0 -1
- package/lib/typescript/constants/index.d.ts +0 -53
- package/lib/typescript/constants/index.d.ts.map +0 -1
- package/lib/typescript/hooks/useConnections.d.ts +0 -9
- package/lib/typescript/hooks/useConnections.d.ts.map +0 -1
- package/lib/typescript/hooks/useCredentials.d.ts +0 -9
- package/lib/typescript/hooks/useCredentials.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -18
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/services/apiKeyService.d.ts +0 -132
- package/lib/typescript/services/apiKeyService.d.ts.map +0 -1
- package/lib/typescript/services/oauthService.d.ts +0 -50
- package/lib/typescript/services/oauthService.d.ts.map +0 -1
- package/lib/typescript/services/platformAuthService.d.ts +0 -144
- package/lib/typescript/services/platformAuthService.d.ts.map +0 -1
- package/lib/typescript/types/index.d.ts +0 -231
- package/lib/typescript/types/index.d.ts.map +0 -1
- package/lib/typescript/types.d.ts +0 -270
- package/lib/typescript/types.d.ts.map +0 -1
- package/lib/typescript/utils/Portal.d.ts +0 -14
- package/lib/typescript/utils/Portal.d.ts.map +0 -1
- package/lib/typescript/utils/api.d.ts +0 -6
- package/lib/typescript/utils/api.d.ts.map +0 -1
- package/lib/typescript/utils/auth.d.ts +0 -6
- package/lib/typescript/utils/auth.d.ts.map +0 -1
- package/lib/typescript/utils/crypto.d.ts +0 -4
- package/lib/typescript/utils/crypto.d.ts.map +0 -1
- package/lib/typescript/utils/debugHelper.d.ts +0 -29
- package/lib/typescript/utils/debugHelper.d.ts.map +0 -1
- package/lib/typescript/utils/encryption.d.ts +0 -19
- package/lib/typescript/utils/encryption.d.ts.map +0 -1
- package/lib/typescript/utils/onairosApi.d.ts +0 -87
- package/lib/typescript/utils/onairosApi.d.ts.map +0 -1
- package/lib/typescript/utils/programmaticFlow.d.ts +0 -23
- package/lib/typescript/utils/programmaticFlow.d.ts.map +0 -1
- package/lib/typescript/utils/retryHelper.d.ts +0 -69
- package/lib/typescript/utils/retryHelper.d.ts.map +0 -1
- package/lib/typescript/utils/secureStorage.d.ts +0 -94
- package/lib/typescript/utils/secureStorage.d.ts.map +0 -1
- package/src/api/index.ts +0 -111
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/onairos_logo.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/DataRequestModal.tsx +0 -227
- package/src/components/DataRequestScreen.tsx +0 -356
- package/src/components/EmailVerificationModal.tsx +0 -364
- package/src/components/Onairos.tsx +0 -425
- package/src/components/OnairosButton.tsx +0 -359
- package/src/components/Overlay.tsx +0 -506
- package/src/components/PinInput.tsx +0 -343
- package/src/components/PlatformList.tsx +0 -145
- package/src/components/TrainingModal.tsx +0 -737
- package/src/components/UniversalOnboarding.tsx +0 -1839
- package/src/components/UniversalOnboarding.tsx.new +0 -455
- package/src/components/onboarding/OAuthWebView.tsx +0 -838
- package/src/components/onboarding/OnboardingHeader.tsx +0 -70
- package/src/components/onboarding/PinInput.tsx +0 -356
- package/src/components/onboarding/PlatformConnector.tsx +0 -302
- package/src/components/screens/ConnectorScreen.tsx +0 -153
- package/src/components/screens/LoadingScreen.tsx +0 -100
- package/src/components/screens/PinCreationScreen.tsx +0 -67
- package/src/constants/index.ts +0 -83
- package/src/hooks/useConnections.ts +0 -163
- package/src/hooks/useCredentials.ts +0 -175
- package/src/index.js +0 -14
- package/src/index.ts +0 -50
- package/src/services/SDK_API_KEY_VALIDATION.md +0 -421
- package/src/services/apiKeyService.ts +0 -984
- package/src/services/oauthService.ts +0 -412
- package/src/services/platformAuthService.ts +0 -1113
- package/src/types/ambient.d.ts +0 -29
- package/src/types/declarations.d.ts +0 -26
- package/src/types/index.d.ts +0 -274
- package/src/types/index.ts +0 -244
- package/src/types/node-fix.d.ts +0 -19
- package/src/types/node-override.d.ts +0 -24
- package/src/types/opacity.d.ts +0 -16
- package/src/types/types.d.ts +0 -18
- package/src/types.ts +0 -298
- package/src/utils/Portal.tsx +0 -83
- package/src/utils/api.js +0 -112
- package/src/utils/auth.js +0 -104
- package/src/utils/crypto.js +0 -60
- package/src/utils/debugHelper.ts +0 -53
- package/src/utils/encryption.ts +0 -69
- package/src/utils/onairosApi.ts +0 -391
- package/src/utils/programmaticFlow.ts +0 -113
- package/src/utils/retryHelper.ts +0 -275
- package/src/utils/secureStorage.ts +0 -361
- package/types/index.d.ts +0 -218
- package/types/node-env.d.ts +0 -15
- /package/{src/assets/images → lib/commonjs/assets/icons}/farcaster.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/instagram.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/pinterest.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/swerv_logo.png +0 -0
- /package/{src/assets/images → lib/commonjs/assets/icons}/twitter.jpg +0 -0
|
@@ -1,302 +1 @@
|
|
|
1
|
-
import React, { useState, useCallback, forwardRef, useImperativeHandle } from 'react';
|
|
2
|
-
import { TouchableOpacity, Text, StyleSheet, View, ActivityIndicator, Image } from 'react-native';
|
|
3
|
-
import { UniversalOnboarding } from './UniversalOnboarding';
|
|
4
|
-
import { Overlay } from './Overlay';
|
|
5
|
-
import { hasCredentials, getCredentials, deleteCredentials as clearCredentials } from '../utils/secureStorage';
|
|
6
|
-
import { onairosApi } from '../api';
|
|
7
|
-
/**
|
|
8
|
-
* OnairosButton Component - A sign-in button similar to Google/Apple sign-in
|
|
9
|
-
*/
|
|
10
|
-
export const OnairosButton = /*#__PURE__*/forwardRef(({
|
|
11
|
-
AppName,
|
|
12
|
-
appIcon,
|
|
13
|
-
requestData,
|
|
14
|
-
returnLink,
|
|
15
|
-
prefillUrl,
|
|
16
|
-
buttonType = 'normal',
|
|
17
|
-
buttonWidth = 180,
|
|
18
|
-
buttonHeight = 48,
|
|
19
|
-
hasStroke = false,
|
|
20
|
-
enabled = true,
|
|
21
|
-
buttonForm = 'default',
|
|
22
|
-
auto = false,
|
|
23
|
-
onRejection,
|
|
24
|
-
onResolved,
|
|
25
|
-
preCheck,
|
|
26
|
-
color,
|
|
27
|
-
swerv = false,
|
|
28
|
-
debug = false,
|
|
29
|
-
preferredPlatform,
|
|
30
|
-
testMode = false,
|
|
31
|
-
darkMode = false
|
|
32
|
-
}, ref) => {
|
|
33
|
-
const [showOnboarding, setShowOnboarding] = useState(false);
|
|
34
|
-
const [showOverlay, setShowOverlay] = useState(false);
|
|
35
|
-
const [storedCredentials, setStoredCredentials] = useState(null);
|
|
36
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
37
|
-
const [isPressed, setIsPressed] = useState(false);
|
|
38
|
-
|
|
39
|
-
// Expose methods via ref
|
|
40
|
-
useImperativeHandle(ref, () => ({
|
|
41
|
-
trigger: async () => {
|
|
42
|
-
await handlePress();
|
|
43
|
-
},
|
|
44
|
-
reset: async () => {
|
|
45
|
-
await clearCredentials();
|
|
46
|
-
}
|
|
47
|
-
}));
|
|
48
|
-
|
|
49
|
-
// Compute button text based on buttonForm
|
|
50
|
-
const getButtonText = () => {
|
|
51
|
-
if (buttonForm === 'connect' || buttonForm === 'signup') {
|
|
52
|
-
return 'Connect with Onairos';
|
|
53
|
-
} else {
|
|
54
|
-
return 'Sign in with Onairos';
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// Calculate background color based on props and state
|
|
59
|
-
const getBackgroundColor = () => {
|
|
60
|
-
if (!enabled) {
|
|
61
|
-
return darkMode ? '#3A3A3A' : '#e0e0e0';
|
|
62
|
-
}
|
|
63
|
-
if (isPressed) {
|
|
64
|
-
return color ? typeof color === 'string' ? `${color}80` : color : darkMode ? '#32323280' : '#f5f5f580';
|
|
65
|
-
}
|
|
66
|
-
return color || (darkMode ? '#2A2A2A' : '#ffffff');
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// Calculate text color based on background luminance
|
|
70
|
-
const getTextColor = () => {
|
|
71
|
-
if (!enabled) {
|
|
72
|
-
return darkMode ? '#777777' : '#AAAAAA';
|
|
73
|
-
}
|
|
74
|
-
if (darkMode) {
|
|
75
|
-
return '#FFFFFF';
|
|
76
|
-
}
|
|
77
|
-
const bgColor = getBackgroundColor();
|
|
78
|
-
// Simple luminance check
|
|
79
|
-
return bgColor === '#ffffff' || bgColor === '#f5f5f580' || bgColor.includes('#f') ? '#000000' : '#FFFFFF';
|
|
80
|
-
};
|
|
81
|
-
const handlePress = async () => {
|
|
82
|
-
if (!enabled || isLoading) return;
|
|
83
|
-
setIsLoading(true);
|
|
84
|
-
try {
|
|
85
|
-
// If auto is enabled, make API call automatically and return result
|
|
86
|
-
if (auto) {
|
|
87
|
-
try {
|
|
88
|
-
// Check if credentials exist
|
|
89
|
-
const hasStoredCreds = await hasCredentials();
|
|
90
|
-
if (hasStoredCreds) {
|
|
91
|
-
const credentials = await getCredentials();
|
|
92
|
-
if (!credentials || !credentials.username) {
|
|
93
|
-
throw new Error('Invalid credentials');
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Call the API directly and return result
|
|
97
|
-
const result = await fetch(`https://api2.onairos.uk/api/inference`, {
|
|
98
|
-
method: 'POST',
|
|
99
|
-
headers: {
|
|
100
|
-
'Content-Type': 'application/json',
|
|
101
|
-
'Authorization': `Bearer ${credentials.userPin || ''}`
|
|
102
|
-
},
|
|
103
|
-
body: JSON.stringify({
|
|
104
|
-
username: credentials.username,
|
|
105
|
-
modelKey: credentials.userPin || '',
|
|
106
|
-
requestData: requestData || {},
|
|
107
|
-
appName: AppName
|
|
108
|
-
})
|
|
109
|
-
}).then(res => res.json());
|
|
110
|
-
if (result && result.success) {
|
|
111
|
-
if (onResolved) {
|
|
112
|
-
onResolved(result.apiUrl || 'https://api2.onairos.uk', result.token || '', result.data || {});
|
|
113
|
-
}
|
|
114
|
-
setIsLoading(false);
|
|
115
|
-
return;
|
|
116
|
-
} else {
|
|
117
|
-
throw new Error((result === null || result === void 0 ? void 0 : result.error) || 'API call failed');
|
|
118
|
-
}
|
|
119
|
-
} else {
|
|
120
|
-
// No credentials, proceed with normal flow
|
|
121
|
-
console.log('No credentials found, proceeding with normal flow');
|
|
122
|
-
}
|
|
123
|
-
} catch (automaticError) {
|
|
124
|
-
console.error('Automatic API call error:', automaticError);
|
|
125
|
-
// Fall back to normal flow on error
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if (preCheck) {
|
|
129
|
-
const shouldProceed = await preCheck();
|
|
130
|
-
if (!shouldProceed) {
|
|
131
|
-
onRejection === null || onRejection === void 0 || onRejection('Precheck validation failed');
|
|
132
|
-
setIsLoading(false);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Check if credentials exist
|
|
138
|
-
const hasStoredCreds = await hasCredentials();
|
|
139
|
-
if (hasStoredCreds) {
|
|
140
|
-
// If credentials exist, fetch them and verify
|
|
141
|
-
const credentials = await getCredentials();
|
|
142
|
-
if (!credentials || !credentials.username) {
|
|
143
|
-
// Invalid credentials, clear and start fresh
|
|
144
|
-
await clearCredentials();
|
|
145
|
-
setShowOnboarding(true);
|
|
146
|
-
setIsLoading(false);
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
try {
|
|
150
|
-
// Validate credentials with server
|
|
151
|
-
const isValid = await onairosApi.validateCredentials(credentials.username);
|
|
152
|
-
if (!isValid) {
|
|
153
|
-
// Clear invalid credentials
|
|
154
|
-
await clearCredentials();
|
|
155
|
-
setShowOnboarding(true);
|
|
156
|
-
setIsLoading(false);
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Store and display overlay with valid credentials
|
|
161
|
-
setStoredCredentials(credentials);
|
|
162
|
-
setShowOverlay(true);
|
|
163
|
-
} catch (validationError) {
|
|
164
|
-
console.warn('Validation error, proceeding to onboarding:', validationError);
|
|
165
|
-
setShowOnboarding(true);
|
|
166
|
-
}
|
|
167
|
-
} else {
|
|
168
|
-
// If no credentials, show onboarding
|
|
169
|
-
setShowOnboarding(true);
|
|
170
|
-
}
|
|
171
|
-
} catch (error) {
|
|
172
|
-
console.error('Error during button press flow:', error);
|
|
173
|
-
// Only call onRejection for actual errors, not when user cancels
|
|
174
|
-
// The onboarding component will handle user cancellation separately
|
|
175
|
-
setShowOnboarding(true);
|
|
176
|
-
} finally {
|
|
177
|
-
setIsLoading(false);
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
const handleOnboardingComplete = useCallback((apiUrl, token, data) => {
|
|
181
|
-
setShowOnboarding(false);
|
|
182
|
-
if (onResolved) {
|
|
183
|
-
onResolved(apiUrl, token, data);
|
|
184
|
-
}
|
|
185
|
-
}, [onResolved]);
|
|
186
|
-
const handleOverlayResolved = useCallback((apiUrl, token, data) => {
|
|
187
|
-
setShowOverlay(false);
|
|
188
|
-
if (onResolved) {
|
|
189
|
-
onResolved(apiUrl, token, data);
|
|
190
|
-
}
|
|
191
|
-
}, [onResolved]);
|
|
192
|
-
|
|
193
|
-
// Calculate button styles based on props
|
|
194
|
-
const buttonStyle = [styles.button, buttonType === 'pill' && styles.pillButton, hasStroke && styles.strokedButton, {
|
|
195
|
-
width: buttonWidth,
|
|
196
|
-
height: buttonHeight,
|
|
197
|
-
backgroundColor: getBackgroundColor(),
|
|
198
|
-
borderColor: darkMode ? '#555555' : '#000000'
|
|
199
|
-
}, swerv && styles.swervButton, !enabled && styles.disabledButton].filter(Boolean);
|
|
200
|
-
|
|
201
|
-
// Calculate button text color
|
|
202
|
-
const buttonTextColor = getTextColor();
|
|
203
|
-
|
|
204
|
-
// Render components
|
|
205
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
206
|
-
style: buttonStyle,
|
|
207
|
-
onPress: handlePress,
|
|
208
|
-
disabled: !enabled || isLoading,
|
|
209
|
-
accessibilityLabel: `Sign in with Onairos`,
|
|
210
|
-
onPressIn: () => setIsPressed(true),
|
|
211
|
-
onPressOut: () => setIsPressed(false)
|
|
212
|
-
}, isLoading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
213
|
-
size: "small",
|
|
214
|
-
color: buttonTextColor
|
|
215
|
-
}) : /*#__PURE__*/React.createElement(View, {
|
|
216
|
-
style: styles.buttonContent
|
|
217
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
218
|
-
source: require('../assets/images/onairos_logo.png'),
|
|
219
|
-
style: styles.logo,
|
|
220
|
-
resizeMode: "contain"
|
|
221
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
222
|
-
style: [styles.buttonText, {
|
|
223
|
-
color: buttonTextColor
|
|
224
|
-
}]
|
|
225
|
-
}, getButtonText()))), showOnboarding && /*#__PURE__*/React.createElement(UniversalOnboarding, {
|
|
226
|
-
visible: showOnboarding,
|
|
227
|
-
onClose: () => {
|
|
228
|
-
setShowOnboarding(false);
|
|
229
|
-
onRejection === null || onRejection === void 0 || onRejection('User closed onboarding');
|
|
230
|
-
},
|
|
231
|
-
AppName: AppName,
|
|
232
|
-
appIcon: appIcon,
|
|
233
|
-
requestData: requestData,
|
|
234
|
-
returnLink: returnLink || '',
|
|
235
|
-
onComplete: handleOnboardingComplete,
|
|
236
|
-
debug: debug,
|
|
237
|
-
testMode: testMode,
|
|
238
|
-
preferredPlatform: preferredPlatform
|
|
239
|
-
}), showOverlay && storedCredentials && /*#__PURE__*/React.createElement(Overlay, {
|
|
240
|
-
data: requestData || {},
|
|
241
|
-
username: storedCredentials.username,
|
|
242
|
-
modelKey: storedCredentials.userPin || '',
|
|
243
|
-
onResolved: handleOverlayResolved,
|
|
244
|
-
appName: AppName,
|
|
245
|
-
darkMode: darkMode
|
|
246
|
-
}));
|
|
247
|
-
});
|
|
248
|
-
const styles = StyleSheet.create({
|
|
249
|
-
button: {
|
|
250
|
-
flexDirection: 'row',
|
|
251
|
-
alignItems: 'center',
|
|
252
|
-
justifyContent: 'center',
|
|
253
|
-
paddingVertical: 12,
|
|
254
|
-
paddingHorizontal: 16,
|
|
255
|
-
borderRadius: 8,
|
|
256
|
-
shadowColor: '#000',
|
|
257
|
-
shadowOffset: {
|
|
258
|
-
width: 0,
|
|
259
|
-
height: 2
|
|
260
|
-
},
|
|
261
|
-
shadowOpacity: 0.1,
|
|
262
|
-
shadowRadius: 4,
|
|
263
|
-
elevation: 2
|
|
264
|
-
},
|
|
265
|
-
buttonContent: {
|
|
266
|
-
flexDirection: 'row',
|
|
267
|
-
alignItems: 'center',
|
|
268
|
-
justifyContent: 'center'
|
|
269
|
-
},
|
|
270
|
-
logo: {
|
|
271
|
-
width: 24,
|
|
272
|
-
height: 24,
|
|
273
|
-
marginRight: 8
|
|
274
|
-
},
|
|
275
|
-
pillButton: {
|
|
276
|
-
borderRadius: 24
|
|
277
|
-
},
|
|
278
|
-
strokedButton: {
|
|
279
|
-
backgroundColor: 'transparent',
|
|
280
|
-
borderWidth: 1
|
|
281
|
-
},
|
|
282
|
-
swervButton: {
|
|
283
|
-
transform: [{
|
|
284
|
-
rotate: '0deg'
|
|
285
|
-
}]
|
|
286
|
-
},
|
|
287
|
-
disabledButton: {
|
|
288
|
-
opacity: 0.6
|
|
289
|
-
},
|
|
290
|
-
buttonText: {
|
|
291
|
-
fontSize: 16,
|
|
292
|
-
fontWeight: '600',
|
|
293
|
-
textAlign: 'center'
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
// Add displayName for better debugging
|
|
298
|
-
OnairosButton.displayName = 'OnairosButton';
|
|
299
|
-
|
|
300
|
-
// Ensure the component is properly exported
|
|
301
|
-
export default OnairosButton;
|
|
302
|
-
//# sourceMappingURL=OnairosButton.js.map
|
|
1
|
+
import React,{useState,useCallback,forwardRef,useImperativeHandle,useEffect}from'react';function _0x28cb(_0x537c3a,_0x28cbb1){_0x537c3a=_0x537c3a-0x0;const _0x515170=_0x537c();let _0x270360=_0x515170[_0x537c3a];return _0x270360;}import{TouchableOpacity,Text,StyleSheet,View,ActivityIndicator,Dimensions,Image,Alert}from'react-native';import _0xdca74 from'react-native-linear-gradient';import{UniversalOnboarding}from'./UniversalOnboarding';import _0x594104 from'./WelcomeScreen';function _0x537c(){const _0x1e8e95=['get','window','normal','default','#1BA9D4','right','black','mvKDy','OtKwn','connect','Sign\x20in\x20with\x20Onairos','Sign\x20up\x20with\x20Onairos','Connect\x20Onairos','User\x20closed\x20onboarding','[OnairosButton]\x20handlePress\x20called.','Onairos\x20SDK\x20not\x20initialized.\x20Developers\x20must\x20call\x20initializeApiKey()\x20with\x20a\x20valid\x20API\x20key\x20before\x20using\x20SDK\x20components.\x20Get\x20your\x20API\x20key\x20from\x20https://dashboard.onairos.uk','❌\x20[OnairosButton]\x20SDK\x20NOT\x20INITIALIZED:','CIZCB','eyGmC','kZnXh','[OnairosButton]\x20SDK\x20initialized\x20with\x20API\x20key:','...','mVnEM','[OnairosButton]\x20handlePress:\x20Setting\x20showOnboarding\x20to\x20true.','Unknown\x20error','pbRgn','yfVDC','login','signup','[OnairosButton]\x20handleOnboardingComplete:\x20Setting\x20showOnboarding\x20to\x20false.','VoRNY','[OnairosButton]\x20handleOnboardingClose:\x20Setting\x20showOnboarding\x20to\x20false.','[OnairosButton]\x20Initializing.\x20Initial\x20showOnboarding:','[OnairosButton]\x20Rendering\x20JSX\x20with\x20props:','pill','#C7A047','#8B6914','absolute','Small','Basic\x20tier','Medium','Standard\x20tier','Premium\x20features','Large','onairosevents://auth/callback','Ojukh','log','BMCXZ','btEhT','YAEqi','resolve','[OnairosButton]\x20LogEffect:\x20showOnboarding\x20state\x20changed\x20to:','GzytK','yOWiR','RzUAe','ZpPiP','IEvrA','zwcKp','ycBkJ','QzeTB','error','KYJCr','ormnd','oOmOj','xQUPc','xgEIx','DfsWL','xxjlb','cHImZ','SGvNh','substring','wbKoR','jFOMS','yCvpK','HxyqG','yWQmP','CxwKV','cPzRr','Precheck\x20validation\x20failed','vuakH','CYrYA','message','BFWvd','sVKuB','UkAOm','wDsho','GiitO','zaObI','DEQjv','DfzkR','apiKey','YbvuW','SDK\x20Not\x20Initialized','alert','fidQF','mJoxb','GaBLb','uNEGh','HGqKy','DAIUv','VBOcn','pWJQl','createElement','Fragment','pillButton','strokedButton','swervButton','PoVtZ','GsLXW','rUgpx','DoiQr','OaYgH','CbVIu','buttonContent','onairosLogoAlt','contain','buttonText','QUFQq','axmKE','Free\x20access','OdCcu','axgfo','JBAuh','BbRap','Premium\x20tier','Full\x20personalization','iELqh','row','center','#000','hidden','transparent','-2deg'];_0x537c=function(){return _0x1e8e95;};return _0x537c();}import{isApiKeyInitialized,getApiConfig}from'../services/apiKeyService';import{BRAND_IMAGES}from'../utils/assetRegistry';const {width}=Dimensions[_0x28cb(0x0)](_0x28cb(0x1));export const OnairosButton=forwardRef(({AppName:_0x1b99f2,buttonType:buttonType=_0x28cb(0x2),buttonWidth:buttonWidth=0xb4,buttonHeight:buttonHeight=0x30,hasStroke:hasStroke=![],enabled:enabled=!![],buttonForm:buttonForm=_0x28cb(0x3),onResolved:_0x3048df,onRejection:_0xd405fc,preCheck:_0x379b2b,color:color=_0x28cb(0x4),swerv:swerv=![],darkMode:darkMode=![],returnLink:_0x4276df,preferredPlatform:_0x1ceb93,autoFetch:autoFetch=![],inferenceData:_0x21a950,textLayout:textLayout=_0x28cb(0x5),textColor:textColor=_0x28cb(0x6),proofMode:proofMode=![],webpageName:_0x2e9fa3,debug:debug=![],testMode:testMode=![],requestData:_0x398053,onPress:_0x3a6355,primaryAuthOnly:primaryAuthOnly=![],useNewWelcomeFlow:useNewWelcomeFlow=![]},_0x52d32c)=>{const _0x2979d9={'xhJtx':function(_0x34899f,_0x2cc0a6){return _0x34899f===_0x2cc0a6;},'btEhT':_0x28cb(0x7),'YAEqi':_0x28cb(0x8),'yWQmP':_0x28cb(0x9),'CxwKV':_0x28cb(0xa),'cPzRr':_0x28cb(0xb),'bDrHs':_0x28cb(0xc),'yOWiR':function(_0x26c325,_0x3c3124){return _0x26c325(_0x3c3124);},'RzUAe':function(_0x3a9f00,_0x34acc4,_0x11ef31){return _0x3a9f00(_0x34acc4,_0x11ef31);},'ZpPiP':_0x28cb(0xd),'IEvrA':_0x28cb(0xe),'zwcKp':function(_0x23eb24,_0x5aa069){return _0x23eb24||_0x5aa069;},'ycBkJ':function(_0x2236c5){return _0x2236c5();},'QzeTB':_0x28cb(0xf),'KYJCr':_0x28cb(0x10),'ormnd':function(_0x2eca63,_0x2ba6ab){return _0x2eca63===_0x2ba6ab;},'oOmOj':_0x28cb(0x11),'xgEIx':'SDK\x20Not\x20Initialized','rEyPw':_0x28cb(0x12),'DfsWL':_0x28cb(0x13),'xxjlb':_0x28cb(0x14),'cHImZ':function(_0x501842,_0x2257af){return _0x501842+_0x2257af;},'gLhCl':function(_0x256496,_0x251aa5){return _0x256496===_0x251aa5;},'vOLDj':function(_0x13bd49,_0x1a4b22){return _0x13bd49===_0x1a4b22;},'SGvNh':function(_0x4038e3,_0xe3b883){return _0x4038e3===_0xe3b883;},'wbKoR':_0x28cb(0x15),'HxyqG':_0x28cb(0x16),'podCE':'[OnairosButton]\x20Precheck\x20failed.\x20Setting\x20showOnboarding\x20to\x20false\x20(indirectly,\x20by\x20not\x20setting\x20to\x20true).','Ojukh':function(_0x5affdd,_0x12c25d){return _0x5affdd(_0x12c25d);},'sVKuB':function(_0x203f4d,_0x19d881){return _0x203f4d(_0x19d881);},'vuakH':_0x28cb(0x17),'CYrYA':function(_0x36206b,_0x367898){return _0x36206b instanceof _0x367898;},'BFWvd':_0x28cb(0x18),'DEQjv':function(_0x28dc0a,_0x398973){return _0x28dc0a+_0x398973;},'DfzkR':function(_0x2cb057,_0x418b17){return _0x2cb057===_0x418b17;},'zMBxy':function(_0x129a0c,_0x221248){return _0x129a0c===_0x221248;},'UkAOm':_0x28cb(0x19),'wDsho':_0x28cb(0x1a),'GiitO':_0x28cb(0x1b),'zaObI':_0x28cb(0x1c),'YbvuW':function(_0x3d64db,_0x431007){return _0x3d64db(_0x431007);},'mOBMV':'The\x20Onairos\x20SDK\x20requires\x20initialization\x20with\x20a\x20valid\x20API\x20key.\x0a\x0aDevelopers:\x20Please\x20call\x20initializeApiKey()\x20before\x20using\x20OnairosButton.','yWWCy':_0x28cb(0x1d),'kAxIl':function(_0x22a29b,_0x308cd6){return _0x22a29b(_0x308cd6);},'GzytK':function(_0x1bc865,_0x36d7ff,_0x398c02){return _0x1bc865(_0x36d7ff,_0x398c02);},'FqfNB':_0x28cb(0x1e),'uNEGh':function(_0x32849a,_0x564e99){return _0x32849a!==_0x564e99;},'HGqKy':'RORBz','BFqQc':_0x28cb(0x1f),'VBOcn':function(_0x28f26a,_0x3c7db2){return _0x28f26a(_0x3c7db2);},'BMCXZ':_0x28cb(0x20),'GaBLb':function(_0x414776,_0x2ba923,_0x40f226){return _0x414776(_0x2ba923,_0x40f226);},'aBjDG':function(_0x194df4,_0x500d9b,_0x46d954){return _0x194df4(_0x500d9b,_0x46d954);},'pWJQl':_0x28cb(0x21),'DoiQr':_0x28cb(0x22),'DPKHK':'#f5e7c1','PoVtZ':_0x28cb(0x23),'GsLXW':_0x28cb(0x24),'rUgpx':_0x28cb(0x25),'uTprp':function(_0x1ac9bf,_0x4d472e){return _0x1ac9bf===_0x4d472e;},'OaYgH':'small','CbVIu':'#FFFFFF','QUFQq':function(_0x74a6ac){return _0x74a6ac();},'axmKE':_0x28cb(0x26),'PJrUc':_0x28cb(0x27),'OdCcu':_0x28cb(0x28),'axgfo':_0x28cb(0x29),'JBAuh':_0x28cb(0x2a),'BbRap':_0x28cb(0x2b),'iELqh':_0x28cb(0x2c)},[_0x42da3d,_0x3f1862]=useState(![]),[_0x288f57,_0x211de8]=useState(![]),[_0x929fad,_0x3a1876]=_0x2979d9[_0x28cb(0x2d)](useState,![]);console[_0x28cb(0x2e)](_0x2979d9[_0x28cb(0x2f)],_0x929fad),_0x2979d9['GaBLb'](useEffect,()=>{if(_0x2979d9['xhJtx'](_0x2979d9[_0x28cb(0x30)],_0x2979d9[_0x28cb(0x31)]))return _0x177c47[_0x28cb(0x32)]();else console['log'](_0x28cb(0x33),_0x929fad);},[_0x929fad]),_0x2979d9[_0x28cb(0x34)](useImperativeHandle,_0x52d32c,()=>({'trigger':async()=>{return await _0x11f18b(),Promise[_0x28cb(0x32)]();},'reset':async()=>{return Promise[_0x28cb(0x32)]();}}));const _0x11f18b=async()=>{const _0x377a88={'IejuC':function(_0x29a2b9,_0x4c6c64){return _0x2979d9[_0x28cb(0x35)](_0x29a2b9,_0x4c6c64);},'xQUPc':function(_0x12c917,_0x45aa48,_0x3d96a5){return _0x2979d9[_0x28cb(0x36)](_0x12c917,_0x45aa48,_0x3d96a5);},'jFOMS':_0x2979d9[_0x28cb(0x37)]};console[_0x28cb(0x2e)](_0x2979d9[_0x28cb(0x38)]);if(_0x2979d9[_0x28cb(0x39)](!enabled,_0x42da3d))return;_0x2979d9[_0x28cb(0x35)](_0x3f1862,!![]);try{if(!_0x2979d9[_0x28cb(0x3a)](isApiKeyInitialized)){const _0x57b8c3=_0x2979d9[_0x28cb(0x3b)];console[_0x28cb(0x3c)](_0x2979d9[_0x28cb(0x3d)],_0x57b8c3);_0xd405fc?_0x2979d9[_0x28cb(0x3e)](_0x2979d9[_0x28cb(0x3f)],_0x2979d9['oOmOj'])?_0x2979d9[_0x28cb(0x35)](_0xd405fc,_0x57b8c3):(_0x17558c[_0x28cb(0x2e)](_0x28cb(0x1d)),_0x377a88['IejuC'](_0x438e86,![]),_0x2db117&&_0x377a88[_0x28cb(0x40)](_0x1eb9cc,_0x11e5a7,_0x1d4715),_0x4b90a4&&_0x2611e9()):Alert['alert'](_0x2979d9[_0x28cb(0x41)],'The\x20Onairos\x20SDK\x20requires\x20initialization\x20with\x20a\x20valid\x20API\x20key.\x0a\x0aDevelopers:\x20Please\x20call\x20initializeApiKey()\x20before\x20using\x20OnairosButton.',[{'text':'OK'}]);_0x2979d9['yOWiR'](_0x3f1862,![]);return;}const _0x5f7397=getApiConfig();if(debug){if(_0x2979d9['rEyPw']!==_0x2979d9[_0x28cb(0x42)]){var _0x2e84d8;console[_0x28cb(0x2e)](_0x2979d9[_0x28cb(0x43)],_0x2979d9[_0x28cb(0x44)](_0x2979d9['ormnd'](_0x5f7397,null)||_0x2979d9['gLhCl'](_0x5f7397,void 0x0)||_0x2979d9['vOLDj'](_0x2e84d8=_0x5f7397['apiKey'],null)||_0x2979d9[_0x28cb(0x45)](_0x2e84d8,void 0x0)?void 0x0:_0x2e84d8[_0x28cb(0x46)](0x0,0x8),_0x2979d9[_0x28cb(0x47)]));}else _0x22d029(_0x377a88[_0x28cb(0x48)]);}if(_0x379b2b){if(_0x2979d9['gLhCl'](_0x28cb(0x49),_0x2979d9[_0x28cb(0x4a)]))switch(_0x29a97d){case _0x2979d9[_0x28cb(0x4b)]:return _0x28cb(0xc);case _0x28cb(0x1b):return _0x2979d9[_0x28cb(0x4c)];case _0x28cb(0x1c):return _0x2979d9[_0x28cb(0x4d)];default:return _0x2979d9['bDrHs'];}else{const _0x164cb0=await _0x2979d9[_0x28cb(0x3a)](_0x379b2b);if(!_0x164cb0){console['log'](_0x2979d9['podCE']),_0xd405fc===null||_0xd405fc===void 0x0||_0x2979d9[_0x28cb(0x2d)](_0xd405fc,_0x28cb(0x4e)),_0x2979d9['sVKuB'](_0x3f1862,![]);return;}}}console[_0x28cb(0x2e)](_0x2979d9[_0x28cb(0x4f)]),_0x3a1876(!![]),_0x2979d9['yOWiR'](_0x3f1862,![]);}catch(_0x4de060){console['error']('[OnairosButton]\x20Error\x20in\x20handlePress:',_0x4de060),_0xd405fc===null||_0x2979d9[_0x28cb(0x3e)](_0xd405fc,void 0x0)||_0xd405fc(_0x2979d9[_0x28cb(0x50)](_0x4de060,Error)?_0x4de060[_0x28cb(0x51)]:_0x2979d9[_0x28cb(0x52)]),_0x2979d9[_0x28cb(0x53)](_0x3f1862,![]);}},_0x6e6fa0=()=>{if(_0x2979d9[_0x28cb(0x54)]!==_0x2979d9[_0x28cb(0x55)])switch(buttonForm){case'connect':return _0x2979d9['bDrHs'];case _0x2979d9[_0x28cb(0x56)]:return _0x2979d9[_0x28cb(0x4c)];case _0x2979d9[_0x28cb(0x57)]:return _0x2979d9[_0x28cb(0x4d)];default:return'Connect\x20Onairos';}else{var _0x39e796;_0x85cbe3[_0x28cb(0x2e)](_0x2979d9[_0x28cb(0x43)],_0x2979d9[_0x28cb(0x58)](_0x2979d9[_0x28cb(0x59)](_0x3aed49,null)||_0x2979d9[_0x28cb(0x45)](_0x4c2812,void 0x0)||_0x2979d9['zMBxy'](_0x39e796=_0x421522[_0x28cb(0x5a)],null)||_0x39e796===void 0x0?void 0x0:_0x39e796['substring'](0x0,0x8),_0x2979d9[_0x28cb(0x47)]));}},_0x51a924=_0x2979d9['aBjDG'](useCallback,(_0x5f79ab,_0x315408)=>{const _0xecbd04={'YUxss':_0x2979d9[_0x28cb(0x3b)],'xPlEe':function(_0x411f94,_0x415dca){return _0x2979d9[_0x28cb(0x5b)](_0x411f94,_0x415dca);},'fidQF':_0x28cb(0x5c),'mJoxb':_0x2979d9['mOBMV']};console['log'](_0x2979d9['yWWCy']),_0x2979d9['kAxIl'](_0x3a1876,![]);_0x3048df&&_0x2979d9[_0x28cb(0x34)](_0x3048df,_0x5f79ab,_0x315408);if(_0x3a6355){if(_0x2979d9['FqfNB']!==_0x2979d9['FqfNB']){const _0x14a471=_0xecbd04['YUxss'];_0x35065d['error'](_0x28cb(0x10),_0x14a471);_0x279b49?_0xecbd04['xPlEe'](_0x37ccbf,_0x14a471):Alert[_0x28cb(0x5d)](_0xecbd04[_0x28cb(0x5e)],_0xecbd04[_0x28cb(0x5f)],[{'text':'OK'}]);_0xecbd04['xPlEe'](_0x8b252e,![]);return;}else _0x2979d9['ycBkJ'](_0x3a6355);}},[_0x3048df,_0x3a6355]),_0x34e995=_0x2979d9[_0x28cb(0x60)](useCallback,()=>{_0x2979d9[_0x28cb(0x61)](_0x2979d9[_0x28cb(0x62)],_0x28cb(0x63))?(console['log'](_0x2979d9['BFqQc']),_0x2979d9[_0x28cb(0x64)](_0x3a1876,![]),_0xd405fc&&_0xd405fc(_0x2979d9[_0x28cb(0x37)])):_0x2979d9[_0x28cb(0x3a)](_0xd67ad9);},[_0xd405fc]);return console[_0x28cb(0x2e)](_0x2979d9[_0x28cb(0x65)],{'AppName':_0x1b99f2,'buttonType':buttonType,'buttonWidth':buttonWidth,'buttonHeight':buttonHeight,'hasStroke':hasStroke,'enabled':enabled,'buttonForm':buttonForm,'onResolved':_0x3048df,'onRejection':_0xd405fc,'preCheck':_0x379b2b,'color':color,'swerv':swerv,'darkMode':darkMode,'returnLink':_0x4276df,'preferredPlatform':_0x1ceb93,'autoFetch':autoFetch,'inferenceData':_0x21a950,'textLayout':textLayout,'textColor':textColor,'proofMode':proofMode,'webpageName':_0x2e9fa3,'debug':debug,'testMode':testMode,'requestData':_0x398053,'onPress':_0x3a6355,'primaryAuthOnly':primaryAuthOnly,'useNewWelcomeFlow':useNewWelcomeFlow}),React[_0x28cb(0x66)](React[_0x28cb(0x67)],null,React[_0x28cb(0x66)](View,null,React[_0x28cb(0x66)](TouchableOpacity,{'style':[styles['button'],buttonType===_0x2979d9['DoiQr']&&styles[_0x28cb(0x68)],hasStroke&&styles[_0x28cb(0x69)],{'width':buttonWidth,'height':buttonHeight},swerv&&styles[_0x28cb(0x6a)],!enabled&&styles['disabledButton']],'onPress':_0x11f18b,'disabled':!enabled||_0x42da3d,'onPressIn':()=>_0x211de8(!![]),'onPressOut':()=>_0x211de8(![])},React[_0x28cb(0x66)](_0xdca74,{'colors':[_0x2979d9['DPKHK'],_0x2979d9[_0x28cb(0x6b)],_0x2979d9[_0x28cb(0x6c)]],'start':{'x':0x0,'y':0x0},'end':{'x':0x1,'y':0x0},'style':{'position':_0x2979d9[_0x28cb(0x6d)],'left':0x0,'right':0x0,'top':0x0,'bottom':0x0,'borderRadius':_0x2979d9['uTprp'](buttonType,_0x2979d9[_0x28cb(0x6e)])?0x18:0x8}}),_0x42da3d?React[_0x28cb(0x66)](ActivityIndicator,{'size':_0x2979d9[_0x28cb(0x6f)],'color':_0x2979d9[_0x28cb(0x70)]}):React[_0x28cb(0x66)](View,{'style':styles[_0x28cb(0x71)]},React[_0x28cb(0x66)](View,{'style':styles['logoContainer']},React[_0x28cb(0x66)](Image,{'source':BRAND_IMAGES[_0x28cb(0x72)],'style':styles['logoImage'],'resizeMode':_0x28cb(0x73)})),React['createElement'](Text,{'style':[styles[_0x28cb(0x74)],{'color':_0x2979d9['CbVIu']}]},_0x2979d9[_0x28cb(0x75)](_0x6e6fa0))))),useNewWelcomeFlow?React[_0x28cb(0x66)](_0x594104,{'visible':_0x929fad,'onClose':_0x34e995,'onComplete':_0x51a924}):React[_0x28cb(0x66)](UniversalOnboarding,{'visible':_0x929fad,'onClose':_0x34e995,'AppName':_0x1b99f2,'requestData':_0x2979d9[_0x28cb(0x39)](_0x398053,{'Small':{'type':_0x2979d9[_0x28cb(0x76)],'descriptions':_0x2979d9['PJrUc'],'reward':_0x28cb(0x77)},'Medium':{'type':_0x2979d9[_0x28cb(0x78)],'descriptions':_0x2979d9[_0x28cb(0x79)],'reward':_0x2979d9[_0x28cb(0x7a)]},'Large':{'type':_0x2979d9[_0x28cb(0x7b)],'descriptions':_0x28cb(0x7c),'reward':_0x28cb(0x7d)}}),'returnLink':_0x2979d9[_0x28cb(0x39)](_0x4276df,_0x2979d9[_0x28cb(0x7e)]),'onComplete':_0x51a924,'debug':debug,'test':testMode,'preferredPlatform':_0x1ceb93,'primaryAuthOnly':primaryAuthOnly}));});const styles=StyleSheet['create']({'button':{'flexDirection':_0x28cb(0x7f),'alignItems':'center','justifyContent':_0x28cb(0x80),'paddingVertical':0xc,'paddingHorizontal':0x10,'borderRadius':0x8,'shadowColor':_0x28cb(0x81),'shadowOffset':{'width':0x0,'height':0x2},'shadowOpacity':0.2,'shadowRadius':0x4,'elevation':0x3,'overflow':_0x28cb(0x82)},'buttonContent':{'flexDirection':_0x28cb(0x7f),'alignItems':_0x28cb(0x80),'justifyContent':'center'},'logoContainer':{'width':0x18,'height':0x18,'alignItems':_0x28cb(0x80),'justifyContent':_0x28cb(0x80),'marginRight':0x4},'logoText':{'color':'#C7A047','fontWeight':'bold','fontSize':0xe},'logoImage':{'width':0x14,'height':0x14},'pillButton':{'borderRadius':0x18},'strokedButton':{'backgroundColor':_0x28cb(0x83),'borderWidth':0x1},'swervButton':{'transform':[{'rotate':_0x28cb(0x84)}]},'disabledButton':{'opacity':0.6},'buttonText':{'fontSize':0x10,'fontWeight':'600','textAlign':_0x28cb(0x80)}});export default OnairosButton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React,{useState,useCallback}from'react';import{TouchableOpacity,Text,StyleSheet,View,Image}from'react-native';import AsyncStorage from'@react-native-async-storage/async-storage';import _0x128bae from'./WelcomeScreen';import{triggerHaptic,HapticType}from'../utils/haptics';import{BRAND_IMAGES}from'../utils/assetRegistry';export const OnairosSignInButton=({AppName:_0x3769a3,buttonWidth:buttonWidth=0x118,buttonHeight:buttonHeight=0x2c,color:color=_0x17b7(0x0),textColor:textColor=_0x17b7(0x1),onResolved:_0x20e479,onRejection:_0x47437d,autoFocusEmailInput:autoFocusEmailInput=!![]})=>{const _0x544bc5={'AlMPA':_0x17b7(0x2),'ltcwC':_0x17b7(0x3),'ICGXI':function(_0x229a45,_0x2befbe,_0x1ecb75){return _0x229a45(_0x2befbe,_0x1ecb75);},'KHFqA':_0x17b7(0x4),'GoXsF':function(_0x575765,_0x2a4754){return _0x575765||_0x2a4754;},'soZeZ':_0x17b7(0x5),'hVahg':_0x17b7(0x6),'EBzGz':function(_0x4783be,_0xbe4fbd){return _0x4783be===_0xbe4fbd;},'ALhAg':function(_0x2b4893,_0x398a86){return _0x2b4893(_0x398a86);},'JVzuw':_0x17b7(0x7),'nQFrD':function(_0x4f42e1,_0x1ac69c){return _0x4f42e1||_0x1ac69c;},'ILvuP':function(_0x15f383,_0x426dc2){return _0x15f383(_0x426dc2);},'pgYlz':'User\x20closed\x20welcome\x20screen','rxWcO':_0x17b7(0x8),'SWmBf':function(_0x40b128,_0x584c30){return _0x40b128(_0x584c30);},'kTpMG':function(_0x32090f,_0x5d2445){return _0x32090f(_0x5d2445);},'pJtZd':function(_0x398033,_0x51fddf){return _0x398033(_0x51fddf);},'WMjrJ':function(_0x100413,_0x3c3057,_0x2ca389){return _0x100413(_0x3c3057,_0x2ca389);},'OnsbG':function(_0x2da177,_0x34d3a8,_0x3dd07f){return _0x2da177(_0x34d3a8,_0x3dd07f);},'omUzD':'contain','BDboW':_0x17b7(0x9),'cvOjY':_0x17b7(0xa)},[_0x74eb6d,_0x3bd414]=_0x544bc5[_0x17b7(0xb)](useState,![]),[_0xfab325,_0x2802f2]=useState(''),_0x2696ee=_0x544bc5[_0x17b7(0xc)](useCallback,(_0x49d8a0,_0x2250b6)=>{const _0x118ea4={'CNeuF':_0x544bc5['KHFqA'],'ZEbIK':function(_0x2b00f0,_0x3e887c){return _0x544bc5[_0x17b7(0xd)](_0x2b00f0,_0x3e887c);},'QwFNa':_0x544bc5[_0x17b7(0xe)]};console['log'](_0x544bc5[_0x17b7(0xf)],{'token':_0x49d8a0,'email':_0x2250b6});const _0xa1f079=_0x49d8a0&&_0x49d8a0[_0x17b7(0x10)]('.')&&_0x544bc5[_0x17b7(0x11)](_0x49d8a0[_0x17b7(0x12)]('.')[_0x17b7(0x13)],0x3);console[_0x17b7(0x14)](_0x17b7(0x15),_0xa1f079),_0x544bc5['ALhAg'](_0x3bd414,![]);if(_0x20e479){if(_0xa1f079)console[_0x17b7(0x14)](_0x544bc5[_0x17b7(0x16)]),AsyncStorage[_0x17b7(0x17)](_0x17b7(0x18))[_0x17b7(0x19)](_0x1923b0=>{if(_0x544bc5[_0x17b7(0x1a)]===_0x544bc5['AlMPA']){const _0x5c98b2=_0x2250b6||_0x1923b0||_0xfab325;console[_0x17b7(0x14)](_0x544bc5[_0x17b7(0x1b)],_0x5c98b2),_0x544bc5['ICGXI'](_0x20e479,_0x49d8a0,_0x5c98b2);}else{_0x5b0a61[_0x17b7(0x14)](_0x118ea4['CNeuF']);const _0x35e162=_0x118ea4[_0x17b7(0x1c)](_0x2ef1d0,_0x1a96de);_0x198e72[_0x17b7(0x14)](_0x118ea4['QwFNa'],_0x35e162),_0x57fa5a(_0xb675d4,_0x35e162);}});else{console[_0x17b7(0x14)](_0x544bc5['KHFqA']);const _0x22ce07=_0x544bc5[_0x17b7(0x1d)](_0x2250b6,_0xfab325);console[_0x17b7(0x14)](_0x544bc5[_0x17b7(0xe)],_0x22ce07),_0x544bc5[_0x17b7(0x1e)](_0x20e479,_0x49d8a0,_0x22ce07);}}},[_0x20e479,_0xfab325]),_0x63b773=_0x544bc5[_0x17b7(0x1f)](useCallback,()=>{_0x3bd414(![]),_0x47437d&&_0x544bc5[_0x17b7(0x20)](_0x47437d,_0x544bc5[_0x17b7(0x21)]);},[_0x47437d]);return React['createElement'](View,{'style':styles['container']},React[_0x17b7(0x22)](TouchableOpacity,{'style':[styles[_0x17b7(0x23)],{'width':buttonWidth,'height':buttonHeight,'backgroundColor':color}],'onPress':()=>{console[_0x17b7(0x14)](_0x544bc5['rxWcO']),_0x544bc5['SWmBf'](triggerHaptic,HapticType[_0x17b7(0x24)]),_0x544bc5['kTpMG'](_0x3bd414,!![]),console[_0x17b7(0x14)]('🔘\x20showWelcomeScreen\x20state\x20set\x20to\x20true');},'activeOpacity':0.85},React['createElement'](View,{'style':styles['contentRow']},React['createElement'](Image,{'source':BRAND_IMAGES[_0x17b7(0x25)],'style':styles['logo'],'resizeMode':_0x544bc5[_0x17b7(0x26)],'accessibilityLabel':_0x544bc5[_0x17b7(0x27)]}),React[_0x17b7(0x22)](Text,{'style':[styles[_0x17b7(0x28)],{'color':textColor}]},_0x544bc5[_0x17b7(0x29)]))),React[_0x17b7(0x22)](_0x128bae,{'visible':_0x74eb6d,'onClose':_0x63b773,'onComplete':_0x2696ee}));};const styles=StyleSheet[_0x17b7(0x2a)]({'button':{'borderRadius':0x18,'justifyContent':_0x17b7(0x2b),'alignItems':_0x17b7(0x2b),'shadowColor':'#000','shadowOffset':{'width':0x0,'height':0x2},'shadowOpacity':0.1,'shadowRadius':0x4,'elevation':0x2,'marginVertical':0x8},'contentRow':{'flexDirection':_0x17b7(0x2c),'alignItems':_0x17b7(0x2b),'justifyContent':_0x17b7(0x2b)},'logo':{'width':0x1a,'height':0x1a,'marginRight':0xa},'buttonText':{'fontSize':0x10,'fontWeight':_0x17b7(0x2d),'textAlign':_0x17b7(0x2b)},'container':{}});function _0x17b7(_0x2bcc83,_0x17b789){_0x2bcc83=_0x2bcc83-0x0;const _0x5c8bd2=_0x2bcc();let _0x3510a2=_0x5c8bd2[_0x2bcc83];return _0x3510a2;}function _0x2bcc(){const _0x33754a=['#D4A536','#000','mxrOj','🔑\x20OnairosSignInButton:\x20Returning\x20JWT\x20token\x20with\x20email:','🔑\x20Received\x20placeholder\x20token\x20from\x20WelcomeScreen,\x20completing\x20sign-in','🔑\x20OnairosSignInButton:\x20Returning\x20token\x20with\x20email:','🔍\x20OnairosSignInButton:\x20handleWelcomeComplete\x20called\x20with:','🔑\x20Received\x20JWT\x20token\x20from\x20WelcomeScreen,\x20completing\x20sign-in','🔘\x20OnairosSignInButton\x20pressed,\x20showing\x20WelcomeScreen','Onairos\x20logo','Sign\x20in\x20with\x20Onairos','pJtZd','WMjrJ','GoXsF','soZeZ','hVahg','includes','EBzGz','split','length','log','🔍\x20OnairosSignInButton:\x20Is\x20JWT\x20token?','JVzuw','getItem','user_email','then','AlMPA','ltcwC','ZEbIK','nQFrD','ICGXI','OnsbG','ILvuP','pgYlz','createElement','button','BUTTON_PRESS','onairosLogoAlt','omUzD','BDboW','buttonText','cvOjY','create','center','row','600'];_0x2bcc=function(){return _0x33754a;};return _0x2bcc();}
|