@onairos/react-native 3.4.1 → 3.6.0
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 +423 -374
- 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/OnairosNewLogo.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 +23 -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 +30 -1702
- package/lib/commonjs/components/VerificationStep.js +11 -0
- package/lib/commonjs/components/WelcomeScreen.js +22 -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 +18 -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 +34 -106
- package/lib/commonjs/services/SDK_API_KEY_VALIDATION.md +421 -421
- 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/hingeDataExtractor.js +8 -0
- package/lib/commonjs/services/hingeDataService.js +9 -0
- package/lib/commonjs/services/imageCompressionService.js +7 -0
- package/lib/commonjs/services/instagramDataExtractor.js +8 -0
- package/lib/commonjs/services/instagramDataService.js +9 -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/sephoraDataExtractor.js +8 -0
- package/lib/commonjs/services/sephoraDataService.js +9 -0
- package/lib/commonjs/services/storageService.js +8 -0
- package/lib/commonjs/services/telegramDataExtractor.js +8 -0
- package/lib/commonjs/services/telegramDataService.js +11 -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/connectorTests.js +29 -0
- 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/hinge.js +1 -0
- package/lib/commonjs/utils/webviewScripts/index.js +13 -0
- package/lib/commonjs/utils/webviewScripts/instagram.js +1 -0
- package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
- package/lib/commonjs/utils/webviewScripts/sephora.js +1 -0
- package/lib/commonjs/utils/webviewScripts/telegram.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/OnairosNewLogo.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 +7 -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/SDK_API_KEY_VALIDATION.md +421 -421
- 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/hingeDataExtractor.js +1 -0
- package/lib/module/services/hingeDataService.js +1 -0
- package/lib/module/services/imageCompressionService.js +1 -0
- package/lib/module/services/instagramDataExtractor.js +1 -0
- package/lib/module/services/instagramDataService.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/sephoraDataExtractor.js +1 -0
- package/lib/module/services/sephoraDataService.js +1 -0
- package/lib/module/services/storageService.js +1 -0
- package/lib/module/services/telegramDataExtractor.js +1 -0
- package/lib/module/services/telegramDataService.js +8 -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/connectorTests.js +28 -0
- 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/hinge.js +1 -0
- package/lib/module/utils/webviewScripts/index.js +1 -0
- package/lib/module/utils/webviewScripts/instagram.js +1 -0
- package/lib/module/utils/webviewScripts/linkedin.js +1 -0
- package/lib/module/utils/webviewScripts/sephora.js +1 -0
- package/lib/module/utils/webviewScripts/telegram.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';import{TouchableOpacity,Text,StyleSheet,View,ActivityIndicator,Dimensions,Image,Alert}from'react-native';function _0x3fbe(_0xe8ce40,_0x3fbe8b){_0xe8ce40=_0xe8ce40-0x0;const _0x53e7b1=_0xe8ce();let _0x4d5aac=_0x53e7b1[_0xe8ce40];return _0x4d5aac;}import _0x318324 from'react-native-linear-gradient';import{UniversalOnboarding}from'./UniversalOnboarding';import _0x3f23a9 from'./WelcomeScreen';import{isApiKeyInitialized,getApiConfig}from'../services/apiKeyService';import{BRAND_IMAGES}from'../utils/assetRegistry';function _0xe8ce(){const _0x45db4f=['get','normal','#1BA9D4','connect','Connect\x20Onairos','signup','Sign\x20up\x20with\x20Onairos','WXUMh','[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','The\x20Onairos\x20SDK\x20requires\x20initialization\x20with\x20a\x20valid\x20API\x20key.\x0a\x0aDevelopers:\x20Please\x20call\x20initializeApiKey()\x20before\x20using\x20OnairosButton.','...','RGUJq','[OnairosButton]\x20Precheck\x20failed.\x20Setting\x20showOnboarding\x20to\x20false\x20(indirectly,\x20by\x20not\x20setting\x20to\x20true).','Precheck\x20validation\x20failed','[OnairosButton]\x20handlePress:\x20Setting\x20showOnboarding\x20to\x20true.','login','Sign\x20in\x20with\x20Onairos','iVVKz','GnVOx','zyNqW','Unknown\x20error','zBUQl','[OnairosButton]\x20handleOnboardingClose:\x20Setting\x20showOnboarding\x20to\x20false.','User\x20closed\x20onboarding','pill','#f5e7c1','#C7A047','absolute','small','contain','Small','Basic\x20tier','Standard\x20tier','Large','PvETl','log','FCiAg','traUy','pUXKq','VhkRb','[OnairosButton]\x20LogEffect:\x20showOnboarding\x20state\x20changed\x20to:','yxmUP','rQFfV','Ryyow','aMAvj','TsXgS','resolve','uGqGv','ccksx','lRoUC','ZTfto','BXGcy','YjSNq','cDGdF','KSnSj','WshHQ','error','nglbl','qrWnX','zxcIj','alert','IkgMj','kSGds','[OnairosButton]\x20SDK\x20initialized\x20with\x20API\x20key:','ZQCBQ','substring','BLSEn','WDmEF','MtqnJ','vDmOG','OeRGb','bjiGD','iDuKS','[OnairosButton]\x20Error\x20in\x20handlePress:','WSpHK','message','mYTcD','bnloq','PtgAh','UDHTB','LPCQD','RdJfC','IvVQz','zCESz','MQhzB','KWCoA','hpOJb','[OnairosButton]\x20Rendering\x20JSX\x20with\x20props:','createElement','button','luiWZ','pillButton','strokedButton','disabledButton','mXdYm','IaWnD','BisWN','HrZQJ','BQXTP','buttonContent','logoContainer','buttonText','#FFFFFF','Lfhet','UOQcx','eKypl','Free\x20access','apeHr','mzNyP','QyNBa','uURUr','NVRzj','create','row','center','#000','hidden','bold','transparent'];_0xe8ce=function(){return _0x45db4f;};return _0xe8ce();}const {width}=Dimensions[_0x3fbe(0x0)]('window');export const OnairosButton=forwardRef(({AppName:_0x52021a,buttonType:buttonType=_0x3fbe(0x1),buttonWidth:buttonWidth=0xb4,buttonHeight:buttonHeight=0x30,hasStroke:hasStroke=![],enabled:enabled=!![],buttonForm:buttonForm='default',onResolved:_0x4cda9f,onRejection:_0x574650,preCheck:_0x5cb53b,color:color=_0x3fbe(0x2),swerv:swerv=![],darkMode:darkMode=![],returnLink:_0x370afa,preferredPlatform:_0x322d7c,autoFetch:autoFetch=![],inferenceData:_0x22b91b,textLayout:textLayout='right',textColor:textColor='black',proofMode:proofMode=![],webpageName:_0x4e70f1,debug:debug=![],testMode:testMode=![],requestData:_0x493fe7,onPress:_0x4d1cb5,primaryAuthOnly:primaryAuthOnly=![],useNewWelcomeFlow:useNewWelcomeFlow=![]},_0xa9bd83)=>{const _0x1a048e={'uXbTf':_0x3fbe(0x3),'traUy':_0x3fbe(0x4),'PtgAh':_0x3fbe(0x5),'pUXKq':_0x3fbe(0x6),'VhkRb':_0x3fbe(0x7),'KSnSj':function(_0x4a6827){return _0x4a6827();},'uGqGv':function(_0x36a77b,_0x16ad2a){return _0x36a77b(_0x16ad2a);},'ccksx':'orStl','kSGds':function(_0x4228c3){return _0x4228c3();},'BXGcy':_0x3fbe(0x8),'YjSNq':function(_0x37dccb,_0x12295d){return _0x37dccb||_0x12295d;},'cDGdF':function(_0x4e3962,_0x565512){return _0x4e3962(_0x565512);},'WshHQ':_0x3fbe(0x9),'nglbl':function(_0x412a0d,_0x15c063){return _0x412a0d!==_0x15c063;},'zxcIj':'GNMuE','IkgMj':'SDK\x20Not\x20Initialized','Htwtb':_0x3fbe(0xa),'ZQCBQ':function(_0x82469c,_0x265443){return _0x82469c+_0x265443;},'luiWZ':function(_0x3cb4dc,_0x4f1be5){return _0x3cb4dc===_0x4f1be5;},'BLSEn':_0x3fbe(0xb),'WDmEF':_0x3fbe(0xc),'MtqnJ':_0x3fbe(0xd),'Ymffh':function(_0x583188,_0x1f8992){return _0x583188===_0x1f8992;},'vDmOG':function(_0x450a4a,_0x54f3a3){return _0x450a4a===_0x54f3a3;},'iDuKS':function(_0x2cc601,_0x34aff2){return _0x2cc601(_0x34aff2);},'OeRGb':_0x3fbe(0xe),'bjiGD':_0x3fbe(0xf),'WSpHK':function(_0xd8d8,_0x489103){return _0xd8d8 instanceof _0x489103;},'mYTcD':_0x3fbe(0x10),'bnloq':_0x3fbe(0x11),'PvETl':function(_0x223a6d,_0x18bd52){return _0x223a6d(_0x18bd52);},'UDHTB':function(_0x522ecc,_0x5f58a1){return _0x522ecc!==_0x5f58a1;},'PwRQx':_0x3fbe(0x12),'LPCQD':'[OnairosButton]\x20handleOnboardingComplete:\x20Setting\x20showOnboarding\x20to\x20false.','RdJfC':function(_0x42ca61,_0x206dae){return _0x42ca61(_0x206dae);},'IvVQz':_0x3fbe(0x13),'fABVC':_0x3fbe(0x14),'lTGKC':_0x3fbe(0x15),'zCESz':_0x3fbe(0x16),'MQhzB':_0x3fbe(0x17),'KWCoA':function(_0x438c0a,_0x5fddb3){return _0x438c0a(_0x5fddb3);},'hpOJb':_0x3fbe(0x18),'XTIGk':'[OnairosButton]\x20Initializing.\x20Initial\x20showOnboarding:','FCiAg':function(_0x160bc0,_0x17d998,_0x14ae8c){return _0x160bc0(_0x17d998,_0x14ae8c);},'TsXgS':function(_0xed062,_0x50cb80,_0x1368c6){return _0xed062(_0x50cb80,_0x1368c6);},'HrZQJ':_0x3fbe(0x19),'mXdYm':_0x3fbe(0x1a),'IaWnD':_0x3fbe(0x1b),'BisWN':'#8B6914','oDUSM':_0x3fbe(0x1c),'UMsEN':function(_0x397cbb,_0x390e48){return _0x397cbb===_0x390e48;},'BQXTP':_0x3fbe(0x1d),'pbqGj':_0x3fbe(0x1e),'Lfhet':function(_0x311ee4){return _0x311ee4();},'UOQcx':_0x3fbe(0x1f),'eKypl':_0x3fbe(0x20),'apeHr':'Medium','mzNyP':_0x3fbe(0x21),'QyNBa':'Premium\x20features','uURUr':_0x3fbe(0x22),'wkQjF':'Premium\x20tier','NVRzj':'onairosevents://auth/callback'},[_0x3eb3f0,_0x2313f]=_0x1a048e['KWCoA'](useState,![]),[_0xe52ca1,_0x3ef3a5]=useState(![]),[_0xb0a8cb,_0xc827bf]=_0x1a048e[_0x3fbe(0x23)](useState,![]);console[_0x3fbe(0x24)](_0x1a048e['XTIGk'],_0xb0a8cb),_0x1a048e[_0x3fbe(0x25)](useEffect,()=>{const _0x5494e6={'yxmUP':_0x1a048e['uXbTf'],'rQFfV':_0x1a048e[_0x3fbe(0x26)],'Ryyow':_0x1a048e['PtgAh'],'aMAvj':_0x1a048e[_0x3fbe(0x27)]};if(_0x1a048e[_0x3fbe(0x28)]===_0x1a048e['VhkRb'])console['log'](_0x3fbe(0x29),_0xb0a8cb);else switch(_0x238e3d){case _0x5494e6[_0x3fbe(0x2a)]:return _0x5494e6[_0x3fbe(0x2b)];case _0x3fbe(0x10):return _0x3fbe(0x11);case _0x5494e6[_0x3fbe(0x2c)]:return _0x5494e6[_0x3fbe(0x2d)];default:return _0x5494e6[_0x3fbe(0x2b)];}},[_0xb0a8cb]),_0x1a048e[_0x3fbe(0x2e)](useImperativeHandle,_0xa9bd83,()=>({'trigger':async()=>{return await _0x1a048e['KSnSj'](_0x4690e8),Promise[_0x3fbe(0x2f)]();},'reset':async()=>{const _0x4c8129={'lRoUC':function(_0x2108de,_0x1d8808){return _0x1a048e[_0x3fbe(0x30)](_0x2108de,_0x1d8808);},'ZTfto':_0x3fbe(0x18)};if(_0x1a048e[_0x3fbe(0x31)]===_0x1a048e['ccksx'])return Promise[_0x3fbe(0x2f)]();else _0x4c8129[_0x3fbe(0x32)](_0x48249c,_0x4c8129[_0x3fbe(0x33)]);}}));const _0x4690e8=async()=>{const _0xe75ad9={'TwLWp':function(_0x532b12,_0x3e6f08,_0x40bc83){return _0x532b12(_0x3e6f08,_0x40bc83);},'Pvgua':function(_0x4cc7ba){return _0x1a048e['kSGds'](_0x4cc7ba);}};console[_0x3fbe(0x24)](_0x1a048e[_0x3fbe(0x34)]);if(_0x1a048e[_0x3fbe(0x35)](!enabled,_0x3eb3f0))return;_0x1a048e[_0x3fbe(0x36)](_0x2313f,!![]);try{if(!_0x1a048e[_0x3fbe(0x37)](isApiKeyInitialized)){const _0x2556cc=_0x1a048e[_0x3fbe(0x38)];console[_0x3fbe(0x39)]('❌\x20[OnairosButton]\x20SDK\x20NOT\x20INITIALIZED:',_0x2556cc);_0x574650?_0x1a048e[_0x3fbe(0x3a)](_0x3fbe(0x3b),_0x1a048e[_0x3fbe(0x3c)])?_0x574650(_0x2556cc):(_0x7aa50e[_0x3fbe(0x24)]('[OnairosButton]\x20handleOnboardingComplete:\x20Setting\x20showOnboarding\x20to\x20false.'),_0x1494be(![]),_0x48de43&&_0xe75ad9['TwLWp'](_0x456f87,_0x4c0f46,_0x3a3f72),_0x2f578b&&_0xe75ad9['Pvgua'](_0x4a10ba)):Alert[_0x3fbe(0x3d)](_0x1a048e[_0x3fbe(0x3e)],_0x1a048e['Htwtb'],[{'text':'OK'}]);_0x2313f(![]);return;}const _0x51ed3d=_0x1a048e[_0x3fbe(0x3f)](getApiConfig);if(debug){var _0x5572fe;console[_0x3fbe(0x24)](_0x3fbe(0x40),_0x1a048e[_0x3fbe(0x41)](_0x51ed3d===null||_0x1a048e['luiWZ'](_0x51ed3d,void 0x0)||(_0x5572fe=_0x51ed3d['apiKey'])===null||_0x5572fe===void 0x0?void 0x0:_0x5572fe[_0x3fbe(0x42)](0x0,0x8),_0x1a048e[_0x3fbe(0x43)]));}if(_0x5cb53b){if(_0x1a048e[_0x3fbe(0x3a)](_0x1a048e[_0x3fbe(0x44)],_0x1a048e['WDmEF']))return _0x1e31f9[_0x3fbe(0x2f)]();else{const _0x10be16=await _0x5cb53b();if(!_0x10be16){console['log'](_0x1a048e[_0x3fbe(0x45)]),_0x1a048e['Ymffh'](_0x574650,null)||_0x1a048e[_0x3fbe(0x46)](_0x574650,void 0x0)||_0x1a048e['iDuKS'](_0x574650,_0x1a048e[_0x3fbe(0x47)]),_0x1a048e[_0x3fbe(0x30)](_0x2313f,![]);return;}}}console[_0x3fbe(0x24)](_0x1a048e[_0x3fbe(0x48)]),_0xc827bf(!![]),_0x1a048e[_0x3fbe(0x49)](_0x2313f,![]);}catch(_0x16dd29){console[_0x3fbe(0x39)](_0x3fbe(0x4a),_0x16dd29),_0x574650===null||_0x574650===void 0x0||_0x574650(_0x1a048e[_0x3fbe(0x4b)](_0x16dd29,Error)?_0x16dd29[_0x3fbe(0x4c)]:_0x3fbe(0x15)),_0x1a048e[_0x3fbe(0x30)](_0x2313f,![]);}},_0x97c0ca=()=>{switch(buttonForm){case _0x1a048e['uXbTf']:return _0x1a048e[_0x3fbe(0x26)];case _0x1a048e[_0x3fbe(0x4d)]:return _0x1a048e[_0x3fbe(0x4e)];case _0x1a048e[_0x3fbe(0x4f)]:return _0x1a048e[_0x3fbe(0x27)];default:return _0x3fbe(0x4);}},_0x4105a8=_0x1a048e['FCiAg'](useCallback,(_0x1970aa,_0x50b972)=>{_0x1a048e[_0x3fbe(0x50)](_0x1a048e['PwRQx'],_0x1a048e['PwRQx'])?_0x1a048e['PvETl'](_0x2bfa59,_0x5ef45a):(console[_0x3fbe(0x24)](_0x1a048e[_0x3fbe(0x51)]),_0x1a048e[_0x3fbe(0x52)](_0xc827bf,![]),_0x4cda9f&&_0x4cda9f(_0x1970aa,_0x50b972),_0x4d1cb5&&(_0x1a048e[_0x3fbe(0x53)]===_0x1a048e['fABVC']?_0x2b04f4():_0x4d1cb5()));},[_0x4cda9f,_0x4d1cb5]),_0xe7ee29=_0x1a048e[_0x3fbe(0x25)](useCallback,()=>{_0x1a048e[_0x3fbe(0x54)]!=='qHUKy'?(console[_0x3fbe(0x24)](_0x1a048e[_0x3fbe(0x55)]),_0x1a048e[_0x3fbe(0x56)](_0xc827bf,![]),_0x574650&&_0x574650(_0x1a048e[_0x3fbe(0x57)])):(_0x5dfb54[_0x3fbe(0x39)](_0x3fbe(0x4a),_0x368bfd),_0x1a048e[_0x3fbe(0x46)](_0x35f161,null)||_0x1c538a===void 0x0||_0x1a048e[_0x3fbe(0x49)](_0x43c09c,_0x1a048e[_0x3fbe(0x4b)](_0x2e3cb7,_0x271e71)?_0x2d4aee['message']:_0x1a048e['lTGKC']),_0x1a048e['iDuKS'](_0x4a7dbb,![]));},[_0x574650]);return console[_0x3fbe(0x24)](_0x3fbe(0x58),{'AppName':_0x52021a,'buttonType':buttonType,'buttonWidth':buttonWidth,'buttonHeight':buttonHeight,'hasStroke':hasStroke,'enabled':enabled,'buttonForm':buttonForm,'onResolved':_0x4cda9f,'onRejection':_0x574650,'preCheck':_0x5cb53b,'color':color,'swerv':swerv,'darkMode':darkMode,'returnLink':_0x370afa,'preferredPlatform':_0x322d7c,'autoFetch':autoFetch,'inferenceData':_0x22b91b,'textLayout':textLayout,'textColor':textColor,'proofMode':proofMode,'webpageName':_0x4e70f1,'debug':debug,'testMode':testMode,'requestData':_0x493fe7,'onPress':_0x4d1cb5,'primaryAuthOnly':primaryAuthOnly,'useNewWelcomeFlow':useNewWelcomeFlow}),React[_0x3fbe(0x59)](React['Fragment'],null,React[_0x3fbe(0x59)](View,null,React[_0x3fbe(0x59)](TouchableOpacity,{'style':[styles[_0x3fbe(0x5a)],_0x1a048e[_0x3fbe(0x5b)](buttonType,_0x1a048e['HrZQJ'])&&styles[_0x3fbe(0x5c)],hasStroke&&styles[_0x3fbe(0x5d)],{'width':buttonWidth,'height':buttonHeight},swerv&&styles['swervButton'],!enabled&&styles[_0x3fbe(0x5e)]],'onPress':_0x4690e8,'disabled':_0x1a048e[_0x3fbe(0x35)](!enabled,_0x3eb3f0),'onPressIn':()=>_0x3ef3a5(!![]),'onPressOut':()=>_0x3ef3a5(![])},React['createElement'](_0x318324,{'colors':[_0x1a048e[_0x3fbe(0x5f)],_0x1a048e[_0x3fbe(0x60)],_0x1a048e[_0x3fbe(0x61)]],'start':{'x':0x0,'y':0x0},'end':{'x':0x1,'y':0x0},'style':{'position':_0x1a048e['oDUSM'],'left':0x0,'right':0x0,'top':0x0,'bottom':0x0,'borderRadius':_0x1a048e['UMsEN'](buttonType,_0x1a048e[_0x3fbe(0x62)])?0x18:0x8}}),_0x3eb3f0?React[_0x3fbe(0x59)](ActivityIndicator,{'size':_0x1a048e[_0x3fbe(0x63)],'color':'#FFFFFF'}):React['createElement'](View,{'style':styles[_0x3fbe(0x64)]},React[_0x3fbe(0x59)](View,{'style':styles[_0x3fbe(0x65)]},React[_0x3fbe(0x59)](Image,{'source':BRAND_IMAGES['onairosLogoAlt'],'style':styles['logoImage'],'resizeMode':_0x1a048e['pbqGj']})),React[_0x3fbe(0x59)](Text,{'style':[styles[_0x3fbe(0x66)],{'color':_0x3fbe(0x67)}]},_0x1a048e[_0x3fbe(0x68)](_0x97c0ca))))),useNewWelcomeFlow?React[_0x3fbe(0x59)](_0x3f23a9,{'visible':_0xb0a8cb,'onClose':_0xe7ee29,'onComplete':_0x4105a8}):React['createElement'](UniversalOnboarding,{'visible':_0xb0a8cb,'onClose':_0xe7ee29,'AppName':_0x52021a,'requestData':_0x1a048e[_0x3fbe(0x35)](_0x493fe7,{'Small':{'type':_0x1a048e[_0x3fbe(0x69)],'descriptions':_0x1a048e[_0x3fbe(0x6a)],'reward':_0x3fbe(0x6b)},'Medium':{'type':_0x1a048e[_0x3fbe(0x6c)],'descriptions':_0x1a048e[_0x3fbe(0x6d)],'reward':_0x1a048e[_0x3fbe(0x6e)]},'Large':{'type':_0x1a048e[_0x3fbe(0x6f)],'descriptions':_0x1a048e['wkQjF'],'reward':'Full\x20personalization'}}),'returnLink':_0x1a048e[_0x3fbe(0x35)](_0x370afa,_0x1a048e[_0x3fbe(0x70)]),'onComplete':_0x4105a8,'debug':debug,'test':testMode,'preferredPlatform':_0x322d7c,'primaryAuthOnly':primaryAuthOnly}));});const styles=StyleSheet[_0x3fbe(0x71)]({'button':{'flexDirection':_0x3fbe(0x72),'alignItems':'center','justifyContent':_0x3fbe(0x73),'paddingVertical':0xc,'paddingHorizontal':0x10,'borderRadius':0x8,'shadowColor':_0x3fbe(0x74),'shadowOffset':{'width':0x0,'height':0x2},'shadowOpacity':0.2,'shadowRadius':0x4,'elevation':0x3,'overflow':_0x3fbe(0x75)},'buttonContent':{'flexDirection':_0x3fbe(0x72),'alignItems':_0x3fbe(0x73),'justifyContent':'center'},'logoContainer':{'width':0x18,'height':0x18,'alignItems':_0x3fbe(0x73),'justifyContent':_0x3fbe(0x73),'marginRight':0x4},'logoText':{'color':_0x3fbe(0x1b),'fontWeight':_0x3fbe(0x76),'fontSize':0xe},'logoImage':{'width':0x14,'height':0x14},'pillButton':{'borderRadius':0x18},'strokedButton':{'backgroundColor':_0x3fbe(0x77),'borderWidth':0x1},'swervButton':{'transform':[{'rotate':'-2deg'}]},'disabledButton':{'opacity':0.6},'buttonText':{'fontSize':0x10,'fontWeight':'600','textAlign':_0x3fbe(0x73)}});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 _0x514103 from'./WelcomeScreen';import{triggerHaptic,HapticType}from'../utils/haptics';import{BRAND_IMAGES}from'../utils/assetRegistry';export const OnairosSignInButton=({AppName:_0x357cf7,buttonWidth:buttonWidth=0x118,buttonHeight:buttonHeight=0x2c,color:color=_0x251d(0x0),textColor:textColor=_0x251d(0x1),onResolved:_0x1adc52,onRejection:_0x178a64,autoFocusEmailInput:autoFocusEmailInput=!![]})=>{const _0x2ac175={'IaCOI':function(_0x169e22,_0x2fbe0f){return _0x169e22||_0x2fbe0f;},'fLtEf':_0x251d(0x2),'PSPHm':_0x251d(0x3),'YZnhT':function(_0x1fadf4,_0x300be7){return _0x1fadf4===_0x300be7;},'FavlV':_0x251d(0x4),'niFzF':function(_0x1b851f,_0x13ff87){return _0x1b851f||_0x13ff87;},'HSapx':function(_0x229138,_0x201eb5,_0x347f7b){return _0x229138(_0x201eb5,_0x347f7b);},'zISgi':'🔑\x20OnairosSignInButton:\x20Returning\x20JWT\x20token\x20with\x20email:','zrkTn':_0x251d(0x5),'JJZgH':_0x251d(0x6),'faOVY':function(_0x53d512,_0x2d8529){return _0x53d512(_0x2d8529);},'qxElm':function(_0xd56c,_0x18306d){return _0xd56c!==_0x18306d;},'SktTj':_0x251d(0x7),'PGwfk':_0x251d(0x8),'hXQmy':function(_0x4e7bab,_0x31f3ca){return _0x4e7bab||_0x31f3ca;},'hjbkC':function(_0x5f590a,_0x2994b2){return _0x5f590a(_0x2994b2);},'hXkKF':_0x251d(0x9),'IqhEr':'🔘\x20showWelcomeScreen\x20state\x20set\x20to\x20true','KfwyB':function(_0x4e0b1a,_0xcea0df){return _0x4e0b1a(_0xcea0df);},'IDtnN':_0x251d(0xa)},[_0x937656,_0xa92767]=useState(![]),[_0x5105eb,_0x11c813]=_0x2ac175['KfwyB'](useState,''),_0x20ba9e=_0x2ac175[_0x251d(0xb)](useCallback,(_0x2a0bc0,_0x332491)=>{console['log'](_0x2ac175[_0x251d(0xc)],{'token':_0x2a0bc0,'email':_0x332491});const _0x48e5f5=_0x2a0bc0&&_0x2a0bc0[_0x251d(0xd)]('.')&&_0x2ac175[_0x251d(0xe)](_0x2a0bc0[_0x251d(0xf)]('.')[_0x251d(0x10)],0x3);console[_0x251d(0x11)](_0x2ac175[_0x251d(0x12)],_0x48e5f5),_0x2ac175['faOVY'](_0xa92767,![]);if(_0x1adc52){if(_0x48e5f5)console[_0x251d(0x11)]('🔑\x20Received\x20JWT\x20token\x20from\x20WelcomeScreen,\x20completing\x20sign-in'),AsyncStorage['getItem'](_0x2ac175[_0x251d(0x13)])[_0x251d(0x14)](_0x275463=>{const _0x2b303b={'TddPe':function(_0x5d9885,_0x1263b5){return _0x2ac175['IaCOI'](_0x5d9885,_0x1263b5);},'vvpGI':_0x2ac175['fLtEf'],'idzVk':_0x2ac175[_0x251d(0x13)]};if(_0x2ac175['YZnhT']('YFBKH',_0x2ac175[_0x251d(0x15)])){const _0xe75dfd=_0x2ac175[_0x251d(0x16)](_0x332491,_0x275463)||_0x5105eb;console[_0x251d(0x11)](_0x251d(0x17),_0xe75dfd),_0x2ac175['HSapx'](_0x1adc52,_0x2a0bc0,_0xe75dfd);}else{const _0x420db3={'YAlHF':function(_0x2c42e1,_0x3f8aa5){return _0x2b303b[_0x251d(0x18)](_0x2c42e1,_0x3f8aa5);}};_0x2b4aa0[_0x251d(0x11)](_0x2b303b[_0x251d(0x19)]),AsyncStorage['getItem'](_0x2b303b[_0x251d(0x1a)])[_0x251d(0x14)](_0x3ee4b7=>{const _0x5e8c55=_0x420db3[_0x251d(0x1b)](_0x3f6226,_0x3ee4b7)||_0x54c177;_0x1e9e12[_0x251d(0x11)]('🔑\x20OnairosSignInButton:\x20Returning\x20JWT\x20token\x20with\x20email:',_0x5e8c55),_0x49f843(_0x487935,_0x5e8c55);});}});else{if(_0x2ac175['qxElm'](_0x251d(0x1c),_0x2ac175['SktTj'])){console['log'](_0x2ac175[_0x251d(0x1d)]);const _0x3f4ca3=_0x2ac175['hXQmy'](_0x332491,_0x5105eb);console[_0x251d(0x11)](_0x251d(0x1e),_0x3f4ca3),_0x1adc52(_0x2a0bc0,_0x3f4ca3);}else{const _0x5d4ccf=_0x8aac5e||_0x2e4a2f||_0x2716d8;_0x4ec520[_0x251d(0x11)](_0x2ac175['zISgi'],_0x5d4ccf),_0x2ac175[_0x251d(0xb)](_0x13cf71,_0x58f9eb,_0x5d4ccf);}}}},[_0x1adc52,_0x5105eb]),_0x5223a4=_0x2ac175[_0x251d(0xb)](useCallback,()=>{_0x2ac175[_0x251d(0x1f)](_0xa92767,![]),_0x178a64&&_0x2ac175[_0x251d(0x20)](_0x178a64,_0x251d(0x21));},[_0x178a64]);return React['createElement'](View,{'style':styles['container']},React[_0x251d(0x22)](TouchableOpacity,{'style':[styles[_0x251d(0x23)],{'width':buttonWidth,'height':buttonHeight,'backgroundColor':color}],'onPress':()=>{console[_0x251d(0x11)](_0x2ac175[_0x251d(0x24)]),triggerHaptic(HapticType[_0x251d(0x25)]),_0x2ac175[_0x251d(0x20)](_0xa92767,!![]),console[_0x251d(0x11)](_0x2ac175[_0x251d(0x26)]);},'activeOpacity':0.85},React['createElement'](View,{'style':styles[_0x251d(0x27)]},React['createElement'](Image,{'source':BRAND_IMAGES[_0x251d(0x28)],'style':styles['logo'],'resizeMode':'contain','accessibilityLabel':_0x2ac175[_0x251d(0x29)]}),React[_0x251d(0x22)](Text,{'style':[styles[_0x251d(0x2a)],{'color':textColor}]},_0x251d(0x2b)))),React[_0x251d(0x22)](_0x514103,{'visible':_0x937656,'onClose':_0x5223a4,'onComplete':_0x20ba9e}));};const styles=StyleSheet['create']({'button':{'borderRadius':0x18,'justifyContent':'center','alignItems':_0x251d(0x2c),'shadowColor':'#000','shadowOffset':{'width':0x0,'height':0x2},'shadowOpacity':0.1,'shadowRadius':0x4,'elevation':0x2,'marginVertical':0x8},'contentRow':{'flexDirection':_0x251d(0x2d),'alignItems':'center','justifyContent':_0x251d(0x2c)},'logo':{'width':0x1a,'height':0x1a,'marginRight':0xa},'buttonText':{'fontSize':0x10,'fontWeight':_0x251d(0x2e),'textAlign':_0x251d(0x2c)},'container':{}});function _0x251d(_0x1e5eda,_0x251d36){_0x1e5eda=_0x1e5eda-0x0;const _0x26ee78=_0x1e5e();let _0x41abea=_0x26ee78[_0x1e5eda];return _0x41abea;}function _0x1e5e(){const _0x2e120b=['#D4A536','#000','🔑\x20Received\x20JWT\x20token\x20from\x20WelcomeScreen,\x20completing\x20sign-in','user_email','YFBKH','🔍\x20OnairosSignInButton:\x20handleWelcomeComplete\x20called\x20with:','🔍\x20OnairosSignInButton:\x20Is\x20JWT\x20token?','elyJf','🔑\x20Received\x20placeholder\x20token\x20from\x20WelcomeScreen,\x20completing\x20sign-in','🔘\x20OnairosSignInButton\x20pressed,\x20showing\x20WelcomeScreen','Onairos\x20logo','HSapx','zrkTn','includes','YZnhT','split','length','log','JJZgH','PSPHm','then','FavlV','niFzF','🔑\x20OnairosSignInButton:\x20Returning\x20JWT\x20token\x20with\x20email:','TddPe','vvpGI','idzVk','YAlHF','QNIbA','PGwfk','🔑\x20OnairosSignInButton:\x20Returning\x20token\x20with\x20email:','faOVY','hjbkC','User\x20closed\x20welcome\x20screen','createElement','button','hXkKF','BUTTON_PRESS','IqhEr','contentRow','onairosLogoAlt','IDtnN','buttonText','Sign\x20in\x20with\x20Onairos','center','row','600'];_0x1e5e=function(){return _0x2e120b;};return _0x1e5e();}
|