@onairos/react-native 3.1.18 → 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.
Files changed (729) hide show
  1. package/README.md +374 -403
  2. package/lib/commonjs/api/index.js +1 -75
  3. package/lib/commonjs/api/index.js.map +1 -1
  4. package/lib/commonjs/assets/images/email.png +0 -0
  5. package/lib/commonjs/assets/images/linkedin.png +0 -0
  6. package/lib/commonjs/assets/images/reddit.png +0 -0
  7. package/lib/commonjs/assets/images/youtube.png +0 -0
  8. package/lib/commonjs/components/DataRequestModal.js.map +1 -1
  9. package/lib/commonjs/components/DataRequestScreen.js.map +1 -1
  10. package/lib/commonjs/components/EmailVerificationModal.js.map +1 -1
  11. package/lib/commonjs/components/Onairos.js +3 -1
  12. package/lib/commonjs/components/Onairos.js.map +1 -1
  13. package/lib/commonjs/components/OnairosButton.js +190 -171
  14. package/lib/commonjs/components/OnairosButton.js.map +1 -1
  15. package/lib/commonjs/components/Overlay.js +5 -5
  16. package/lib/commonjs/components/Overlay.js.map +1 -1
  17. package/lib/commonjs/components/PinInput.js +120 -282
  18. package/lib/commonjs/components/PinInput.js.map +1 -1
  19. package/lib/commonjs/components/PlatformList.js.map +1 -1
  20. package/lib/commonjs/components/TrainingModal.js +563 -808
  21. package/lib/commonjs/components/TrainingModal.js.map +1 -1
  22. package/lib/commonjs/components/UniversalOnboarding.js +1283 -2304
  23. package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
  24. package/lib/commonjs/components/UniversalOnboarding.tsx.new +455 -0
  25. package/lib/commonjs/components/onboarding/OAuthWebView.js +743 -134
  26. package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
  27. package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +1 -1
  28. package/lib/commonjs/components/onboarding/PinInput.js.map +1 -1
  29. package/lib/commonjs/components/onboarding/PlatformConnector.js.map +1 -1
  30. package/lib/commonjs/components/screens/ConnectorScreen.js.map +1 -1
  31. package/lib/commonjs/components/screens/LoadingScreen.js.map +1 -1
  32. package/lib/commonjs/components/screens/PinCreationScreen.js.map +1 -1
  33. package/lib/commonjs/constants/index.js.map +1 -1
  34. package/lib/commonjs/hooks/useConnections.js +125 -120
  35. package/lib/commonjs/hooks/useConnections.js.map +1 -1
  36. package/lib/commonjs/hooks/useCredentials.js.map +1 -1
  37. package/lib/commonjs/index.js +31 -201
  38. package/lib/commonjs/index.js.map +1 -1
  39. package/lib/commonjs/services/apiKeyService.js +102 -101
  40. package/lib/commonjs/services/apiKeyService.js.map +1 -1
  41. package/lib/commonjs/services/oauthService.js.map +1 -1
  42. package/lib/commonjs/services/platformAuthService.js +722 -956
  43. package/lib/commonjs/services/platformAuthService.js.map +1 -1
  44. package/lib/commonjs/types/ambient.d.js.map +1 -1
  45. package/lib/commonjs/types/declarations.d.js.map +1 -1
  46. package/lib/commonjs/types/index.d.js.map +1 -1
  47. package/lib/commonjs/types/index.js.map +1 -1
  48. package/lib/commonjs/types/node-fix.d.js.map +1 -1
  49. package/lib/commonjs/types/node-override.d.js.map +1 -1
  50. package/lib/commonjs/types/opacity.d.js.map +1 -1
  51. package/lib/commonjs/types/types.d.js.map +1 -1
  52. package/lib/commonjs/types.js.map +1 -1
  53. package/lib/commonjs/utils/Portal.js +4 -4
  54. package/lib/commonjs/utils/Portal.js.map +1 -1
  55. package/lib/commonjs/utils/api.js +24 -24
  56. package/lib/commonjs/utils/api.js.map +1 -1
  57. package/lib/commonjs/utils/auth.js +18 -18
  58. package/lib/commonjs/utils/auth.js.map +1 -1
  59. package/lib/commonjs/utils/crypto.js +13 -13
  60. package/lib/commonjs/utils/crypto.js.map +1 -1
  61. package/lib/commonjs/utils/debugHelper.js.map +1 -1
  62. package/lib/commonjs/utils/encryption.js +12 -12
  63. package/lib/commonjs/utils/encryption.js.map +1 -1
  64. package/lib/commonjs/utils/onairosApi.js.map +1 -1
  65. package/lib/commonjs/utils/programmaticFlow.js +16 -16
  66. package/lib/commonjs/utils/programmaticFlow.js.map +1 -1
  67. package/lib/commonjs/utils/retryHelper.js +27 -27
  68. package/lib/commonjs/utils/retryHelper.js.map +1 -1
  69. package/lib/commonjs/utils/secureStorage.js.map +1 -1
  70. package/lib/module/api/index.js +0 -72
  71. package/lib/module/api/index.js.map +1 -1
  72. package/lib/module/assets/images/email.png +0 -0
  73. package/lib/module/assets/images/linkedin.png +0 -0
  74. package/lib/module/assets/images/reddit.png +0 -0
  75. package/lib/module/assets/images/youtube.png +0 -0
  76. package/lib/module/components/DataRequestModal.js.map +1 -1
  77. package/lib/module/components/DataRequestScreen.js.map +1 -1
  78. package/lib/module/components/EmailVerificationModal.js.map +1 -1
  79. package/lib/module/components/Onairos.js +3 -1
  80. package/lib/module/components/Onairos.js.map +1 -1
  81. package/lib/module/components/OnairosButton.js +192 -172
  82. package/lib/module/components/OnairosButton.js.map +1 -1
  83. package/lib/module/components/Overlay.js +5 -5
  84. package/lib/module/components/Overlay.js.map +1 -1
  85. package/lib/module/components/PinInput.js +120 -283
  86. package/lib/module/components/PinInput.js.map +1 -1
  87. package/lib/module/components/PlatformList.js.map +1 -1
  88. package/lib/module/components/TrainingModal.js +565 -809
  89. package/lib/module/components/TrainingModal.js.map +1 -1
  90. package/lib/module/components/UniversalOnboarding.js +1284 -2307
  91. package/lib/module/components/UniversalOnboarding.js.map +1 -1
  92. package/lib/module/components/UniversalOnboarding.tsx.new +455 -0
  93. package/lib/module/components/onboarding/OAuthWebView.js +744 -136
  94. package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
  95. package/lib/module/components/onboarding/OnboardingHeader.js.map +1 -1
  96. package/lib/module/components/onboarding/PinInput.js.map +1 -1
  97. package/lib/module/components/onboarding/PlatformConnector.js.map +1 -1
  98. package/lib/module/components/screens/ConnectorScreen.js.map +1 -1
  99. package/lib/module/components/screens/LoadingScreen.js.map +1 -1
  100. package/lib/module/components/screens/PinCreationScreen.js.map +1 -1
  101. package/lib/module/constants/index.js.map +1 -1
  102. package/lib/module/hooks/useConnections.js +125 -119
  103. package/lib/module/hooks/useConnections.js.map +1 -1
  104. package/lib/module/hooks/useCredentials.js.map +1 -1
  105. package/lib/module/index.js +17 -55
  106. package/lib/module/index.js.map +1 -1
  107. package/lib/module/services/apiKeyService.js +102 -101
  108. package/lib/module/services/apiKeyService.js.map +1 -1
  109. package/lib/module/services/oauthService.js.map +1 -1
  110. package/lib/module/services/platformAuthService.js +704 -943
  111. package/lib/module/services/platformAuthService.js.map +1 -1
  112. package/lib/module/types/ambient.d.js.map +1 -1
  113. package/lib/module/types/declarations.d.js.map +1 -1
  114. package/lib/module/types/index.d.js.map +1 -1
  115. package/lib/module/types/index.js.map +1 -1
  116. package/lib/module/types/node-fix.d.js.map +1 -1
  117. package/lib/module/types/node-override.d.js.map +1 -1
  118. package/lib/module/types/opacity.d.js.map +1 -1
  119. package/lib/module/types/types.d.js.map +1 -1
  120. package/lib/module/types.js.map +1 -1
  121. package/lib/module/utils/Portal.js +4 -4
  122. package/lib/module/utils/Portal.js.map +1 -1
  123. package/lib/module/utils/api.js +24 -24
  124. package/lib/module/utils/api.js.map +1 -1
  125. package/lib/module/utils/auth.js +18 -18
  126. package/lib/module/utils/auth.js.map +1 -1
  127. package/lib/module/utils/crypto.js +13 -13
  128. package/lib/module/utils/crypto.js.map +1 -1
  129. package/lib/module/utils/debugHelper.js.map +1 -1
  130. package/lib/module/utils/encryption.js +12 -12
  131. package/lib/module/utils/encryption.js.map +1 -1
  132. package/lib/module/utils/onairosApi.js.map +1 -1
  133. package/lib/module/utils/programmaticFlow.js +16 -16
  134. package/lib/module/utils/programmaticFlow.js.map +1 -1
  135. package/lib/module/utils/retryHelper.js +27 -27
  136. package/lib/module/utils/retryHelper.js.map +1 -1
  137. package/lib/module/utils/secureStorage.js.map +1 -1
  138. package/lib/typescript/api/index.d.ts +7 -15
  139. package/lib/typescript/api/index.d.ts.map +1 -1
  140. package/lib/typescript/components/DataRequestModal.d.ts +10 -10
  141. package/lib/typescript/components/DataRequestScreen.d.ts +10 -10
  142. package/lib/typescript/components/EmailVerificationModal.d.ts +10 -10
  143. package/lib/typescript/components/Onairos.d.ts +3 -3
  144. package/lib/typescript/components/Onairos.d.ts.map +1 -1
  145. package/lib/typescript/components/OnairosButton.d.ts +11 -36
  146. package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
  147. package/lib/typescript/components/Overlay.d.ts +3 -3
  148. package/lib/typescript/components/PinInput.d.ts +3 -13
  149. package/lib/typescript/components/PinInput.d.ts.map +1 -1
  150. package/lib/typescript/components/PlatformList.d.ts +3 -3
  151. package/lib/typescript/components/TrainingModal.d.ts +3 -14
  152. package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
  153. package/lib/typescript/components/UniversalOnboarding.d.ts +3 -16
  154. package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
  155. package/lib/typescript/components/onboarding/OAuthWebView.d.ts +9 -9
  156. package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
  157. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +10 -10
  158. package/lib/typescript/components/onboarding/PinInput.d.ts +3 -3
  159. package/lib/typescript/components/onboarding/PlatformConnector.d.ts +12 -12
  160. package/lib/typescript/components/screens/ConnectorScreen.d.ts +8 -8
  161. package/lib/typescript/components/screens/LoadingScreen.d.ts +8 -8
  162. package/lib/typescript/components/screens/PinCreationScreen.d.ts +9 -9
  163. package/lib/typescript/constants/index.d.ts +52 -52
  164. package/lib/typescript/hooks/useConnections.d.ts +8 -13
  165. package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
  166. package/lib/typescript/hooks/useCredentials.d.ts +8 -8
  167. package/lib/typescript/index.d.ts +17 -38
  168. package/lib/typescript/index.d.ts.map +1 -1
  169. package/lib/typescript/services/apiKeyService.d.ts +131 -131
  170. package/lib/typescript/services/apiKeyService.d.ts.map +1 -1
  171. package/lib/typescript/services/oauthService.d.ts +49 -49
  172. package/lib/typescript/services/platformAuthService.d.ts +143 -68
  173. package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
  174. package/lib/typescript/types/index.d.ts +225 -264
  175. package/lib/typescript/types/index.d.ts.map +1 -1
  176. package/lib/typescript/types.d.ts +266 -266
  177. package/lib/typescript/utils/Portal.d.ts +13 -13
  178. package/lib/typescript/utils/api.d.ts +5 -5
  179. package/lib/typescript/utils/auth.d.ts +5 -5
  180. package/lib/typescript/utils/crypto.d.ts +3 -3
  181. package/lib/typescript/utils/debugHelper.d.ts +28 -28
  182. package/lib/typescript/utils/encryption.d.ts +18 -18
  183. package/lib/typescript/utils/onairosApi.d.ts +86 -86
  184. package/lib/typescript/utils/programmaticFlow.d.ts +22 -22
  185. package/lib/typescript/utils/retryHelper.d.ts +68 -68
  186. package/lib/typescript/utils/secureStorage.d.ts +93 -93
  187. package/package.json +149 -145
  188. package/src/api/index.ts +110 -151
  189. package/src/assets/images/email.png +0 -0
  190. package/src/assets/images/linkedin.png +0 -0
  191. package/src/assets/images/reddit.png +0 -0
  192. package/src/assets/images/youtube.png +0 -0
  193. package/src/components/DataRequestScreen.tsx +355 -355
  194. package/src/components/EmailVerificationModal.tsx +363 -363
  195. package/src/components/Onairos.tsx +424 -422
  196. package/src/components/OnairosButton.tsx +359 -339
  197. package/src/components/Overlay.tsx +506 -506
  198. package/src/components/PinInput.tsx +343 -555
  199. package/src/components/PlatformList.tsx +144 -144
  200. package/src/components/TrainingModal.tsx +737 -1047
  201. package/src/components/UniversalOnboarding.tsx +1820 -2888
  202. package/src/components/UniversalOnboarding.tsx.new +455 -0
  203. package/src/components/onboarding/OAuthWebView.tsx +838 -232
  204. package/src/hooks/useConnections.ts +163 -161
  205. package/src/hooks/useCredentials.ts +174 -174
  206. package/src/index.js +14 -14
  207. package/src/index.ts +49 -99
  208. package/src/services/apiKeyService.ts +921 -919
  209. package/src/services/platformAuthService.ts +1113 -1346
  210. package/src/types/ambient.d.ts +28 -28
  211. package/src/types/index.ts +238 -265
  212. package/src/types/node-fix.d.ts +18 -18
  213. package/src/types/node-override.d.ts +23 -23
  214. package/src/types/opacity.d.ts +15 -15
  215. package/src/types/types.d.ts +17 -17
  216. package/src/utils/Portal.tsx +82 -82
  217. package/src/utils/api.js +111 -111
  218. package/src/utils/auth.js +103 -103
  219. package/src/utils/crypto.js +59 -59
  220. package/src/utils/encryption.ts +68 -68
  221. package/src/utils/programmaticFlow.ts +112 -112
  222. package/src/utils/retryHelper.ts +274 -274
  223. package/types/index.d.ts +213 -213
  224. package/types/node-env.d.ts +14 -14
  225. package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  226. package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  227. package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
  228. package/lib/commonjs/assets/icons/Gmail.png +0 -0
  229. package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
  230. package/lib/commonjs/assets/icons/Redditicon.png +0 -0
  231. package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
  232. package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
  233. package/lib/commonjs/assets/icons/farcaster.png +0 -0
  234. package/lib/commonjs/assets/icons/instagram.png +0 -0
  235. package/lib/commonjs/assets/icons/pinterest.png +0 -0
  236. package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
  237. package/lib/commonjs/assets/icons/twitter.jpg +0 -0
  238. package/lib/commonjs/assets/images/Checkbox.svg +0 -3
  239. package/lib/commonjs/assets/images/EnochE.svg +0 -19
  240. package/lib/commonjs/assets/images/Enochicon1.png +0 -0
  241. package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
  242. package/lib/commonjs/assets/images/Facebookicon.png +0 -0
  243. package/lib/commonjs/assets/images/Gmail.png +0 -0
  244. package/lib/commonjs/assets/images/Googlelogo.png +0 -0
  245. package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
  246. package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
  247. package/lib/commonjs/assets/images/Personalityprofile.svg +0 -3
  248. package/lib/commonjs/assets/images/Personalitytraits.svg +0 -3
  249. package/lib/commonjs/assets/images/Redditicon.png +0 -0
  250. package/lib/commonjs/assets/images/Userpreferences.svg +0 -3
  251. package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
  252. package/lib/commonjs/assets/images/arrow.svg +0 -20
  253. package/lib/commonjs/assets/images/basicproficon.svg +0 -43
  254. package/lib/commonjs/assets/images/basicprofile.svg +0 -3
  255. package/lib/commonjs/assets/images/checkmark.svg +0 -4
  256. package/lib/commonjs/assets/images/contentanalysis.svg +0 -3
  257. package/lib/commonjs/assets/images/contenticon.svg +0 -23
  258. package/lib/commonjs/assets/images/persona1.png +0 -0
  259. package/lib/commonjs/assets/images/persona2.png +0 -0
  260. package/lib/commonjs/assets/images/persona3.png +0 -0
  261. package/lib/commonjs/assets/images/persona4.png +0 -0
  262. package/lib/commonjs/assets/images/persona5.png +0 -0
  263. package/lib/commonjs/assets/images/personalityicon.svg +0 -18
  264. package/lib/commonjs/assets/images/x-close.svg +0 -3
  265. package/lib/commonjs/components/BodyText.js +0 -27
  266. package/lib/commonjs/components/BodyText.js.map +0 -1
  267. package/lib/commonjs/components/BrandMark.js +0 -44
  268. package/lib/commonjs/components/BrandMark.js.map +0 -1
  269. package/lib/commonjs/components/CodeInput.js +0 -30
  270. package/lib/commonjs/components/CodeInput.js.map +0 -1
  271. package/lib/commonjs/components/EmailInput.js +0 -30
  272. package/lib/commonjs/components/EmailInput.js.map +0 -1
  273. package/lib/commonjs/components/ExistingUserDataConfirmation.js +0 -474
  274. package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +0 -1
  275. package/lib/commonjs/components/GoogleButton.js +0 -55
  276. package/lib/commonjs/components/GoogleButton.js.map +0 -1
  277. package/lib/commonjs/components/HeadingGroup.js +0 -43
  278. package/lib/commonjs/components/HeadingGroup.js.map +0 -1
  279. package/lib/commonjs/components/ModalHeader.js +0 -99
  280. package/lib/commonjs/components/ModalHeader.js.map +0 -1
  281. package/lib/commonjs/components/ModalSheet.js +0 -47
  282. package/lib/commonjs/components/ModalSheet.js.map +0 -1
  283. package/lib/commonjs/components/OnairosSignInButton.js +0 -129
  284. package/lib/commonjs/components/OnairosSignInButton.js.map +0 -1
  285. package/lib/commonjs/components/PersonaImage.js +0 -60
  286. package/lib/commonjs/components/PersonaImage.js.map +0 -1
  287. package/lib/commonjs/components/PersonaLoadingScreen.js +0 -156
  288. package/lib/commonjs/components/PersonaLoadingScreen.js.map +0 -1
  289. package/lib/commonjs/components/PersonalizationConsentScreen.js +0 -316
  290. package/lib/commonjs/components/PersonalizationConsentScreen.js.map +0 -1
  291. package/lib/commonjs/components/PinCreationScreen.js +0 -393
  292. package/lib/commonjs/components/PinCreationScreen.js.map +0 -1
  293. package/lib/commonjs/components/PlatformConnectorsStep.js +0 -828
  294. package/lib/commonjs/components/PlatformConnectorsStep.js.map +0 -1
  295. package/lib/commonjs/components/PlatformToggle.js +0 -180
  296. package/lib/commonjs/components/PlatformToggle.js.map +0 -1
  297. package/lib/commonjs/components/PrimaryButton.js +0 -180
  298. package/lib/commonjs/components/PrimaryButton.js.map +0 -1
  299. package/lib/commonjs/components/SignInMatchAnimation.js +0 -197
  300. package/lib/commonjs/components/SignInMatchAnimation.js.map +0 -1
  301. package/lib/commonjs/components/SignInStep.js +0 -179
  302. package/lib/commonjs/components/SignInStep.js.map +0 -1
  303. package/lib/commonjs/components/VerificationStep.js +0 -154
  304. package/lib/commonjs/components/VerificationStep.js.map +0 -1
  305. package/lib/commonjs/components/WelcomeScreen.js +0 -401
  306. package/lib/commonjs/components/WelcomeScreen.js.map +0 -1
  307. package/lib/commonjs/components/icons/Basicproficon.js +0 -37
  308. package/lib/commonjs/components/icons/Basicproficon.js.map +0 -1
  309. package/lib/commonjs/components/icons/Basicprofile.js +0 -21
  310. package/lib/commonjs/components/icons/Basicprofile.js.map +0 -1
  311. package/lib/commonjs/components/icons/Checkbox.js +0 -21
  312. package/lib/commonjs/components/icons/Checkbox.js.map +0 -1
  313. package/lib/commonjs/components/icons/Checkmark.js +0 -27
  314. package/lib/commonjs/components/icons/Checkmark.js.map +0 -1
  315. package/lib/commonjs/components/icons/Contentanalysis.js +0 -21
  316. package/lib/commonjs/components/icons/Contentanalysis.js.map +0 -1
  317. package/lib/commonjs/components/icons/Contenticon.js +0 -39
  318. package/lib/commonjs/components/icons/Contenticon.js.map +0 -1
  319. package/lib/commonjs/components/icons/EnochE.js +0 -41
  320. package/lib/commonjs/components/icons/EnochE.js.map +0 -1
  321. package/lib/commonjs/components/icons/Personalityicon.js +0 -30
  322. package/lib/commonjs/components/icons/Personalityicon.js.map +0 -1
  323. package/lib/commonjs/components/icons/Personalityprofile.js +0 -21
  324. package/lib/commonjs/components/icons/Personalityprofile.js.map +0 -1
  325. package/lib/commonjs/components/icons/Personalitytraits.js +0 -21
  326. package/lib/commonjs/components/icons/Personalitytraits.js.map +0 -1
  327. package/lib/commonjs/components/icons/Userpreferences.js +0 -21
  328. package/lib/commonjs/components/icons/Userpreferences.js.map +0 -1
  329. package/lib/commonjs/components/icons/index.js +0 -84
  330. package/lib/commonjs/components/icons/index.js.map +0 -1
  331. package/lib/commonjs/config/api.js +0 -34
  332. package/lib/commonjs/config/api.js.map +0 -1
  333. package/lib/commonjs/context/AuthContext.js +0 -345
  334. package/lib/commonjs/context/AuthContext.js.map +0 -1
  335. package/lib/commonjs/hooks/useConnectedAccounts.js +0 -111
  336. package/lib/commonjs/hooks/useConnectedAccounts.js.map +0 -1
  337. package/lib/commonjs/hooks/useUserConnections.js +0 -148
  338. package/lib/commonjs/hooks/useUserConnections.js.map +0 -1
  339. package/lib/commonjs/services/apiClient.js +0 -302
  340. package/lib/commonjs/services/apiClient.js.map +0 -1
  341. package/lib/commonjs/services/authService.js +0 -935
  342. package/lib/commonjs/services/authService.js.map +0 -1
  343. package/lib/commonjs/services/biometricPinService.js +0 -184
  344. package/lib/commonjs/services/biometricPinService.js.map +0 -1
  345. package/lib/commonjs/services/connectedAccountsService.js +0 -268
  346. package/lib/commonjs/services/connectedAccountsService.js.map +0 -1
  347. package/lib/commonjs/services/googleAuthService.js +0 -268
  348. package/lib/commonjs/services/googleAuthService.js.map +0 -1
  349. package/lib/commonjs/services/imageCompressionService.js +0 -260
  350. package/lib/commonjs/services/imageCompressionService.js.map +0 -1
  351. package/lib/commonjs/services/jwtStorageService.js +0 -256
  352. package/lib/commonjs/services/jwtStorageService.js.map +0 -1
  353. package/lib/commonjs/services/mobileTrainingService.js +0 -185
  354. package/lib/commonjs/services/mobileTrainingService.js.map +0 -1
  355. package/lib/commonjs/services/pinEncryptionService.js +0 -84
  356. package/lib/commonjs/services/pinEncryptionService.js.map +0 -1
  357. package/lib/commonjs/services/pinStorageUtils.js +0 -105
  358. package/lib/commonjs/services/pinStorageUtils.js.map +0 -1
  359. package/lib/commonjs/services/storageService.js +0 -404
  360. package/lib/commonjs/services/storageService.js.map +0 -1
  361. package/lib/commonjs/services/trainingApiHelpers.js +0 -73
  362. package/lib/commonjs/services/trainingApiHelpers.js.map +0 -1
  363. package/lib/commonjs/services/userConnectionsService.js +0 -486
  364. package/lib/commonjs/services/userConnectionsService.js.map +0 -1
  365. package/lib/commonjs/services/youtubeMigrationService.js +0 -415
  366. package/lib/commonjs/services/youtubeMigrationService.js.map +0 -1
  367. package/lib/commonjs/theme/index.js +0 -249
  368. package/lib/commonjs/theme/index.js.map +0 -1
  369. package/lib/commonjs/utils/eventUtils.js +0 -288
  370. package/lib/commonjs/utils/eventUtils.js.map +0 -1
  371. package/lib/commonjs/utils/haptics.js +0 -66
  372. package/lib/commonjs/utils/haptics.js.map +0 -1
  373. package/lib/commonjs/utils/imagePreloader.js +0 -6
  374. package/lib/commonjs/utils/imagePreloader.js.map +0 -1
  375. package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  376. package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  377. package/lib/module/assets/icons/Facebookicon.png +0 -0
  378. package/lib/module/assets/icons/Gmail.png +0 -0
  379. package/lib/module/assets/icons/Linkedinicon.png +0 -0
  380. package/lib/module/assets/icons/Redditicon.png +0 -0
  381. package/lib/module/assets/icons/YouTubeicon2.png +0 -0
  382. package/lib/module/assets/icons/YouTubeicon3.png +0 -0
  383. package/lib/module/assets/icons/farcaster.png +0 -0
  384. package/lib/module/assets/icons/instagram.png +0 -0
  385. package/lib/module/assets/icons/pinterest.png +0 -0
  386. package/lib/module/assets/icons/swerv_logo.png +0 -0
  387. package/lib/module/assets/icons/twitter.jpg +0 -0
  388. package/lib/module/assets/images/Checkbox.svg +0 -3
  389. package/lib/module/assets/images/EnochE.svg +0 -19
  390. package/lib/module/assets/images/Enochicon1.png +0 -0
  391. package/lib/module/assets/images/Face_ID_logo.png +0 -0
  392. package/lib/module/assets/images/Facebookicon.png +0 -0
  393. package/lib/module/assets/images/Gmail.png +0 -0
  394. package/lib/module/assets/images/Googlelogo.png +0 -0
  395. package/lib/module/assets/images/Linkedinicon.png +0 -0
  396. package/lib/module/assets/images/Onairoslogo.png +0 -0
  397. package/lib/module/assets/images/Personalityprofile.svg +0 -3
  398. package/lib/module/assets/images/Personalitytraits.svg +0 -3
  399. package/lib/module/assets/images/Redditicon.png +0 -0
  400. package/lib/module/assets/images/Userpreferences.svg +0 -3
  401. package/lib/module/assets/images/YouTubeicon3.png +0 -0
  402. package/lib/module/assets/images/arrow.svg +0 -20
  403. package/lib/module/assets/images/basicproficon.svg +0 -43
  404. package/lib/module/assets/images/basicprofile.svg +0 -3
  405. package/lib/module/assets/images/checkmark.svg +0 -4
  406. package/lib/module/assets/images/contentanalysis.svg +0 -3
  407. package/lib/module/assets/images/contenticon.svg +0 -23
  408. package/lib/module/assets/images/persona1.png +0 -0
  409. package/lib/module/assets/images/persona2.png +0 -0
  410. package/lib/module/assets/images/persona3.png +0 -0
  411. package/lib/module/assets/images/persona4.png +0 -0
  412. package/lib/module/assets/images/persona5.png +0 -0
  413. package/lib/module/assets/images/personalityicon.svg +0 -18
  414. package/lib/module/assets/images/x-close.svg +0 -3
  415. package/lib/module/components/BodyText.js +0 -20
  416. package/lib/module/components/BodyText.js.map +0 -1
  417. package/lib/module/components/BrandMark.js +0 -37
  418. package/lib/module/components/BrandMark.js.map +0 -1
  419. package/lib/module/components/CodeInput.js +0 -23
  420. package/lib/module/components/CodeInput.js.map +0 -1
  421. package/lib/module/components/EmailInput.js +0 -23
  422. package/lib/module/components/EmailInput.js.map +0 -1
  423. package/lib/module/components/ExistingUserDataConfirmation.js +0 -465
  424. package/lib/module/components/ExistingUserDataConfirmation.js.map +0 -1
  425. package/lib/module/components/GoogleButton.js +0 -48
  426. package/lib/module/components/GoogleButton.js.map +0 -1
  427. package/lib/module/components/HeadingGroup.js +0 -36
  428. package/lib/module/components/HeadingGroup.js.map +0 -1
  429. package/lib/module/components/ModalHeader.js +0 -92
  430. package/lib/module/components/ModalHeader.js.map +0 -1
  431. package/lib/module/components/ModalSheet.js +0 -39
  432. package/lib/module/components/ModalSheet.js.map +0 -1
  433. package/lib/module/components/OnairosSignInButton.js +0 -120
  434. package/lib/module/components/OnairosSignInButton.js.map +0 -1
  435. package/lib/module/components/PersonaImage.js +0 -53
  436. package/lib/module/components/PersonaImage.js.map +0 -1
  437. package/lib/module/components/PersonaLoadingScreen.js +0 -148
  438. package/lib/module/components/PersonaLoadingScreen.js.map +0 -1
  439. package/lib/module/components/PersonalizationConsentScreen.js +0 -309
  440. package/lib/module/components/PersonalizationConsentScreen.js.map +0 -1
  441. package/lib/module/components/PinCreationScreen.js +0 -386
  442. package/lib/module/components/PinCreationScreen.js.map +0 -1
  443. package/lib/module/components/PlatformConnectorsStep.js +0 -820
  444. package/lib/module/components/PlatformConnectorsStep.js.map +0 -1
  445. package/lib/module/components/PlatformToggle.js +0 -173
  446. package/lib/module/components/PlatformToggle.js.map +0 -1
  447. package/lib/module/components/PrimaryButton.js +0 -172
  448. package/lib/module/components/PrimaryButton.js.map +0 -1
  449. package/lib/module/components/SignInMatchAnimation.js +0 -189
  450. package/lib/module/components/SignInMatchAnimation.js.map +0 -1
  451. package/lib/module/components/SignInStep.js +0 -171
  452. package/lib/module/components/SignInStep.js.map +0 -1
  453. package/lib/module/components/VerificationStep.js +0 -146
  454. package/lib/module/components/VerificationStep.js.map +0 -1
  455. package/lib/module/components/WelcomeScreen.js +0 -393
  456. package/lib/module/components/WelcomeScreen.js.map +0 -1
  457. package/lib/module/components/icons/Basicproficon.js +0 -30
  458. package/lib/module/components/icons/Basicproficon.js.map +0 -1
  459. package/lib/module/components/icons/Basicprofile.js +0 -14
  460. package/lib/module/components/icons/Basicprofile.js.map +0 -1
  461. package/lib/module/components/icons/Checkbox.js +0 -14
  462. package/lib/module/components/icons/Checkbox.js.map +0 -1
  463. package/lib/module/components/icons/Checkmark.js +0 -20
  464. package/lib/module/components/icons/Checkmark.js.map +0 -1
  465. package/lib/module/components/icons/Contentanalysis.js +0 -14
  466. package/lib/module/components/icons/Contentanalysis.js.map +0 -1
  467. package/lib/module/components/icons/Contenticon.js +0 -32
  468. package/lib/module/components/icons/Contenticon.js.map +0 -1
  469. package/lib/module/components/icons/EnochE.js +0 -34
  470. package/lib/module/components/icons/EnochE.js.map +0 -1
  471. package/lib/module/components/icons/Personalityicon.js +0 -23
  472. package/lib/module/components/icons/Personalityicon.js.map +0 -1
  473. package/lib/module/components/icons/Personalityprofile.js +0 -14
  474. package/lib/module/components/icons/Personalityprofile.js.map +0 -1
  475. package/lib/module/components/icons/Personalitytraits.js +0 -14
  476. package/lib/module/components/icons/Personalitytraits.js.map +0 -1
  477. package/lib/module/components/icons/Userpreferences.js +0 -14
  478. package/lib/module/components/icons/Userpreferences.js.map +0 -1
  479. package/lib/module/components/icons/index.js +0 -13
  480. package/lib/module/components/icons/index.js.map +0 -1
  481. package/lib/module/config/api.js +0 -26
  482. package/lib/module/config/api.js.map +0 -1
  483. package/lib/module/context/AuthContext.js +0 -335
  484. package/lib/module/context/AuthContext.js.map +0 -1
  485. package/lib/module/hooks/useConnectedAccounts.js +0 -106
  486. package/lib/module/hooks/useConnectedAccounts.js.map +0 -1
  487. package/lib/module/hooks/useUserConnections.js +0 -140
  488. package/lib/module/hooks/useUserConnections.js.map +0 -1
  489. package/lib/module/services/apiClient.js +0 -298
  490. package/lib/module/services/apiClient.js.map +0 -1
  491. package/lib/module/services/authService.js +0 -905
  492. package/lib/module/services/authService.js.map +0 -1
  493. package/lib/module/services/biometricPinService.js +0 -173
  494. package/lib/module/services/biometricPinService.js.map +0 -1
  495. package/lib/module/services/connectedAccountsService.js +0 -255
  496. package/lib/module/services/connectedAccountsService.js.map +0 -1
  497. package/lib/module/services/googleAuthService.js +0 -258
  498. package/lib/module/services/googleAuthService.js.map +0 -1
  499. package/lib/module/services/imageCompressionService.js +0 -250
  500. package/lib/module/services/imageCompressionService.js.map +0 -1
  501. package/lib/module/services/jwtStorageService.js +0 -239
  502. package/lib/module/services/jwtStorageService.js.map +0 -1
  503. package/lib/module/services/mobileTrainingService.js +0 -172
  504. package/lib/module/services/mobileTrainingService.js.map +0 -1
  505. package/lib/module/services/pinEncryptionService.js +0 -75
  506. package/lib/module/services/pinEncryptionService.js.map +0 -1
  507. package/lib/module/services/pinStorageUtils.js +0 -93
  508. package/lib/module/services/pinStorageUtils.js.map +0 -1
  509. package/lib/module/services/storageService.js +0 -383
  510. package/lib/module/services/storageService.js.map +0 -1
  511. package/lib/module/services/trainingApiHelpers.js +0 -67
  512. package/lib/module/services/trainingApiHelpers.js.map +0 -1
  513. package/lib/module/services/userConnectionsService.js +0 -476
  514. package/lib/module/services/userConnectionsService.js.map +0 -1
  515. package/lib/module/services/youtubeMigrationService.js +0 -404
  516. package/lib/module/services/youtubeMigrationService.js.map +0 -1
  517. package/lib/module/theme/index.js +0 -244
  518. package/lib/module/theme/index.js.map +0 -1
  519. package/lib/module/utils/eventUtils.js +0 -270
  520. package/lib/module/utils/eventUtils.js.map +0 -1
  521. package/lib/module/utils/haptics.js +0 -59
  522. package/lib/module/utils/haptics.js.map +0 -1
  523. package/lib/module/utils/imagePreloader.js +0 -3
  524. package/lib/module/utils/imagePreloader.js.map +0 -1
  525. package/lib/typescript/components/BodyText.d.ts +0 -10
  526. package/lib/typescript/components/BodyText.d.ts.map +0 -1
  527. package/lib/typescript/components/BrandMark.d.ts +0 -11
  528. package/lib/typescript/components/BrandMark.d.ts.map +0 -1
  529. package/lib/typescript/components/CodeInput.d.ts +0 -10
  530. package/lib/typescript/components/CodeInput.d.ts.map +0 -1
  531. package/lib/typescript/components/EmailInput.d.ts +0 -8
  532. package/lib/typescript/components/EmailInput.d.ts.map +0 -1
  533. package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +0 -12
  534. package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +0 -1
  535. package/lib/typescript/components/GoogleButton.d.ts +0 -11
  536. package/lib/typescript/components/GoogleButton.d.ts.map +0 -1
  537. package/lib/typescript/components/HeadingGroup.d.ts +0 -11
  538. package/lib/typescript/components/HeadingGroup.d.ts.map +0 -1
  539. package/lib/typescript/components/ModalHeader.d.ts +0 -11
  540. package/lib/typescript/components/ModalHeader.d.ts.map +0 -1
  541. package/lib/typescript/components/ModalSheet.d.ts +0 -13
  542. package/lib/typescript/components/ModalSheet.d.ts.map +0 -1
  543. package/lib/typescript/components/OnairosSignInButton.d.ts +0 -13
  544. package/lib/typescript/components/OnairosSignInButton.d.ts.map +0 -1
  545. package/lib/typescript/components/PersonaImage.d.ts +0 -8
  546. package/lib/typescript/components/PersonaImage.d.ts.map +0 -1
  547. package/lib/typescript/components/PersonaLoadingScreen.d.ts +0 -10
  548. package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +0 -1
  549. package/lib/typescript/components/PersonalizationConsentScreen.d.ts +0 -10
  550. package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +0 -1
  551. package/lib/typescript/components/PinCreationScreen.d.ts +0 -10
  552. package/lib/typescript/components/PinCreationScreen.d.ts.map +0 -1
  553. package/lib/typescript/components/PlatformConnectorsStep.d.ts +0 -11
  554. package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +0 -1
  555. package/lib/typescript/components/PlatformToggle.d.ts +0 -20
  556. package/lib/typescript/components/PlatformToggle.d.ts.map +0 -1
  557. package/lib/typescript/components/PrimaryButton.d.ts +0 -22
  558. package/lib/typescript/components/PrimaryButton.d.ts.map +0 -1
  559. package/lib/typescript/components/SignInMatchAnimation.d.ts +0 -9
  560. package/lib/typescript/components/SignInMatchAnimation.d.ts.map +0 -1
  561. package/lib/typescript/components/SignInStep.d.ts +0 -12
  562. package/lib/typescript/components/SignInStep.d.ts.map +0 -1
  563. package/lib/typescript/components/VerificationStep.d.ts +0 -13
  564. package/lib/typescript/components/VerificationStep.d.ts.map +0 -1
  565. package/lib/typescript/components/WelcomeScreen.d.ts +0 -9
  566. package/lib/typescript/components/WelcomeScreen.d.ts.map +0 -1
  567. package/lib/typescript/components/icons/Basicproficon.d.ts +0 -5
  568. package/lib/typescript/components/icons/Basicproficon.d.ts.map +0 -1
  569. package/lib/typescript/components/icons/Basicprofile.d.ts +0 -5
  570. package/lib/typescript/components/icons/Basicprofile.d.ts.map +0 -1
  571. package/lib/typescript/components/icons/Checkbox.d.ts +0 -5
  572. package/lib/typescript/components/icons/Checkbox.d.ts.map +0 -1
  573. package/lib/typescript/components/icons/Checkmark.d.ts +0 -5
  574. package/lib/typescript/components/icons/Checkmark.d.ts.map +0 -1
  575. package/lib/typescript/components/icons/Contentanalysis.d.ts +0 -5
  576. package/lib/typescript/components/icons/Contentanalysis.d.ts.map +0 -1
  577. package/lib/typescript/components/icons/Contenticon.d.ts +0 -5
  578. package/lib/typescript/components/icons/Contenticon.d.ts.map +0 -1
  579. package/lib/typescript/components/icons/EnochE.d.ts +0 -5
  580. package/lib/typescript/components/icons/EnochE.d.ts.map +0 -1
  581. package/lib/typescript/components/icons/Personalityicon.d.ts +0 -5
  582. package/lib/typescript/components/icons/Personalityicon.d.ts.map +0 -1
  583. package/lib/typescript/components/icons/Personalityprofile.d.ts +0 -5
  584. package/lib/typescript/components/icons/Personalityprofile.d.ts.map +0 -1
  585. package/lib/typescript/components/icons/Personalitytraits.d.ts +0 -5
  586. package/lib/typescript/components/icons/Personalitytraits.d.ts.map +0 -1
  587. package/lib/typescript/components/icons/Userpreferences.d.ts +0 -5
  588. package/lib/typescript/components/icons/Userpreferences.d.ts.map +0 -1
  589. package/lib/typescript/components/icons/index.d.ts +0 -12
  590. package/lib/typescript/components/icons/index.d.ts.map +0 -1
  591. package/lib/typescript/config/api.d.ts +0 -24
  592. package/lib/typescript/config/api.d.ts.map +0 -1
  593. package/lib/typescript/context/AuthContext.d.ts +0 -34
  594. package/lib/typescript/context/AuthContext.d.ts.map +0 -1
  595. package/lib/typescript/hooks/useConnectedAccounts.d.ts +0 -11
  596. package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +0 -1
  597. package/lib/typescript/hooks/useUserConnections.d.ts +0 -12
  598. package/lib/typescript/hooks/useUserConnections.d.ts.map +0 -1
  599. package/lib/typescript/services/apiClient.d.ts +0 -91
  600. package/lib/typescript/services/apiClient.d.ts.map +0 -1
  601. package/lib/typescript/services/authService.d.ts +0 -216
  602. package/lib/typescript/services/authService.d.ts.map +0 -1
  603. package/lib/typescript/services/biometricPinService.d.ts +0 -29
  604. package/lib/typescript/services/biometricPinService.d.ts.map +0 -1
  605. package/lib/typescript/services/connectedAccountsService.d.ts +0 -56
  606. package/lib/typescript/services/connectedAccountsService.d.ts.map +0 -1
  607. package/lib/typescript/services/googleAuthService.d.ts +0 -63
  608. package/lib/typescript/services/googleAuthService.d.ts.map +0 -1
  609. package/lib/typescript/services/imageCompressionService.d.ts +0 -37
  610. package/lib/typescript/services/imageCompressionService.d.ts.map +0 -1
  611. package/lib/typescript/services/jwtStorageService.d.ts +0 -86
  612. package/lib/typescript/services/jwtStorageService.d.ts.map +0 -1
  613. package/lib/typescript/services/mobileTrainingService.d.ts +0 -45
  614. package/lib/typescript/services/mobileTrainingService.d.ts.map +0 -1
  615. package/lib/typescript/services/pinEncryptionService.d.ts +0 -17
  616. package/lib/typescript/services/pinEncryptionService.d.ts.map +0 -1
  617. package/lib/typescript/services/pinStorageUtils.d.ts +0 -25
  618. package/lib/typescript/services/pinStorageUtils.d.ts.map +0 -1
  619. package/lib/typescript/services/storageService.d.ts +0 -128
  620. package/lib/typescript/services/storageService.d.ts.map +0 -1
  621. package/lib/typescript/services/trainingApiHelpers.d.ts +0 -38
  622. package/lib/typescript/services/trainingApiHelpers.d.ts.map +0 -1
  623. package/lib/typescript/services/userConnectionsService.d.ts +0 -90
  624. package/lib/typescript/services/userConnectionsService.d.ts.map +0 -1
  625. package/lib/typescript/services/youtubeMigrationService.d.ts +0 -12
  626. package/lib/typescript/services/youtubeMigrationService.d.ts.map +0 -1
  627. package/lib/typescript/theme/index.d.ts +0 -416
  628. package/lib/typescript/theme/index.d.ts.map +0 -1
  629. package/lib/typescript/utils/eventUtils.d.ts +0 -108
  630. package/lib/typescript/utils/eventUtils.d.ts.map +0 -1
  631. package/lib/typescript/utils/haptics.d.ts +0 -11
  632. package/lib/typescript/utils/haptics.d.ts.map +0 -1
  633. package/lib/typescript/utils/imagePreloader.d.ts +0 -2
  634. package/lib/typescript/utils/imagePreloader.d.ts.map +0 -1
  635. package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  636. package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  637. package/src/assets/icons/Facebookicon.png +0 -0
  638. package/src/assets/icons/Gmail.png +0 -0
  639. package/src/assets/icons/Linkedinicon.png +0 -0
  640. package/src/assets/icons/Redditicon.png +0 -0
  641. package/src/assets/icons/YouTubeicon2.png +0 -0
  642. package/src/assets/icons/YouTubeicon3.png +0 -0
  643. package/src/assets/icons/farcaster.png +0 -0
  644. package/src/assets/icons/instagram.png +0 -0
  645. package/src/assets/icons/pinterest.png +0 -0
  646. package/src/assets/icons/swerv_logo.png +0 -0
  647. package/src/assets/icons/twitter.jpg +0 -0
  648. package/src/assets/images/Checkbox.svg +0 -3
  649. package/src/assets/images/EnochE.svg +0 -19
  650. package/src/assets/images/Enochicon1.png +0 -0
  651. package/src/assets/images/Face_ID_logo.png +0 -0
  652. package/src/assets/images/Facebookicon.png +0 -0
  653. package/src/assets/images/Gmail.png +0 -0
  654. package/src/assets/images/Googlelogo.png +0 -0
  655. package/src/assets/images/Linkedinicon.png +0 -0
  656. package/src/assets/images/Onairoslogo.png +0 -0
  657. package/src/assets/images/Personalityprofile.svg +0 -3
  658. package/src/assets/images/Personalitytraits.svg +0 -3
  659. package/src/assets/images/Redditicon.png +0 -0
  660. package/src/assets/images/Userpreferences.svg +0 -3
  661. package/src/assets/images/YouTubeicon3.png +0 -0
  662. package/src/assets/images/arrow.svg +0 -20
  663. package/src/assets/images/basicproficon.svg +0 -43
  664. package/src/assets/images/basicprofile.svg +0 -3
  665. package/src/assets/images/checkmark.svg +0 -4
  666. package/src/assets/images/contentanalysis.svg +0 -3
  667. package/src/assets/images/contenticon.svg +0 -23
  668. package/src/assets/images/persona1.png +0 -0
  669. package/src/assets/images/persona2.png +0 -0
  670. package/src/assets/images/persona3.png +0 -0
  671. package/src/assets/images/persona4.png +0 -0
  672. package/src/assets/images/persona5.png +0 -0
  673. package/src/assets/images/personalityicon.svg +0 -18
  674. package/src/assets/images/x-close.svg +0 -3
  675. package/src/components/BodyText.tsx +0 -33
  676. package/src/components/BrandMark.tsx +0 -62
  677. package/src/components/CodeInput.tsx +0 -32
  678. package/src/components/EmailInput.tsx +0 -31
  679. package/src/components/ExistingUserDataConfirmation.tsx +0 -507
  680. package/src/components/GoogleButton.tsx +0 -55
  681. package/src/components/HeadingGroup.tsx +0 -49
  682. package/src/components/ModalHeader.tsx +0 -125
  683. package/src/components/ModalSheet.tsx +0 -59
  684. package/src/components/OnairosSignInButton.tsx +0 -132
  685. package/src/components/PersonaImage.tsx +0 -79
  686. package/src/components/PersonaLoadingScreen.tsx +0 -201
  687. package/src/components/PersonalizationConsentScreen.tsx +0 -410
  688. package/src/components/PinCreationScreen.tsx +0 -492
  689. package/src/components/PlatformConnectorsStep.tsx +0 -892
  690. package/src/components/PlatformToggle.tsx +0 -226
  691. package/src/components/PrimaryButton.tsx +0 -214
  692. package/src/components/SignInMatchAnimation.tsx +0 -225
  693. package/src/components/SignInStep.tsx +0 -217
  694. package/src/components/VerificationStep.tsx +0 -198
  695. package/src/components/WelcomeScreen.tsx +0 -490
  696. package/src/components/icons/Basicproficon.tsx +0 -30
  697. package/src/components/icons/Basicprofile.tsx +0 -17
  698. package/src/components/icons/Checkbox.tsx +0 -17
  699. package/src/components/icons/Checkmark.tsx +0 -24
  700. package/src/components/icons/Contentanalysis.tsx +0 -17
  701. package/src/components/icons/Contenticon.tsx +0 -30
  702. package/src/components/icons/EnochE.tsx +0 -39
  703. package/src/components/icons/Personalityicon.tsx +0 -22
  704. package/src/components/icons/Personalityprofile.tsx +0 -17
  705. package/src/components/icons/Personalitytraits.tsx +0 -17
  706. package/src/components/icons/Userpreferences.tsx +0 -17
  707. package/src/components/icons/index.ts +0 -12
  708. package/src/config/api.ts +0 -25
  709. package/src/context/AuthContext.tsx +0 -393
  710. package/src/hooks/useConnectedAccounts.ts +0 -139
  711. package/src/hooks/useUserConnections.ts +0 -166
  712. package/src/services/apiClient.ts +0 -337
  713. package/src/services/authService.ts +0 -1008
  714. package/src/services/biometricPinService.ts +0 -193
  715. package/src/services/connectedAccountsService.ts +0 -290
  716. package/src/services/googleAuthService.ts +0 -279
  717. package/src/services/imageCompressionService.ts +0 -303
  718. package/src/services/jwtStorageService.ts +0 -257
  719. package/src/services/mobileTrainingService.ts +0 -204
  720. package/src/services/pinEncryptionService.ts +0 -76
  721. package/src/services/pinStorageUtils.ts +0 -97
  722. package/src/services/storageService.ts +0 -452
  723. package/src/services/trainingApiHelpers.ts +0 -67
  724. package/src/services/userConnectionsService.ts +0 -557
  725. package/src/services/youtubeMigrationService.ts +0 -454
  726. package/src/theme/index.ts +0 -239
  727. package/src/utils/eventUtils.ts +0 -303
  728. package/src/utils/haptics.ts +0 -59
  729. package/src/utils/imagePreloader.ts +0 -2
@@ -1,232 +1,838 @@
1
- import React, { useState } from 'react';
2
- import {
3
- View,
4
- Text,
5
- StyleSheet,
6
- TouchableOpacity,
7
- ActivityIndicator,
8
- SafeAreaView,
9
- Dimensions,
10
- } from 'react-native';
11
- import { WebView } from 'react-native-webview';
12
-
13
- const { width, height } = Dimensions.get('window');
14
-
15
- export interface OAuthWebViewProps {
16
- url: string;
17
- onClose: () => void;
18
- onSuccess: (code: string) => void;
19
- platform?: string;
20
- onComplete?: () => void;
21
- }
22
-
23
- export const OAuthWebView: React.FC<OAuthWebViewProps> = ({
24
- url,
25
- onClose,
26
- onSuccess,
27
- platform = 'platform',
28
- onComplete,
29
- }) => {
30
- const [isLoading, setIsLoading] = useState(true);
31
- const [timeoutReached, setTimeoutReached] = useState(false);
32
-
33
- console.log('Opening OAuth WebView with URL:', url);
34
-
35
- // Set up a timeout to prevent infinite waiting
36
- React.useEffect(() => {
37
- const timeout = setTimeout(() => {
38
- console.log(`⏰ OAuth timeout reached for ${platform} after 1 minutes`);
39
- setTimeoutReached(true);
40
- }, 60000); // 1 minutes timeout
41
-
42
- return () => clearTimeout(timeout);
43
- }, [platform]);
44
-
45
- const handleNavigationStateChange = (navState: any) => {
46
- console.log(`Navigation state changed for ${platform}:`, navState.url);
47
-
48
- // Check for the final redirect to onairos.uk domain (this means backend callback completed)
49
- const isFinalRedirect = (
50
- navState.url.includes('onairos.uk/Home') ||
51
- navState.url.includes('onairos.uk/home') ||
52
- navState.url.includes('onairos.uk/success') ||
53
- navState.url.startsWith('https://onairos.uk/Home') ||
54
- navState.url.startsWith('https://onairos.uk/home')
55
- );
56
-
57
- // For all platforms, we need to wait for the backend callback to complete
58
- // The backend processes the OAuth callback and then redirects to onairos.uk/Home
59
- if (isFinalRedirect) {
60
- console.log(`${platform} OAuth completed - backend callback finished and redirected to Home`);
61
- onSuccess('success');
62
-
63
- // Close the OAuth window after a small delay to ensure redirect is processed
64
- setTimeout(() => {
65
- if (onComplete) {
66
- console.log(`Closing ${platform} OAuth window after callback completion`);
67
- onComplete();
68
- }
69
- }, 1000); // Increased delay to ensure backend processing completes
70
- return; // Exit early to avoid other triggers
71
- }
72
-
73
- // Log intermediate callback URLs for debugging but don't close yet
74
- const isIntermediateCallback = (
75
- navState.url.includes('/callback') ||
76
- navState.url.includes('code=') ||
77
- navState.url.includes('token=') ||
78
- navState.url.includes('access_token=')
79
- );
80
-
81
- if (isIntermediateCallback && !isFinalRedirect) {
82
- console.log(`Detected intermediate callback URL for ${platform}:`, navState.url);
83
- console.log('Waiting for backend processing to complete and final redirect...');
84
-
85
- // Extract authorization code for logging purposes
86
- const codeMatch = navState.url.match(/code=([^&]+)/);
87
- if (codeMatch && codeMatch[1]) {
88
- console.log('OAuth code detected:', codeMatch[1]);
89
- }
90
-
91
- // Don't close yet - wait for the backend to process and redirect
92
- return;
93
- }
94
- };
95
-
96
- return (
97
- <View style={styles.modalContainer}>
98
- <SafeAreaView style={styles.container}>
99
- <View style={styles.header}>
100
- <Text style={styles.title}>Connect {platform.charAt(0).toUpperCase() + platform.slice(1)}</Text>
101
- {timeoutReached && (
102
- <Text style={styles.timeoutText}>Taking longer than expected...</Text>
103
- )}
104
- <TouchableOpacity onPress={onClose} style={styles.closeButton}>
105
- <Text style={styles.closeButtonText}>✕</Text>
106
- </TouchableOpacity>
107
- </View>
108
-
109
- <View style={styles.webViewContainer}>
110
- {isLoading && (
111
- <View style={styles.loadingContainer}>
112
- <ActivityIndicator size="large" color="#1BA9D4" />
113
- <Text style={styles.loadingText}>Loading...</Text>
114
- </View>
115
- )}
116
-
117
- <WebView
118
- source={{ uri: url }}
119
- onNavigationStateChange={handleNavigationStateChange}
120
- onLoadStart={() => setIsLoading(true)}
121
- onLoadEnd={() => setIsLoading(false)}
122
- style={styles.webView}
123
- javaScriptEnabled={true}
124
- domStorageEnabled={true}
125
- cacheEnabled={true} // Enable cache to remember previous logins
126
- incognito={false} // Disable incognito mode to remember previous logins
127
- thirdPartyCookiesEnabled={true}
128
- sharedCookiesEnabled={true} // Enable shared cookies for Google sign-in
129
- userAgent="Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1"
130
- onError={(syntheticEvent) => {
131
- const { nativeEvent } = syntheticEvent;
132
- console.error(`WebView error for ${platform}:`, nativeEvent);
133
- // Don't automatically close on error - let user retry or manually close
134
- }}
135
- onHttpError={(syntheticEvent) => {
136
- const { nativeEvent } = syntheticEvent;
137
- console.error(`WebView HTTP error for ${platform}: ${nativeEvent.statusCode}`, nativeEvent.url);
138
-
139
- // If we get a 404 or similar error on the final redirect, it might still be successful
140
- if (nativeEvent.url && nativeEvent.url.includes('onairos.uk')) {
141
- console.log('HTTP error on onairos.uk domain - treating as potential success');
142
- onSuccess('success');
143
- if (onComplete) {
144
- setTimeout(() => onComplete(), 1000);
145
- }
146
- }
147
- }}
148
- />
149
- </View>
150
- </SafeAreaView>
151
- </View>
152
- );
153
- };
154
-
155
- const styles = StyleSheet.create({
156
- modalContainer: {
157
- position: 'absolute',
158
- top: 0,
159
- left: 0,
160
- right: 0,
161
- bottom: 0,
162
- width: width,
163
- height: height,
164
- backgroundColor: '#fff',
165
- zIndex: 9999,
166
- },
167
- container: {
168
- flex: 1,
169
- backgroundColor: '#fff',
170
- width: width,
171
- height: height,
172
- position: 'absolute',
173
- top: 0,
174
- left: 0,
175
- right: 0,
176
- bottom: 0,
177
- zIndex: 999,
178
- },
179
- header: {
180
- flexDirection: 'row',
181
- alignItems: 'center',
182
- justifyContent: 'space-between',
183
- paddingHorizontal: 16,
184
- paddingVertical: 12,
185
- borderBottomWidth: 1,
186
- borderBottomColor: '#E5E5E5',
187
- backgroundColor: '#fff',
188
- zIndex: 1000,
189
- },
190
- title: {
191
- fontSize: 18,
192
- fontWeight: '600',
193
- color: '#333',
194
- flex: 1,
195
- textAlign: 'center',
196
- },
197
- closeButton: {
198
- padding: 8,
199
- },
200
- closeButtonText: {
201
- fontSize: 20,
202
- color: '#666',
203
- },
204
- webViewContainer: {
205
- flex: 1,
206
- width: width,
207
- height: height - 60, // Adjust for header height
208
- },
209
- webView: {
210
- flex: 1,
211
- width: '100%',
212
- height: '100%',
213
- },
214
- loadingContainer: {
215
- ...StyleSheet.absoluteFillObject,
216
- alignItems: 'center',
217
- justifyContent: 'center',
218
- backgroundColor: 'rgba(255, 255, 255, 0.9)',
219
- zIndex: 1,
220
- },
221
- loadingText: {
222
- marginTop: 12,
223
- fontSize: 16,
224
- color: '#666',
225
- },
226
- timeoutText: {
227
- fontSize: 12,
228
- color: '#FF6B6B',
229
- textAlign: 'center',
230
- marginTop: 4,
231
- },
232
- });
1
+ import React, { useState, useRef } from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ StyleSheet,
6
+ TouchableOpacity,
7
+ ActivityIndicator,
8
+ SafeAreaView,
9
+ Dimensions,
10
+ Linking,
11
+ } from 'react-native';
12
+ import { WebView } from 'react-native-webview';
13
+ import Icon from 'react-native-vector-icons/MaterialIcons';
14
+ import { COLORS } from '../../constants';
15
+
16
+ const { width, height } = Dimensions.get('window');
17
+
18
+ export interface OAuthWebViewProps {
19
+ url: string;
20
+ onClose: () => void;
21
+ onSuccess: (code: string) => void;
22
+ platform?: string;
23
+ onComplete?: () => void;
24
+ }
25
+
26
+ export const OAuthWebView: React.FC<OAuthWebViewProps> = ({
27
+ url,
28
+ onClose,
29
+ onSuccess,
30
+ platform = 'platform',
31
+ onComplete,
32
+ }) => {
33
+ const [isLoading, setIsLoading] = useState(true);
34
+ const [error, setError] = useState<string | null>(null);
35
+ const [errorMessage, setErrorMessage] = useState<string>('');
36
+ const [isRetryable, setIsRetryable] = useState(true);
37
+ const [retryCount, setRetryCount] = useState(0);
38
+ const webViewRef = useRef<WebView>(null);
39
+ const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
40
+
41
+ console.log('🌐 Opening OAuth WebView with URL:', url);
42
+ console.log('🔗 Platform:', platform);
43
+ console.log('📱 URL Components:', {
44
+ protocol: url.split('://')[0],
45
+ domain: url.split('://')[1]?.split('/')[0],
46
+ path: url.split('://')[1]?.split('/').slice(1).join('/'),
47
+ });
48
+
49
+ // Set up timeout for OAuth flow
50
+ React.useEffect(() => {
51
+ // Clear any existing timeout
52
+ if (timeoutRef.current) {
53
+ clearTimeout(timeoutRef.current);
54
+ }
55
+
56
+ // Set a 60-second timeout for OAuth completion
57
+ timeoutRef.current = setTimeout(() => {
58
+ console.log('OAuth flow timeout - no completion detected');
59
+ setError('OAuth flow is taking too long. Please try again or use the browser option.');
60
+ setIsLoading(false);
61
+ }, 60000);
62
+
63
+ return () => {
64
+ if (timeoutRef.current) {
65
+ clearTimeout(timeoutRef.current);
66
+ }
67
+ };
68
+ }, [url]);
69
+
70
+ // Clear timeout when component unmounts or OAuth completes
71
+ React.useEffect(() => {
72
+ return () => {
73
+ if (timeoutRef.current) {
74
+ clearTimeout(timeoutRef.current);
75
+ }
76
+ };
77
+ }, []);
78
+
79
+ const onNavigationStateChange = (navState: any) => {
80
+ const currentUrl = navState.url;
81
+ console.log('🌐 Navigation state changed:', {
82
+ url: currentUrl,
83
+ canGoBack: navState.canGoBack,
84
+ canGoForward: navState.canGoForward,
85
+ loading: navState.loading,
86
+ title: navState.title,
87
+ });
88
+
89
+ // Don't process if still loading
90
+ if (navState.loading) {
91
+ return;
92
+ }
93
+
94
+ // Check if this URL indicates OAuth completion
95
+ if (isOAuthComplete(currentUrl)) {
96
+ console.log('🎉 OAuth completion detected!');
97
+
98
+ // Extract the result
99
+ const result = extractOAuthResult(currentUrl);
100
+
101
+ if (result.success) {
102
+ console.log('✅ OAuth completed successfully:', result);
103
+
104
+ // Clear timeout
105
+ if (timeoutRef.current) {
106
+ clearTimeout(timeoutRef.current);
107
+ timeoutRef.current = null;
108
+ }
109
+
110
+ // Call success callback
111
+ if (onSuccess && result.code) {
112
+ onSuccess(result.code);
113
+ }
114
+
115
+ // Close the WebView
116
+ if (onComplete) {
117
+ onComplete();
118
+ }
119
+ } else {
120
+ console.error('❌ OAuth failed:', result.error);
121
+
122
+ // Clear timeout
123
+ if (timeoutRef.current) {
124
+ clearTimeout(timeoutRef.current);
125
+ timeoutRef.current = null;
126
+ }
127
+
128
+ // Set error state
129
+ setError('OAuth authentication failed');
130
+ setErrorMessage(result.error || 'Authentication failed');
131
+ setIsRetryable(true);
132
+ }
133
+ }
134
+
135
+ // Additional check for Gmail specific patterns
136
+ if (platform === 'email' || platform === 'gmail') {
137
+ const gmailPatterns = [
138
+ 'onairos.uk/Home',
139
+ 'onairos.uk/home',
140
+ 'https://onairos.uk/Home',
141
+ 'https://onairos.uk/home',
142
+ ];
143
+
144
+ for (const pattern of gmailPatterns) {
145
+ if (currentUrl.includes(pattern)) {
146
+ console.log('✅ Gmail OAuth success detected via home page redirect');
147
+
148
+ // Clear timeout
149
+ if (timeoutRef.current) {
150
+ clearTimeout(timeoutRef.current);
151
+ timeoutRef.current = null;
152
+ }
153
+
154
+ // Call success callback with Gmail-specific code
155
+ if (onSuccess) {
156
+ onSuccess('gmail_success');
157
+ }
158
+
159
+ // Close the WebView
160
+ if (onComplete) {
161
+ onComplete();
162
+ }
163
+
164
+ return;
165
+ }
166
+ }
167
+ }
168
+
169
+ // Check for error URLs
170
+ const errorPatterns = [
171
+ 'error=',
172
+ 'error_description=',
173
+ 'access_denied',
174
+ 'user_cancelled',
175
+ 'cancelled',
176
+ 'denied',
177
+ ];
178
+
179
+ for (const pattern of errorPatterns) {
180
+ if (currentUrl.includes(pattern)) {
181
+ console.log('❌ OAuth error detected in URL:', pattern);
182
+
183
+ // Clear timeout
184
+ if (timeoutRef.current) {
185
+ clearTimeout(timeoutRef.current);
186
+ timeoutRef.current = null;
187
+ }
188
+
189
+ // Parse error details
190
+ try {
191
+ const urlObj = new URL(currentUrl);
192
+ const params = new URLSearchParams(urlObj.search);
193
+ const errorDescription = params.get('error_description') || params.get('error') || 'Authentication failed';
194
+
195
+ setError('OAuth authentication failed');
196
+ setErrorMessage(errorDescription);
197
+ setIsRetryable(true);
198
+ } catch (parseError) {
199
+ setError('OAuth authentication failed');
200
+ setErrorMessage('Authentication failed');
201
+ setIsRetryable(true);
202
+ }
203
+
204
+ return;
205
+ }
206
+ }
207
+ };
208
+
209
+ const handleLoadEnd = () => {
210
+ setIsLoading(false);
211
+ setError(null);
212
+ setErrorMessage('');
213
+ };
214
+
215
+ const handleError = (syntheticEvent: any) => {
216
+ const { nativeEvent } = syntheticEvent;
217
+ console.error('🚨 WebView error details:', {
218
+ description: nativeEvent.description,
219
+ code: nativeEvent.code,
220
+ domain: nativeEvent.domain,
221
+ url: nativeEvent.url,
222
+ canGoBack: nativeEvent.canGoBack,
223
+ canGoForward: nativeEvent.canGoForward,
224
+ loading: nativeEvent.loading,
225
+ target: nativeEvent.target,
226
+ title: nativeEvent.title,
227
+ });
228
+
229
+ // Check for specific NSURLErrorDomain codes
230
+ let errorMessage = 'Failed to load OAuth page.';
231
+ let isRetryable = true;
232
+
233
+ if (nativeEvent.domain === 'NSURLErrorDomain') {
234
+ switch (nativeEvent.code) {
235
+ case -1009: // NSURLErrorNotConnectedToInternet
236
+ errorMessage = 'No internet connection. Please check your network and try again.';
237
+ isRetryable = true;
238
+ break;
239
+ case -1003: // NSURLErrorCannotFindHost
240
+ errorMessage = 'Cannot reach authentication server. Please check your internet connection.';
241
+ isRetryable = true;
242
+ break;
243
+ case -1001: // NSURLErrorTimedOut
244
+ errorMessage = 'Connection timed out. Please try again.';
245
+ isRetryable = true;
246
+ break;
247
+ case -1200: // NSURLErrorSecureConnectionFailed
248
+ errorMessage = 'Secure connection failed. Please try again.';
249
+ isRetryable = true;
250
+ break;
251
+ case -1022: // NSURLErrorAppTransportSecurityRequiresSecureConnection
252
+ errorMessage = 'App Transport Security error. Connection must be secure.';
253
+ isRetryable = false;
254
+ break;
255
+ case -1004: // NSURLErrorCannotConnectToHost
256
+ errorMessage = 'Cannot connect to authentication server. Please try again later.';
257
+ isRetryable = true;
258
+ break;
259
+ case -1005: // NSURLErrorNetworkConnectionLost
260
+ errorMessage = 'Network connection lost. Please check your connection and try again.';
261
+ isRetryable = true;
262
+ break;
263
+ case -1020: // NSURLErrorDataNotAllowed
264
+ errorMessage = 'Data not allowed. Please check your cellular data settings.';
265
+ isRetryable = true;
266
+ break;
267
+ default:
268
+ errorMessage = `Network error (${nativeEvent.code}): ${nativeEvent.description || 'Please check your connection and try again.'}`;
269
+ isRetryable = true;
270
+ }
271
+ } else if (nativeEvent.domain === 'WebKitErrorDomain') {
272
+ switch (nativeEvent.code) {
273
+ case 102: // WebKitErrorFrameLoadInterruptedByPolicyChange
274
+ errorMessage = 'Page load was interrupted. Please try again.';
275
+ isRetryable = true;
276
+ break;
277
+ case 204: // WebKitErrorPlugInLoadFailed
278
+ errorMessage = 'Plugin failed to load. Please try again.';
279
+ isRetryable = true;
280
+ break;
281
+ default:
282
+ errorMessage = `WebKit error (${nativeEvent.code}): ${nativeEvent.description || 'Please try again.'}`;
283
+ isRetryable = true;
284
+ }
285
+ }
286
+
287
+ console.error('🔴 OAuth WebView Error:', errorMessage);
288
+
289
+ // Implement smart retry logic
290
+ if (isRetryable && retryCount < 3) {
291
+ console.log(`🔄 Auto-retrying OAuth load (attempt ${retryCount + 1}/3) in 3 seconds...`);
292
+ setRetryCount(prev => prev + 1);
293
+ setIsLoading(true);
294
+ setError(null);
295
+
296
+ // Retry after a delay with exponential backoff
297
+ const retryDelay = 3000 * Math.pow(2, retryCount); // 3s, 6s, 12s
298
+ setTimeout(() => {
299
+ if (webViewRef.current) {
300
+ console.log(`🔄 Attempting retry ${retryCount + 1}...`);
301
+ webViewRef.current.reload();
302
+ }
303
+ }, retryDelay);
304
+ } else {
305
+ setError(errorMessage);
306
+ setIsLoading(false);
307
+
308
+ // Show additional help for persistent errors
309
+ if (retryCount >= 3) {
310
+ console.log('❌ Maximum retries reached, showing error to user');
311
+ }
312
+ }
313
+ };
314
+
315
+ const handleOpenInBrowser = () => {
316
+ console.log('Opening OAuth URL in external browser:', url);
317
+ Linking.openURL(url).catch(err => {
318
+ console.error('Failed to open URL in browser:', err);
319
+ setError('Unable to open browser. Please check your device settings.');
320
+ });
321
+ };
322
+
323
+ const handleRetry = () => {
324
+ console.log('Manual retry requested');
325
+ setError(null);
326
+ setErrorMessage('');
327
+ setIsRetryable(true);
328
+ setIsLoading(true);
329
+ setRetryCount(0);
330
+
331
+ if (webViewRef.current) {
332
+ webViewRef.current.reload();
333
+ }
334
+ };
335
+
336
+ /**
337
+ * Get platform-specific icon
338
+ */
339
+ const getPlatformIcon = (platform: string): string => {
340
+ switch (platform) {
341
+ case 'instagram':
342
+ return 'photo-camera';
343
+ case 'youtube':
344
+ return 'smart-display';
345
+ case 'pinterest':
346
+ return 'push-pin';
347
+ case 'reddit':
348
+ return 'forum';
349
+ case 'email':
350
+ return 'email';
351
+ default:
352
+ return 'link';
353
+ }
354
+ };
355
+
356
+ /**
357
+ * Get platform-specific color
358
+ */
359
+ const getPlatformColor = (platform: string): string => {
360
+ switch (platform) {
361
+ case 'instagram':
362
+ return '#E1306C';
363
+ case 'youtube':
364
+ return '#FF0000';
365
+ case 'pinterest':
366
+ return '#E60023';
367
+ case 'reddit':
368
+ return '#FF4500';
369
+ case 'email':
370
+ return '#4285F4';
371
+ default:
372
+ return COLORS.primary;
373
+ }
374
+ };
375
+
376
+ // Check if URL indicates OAuth completion
377
+ const isOAuthComplete = (url: string): boolean => {
378
+ // Gmail OAuth completion patterns
379
+ const gmailSuccessPatterns = [
380
+ 'https://onairos.uk/Home',
381
+ 'https://onairos.uk/home',
382
+ 'onairos.uk/Home',
383
+ 'onairos.uk/home',
384
+ process.env.APP_HOME_URL,
385
+ ].filter(Boolean);
386
+
387
+ // Check for success redirect patterns
388
+ for (const pattern of gmailSuccessPatterns) {
389
+ if (url.includes(pattern)) {
390
+ console.log('✅ OAuth success detected via redirect to:', pattern);
391
+ return true;
392
+ }
393
+ }
394
+
395
+ // Check for traditional OAuth callback patterns (more specific)
396
+ // Only match actual query parameters, not just any occurrence in the URL
397
+ const callbackPatterns = [
398
+ 'code=',
399
+ 'access_token=',
400
+ 'oauth_token=',
401
+ 'authorization_code=',
402
+ 'auth_code=',
403
+ 'token=',
404
+ ];
405
+
406
+ for (const pattern of callbackPatterns) {
407
+ if (url.includes(pattern)) {
408
+ console.log('✅ OAuth success detected via callback parameter:', pattern);
409
+ return true;
410
+ }
411
+ }
412
+
413
+ // Check for specific callback URLs (more targeted than generic words)
414
+ const callbackUrlPatterns = [
415
+ '/callback',
416
+ '/oauth/callback',
417
+ '/auth/callback',
418
+ 'redirect_uri',
419
+ 'onairos.uk/callback',
420
+ 'onairos.uk/oauth',
421
+ ];
422
+
423
+ for (const pattern of callbackUrlPatterns) {
424
+ if (url.includes(pattern)) {
425
+ console.log('✅ OAuth success detected via callback URL pattern:', pattern);
426
+ return true;
427
+ }
428
+ }
429
+
430
+ // Check for error patterns
431
+ const errorPatterns = [
432
+ 'error=',
433
+ 'error_description=',
434
+ 'oauth_error=',
435
+ 'auth_error=',
436
+ 'access_denied',
437
+ 'user_cancelled',
438
+ 'cancelled',
439
+ 'denied',
440
+ ];
441
+
442
+ for (const pattern of errorPatterns) {
443
+ if (url.includes(pattern)) {
444
+ console.log('❌ OAuth error detected via pattern:', pattern);
445
+ return false;
446
+ }
447
+ }
448
+
449
+ return false;
450
+ };
451
+
452
+ // Extract OAuth result from URL
453
+ const extractOAuthResult = (url: string): { success: boolean; code?: string; error?: string } => {
454
+ try {
455
+ const urlObj = new URL(url);
456
+ const params = new URLSearchParams(urlObj.search);
457
+
458
+ // Check for error first
459
+ const error = params.get('error') || params.get('error_description') || params.get('oauth_error');
460
+ if (error) {
461
+ return { success: false, error };
462
+ }
463
+
464
+ // Check for success indicators
465
+ const code = params.get('code') || params.get('authorization_code') || params.get('auth_code');
466
+ const accessToken = params.get('access_token') || params.get('oauth_token') || params.get('token');
467
+
468
+ if (code || accessToken) {
469
+ return { success: true, code: code || accessToken };
470
+ }
471
+
472
+ // Check for success redirect to home page (Gmail pattern)
473
+ const gmailSuccessPatterns = [
474
+ 'https://onairos.uk/Home',
475
+ 'https://onairos.uk/home',
476
+ 'onairos.uk/Home',
477
+ 'onairos.uk/home',
478
+ ];
479
+
480
+ for (const pattern of gmailSuccessPatterns) {
481
+ if (url.includes(pattern)) {
482
+ console.log('✅ Gmail OAuth success detected via home page redirect');
483
+ return { success: true, code: 'gmail_home_redirect' };
484
+ }
485
+ }
486
+
487
+ // If we reached here and isOAuthComplete returned true, assume success
488
+ if (isOAuthComplete(url)) {
489
+ return { success: true, code: 'oauth_complete' };
490
+ }
491
+
492
+ return { success: false, error: 'OAuth completion not detected' };
493
+ } catch (error) {
494
+ console.error('Error parsing OAuth URL:', error);
495
+ return { success: false, error: 'Invalid OAuth callback URL' };
496
+ }
497
+ };
498
+
499
+ if (error) {
500
+ return (
501
+ <SafeAreaView style={styles.container}>
502
+ <View style={styles.header}>
503
+ <TouchableOpacity onPress={onClose} style={styles.closeButton}>
504
+ <Icon name="close" size={24} color="#000" />
505
+ </TouchableOpacity>
506
+ <View style={styles.titleContainer}>
507
+ <Icon
508
+ name={getPlatformIcon(platform)}
509
+ size={20}
510
+ color={getPlatformColor(platform)}
511
+ />
512
+ <Text style={styles.titleText}>{platform.charAt(0).toUpperCase() + platform.slice(1)} OAuth</Text>
513
+ </View>
514
+ </View>
515
+
516
+ <View style={styles.errorContainer}>
517
+ <Icon name="error-outline" size={48} color="#FF6B6B" />
518
+ <Text style={styles.errorTitle}>Connection Error</Text>
519
+ <Text style={styles.errorMessage}>{errorMessage || error}</Text>
520
+
521
+ {/* Help text based on error type */}
522
+ {error.includes('internet') || error.includes('network') ? (
523
+ <View style={styles.helpContainer}>
524
+ <Text style={styles.helpTitle}>💡 Troubleshooting Steps:</Text>
525
+ <Text style={styles.helpText}>• Check your Wi-Fi or cellular connection</Text>
526
+ <Text style={styles.helpText}>• Try switching between Wi-Fi and cellular</Text>
527
+ <Text style={styles.helpText}>• Ensure you're not using a VPN that blocks OAuth</Text>
528
+ <Text style={styles.helpText}>• Close other apps that might be using bandwidth</Text>
529
+ </View>
530
+ ) : error.includes('timeout') ? (
531
+ <View style={styles.helpContainer}>
532
+ <Text style={styles.helpTitle}>⏱️ Connection Timeout:</Text>
533
+ <Text style={styles.helpText}>• Your connection might be slow</Text>
534
+ <Text style={styles.helpText}>• Try again when you have a stronger signal</Text>
535
+ <Text style={styles.helpText}>• Use "Open in Browser" for better reliability</Text>
536
+ </View>
537
+ ) : error.includes('secure') || error.includes('SSL') ? (
538
+ <View style={styles.helpContainer}>
539
+ <Text style={styles.helpTitle}>🔒 Security Error:</Text>
540
+ <Text style={styles.helpText}>• Check your device's date and time settings</Text>
541
+ <Text style={styles.helpText}>• Update your device's operating system</Text>
542
+ <Text style={styles.helpText}>• Try "Open in Browser" as an alternative</Text>
543
+ </View>
544
+ ) : (
545
+ <View style={styles.helpContainer}>
546
+ <Text style={styles.helpTitle}>🔧 General Solutions:</Text>
547
+ <Text style={styles.helpText}>• Close and reopen the app</Text>
548
+ <Text style={styles.helpText}>• Check your internet connection</Text>
549
+ <Text style={styles.helpText}>• Use "Open in Browser" for better reliability</Text>
550
+ </View>
551
+ )}
552
+
553
+ <View style={styles.buttonContainer}>
554
+ {isRetryable && (
555
+ <TouchableOpacity style={styles.retryButton} onPress={handleRetry}>
556
+ <Icon name="refresh" size={20} color="#fff" style={styles.buttonIcon} />
557
+ <Text style={styles.retryButtonText}>Retry</Text>
558
+ </TouchableOpacity>
559
+ )}
560
+ <TouchableOpacity style={styles.browserButton} onPress={handleOpenInBrowser}>
561
+ <Icon name="open-in-browser" size={20} color="#666" style={styles.buttonIcon} />
562
+ <Text style={styles.browserButtonText}>Open in Browser</Text>
563
+ </TouchableOpacity>
564
+ </View>
565
+
566
+ {retryCount >= 3 && (
567
+ <View style={styles.persistentErrorContainer}>
568
+ <Text style={styles.persistentErrorText}>
569
+ Still having trouble? Try these steps:
570
+ </Text>
571
+ <Text style={styles.persistentErrorStep}>
572
+ 1. Use "Open in Browser" for more reliable authentication
573
+ </Text>
574
+ <Text style={styles.persistentErrorStep}>
575
+ 2. Check if other apps can access the internet
576
+ </Text>
577
+ <Text style={styles.persistentErrorStep}>
578
+ 3. Restart your device if the problem persists
579
+ </Text>
580
+ </View>
581
+ )}
582
+ </View>
583
+ </SafeAreaView>
584
+ );
585
+ }
586
+
587
+ return (
588
+ <SafeAreaView style={styles.container}>
589
+ <View style={styles.header}>
590
+ <TouchableOpacity onPress={onClose} style={styles.closeButton}>
591
+ <Icon name="close" size={24} color="#000" />
592
+ </TouchableOpacity>
593
+ <View style={styles.titleContainer}>
594
+ <Icon
595
+ name={getPlatformIcon(platform)}
596
+ size={20}
597
+ color={getPlatformColor(platform)}
598
+ />
599
+ <Text style={styles.titleText}>{platform.charAt(0).toUpperCase() + platform.slice(1)} OAuth</Text>
600
+ </View>
601
+ <TouchableOpacity onPress={handleOpenInBrowser} style={styles.browserButton}>
602
+ <Icon name="open-in-browser" size={20} color="#666" />
603
+ </TouchableOpacity>
604
+ </View>
605
+
606
+ <WebView
607
+ ref={webViewRef}
608
+ source={{ uri: url }}
609
+ onNavigationStateChange={onNavigationStateChange}
610
+ onLoadEnd={handleLoadEnd}
611
+ onError={handleError}
612
+ onHttpError={(syntheticEvent) => {
613
+ const { nativeEvent } = syntheticEvent;
614
+ console.error('WebView HTTP error:', nativeEvent);
615
+ setError('Failed to load OAuth page. Please check your internet connection.');
616
+ setIsLoading(false);
617
+ }}
618
+ style={styles.webView}
619
+ javaScriptEnabled={true}
620
+ domStorageEnabled={true}
621
+ startInLoadingState={true}
622
+ scalesPageToFit={true}
623
+ allowsInlineMediaPlayback={true}
624
+ mediaPlaybackRequiresUserAction={false}
625
+ mixedContentMode="compatibility"
626
+ thirdPartyCookiesEnabled={true}
627
+ sharedCookiesEnabled={true}
628
+ cacheEnabled={true}
629
+ allowsBackForwardNavigationGestures={true}
630
+ allowsLinkPreview={false}
631
+ userAgent="Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1"
632
+ onShouldStartLoadWithRequest={(request) => {
633
+ console.log('WebView attempting to load:', request.url);
634
+
635
+ // Block about:srcdoc and other problematic URLs
636
+ if (request.url.startsWith('about:') ||
637
+ request.url.startsWith('data:') ||
638
+ request.url === 'about:blank') {
639
+ console.log('Blocking problematic URL:', request.url);
640
+ return false;
641
+ }
642
+
643
+ // Allow all other requests
644
+ return true;
645
+ }}
646
+ onLoadStart={(syntheticEvent) => {
647
+ const { nativeEvent } = syntheticEvent;
648
+ console.log('WebView load started:', nativeEvent.url);
649
+ setIsLoading(true);
650
+ }}
651
+ onLoadProgress={(syntheticEvent) => {
652
+ const { nativeEvent } = syntheticEvent;
653
+ console.log('WebView load progress:', nativeEvent.progress);
654
+ }}
655
+ renderError={(errorName) => (
656
+ <View style={styles.errorContainer}>
657
+ <Icon name="error-outline" size={48} color="#FF6B6B" />
658
+ <Text style={styles.errorTitle}>WebView Error</Text>
659
+ <Text style={styles.errorMessage}>
660
+ Failed to load the authentication page. Error: {errorName}
661
+ </Text>
662
+ <TouchableOpacity style={styles.retryButton} onPress={handleRetry}>
663
+ <Text style={styles.retryButtonText}>Retry</Text>
664
+ </TouchableOpacity>
665
+ </View>
666
+ )}
667
+ renderLoading={() => (
668
+ <View style={styles.loadingContainer}>
669
+ <ActivityIndicator size="large" color={COLORS.primary} />
670
+ <Text style={styles.loadingText}>Loading {platform}...</Text>
671
+ </View>
672
+ )}
673
+ injectedJavaScript={`
674
+ // Prevent white screen issues
675
+ window.addEventListener('error', function(e) {
676
+ console.log('JavaScript error:', e.message);
677
+ });
678
+
679
+ // Handle OAuth redirects
680
+ window.addEventListener('beforeunload', function(e) {
681
+ console.log('Page unloading:', window.location.href);
682
+ });
683
+
684
+ // Monitor for OAuth completion
685
+ setInterval(function() {
686
+ if (window.location.href.includes('code=') ||
687
+ window.location.href.includes('access_token=') ||
688
+ window.location.href.includes('oauth_token=') ||
689
+ window.location.href.includes('api2.onairos.uk')) {
690
+ console.log('OAuth completion detected:', window.location.href);
691
+ }
692
+ }, 1000);
693
+
694
+ true; // Required for injected JavaScript
695
+ `}
696
+ />
697
+ </SafeAreaView>
698
+ );
699
+ };
700
+
701
+ const styles = StyleSheet.create({
702
+ container: {
703
+ flex: 1,
704
+ backgroundColor: '#fff',
705
+ },
706
+ header: {
707
+ flexDirection: 'row',
708
+ alignItems: 'center',
709
+ height: 56,
710
+ backgroundColor: '#f8f8f8',
711
+ borderBottomWidth: 1,
712
+ borderBottomColor: '#e0e0e0',
713
+ paddingHorizontal: 16,
714
+ },
715
+ titleContainer: {
716
+ flex: 1,
717
+ flexDirection: 'row',
718
+ alignItems: 'center',
719
+ justifyContent: 'center',
720
+ },
721
+ titleText: {
722
+ marginLeft: 8,
723
+ fontSize: 16,
724
+ fontWeight: '500',
725
+ color: '#000',
726
+ },
727
+ closeButton: {
728
+ padding: 8,
729
+ position: 'absolute',
730
+ left: 16,
731
+ zIndex: 10,
732
+ },
733
+ browserButton: {
734
+ backgroundColor: 'transparent',
735
+ borderWidth: 1,
736
+ borderColor: '#666',
737
+ paddingHorizontal: 24,
738
+ paddingVertical: 12,
739
+ borderRadius: 8,
740
+ flexDirection: 'row',
741
+ alignItems: 'center',
742
+ justifyContent: 'center',
743
+ },
744
+ webView: {
745
+ flex: 1,
746
+ },
747
+ loadingContainer: {
748
+ ...StyleSheet.absoluteFillObject,
749
+ backgroundColor: 'rgba(255, 255, 255, 0.8)',
750
+ alignItems: 'center',
751
+ justifyContent: 'center',
752
+ },
753
+ loadingText: {
754
+ marginTop: 10,
755
+ fontSize: 16,
756
+ color: '#666',
757
+ },
758
+ errorContainer: {
759
+ flex: 1,
760
+ alignItems: 'center',
761
+ justifyContent: 'center',
762
+ padding: 20,
763
+ },
764
+ errorTitle: {
765
+ fontSize: 18,
766
+ fontWeight: '600',
767
+ color: '#333',
768
+ marginTop: 16,
769
+ marginBottom: 8,
770
+ },
771
+ errorMessage: {
772
+ fontSize: 14,
773
+ color: '#666',
774
+ textAlign: 'center',
775
+ marginBottom: 20,
776
+ },
777
+ retryButton: {
778
+ backgroundColor: COLORS.primary,
779
+ paddingHorizontal: 24,
780
+ paddingVertical: 12,
781
+ borderRadius: 8,
782
+ marginRight: 10,
783
+ flexDirection: 'row',
784
+ alignItems: 'center',
785
+ justifyContent: 'center',
786
+ },
787
+ retryButtonText: {
788
+ color: '#fff',
789
+ fontSize: 16,
790
+ fontWeight: '600',
791
+ },
792
+ buttonContainer: {
793
+ flexDirection: 'row',
794
+ justifyContent: 'center',
795
+ alignItems: 'center',
796
+ marginTop: 10,
797
+ },
798
+ browserButtonText: {
799
+ color: '#666',
800
+ fontSize: 16,
801
+ fontWeight: '600',
802
+ },
803
+ helpContainer: {
804
+ marginBottom: 20,
805
+ },
806
+ helpTitle: {
807
+ fontSize: 18,
808
+ fontWeight: '600',
809
+ color: '#333',
810
+ marginBottom: 8,
811
+ },
812
+ helpText: {
813
+ fontSize: 14,
814
+ color: '#666',
815
+ textAlign: 'center',
816
+ },
817
+ buttonIcon: {
818
+ marginRight: 10,
819
+ },
820
+ persistentErrorContainer: {
821
+ marginTop: 20,
822
+ padding: 20,
823
+ backgroundColor: '#f8f8f8',
824
+ borderRadius: 8,
825
+ },
826
+ persistentErrorText: {
827
+ fontSize: 16,
828
+ fontWeight: '600',
829
+ color: '#333',
830
+ marginBottom: 10,
831
+ },
832
+ persistentErrorStep: {
833
+ fontSize: 14,
834
+ color: '#666',
835
+ textAlign: 'center',
836
+ marginBottom: 5,
837
+ },
838
+ });