@onairos/react-native 3.7.2 → 3.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/lib/commonjs/api/index.js +219 -9
  2. package/lib/commonjs/components/BodyText.js +27 -9
  3. package/lib/commonjs/components/BrandMark.js +111 -10
  4. package/lib/commonjs/components/CodeInput.js +120 -9
  5. package/lib/commonjs/components/EmailInput.js +30 -8
  6. package/lib/commonjs/components/GoogleButton.js +56 -9
  7. package/lib/commonjs/components/HeadingGroup.js +43 -9
  8. package/lib/commonjs/components/LLMDataInputModal.js +664 -14
  9. package/lib/commonjs/components/ModalHeader.js +99 -9
  10. package/lib/commonjs/components/ModalSheet.js +47 -9
  11. package/lib/commonjs/components/Onairos.js +380 -14
  12. package/lib/commonjs/components/OnairosButton.js +313 -13
  13. package/lib/commonjs/components/OnairosSignInButton.js +130 -12
  14. package/lib/commonjs/components/Overlay.js +465 -13
  15. package/lib/commonjs/components/PersonaImage.js +137 -10
  16. package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
  17. package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
  18. package/lib/commonjs/components/PinCreationScreen.js +403 -12
  19. package/lib/commonjs/components/PinInput.js +464 -9
  20. package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
  21. package/lib/commonjs/components/PlatformList.js +137 -10
  22. package/lib/commonjs/components/PlatformToggle.js +180 -9
  23. package/lib/commonjs/components/PrimaryButton.js +180 -10
  24. package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
  25. package/lib/commonjs/components/SignInStep.js +345 -12
  26. package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
  27. package/lib/commonjs/components/VerificationStep.js +176 -11
  28. package/lib/commonjs/components/WelcomeScreen.js +461 -22
  29. package/lib/commonjs/components/icons/Basicproficon.js +37 -8
  30. package/lib/commonjs/components/icons/Basicprofile.js +21 -8
  31. package/lib/commonjs/components/icons/Checkbox.js +21 -8
  32. package/lib/commonjs/components/icons/Checkmark.js +27 -8
  33. package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
  34. package/lib/commonjs/components/icons/Contenticon.js +39 -8
  35. package/lib/commonjs/components/icons/EnochE.js +41 -8
  36. package/lib/commonjs/components/icons/Personalityicon.js +30 -8
  37. package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
  38. package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
  39. package/lib/commonjs/components/icons/Userpreferences.js +21 -8
  40. package/lib/commonjs/components/icons/index.js +84 -17
  41. package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
  42. package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
  43. package/lib/commonjs/components/onboarding/PinInput.js +283 -10
  44. package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
  45. package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
  46. package/lib/commonjs/config/api.js +56 -7
  47. package/lib/commonjs/constants/index.js +120 -7
  48. package/lib/commonjs/context/AuthContext.js +345 -10
  49. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
  50. package/lib/commonjs/hooks/useConnections.js +102 -8
  51. package/lib/commonjs/hooks/useCredentials.js +178 -10
  52. package/lib/commonjs/hooks/useUserConnections.js +148 -10
  53. package/lib/commonjs/index.js +439 -34
  54. package/lib/commonjs/services/apiClient.js +298 -8
  55. package/lib/commonjs/services/biometricPinService.js +180 -8
  56. package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
  57. package/lib/commonjs/services/chatGPTConversationService.js +275 -9
  58. package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
  59. package/lib/commonjs/services/claudeConversationService.js +158 -9
  60. package/lib/commonjs/services/connectedAccountsService.js +310 -10
  61. package/lib/commonjs/services/googleAuthService.js +252 -11
  62. package/lib/commonjs/services/hingeDataExtractor.js +105 -8
  63. package/lib/commonjs/services/hingeDataService.js +150 -9
  64. package/lib/commonjs/services/imageCompressionService.js +260 -7
  65. package/lib/commonjs/services/instagramDataExtractor.js +126 -8
  66. package/lib/commonjs/services/instagramDataService.js +163 -9
  67. package/lib/commonjs/services/jwtStorageService.js +276 -7
  68. package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
  69. package/lib/commonjs/services/linkedinProfileService.js +222 -9
  70. package/lib/commonjs/services/linkedinScrapingService.js +230 -8
  71. package/lib/commonjs/services/llmDataStorage.js +294 -8
  72. package/lib/commonjs/services/mobileTrainingService.js +186 -8
  73. package/lib/commonjs/services/netflixDataExtractor.js +120 -8
  74. package/lib/commonjs/services/netflixDataService.js +198 -9
  75. package/lib/commonjs/services/pinEncryptionService.js +84 -8
  76. package/lib/commonjs/services/pinStorageUtils.js +105 -7
  77. package/lib/commonjs/services/platformAuthService.js +1484 -12
  78. package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
  79. package/lib/commonjs/services/sephoraDataService.js +200 -9
  80. package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
  81. package/lib/commonjs/services/spotifyDataService.js +241 -9
  82. package/lib/commonjs/services/storageService.js +404 -8
  83. package/lib/commonjs/services/telegramDataExtractor.js +115 -8
  84. package/lib/commonjs/services/telegramDataService.js +499 -9
  85. package/lib/commonjs/services/trainingApiHelpers.js +73 -7
  86. package/lib/commonjs/services/userConnectionsService.js +340 -10
  87. package/lib/commonjs/services/youtubeMigrationService.js +416 -10
  88. package/lib/commonjs/theme/index.js +250 -7
  89. package/lib/commonjs/types/ambient.d.js +2 -1
  90. package/lib/commonjs/types/declarations.d.js +2 -1
  91. package/lib/commonjs/types/index.js +6 -1
  92. package/lib/commonjs/types/node-fix.d.js +2 -1
  93. package/lib/commonjs/types/node-override.d.js +2 -1
  94. package/lib/commonjs/types/opacity.d.js +2 -1
  95. package/lib/commonjs/types.js +14 -1
  96. package/lib/commonjs/utils/Portal.js +98 -8
  97. package/lib/commonjs/utils/api.js +130 -9
  98. package/lib/commonjs/utils/assetRegistry.js +210 -35
  99. package/lib/commonjs/utils/auth.js +112 -9
  100. package/lib/commonjs/utils/connectorTests.js +613 -29
  101. package/lib/commonjs/utils/crypto.js +62 -8
  102. package/lib/commonjs/utils/debugHelper.js +64 -1
  103. package/lib/commonjs/utils/encryption.js +76 -7
  104. package/lib/commonjs/utils/eventUtils.js +288 -1
  105. package/lib/commonjs/utils/haptics.js +66 -9
  106. package/lib/commonjs/utils/imagePreloader.js +6 -1
  107. package/lib/commonjs/utils/networkDiagnostics.js +226 -8
  108. package/lib/commonjs/utils/onairosApi.js +350 -9
  109. package/lib/commonjs/utils/programmaticFlow.js +117 -9
  110. package/lib/commonjs/utils/retryHelper.js +220 -1
  111. package/lib/commonjs/utils/secureStorage.js +349 -10
  112. package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
  113. package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
  114. package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
  115. package/lib/commonjs/utils/webviewScripts/index.js +698 -15
  116. package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
  117. package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
  118. package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
  119. package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
  120. package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
  121. package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
  122. package/lib/module/api/index.js +211 -1
  123. package/lib/module/components/BodyText.js +20 -1
  124. package/lib/module/components/BrandMark.js +104 -1
  125. package/lib/module/components/CodeInput.js +113 -1
  126. package/lib/module/components/EmailInput.js +23 -1
  127. package/lib/module/components/GoogleButton.js +49 -1
  128. package/lib/module/components/HeadingGroup.js +36 -1
  129. package/lib/module/components/LLMDataInputModal.js +656 -7
  130. package/lib/module/components/ModalHeader.js +92 -1
  131. package/lib/module/components/ModalSheet.js +39 -1
  132. package/lib/module/components/Onairos.js +373 -1
  133. package/lib/module/components/OnairosButton.js +305 -1
  134. package/lib/module/components/OnairosSignInButton.js +121 -1
  135. package/lib/module/components/Overlay.js +456 -1
  136. package/lib/module/components/PersonaImage.js +129 -1
  137. package/lib/module/components/PersonaLoadingScreen.js +310 -1
  138. package/lib/module/components/PersonalizationConsentScreen.js +460 -1
  139. package/lib/module/components/PinCreationScreen.js +396 -1
  140. package/lib/module/components/PinInput.js +456 -1
  141. package/lib/module/components/PlatformConnectorsStep.js +1302 -6
  142. package/lib/module/components/PlatformList.js +129 -1
  143. package/lib/module/components/PlatformToggle.js +173 -1
  144. package/lib/module/components/PrimaryButton.js +172 -1
  145. package/lib/module/components/SignInMatchAnimation.js +189 -1
  146. package/lib/module/components/SignInStep.js +338 -1
  147. package/lib/module/components/UniversalOnboarding.js +2770 -1
  148. package/lib/module/components/VerificationStep.js +168 -1
  149. package/lib/module/components/WelcomeScreen.js +453 -1
  150. package/lib/module/components/icons/Basicproficon.js +30 -1
  151. package/lib/module/components/icons/Basicprofile.js +14 -1
  152. package/lib/module/components/icons/Checkbox.js +14 -1
  153. package/lib/module/components/icons/Checkmark.js +20 -1
  154. package/lib/module/components/icons/Contentanalysis.js +14 -1
  155. package/lib/module/components/icons/Contenticon.js +32 -1
  156. package/lib/module/components/icons/EnochE.js +34 -1
  157. package/lib/module/components/icons/Personalityicon.js +23 -1
  158. package/lib/module/components/icons/Personalityprofile.js +14 -1
  159. package/lib/module/components/icons/Personalitytraits.js +14 -1
  160. package/lib/module/components/icons/Userpreferences.js +14 -1
  161. package/lib/module/components/icons/index.js +13 -1
  162. package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
  163. package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
  164. package/lib/module/components/onboarding/PinInput.js +274 -1
  165. package/lib/module/components/onboarding/PlatformConnector.js +240 -1
  166. package/lib/module/config/PLATFORM_APIS.md +849 -0
  167. package/lib/module/config/api.js +47 -1
  168. package/lib/module/constants/index.js +114 -1
  169. package/lib/module/context/AuthContext.js +335 -1
  170. package/lib/module/hooks/useConnectedAccounts.js +106 -1
  171. package/lib/module/hooks/useConnections.js +95 -1
  172. package/lib/module/hooks/useCredentials.js +171 -6
  173. package/lib/module/hooks/useUserConnections.js +140 -1
  174. package/lib/module/index.js +172 -1
  175. package/lib/module/services/apiClient.js +295 -1
  176. package/lib/module/services/biometricPinService.js +169 -1
  177. package/lib/module/services/chatGPTConversationExtractor.js +149 -1
  178. package/lib/module/services/chatGPTConversationService.js +268 -1
  179. package/lib/module/services/claudeConversationExtractor.js +97 -1
  180. package/lib/module/services/claudeConversationService.js +151 -1
  181. package/lib/module/services/connectedAccountsService.js +293 -1
  182. package/lib/module/services/googleAuthService.js +241 -1
  183. package/lib/module/services/hingeDataExtractor.js +99 -1
  184. package/lib/module/services/hingeDataService.js +143 -1
  185. package/lib/module/services/imageCompressionService.js +250 -1
  186. package/lib/module/services/instagramDataExtractor.js +120 -1
  187. package/lib/module/services/instagramDataService.js +156 -1
  188. package/lib/module/services/jwtStorageService.js +257 -1
  189. package/lib/module/services/linkedinDOMExtractor.js +234 -1
  190. package/lib/module/services/linkedinProfileService.js +210 -1
  191. package/lib/module/services/linkedinScrapingService.js +219 -1
  192. package/lib/module/services/llmDataStorage.js +277 -1
  193. package/lib/module/services/mobileTrainingService.js +173 -1
  194. package/lib/module/services/netflixDataExtractor.js +114 -1
  195. package/lib/module/services/netflixDataService.js +191 -1
  196. package/lib/module/services/pinEncryptionService.js +74 -6
  197. package/lib/module/services/pinStorageUtils.js +93 -1
  198. package/lib/module/services/platformAuthService.js +1461 -1
  199. package/lib/module/services/sephoraDataExtractor.js +134 -1
  200. package/lib/module/services/sephoraDataService.js +193 -1
  201. package/lib/module/services/spotifyDataExtractor.js +142 -1
  202. package/lib/module/services/spotifyDataService.js +234 -1
  203. package/lib/module/services/storageService.js +383 -1
  204. package/lib/module/services/telegramDataExtractor.js +109 -1
  205. package/lib/module/services/telegramDataService.js +493 -1
  206. package/lib/module/services/trainingApiHelpers.js +67 -1
  207. package/lib/module/services/userConnectionsService.js +329 -1
  208. package/lib/module/services/youtubeMigrationService.js +405 -1
  209. package/lib/module/theme/index.js +245 -1
  210. package/lib/module/types.js +10 -1
  211. package/lib/module/utils/Portal.js +90 -1
  212. package/lib/module/utils/api.js +118 -1
  213. package/lib/module/utils/assetRegistry.js +200 -34
  214. package/lib/module/utils/auth.js +100 -1
  215. package/lib/module/utils/connectorTests.js +600 -27
  216. package/lib/module/utils/crypto.js +54 -1
  217. package/lib/module/utils/debugHelper.js +54 -1
  218. package/lib/module/utils/encryption.js +67 -1
  219. package/lib/module/utils/eventUtils.js +270 -1
  220. package/lib/module/utils/haptics.js +59 -8
  221. package/lib/module/utils/imagePreloader.js +3 -1
  222. package/lib/module/utils/networkDiagnostics.js +217 -1
  223. package/lib/module/utils/onairosApi.js +333 -1
  224. package/lib/module/utils/programmaticFlow.js +111 -1
  225. package/lib/module/utils/retryHelper.js +211 -1
  226. package/lib/module/utils/secureStorage.js +330 -6
  227. package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
  228. package/lib/module/utils/webviewScripts/claude.js +370 -1
  229. package/lib/module/utils/webviewScripts/hinge.js +405 -1
  230. package/lib/module/utils/webviewScripts/index.js +434 -1
  231. package/lib/module/utils/webviewScripts/instagram.js +448 -1
  232. package/lib/module/utils/webviewScripts/linkedin.js +874 -1
  233. package/lib/module/utils/webviewScripts/netflix.js +376 -1
  234. package/lib/module/utils/webviewScripts/sephora.js +510 -1
  235. package/lib/module/utils/webviewScripts/spotify.js +413 -1
  236. package/lib/module/utils/webviewScripts/telegram.js +672 -1
  237. package/package.json +2 -2
@@ -1,8 +1,298 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("./jwtStorageService"),
5
- require("../config/api")
6
- ];
7
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
8
- Object[_0xc747(0x0)](exports,_0xc747(0x1),{'value':!![]}),exports[_0xc747(0x2)]=exports[_0xc747(0x3)]=exports[_0xc747(0x4)]=exports[_0xc747(0x5)]=exports[_0xc747(0x6)]=exports[_0xc747(0x7)]=exports[_0xc747(0x8)]=exports[_0xc747(0x9)]=void 0x0;var _jwtStorageService=__ONAIROS_REQ_FUNC__(0x0),_api=__ONAIROS_REQ_FUNC__(0x1);let currentRequestId=0x0;const activeRequests=new Map();class ApiClient{constructor(_0x331633=_api[_0xc747(0xa)][_0xc747(0xb)],_0x31dcd8={}){this[_0xc747(0xc)]=_0x331633,this[_0xc747(0xd)]=_0x31dcd8;}async[_0xc747(0xe)](_0x4cf703,_0x12a7cc={}){const _0x5baa9a={'IGPau':_0xc747(0xf),'URfiC':_0xc747(0x10),'KpqOZ':_0xc747(0x11),'AJUJe':function(_0x19791e,_0x5108e8,_0x56ee69){return _0x19791e(_0x5108e8,_0x56ee69);},'gMZwP':function(_0x3e700d,_0x5cf4ed){return _0x3e700d===_0x5cf4ed;},'XgLRc':_0xc747(0x12),'qiGux':_0xc747(0x13),'jmOgy':_0xc747(0x14),'IQoso':function(_0x1113eb,_0x294b20){return _0x1113eb instanceof _0x294b20;},'MiUuC':_0xc747(0x15)},_0x4fb50e=++currentRequestId,_0x58ebf0=new AbortController();activeRequests[_0xc747(0x16)](_0x4fb50e,_0x58ebf0);try{if(_0x5baa9a['IGPau']!==_0x5baa9a['URfiC']){console['log'](_0xc747(0x17)+_0x4fb50e+'\x20to:\x20'+_0x4cf703);const _0x4693b6=(0x0,_jwtStorageService['getTokenTypeForRoute'])(_0x4cf703);console[_0xc747(0x18)](_0xc747(0x19)+_0x4cf703+'\x20requires\x20'+_0x4693b6+_0xc747(0x1a));const _0x11bb7c=await this[_0xc747(0x1b)](_0x4cf703,_0x12a7cc['requiresAuth']!==![]),_0x46bbab={'method':_0x12a7cc['method']||'GET','headers':{'Content-Type':'application/json','User-Agent':_0x5baa9a[_0xc747(0x1c)],..._0x11bb7c,..._0x12a7cc[_0xc747(0x1d)]},'body':_0x12a7cc['body']?JSON[_0xc747(0x1e)](_0x12a7cc[_0xc747(0x1f)]):undefined,'signal':_0x58ebf0['signal']};console[_0xc747(0x18)](_0xc747(0x20)+_0x4fb50e+'\x20using\x20'+_0x4693b6+_0xc747(0x1a));const _0x3f37da=await _0x5baa9a[_0xc747(0x21)](fetch,''+this[_0xc747(0xc)]+_0x4cf703,_0x46bbab);console[_0xc747(0x18)](_0xc747(0x22)+_0x4fb50e+'\x20status:',_0x3f37da['status']);if(_0x5baa9a[_0xc747(0x23)](_0x3f37da[_0xc747(0x24)],0x191))return await this[_0xc747(0x25)](_0x4fb50e,_0x4cf703,_0x4693b6,_0x12a7cc);const _0x3e71d4=await _0x3f37da[_0xc747(0x26)]();activeRequests[_0xc747(0x27)](_0x4fb50e);if(!_0x3f37da['ok'])return _0x5baa9a[_0xc747(0x23)](_0x5baa9a[_0xc747(0x28)],_0x5baa9a[_0xc747(0x28)])?{'success':![],'error':_0x3e71d4[_0xc747(0x29)]||'Request\x20failed\x20with\x20status\x20'+_0x3f37da[_0xc747(0x24)],'status':_0x3f37da['status'],'tokenType':_0x4693b6}:this[_0xc747(0xe)](_0x3cee3f,{..._0x418716,'method':'POST','body':_0x1e0c83});return{'success':!![],'data':_0x3e71d4,'status':_0x3f37da['status'],'tokenType':_0x4693b6};}else return _0x14b789[_0xc747(0x18)]('🚫\x20[API\x20Client]\x20Request\x20'+_0x273434+_0xc747(0x2a)),{'success':![],'error':'Request\x20cancelled','status':0x0};}catch(_0x2c1ee6){activeRequests[_0xc747(0x27)](_0x4fb50e);if(_0x2c1ee6 instanceof Error&&_0x2c1ee6['name']===_0x5baa9a[_0xc747(0x2b)])return console[_0xc747(0x18)](_0xc747(0x2c)+_0x4fb50e+_0xc747(0x2a)),{'success':![],'error':_0x5baa9a[_0xc747(0x2d)],'status':0x0};return console[_0xc747(0x2e)](_0xc747(0x2f)+_0x4fb50e+_0xc747(0x30),_0x2c1ee6),{'success':![],'error':_0x5baa9a[_0xc747(0x31)](_0x2c1ee6,Error)?_0x2c1ee6[_0xc747(0x29)]:_0x5baa9a['MiUuC'],'status':0x0};}}async['getRequestHeaders'](_0x1da9ad,_0x2e5eb5){if(!_0x2e5eb5)return{};const _0x4ae3a7=await(0x0,_jwtStorageService['getJWTForRoute'])(_0x1da9ad);if(!_0x4ae3a7){const _0x12cd6c=(0x0,_jwtStorageService[_0xc747(0x32)])(_0x1da9ad);throw new Error(_0xc747(0x33)+_0x12cd6c+_0xc747(0x34)+_0x1da9ad+_0xc747(0x35));}return{'Authorization':_0x4ae3a7};}async[_0xc747(0x25)](_0x27acb5,_0x5c4980,_0x23aee9,_0x81691b){const _0x5ec2c9={'vKrAU':_0xc747(0x36)},_0x40665f=_0x5ec2c9[_0xc747(0x37)]['split']('|');let _0xe939d0=0x0;while(!![]){switch(_0x40665f[_0xe939d0++]){case'0':await(0x0,_jwtStorageService[_0xc747(0x38)])(_0x23aee9);continue;case'1':await this[_0xc747(0x39)](_0x23aee9,_0x5c4980);continue;case'2':console[_0xc747(0x18)](_0xc747(0x3a)+_0x23aee9+_0xc747(0x3b));continue;case'3':console[_0xc747(0x18)](_0xc747(0x3c)+_0x23aee9+_0xc747(0x3d));continue;case'4':this[_0xc747(0x3e)](_0x23aee9,_0x27acb5);continue;case'5':return{'success':![],'error':_0x23aee9+_0xc747(0x3f)+_0x5c4980+_0xc747(0x40),'status':0x191,'tokenType':_0x23aee9};case'6':console[_0xc747(0x2e)]('🚫\x20[API\x20Client]\x20Request\x20'+_0x27acb5+_0xc747(0x41)+_0x23aee9+'\x20token\x20on\x20route:\x20'+_0x5c4980);continue;}break;}}async[_0xc747(0x39)](_0x880374,_0x128f3b){const _0x42e526={'XDyPp':_0xc747(0x42),'sYtFO':function(_0x392ced,_0x48f44f){return _0x392ced===_0x48f44f;},'gyFnM':_0xc747(0x43),'vgRlM':_0xc747(0x44),'BqNqG':'🔑\x20[API\x20Client]\x20Triggering\x20Onairos\x20re-authentication','moeBN':'UezJo','gLUAm':_0xc747(0x45),'LzNWN':_0xc747(0x46),'HVRKH':function(_0x7d374,_0x4a393f){return _0x7d374!==_0x4a393f;},'WxBFP':'dJKpU','pPRsR':_0xc747(0x47)};console[_0xc747(0x18)](_0xc747(0x48)+_0x880374+'\x20token\x20(endpoint:\x20'+_0x128f3b+')');try{if('JugRS'===_0x42e526[_0xc747(0x49)])_0x27c0bd['log'](_0xc747(0x4a)+_0x38098d+':\x20null');else switch(_0x880374){case _jwtStorageService['TokenType']['ENOCH']:this['authTriggers'][_0xc747(0x4b)]?_0x42e526[_0xc747(0x4c)](_0xc747(0x4d),_0x42e526[_0xc747(0x4e)])?(_0x412f80[_0xc747(0x4f)](),_0x5c1ee0[_0xc747(0x27)](_0x412561),_0x22a35e++):(console[_0xc747(0x18)](_0xc747(0x50)),await this[_0xc747(0xd)]['triggerEnochReAuth']()):console[_0xc747(0x51)](_0x42e526['vgRlM']);break;case _jwtStorageService[_0xc747(0x52)][_0xc747(0x53)]:this[_0xc747(0xd)][_0xc747(0x54)]?(console[_0xc747(0x18)](_0x42e526[_0xc747(0x55)]),await this[_0xc747(0xd)]['triggerOnairosReAuth']()):_0x42e526[_0xc747(0x56)]===_0x42e526['gLUAm']?_0x452d50[_0xc747(0x18)](_0xc747(0x57)+_0x11efae+'\x20requests\x20due\x20to\x20'+_0x1336da+_0xc747(0x58)):console[_0xc747(0x51)](_0xc747(0x59));break;case _jwtStorageService['TokenType'][_0xc747(0x5a)]:this[_0xc747(0xd)][_0xc747(0x5b)]?_0x42e526[_0xc747(0x5c)]===_0x42e526[_0xc747(0x5c)]?(console[_0xc747(0x18)](_0xc747(0x5d)),await this[_0xc747(0xd)][_0xc747(0x5b)]()):_0x123e8b?_0x57b0e6[_0xc747(0x18)](_0xc747(0x5e)+_0x29154b+':\x20'+_0x39f163['substring'](0x0,0x14)+'...\x20(length:\x20'+_0x3de679[_0xc747(0x5f)]+')'):_0x4c2bd1[_0xc747(0x18)]('📭\x20'+_0x27fbaf+_0xc747(0x60)):_0x42e526[_0xc747(0x61)](_0x42e526['WxBFP'],_0xc747(0x62))?console['warn'](_0x42e526[_0xc747(0x63)]):_0x42497f[_0xc747(0x51)](_0xc747(0x44));break;}}catch(_0x3778dc){console[_0xc747(0x2e)](_0xc747(0x64)+_0x880374+':',_0x3778dc);}}[_0xc747(0x3e)](_0x593fc2,_0x2e2782){const _0x340cc6={'LOQFd':function(_0x2ad569,_0x256ec7){return _0x2ad569!==_0x256ec7;},'kvGGr':_0xc747(0x65),'HNesk':function(_0x119da2,_0x4682d8){return _0x119da2>_0x4682d8;},'gEDIn':function(_0x40d2f1,_0x3ce289){return _0x40d2f1!==_0x3ce289;},'jmfuq':_0xc747(0x66)};let _0x2fc907=0x0;for(const [_0x190b3e,_0x1c67ae]of activeRequests[_0xc747(0x67)]()){if(_0x340cc6[_0xc747(0x68)](_0x190b3e,_0x2e2782)){if(_0xc747(0x69)===_0x340cc6[_0xc747(0x6a)])return{};else _0x1c67ae['abort'](),activeRequests[_0xc747(0x27)](_0x190b3e),_0x2fc907++;}}_0x340cc6[_0xc747(0x6b)](_0x2fc907,0x0)&&(_0x340cc6[_0xc747(0x6c)]('sjLHb',_0x340cc6[_0xc747(0x6d)])?(this[_0xc747(0xc)]=_0x230123,this[_0xc747(0xd)]=_0x203bc5):console[_0xc747(0x18)](_0xc747(0x57)+_0x2fc907+'\x20requests\x20due\x20to\x20'+_0x593fc2+'\x20token\x20failure'));}async[_0xc747(0x6e)](_0x3d9333,_0xcd3aea){console[_0xc747(0x18)]('🔄\x20[API\x20Client]\x20Replacing\x20'+_0x3d9333+_0xc747(0x1a)),this[_0xc747(0x3e)](_0x3d9333);const _0x3bc629=await(0x0,_jwtStorageService[_0xc747(0x6f)])(_0x3d9333,_0xcd3aea);return _0x3bc629&&console['log'](_0xc747(0x70)+_0x3d9333+_0xc747(0x71)),_0x3bc629;}async[_0xc747(0x72)](){const _0xf26134={'zwbDy':function(_0x3b1996,_0x36020f){return _0x3b1996 instanceof _0x36020f;},'gTtIg':function(_0x2c6dfb,_0xf3fc5b){return _0x2c6dfb===_0xf3fc5b;},'WYBIN':_0xc747(0x14),'DQtov':function(_0x1d9545,_0x2a718e){return _0x1d9545 instanceof _0x2a718e;},'kJLEi':_0xc747(0x15),'ZhmRa':_0xc747(0x73),'dVxUZ':function(_0x127e25,_0x44d547){return _0x127e25===_0x44d547;},'dXeKi':_0xc747(0x74)};console[_0xc747(0x18)](_0xf26134['ZhmRa']);const _0x2ab3ff=await(0x0,_jwtStorageService['getAllTokens'])();for(const [_0x4811dc,_0x1df625]of Object[_0xc747(0x67)](_0x2ab3ff)){if(_0x1df625){if(_0xf26134[_0xc747(0x75)](_0xf26134[_0xc747(0x76)],_0xf26134[_0xc747(0x76)]))console['log'](_0xc747(0x5e)+_0x4811dc+':\x20'+_0x1df625[_0xc747(0x77)](0x0,0x14)+_0xc747(0x78)+_0x1df625['length']+')');else{_0x2e7cbe[_0xc747(0x27)](_0x1545ba);if(_0xf26134[_0xc747(0x79)](_0x2a8980,_0x41f00e)&&_0xf26134['gTtIg'](_0x2ac0d1[_0xc747(0x7a)],'AbortError'))return _0x6a8efe[_0xc747(0x18)]('🚫\x20[API\x20Client]\x20Request\x20'+_0x4a18e6+'\x20was\x20cancelled'),{'success':![],'error':_0xf26134[_0xc747(0x7b)],'status':0x0};return _0x34c180[_0xc747(0x2e)](_0xc747(0x2f)+_0x564f88+'\x20failed:',_0x343e33),{'success':![],'error':_0xf26134['DQtov'](_0x476bd2,_0x20e279)?_0x2983ce[_0xc747(0x29)]:_0xf26134[_0xc747(0x7c)],'status':0x0};}}else console['log'](_0xc747(0x4a)+_0x4811dc+_0xc747(0x60));}return _0x2ab3ff;}['setAuthTriggers'](_0x509e43){const _0x3ef54c={'lfIRC':'🔧\x20[API\x20Client]\x20Authentication\x20triggers\x20updated'};this[_0xc747(0xd)]={...this[_0xc747(0xd)],..._0x509e43},console[_0xc747(0x18)](_0x3ef54c[_0xc747(0x7d)]);}async[_0xc747(0x7e)](_0x51bca9,_0xe7841c={}){return this[_0xc747(0xe)](_0x51bca9,{..._0xe7841c,'method':'GET'});}async[_0xc747(0x7f)](_0x194afa,_0x422020,_0x521f76={}){return this[_0xc747(0xe)](_0x194afa,{..._0x521f76,'method':'POST','body':_0x422020});}async[_0xc747(0x80)](_0x44137f,_0x23aea2,_0x548264={}){return this[_0xc747(0xe)](_0x44137f,{..._0x548264,'method':'PUT','body':_0x23aea2});}async[_0xc747(0x27)](_0x25e028,_0x5cd572={}){return this['request'](_0x25e028,{..._0x5cd572,'method':'DELETE'});}}function _0x51c1(){const _0x2cccb2=['defineProperty','__esModule','default','authenticatedRequest','apiPut','apiPost','apiGet','apiDelete','apiClient','ApiClient','API_CONFIG','BASE_URL','baseUrl','authTriggers','request','zmpRq','hOykQ','OnairosSDK/1.0.0','nTzFj','AbortError','Request\x20cancelled','Unknown\x20error','set','🔗\x20[API\x20Client]\x20Starting\x20request\x20','log','🎯\x20[API\x20Client]\x20Route\x20','\x20token','getRequestHeaders','KpqOZ','headers','stringify','body','🔐\x20[API\x20Client]\x20Request\x20','AJUJe','📡\x20[API\x20Client]\x20Response\x20','gMZwP','status','handle401Error','json','delete','XgLRc','message','\x20was\x20cancelled','qiGux','🚫\x20[API\x20Client]\x20Request\x20','jmOgy','error','❌\x20[API\x20Client]\x20Request\x20','\x20failed:','IQoso','getTokenTypeForRoute','No\x20','\x20token\x20available\x20for\x20route\x20','.\x20Please\x20authenticate\x20first.','6|3|0|4|1|2|5','vKrAU','clearJWT','triggerReAuthForTokenType','🔑\x20[API\x20Client]\x20','\x20token\x20cleared,\x20user\x20needs\x20to\x20re-authenticate','🔄\x20[API\x20Client]\x20Clearing\x20','\x20token\x20due\x20to\x20401\x20error','cancelRequestsForTokenType','\x20authentication\x20expired\x20for\x20','.\x20Please\x20re-authenticate.','\x20received\x20401\x20for\x20','cdrLA','bpDWE','⚠️\x20[API\x20Client]\x20No\x20Enoch\x20re-auth\x20trigger\x20configured','WVFyW','AjmuR','⚠️\x20[API\x20Client]\x20No\x20auth\x20token\x20refresh\x20trigger\x20configured','🔄\x20[API\x20Client]\x20Triggering\x20re-auth\x20for\x20','XDyPp','📭\x20','triggerEnochReAuth','sYtFO','fkTjN','gyFnM','abort','📧\x20[API\x20Client]\x20Triggering\x20Enoch\x20email\x20re-verification','warn','TokenType','ONAIROS','triggerOnairosReAuth','BqNqG','moeBN','🚫\x20[API\x20Client]\x20Cancelled\x20','\x20token\x20failure','⚠️\x20[API\x20Client]\x20No\x20Onairos\x20re-auth\x20trigger\x20configured','AUTH','triggerAuthTokenRefresh','LzNWN','🔄\x20[API\x20Client]\x20Triggering\x20auth\x20token\x20refresh','🔐\x20','length',':\x20null','HVRKH','dOxKQ','pPRsR','❌\x20[API\x20Client]\x20Failed\x20to\x20trigger\x20re-auth\x20for\x20','ryHSZ','sjLHb','entries','LOQFd','KNDON','kvGGr','HNesk','gEDIn','jmfuq','replaceTokenForType','replaceJWTAfterVerification','✅\x20[API\x20Client]\x20','\x20token\x20replaced\x20and\x20related\x20requests\x20cancelled','debugTokens','🔍\x20[API\x20Client]\x20Debug:\x20Current\x20token\x20status','xGXiR','dVxUZ','dXeKi','substring','...\x20(length:\x20','zwbDy','name','WYBIN','kJLEi','lfIRC','get','post','put','bind'];_0x51c1=function(){return _0x2cccb2;};return _0x51c1();}function _0xc747(_0x51c176,_0xc7471a){_0x51c176=_0x51c176-0x0;const _0x28dfbe=_0x51c1();let _0x45428d=_0x28dfbe[_0x51c176];return _0x45428d;}exports[_0xc747(0x9)]=ApiClient;const apiClient=exports[_0xc747(0x8)]=new ApiClient(),authenticatedRequest=exports['authenticatedRequest']=apiClient[_0xc747(0xe)][_0xc747(0x81)](apiClient),apiGet=exports[_0xc747(0x6)]=apiClient['get'][_0xc747(0x81)](apiClient),apiPost=exports[_0xc747(0x5)]=apiClient[_0xc747(0x7f)]['bind'](apiClient),apiPut=exports['apiPut']=apiClient[_0xc747(0x80)][_0xc747(0x81)](apiClient),apiDelete=exports[_0xc747(0x7)]=apiClient[_0xc747(0x27)][_0xc747(0x81)](apiClient);var _default=exports[_0xc747(0x2)]=apiClient;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.authenticatedRequest = exports.apiPut = exports.apiPost = exports.apiGet = exports.apiDelete = exports.apiClient = exports.ApiClient = void 0;
7
+ var _jwtStorageService = require("./jwtStorageService");
8
+ var _api = require("../config/api");
9
+ /**
10
+ * Centralized API Client with Route-Based JWT Token Management
11
+ * CORRECTED APPROACH: Uses different JWT tokens for different route families
12
+ *
13
+ * TOKEN ROUTING:
14
+ * - Enoch JWT: /enoch/*, /api/auth/*, /mobile-training/enoch
15
+ * - Onairos JWT: /youtube/*, /gmail/*, social connections
16
+ * - Auth Token: Context-specific auth flows
17
+ */
18
+
19
+ /**
20
+ * Global request counter for tracking in-flight requests
21
+ */
22
+ let currentRequestId = 0;
23
+ const activeRequests = new Map();
24
+
25
+ /**
26
+ * Route-specific authentication triggers
27
+ */
28
+
29
+ /**
30
+ * Create API client with route-based token management
31
+ */
32
+ class ApiClient {
33
+ constructor(baseUrl = _api.API_CONFIG.BASE_URL, authTriggers = {}) {
34
+ this.baseUrl = baseUrl;
35
+ this.authTriggers = authTriggers;
36
+ }
37
+
38
+ /**
39
+ * Make authenticated API request with route-based token selection
40
+ * CRITICAL: Uses the correct token type based on route
41
+ */
42
+ async request(endpoint, options = {}) {
43
+ const requestId = ++currentRequestId;
44
+ const abortController = new AbortController();
45
+ activeRequests.set(requestId, abortController);
46
+ try {
47
+ console.log(`🔗 [API Client] Starting request ${requestId} to: ${endpoint}`);
48
+
49
+ // CRITICAL FIX: Determine which token type to use based on route
50
+ const tokenType = (0, _jwtStorageService.getTokenTypeForRoute)(endpoint);
51
+ console.log(`🎯 [API Client] Route ${endpoint} requires ${tokenType} token`);
52
+
53
+ // Get route-specific headers
54
+ const headers = await this.getRequestHeaders(endpoint, options.requiresAuth !== false);
55
+ const fetchOptions = {
56
+ method: options.method || 'GET',
57
+ headers: {
58
+ 'Content-Type': 'application/json',
59
+ 'User-Agent': 'OnairosSDK/1.0.0',
60
+ ...headers,
61
+ ...options.headers
62
+ },
63
+ body: options.body ? JSON.stringify(options.body) : undefined,
64
+ signal: abortController.signal
65
+ };
66
+ console.log(`🔐 [API Client] Request ${requestId} using ${tokenType} token`);
67
+ const response = await fetch(`${this.baseUrl}${endpoint}`, fetchOptions);
68
+ console.log(`📡 [API Client] Response ${requestId} status:`, response.status);
69
+
70
+ // CRITICAL FIX: Route-specific 401 handler
71
+ if (response.status === 401) {
72
+ return await this.handle401Error(requestId, endpoint, tokenType, options);
73
+ }
74
+ const result = await response.json();
75
+ activeRequests.delete(requestId);
76
+ if (!response.ok) {
77
+ return {
78
+ success: false,
79
+ error: result.message || `Request failed with status ${response.status}`,
80
+ status: response.status,
81
+ tokenType
82
+ };
83
+ }
84
+ return {
85
+ success: true,
86
+ data: result,
87
+ status: response.status,
88
+ tokenType
89
+ };
90
+ } catch (error) {
91
+ activeRequests.delete(requestId);
92
+ if (error instanceof Error && error.name === 'AbortError') {
93
+ console.log(`🚫 [API Client] Request ${requestId} was cancelled`);
94
+ return {
95
+ success: false,
96
+ error: 'Request cancelled',
97
+ status: 0
98
+ };
99
+ }
100
+ console.error(`❌ [API Client] Request ${requestId} failed:`, error);
101
+ return {
102
+ success: false,
103
+ error: error instanceof Error ? error.message : 'Unknown error',
104
+ status: 0
105
+ };
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Get request headers with route-appropriate token
111
+ * CRITICAL: Selects correct token based on route
112
+ */
113
+ async getRequestHeaders(endpoint, requiresAuth) {
114
+ if (!requiresAuth) {
115
+ return {};
116
+ }
117
+
118
+ // CRITICAL FIX: Get token specifically for this route
119
+ const token = await (0, _jwtStorageService.getJWTForRoute)(endpoint);
120
+ if (!token) {
121
+ const tokenType = (0, _jwtStorageService.getTokenTypeForRoute)(endpoint);
122
+ throw new Error(`No ${tokenType} token available for route ${endpoint}. Please authenticate first.`);
123
+ }
124
+ return {
125
+ 'Authorization': token
126
+ };
127
+ }
128
+
129
+ /**
130
+ * Handle 401 errors with route-specific re-authentication
131
+ * CRITICAL FIX: Different auth flows for different token types
132
+ */
133
+ async handle401Error(requestId, endpoint, tokenType, options) {
134
+ console.error(`🚫 [API Client] Request ${requestId} received 401 for ${tokenType} token on route: ${endpoint}`);
135
+
136
+ // CRITICAL FIX: Clear only the specific token type that failed
137
+ console.log(`🔄 [API Client] Clearing ${tokenType} token due to 401 error`);
138
+ await (0, _jwtStorageService.clearJWT)(tokenType);
139
+
140
+ // Cancel requests using the same token type
141
+ this.cancelRequestsForTokenType(tokenType, requestId);
142
+
143
+ // CRITICAL FIX: Route-specific re-authentication
144
+ await this.triggerReAuthForTokenType(tokenType, endpoint);
145
+ console.log(`🔑 [API Client] ${tokenType} token cleared, user needs to re-authenticate`);
146
+ return {
147
+ success: false,
148
+ error: `${tokenType} authentication expired for ${endpoint}. Please re-authenticate.`,
149
+ status: 401,
150
+ tokenType
151
+ };
152
+ }
153
+
154
+ /**
155
+ * Trigger appropriate re-authentication based on token type
156
+ */
157
+ async triggerReAuthForTokenType(tokenType, endpoint) {
158
+ console.log(`🔄 [API Client] Triggering re-auth for ${tokenType} token (endpoint: ${endpoint})`);
159
+ try {
160
+ switch (tokenType) {
161
+ case _jwtStorageService.TokenType.ENOCH:
162
+ if (this.authTriggers.triggerEnochReAuth) {
163
+ console.log('📧 [API Client] Triggering Enoch email re-verification');
164
+ await this.authTriggers.triggerEnochReAuth();
165
+ } else {
166
+ console.warn('⚠️ [API Client] No Enoch re-auth trigger configured');
167
+ }
168
+ break;
169
+ case _jwtStorageService.TokenType.ONAIROS:
170
+ if (this.authTriggers.triggerOnairosReAuth) {
171
+ console.log('🔑 [API Client] Triggering Onairos re-authentication');
172
+ await this.authTriggers.triggerOnairosReAuth();
173
+ } else {
174
+ console.warn('⚠️ [API Client] No Onairos re-auth trigger configured');
175
+ }
176
+ break;
177
+ case _jwtStorageService.TokenType.AUTH:
178
+ if (this.authTriggers.triggerAuthTokenRefresh) {
179
+ console.log('🔄 [API Client] Triggering auth token refresh');
180
+ await this.authTriggers.triggerAuthTokenRefresh();
181
+ } else {
182
+ console.warn('⚠️ [API Client] No auth token refresh trigger configured');
183
+ }
184
+ break;
185
+ }
186
+ } catch (error) {
187
+ console.error(`❌ [API Client] Failed to trigger re-auth for ${tokenType}:`, error);
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Cancel requests using a specific token type
193
+ */
194
+ cancelRequestsForTokenType(tokenType, excludeRequestId) {
195
+ let cancelledCount = 0;
196
+
197
+ // Note: In a full implementation, we'd track which requests use which tokens
198
+ // For now, we cancel all other requests as a safety measure
199
+ for (const [requestId, controller] of activeRequests.entries()) {
200
+ if (requestId !== excludeRequestId) {
201
+ controller.abort();
202
+ activeRequests.delete(requestId);
203
+ cancelledCount++;
204
+ }
205
+ }
206
+ if (cancelledCount > 0) {
207
+ console.log(`🚫 [API Client] Cancelled ${cancelledCount} requests due to ${tokenType} token failure`);
208
+ }
209
+ }
210
+
211
+ /**
212
+ * Replace token for specific type and cancel related requests
213
+ */
214
+ async replaceTokenForType(tokenType, newToken) {
215
+ console.log(`🔄 [API Client] Replacing ${tokenType} token`);
216
+
217
+ // Cancel all in-flight requests using this token type
218
+ this.cancelRequestsForTokenType(tokenType);
219
+
220
+ // Replace token using storage service
221
+ const replaced = await (0, _jwtStorageService.replaceJWTAfterVerification)(tokenType, newToken);
222
+ if (replaced) {
223
+ console.log(`✅ [API Client] ${tokenType} token replaced and related requests cancelled`);
224
+ }
225
+ return replaced;
226
+ }
227
+
228
+ /**
229
+ * Debug: Get all current tokens
230
+ */
231
+ async debugTokens() {
232
+ console.log('🔍 [API Client] Debug: Current token status');
233
+ const tokens = await (0, _jwtStorageService.getAllTokens)();
234
+ for (const [tokenType, token] of Object.entries(tokens)) {
235
+ if (token) {
236
+ console.log(`🔐 ${tokenType}: ${token.substring(0, 20)}... (length: ${token.length})`);
237
+ } else {
238
+ console.log(`📭 ${tokenType}: null`);
239
+ }
240
+ }
241
+ return tokens;
242
+ }
243
+
244
+ /**
245
+ * Set authentication triggers
246
+ */
247
+ setAuthTriggers(triggers) {
248
+ this.authTriggers = {
249
+ ...this.authTriggers,
250
+ ...triggers
251
+ };
252
+ console.log('🔧 [API Client] Authentication triggers updated');
253
+ }
254
+
255
+ /**
256
+ * Convenience methods for common HTTP verbs
257
+ */
258
+ async get(endpoint, options = {}) {
259
+ return this.request(endpoint, {
260
+ ...options,
261
+ method: 'GET'
262
+ });
263
+ }
264
+ async post(endpoint, body, options = {}) {
265
+ return this.request(endpoint, {
266
+ ...options,
267
+ method: 'POST',
268
+ body
269
+ });
270
+ }
271
+ async put(endpoint, body, options = {}) {
272
+ return this.request(endpoint, {
273
+ ...options,
274
+ method: 'PUT',
275
+ body
276
+ });
277
+ }
278
+ async delete(endpoint, options = {}) {
279
+ return this.request(endpoint, {
280
+ ...options,
281
+ method: 'DELETE'
282
+ });
283
+ }
284
+ }
285
+
286
+ // SINGLE INSTANCE - Global API client
287
+ exports.ApiClient = ApiClient;
288
+ const apiClient = exports.apiClient = new ApiClient();
289
+ // Export convenience functions
290
+ const authenticatedRequest = exports.authenticatedRequest = apiClient.request.bind(apiClient);
291
+ const apiGet = exports.apiGet = apiClient.get.bind(apiClient);
292
+ const apiPost = exports.apiPost = apiClient.post.bind(apiClient);
293
+ const apiPut = exports.apiPut = apiClient.put.bind(apiClient);
294
+ const apiDelete = exports.apiDelete = apiClient.delete.bind(apiClient);
295
+
296
+ // Export types for external use
297
+ var _default = exports.default = apiClient;
298
+ //# sourceMappingURL=apiClient.js.map
@@ -1,8 +1,180 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("react-native-keychain"),
5
- require("react-native")
6
- ];
7
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
8
- function _0x1d8d(_0xe44877,_0x1d8db2){_0xe44877=_0xe44877-0x0;const _0x84a4c4=_0xe448();let _0x2049a2=_0x84a4c4[_0xe44877];return _0x2049a2;}function _0xe448(){const _0x1404f8=['removePinFromStorage','isBiometricAvailable','biometricPinService','❌\x20Error\x20checking\x20PIN\x20storage:','default','function','TMOzb','qljks','mpqQS','__esModule','Wkzeb','IvbKt','eYhZE','jtZUd','lfSjy','has','IKLug','HFgiN','hasOwnProperty','call','defineProperty','getOwnPropertyDescriptor','set','OnairosEventsPIN','user_pin','📱\x20Biometric\x20not\x20available','📱\x20Biometric\x20support:','❌\x20Error\x20checking\x20biometric\x20availability:','horNI','leQkX','getSupportedBiometryType','log','XrOtj','gYSaz','BIOMETRY_TYPE','FACE_ID','FINGERPRINT','FACE','EObZR','IRIS','gxdjq','error','tDtzz','❌\x20Face\x20ID/Touch\x20ID\x20not\x20available\x20on\x20this\x20device','Cancel','android','Authenticate\x20with\x20biometric\x20to\x20secure\x20your\x20PIN','Kuukd','❌\x20Face\x20ID\x20authentication\x20failed:','UserCancel','xXGub','👤\x20User\x20cancelled\x20Face\x20ID\x20authentication','AuthenticationFailed','🚫\x20Face\x20ID\x20authentication\x20failed','BiometryLockout','LEtvl','vPLjA','📱\x20Face\x20ID\x20available,\x20showing\x20authentication\x20prompt...','ACCESS_CONTROL','BIOMETRY_CURRENT_SET','AUTHENTICATION_TYPE','BIOMETRICS','Platform','kzroU','oyOJX','rLLtZ','KPpdM','👤\x20Requesting\x20Face\x20ID\x20authentication...','setGenericPassword','LLxKe','bToYr','✅\x20PIN\x20retrieved\x20successfully','jSelo','❌\x20Error\x20details:','message','domain','userInfo','XJRrw','includes','PfJNB','EZVyG','code','zPvCp','nAyCR','⚠️\x20No\x20PIN\x20found\x20in\x20secure\x20storage','WnMXb','swFlk','tPCbF','QpLcz','GVSrl','WWLUE','FHWjc','eiyEJ','AwDJY','QjrYL','bmkWq','cIFQg','❌\x20Unknown\x20Face\x20ID\x20error:','storePinWithBiometric','DlCwz','🔓\x20Retrieving\x20PIN\x20with\x20biometric\x20authentication...','Aahco','❌\x20Error\x20retrieving\x20PIN\x20with\x20biometric:','👤\x20User\x20cancelled\x20biometric\x20authentication','BiometryNotAvailable','DRJFE','kBgOh','JgyYB','iGuTH','getGenericPassword','password','MPBEl','XMbDc','TWUUn','dzXqd','lFRgG','FvczS','oeTwI','object','rtsoh','get','PsqVf','swiGm','AiYKx','aEJKs','qUAaZ','SnDnX','GEEyr','gIfQM','peQif','ZPtHq','MAuee','ehGmG','KHMDB','poRyD','vmuEK','retrievePinWithBiometric','gmpyQ','UYjXG','TRhbr','ZlQwa','EZMmd','tffyM','Tuank','VWHvX','gaCUU','XnmmA','isPinStored','GuFff','🗑️\x20Removing\x20PIN\x20from\x20secure\x20storage...','eXaGL','❌\x20Error\x20removing\x20PIN\x20from\x20storage:','YXySo','KTXTc','resetGenericPassword','COTrB','gwtPz','egOhZ','WNRwg','OITnU','JmwQw','sNMwf','oGrFU','sWSWu','VJwLE'];_0xe448=function(){return _0x1404f8;};return _0xe448();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['storePinWithBiometric']=exports['retrievePinWithBiometric']=exports[_0x1d8d(0x0)]=exports['isPinStored']=exports[_0x1d8d(0x1)]=exports[_0x1d8d(0x2)]=void 0x0;var Keychain=_interopRequireWildcard(__ONAIROS_REQ_FUNC__(0x0)),_reactNative=__ONAIROS_REQ_FUNC__(0x1);function _interopRequireWildcard(_0x2c5e71,_0x28d50b){const _0x3cb2b6={'IKLug':_0x1d8d(0x3),'mpqQS':function(_0x5264fe,_0x5aedf4){return _0x5264fe&&_0x5aedf4;},'Wkzeb':function(_0x422597,_0x1509e1){return _0x422597===_0x1509e1;},'IvbKt':function(_0x1f129a,_0x41f515){return _0x1f129a!=_0x41f515;},'yURoq':'object','eYhZE':function(_0x3ad3f6,_0x3e251a){return _0x3ad3f6!=_0x3e251a;},'jtZUd':'yAnZX','HFgiN':function(_0x71bb35,_0x1485e5){return _0x71bb35!==_0x1485e5;},'fKYKr':_0x1d8d(0x4),'TMOzb':function(_0x4bd893,_0x5e30a1){return _0x4bd893==_0x5e30a1;},'qljks':_0x1d8d(0x5)};if(_0x3cb2b6[_0x1d8d(0x6)](_0x3cb2b6[_0x1d8d(0x7)],typeof WeakMap))var _0x132212=new WeakMap(),_0x52ae72=new WeakMap();return(_interopRequireWildcard=function(_0x2cc570,_0xcd782f){if(_0x3cb2b6[_0x1d8d(0x8)](!_0xcd782f,_0x2cc570)&&_0x2cc570[_0x1d8d(0x9)])return _0x2cc570;var _0x22705e,_0x4c9d01,_0x411d9b={'__proto__':null,'default':_0x2cc570};if(_0x3cb2b6[_0x1d8d(0xa)](null,_0x2cc570)||_0x3cb2b6[_0x1d8d(0xb)](_0x3cb2b6['yURoq'],typeof _0x2cc570)&&_0x3cb2b6[_0x1d8d(0xc)](_0x1d8d(0x5),typeof _0x2cc570))return _0x411d9b;if(_0x22705e=_0xcd782f?_0x52ae72:_0x132212){if(_0x3cb2b6[_0x1d8d(0xd)]!==_0x1d8d(0xe)){if(_0x22705e[_0x1d8d(0xf)](_0x2cc570))return _0x22705e['get'](_0x2cc570);_0x22705e['set'](_0x2cc570,_0x411d9b);}else return _0xcbd6a7['error'](_0x3cb2b6[_0x1d8d(0x10)],_0x329244),![];}for(const _0x2ada3a in _0x2cc570)_0x3cb2b6[_0x1d8d(0x11)](_0x3cb2b6['fKYKr'],_0x2ada3a)&&{}[_0x1d8d(0x12)][_0x1d8d(0x13)](_0x2cc570,_0x2ada3a)&&((_0x4c9d01=(_0x22705e=Object[_0x1d8d(0x14)])&&Object[_0x1d8d(0x15)](_0x2cc570,_0x2ada3a))&&(_0x4c9d01['get']||_0x4c9d01[_0x1d8d(0x16)])?_0x22705e(_0x411d9b,_0x2ada3a,_0x4c9d01):_0x411d9b[_0x2ada3a]=_0x2cc570[_0x2ada3a]);return _0x411d9b;})(_0x2c5e71,_0x28d50b);}const PIN_SERVICE_KEY=_0x1d8d(0x17),PIN_USERNAME=_0x1d8d(0x18),isBiometricAvailable=async()=>{const _0x243d9d={'gxdjq':_0x1d8d(0x19),'horNI':function(_0x3973cb,_0x388fa4){return _0x3973cb!==_0x388fa4;},'YdCqq':'jJapC','XrOtj':_0x1d8d(0x1a),'gYSaz':function(_0x597af7,_0x30d161){return _0x597af7===_0x30d161;},'EObZR':function(_0x455b9c,_0x322366){return _0x455b9c===_0x322366;},'tDtzz':_0x1d8d(0x1b)};try{if(_0x243d9d[_0x1d8d(0x1c)](_0x1d8d(0x1d),_0x243d9d['YdCqq'])){const _0x8d291f=await Keychain[_0x1d8d(0x1e)]();return console[_0x1d8d(0x1f)](_0x243d9d[_0x1d8d(0x20)],_0x8d291f),_0x243d9d[_0x1d8d(0x21)](_0x8d291f,Keychain[_0x1d8d(0x22)][_0x1d8d(0x23)])||_0x8d291f===Keychain['BIOMETRY_TYPE']['TOUCH_ID']||_0x243d9d['gYSaz'](_0x8d291f,Keychain['BIOMETRY_TYPE'][_0x1d8d(0x24)])||_0x243d9d[_0x1d8d(0x21)](_0x8d291f,Keychain[_0x1d8d(0x22)][_0x1d8d(0x25)])||_0x243d9d[_0x1d8d(0x26)](_0x8d291f,Keychain[_0x1d8d(0x22)][_0x1d8d(0x27)]);}else return _0x536f58[_0x1d8d(0x1f)](_0x243d9d[_0x1d8d(0x28)]),null;}catch(_0x49a169){return console[_0x1d8d(0x29)](_0x243d9d[_0x1d8d(0x2a)],_0x49a169),![];}};exports[_0x1d8d(0x1)]=isBiometricAvailable;const storePinWithBiometric=async _0x3a6d0a=>{const _0x55522e={'XJRrw':function(_0x13ff81,_0x373826){return _0x13ff81!==_0x373826;},'LEtvl':'TEqYi','EJjXh':function(_0x55f715){return _0x55f715();},'vPLjA':_0x1d8d(0x2b),'iyyYw':'Authenticate\x20with\x20Face\x20ID\x20to\x20secure\x20your\x20PIN','KPpdM':_0x1d8d(0x2c),'kzroU':function(_0x116ea7,_0x431159){return _0x116ea7===_0x431159;},'oyOJX':_0x1d8d(0x2d),'rLLtZ':_0x1d8d(0x2e),'WOLvm':'✅\x20Face\x20ID\x20authentication\x20successful\x20-\x20PIN\x20stored\x20securely','LLxKe':function(_0x170617,_0x495c37){return _0x170617!==_0x495c37;},'bToYr':_0x1d8d(0x2f),'jSelo':_0x1d8d(0x30),'BAJdq':function(_0x3f601e,_0x4efaa3){return _0x3f601e!==_0x4efaa3;},'PfJNB':_0x1d8d(0x31),'EZVyG':function(_0x409e65,_0x595402){return _0x409e65===_0x595402;},'QjrYL':function(_0x23eae4,_0x42ef13){return _0x23eae4===_0x42ef13;},'zPvCp':function(_0x3566af,_0x40b6a5){return _0x3566af!==_0x40b6a5;},'nAyCR':_0x1d8d(0x32),'WnMXb':_0x1d8d(0x33),'swFlk':'BiometryNotAvailable','tPCbF':function(_0x2d3dd9,_0x29b0e7){return _0x2d3dd9===_0x29b0e7;},'YUSLM':function(_0x5219b4,_0x20dd2f){return _0x5219b4===_0x20dd2f;},'QpLcz':function(_0x141d5e,_0x5090c5){return _0x141d5e===_0x5090c5;},'GVSrl':function(_0x6da936,_0x2d5c34){return _0x6da936!==_0x2d5c34;},'ncGjH':function(_0x184362,_0x55390b){return _0x184362!==_0x55390b;},'WWLUE':_0x1d8d(0x34),'FHWjc':function(_0x35ddfd,_0x3c6d3c){return _0x35ddfd===_0x3c6d3c;},'eiyEJ':function(_0x41bd76,_0x5e74c6){return _0x41bd76===_0x5e74c6;},'eznBC':_0x1d8d(0x35),'AwDJY':_0x1d8d(0x36),'bmkWq':function(_0xc5d08,_0x2b426b){return _0xc5d08===_0x2b426b;},'cIFQg':'🔒\x20Face\x20ID\x20locked\x20out\x20-\x20too\x20many\x20failed\x20attempts'};try{if(_0x55522e['XJRrw'](_0x55522e[_0x1d8d(0x37)],_0x55522e[_0x1d8d(0x37)])){if(_0xa76fd2[_0x1d8d(0xf)](_0x2ff5a3))return _0x5d6e45['get'](_0x2ad70e);_0x370016['set'](_0x2515c3,_0xcae11f);}else{console[_0x1d8d(0x1f)]('🔐\x20Starting\x20Face\x20ID\x20authentication\x20for\x20PIN\x20storage...');const _0x39c31e=await _0x55522e['EJjXh'](isBiometricAvailable);if(!_0x39c31e)return console['error'](_0x55522e[_0x1d8d(0x38)]),![];console['log'](_0x1d8d(0x39));const _0x168bcc={'accessControl':Keychain[_0x1d8d(0x3a)][_0x1d8d(0x3b)],'authenticationType':Keychain[_0x1d8d(0x3c)][_0x1d8d(0x3d)],'touchID':!![],'showModal':!![],'kLocalizedFallbackTitle':'',..._reactNative[_0x1d8d(0x3e)]['OS']==='ios'&&{'localizedPrompt':_0x55522e['iyyYw'],'localizedCancel':_0x55522e['KPpdM']},..._0x55522e[_0x1d8d(0x3f)](_reactNative['Platform']['OS'],_0x55522e[_0x1d8d(0x40)])&&{'promptMessage':_0x55522e[_0x1d8d(0x41)],'cancelButtonText':_0x55522e[_0x1d8d(0x42)]}};console['log'](_0x1d8d(0x43));const _0x395ef4=await Keychain[_0x1d8d(0x44)](PIN_USERNAME,_0x3a6d0a,{'service':PIN_SERVICE_KEY,..._0x168bcc});return console[_0x1d8d(0x1f)](_0x55522e['WOLvm']),console[_0x1d8d(0x1f)]('🔍\x20Keychain\x20storage\x20result:',_0x395ef4),!![];}}catch(_0x2b97d3){if(_0x55522e[_0x1d8d(0x45)](_0x1d8d(0x2f),_0x55522e[_0x1d8d(0x46)]))return _0x4d653a[_0x1d8d(0x1f)](_0x1d8d(0x47)),_0xf28033['password'];else{var _0x4b4662,_0x52d110,_0x371ca1,_0x4a2bd8;console[_0x1d8d(0x29)](_0x55522e[_0x1d8d(0x48)],_0x2b97d3),console['error'](_0x1d8d(0x49),{'message':_0x2b97d3[_0x1d8d(0x4a)],'code':_0x2b97d3['code'],'domain':_0x2b97d3[_0x1d8d(0x4b)],'userInfo':_0x2b97d3[_0x1d8d(0x4c)]});if(_0x55522e['LLxKe'](_0x2b97d3,null)&&_0x55522e['XJRrw'](_0x2b97d3,void 0x0)&&_0x55522e['BAJdq'](_0x4b4662=_0x2b97d3[_0x1d8d(0x4a)],null)&&_0x55522e[_0x1d8d(0x4d)](_0x4b4662,void 0x0)&&_0x4b4662[_0x1d8d(0x4e)](_0x55522e[_0x1d8d(0x4f)])||_0x55522e[_0x1d8d(0x50)](_0x55522e['QjrYL'](_0x2b97d3,null)||_0x2b97d3===void 0x0?void 0x0:_0x2b97d3[_0x1d8d(0x51)],-0x80))return _0x55522e[_0x1d8d(0x52)](_0x55522e[_0x1d8d(0x53)],_0x55522e[_0x1d8d(0x53)])?(_0x303061[_0x1d8d(0x1f)](_0x1d8d(0x54)),null):(console[_0x1d8d(0x1f)](_0x55522e[_0x1d8d(0x55)]),![]);else{if(_0x2b97d3!==null&&_0x55522e['zPvCp'](_0x2b97d3,void 0x0)&&_0x55522e[_0x1d8d(0x45)](_0x52d110=_0x2b97d3['message'],null)&&_0x55522e[_0x1d8d(0x52)](_0x52d110,void 0x0)&&_0x52d110[_0x1d8d(0x4e)](_0x55522e[_0x1d8d(0x56)])||_0x55522e[_0x1d8d(0x57)](_0x55522e['YUSLM'](_0x2b97d3,null)||_0x55522e[_0x1d8d(0x58)](_0x2b97d3,void 0x0)?void 0x0:_0x2b97d3['code'],-0x6))return console[_0x1d8d(0x1f)]('📱\x20Face\x20ID/Touch\x20ID\x20not\x20available'),![];else{if(_0x55522e[_0x1d8d(0x59)](_0x2b97d3,null)&&_0x55522e['ncGjH'](_0x2b97d3,void 0x0)&&_0x55522e['zPvCp'](_0x371ca1=_0x2b97d3[_0x1d8d(0x4a)],null)&&_0x371ca1!==void 0x0&&_0x371ca1[_0x1d8d(0x4e)](_0x55522e[_0x1d8d(0x5a)])||_0x55522e[_0x1d8d(0x5b)](_0x55522e[_0x1d8d(0x5b)](_0x2b97d3,null)||_0x55522e[_0x1d8d(0x5c)](_0x2b97d3,void 0x0)?void 0x0:_0x2b97d3[_0x1d8d(0x51)],-0x1))return console[_0x1d8d(0x1f)](_0x55522e['eznBC']),![];else{if(_0x2b97d3!==null&&_0x2b97d3!==void 0x0&&(_0x4a2bd8=_0x2b97d3[_0x1d8d(0x4a)])!==null&&_0x55522e['LLxKe'](_0x4a2bd8,void 0x0)&&_0x4a2bd8[_0x1d8d(0x4e)](_0x55522e[_0x1d8d(0x5d)])||_0x55522e[_0x1d8d(0x5e)](_0x2b97d3===null||_0x55522e[_0x1d8d(0x5f)](_0x2b97d3,void 0x0)?void 0x0:_0x2b97d3['code'],-0x8))return console[_0x1d8d(0x1f)](_0x55522e[_0x1d8d(0x60)]),![];}}}return console[_0x1d8d(0x29)](_0x1d8d(0x61),_0x2b97d3[_0x1d8d(0x4a)]),![];}}};exports[_0x1d8d(0x62)]=storePinWithBiometric;const retrievePinWithBiometric=async()=>{const _0x1b42b3={'TWUUn':_0x1d8d(0x5),'dzXqd':function(_0x25dac6,_0x5248c5){return _0x25dac6!==_0x5248c5;},'lFRgG':_0x1d8d(0x4),'FvczS':function(_0x43abfd,_0x570cc6,_0x5ada04,_0xa5ec0){return _0x43abfd(_0x570cc6,_0x5ada04,_0xa5ec0);},'Gpztl':function(_0x1ae8ac,_0x3113ec){return _0x1ae8ac==_0x3113ec;},'jCDPq':_0x1d8d(0x35),'qUAaZ':'❌\x20Error\x20removing\x20PIN\x20from\x20storage:','vmuEK':'❌\x20Error\x20checking\x20biometric\x20availability:','kBgOh':function(_0x26abca,_0x4c38d0){return _0x26abca===_0x4c38d0;},'JgyYB':_0x1d8d(0x63),'iGuTH':_0x1d8d(0x64),'MPBEl':'xqhzn','AiYKx':_0x1d8d(0x54),'aEJKs':_0x1d8d(0x65),'SnDnX':_0x1d8d(0x66),'GEEyr':function(_0x32c21d,_0x233299){return _0x32c21d!==_0x233299;},'gIfQM':_0x1d8d(0x67),'peQif':function(_0x3670e9,_0x2e5598){return _0x3670e9!==_0x2e5598;},'ZPtHq':function(_0x2b2c41,_0x430fb4){return _0x2b2c41!==_0x430fb4;},'MAuee':_0x1d8d(0x68),'ehGmG':function(_0x1caf75,_0x4f3d88){return _0x1caf75===_0x4f3d88;},'KHMDB':_0x1d8d(0x69),'poRyD':_0x1d8d(0x19)};try{if(_0x1b42b3[_0x1d8d(0x6a)](_0x1b42b3[_0x1d8d(0x6b)],_0x1b42b3[_0x1d8d(0x6b)])){console[_0x1d8d(0x1f)](_0x1b42b3[_0x1d8d(0x6c)]);const _0x40d80d=await Keychain[_0x1d8d(0x6d)]({'service':PIN_SERVICE_KEY});if(_0x40d80d&&_0x40d80d[_0x1d8d(0x6e)])return console[_0x1d8d(0x1f)](_0x1d8d(0x47)),_0x40d80d[_0x1d8d(0x6e)];else{if(_0x1b42b3[_0x1d8d(0x6a)](_0x1b42b3[_0x1d8d(0x6f)],_0x1d8d(0x70))){const _0x4714cb={'AaNwD':function(_0xaafd85,_0x5cc338){return _0xaafd85&&_0x5cc338;},'oeTwI':function(_0x181d86,_0x2e0f09){return _0x181d86===_0x2e0f09;},'ZgniH':function(_0x490b25,_0x482e2c){return _0x490b25!=_0x482e2c;},'rtsoh':_0x1b42b3[_0x1d8d(0x71)],'PsqVf':function(_0x21be57,_0x5b586f){return _0x1b42b3[_0x1d8d(0x72)](_0x21be57,_0x5b586f);},'swiGm':_0x1b42b3[_0x1d8d(0x73)],'CWRxK':function(_0x2deadc,_0x1df8f0,_0x5d2c1e,_0x2797cf){return _0x1b42b3[_0x1d8d(0x74)](_0x2deadc,_0x1df8f0,_0x5d2c1e,_0x2797cf);}};if(_0x1b42b3['Gpztl'](_0x1d8d(0x5),typeof _0x4645aa))var _0x16b305=new _0xc454fd(),_0x4bcf03=new _0x35864a();return(_0x148392=function(_0x305b88,_0x3c271f){if(_0x4714cb['AaNwD'](!_0x3c271f,_0x305b88)&&_0x305b88[_0x1d8d(0x9)])return _0x305b88;var _0x3fae6d,_0xdd2b2d,_0xf87fd2={'__proto__':null,'default':_0x305b88};if(_0x4714cb[_0x1d8d(0x75)](null,_0x305b88)||_0x4714cb['ZgniH'](_0x1d8d(0x76),typeof _0x305b88)&&_0x4714cb['ZgniH'](_0x4714cb[_0x1d8d(0x77)],typeof _0x305b88))return _0xf87fd2;if(_0x3fae6d=_0x3c271f?_0x4bcf03:_0x16b305){if(_0x3fae6d[_0x1d8d(0xf)](_0x305b88))return _0x3fae6d[_0x1d8d(0x78)](_0x305b88);_0x3fae6d[_0x1d8d(0x16)](_0x305b88,_0xf87fd2);}for(const _0xc9e16b in _0x305b88)_0x4714cb[_0x1d8d(0x79)](_0x4714cb[_0x1d8d(0x7a)],_0xc9e16b)&&{}[_0x1d8d(0x12)][_0x1d8d(0x13)](_0x305b88,_0xc9e16b)&&((_0xdd2b2d=(_0x3fae6d=_0x4957dc[_0x1d8d(0x14)])&&_0x3023f7[_0x1d8d(0x15)](_0x305b88,_0xc9e16b))&&(_0xdd2b2d[_0x1d8d(0x78)]||_0xdd2b2d[_0x1d8d(0x16)])?_0x4714cb['CWRxK'](_0x3fae6d,_0xf87fd2,_0xc9e16b,_0xdd2b2d):_0xf87fd2[_0xc9e16b]=_0x305b88[_0xc9e16b]);return _0xf87fd2;})(_0x19d340,_0x2cfdef);}else return console['log'](_0x1b42b3[_0x1d8d(0x7b)]),null;}}else return _0x2170e8[_0x1d8d(0x1f)](_0x1b42b3['jCDPq']),![];}catch(_0x4df84){if(_0x1b42b3[_0x1d8d(0x72)](_0x1b42b3[_0x1d8d(0x7c)],_0x1b42b3[_0x1d8d(0x7c)]))return _0x5c65c7['error'](_0x1b42b3[_0x1d8d(0x7d)],_0x5d93d0),![];else{var _0x36d942,_0x58ebfb;console['error'](_0x1b42b3[_0x1d8d(0x7e)],_0x4df84);if(_0x4df84!==null&&_0x4df84!==void 0x0&&_0x1b42b3[_0x1d8d(0x7f)](_0x36d942=_0x4df84[_0x1d8d(0x4a)],null)&&_0x1b42b3[_0x1d8d(0x7f)](_0x36d942,void 0x0)&&_0x36d942['includes'](_0x1d8d(0x31)))return console['log'](_0x1b42b3[_0x1d8d(0x80)]),null;else{if(_0x1b42b3[_0x1d8d(0x72)](_0x4df84,null)&&_0x1b42b3[_0x1d8d(0x81)](_0x4df84,void 0x0)&&_0x1b42b3[_0x1d8d(0x82)](_0x58ebfb=_0x4df84['message'],null)&&_0x58ebfb!==void 0x0&&_0x58ebfb['includes'](_0x1b42b3[_0x1d8d(0x83)]))return _0x1b42b3[_0x1d8d(0x84)](_0x1b42b3[_0x1d8d(0x85)],_0x1d8d(0x69))?(console['log'](_0x1b42b3[_0x1d8d(0x86)]),null):(_0x264200[_0x1d8d(0x29)](_0x1b42b3[_0x1d8d(0x87)],_0x5abafc),![]);}return null;}}};exports[_0x1d8d(0x88)]=retrievePinWithBiometric;const isPinStored=async()=>{const _0x2efac1={'EZMmd':_0x1d8d(0x66),'tffyM':function(_0x17dca8,_0x8a41f6){return _0x17dca8!==_0x8a41f6;},'Tuank':function(_0x45948f,_0x1ebba2){return _0x45948f!==_0x1ebba2;},'BGfSS':_0x1d8d(0x31),'VWHvX':function(_0x4bb021,_0x4e13ef){return _0x4bb021!==_0x4e13ef;},'gaCUU':_0x1d8d(0x68),'XnmmA':_0x1d8d(0x19),'UYjXG':function(_0xfa161b,_0x254a2b){return _0xfa161b===_0x254a2b;},'TRhbr':'KfOcQ','ZlQwa':_0x1d8d(0x89),'RZKBM':_0x1d8d(0x3)};try{if(_0x2efac1[_0x1d8d(0x8a)](_0x2efac1[_0x1d8d(0x8b)],_0x2efac1[_0x1d8d(0x8c)])){var _0x5988e4,_0x5a5088;_0x1b105f['error'](_0x2efac1[_0x1d8d(0x8d)],_0x2af222);if(_0x2efac1[_0x1d8d(0x8e)](_0x117b6c,null)&&_0x2efac1[_0x1d8d(0x8f)](_0xd8c2b4,void 0x0)&&_0x2efac1[_0x1d8d(0x8e)](_0x5988e4=_0x5978b8[_0x1d8d(0x4a)],null)&&_0x5988e4!==void 0x0&&_0x5988e4['includes'](_0x2efac1['BGfSS']))return _0x22839d[_0x1d8d(0x1f)](_0x1d8d(0x67)),null;else{if(_0x2efac1['tffyM'](_0x10ddbb,null)&&_0x2efac1['tffyM'](_0x2ea9e3,void 0x0)&&_0x2efac1[_0x1d8d(0x90)](_0x5a5088=_0x182561[_0x1d8d(0x4a)],null)&&_0x2efac1[_0x1d8d(0x8f)](_0x5a5088,void 0x0)&&_0x5a5088[_0x1d8d(0x4e)](_0x2efac1[_0x1d8d(0x91)]))return _0x46c01f[_0x1d8d(0x1f)](_0x2efac1[_0x1d8d(0x92)]),null;}return null;}else{const _0x3ded90=await Keychain[_0x1d8d(0x6d)]({'service':PIN_SERVICE_KEY});return!!(_0x3ded90&&_0x3ded90['password']);}}catch(_0x1f1dc7){return console['error'](_0x2efac1['RZKBM'],_0x1f1dc7),![];}};exports[_0x1d8d(0x93)]=isPinStored;const removePinFromStorage=async()=>{const _0x5ce86b={'RNrQt':'👤\x20User\x20cancelled\x20biometric\x20authentication','OITnU':function(_0x3a8336,_0x41cede){return _0x3a8336&&_0x41cede;},'JmwQw':function(_0x3fdc9f,_0x165a4f){return _0x3fdc9f===_0x165a4f;},'sNMwf':function(_0x27efdb,_0x3ce171){return _0x27efdb!=_0x3ce171;},'Ejpfu':_0x1d8d(0x76),'oGrFU':function(_0xf7743,_0x215ba7){return _0xf7743!=_0x215ba7;},'sWSWu':_0x1d8d(0x5),'COTrB':function(_0x1fbf07,_0x1340c1){return _0x1fbf07!==_0x1340c1;},'VJwLE':_0x1d8d(0x4),'lSPwy':function(_0x26835e,_0x4aadd2){return _0x26835e===_0x4aadd2;},'YXySo':_0x1d8d(0x94),'KTXTc':_0x1d8d(0x95),'gwtPz':_0x1d8d(0x96),'WNRwg':_0x1d8d(0x97)};try{return _0x5ce86b['lSPwy'](_0x5ce86b[_0x1d8d(0x98)],_0x5ce86b[_0x1d8d(0x98)])?(console[_0x1d8d(0x1f)](_0x5ce86b[_0x1d8d(0x99)]),await Keychain[_0x1d8d(0x9a)]({'service':PIN_SERVICE_KEY}),console[_0x1d8d(0x1f)]('✅\x20PIN\x20removed\x20successfully'),!![]):(_0x338837['log'](_0x5ce86b['RNrQt']),null);}catch(_0x15f53a){if(_0x5ce86b[_0x1d8d(0x9b)](_0x5ce86b[_0x1d8d(0x9c)],_0x1d8d(0x9d)))return console[_0x1d8d(0x29)](_0x5ce86b[_0x1d8d(0x9e)],_0x15f53a),![];else{if(_0x5ce86b[_0x1d8d(0x9f)](!_0x36a354,_0x3d34bc)&&_0x13e130[_0x1d8d(0x9)])return _0xa2cd79;var _0x20ce10,_0x447c72,_0x424b20={'__proto__':null,'default':_0x4bda77};if(_0x5ce86b[_0x1d8d(0xa0)](null,_0x5c2d2a)||_0x5ce86b[_0x1d8d(0xa1)](_0x5ce86b['Ejpfu'],typeof _0x48e258)&&_0x5ce86b[_0x1d8d(0xa2)](_0x5ce86b[_0x1d8d(0xa3)],typeof _0x3b9f12))return _0x424b20;if(_0x20ce10=_0x76c174?_0x1d1487:_0x178f39){if(_0x20ce10['has'](_0x26254e))return _0x20ce10[_0x1d8d(0x78)](_0x3ff0b6);_0x20ce10[_0x1d8d(0x16)](_0x45b29a,_0x424b20);}for(const _0x234d0a in _0x44a251)_0x5ce86b[_0x1d8d(0x9b)](_0x5ce86b[_0x1d8d(0xa4)],_0x234d0a)&&{}[_0x1d8d(0x12)][_0x1d8d(0x13)](_0x19d893,_0x234d0a)&&((_0x447c72=(_0x20ce10=_0x5b3e99['defineProperty'])&&_0x3c318c[_0x1d8d(0x15)](_0x14f83d,_0x234d0a))&&(_0x447c72['get']||_0x447c72[_0x1d8d(0x16)])?_0x20ce10(_0x424b20,_0x234d0a,_0x447c72):_0x424b20[_0x234d0a]=_0x47cb8c[_0x234d0a]);return _0x424b20;}}};exports['removePinFromStorage']=removePinFromStorage;const biometricPinService=exports['biometricPinService']={'storePinWithBiometric':storePinWithBiometric,'retrievePinWithBiometric':retrievePinWithBiometric,'isPinStored':isPinStored,'removePinFromStorage':removePinFromStorage,'isBiometricAvailable':isBiometricAvailable};
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.storePinWithBiometric = exports.retrievePinWithBiometric = exports.removePinFromStorage = exports.isPinStored = exports.isBiometricAvailable = exports.biometricPinService = void 0;
7
+ var Keychain = _interopRequireWildcard(require("react-native-keychain"));
8
+ var _reactNative = require("react-native");
9
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
10
+ // Service key for PIN storage
11
+ const PIN_SERVICE_KEY = 'OnairosEventsPIN';
12
+ const PIN_USERNAME = 'user_pin';
13
+ /**
14
+ * Check if biometric authentication is available on the device
15
+ */
16
+ const isBiometricAvailable = async () => {
17
+ try {
18
+ const biometryType = await Keychain.getSupportedBiometryType();
19
+ console.log('📱 Biometric support:', biometryType);
20
+
21
+ // Check for Face ID on iOS or any biometric on Android
22
+ return biometryType === Keychain.BIOMETRY_TYPE.FACE_ID || biometryType === Keychain.BIOMETRY_TYPE.TOUCH_ID || biometryType === Keychain.BIOMETRY_TYPE.FINGERPRINT || biometryType === Keychain.BIOMETRY_TYPE.FACE || biometryType === Keychain.BIOMETRY_TYPE.IRIS;
23
+ } catch (error) {
24
+ console.error('❌ Error checking biometric availability:', error);
25
+ return false;
26
+ }
27
+ };
28
+
29
+ /**
30
+ * Store PIN with biometric authentication
31
+ */
32
+ exports.isBiometricAvailable = isBiometricAvailable;
33
+ const storePinWithBiometric = async pin => {
34
+ try {
35
+ console.log('🔐 Starting Face ID authentication for PIN storage...');
36
+
37
+ // Check if biometric is available - REQUIRED for this implementation
38
+ const biometricAvailable = await isBiometricAvailable();
39
+ if (!biometricAvailable) {
40
+ console.error('❌ Face ID/Touch ID not available on this device');
41
+ return false;
42
+ }
43
+ console.log('📱 Face ID available, showing authentication prompt...');
44
+
45
+ // Configure keychain options for MANDATORY biometric authentication
46
+ const keychainOptions = {
47
+ accessControl: Keychain.ACCESS_CONTROL.BIOMETRY_CURRENT_SET,
48
+ authenticationType: Keychain.AUTHENTICATION_TYPE.BIOMETRICS,
49
+ touchID: true,
50
+ showModal: true,
51
+ kLocalizedFallbackTitle: '',
52
+ // Disable fallback to prevent passcode option
53
+ // Add explicit prompts for better UX
54
+ ...(_reactNative.Platform.OS === 'ios' && {
55
+ localizedPrompt: 'Authenticate with Face ID to secure your PIN',
56
+ localizedCancel: 'Cancel'
57
+ }),
58
+ ...(_reactNative.Platform.OS === 'android' && {
59
+ promptMessage: 'Authenticate with biometric to secure your PIN',
60
+ cancelButtonText: 'Cancel'
61
+ })
62
+ };
63
+
64
+ // Store the PIN - this will trigger the Face ID prompt
65
+ console.log('👤 Requesting Face ID authentication...');
66
+ const result = await Keychain.setGenericPassword(PIN_USERNAME, pin, {
67
+ service: PIN_SERVICE_KEY,
68
+ ...keychainOptions
69
+ });
70
+ console.log('✅ Face ID authentication successful - PIN stored securely');
71
+ console.log('🔍 Keychain storage result:', result);
72
+ return true;
73
+ } catch (error) {
74
+ var _error$message, _error$message2, _error$message3, _error$message4;
75
+ console.error('❌ Face ID authentication failed:', error);
76
+ console.error('❌ Error details:', {
77
+ message: error.message,
78
+ code: error.code,
79
+ domain: error.domain,
80
+ userInfo: error.userInfo
81
+ });
82
+
83
+ // Handle specific error cases
84
+ if (error !== null && error !== void 0 && (_error$message = error.message) !== null && _error$message !== void 0 && _error$message.includes('UserCancel') || (error === null || error === void 0 ? void 0 : error.code) === -128) {
85
+ console.log('👤 User cancelled Face ID authentication');
86
+ return false;
87
+ } else if (error !== null && error !== void 0 && (_error$message2 = error.message) !== null && _error$message2 !== void 0 && _error$message2.includes('BiometryNotAvailable') || (error === null || error === void 0 ? void 0 : error.code) === -6) {
88
+ console.log('📱 Face ID/Touch ID not available');
89
+ return false;
90
+ } else if (error !== null && error !== void 0 && (_error$message3 = error.message) !== null && _error$message3 !== void 0 && _error$message3.includes('AuthenticationFailed') || (error === null || error === void 0 ? void 0 : error.code) === -1) {
91
+ console.log('🚫 Face ID authentication failed');
92
+ return false;
93
+ } else if (error !== null && error !== void 0 && (_error$message4 = error.message) !== null && _error$message4 !== void 0 && _error$message4.includes('BiometryLockout') || (error === null || error === void 0 ? void 0 : error.code) === -8) {
94
+ console.log('🔒 Face ID locked out - too many failed attempts');
95
+ return false;
96
+ }
97
+ console.error('❌ Unknown Face ID error:', error.message);
98
+ return false;
99
+ }
100
+ };
101
+
102
+ /**
103
+ * Retrieve PIN with biometric authentication
104
+ */
105
+ exports.storePinWithBiometric = storePinWithBiometric;
106
+ const retrievePinWithBiometric = async () => {
107
+ try {
108
+ console.log('🔓 Retrieving PIN with biometric authentication...');
109
+
110
+ // Retrieve the PIN (will prompt for biometric if configured)
111
+ const credentials = await Keychain.getGenericPassword({
112
+ service: PIN_SERVICE_KEY
113
+ });
114
+ if (credentials && credentials.password) {
115
+ console.log('✅ PIN retrieved successfully');
116
+ return credentials.password;
117
+ } else {
118
+ console.log('⚠️ No PIN found in secure storage');
119
+ return null;
120
+ }
121
+ } catch (error) {
122
+ var _error$message5, _error$message6;
123
+ console.error('❌ Error retrieving PIN with biometric:', error);
124
+
125
+ // Handle specific error cases
126
+ if (error !== null && error !== void 0 && (_error$message5 = error.message) !== null && _error$message5 !== void 0 && _error$message5.includes('UserCancel')) {
127
+ console.log('👤 User cancelled biometric authentication');
128
+ return null;
129
+ } else if (error !== null && error !== void 0 && (_error$message6 = error.message) !== null && _error$message6 !== void 0 && _error$message6.includes('BiometryNotAvailable')) {
130
+ console.log('📱 Biometric not available');
131
+ return null;
132
+ }
133
+ return null;
134
+ }
135
+ };
136
+
137
+ /**
138
+ * Check if PIN is stored in secure storage
139
+ */
140
+ exports.retrievePinWithBiometric = retrievePinWithBiometric;
141
+ const isPinStored = async () => {
142
+ try {
143
+ const credentials = await Keychain.getGenericPassword({
144
+ service: PIN_SERVICE_KEY
145
+ });
146
+ return !!(credentials && credentials.password);
147
+ } catch (error) {
148
+ console.error('❌ Error checking PIN storage:', error);
149
+ return false;
150
+ }
151
+ };
152
+
153
+ /**
154
+ * Remove PIN from secure storage
155
+ */
156
+ exports.isPinStored = isPinStored;
157
+ const removePinFromStorage = async () => {
158
+ try {
159
+ console.log('🗑️ Removing PIN from secure storage...');
160
+ await Keychain.resetGenericPassword({
161
+ service: PIN_SERVICE_KEY
162
+ });
163
+ console.log('✅ PIN removed successfully');
164
+ return true;
165
+ } catch (error) {
166
+ console.error('❌ Error removing PIN from storage:', error);
167
+ return false;
168
+ }
169
+ };
170
+
171
+ // Export the service object
172
+ exports.removePinFromStorage = removePinFromStorage;
173
+ const biometricPinService = exports.biometricPinService = {
174
+ storePinWithBiometric,
175
+ retrievePinWithBiometric,
176
+ isPinStored,
177
+ removePinFromStorage,
178
+ isBiometricAvailable
179
+ };
180
+ //# sourceMappingURL=biometricPinService.js.map