@onairos/react-native 3.1.17 → 3.2.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 +374 -403
- package/lib/commonjs/api/index.js +1 -75
- package/lib/commonjs/api/index.js.map +1 -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.map +1 -1
- package/lib/commonjs/components/DataRequestScreen.js.map +1 -1
- package/lib/commonjs/components/EmailVerificationModal.js.map +1 -1
- package/lib/commonjs/components/Onairos.js +3 -1
- package/lib/commonjs/components/Onairos.js.map +1 -1
- package/lib/commonjs/components/OnairosButton.js +190 -171
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/Overlay.js +5 -5
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/PinInput.js +120 -282
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/commonjs/components/PlatformList.js.map +1 -1
- package/lib/commonjs/components/TrainingModal.js +563 -808
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +1283 -2304
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +743 -134
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +1 -1
- package/lib/commonjs/components/onboarding/PinInput.js.map +1 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js.map +1 -1
- package/lib/commonjs/components/screens/ConnectorScreen.js.map +1 -1
- package/lib/commonjs/components/screens/LoadingScreen.js.map +1 -1
- package/lib/commonjs/components/screens/PinCreationScreen.js.map +1 -1
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/hooks/useConnections.js +125 -120
- package/lib/commonjs/hooks/useConnections.js.map +1 -1
- package/lib/commonjs/hooks/useCredentials.js.map +1 -1
- package/lib/commonjs/index.js +31 -193
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiKeyService.js +102 -101
- package/lib/commonjs/services/apiKeyService.js.map +1 -1
- package/lib/commonjs/services/oauthService.js.map +1 -1
- package/lib/commonjs/services/platformAuthService.js +722 -956
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/commonjs/types/ambient.d.js.map +1 -1
- package/lib/commonjs/types/declarations.d.js.map +1 -1
- package/lib/commonjs/types/index.d.js.map +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/node-fix.d.js.map +1 -1
- package/lib/commonjs/types/node-override.d.js.map +1 -1
- package/lib/commonjs/types/opacity.d.js.map +1 -1
- package/lib/commonjs/types/types.d.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/Portal.js +4 -4
- package/lib/commonjs/utils/Portal.js.map +1 -1
- package/lib/commonjs/utils/api.js +24 -24
- package/lib/commonjs/utils/api.js.map +1 -1
- package/lib/commonjs/utils/auth.js +18 -18
- package/lib/commonjs/utils/auth.js.map +1 -1
- package/lib/commonjs/utils/crypto.js +13 -13
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/debugHelper.js.map +1 -1
- package/lib/commonjs/utils/encryption.js +12 -12
- package/lib/commonjs/utils/encryption.js.map +1 -1
- package/lib/commonjs/utils/onairosApi.js.map +1 -1
- package/lib/commonjs/utils/programmaticFlow.js +16 -16
- package/lib/commonjs/utils/programmaticFlow.js.map +1 -1
- package/lib/commonjs/utils/retryHelper.js +27 -27
- package/lib/commonjs/utils/retryHelper.js.map +1 -1
- package/lib/commonjs/utils/secureStorage.js.map +1 -1
- package/lib/module/api/index.js +0 -72
- package/lib/module/api/index.js.map +1 -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.map +1 -1
- package/lib/module/components/DataRequestScreen.js.map +1 -1
- package/lib/module/components/EmailVerificationModal.js.map +1 -1
- package/lib/module/components/Onairos.js +3 -1
- package/lib/module/components/Onairos.js.map +1 -1
- package/lib/module/components/OnairosButton.js +192 -172
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/Overlay.js +5 -5
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/PinInput.js +120 -283
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/module/components/PlatformList.js.map +1 -1
- package/lib/module/components/TrainingModal.js +565 -809
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +1284 -2307
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/module/components/onboarding/OAuthWebView.js +744 -136
- package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/module/components/onboarding/OnboardingHeader.js.map +1 -1
- package/lib/module/components/onboarding/PinInput.js.map +1 -1
- package/lib/module/components/onboarding/PlatformConnector.js.map +1 -1
- package/lib/module/components/screens/ConnectorScreen.js.map +1 -1
- package/lib/module/components/screens/LoadingScreen.js.map +1 -1
- package/lib/module/components/screens/PinCreationScreen.js.map +1 -1
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/hooks/useConnections.js +125 -119
- package/lib/module/hooks/useConnections.js.map +1 -1
- package/lib/module/hooks/useCredentials.js.map +1 -1
- package/lib/module/index.js +15 -51
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/apiKeyService.js +102 -101
- package/lib/module/services/apiKeyService.js.map +1 -1
- package/lib/module/services/oauthService.js.map +1 -1
- package/lib/module/services/platformAuthService.js +704 -943
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/module/types/ambient.d.js.map +1 -1
- package/lib/module/types/declarations.d.js.map +1 -1
- package/lib/module/types/index.d.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/node-fix.d.js.map +1 -1
- package/lib/module/types/node-override.d.js.map +1 -1
- package/lib/module/types/opacity.d.js.map +1 -1
- package/lib/module/types/types.d.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/Portal.js +4 -4
- package/lib/module/utils/Portal.js.map +1 -1
- package/lib/module/utils/api.js +24 -24
- package/lib/module/utils/api.js.map +1 -1
- package/lib/module/utils/auth.js +18 -18
- package/lib/module/utils/auth.js.map +1 -1
- package/lib/module/utils/crypto.js +13 -13
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/debugHelper.js.map +1 -1
- package/lib/module/utils/encryption.js +12 -12
- package/lib/module/utils/encryption.js.map +1 -1
- package/lib/module/utils/onairosApi.js.map +1 -1
- package/lib/module/utils/programmaticFlow.js +16 -16
- package/lib/module/utils/programmaticFlow.js.map +1 -1
- package/lib/module/utils/retryHelper.js +27 -27
- package/lib/module/utils/retryHelper.js.map +1 -1
- package/lib/module/utils/secureStorage.js.map +1 -1
- package/lib/typescript/api/index.d.ts +7 -15
- package/lib/typescript/api/index.d.ts.map +1 -1
- package/lib/typescript/components/DataRequestModal.d.ts +10 -10
- package/lib/typescript/components/DataRequestScreen.d.ts +10 -10
- package/lib/typescript/components/EmailVerificationModal.d.ts +10 -10
- package/lib/typescript/components/Onairos.d.ts +3 -3
- package/lib/typescript/components/Onairos.d.ts.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts +11 -36
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/Overlay.d.ts +3 -3
- package/lib/typescript/components/PinInput.d.ts +3 -13
- package/lib/typescript/components/PinInput.d.ts.map +1 -1
- package/lib/typescript/components/PlatformList.d.ts +3 -3
- package/lib/typescript/components/TrainingModal.d.ts +3 -14
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +3 -16
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts +9 -9
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +10 -10
- package/lib/typescript/components/onboarding/PinInput.d.ts +3 -3
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts +12 -12
- package/lib/typescript/components/screens/ConnectorScreen.d.ts +8 -8
- package/lib/typescript/components/screens/LoadingScreen.d.ts +8 -8
- package/lib/typescript/components/screens/PinCreationScreen.d.ts +9 -9
- package/lib/typescript/constants/index.d.ts +52 -52
- package/lib/typescript/hooks/useConnections.d.ts +8 -13
- package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
- package/lib/typescript/hooks/useCredentials.d.ts +8 -8
- package/lib/typescript/index.d.ts +17 -35
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/services/apiKeyService.d.ts +131 -131
- package/lib/typescript/services/apiKeyService.d.ts.map +1 -1
- package/lib/typescript/services/oauthService.d.ts +49 -49
- package/lib/typescript/services/platformAuthService.d.ts +143 -68
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/lib/typescript/types/index.d.ts +225 -264
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +266 -266
- package/lib/typescript/utils/Portal.d.ts +13 -13
- package/lib/typescript/utils/api.d.ts +5 -5
- package/lib/typescript/utils/auth.d.ts +5 -5
- package/lib/typescript/utils/crypto.d.ts +3 -3
- package/lib/typescript/utils/debugHelper.d.ts +28 -28
- package/lib/typescript/utils/encryption.d.ts +18 -18
- package/lib/typescript/utils/onairosApi.d.ts +86 -86
- package/lib/typescript/utils/programmaticFlow.d.ts +22 -22
- package/lib/typescript/utils/retryHelper.d.ts +68 -68
- package/lib/typescript/utils/secureStorage.d.ts +93 -93
- package/package.json +149 -163
- package/src/api/index.ts +110 -151
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/DataRequestScreen.tsx +355 -355
- package/src/components/EmailVerificationModal.tsx +363 -363
- package/src/components/Onairos.tsx +424 -422
- package/src/components/OnairosButton.tsx +359 -339
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PinInput.tsx +343 -555
- package/src/components/PlatformList.tsx +144 -144
- package/src/components/TrainingModal.tsx +737 -1047
- package/src/components/UniversalOnboarding.tsx +1820 -2888
- package/src/components/UniversalOnboarding.tsx.new +455 -0
- package/src/components/onboarding/OAuthWebView.tsx +838 -232
- package/src/hooks/useConnections.ts +163 -161
- package/src/hooks/useCredentials.ts +174 -174
- package/src/index.js +14 -14
- package/src/index.ts +49 -94
- package/src/services/apiKeyService.ts +921 -919
- package/src/services/platformAuthService.ts +1113 -1346
- package/src/types/ambient.d.ts +28 -28
- package/src/types/index.ts +238 -265
- package/src/types/node-fix.d.ts +18 -18
- package/src/types/node-override.d.ts +23 -23
- package/src/types/opacity.d.ts +15 -15
- package/src/types/types.d.ts +17 -17
- package/src/utils/Portal.tsx +82 -82
- package/src/utils/api.js +111 -111
- package/src/utils/auth.js +103 -103
- package/src/utils/crypto.js +59 -59
- package/src/utils/encryption.ts +68 -68
- package/src/utils/programmaticFlow.ts +112 -112
- package/src/utils/retryHelper.ts +274 -274
- package/types/index.d.ts +213 -213
- package/types/node-env.d.ts +14 -14
- 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/farcaster.png +0 -0
- package/lib/commonjs/assets/icons/instagram.png +0 -0
- package/lib/commonjs/assets/icons/pinterest.png +0 -0
- package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
- package/lib/commonjs/assets/icons/twitter.jpg +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +0 -3
- package/lib/commonjs/assets/images/EnochE.svg +0 -19
- 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 +0 -3
- package/lib/commonjs/assets/images/Personalitytraits.svg +0 -3
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +0 -3
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +0 -20
- package/lib/commonjs/assets/images/basicproficon.svg +0 -43
- package/lib/commonjs/assets/images/basicprofile.svg +0 -3
- package/lib/commonjs/assets/images/checkmark.svg +0 -4
- package/lib/commonjs/assets/images/contentanalysis.svg +0 -3
- package/lib/commonjs/assets/images/contenticon.svg +0 -23
- 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 +0 -18
- package/lib/commonjs/assets/images/x-close.svg +0 -3
- package/lib/commonjs/components/BodyText.js +0 -27
- package/lib/commonjs/components/BodyText.js.map +0 -1
- package/lib/commonjs/components/BrandMark.js +0 -44
- package/lib/commonjs/components/BrandMark.js.map +0 -1
- package/lib/commonjs/components/CodeInput.js +0 -30
- package/lib/commonjs/components/CodeInput.js.map +0 -1
- package/lib/commonjs/components/EmailInput.js +0 -30
- package/lib/commonjs/components/EmailInput.js.map +0 -1
- package/lib/commonjs/components/ExistingUserDataConfirmation.js +0 -474
- package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +0 -1
- package/lib/commonjs/components/GoogleButton.js +0 -55
- package/lib/commonjs/components/GoogleButton.js.map +0 -1
- package/lib/commonjs/components/HeadingGroup.js +0 -43
- package/lib/commonjs/components/HeadingGroup.js.map +0 -1
- package/lib/commonjs/components/ModalHeader.js +0 -99
- package/lib/commonjs/components/ModalHeader.js.map +0 -1
- package/lib/commonjs/components/ModalSheet.js +0 -41
- package/lib/commonjs/components/ModalSheet.js.map +0 -1
- package/lib/commonjs/components/OnairosSignInButton.js +0 -127
- package/lib/commonjs/components/OnairosSignInButton.js.map +0 -1
- package/lib/commonjs/components/PersonaImage.js +0 -60
- package/lib/commonjs/components/PersonaImage.js.map +0 -1
- package/lib/commonjs/components/PersonaLoadingScreen.js +0 -156
- package/lib/commonjs/components/PersonaLoadingScreen.js.map +0 -1
- package/lib/commonjs/components/PersonalizationConsentScreen.js +0 -316
- package/lib/commonjs/components/PersonalizationConsentScreen.js.map +0 -1
- package/lib/commonjs/components/PinCreationScreen.js +0 -393
- package/lib/commonjs/components/PinCreationScreen.js.map +0 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +0 -828
- package/lib/commonjs/components/PlatformConnectorsStep.js.map +0 -1
- package/lib/commonjs/components/PlatformToggle.js +0 -180
- package/lib/commonjs/components/PlatformToggle.js.map +0 -1
- package/lib/commonjs/components/PrimaryButton.js +0 -180
- package/lib/commonjs/components/PrimaryButton.js.map +0 -1
- package/lib/commonjs/components/SignInMatchAnimation.js +0 -197
- package/lib/commonjs/components/SignInMatchAnimation.js.map +0 -1
- package/lib/commonjs/components/SignInStep.js +0 -179
- package/lib/commonjs/components/SignInStep.js.map +0 -1
- package/lib/commonjs/components/VerificationStep.js +0 -154
- package/lib/commonjs/components/VerificationStep.js.map +0 -1
- package/lib/commonjs/components/WelcomeScreen.js +0 -385
- package/lib/commonjs/components/WelcomeScreen.js.map +0 -1
- package/lib/commonjs/components/icons/Basicproficon.js +0 -37
- package/lib/commonjs/components/icons/Basicproficon.js.map +0 -1
- package/lib/commonjs/components/icons/Basicprofile.js +0 -21
- package/lib/commonjs/components/icons/Basicprofile.js.map +0 -1
- package/lib/commonjs/components/icons/Checkbox.js +0 -21
- package/lib/commonjs/components/icons/Checkbox.js.map +0 -1
- package/lib/commonjs/components/icons/Checkmark.js +0 -27
- package/lib/commonjs/components/icons/Checkmark.js.map +0 -1
- package/lib/commonjs/components/icons/Contentanalysis.js +0 -21
- package/lib/commonjs/components/icons/Contentanalysis.js.map +0 -1
- package/lib/commonjs/components/icons/Contenticon.js +0 -39
- package/lib/commonjs/components/icons/Contenticon.js.map +0 -1
- package/lib/commonjs/components/icons/EnochE.js +0 -41
- package/lib/commonjs/components/icons/EnochE.js.map +0 -1
- package/lib/commonjs/components/icons/Personalityicon.js +0 -30
- package/lib/commonjs/components/icons/Personalityicon.js.map +0 -1
- package/lib/commonjs/components/icons/Personalityprofile.js +0 -21
- package/lib/commonjs/components/icons/Personalityprofile.js.map +0 -1
- package/lib/commonjs/components/icons/Personalitytraits.js +0 -21
- package/lib/commonjs/components/icons/Personalitytraits.js.map +0 -1
- package/lib/commonjs/components/icons/Userpreferences.js +0 -21
- package/lib/commonjs/components/icons/Userpreferences.js.map +0 -1
- package/lib/commonjs/components/icons/index.js +0 -84
- package/lib/commonjs/components/icons/index.js.map +0 -1
- package/lib/commonjs/config/api.js +0 -34
- package/lib/commonjs/config/api.js.map +0 -1
- package/lib/commonjs/context/AuthContext.js +0 -345
- package/lib/commonjs/context/AuthContext.js.map +0 -1
- package/lib/commonjs/hooks/useConnectedAccounts.js +0 -111
- package/lib/commonjs/hooks/useConnectedAccounts.js.map +0 -1
- package/lib/commonjs/hooks/useUserConnections.js +0 -148
- package/lib/commonjs/hooks/useUserConnections.js.map +0 -1
- package/lib/commonjs/services/apiClient.js +0 -302
- package/lib/commonjs/services/apiClient.js.map +0 -1
- package/lib/commonjs/services/authService.js +0 -935
- package/lib/commonjs/services/authService.js.map +0 -1
- package/lib/commonjs/services/biometricPinService.js +0 -184
- package/lib/commonjs/services/biometricPinService.js.map +0 -1
- package/lib/commonjs/services/connectedAccountsService.js +0 -268
- package/lib/commonjs/services/connectedAccountsService.js.map +0 -1
- package/lib/commonjs/services/googleAuthService.js +0 -268
- package/lib/commonjs/services/googleAuthService.js.map +0 -1
- package/lib/commonjs/services/imageCompressionService.js +0 -260
- package/lib/commonjs/services/imageCompressionService.js.map +0 -1
- package/lib/commonjs/services/jwtStorageService.js +0 -256
- package/lib/commonjs/services/jwtStorageService.js.map +0 -1
- package/lib/commonjs/services/mobileTrainingService.js +0 -185
- package/lib/commonjs/services/mobileTrainingService.js.map +0 -1
- package/lib/commonjs/services/pinEncryptionService.js +0 -84
- package/lib/commonjs/services/pinEncryptionService.js.map +0 -1
- package/lib/commonjs/services/pinStorageUtils.js +0 -105
- package/lib/commonjs/services/pinStorageUtils.js.map +0 -1
- package/lib/commonjs/services/storageService.js +0 -404
- package/lib/commonjs/services/storageService.js.map +0 -1
- package/lib/commonjs/services/trainingApiHelpers.js +0 -73
- package/lib/commonjs/services/trainingApiHelpers.js.map +0 -1
- package/lib/commonjs/services/userConnectionsService.js +0 -486
- package/lib/commonjs/services/userConnectionsService.js.map +0 -1
- package/lib/commonjs/services/youtubeMigrationService.js +0 -415
- package/lib/commonjs/services/youtubeMigrationService.js.map +0 -1
- package/lib/commonjs/theme/index.js +0 -249
- package/lib/commonjs/theme/index.js.map +0 -1
- package/lib/commonjs/utils/eventUtils.js +0 -288
- package/lib/commonjs/utils/eventUtils.js.map +0 -1
- package/lib/commonjs/utils/haptics.js +0 -66
- package/lib/commonjs/utils/haptics.js.map +0 -1
- package/lib/commonjs/utils/imagePreloader.js +0 -6
- package/lib/commonjs/utils/imagePreloader.js.map +0 -1
- 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/farcaster.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 +0 -3
- package/lib/module/assets/images/EnochE.svg +0 -19
- 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 +0 -3
- package/lib/module/assets/images/Personalitytraits.svg +0 -3
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +0 -3
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +0 -20
- package/lib/module/assets/images/basicproficon.svg +0 -43
- package/lib/module/assets/images/basicprofile.svg +0 -3
- package/lib/module/assets/images/checkmark.svg +0 -4
- package/lib/module/assets/images/contentanalysis.svg +0 -3
- package/lib/module/assets/images/contenticon.svg +0 -23
- 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 +0 -18
- package/lib/module/assets/images/x-close.svg +0 -3
- package/lib/module/components/BodyText.js +0 -20
- package/lib/module/components/BodyText.js.map +0 -1
- package/lib/module/components/BrandMark.js +0 -37
- package/lib/module/components/BrandMark.js.map +0 -1
- package/lib/module/components/CodeInput.js +0 -23
- package/lib/module/components/CodeInput.js.map +0 -1
- package/lib/module/components/EmailInput.js +0 -23
- package/lib/module/components/EmailInput.js.map +0 -1
- package/lib/module/components/ExistingUserDataConfirmation.js +0 -465
- package/lib/module/components/ExistingUserDataConfirmation.js.map +0 -1
- package/lib/module/components/GoogleButton.js +0 -48
- package/lib/module/components/GoogleButton.js.map +0 -1
- package/lib/module/components/HeadingGroup.js +0 -36
- package/lib/module/components/HeadingGroup.js.map +0 -1
- package/lib/module/components/ModalHeader.js +0 -92
- package/lib/module/components/ModalHeader.js.map +0 -1
- package/lib/module/components/ModalSheet.js +0 -34
- package/lib/module/components/ModalSheet.js.map +0 -1
- package/lib/module/components/OnairosSignInButton.js +0 -118
- package/lib/module/components/OnairosSignInButton.js.map +0 -1
- package/lib/module/components/PersonaImage.js +0 -53
- package/lib/module/components/PersonaImage.js.map +0 -1
- package/lib/module/components/PersonaLoadingScreen.js +0 -148
- package/lib/module/components/PersonaLoadingScreen.js.map +0 -1
- package/lib/module/components/PersonalizationConsentScreen.js +0 -309
- package/lib/module/components/PersonalizationConsentScreen.js.map +0 -1
- package/lib/module/components/PinCreationScreen.js +0 -386
- package/lib/module/components/PinCreationScreen.js.map +0 -1
- package/lib/module/components/PlatformConnectorsStep.js +0 -820
- package/lib/module/components/PlatformConnectorsStep.js.map +0 -1
- package/lib/module/components/PlatformToggle.js +0 -173
- package/lib/module/components/PlatformToggle.js.map +0 -1
- package/lib/module/components/PrimaryButton.js +0 -172
- package/lib/module/components/PrimaryButton.js.map +0 -1
- package/lib/module/components/SignInMatchAnimation.js +0 -189
- package/lib/module/components/SignInMatchAnimation.js.map +0 -1
- package/lib/module/components/SignInStep.js +0 -171
- package/lib/module/components/SignInStep.js.map +0 -1
- package/lib/module/components/VerificationStep.js +0 -146
- package/lib/module/components/VerificationStep.js.map +0 -1
- package/lib/module/components/WelcomeScreen.js +0 -378
- package/lib/module/components/WelcomeScreen.js.map +0 -1
- package/lib/module/components/icons/Basicproficon.js +0 -30
- package/lib/module/components/icons/Basicproficon.js.map +0 -1
- package/lib/module/components/icons/Basicprofile.js +0 -14
- package/lib/module/components/icons/Basicprofile.js.map +0 -1
- package/lib/module/components/icons/Checkbox.js +0 -14
- package/lib/module/components/icons/Checkbox.js.map +0 -1
- package/lib/module/components/icons/Checkmark.js +0 -20
- package/lib/module/components/icons/Checkmark.js.map +0 -1
- package/lib/module/components/icons/Contentanalysis.js +0 -14
- package/lib/module/components/icons/Contentanalysis.js.map +0 -1
- package/lib/module/components/icons/Contenticon.js +0 -32
- package/lib/module/components/icons/Contenticon.js.map +0 -1
- package/lib/module/components/icons/EnochE.js +0 -34
- package/lib/module/components/icons/EnochE.js.map +0 -1
- package/lib/module/components/icons/Personalityicon.js +0 -23
- package/lib/module/components/icons/Personalityicon.js.map +0 -1
- package/lib/module/components/icons/Personalityprofile.js +0 -14
- package/lib/module/components/icons/Personalityprofile.js.map +0 -1
- package/lib/module/components/icons/Personalitytraits.js +0 -14
- package/lib/module/components/icons/Personalitytraits.js.map +0 -1
- package/lib/module/components/icons/Userpreferences.js +0 -14
- package/lib/module/components/icons/Userpreferences.js.map +0 -1
- package/lib/module/components/icons/index.js +0 -13
- package/lib/module/components/icons/index.js.map +0 -1
- package/lib/module/config/api.js +0 -26
- package/lib/module/config/api.js.map +0 -1
- package/lib/module/context/AuthContext.js +0 -335
- package/lib/module/context/AuthContext.js.map +0 -1
- package/lib/module/hooks/useConnectedAccounts.js +0 -106
- package/lib/module/hooks/useConnectedAccounts.js.map +0 -1
- package/lib/module/hooks/useUserConnections.js +0 -140
- package/lib/module/hooks/useUserConnections.js.map +0 -1
- package/lib/module/services/apiClient.js +0 -298
- package/lib/module/services/apiClient.js.map +0 -1
- package/lib/module/services/authService.js +0 -905
- package/lib/module/services/authService.js.map +0 -1
- package/lib/module/services/biometricPinService.js +0 -173
- package/lib/module/services/biometricPinService.js.map +0 -1
- package/lib/module/services/connectedAccountsService.js +0 -255
- package/lib/module/services/connectedAccountsService.js.map +0 -1
- package/lib/module/services/googleAuthService.js +0 -258
- package/lib/module/services/googleAuthService.js.map +0 -1
- package/lib/module/services/imageCompressionService.js +0 -250
- package/lib/module/services/imageCompressionService.js.map +0 -1
- package/lib/module/services/jwtStorageService.js +0 -239
- package/lib/module/services/jwtStorageService.js.map +0 -1
- package/lib/module/services/mobileTrainingService.js +0 -172
- package/lib/module/services/mobileTrainingService.js.map +0 -1
- package/lib/module/services/pinEncryptionService.js +0 -75
- package/lib/module/services/pinEncryptionService.js.map +0 -1
- package/lib/module/services/pinStorageUtils.js +0 -93
- package/lib/module/services/pinStorageUtils.js.map +0 -1
- package/lib/module/services/storageService.js +0 -383
- package/lib/module/services/storageService.js.map +0 -1
- package/lib/module/services/trainingApiHelpers.js +0 -67
- package/lib/module/services/trainingApiHelpers.js.map +0 -1
- package/lib/module/services/userConnectionsService.js +0 -476
- package/lib/module/services/userConnectionsService.js.map +0 -1
- package/lib/module/services/youtubeMigrationService.js +0 -404
- package/lib/module/services/youtubeMigrationService.js.map +0 -1
- package/lib/module/theme/index.js +0 -244
- package/lib/module/theme/index.js.map +0 -1
- package/lib/module/utils/eventUtils.js +0 -270
- package/lib/module/utils/eventUtils.js.map +0 -1
- package/lib/module/utils/haptics.js +0 -59
- package/lib/module/utils/haptics.js.map +0 -1
- package/lib/module/utils/imagePreloader.js +0 -3
- package/lib/module/utils/imagePreloader.js.map +0 -1
- package/lib/typescript/components/BodyText.d.ts +0 -10
- package/lib/typescript/components/BodyText.d.ts.map +0 -1
- package/lib/typescript/components/BrandMark.d.ts +0 -11
- package/lib/typescript/components/BrandMark.d.ts.map +0 -1
- package/lib/typescript/components/CodeInput.d.ts +0 -10
- package/lib/typescript/components/CodeInput.d.ts.map +0 -1
- package/lib/typescript/components/EmailInput.d.ts +0 -8
- package/lib/typescript/components/EmailInput.d.ts.map +0 -1
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +0 -12
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +0 -1
- package/lib/typescript/components/GoogleButton.d.ts +0 -11
- package/lib/typescript/components/GoogleButton.d.ts.map +0 -1
- package/lib/typescript/components/HeadingGroup.d.ts +0 -11
- package/lib/typescript/components/HeadingGroup.d.ts.map +0 -1
- package/lib/typescript/components/ModalHeader.d.ts +0 -11
- package/lib/typescript/components/ModalHeader.d.ts.map +0 -1
- package/lib/typescript/components/ModalSheet.d.ts +0 -13
- package/lib/typescript/components/ModalSheet.d.ts.map +0 -1
- package/lib/typescript/components/OnairosSignInButton.d.ts +0 -14
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +0 -1
- package/lib/typescript/components/PersonaImage.d.ts +0 -8
- package/lib/typescript/components/PersonaImage.d.ts.map +0 -1
- package/lib/typescript/components/PersonaLoadingScreen.d.ts +0 -10
- package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +0 -1
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts +0 -10
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +0 -1
- package/lib/typescript/components/PinCreationScreen.d.ts +0 -10
- package/lib/typescript/components/PinCreationScreen.d.ts.map +0 -1
- package/lib/typescript/components/PlatformConnectorsStep.d.ts +0 -11
- package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +0 -1
- package/lib/typescript/components/PlatformToggle.d.ts +0 -20
- package/lib/typescript/components/PlatformToggle.d.ts.map +0 -1
- package/lib/typescript/components/PrimaryButton.d.ts +0 -22
- package/lib/typescript/components/PrimaryButton.d.ts.map +0 -1
- package/lib/typescript/components/SignInMatchAnimation.d.ts +0 -9
- package/lib/typescript/components/SignInMatchAnimation.d.ts.map +0 -1
- package/lib/typescript/components/SignInStep.d.ts +0 -12
- package/lib/typescript/components/SignInStep.d.ts.map +0 -1
- package/lib/typescript/components/VerificationStep.d.ts +0 -13
- package/lib/typescript/components/VerificationStep.d.ts.map +0 -1
- package/lib/typescript/components/WelcomeScreen.d.ts +0 -9
- package/lib/typescript/components/WelcomeScreen.d.ts.map +0 -1
- package/lib/typescript/components/icons/Basicproficon.d.ts +0 -5
- package/lib/typescript/components/icons/Basicproficon.d.ts.map +0 -1
- package/lib/typescript/components/icons/Basicprofile.d.ts +0 -5
- package/lib/typescript/components/icons/Basicprofile.d.ts.map +0 -1
- package/lib/typescript/components/icons/Checkbox.d.ts +0 -5
- package/lib/typescript/components/icons/Checkbox.d.ts.map +0 -1
- package/lib/typescript/components/icons/Checkmark.d.ts +0 -5
- package/lib/typescript/components/icons/Checkmark.d.ts.map +0 -1
- package/lib/typescript/components/icons/Contentanalysis.d.ts +0 -5
- package/lib/typescript/components/icons/Contentanalysis.d.ts.map +0 -1
- package/lib/typescript/components/icons/Contenticon.d.ts +0 -5
- package/lib/typescript/components/icons/Contenticon.d.ts.map +0 -1
- package/lib/typescript/components/icons/EnochE.d.ts +0 -5
- package/lib/typescript/components/icons/EnochE.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalityicon.d.ts +0 -5
- package/lib/typescript/components/icons/Personalityicon.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalityprofile.d.ts +0 -5
- package/lib/typescript/components/icons/Personalityprofile.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalitytraits.d.ts +0 -5
- package/lib/typescript/components/icons/Personalitytraits.d.ts.map +0 -1
- package/lib/typescript/components/icons/Userpreferences.d.ts +0 -5
- package/lib/typescript/components/icons/Userpreferences.d.ts.map +0 -1
- package/lib/typescript/components/icons/index.d.ts +0 -12
- package/lib/typescript/components/icons/index.d.ts.map +0 -1
- package/lib/typescript/config/api.d.ts +0 -24
- package/lib/typescript/config/api.d.ts.map +0 -1
- package/lib/typescript/context/AuthContext.d.ts +0 -34
- package/lib/typescript/context/AuthContext.d.ts.map +0 -1
- package/lib/typescript/hooks/useConnectedAccounts.d.ts +0 -11
- package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +0 -1
- package/lib/typescript/hooks/useUserConnections.d.ts +0 -12
- package/lib/typescript/hooks/useUserConnections.d.ts.map +0 -1
- package/lib/typescript/services/apiClient.d.ts +0 -91
- package/lib/typescript/services/apiClient.d.ts.map +0 -1
- package/lib/typescript/services/authService.d.ts +0 -216
- package/lib/typescript/services/authService.d.ts.map +0 -1
- package/lib/typescript/services/biometricPinService.d.ts +0 -29
- package/lib/typescript/services/biometricPinService.d.ts.map +0 -1
- package/lib/typescript/services/connectedAccountsService.d.ts +0 -56
- package/lib/typescript/services/connectedAccountsService.d.ts.map +0 -1
- package/lib/typescript/services/googleAuthService.d.ts +0 -63
- package/lib/typescript/services/googleAuthService.d.ts.map +0 -1
- package/lib/typescript/services/imageCompressionService.d.ts +0 -37
- package/lib/typescript/services/imageCompressionService.d.ts.map +0 -1
- package/lib/typescript/services/jwtStorageService.d.ts +0 -86
- package/lib/typescript/services/jwtStorageService.d.ts.map +0 -1
- package/lib/typescript/services/mobileTrainingService.d.ts +0 -45
- package/lib/typescript/services/mobileTrainingService.d.ts.map +0 -1
- package/lib/typescript/services/pinEncryptionService.d.ts +0 -17
- package/lib/typescript/services/pinEncryptionService.d.ts.map +0 -1
- package/lib/typescript/services/pinStorageUtils.d.ts +0 -25
- package/lib/typescript/services/pinStorageUtils.d.ts.map +0 -1
- package/lib/typescript/services/storageService.d.ts +0 -128
- package/lib/typescript/services/storageService.d.ts.map +0 -1
- package/lib/typescript/services/trainingApiHelpers.d.ts +0 -38
- package/lib/typescript/services/trainingApiHelpers.d.ts.map +0 -1
- package/lib/typescript/services/userConnectionsService.d.ts +0 -90
- package/lib/typescript/services/userConnectionsService.d.ts.map +0 -1
- package/lib/typescript/services/youtubeMigrationService.d.ts +0 -12
- package/lib/typescript/services/youtubeMigrationService.d.ts.map +0 -1
- package/lib/typescript/theme/index.d.ts +0 -416
- package/lib/typescript/theme/index.d.ts.map +0 -1
- package/lib/typescript/utils/eventUtils.d.ts +0 -108
- package/lib/typescript/utils/eventUtils.d.ts.map +0 -1
- package/lib/typescript/utils/haptics.d.ts +0 -11
- package/lib/typescript/utils/haptics.d.ts.map +0 -1
- package/lib/typescript/utils/imagePreloader.d.ts +0 -2
- package/lib/typescript/utils/imagePreloader.d.ts.map +0 -1
- package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/icons/Facebookicon.png +0 -0
- package/src/assets/icons/Gmail.png +0 -0
- package/src/assets/icons/Linkedinicon.png +0 -0
- package/src/assets/icons/Redditicon.png +0 -0
- package/src/assets/icons/YouTubeicon2.png +0 -0
- package/src/assets/icons/YouTubeicon3.png +0 -0
- package/src/assets/icons/farcaster.png +0 -0
- package/src/assets/icons/instagram.png +0 -0
- package/src/assets/icons/pinterest.png +0 -0
- package/src/assets/icons/swerv_logo.png +0 -0
- package/src/assets/icons/twitter.jpg +0 -0
- package/src/assets/images/Checkbox.svg +0 -3
- package/src/assets/images/EnochE.svg +0 -19
- package/src/assets/images/Enochicon1.png +0 -0
- package/src/assets/images/Face_ID_logo.png +0 -0
- package/src/assets/images/Facebookicon.png +0 -0
- package/src/assets/images/Gmail.png +0 -0
- package/src/assets/images/Googlelogo.png +0 -0
- package/src/assets/images/Linkedinicon.png +0 -0
- package/src/assets/images/Onairoslogo.png +0 -0
- package/src/assets/images/Personalityprofile.svg +0 -3
- package/src/assets/images/Personalitytraits.svg +0 -3
- package/src/assets/images/Redditicon.png +0 -0
- package/src/assets/images/Userpreferences.svg +0 -3
- package/src/assets/images/YouTubeicon3.png +0 -0
- package/src/assets/images/arrow.svg +0 -20
- package/src/assets/images/basicproficon.svg +0 -43
- package/src/assets/images/basicprofile.svg +0 -3
- package/src/assets/images/checkmark.svg +0 -4
- package/src/assets/images/contentanalysis.svg +0 -3
- package/src/assets/images/contenticon.svg +0 -23
- package/src/assets/images/persona1.png +0 -0
- package/src/assets/images/persona2.png +0 -0
- package/src/assets/images/persona3.png +0 -0
- package/src/assets/images/persona4.png +0 -0
- package/src/assets/images/persona5.png +0 -0
- package/src/assets/images/personalityicon.svg +0 -18
- package/src/assets/images/x-close.svg +0 -3
- package/src/components/BodyText.tsx +0 -33
- package/src/components/BrandMark.tsx +0 -62
- package/src/components/CodeInput.tsx +0 -32
- package/src/components/EmailInput.tsx +0 -31
- package/src/components/ExistingUserDataConfirmation.tsx +0 -507
- package/src/components/GoogleButton.tsx +0 -55
- package/src/components/HeadingGroup.tsx +0 -49
- package/src/components/ModalHeader.tsx +0 -125
- package/src/components/ModalSheet.tsx +0 -57
- package/src/components/OnairosSignInButton.tsx +0 -130
- package/src/components/PersonaImage.tsx +0 -79
- package/src/components/PersonaLoadingScreen.tsx +0 -201
- package/src/components/PersonalizationConsentScreen.tsx +0 -410
- package/src/components/PinCreationScreen.tsx +0 -492
- package/src/components/PlatformConnectorsStep.tsx +0 -892
- package/src/components/PlatformToggle.tsx +0 -226
- package/src/components/PrimaryButton.tsx +0 -214
- package/src/components/SignInMatchAnimation.tsx +0 -225
- package/src/components/SignInStep.tsx +0 -217
- package/src/components/VerificationStep.tsx +0 -198
- package/src/components/WelcomeScreen.tsx +0 -473
- package/src/components/icons/Basicproficon.tsx +0 -30
- package/src/components/icons/Basicprofile.tsx +0 -17
- package/src/components/icons/Checkbox.tsx +0 -17
- package/src/components/icons/Checkmark.tsx +0 -24
- package/src/components/icons/Contentanalysis.tsx +0 -17
- package/src/components/icons/Contenticon.tsx +0 -30
- package/src/components/icons/EnochE.tsx +0 -39
- package/src/components/icons/Personalityicon.tsx +0 -22
- package/src/components/icons/Personalityprofile.tsx +0 -17
- package/src/components/icons/Personalitytraits.tsx +0 -17
- package/src/components/icons/Userpreferences.tsx +0 -17
- package/src/components/icons/index.ts +0 -12
- package/src/config/api.ts +0 -25
- package/src/context/AuthContext.tsx +0 -393
- package/src/hooks/useConnectedAccounts.ts +0 -139
- package/src/hooks/useUserConnections.ts +0 -166
- package/src/services/apiClient.ts +0 -337
- package/src/services/authService.ts +0 -1008
- package/src/services/biometricPinService.ts +0 -193
- package/src/services/connectedAccountsService.ts +0 -290
- package/src/services/googleAuthService.ts +0 -279
- package/src/services/imageCompressionService.ts +0 -303
- package/src/services/jwtStorageService.ts +0 -257
- package/src/services/mobileTrainingService.ts +0 -204
- package/src/services/pinEncryptionService.ts +0 -76
- package/src/services/pinStorageUtils.ts +0 -97
- package/src/services/storageService.ts +0 -452
- package/src/services/trainingApiHelpers.ts +0 -67
- package/src/services/userConnectionsService.ts +0 -557
- package/src/services/youtubeMigrationService.ts +0 -454
- package/src/theme/index.ts +0 -239
- package/src/utils/eventUtils.ts +0 -303
- package/src/utils/haptics.ts +0 -59
- package/src/utils/imagePreloader.ts +0 -2
|
@@ -1,207 +1,106 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { View, Text, StyleSheet, TouchableOpacity,
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, TouchableOpacity, Dimensions, Modal, TouchableWithoutFeedback, SafeAreaView, Image, Alert } from 'react-native';
|
|
3
|
+
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
3
4
|
import { io } from 'socket.io-client';
|
|
4
|
-
import {
|
|
5
|
-
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
|
|
6
|
-
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
7
|
-
import { getEncryptedPinForAPI } from '../services/pinEncryptionService';
|
|
8
|
-
import { clearTemporaryPin } from '../services/pinStorageUtils';
|
|
9
|
-
// import EmailVerification from '../../../components/EmailVerification'; // Commented out - file doesn't exist
|
|
10
|
-
// import { sendEmailVerificationCode } from '../../../services/api'; // Commented out - use local API instead
|
|
11
|
-
import { startEnochTrainingWithYouTubeCheck } from '../services/mobileTrainingService';
|
|
12
|
-
import { ExistingUserDataConfirmation } from './ExistingUserDataConfirmation';
|
|
5
|
+
import { COLORS } from '../constants';
|
|
13
6
|
const {
|
|
14
7
|
width,
|
|
15
8
|
height
|
|
16
9
|
} = Dimensions.get('window');
|
|
17
10
|
export const TrainingModal = ({
|
|
18
11
|
visible,
|
|
12
|
+
progress,
|
|
13
|
+
eta,
|
|
19
14
|
onCancel,
|
|
20
15
|
onComplete,
|
|
21
16
|
modelKey,
|
|
22
17
|
username,
|
|
23
|
-
|
|
24
|
-
autoFocusEmailInput = false,
|
|
25
|
-
// Add default value
|
|
26
|
-
navigation
|
|
18
|
+
test = false
|
|
27
19
|
}) => {
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const [emailError, setEmailError] = useState('');
|
|
31
|
-
const [isTrainingComplete, setIsTrainingComplete] = useState(false);
|
|
32
|
-
const [isSubmittingEmail, setIsSubmittingEmail] = useState(false);
|
|
20
|
+
// Socket and training state
|
|
21
|
+
const socketRef = useRef(null);
|
|
33
22
|
const [socketConnected, setSocketConnected] = useState(false);
|
|
34
23
|
const [trainingStatus, setTrainingStatus] = useState('Initializing...');
|
|
35
24
|
const [hasError, setHasError] = useState(false);
|
|
25
|
+
const [errorCode, setErrorCode] = useState(null);
|
|
26
|
+
const [isTrainingComplete, setIsTrainingComplete] = useState(false);
|
|
36
27
|
const [userTraits, setUserTraits] = useState(null);
|
|
37
28
|
const [inferenceResults, setInferenceResults] = useState(null);
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
//
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (!visible) {
|
|
54
|
-
// Reset all state
|
|
55
|
-
setEmail('');
|
|
56
|
-
setEmailError('');
|
|
57
|
-
setIsSubmittingEmail(false);
|
|
58
|
-
setMatchStep('email');
|
|
59
|
-
setMatchCount(0);
|
|
60
|
-
setIsContinueLoading(false);
|
|
61
|
-
setProgress(0);
|
|
62
|
-
setIsTrainingComplete(false);
|
|
63
|
-
setHasError(false);
|
|
64
|
-
setTrainingStatus('Initializing...');
|
|
65
|
-
setUserTraits(null);
|
|
66
|
-
setInferenceResults(null);
|
|
67
|
-
setUserToken(null);
|
|
68
|
-
setUserInfo(null);
|
|
69
|
-
|
|
70
|
-
// Reset animation value
|
|
71
|
-
modalTranslateY.setValue(height);
|
|
72
|
-
}
|
|
73
|
-
}, [visible]);
|
|
74
|
-
|
|
75
|
-
// Handle animation
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
if (visible) {
|
|
78
|
-
// Ensure we start from the bottom
|
|
79
|
-
modalTranslateY.setValue(height);
|
|
80
|
-
// Animate up
|
|
81
|
-
Animated.spring(modalTranslateY, {
|
|
82
|
-
toValue: 0,
|
|
83
|
-
useNativeDriver: true,
|
|
84
|
-
damping: 20,
|
|
85
|
-
mass: 1,
|
|
86
|
-
stiffness: 200
|
|
87
|
-
}).start();
|
|
88
|
-
}
|
|
89
|
-
}, [visible]);
|
|
90
|
-
|
|
91
|
-
// Handle modal close
|
|
92
|
-
const handleModalClose = () => {
|
|
93
|
-
Animated.spring(modalTranslateY, {
|
|
94
|
-
toValue: height,
|
|
95
|
-
useNativeDriver: true,
|
|
96
|
-
damping: 20,
|
|
97
|
-
mass: 1,
|
|
98
|
-
stiffness: 200
|
|
99
|
-
}).start(() => {
|
|
100
|
-
onCancel();
|
|
101
|
-
});
|
|
29
|
+
const [internalProgress, setInternalProgress] = useState(0);
|
|
30
|
+
const [isEnochSDK, setIsEnochSDK] = useState(false); // Determine if using Enoch SDK
|
|
31
|
+
const [trainingResults, setTrainingResults] = useState(null);
|
|
32
|
+
|
|
33
|
+
// Use internal progress if available, otherwise fall back to prop progress
|
|
34
|
+
const currentProgress = internalProgress > 0 ? internalProgress / 100 : progress;
|
|
35
|
+
const progressPercentage = Math.round(currentProgress * 100);
|
|
36
|
+
|
|
37
|
+
// Mock user data for now - in real implementation this would come from props
|
|
38
|
+
const userToken = 'mock-token'; // TODO: Get from actual auth
|
|
39
|
+
const userInfo = {
|
|
40
|
+
username: username || 'mobile_user',
|
|
41
|
+
email: null,
|
|
42
|
+
id: null,
|
|
43
|
+
name: username || 'mobile_user'
|
|
102
44
|
};
|
|
103
45
|
|
|
104
|
-
//
|
|
46
|
+
// Check if we should use Enoch SDK (based on modelKey or other criteria)
|
|
105
47
|
useEffect(() => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (token) {
|
|
111
|
-
// Use provided username instead of making API call to avoid 404 error
|
|
112
|
-
// The backend JWT contains username but /api/user/profile endpoint doesn't exist
|
|
113
|
-
const fallbackUsername = username || 'mobile_user';
|
|
114
|
-
console.log('🔍 Using provided username for training:', fallbackUsername);
|
|
115
|
-
setUserInfo({
|
|
116
|
-
username: fallbackUsername,
|
|
117
|
-
email: null,
|
|
118
|
-
id: null // Will be filled by backend during training
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
} catch (error) {
|
|
122
|
-
console.error('Error loading user data:', error);
|
|
123
|
-
// Fallback user info
|
|
124
|
-
setUserInfo({
|
|
125
|
-
username: username || 'mobile_user',
|
|
126
|
-
email: null,
|
|
127
|
-
id: null
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
if (visible) {
|
|
132
|
-
loadUserData();
|
|
133
|
-
}
|
|
134
|
-
}, [visible, username]);
|
|
48
|
+
// For now, default to clean training unless specified
|
|
49
|
+
// In real implementation, this would be determined by SDK type
|
|
50
|
+
setIsEnochSDK((modelKey === null || modelKey === void 0 ? void 0 : modelKey.includes('enoch')) || false);
|
|
51
|
+
}, [modelKey]);
|
|
135
52
|
|
|
136
|
-
// Start
|
|
137
|
-
const
|
|
53
|
+
// Start training with new API schema
|
|
54
|
+
const startTraining = async socketId => {
|
|
138
55
|
try {
|
|
139
56
|
setTrainingStatus('Starting training...');
|
|
140
|
-
|
|
57
|
+
setInternalProgress(10);
|
|
58
|
+
setHasError(false);
|
|
59
|
+
setErrorCode(null);
|
|
141
60
|
if (!userToken) {
|
|
142
61
|
throw new Error('No authentication token available');
|
|
143
62
|
}
|
|
144
|
-
console.log('🚀 Starting Enoch training with socketId:', socketId);
|
|
145
63
|
|
|
146
|
-
//
|
|
147
|
-
const
|
|
148
|
-
|
|
64
|
+
// Determine endpoint based on SDK type
|
|
65
|
+
const endpoint = isEnochSDK ? '/mobile-training/enoch' : '/mobile-training/clean';
|
|
66
|
+
console.log(`🚀 Starting training with endpoint: ${endpoint}`);
|
|
67
|
+
console.log('🔍 Production mode: Using new training API schema');
|
|
149
68
|
|
|
150
|
-
//
|
|
151
|
-
const connectedPlatforms = await AsyncStorage.getItem('connectedPlatforms');
|
|
152
|
-
const platformsList = connectedPlatforms ? JSON.parse(connectedPlatforms) : [];
|
|
153
|
-
console.log('📱 Connected platforms for training:', platformsList);
|
|
154
|
-
|
|
155
|
-
// Get encrypted PIN for training (if available)
|
|
156
|
-
const encryptedPin = await getEncryptedPinForAPI().catch(error => {
|
|
157
|
-
console.warn('⚠️ Could not get encrypted PIN for training:', error);
|
|
158
|
-
return null;
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
// Prepare user data for training - match backend expected format
|
|
69
|
+
// Prepare training data in new format
|
|
162
70
|
const trainingData = {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
modelKey: modelKey || null,
|
|
169
|
-
connectedPlatforms: platformsList,
|
|
170
|
-
// Include connected platforms
|
|
171
|
-
// Include encrypted PIN if available
|
|
172
|
-
...(encryptedPin && {
|
|
173
|
-
encryptedPin: encryptedPin,
|
|
174
|
-
hasPinData: true
|
|
175
|
-
})
|
|
71
|
+
Info: {
|
|
72
|
+
username: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.username) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || username || 'mobile_user',
|
|
73
|
+
// Mock connected platforms - in real implementation this would come from props
|
|
74
|
+
connectedPlatforms: ['youtube', 'instagram', 'reddit'] // TODO: Get from actual connections
|
|
75
|
+
}
|
|
176
76
|
};
|
|
177
|
-
console.log('📤
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
77
|
+
console.log('📤 Sending training data:', trainingData);
|
|
78
|
+
|
|
79
|
+
// Call the new training API
|
|
80
|
+
const response = await fetch(`https://api2.onairos.uk${endpoint}`, {
|
|
81
|
+
method: 'POST',
|
|
82
|
+
headers: {
|
|
83
|
+
'Content-Type': 'application/json',
|
|
84
|
+
'Authorization': `Bearer ${userToken}` // JWT token authentication
|
|
85
|
+
},
|
|
86
|
+
body: JSON.stringify(trainingData)
|
|
87
|
+
});
|
|
88
|
+
const result = await response.json();
|
|
185
89
|
if (result.success) {
|
|
186
90
|
console.log('🚀 Training Started:', result.message);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
// Log the new features from the spec
|
|
190
|
-
if (result.features) {
|
|
191
|
-
console.log('✅ Inference enabled:', result.features.inference);
|
|
192
|
-
console.log('💾 Storage method:', result.features.storage);
|
|
193
|
-
console.log('🔒 Compression enabled:', result.features.compression);
|
|
194
|
-
console.log('🔐 Encryption enabled:', result.features.encryption);
|
|
195
|
-
console.log('📊 Training type:', result.features.type);
|
|
196
|
-
console.log('🗄️ Databases:', result.features.databases);
|
|
197
|
-
console.log('📈 Query scores enabled:', result.features.queryScores);
|
|
198
|
-
}
|
|
199
|
-
setTrainingStatus('Training model...');
|
|
200
|
-
setProgress(20);
|
|
91
|
+
setTrainingStatus('Training initiated...');
|
|
92
|
+
setInternalProgress(20);
|
|
201
93
|
} else {
|
|
202
94
|
console.error('Training start failed:', result.error);
|
|
203
|
-
|
|
204
|
-
|
|
95
|
+
|
|
96
|
+
// Handle specific error codes from new schema
|
|
97
|
+
if (result.code) {
|
|
98
|
+
setErrorCode(result.code);
|
|
99
|
+
handleTrainingError(result.code, result.error);
|
|
100
|
+
} else {
|
|
101
|
+
setTrainingStatus(`Error: ${result.error}`);
|
|
102
|
+
setHasError(true);
|
|
103
|
+
}
|
|
205
104
|
}
|
|
206
105
|
} catch (error) {
|
|
207
106
|
console.error('Training start error:', error);
|
|
@@ -210,743 +109,600 @@ export const TrainingModal = ({
|
|
|
210
109
|
}
|
|
211
110
|
};
|
|
212
111
|
|
|
213
|
-
//
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
console.log('🗄️ Databases used:', data.databases.join(', '));
|
|
267
|
-
}
|
|
112
|
+
// Handle training errors with specific error codes
|
|
113
|
+
const handleTrainingError = (code, message) => {
|
|
114
|
+
console.error(`Training Error [${code}]:`, message);
|
|
115
|
+
setHasError(true);
|
|
116
|
+
switch (code) {
|
|
117
|
+
case 'PIN_REQUIRED':
|
|
118
|
+
setTrainingStatus('PIN setup required');
|
|
119
|
+
Alert.alert('PIN Required', 'Please set up your PIN first before training.', [{
|
|
120
|
+
text: 'Cancel',
|
|
121
|
+
style: 'cancel'
|
|
122
|
+
}, {
|
|
123
|
+
text: 'Set PIN',
|
|
124
|
+
onPress: () => {
|
|
125
|
+
// TODO: Navigate to PIN setup
|
|
126
|
+
console.log('Navigate to PIN setup');
|
|
127
|
+
}
|
|
128
|
+
}]);
|
|
129
|
+
break;
|
|
130
|
+
case 'CONNECTIONS_REQUIRED':
|
|
131
|
+
setTrainingStatus('No connected accounts');
|
|
132
|
+
Alert.alert('Connections Required', 'Please connect at least one social media account before training.', [{
|
|
133
|
+
text: 'Cancel',
|
|
134
|
+
style: 'cancel'
|
|
135
|
+
}, {
|
|
136
|
+
text: 'Connect',
|
|
137
|
+
onPress: () => {
|
|
138
|
+
// TODO: Navigate to connections
|
|
139
|
+
console.log('Navigate to connections');
|
|
140
|
+
}
|
|
141
|
+
}]);
|
|
142
|
+
break;
|
|
143
|
+
case 'INSUFFICIENT_DATA':
|
|
144
|
+
setTrainingStatus('Insufficient data for training');
|
|
145
|
+
Alert.alert('Insufficient Data', 'We need more interaction data to train your model effectively. Please use your connected platforms more and try again.', [{
|
|
146
|
+
text: 'OK',
|
|
147
|
+
style: 'default'
|
|
148
|
+
}]);
|
|
149
|
+
break;
|
|
150
|
+
case 'ENCRYPTION_REQUIRED':
|
|
151
|
+
setTrainingStatus('Model encryption failed');
|
|
152
|
+
Alert.alert('Encryption Error', 'Failed to encrypt your model. Please try again.', [{
|
|
153
|
+
text: 'OK',
|
|
154
|
+
style: 'default'
|
|
155
|
+
}]);
|
|
156
|
+
break;
|
|
157
|
+
default:
|
|
158
|
+
setTrainingStatus(`Error: ${message}`);
|
|
159
|
+
Alert.alert('Training Error', message || 'An unexpected error occurred during training.', [{
|
|
160
|
+
text: 'OK',
|
|
161
|
+
style: 'default'
|
|
162
|
+
}]);
|
|
163
|
+
}
|
|
164
|
+
};
|
|
268
165
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
166
|
+
// Simulate training progress for test mode
|
|
167
|
+
const simulateTraining = () => {
|
|
168
|
+
var _phases$currentPhase;
|
|
169
|
+
console.log('🧪 Starting simulated training with new schema phases...');
|
|
170
|
+
setTrainingStatus('Validating Requirements');
|
|
171
|
+
setInternalProgress(5);
|
|
172
|
+
|
|
173
|
+
// Simulate all phases from the new schema
|
|
174
|
+
const phases = [{
|
|
175
|
+
progress: 10,
|
|
176
|
+
status: 'Validating Requirements',
|
|
177
|
+
delay: 1000
|
|
178
|
+
}, {
|
|
179
|
+
progress: 25,
|
|
180
|
+
status: 'Training Model',
|
|
181
|
+
delay: 2000
|
|
182
|
+
}, {
|
|
183
|
+
progress: 50,
|
|
184
|
+
status: 'Training Model',
|
|
185
|
+
delay: 2000
|
|
186
|
+
}, {
|
|
187
|
+
progress: 65,
|
|
188
|
+
status: 'Model Trained - Running Test Inference',
|
|
189
|
+
delay: 1500
|
|
190
|
+
}, {
|
|
191
|
+
progress: 80,
|
|
192
|
+
status: 'Encrypting and Compressing Model',
|
|
193
|
+
delay: 1000
|
|
194
|
+
}, {
|
|
195
|
+
progress: 95,
|
|
196
|
+
status: 'Uploading Encrypted Model to ARDrive',
|
|
197
|
+
delay: 1500
|
|
198
|
+
}, {
|
|
199
|
+
progress: 100,
|
|
200
|
+
status: 'Complete!',
|
|
201
|
+
delay: 500
|
|
202
|
+
}];
|
|
203
|
+
let currentPhase = 0;
|
|
204
|
+
const progressInterval = setInterval(() => {
|
|
205
|
+
if (currentPhase < phases.length) {
|
|
206
|
+
const phase = phases[currentPhase];
|
|
207
|
+
setInternalProgress(phase.progress);
|
|
208
|
+
setTrainingStatus(phase.status);
|
|
209
|
+
if (phase.progress === 100) {
|
|
210
|
+
setIsTrainingComplete(true);
|
|
211
|
+
clearInterval(progressInterval);
|
|
212
|
+
|
|
213
|
+
// Mock completion results
|
|
214
|
+
const mockResults = {
|
|
215
|
+
completed: true,
|
|
216
|
+
message: "Model trained, encrypted, and stored successfully",
|
|
217
|
+
storage: "ARDrive",
|
|
218
|
+
encryption: true,
|
|
219
|
+
inference: isEnochSDK,
|
|
220
|
+
// Only Enoch SDK runs inference
|
|
221
|
+
modelUrl: `https://arweave.net/mock_tx_${Date.now()}`
|
|
222
|
+
};
|
|
223
|
+
setTrainingResults(mockResults);
|
|
224
|
+
|
|
225
|
+
// Auto-complete after a short delay
|
|
226
|
+
setTimeout(() => {
|
|
227
|
+
onComplete && onComplete();
|
|
228
|
+
}, 1000);
|
|
272
229
|
}
|
|
230
|
+
currentPhase++;
|
|
273
231
|
}
|
|
274
|
-
|
|
275
|
-
setTrainingStatus('Complete!');
|
|
276
|
-
setProgress(100);
|
|
232
|
+
}, ((_phases$currentPhase = phases[currentPhase]) === null || _phases$currentPhase === void 0 ? void 0 : _phases$currentPhase.delay) || 1000);
|
|
277
233
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
// Show continue button for primary auth when training is complete
|
|
282
|
-
if (isPrimaryAuth) {
|
|
283
|
-
setMatchStep('found');
|
|
284
|
-
setMatchCount(Math.floor(Math.random() * 10) + 5);
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
socketRef.current.on('trainingUpdate', data => {
|
|
288
|
-
if (data.error) {
|
|
289
|
-
console.error('Training update error:', data.error);
|
|
290
|
-
setTrainingStatus(`Error: ${data.error}`);
|
|
291
|
-
setHasError(true);
|
|
292
|
-
} else if (data.progress) {
|
|
293
|
-
setProgress(data.progress);
|
|
294
|
-
setTrainingStatus(data.status || 'Training in progress...');
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
// Connect to socket
|
|
299
|
-
socketRef.current.connect();
|
|
300
|
-
|
|
301
|
-
// Cleanup function
|
|
302
|
-
return () => {
|
|
303
|
-
if (socketRef.current) {
|
|
304
|
-
console.log('🔌 Disconnecting training socket...');
|
|
305
|
-
socketRef.current.disconnect();
|
|
306
|
-
socketRef.current = null;
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
}, [visible, userToken, userInfo]);
|
|
234
|
+
// Cleanup interval on unmount
|
|
235
|
+
return () => clearInterval(progressInterval);
|
|
236
|
+
};
|
|
310
237
|
|
|
311
|
-
//
|
|
238
|
+
// Setup socket connection and training
|
|
312
239
|
useEffect(() => {
|
|
313
|
-
if (visible
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
return () => clearTimeout(timer);
|
|
319
|
-
} else if (!visible && emailInputRef.current) {
|
|
320
|
-
// Optional: Blur input when modal is not visible
|
|
321
|
-
// emailInputRef.current?.blur();
|
|
322
|
-
}
|
|
323
|
-
}, [visible, autoFocusEmailInput, matchStep]);
|
|
240
|
+
if (!visible || !userInfo) return;
|
|
241
|
+
console.log('Setting up socket connection for training...');
|
|
242
|
+
console.log('🧑💻 User info available:', userInfo);
|
|
243
|
+
console.log('🧪 Test mode:', test);
|
|
244
|
+
console.log('🔧 Using Enoch SDK:', isEnochSDK);
|
|
324
245
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
}
|
|
331
|
-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
332
|
-
return emailRegex.test(email);
|
|
333
|
-
};
|
|
334
|
-
const handleEmailSubmit = async () => {
|
|
335
|
-
// Check for reviewer bypass
|
|
336
|
-
if (email.toLowerCase().trim() === 'reviewer') {
|
|
337
|
-
console.log('🔍 Reviewer bypass detected');
|
|
338
|
-
setEmail('reviewer@bypass.com'); // Set a valid email for the flow
|
|
339
|
-
if (onComplete) {
|
|
340
|
-
onComplete('reviewer@bypass.com');
|
|
341
|
-
}
|
|
246
|
+
// If test mode is enabled, use simulation instead of real API
|
|
247
|
+
if (test) {
|
|
248
|
+
console.log('🧪 Test mode enabled - Using simulated training with new schema');
|
|
249
|
+
setSocketConnected(true);
|
|
250
|
+
simulateTraining();
|
|
342
251
|
return;
|
|
343
252
|
}
|
|
344
253
|
|
|
345
|
-
//
|
|
346
|
-
if (!validateEmail(email)) {
|
|
347
|
-
setEmailError('Please enter a valid email address');
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
setIsSubmittingEmail(true);
|
|
351
|
-
setEmailError('');
|
|
254
|
+
// Initialize real socket connection
|
|
352
255
|
try {
|
|
353
|
-
console.log('
|
|
256
|
+
console.log('🔌 Production mode: Initializing real socket connection');
|
|
354
257
|
|
|
355
|
-
//
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
};
|
|
361
|
-
if (result.success) {
|
|
362
|
-
console.log('✅ Verification code sent successfully');
|
|
363
|
-
setMatchStep('verification'); // Move to verification step
|
|
364
|
-
} else {
|
|
365
|
-
console.log('❌ Failed to send verification code:', result.message);
|
|
366
|
-
setEmailError(result.message || 'Failed to send verification code. Please try again.');
|
|
367
|
-
}
|
|
368
|
-
} catch (error) {
|
|
369
|
-
console.error('❌ Error sending verification code:', error);
|
|
370
|
-
setEmailError('Network error. Please check your connection and try again.');
|
|
371
|
-
} finally {
|
|
372
|
-
setIsSubmittingEmail(false);
|
|
373
|
-
}
|
|
374
|
-
};
|
|
375
|
-
const handleVerificationComplete = async (verifiedEmail, isVerified, accountInfo) => {
|
|
376
|
-
if (isVerified) {
|
|
377
|
-
console.log('✅ Email verification completed for:', verifiedEmail);
|
|
378
|
-
console.log('🔍 AccountInfo received:', accountInfo);
|
|
379
|
-
console.log('🔍 ExistingUser flag:', accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.existingUser);
|
|
380
|
-
|
|
381
|
-
// Check if this is an existing user - must have accountInfo AND explicitly marked as existing
|
|
382
|
-
if (accountInfo && accountInfo.existingUser === true) {
|
|
383
|
-
console.log('🔍 Existing user detected:', accountInfo);
|
|
384
|
-
|
|
385
|
-
// CRITICAL FIX: Ensure we have a valid JWT token before proceeding
|
|
386
|
-
if (accountInfo.token && typeof accountInfo.token === 'string' && accountInfo.token.length > 50) {
|
|
387
|
-
console.log('✅ Valid JWT token found for existing user');
|
|
388
|
-
|
|
389
|
-
// Store the token immediately for existing users
|
|
390
|
-
await AsyncStorage.setItem('onairos_jwt_token', accountInfo.token);
|
|
391
|
-
await AsyncStorage.setItem('enoch_token', accountInfo.token);
|
|
392
|
-
await AsyncStorage.setItem('auth_token', accountInfo.token);
|
|
393
|
-
await AsyncStorage.setItem('user_email', verifiedEmail);
|
|
394
|
-
await AsyncStorage.setItem('auth_method', 'onairos');
|
|
395
|
-
console.log('✅ Existing user tokens stored successfully');
|
|
396
|
-
|
|
397
|
-
// NEW: Show existing user confirmation modal instead of immediately completing
|
|
398
|
-
setExistingUserAccountInfo(accountInfo);
|
|
399
|
-
setMatchStep('existing_user');
|
|
400
|
-
return;
|
|
401
|
-
} else {
|
|
402
|
-
console.error('❌ No valid JWT token for existing user - token:', accountInfo.token);
|
|
403
|
-
console.error('❌ Cannot proceed without valid authentication token');
|
|
258
|
+
// Initialize socket connection
|
|
259
|
+
socketRef.current = io('https://api2.onairos.uk', {
|
|
260
|
+
transports: ['websocket'],
|
|
261
|
+
autoConnect: false
|
|
262
|
+
});
|
|
404
263
|
|
|
405
|
-
|
|
406
|
-
|
|
264
|
+
// Socket event listeners for new schema
|
|
265
|
+
socketRef.current.on('connect', () => {
|
|
266
|
+
var _socketRef$current;
|
|
267
|
+
console.log('✅ Socket connected for training');
|
|
268
|
+
setSocketConnected(true);
|
|
269
|
+
const socketId = (_socketRef$current = socketRef.current) === null || _socketRef$current === void 0 ? void 0 : _socketRef$current.id;
|
|
270
|
+
if (socketId) {
|
|
271
|
+
startTraining(socketId);
|
|
407
272
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
console.
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
headers: {
|
|
419
|
-
'Content-Type': 'application/json'
|
|
420
|
-
},
|
|
421
|
-
body: JSON.stringify({
|
|
422
|
-
email: verifiedEmail,
|
|
423
|
-
username: username,
|
|
424
|
-
name: username,
|
|
425
|
-
emailVerified: true // Mark as verified
|
|
426
|
-
})
|
|
427
|
-
});
|
|
428
|
-
const onairosResponseData = await onairosSignupResponse.json();
|
|
429
|
-
console.log('🔗 Onairos account creation response:', onairosResponseData);
|
|
430
|
-
if (onairosResponseData.token) {
|
|
431
|
-
// Store tokens
|
|
432
|
-
await AsyncStorage.setItem('onairos_jwt_token', onairosResponseData.token);
|
|
433
|
-
await AsyncStorage.setItem('auth_token', onairosResponseData.token);
|
|
434
|
-
await AsyncStorage.setItem('enoch_token', onairosResponseData.token);
|
|
435
|
-
await AsyncStorage.setItem('onairos_username', onairosResponseData.username);
|
|
436
|
-
await AsyncStorage.setItem('user_email', verifiedEmail);
|
|
437
|
-
console.log('✅ Account created and tokens stored');
|
|
438
|
-
console.log('🔗 Proceeding to UniversalOnboarding platform connectors');
|
|
273
|
+
});
|
|
274
|
+
socketRef.current.on('disconnect', () => {
|
|
275
|
+
console.log('❌ Socket disconnected');
|
|
276
|
+
setSocketConnected(false);
|
|
277
|
+
});
|
|
278
|
+
socketRef.current.on('connect_error', error => {
|
|
279
|
+
console.error('❌ Socket connection error:', error);
|
|
280
|
+
setTrainingStatus('Connection failed');
|
|
281
|
+
setHasError(true);
|
|
282
|
+
});
|
|
439
283
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
284
|
+
// Handle training updates with new schema phases
|
|
285
|
+
socketRef.current.on('trainingUpdate', data => {
|
|
286
|
+
console.log('📡 Training update received:', data);
|
|
287
|
+
if (data.error) {
|
|
288
|
+
if (data.code) {
|
|
289
|
+
setErrorCode(data.code);
|
|
290
|
+
handleTrainingError(data.code, data.error);
|
|
291
|
+
} else {
|
|
292
|
+
console.error('Training update error:', data.error);
|
|
293
|
+
setTrainingStatus(`Error: ${data.error}`);
|
|
294
|
+
setHasError(true);
|
|
446
295
|
}
|
|
447
296
|
} else {
|
|
448
|
-
//
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
297
|
+
// Handle different status phases
|
|
298
|
+
if (data.status) {
|
|
299
|
+
setTrainingStatus(data.status);
|
|
300
|
+
|
|
301
|
+
// Update progress based on phase
|
|
302
|
+
switch (data.status) {
|
|
303
|
+
case 'Validating Requirements':
|
|
304
|
+
setInternalProgress(10);
|
|
305
|
+
break;
|
|
306
|
+
case 'Training Model':
|
|
307
|
+
setInternalProgress(data.percent || 40);
|
|
308
|
+
break;
|
|
309
|
+
case 'Model Trained - Running Test Inference':
|
|
310
|
+
setInternalProgress(65);
|
|
311
|
+
break;
|
|
312
|
+
case 'Encrypting and Compressing Model':
|
|
313
|
+
setInternalProgress(80);
|
|
314
|
+
break;
|
|
315
|
+
case 'Uploading Encrypted Model to ARDrive':
|
|
316
|
+
setInternalProgress(90);
|
|
317
|
+
break;
|
|
318
|
+
default:
|
|
319
|
+
if (data.percent) {
|
|
320
|
+
setInternalProgress(data.percent);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (data.progress) {
|
|
325
|
+
setInternalProgress(data.progress);
|
|
455
326
|
}
|
|
456
327
|
}
|
|
457
|
-
}
|
|
458
|
-
console.error('❌ Error creating account after verification:', error);
|
|
459
|
-
// Continue anyway to platform connectors
|
|
460
|
-
console.log('🔗 Error occurred, but proceeding to platform connectors');
|
|
461
|
-
// CRITICAL FIX: Store email even when account creation throws an error
|
|
462
|
-
await AsyncStorage.setItem('user_email', verifiedEmail);
|
|
463
|
-
console.log('✅ Email stored despite error for admin check compatibility');
|
|
464
|
-
if (onComplete) {
|
|
465
|
-
onComplete(verifiedEmail);
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
};
|
|
470
|
-
const handleVerificationBack = () => {
|
|
471
|
-
setMatchStep('email');
|
|
472
|
-
setEmailError('');
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
// Handle existing user confirmation
|
|
476
|
-
const handleExistingUserConfirm = async () => {
|
|
477
|
-
console.log('✅ Existing user confirmed data sharing');
|
|
478
|
-
if (existingUserAccountInfo && existingUserAccountInfo.token) {
|
|
479
|
-
if (onComplete) {
|
|
480
|
-
onComplete(existingUserAccountInfo.token);
|
|
481
|
-
}
|
|
482
|
-
} else {
|
|
483
|
-
console.error('❌ No token available for existing user');
|
|
484
|
-
setEmailError('Authentication error. Please try again.');
|
|
485
|
-
setMatchStep('email');
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
const handleExistingUserCancel = () => {
|
|
489
|
-
console.log('❌ Existing user cancelled data sharing');
|
|
490
|
-
setMatchStep('email');
|
|
491
|
-
setExistingUserAccountInfo(null);
|
|
492
|
-
setEmailError('');
|
|
493
|
-
};
|
|
494
|
-
const handleExistingUserAddMoreData = () => {
|
|
495
|
-
console.log('🔗 Existing user wants to add more data');
|
|
496
|
-
|
|
497
|
-
// Store the existing user info for later use
|
|
498
|
-
if (existingUserAccountInfo && existingUserAccountInfo.token) {
|
|
499
|
-
AsyncStorage.setItem('existing_user_token', existingUserAccountInfo.token);
|
|
500
|
-
AsyncStorage.setItem('existing_user_info', JSON.stringify(existingUserAccountInfo));
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
// Continue to new user flow (UniversalOnboarding) but with existing user context
|
|
504
|
-
setMatchStep('email');
|
|
505
|
-
setExistingUserAccountInfo(null);
|
|
506
|
-
|
|
507
|
-
// Call onComplete with email to trigger UniversalOnboarding
|
|
508
|
-
if (onComplete) {
|
|
509
|
-
onComplete(email);
|
|
510
|
-
}
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
// Ensure cancel button always works
|
|
514
|
-
const handleCancelPress = () => {
|
|
515
|
-
// Clear temporary PIN when cancelling
|
|
516
|
-
clearTemporaryPin();
|
|
517
|
-
onCancel();
|
|
518
|
-
};
|
|
519
|
-
const handleContinue = () => {
|
|
520
|
-
// Trigger haptic feedback when button is pressed
|
|
521
|
-
ReactNativeHapticFeedback.trigger('impactMedium', {
|
|
522
|
-
enableVibrateFallback: true,
|
|
523
|
-
ignoreAndroidSystemSettings: false
|
|
524
|
-
});
|
|
525
|
-
console.log('handleContinue called. Current email state:', email);
|
|
526
|
-
console.log('Continue button pressed, completing onboarding with email:', email);
|
|
527
|
-
|
|
528
|
-
// Make sure we have a valid email
|
|
529
|
-
if (!validateEmail(email)) {
|
|
530
|
-
console.log('Email validation failed, cannot continue');
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
328
|
+
});
|
|
533
329
|
|
|
534
|
-
|
|
535
|
-
|
|
330
|
+
// Handle training completion with new schema
|
|
331
|
+
socketRef.current.on('trainingCompleted', data => {
|
|
332
|
+
console.log('✅ Training Complete:', data);
|
|
333
|
+
if (data.completed && data.storage === 'ARDrive' && data.encryption === true) {
|
|
334
|
+
setTrainingStatus('Training completed successfully!');
|
|
335
|
+
setIsTrainingComplete(true);
|
|
336
|
+
setInternalProgress(100);
|
|
337
|
+
setTrainingResults(data);
|
|
338
|
+
|
|
339
|
+
// Display results
|
|
340
|
+
console.log('✅ Model URL:', data.modelUrl);
|
|
341
|
+
console.log('✅ Storage:', data.storage);
|
|
342
|
+
console.log('✅ Encrypted:', data.encryption);
|
|
343
|
+
console.log('✅ Inference:', data.inference);
|
|
344
|
+
|
|
345
|
+
// Auto-complete after a short delay
|
|
346
|
+
setTimeout(() => {
|
|
347
|
+
onComplete && onComplete();
|
|
348
|
+
}, 1500);
|
|
349
|
+
} else {
|
|
350
|
+
console.error('Training completion missing required fields:', data);
|
|
351
|
+
setTrainingStatus('Training completed with warnings');
|
|
352
|
+
setHasError(true);
|
|
353
|
+
}
|
|
354
|
+
});
|
|
536
355
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
356
|
+
// Legacy handlers for backward compatibility
|
|
357
|
+
socketRef.current.on('inferenceCompleted', data => {
|
|
358
|
+
console.log('🧠 Inference Complete:', data);
|
|
359
|
+
setUserTraits(data.traits);
|
|
360
|
+
setInferenceResults(data.inferenceResults);
|
|
361
|
+
});
|
|
362
|
+
socketRef.current.on('modelStandby', data => {
|
|
363
|
+
console.log('🎉 Model Ready:', data);
|
|
364
|
+
// This is handled by trainingCompleted now
|
|
365
|
+
});
|
|
545
366
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
} else if (progress < 40) {
|
|
553
|
-
return 'Trying to understand your mind...';
|
|
554
|
-
} else if (progress < 60) {
|
|
555
|
-
return 'You\'re more interesting than I expected...';
|
|
556
|
-
} else if (progress < 80) {
|
|
557
|
-
return 'Finalizing your unique persona...';
|
|
558
|
-
} else if (progress < 95) {
|
|
559
|
-
return 'Almost done...';
|
|
560
|
-
} else {
|
|
561
|
-
return 'Just a few more seconds...';
|
|
367
|
+
// Connect to socket
|
|
368
|
+
socketRef.current.connect();
|
|
369
|
+
} catch (socketError) {
|
|
370
|
+
console.error('🚨 Production mode: Socket connection failed:', socketError);
|
|
371
|
+
setTrainingStatus('Failed to connect to training service');
|
|
372
|
+
setHasError(true);
|
|
562
373
|
}
|
|
563
|
-
};
|
|
564
374
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
375
|
+
// Cleanup function
|
|
376
|
+
return () => {
|
|
377
|
+
if (socketRef.current) {
|
|
378
|
+
console.log('🔌 Disconnecting training socket...');
|
|
379
|
+
socketRef.current.disconnect();
|
|
380
|
+
socketRef.current = null;
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}, [visible, userInfo, test, isEnochSDK]);
|
|
384
|
+
|
|
385
|
+
// Render error details for specific error codes
|
|
386
|
+
const renderErrorDetails = () => {
|
|
387
|
+
if (!hasError || !errorCode) return null;
|
|
388
|
+
const errorDetails = {
|
|
389
|
+
'PIN_REQUIRED': {
|
|
390
|
+
icon: 'lock',
|
|
391
|
+
title: 'PIN Setup Required',
|
|
392
|
+
description: 'Set up your PIN to secure your AI model'
|
|
393
|
+
},
|
|
394
|
+
'CONNECTIONS_REQUIRED': {
|
|
395
|
+
icon: 'link',
|
|
396
|
+
title: 'Connect Accounts',
|
|
397
|
+
description: 'Connect at least one social media account'
|
|
398
|
+
},
|
|
399
|
+
'INSUFFICIENT_DATA': {
|
|
400
|
+
icon: 'data-usage',
|
|
401
|
+
title: 'More Data Needed',
|
|
402
|
+
description: 'We need more interaction data to train effectively'
|
|
403
|
+
},
|
|
404
|
+
'ENCRYPTION_REQUIRED': {
|
|
405
|
+
icon: 'security',
|
|
406
|
+
title: 'Encryption Failed',
|
|
407
|
+
description: 'Failed to encrypt your model securely'
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
const details = errorDetails[errorCode];
|
|
411
|
+
if (!details) return null;
|
|
412
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
413
|
+
style: styles.errorDetailsContainer
|
|
414
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
415
|
+
name: details.icon,
|
|
416
|
+
size: 32,
|
|
417
|
+
color: "#FF6B6B"
|
|
418
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
419
|
+
style: styles.errorTitle
|
|
420
|
+
}, details.title), /*#__PURE__*/React.createElement(Text, {
|
|
421
|
+
style: styles.errorDescription
|
|
422
|
+
}, details.description));
|
|
581
423
|
};
|
|
582
|
-
|
|
583
|
-
// Grabber bar
|
|
584
|
-
const Grabber = () => /*#__PURE__*/React.createElement(View, {
|
|
585
|
-
style: styles.grabberContainer
|
|
586
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
587
|
-
style: styles.grabberBar
|
|
588
|
-
}));
|
|
589
|
-
if (!visible) return null;
|
|
590
|
-
const progressPercentage = Math.min(Math.max(progress, 0), 100);
|
|
591
424
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
592
425
|
visible: visible,
|
|
593
426
|
transparent: true,
|
|
594
|
-
animationType: "none"
|
|
595
|
-
,
|
|
596
|
-
onRequestClose:
|
|
597
|
-
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, {
|
|
598
|
-
onPress: handleModalClose
|
|
599
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
427
|
+
animationType: "none",
|
|
428
|
+
statusBarTranslucent: true,
|
|
429
|
+
onRequestClose: onCancel
|
|
430
|
+
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, null, /*#__PURE__*/React.createElement(View, {
|
|
600
431
|
style: styles.modalOverlay
|
|
601
|
-
}, /*#__PURE__*/React.createElement(
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
style: styles.
|
|
605
|
-
}, /*#__PURE__*/React.createElement(
|
|
606
|
-
|
|
607
|
-
}, /*#__PURE__*/React.createElement(
|
|
608
|
-
style:
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
432
|
+
}, /*#__PURE__*/React.createElement(TouchableWithoutFeedback, null, /*#__PURE__*/React.createElement(View, {
|
|
433
|
+
style: styles.bottomSheet
|
|
434
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
435
|
+
style: styles.handleContainer
|
|
436
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
437
|
+
style: styles.handle
|
|
438
|
+
})), /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
439
|
+
style: styles.container
|
|
440
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
441
|
+
style: styles.content
|
|
442
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
443
|
+
source: require('../assets/images/onairos_logo.png'),
|
|
444
|
+
style: styles.onairosLogo,
|
|
445
|
+
resizeMode: "contain"
|
|
446
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
447
|
+
style: styles.title
|
|
448
|
+
}, isEnochSDK ? 'Training AI with Inference' : 'Training Your AI'), /*#__PURE__*/React.createElement(View, {
|
|
449
|
+
style: styles.progressContainer
|
|
450
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
451
|
+
style: styles.progressBar
|
|
452
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
453
|
+
style: [styles.progressFill, {
|
|
454
|
+
width: `${progressPercentage}%`
|
|
621
455
|
}]
|
|
622
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
623
|
-
style: styles.
|
|
624
|
-
},
|
|
625
|
-
style: styles.
|
|
626
|
-
})
|
|
627
|
-
style: styles.
|
|
628
|
-
}, /*#__PURE__*/React.createElement(
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
value: email,
|
|
634
|
-
onChangeText: text => {
|
|
635
|
-
setEmail(text);
|
|
636
|
-
if (emailError) setEmailError('');
|
|
637
|
-
},
|
|
638
|
-
placeholder: "your.email@example.com",
|
|
639
|
-
keyboardType: "email-address",
|
|
640
|
-
autoCapitalize: "none",
|
|
641
|
-
autoCorrect: false,
|
|
642
|
-
returnKeyType: "done",
|
|
643
|
-
onSubmitEditing: () => Keyboard.dismiss()
|
|
644
|
-
}), emailError ? /*#__PURE__*/React.createElement(Text, {
|
|
456
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
457
|
+
style: styles.progressText
|
|
458
|
+
}, progressPercentage, "%")), /*#__PURE__*/React.createElement(Text, {
|
|
459
|
+
style: styles.statusText
|
|
460
|
+
}, trainingStatus), hasError && /*#__PURE__*/React.createElement(View, {
|
|
461
|
+
style: styles.errorContainer
|
|
462
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
463
|
+
name: "error-outline",
|
|
464
|
+
size: 24,
|
|
465
|
+
color: "#FF6B6B"
|
|
466
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
645
467
|
style: styles.errorText
|
|
646
|
-
},
|
|
647
|
-
style:
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
}
|
|
657
|
-
style: styles.
|
|
658
|
-
},
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
size: "large",
|
|
671
|
-
color: "#E9C46A",
|
|
672
|
-
style: styles.matchLoader
|
|
468
|
+
}, "Training encountered an error")), renderErrorDetails(), isTrainingComplete && trainingResults && /*#__PURE__*/React.createElement(View, {
|
|
469
|
+
style: styles.resultsContainer
|
|
470
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
471
|
+
name: "check-circle",
|
|
472
|
+
size: 32,
|
|
473
|
+
color: "#4CAF50"
|
|
474
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
475
|
+
style: styles.resultsTitle
|
|
476
|
+
}, "Training Complete!"), /*#__PURE__*/React.createElement(View, {
|
|
477
|
+
style: styles.resultsDetails
|
|
478
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
479
|
+
style: styles.resultItem
|
|
480
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
481
|
+
name: "cloud-done",
|
|
482
|
+
size: 16,
|
|
483
|
+
color: "#666"
|
|
484
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
485
|
+
style: styles.resultText
|
|
486
|
+
}, "Storage: ", trainingResults.storage)), /*#__PURE__*/React.createElement(View, {
|
|
487
|
+
style: styles.resultItem
|
|
488
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
489
|
+
name: "security",
|
|
490
|
+
size: 16,
|
|
491
|
+
color: "#666"
|
|
673
492
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
674
|
-
style: styles.
|
|
675
|
-
}, "
|
|
676
|
-
style: styles.
|
|
493
|
+
style: styles.resultText
|
|
494
|
+
}, "Encrypted: ", trainingResults.encryption ? 'Yes' : 'No')), trainingResults.inference && /*#__PURE__*/React.createElement(View, {
|
|
495
|
+
style: styles.resultItem
|
|
496
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
497
|
+
name: "psychology",
|
|
498
|
+
size: 16,
|
|
499
|
+
color: "#666"
|
|
500
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
501
|
+
style: styles.resultText
|
|
502
|
+
}, "Inference: Completed")))), /*#__PURE__*/React.createElement(View, {
|
|
503
|
+
style: styles.footer
|
|
504
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
505
|
+
style: styles.cancelButton,
|
|
506
|
+
onPress: onCancel
|
|
677
507
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
678
|
-
style: styles.
|
|
679
|
-
}, "
|
|
680
|
-
style: styles.
|
|
508
|
+
style: styles.cancelButtonText
|
|
509
|
+
}, "Cancel")), (currentProgress >= 1 || isTrainingComplete) && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
510
|
+
style: styles.completeButton,
|
|
511
|
+
onPress: onComplete
|
|
681
512
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
682
|
-
style: styles.
|
|
683
|
-
},
|
|
684
|
-
style: styles.matchMessage
|
|
685
|
-
}, "We found ", matchCount, " potential connections for you!"), /*#__PURE__*/React.createElement(Text, {
|
|
686
|
-
style: styles.matchSubMessage
|
|
687
|
-
}, "Complete your profile to see your personalized matches"), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
688
|
-
style: [styles.continueButton, isContinueLoading && styles.disabledButton],
|
|
689
|
-
onPress: handleContinue,
|
|
690
|
-
disabled: isContinueLoading
|
|
691
|
-
}, isContinueLoading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
692
|
-
size: "small",
|
|
693
|
-
color: "#FFFFFF"
|
|
694
|
-
}) : /*#__PURE__*/React.createElement(Text, {
|
|
695
|
-
style: styles.continueButtonText
|
|
696
|
-
}, "continue to setup")))))))));
|
|
513
|
+
style: styles.completeButtonText
|
|
514
|
+
}, "Complete"))))))))));
|
|
697
515
|
};
|
|
698
516
|
const styles = StyleSheet.create({
|
|
699
|
-
|
|
517
|
+
modalOverlay: {
|
|
700
518
|
flex: 1,
|
|
701
|
-
backgroundColor: '
|
|
702
|
-
|
|
519
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
520
|
+
justifyContent: 'flex-end',
|
|
521
|
+
alignItems: 'center'
|
|
703
522
|
},
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
523
|
+
bottomSheet: {
|
|
524
|
+
backgroundColor: '#fff',
|
|
525
|
+
width: width,
|
|
526
|
+
height: height * 0.8,
|
|
527
|
+
borderTopLeftRadius: 24,
|
|
528
|
+
borderTopRightRadius: 24,
|
|
529
|
+
overflow: 'hidden'
|
|
709
530
|
},
|
|
710
|
-
|
|
531
|
+
handleContainer: {
|
|
711
532
|
width: '100%',
|
|
712
|
-
alignItems: 'center'
|
|
533
|
+
alignItems: 'center',
|
|
534
|
+
paddingTop: 12,
|
|
535
|
+
paddingBottom: 8
|
|
536
|
+
},
|
|
537
|
+
handle: {
|
|
538
|
+
width: 40,
|
|
539
|
+
height: 5,
|
|
540
|
+
borderRadius: 3,
|
|
541
|
+
backgroundColor: '#E0E0E0'
|
|
542
|
+
},
|
|
543
|
+
container: {
|
|
544
|
+
flex: 1,
|
|
545
|
+
backgroundColor: '#fff'
|
|
713
546
|
},
|
|
714
547
|
content: {
|
|
715
|
-
|
|
716
|
-
|
|
548
|
+
flex: 1,
|
|
549
|
+
width: '100%',
|
|
550
|
+
alignItems: 'center',
|
|
551
|
+
justifyContent: 'center',
|
|
552
|
+
padding: 24
|
|
717
553
|
},
|
|
718
554
|
title: {
|
|
719
555
|
fontSize: 24,
|
|
720
556
|
fontWeight: '600',
|
|
721
|
-
|
|
722
|
-
marginBottom:
|
|
557
|
+
marginTop: 24,
|
|
558
|
+
marginBottom: 8,
|
|
559
|
+
color: COLORS.text.primary,
|
|
723
560
|
textAlign: 'center'
|
|
724
561
|
},
|
|
725
562
|
subtitle: {
|
|
726
563
|
fontSize: 16,
|
|
727
|
-
color:
|
|
728
|
-
|
|
564
|
+
color: COLORS.text.secondary,
|
|
565
|
+
textAlign: 'center',
|
|
566
|
+
marginBottom: 32
|
|
567
|
+
},
|
|
568
|
+
statusText: {
|
|
569
|
+
fontSize: 14,
|
|
570
|
+
color: COLORS.text.secondary,
|
|
571
|
+
marginBottom: 24,
|
|
729
572
|
textAlign: 'center'
|
|
730
573
|
},
|
|
731
574
|
progressContainer: {
|
|
732
|
-
|
|
575
|
+
width: '100%',
|
|
576
|
+
marginBottom: 16
|
|
733
577
|
},
|
|
734
578
|
progressBar: {
|
|
735
579
|
height: 8,
|
|
736
|
-
backgroundColor:
|
|
580
|
+
backgroundColor: COLORS.border,
|
|
737
581
|
borderRadius: 4,
|
|
738
|
-
overflow: 'hidden'
|
|
739
|
-
marginBottom: 8
|
|
582
|
+
overflow: 'hidden'
|
|
740
583
|
},
|
|
741
584
|
progressFill: {
|
|
742
585
|
height: '100%',
|
|
743
|
-
backgroundColor:
|
|
586
|
+
backgroundColor: COLORS.primary,
|
|
744
587
|
borderRadius: 4
|
|
745
588
|
},
|
|
746
589
|
progressText: {
|
|
747
590
|
fontSize: 14,
|
|
748
|
-
color:
|
|
749
|
-
textAlign: '
|
|
591
|
+
color: COLORS.text.secondary,
|
|
592
|
+
textAlign: 'center',
|
|
593
|
+
marginTop: 8
|
|
750
594
|
},
|
|
751
|
-
|
|
595
|
+
etaText: {
|
|
596
|
+
fontSize: 14,
|
|
597
|
+
color: COLORS.text.secondary,
|
|
598
|
+
marginBottom: 24
|
|
599
|
+
},
|
|
600
|
+
loadingContainer: {
|
|
752
601
|
flexDirection: 'row',
|
|
753
602
|
alignItems: 'center',
|
|
754
603
|
marginBottom: 32
|
|
755
604
|
},
|
|
756
|
-
|
|
605
|
+
loadingText: {
|
|
757
606
|
fontSize: 14,
|
|
758
|
-
color:
|
|
759
|
-
marginLeft: 8
|
|
760
|
-
textAlign: 'center',
|
|
761
|
-
marginBottom: 16
|
|
762
|
-
},
|
|
763
|
-
detailText: {
|
|
764
|
-
fontSize: 14,
|
|
765
|
-
color: '#666',
|
|
766
|
-
lineHeight: 20
|
|
607
|
+
color: COLORS.text.secondary,
|
|
608
|
+
marginLeft: 8
|
|
767
609
|
},
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
610
|
+
footer: {
|
|
611
|
+
flexDirection: 'row',
|
|
612
|
+
alignItems: 'center',
|
|
613
|
+
justifyContent: 'space-between',
|
|
614
|
+
width: '100%',
|
|
615
|
+
borderTopWidth: 1,
|
|
616
|
+
borderTopColor: '#eee',
|
|
617
|
+
paddingTop: 16,
|
|
618
|
+
paddingHorizontal: 24,
|
|
619
|
+
paddingBottom: 24
|
|
772
620
|
},
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
621
|
+
cancelButton: {
|
|
622
|
+
paddingVertical: 8,
|
|
623
|
+
paddingHorizontal: 16
|
|
776
624
|
},
|
|
777
|
-
|
|
625
|
+
cancelButtonText: {
|
|
778
626
|
fontSize: 16,
|
|
779
|
-
|
|
780
|
-
color: '#333',
|
|
781
|
-
marginBottom: 12,
|
|
782
|
-
textAlign: 'center'
|
|
627
|
+
color: '#666'
|
|
783
628
|
},
|
|
784
|
-
|
|
785
|
-
|
|
629
|
+
completeButton: {
|
|
630
|
+
paddingVertical: 16,
|
|
631
|
+
paddingHorizontal: 32,
|
|
632
|
+
borderRadius: 16,
|
|
633
|
+
backgroundColor: '#fff',
|
|
786
634
|
borderWidth: 1,
|
|
787
|
-
borderColor: '#
|
|
788
|
-
borderRadius: 8,
|
|
789
|
-
paddingHorizontal: 16,
|
|
790
|
-
fontSize: 16,
|
|
791
|
-
marginBottom: 8
|
|
635
|
+
borderColor: '#000'
|
|
792
636
|
},
|
|
793
|
-
|
|
794
|
-
|
|
637
|
+
completeButtonText: {
|
|
638
|
+
fontSize: 16,
|
|
639
|
+
fontWeight: '600',
|
|
640
|
+
color: '#000'
|
|
795
641
|
},
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
marginBottom: 16
|
|
642
|
+
onairosLogo: {
|
|
643
|
+
width: 48,
|
|
644
|
+
height: 48
|
|
800
645
|
},
|
|
801
|
-
|
|
646
|
+
errorContainer: {
|
|
802
647
|
flexDirection: 'row',
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
paddingTop: 16
|
|
806
|
-
},
|
|
807
|
-
completeButton: {
|
|
808
|
-
paddingVertical: 12,
|
|
809
|
-
paddingHorizontal: 24,
|
|
810
|
-
backgroundColor: '#1BA9D4',
|
|
811
|
-
borderRadius: 8
|
|
812
|
-
},
|
|
813
|
-
disabledButton: {
|
|
814
|
-
backgroundColor: '#CCCCCC',
|
|
815
|
-
opacity: 0.7
|
|
816
|
-
},
|
|
817
|
-
completeButtonText: {
|
|
818
|
-
color: '#fff',
|
|
819
|
-
fontSize: 16,
|
|
820
|
-
fontWeight: '600'
|
|
648
|
+
alignItems: 'center',
|
|
649
|
+
marginBottom: 16
|
|
821
650
|
},
|
|
822
|
-
|
|
651
|
+
errorText: {
|
|
823
652
|
fontSize: 14,
|
|
824
|
-
color: '#
|
|
653
|
+
color: '#FF6B6B',
|
|
825
654
|
marginLeft: 8
|
|
826
655
|
},
|
|
827
|
-
|
|
828
|
-
backgroundColor: '#FF3B30'
|
|
829
|
-
},
|
|
830
|
-
primaryAuthHeader: {
|
|
656
|
+
errorDetailsContainer: {
|
|
831
657
|
alignItems: 'center',
|
|
832
658
|
marginBottom: 24,
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
color: '#333',
|
|
839
|
-
marginBottom: 8,
|
|
840
|
-
textAlign: 'center'
|
|
659
|
+
padding: 16,
|
|
660
|
+
backgroundColor: '#FFF5F5',
|
|
661
|
+
borderRadius: 12,
|
|
662
|
+
borderWidth: 1,
|
|
663
|
+
borderColor: '#FFEBEE'
|
|
841
664
|
},
|
|
842
|
-
|
|
665
|
+
errorTitle: {
|
|
843
666
|
fontSize: 16,
|
|
844
|
-
color: '#555',
|
|
845
|
-
textAlign: 'center',
|
|
846
|
-
marginBottom: 16
|
|
847
|
-
},
|
|
848
|
-
matchContainer: {
|
|
849
|
-
alignItems: 'center',
|
|
850
|
-
padding: 20
|
|
851
|
-
},
|
|
852
|
-
matchTitle: {
|
|
853
|
-
fontSize: 24,
|
|
854
667
|
fontWeight: '600',
|
|
855
|
-
color: '#
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
},
|
|
859
|
-
matchLoader: {
|
|
860
|
-
marginVertical: 20
|
|
861
|
-
},
|
|
862
|
-
matchMessage: {
|
|
863
|
-
fontSize: 16,
|
|
864
|
-
color: '#555',
|
|
865
|
-
textAlign: 'center',
|
|
866
|
-
marginVertical: 12
|
|
668
|
+
color: '#FF6B6B',
|
|
669
|
+
marginTop: 8,
|
|
670
|
+
marginBottom: 4
|
|
867
671
|
},
|
|
868
|
-
|
|
672
|
+
errorDescription: {
|
|
869
673
|
fontSize: 14,
|
|
870
|
-
color: '#
|
|
871
|
-
textAlign: 'center'
|
|
872
|
-
marginTop: 8
|
|
873
|
-
},
|
|
874
|
-
matchCircle: {
|
|
875
|
-
width: 80,
|
|
876
|
-
height: 80,
|
|
877
|
-
borderRadius: 40,
|
|
878
|
-
backgroundColor: '#E9C46A',
|
|
879
|
-
justifyContent: 'center',
|
|
880
|
-
alignItems: 'center',
|
|
881
|
-
marginVertical: 16
|
|
882
|
-
},
|
|
883
|
-
matchCount: {
|
|
884
|
-
fontSize: 32,
|
|
885
|
-
fontWeight: 'bold',
|
|
886
|
-
color: '#FFFFFF'
|
|
674
|
+
color: '#666',
|
|
675
|
+
textAlign: 'center'
|
|
887
676
|
},
|
|
888
|
-
|
|
889
|
-
marginTop: 40,
|
|
890
|
-
width: '85%',
|
|
891
|
-
height: 50,
|
|
892
|
-
backgroundColor: '#000000',
|
|
893
|
-
borderRadius: 8,
|
|
894
|
-
justifyContent: 'center',
|
|
677
|
+
resultsContainer: {
|
|
895
678
|
alignItems: 'center',
|
|
896
|
-
|
|
679
|
+
marginBottom: 24,
|
|
680
|
+
padding: 16,
|
|
681
|
+
backgroundColor: '#F5F5F5',
|
|
682
|
+
borderRadius: 12,
|
|
683
|
+
borderWidth: 1,
|
|
684
|
+
borderColor: '#E0E0E0'
|
|
897
685
|
},
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
fontSize: 18,
|
|
686
|
+
resultsTitle: {
|
|
687
|
+
fontSize: 16,
|
|
901
688
|
fontWeight: '600',
|
|
902
|
-
|
|
689
|
+
color: '#4CAF50',
|
|
690
|
+
marginTop: 8,
|
|
691
|
+
marginBottom: 12
|
|
903
692
|
},
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
justifyContent: 'flex-end'
|
|
908
|
-
},
|
|
909
|
-
keyboardAvoidingView: {
|
|
910
|
-
flex: 1,
|
|
911
|
-
justifyContent: 'flex-end',
|
|
912
|
-
alignItems: 'stretch',
|
|
913
|
-
margin: 0,
|
|
914
|
-
padding: 0
|
|
915
|
-
},
|
|
916
|
-
modalContent: {
|
|
917
|
-
backgroundColor: '#fff',
|
|
918
|
-
borderTopLeftRadius: 20,
|
|
919
|
-
borderTopRightRadius: 20,
|
|
920
|
-
padding: 24,
|
|
921
|
-
paddingTop: 12,
|
|
922
|
-
minHeight: height * 0.4,
|
|
923
|
-
maxHeight: height * 0.9
|
|
924
|
-
},
|
|
925
|
-
closeButton: {
|
|
926
|
-
position: 'absolute',
|
|
927
|
-
top: 15,
|
|
928
|
-
// Adjust as needed for visual balance with grabber and padding
|
|
929
|
-
right: 20,
|
|
930
|
-
// Adjust as needed
|
|
931
|
-
padding: 5,
|
|
932
|
-
// Make it easier to tap
|
|
933
|
-
zIndex: 10 // Ensure it's above other content
|
|
934
|
-
},
|
|
935
|
-
closeButtonText: {
|
|
936
|
-
fontSize: 24,
|
|
937
|
-
// Make it a bit larger
|
|
938
|
-
color: '#888',
|
|
939
|
-
// Subtle color
|
|
940
|
-
fontWeight: '300'
|
|
693
|
+
resultsDetails: {
|
|
694
|
+
alignItems: 'flex-start',
|
|
695
|
+
width: '100%'
|
|
941
696
|
},
|
|
942
|
-
|
|
943
|
-
|
|
697
|
+
resultItem: {
|
|
698
|
+
flexDirection: 'row',
|
|
699
|
+
alignItems: 'center',
|
|
700
|
+
marginBottom: 4
|
|
944
701
|
},
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
backgroundColor: '#E0E0E0'
|
|
702
|
+
resultText: {
|
|
703
|
+
fontSize: 14,
|
|
704
|
+
color: '#666',
|
|
705
|
+
marginLeft: 8
|
|
950
706
|
}
|
|
951
707
|
});
|
|
952
708
|
//# sourceMappingURL=TrainingModal.js.map
|