@onairos/react-native 3.4.1 → 3.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (544) hide show
  1. package/README.md +62 -13
  2. package/lib/commonjs/api/index.js +9 -145
  3. package/lib/commonjs/assets/animations/loaderani.json +1 -0
  4. package/lib/commonjs/assets/animations/persona-animation.json +1 -0
  5. package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  6. package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  7. package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
  8. package/lib/commonjs/assets/icons/Gmail.png +0 -0
  9. package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
  10. package/lib/commonjs/assets/icons/Redditicon.png +0 -0
  11. package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
  12. package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
  13. package/lib/commonjs/assets/icons/chatgpt.png +0 -0
  14. package/lib/commonjs/assets/icons/claude.png +0 -0
  15. package/lib/commonjs/assets/icons/gemini.png +0 -0
  16. package/lib/commonjs/assets/icons/grok.png +0 -0
  17. package/lib/commonjs/assets/images/Checkbox.svg +3 -0
  18. package/lib/commonjs/assets/images/EnochE.svg +19 -0
  19. package/lib/commonjs/assets/images/Enochicon1.png +0 -0
  20. package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
  21. package/lib/commonjs/assets/images/Facebookicon.png +0 -0
  22. package/lib/commonjs/assets/images/Gmail.png +0 -0
  23. package/lib/commonjs/assets/images/Googlelogo.png +0 -0
  24. package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
  25. package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
  26. package/lib/commonjs/assets/images/Personalityprofile.svg +3 -0
  27. package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
  28. package/lib/commonjs/assets/images/Redditicon.png +0 -0
  29. package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
  30. package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
  31. package/lib/commonjs/assets/images/arrow.svg +20 -0
  32. package/lib/commonjs/assets/images/basicproficon.svg +43 -0
  33. package/lib/commonjs/assets/images/basicprofile.svg +3 -0
  34. package/lib/commonjs/assets/images/chatgpt.png +0 -0
  35. package/lib/commonjs/assets/images/checkmark.svg +4 -0
  36. package/lib/commonjs/assets/images/claude.png +0 -0
  37. package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
  38. package/lib/commonjs/assets/images/contenticon.svg +23 -0
  39. package/lib/commonjs/assets/images/gemini.png +0 -0
  40. package/lib/commonjs/assets/images/grok.png +0 -0
  41. package/lib/commonjs/assets/images/persona1.png +0 -0
  42. package/lib/commonjs/assets/images/persona2.png +0 -0
  43. package/lib/commonjs/assets/images/persona3.png +0 -0
  44. package/lib/commonjs/assets/images/persona4.png +0 -0
  45. package/lib/commonjs/assets/images/persona5.png +0 -0
  46. package/lib/commonjs/assets/images/personalityicon.svg +18 -0
  47. package/lib/commonjs/assets/images/x-close.svg +3 -0
  48. package/lib/commonjs/components/BodyText.js +9 -0
  49. package/lib/commonjs/components/BrandMark.js +10 -0
  50. package/lib/commonjs/components/CodeInput.js +9 -0
  51. package/lib/commonjs/components/EmailInput.js +8 -0
  52. package/lib/commonjs/components/GoogleButton.js +9 -0
  53. package/lib/commonjs/components/HeadingGroup.js +9 -0
  54. package/lib/commonjs/components/LLMDataInputModal.js +14 -0
  55. package/lib/commonjs/components/ModalHeader.js +9 -0
  56. package/lib/commonjs/components/ModalSheet.js +9 -0
  57. package/lib/commonjs/components/Onairos.js +14 -374
  58. package/lib/commonjs/components/OnairosButton.js +13 -309
  59. package/lib/commonjs/components/OnairosSignInButton.js +12 -0
  60. package/lib/commonjs/components/Overlay.js +13 -483
  61. package/lib/commonjs/components/PersonaImage.js +10 -0
  62. package/lib/commonjs/components/PersonaLoadingScreen.js +12 -0
  63. package/lib/commonjs/components/PersonalizationConsentScreen.js +13 -0
  64. package/lib/commonjs/components/PinCreationScreen.js +12 -0
  65. package/lib/commonjs/components/PinInput.js +9 -302
  66. package/lib/commonjs/components/PlatformConnectorsStep.js +22 -0
  67. package/lib/commonjs/components/PlatformList.js +10 -137
  68. package/lib/commonjs/components/PlatformToggle.js +9 -0
  69. package/lib/commonjs/components/PrimaryButton.js +10 -0
  70. package/lib/commonjs/components/SignInMatchAnimation.js +9 -0
  71. package/lib/commonjs/components/SignInStep.js +12 -0
  72. package/lib/commonjs/components/UniversalOnboarding.js +29 -1702
  73. package/lib/commonjs/components/VerificationStep.js +11 -0
  74. package/lib/commonjs/components/WelcomeScreen.js +21 -0
  75. package/lib/commonjs/components/icons/Basicproficon.js +8 -0
  76. package/lib/commonjs/components/icons/Basicprofile.js +8 -0
  77. package/lib/commonjs/components/icons/Checkbox.js +8 -0
  78. package/lib/commonjs/components/icons/Checkmark.js +8 -0
  79. package/lib/commonjs/components/icons/Contentanalysis.js +8 -0
  80. package/lib/commonjs/components/icons/Contenticon.js +8 -0
  81. package/lib/commonjs/components/icons/EnochE.js +8 -0
  82. package/lib/commonjs/components/icons/Personalityicon.js +8 -0
  83. package/lib/commonjs/components/icons/Personalityprofile.js +8 -0
  84. package/lib/commonjs/components/icons/Personalitytraits.js +8 -0
  85. package/lib/commonjs/components/icons/Userpreferences.js +8 -0
  86. package/lib/commonjs/components/icons/index.js +17 -0
  87. package/lib/commonjs/components/onboarding/OAuthWebView.js +14 -827
  88. package/lib/commonjs/components/onboarding/OnboardingHeader.js +10 -74
  89. package/lib/commonjs/components/onboarding/PinInput.js +10 -283
  90. package/lib/commonjs/components/onboarding/PlatformConnector.js +11 -249
  91. package/lib/commonjs/config/api.js +7 -0
  92. package/lib/commonjs/constants/index.js +7 -83
  93. package/lib/commonjs/context/AuthContext.js +10 -0
  94. package/lib/commonjs/hooks/useConnectedAccounts.js +9 -0
  95. package/lib/commonjs/hooks/useConnections.js +8 -159
  96. package/lib/commonjs/hooks/useCredentials.js +10 -177
  97. package/lib/commonjs/hooks/useUserConnections.js +10 -0
  98. package/lib/commonjs/index.js +35 -106
  99. package/lib/commonjs/services/apiClient.js +8 -0
  100. package/lib/commonjs/services/apiKeyService.js +9 -952
  101. package/lib/commonjs/services/authService.js +10 -0
  102. package/lib/commonjs/services/biometricPinService.js +8 -0
  103. package/lib/commonjs/services/chatGPTConversationExtractor.js +8 -0
  104. package/lib/commonjs/services/chatGPTConversationService.js +9 -0
  105. package/lib/commonjs/services/claudeConversationExtractor.js +8 -0
  106. package/lib/commonjs/services/claudeConversationService.js +9 -0
  107. package/lib/commonjs/services/connectedAccountsService.js +10 -0
  108. package/lib/commonjs/services/googleAuthService.js +11 -0
  109. package/lib/commonjs/services/imageCompressionService.js +7 -0
  110. package/lib/commonjs/services/jwtStorageService.js +7 -0
  111. package/lib/commonjs/services/linkedinDOMExtractor.js +7 -0
  112. package/lib/commonjs/services/linkedinProfileService.js +9 -0
  113. package/lib/commonjs/services/linkedinScrapingService.js +8 -0
  114. package/lib/commonjs/services/llmDataStorage.js +8 -0
  115. package/lib/commonjs/services/mobileTrainingService.js +8 -0
  116. package/lib/commonjs/services/oauthService.js +11 -390
  117. package/lib/commonjs/services/pinEncryptionService.js +8 -0
  118. package/lib/commonjs/services/pinStorageUtils.js +7 -0
  119. package/lib/commonjs/services/platformAuthService.js +12 -1067
  120. package/lib/commonjs/services/storageService.js +8 -0
  121. package/lib/commonjs/services/trainingApiHelpers.js +7 -0
  122. package/lib/commonjs/services/userConnectionsService.js +10 -0
  123. package/lib/commonjs/services/youtubeMigrationService.js +10 -0
  124. package/lib/commonjs/theme/index.js +7 -0
  125. package/lib/commonjs/types/ambient.d.js +1 -2
  126. package/lib/commonjs/types/declarations.d.js +1 -2
  127. package/lib/commonjs/types/index.js +1 -6
  128. package/lib/commonjs/types/node-fix.d.js +1 -2
  129. package/lib/commonjs/types/node-override.d.js +1 -2
  130. package/lib/commonjs/types/opacity.d.js +1 -2
  131. package/lib/commonjs/types.js +1 -14
  132. package/lib/commonjs/utils/Portal.js +8 -98
  133. package/lib/commonjs/utils/api.js +9 -129
  134. package/lib/commonjs/utils/assetRegistry.js +33 -0
  135. package/lib/commonjs/utils/auth.js +9 -111
  136. package/lib/commonjs/utils/crypto.js +8 -62
  137. package/lib/commonjs/utils/debugHelper.js +1 -64
  138. package/lib/commonjs/utils/encryption.js +7 -76
  139. package/lib/commonjs/utils/eventUtils.js +1 -0
  140. package/lib/commonjs/utils/haptics.js +9 -0
  141. package/lib/commonjs/utils/imagePreloader.js +1 -0
  142. package/lib/commonjs/utils/networkDiagnostics.js +8 -0
  143. package/lib/commonjs/utils/onairosApi.js +9 -350
  144. package/lib/commonjs/utils/programmaticFlow.js +9 -117
  145. package/lib/commonjs/utils/retryHelper.js +1 -220
  146. package/lib/commonjs/utils/secureStorage.js +10 -349
  147. package/lib/commonjs/utils/webviewScripts/chatgpt.js +1 -0
  148. package/lib/commonjs/utils/webviewScripts/claude.js +1 -0
  149. package/lib/commonjs/utils/webviewScripts/index.js +9 -0
  150. package/lib/commonjs/utils/webviewScripts/linkedin.js +1 -0
  151. package/lib/module/api/index.js +1 -139
  152. package/lib/module/assets/animations/loaderani.json +1 -0
  153. package/lib/module/assets/animations/persona-animation.json +1 -0
  154. package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
  155. package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
  156. package/lib/module/assets/icons/Facebookicon.png +0 -0
  157. package/lib/module/assets/icons/Gmail.png +0 -0
  158. package/lib/module/assets/icons/Linkedinicon.png +0 -0
  159. package/lib/module/assets/icons/Redditicon.png +0 -0
  160. package/lib/module/assets/icons/YouTubeicon2.png +0 -0
  161. package/lib/module/assets/icons/YouTubeicon3.png +0 -0
  162. package/lib/module/assets/icons/chatgpt.png +0 -0
  163. package/lib/module/assets/icons/claude.png +0 -0
  164. package/lib/module/assets/icons/farcaster.png +0 -0
  165. package/lib/module/assets/icons/gemini.png +0 -0
  166. package/lib/module/assets/icons/grok.png +0 -0
  167. package/lib/module/assets/icons/instagram.png +0 -0
  168. package/lib/module/assets/icons/pinterest.png +0 -0
  169. package/lib/module/assets/icons/swerv_logo.png +0 -0
  170. package/lib/module/assets/icons/twitter.jpg +0 -0
  171. package/lib/module/assets/images/Checkbox.svg +3 -0
  172. package/lib/module/assets/images/EnochE.svg +19 -0
  173. package/lib/module/assets/images/Enochicon1.png +0 -0
  174. package/lib/module/assets/images/Face_ID_logo.png +0 -0
  175. package/lib/module/assets/images/Facebookicon.png +0 -0
  176. package/lib/module/assets/images/Gmail.png +0 -0
  177. package/lib/module/assets/images/Googlelogo.png +0 -0
  178. package/lib/module/assets/images/Linkedinicon.png +0 -0
  179. package/lib/module/assets/images/Onairoslogo.png +0 -0
  180. package/lib/module/assets/images/Personalityprofile.svg +3 -0
  181. package/lib/module/assets/images/Personalitytraits.svg +3 -0
  182. package/lib/module/assets/images/Redditicon.png +0 -0
  183. package/lib/module/assets/images/Userpreferences.svg +3 -0
  184. package/lib/module/assets/images/YouTubeicon3.png +0 -0
  185. package/lib/module/assets/images/arrow.svg +20 -0
  186. package/lib/module/assets/images/basicproficon.svg +43 -0
  187. package/lib/module/assets/images/basicprofile.svg +3 -0
  188. package/lib/module/assets/images/chatgpt.png +0 -0
  189. package/lib/module/assets/images/checkmark.svg +4 -0
  190. package/lib/module/assets/images/claude.png +0 -0
  191. package/lib/module/assets/images/contentanalysis.svg +3 -0
  192. package/lib/module/assets/images/contenticon.svg +23 -0
  193. package/lib/module/assets/images/gemini.png +0 -0
  194. package/lib/module/assets/images/grok.png +0 -0
  195. package/lib/module/assets/images/persona1.png +0 -0
  196. package/lib/module/assets/images/persona2.png +0 -0
  197. package/lib/module/assets/images/persona3.png +0 -0
  198. package/lib/module/assets/images/persona4.png +0 -0
  199. package/lib/module/assets/images/persona5.png +0 -0
  200. package/lib/module/assets/images/personalityicon.svg +18 -0
  201. package/lib/module/assets/images/x-close.svg +3 -0
  202. package/lib/module/components/BodyText.js +1 -0
  203. package/lib/module/components/BrandMark.js +1 -0
  204. package/lib/module/components/CodeInput.js +1 -0
  205. package/lib/module/components/EmailInput.js +1 -0
  206. package/lib/module/components/GoogleButton.js +1 -0
  207. package/lib/module/components/HeadingGroup.js +1 -0
  208. package/lib/module/components/LLMDataInputModal.js +8 -0
  209. package/lib/module/components/ModalHeader.js +1 -0
  210. package/lib/module/components/ModalSheet.js +1 -0
  211. package/lib/module/components/Onairos.js +1 -367
  212. package/lib/module/components/OnairosButton.js +1 -302
  213. package/lib/module/components/OnairosSignInButton.js +1 -0
  214. package/lib/module/components/Overlay.js +1 -474
  215. package/lib/module/components/PersonaImage.js +1 -0
  216. package/lib/module/components/PersonaLoadingScreen.js +1 -0
  217. package/lib/module/components/PersonalizationConsentScreen.js +1 -0
  218. package/lib/module/components/PinCreationScreen.js +1 -0
  219. package/lib/module/components/PinInput.js +1 -293
  220. package/lib/module/components/PlatformConnectorsStep.js +1 -0
  221. package/lib/module/components/PlatformList.js +1 -129
  222. package/lib/module/components/PlatformToggle.js +1 -0
  223. package/lib/module/components/PrimaryButton.js +1 -0
  224. package/lib/module/components/SignInMatchAnimation.js +1 -0
  225. package/lib/module/components/SignInStep.js +1 -0
  226. package/lib/module/components/UniversalOnboarding.js +1 -1693
  227. package/lib/module/components/VerificationStep.js +1 -0
  228. package/lib/module/components/WelcomeScreen.js +1 -0
  229. package/lib/module/components/icons/Basicproficon.js +1 -0
  230. package/lib/module/components/icons/Basicprofile.js +1 -0
  231. package/lib/module/components/icons/Checkbox.js +1 -0
  232. package/lib/module/components/icons/Checkmark.js +1 -0
  233. package/lib/module/components/icons/Contentanalysis.js +1 -0
  234. package/lib/module/components/icons/Contenticon.js +1 -0
  235. package/lib/module/components/icons/EnochE.js +1 -0
  236. package/lib/module/components/icons/Personalityicon.js +1 -0
  237. package/lib/module/components/icons/Personalityprofile.js +1 -0
  238. package/lib/module/components/icons/Personalitytraits.js +1 -0
  239. package/lib/module/components/icons/Userpreferences.js +1 -0
  240. package/lib/module/components/icons/index.js +1 -0
  241. package/lib/module/components/onboarding/OAuthWebView.js +1 -818
  242. package/lib/module/components/onboarding/OnboardingHeader.js +1 -66
  243. package/lib/module/components/onboarding/PinInput.js +1 -274
  244. package/lib/module/components/onboarding/PlatformConnector.js +1 -240
  245. package/lib/module/config/api.js +1 -0
  246. package/lib/module/constants/index.js +1 -77
  247. package/lib/module/context/AuthContext.js +1 -0
  248. package/lib/module/hooks/useConnectedAccounts.js +1 -0
  249. package/lib/module/hooks/useConnections.js +1 -152
  250. package/lib/module/hooks/useCredentials.js +6 -169
  251. package/lib/module/hooks/useUserConnections.js +1 -0
  252. package/lib/module/index.js +1 -32
  253. package/lib/module/services/apiClient.js +1 -0
  254. package/lib/module/services/apiKeyService.js +1 -925
  255. package/lib/module/services/authService.js +1 -0
  256. package/lib/module/services/biometricPinService.js +1 -0
  257. package/lib/module/services/chatGPTConversationExtractor.js +1 -0
  258. package/lib/module/services/chatGPTConversationService.js +1 -0
  259. package/lib/module/services/claudeConversationExtractor.js +1 -0
  260. package/lib/module/services/claudeConversationService.js +1 -0
  261. package/lib/module/services/connectedAccountsService.js +1 -0
  262. package/lib/module/services/googleAuthService.js +1 -0
  263. package/lib/module/services/imageCompressionService.js +1 -0
  264. package/lib/module/services/jwtStorageService.js +1 -0
  265. package/lib/module/services/linkedinDOMExtractor.js +1 -0
  266. package/lib/module/services/linkedinProfileService.js +1 -0
  267. package/lib/module/services/linkedinScrapingService.js +1 -0
  268. package/lib/module/services/llmDataStorage.js +1 -0
  269. package/lib/module/services/mobileTrainingService.js +1 -0
  270. package/lib/module/services/oauthService.js +1 -380
  271. package/lib/module/services/pinEncryptionService.js +7 -0
  272. package/lib/module/services/pinStorageUtils.js +1 -0
  273. package/lib/module/services/platformAuthService.js +1 -1041
  274. package/lib/module/services/storageService.js +1 -0
  275. package/lib/module/services/trainingApiHelpers.js +1 -0
  276. package/lib/module/services/userConnectionsService.js +1 -0
  277. package/lib/module/services/youtubeMigrationService.js +1 -0
  278. package/lib/module/theme/index.js +1 -0
  279. package/lib/module/types.js +1 -10
  280. package/lib/module/utils/Portal.js +1 -90
  281. package/lib/module/utils/api.js +1 -117
  282. package/lib/module/utils/assetRegistry.js +33 -0
  283. package/lib/module/utils/auth.js +1 -99
  284. package/lib/module/utils/crypto.js +1 -54
  285. package/lib/module/utils/debugHelper.js +1 -54
  286. package/lib/module/utils/encryption.js +1 -67
  287. package/lib/module/utils/eventUtils.js +1 -0
  288. package/lib/module/utils/haptics.js +8 -0
  289. package/lib/module/utils/imagePreloader.js +1 -0
  290. package/lib/module/utils/networkDiagnostics.js +1 -0
  291. package/lib/module/utils/onairosApi.js +1 -333
  292. package/lib/module/utils/programmaticFlow.js +1 -111
  293. package/lib/module/utils/retryHelper.js +1 -211
  294. package/lib/module/utils/secureStorage.js +6 -330
  295. package/lib/module/utils/webviewScripts/chatgpt.js +1 -0
  296. package/lib/module/utils/webviewScripts/claude.js +1 -0
  297. package/lib/module/utils/webviewScripts/index.js +1 -0
  298. package/lib/module/utils/webviewScripts/linkedin.js +1 -0
  299. package/package.json +62 -39
  300. package/lib/commonjs/api/index.js.map +0 -1
  301. package/lib/commonjs/assets/images/email.png +0 -0
  302. package/lib/commonjs/assets/images/linkedin.png +0 -0
  303. package/lib/commonjs/assets/images/reddit.png +0 -0
  304. package/lib/commonjs/assets/images/youtube.png +0 -0
  305. package/lib/commonjs/components/DataRequestModal.js +0 -228
  306. package/lib/commonjs/components/DataRequestModal.js.map +0 -1
  307. package/lib/commonjs/components/DataRequestScreen.js +0 -329
  308. package/lib/commonjs/components/DataRequestScreen.js.map +0 -1
  309. package/lib/commonjs/components/EmailVerificationModal.js +0 -320
  310. package/lib/commonjs/components/EmailVerificationModal.js.map +0 -1
  311. package/lib/commonjs/components/Onairos.js.map +0 -1
  312. package/lib/commonjs/components/OnairosButton.js.map +0 -1
  313. package/lib/commonjs/components/Overlay.js.map +0 -1
  314. package/lib/commonjs/components/PinInput.js.map +0 -1
  315. package/lib/commonjs/components/PlatformList.js.map +0 -1
  316. package/lib/commonjs/components/TrainingModal.js +0 -717
  317. package/lib/commonjs/components/TrainingModal.js.map +0 -1
  318. package/lib/commonjs/components/UniversalOnboarding.js.map +0 -1
  319. package/lib/commonjs/components/UniversalOnboarding.tsx.new +0 -455
  320. package/lib/commonjs/components/onboarding/OAuthWebView.js.map +0 -1
  321. package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +0 -1
  322. package/lib/commonjs/components/onboarding/PinInput.js.map +0 -1
  323. package/lib/commonjs/components/onboarding/PlatformConnector.js.map +0 -1
  324. package/lib/commonjs/components/screens/ConnectorScreen.js +0 -146
  325. package/lib/commonjs/components/screens/ConnectorScreen.js.map +0 -1
  326. package/lib/commonjs/components/screens/LoadingScreen.js +0 -91
  327. package/lib/commonjs/components/screens/LoadingScreen.js.map +0 -1
  328. package/lib/commonjs/components/screens/PinCreationScreen.js +0 -61
  329. package/lib/commonjs/components/screens/PinCreationScreen.js.map +0 -1
  330. package/lib/commonjs/constants/index.js.map +0 -1
  331. package/lib/commonjs/hooks/useConnections.js.map +0 -1
  332. package/lib/commonjs/hooks/useCredentials.js.map +0 -1
  333. package/lib/commonjs/index.js.map +0 -1
  334. package/lib/commonjs/services/apiKeyService.js.map +0 -1
  335. package/lib/commonjs/services/oauthService.js.map +0 -1
  336. package/lib/commonjs/services/platformAuthService.js.map +0 -1
  337. package/lib/commonjs/types/ambient.d.js.map +0 -1
  338. package/lib/commonjs/types/declarations.d.js.map +0 -1
  339. package/lib/commonjs/types/index.d.js.map +0 -1
  340. package/lib/commonjs/types/index.js.map +0 -1
  341. package/lib/commonjs/types/node-fix.d.js.map +0 -1
  342. package/lib/commonjs/types/node-override.d.js.map +0 -1
  343. package/lib/commonjs/types/opacity.d.js.map +0 -1
  344. package/lib/commonjs/types/types.d.js.map +0 -1
  345. package/lib/commonjs/types.js.map +0 -1
  346. package/lib/commonjs/utils/Portal.js.map +0 -1
  347. package/lib/commonjs/utils/api.js.map +0 -1
  348. package/lib/commonjs/utils/auth.js.map +0 -1
  349. package/lib/commonjs/utils/crypto.js.map +0 -1
  350. package/lib/commonjs/utils/debugHelper.js.map +0 -1
  351. package/lib/commonjs/utils/encryption.js.map +0 -1
  352. package/lib/commonjs/utils/onairosApi.js.map +0 -1
  353. package/lib/commonjs/utils/programmaticFlow.js.map +0 -1
  354. package/lib/commonjs/utils/retryHelper.js.map +0 -1
  355. package/lib/commonjs/utils/secureStorage.js.map +0 -1
  356. package/lib/module/api/index.js.map +0 -1
  357. package/lib/module/assets/images/email.png +0 -0
  358. package/lib/module/assets/images/linkedin.png +0 -0
  359. package/lib/module/assets/images/reddit.png +0 -0
  360. package/lib/module/assets/images/youtube.png +0 -0
  361. package/lib/module/components/DataRequestModal.js +0 -220
  362. package/lib/module/components/DataRequestModal.js.map +0 -1
  363. package/lib/module/components/DataRequestScreen.js +0 -321
  364. package/lib/module/components/DataRequestScreen.js.map +0 -1
  365. package/lib/module/components/EmailVerificationModal.js +0 -311
  366. package/lib/module/components/EmailVerificationModal.js.map +0 -1
  367. package/lib/module/components/Onairos.js.map +0 -1
  368. package/lib/module/components/OnairosButton.js.map +0 -1
  369. package/lib/module/components/Overlay.js.map +0 -1
  370. package/lib/module/components/PinInput.js.map +0 -1
  371. package/lib/module/components/PlatformList.js.map +0 -1
  372. package/lib/module/components/TrainingModal.js +0 -708
  373. package/lib/module/components/TrainingModal.js.map +0 -1
  374. package/lib/module/components/UniversalOnboarding.js.map +0 -1
  375. package/lib/module/components/UniversalOnboarding.tsx.new +0 -455
  376. package/lib/module/components/onboarding/OAuthWebView.js.map +0 -1
  377. package/lib/module/components/onboarding/OnboardingHeader.js.map +0 -1
  378. package/lib/module/components/onboarding/PinInput.js.map +0 -1
  379. package/lib/module/components/onboarding/PlatformConnector.js.map +0 -1
  380. package/lib/module/components/screens/ConnectorScreen.js +0 -138
  381. package/lib/module/components/screens/ConnectorScreen.js.map +0 -1
  382. package/lib/module/components/screens/LoadingScreen.js +0 -83
  383. package/lib/module/components/screens/LoadingScreen.js.map +0 -1
  384. package/lib/module/components/screens/PinCreationScreen.js +0 -53
  385. package/lib/module/components/screens/PinCreationScreen.js.map +0 -1
  386. package/lib/module/constants/index.js.map +0 -1
  387. package/lib/module/hooks/useConnections.js.map +0 -1
  388. package/lib/module/hooks/useCredentials.js.map +0 -1
  389. package/lib/module/index.js.map +0 -1
  390. package/lib/module/services/apiKeyService.js.map +0 -1
  391. package/lib/module/services/oauthService.js.map +0 -1
  392. package/lib/module/services/platformAuthService.js.map +0 -1
  393. package/lib/module/types/ambient.d.js.map +0 -1
  394. package/lib/module/types/declarations.d.js.map +0 -1
  395. package/lib/module/types/index.d.js.map +0 -1
  396. package/lib/module/types/index.js.map +0 -1
  397. package/lib/module/types/node-fix.d.js.map +0 -1
  398. package/lib/module/types/node-override.d.js.map +0 -1
  399. package/lib/module/types/opacity.d.js.map +0 -1
  400. package/lib/module/types/types.d.js.map +0 -1
  401. package/lib/module/types.js.map +0 -1
  402. package/lib/module/utils/Portal.js.map +0 -1
  403. package/lib/module/utils/api.js.map +0 -1
  404. package/lib/module/utils/auth.js.map +0 -1
  405. package/lib/module/utils/crypto.js.map +0 -1
  406. package/lib/module/utils/debugHelper.js.map +0 -1
  407. package/lib/module/utils/encryption.js.map +0 -1
  408. package/lib/module/utils/onairosApi.js.map +0 -1
  409. package/lib/module/utils/programmaticFlow.js.map +0 -1
  410. package/lib/module/utils/retryHelper.js.map +0 -1
  411. package/lib/module/utils/secureStorage.js.map +0 -1
  412. package/lib/typescript/api/index.d.ts +0 -8
  413. package/lib/typescript/api/index.d.ts.map +0 -1
  414. package/lib/typescript/components/DataRequestModal.d.ts +0 -11
  415. package/lib/typescript/components/DataRequestModal.d.ts.map +0 -1
  416. package/lib/typescript/components/DataRequestScreen.d.ts +0 -11
  417. package/lib/typescript/components/DataRequestScreen.d.ts.map +0 -1
  418. package/lib/typescript/components/EmailVerificationModal.d.ts +0 -11
  419. package/lib/typescript/components/EmailVerificationModal.d.ts.map +0 -1
  420. package/lib/typescript/components/Onairos.d.ts +0 -4
  421. package/lib/typescript/components/Onairos.d.ts.map +0 -1
  422. package/lib/typescript/components/OnairosButton.d.ts +0 -12
  423. package/lib/typescript/components/OnairosButton.d.ts.map +0 -1
  424. package/lib/typescript/components/Overlay.d.ts +0 -4
  425. package/lib/typescript/components/Overlay.d.ts.map +0 -1
  426. package/lib/typescript/components/PinInput.d.ts +0 -4
  427. package/lib/typescript/components/PinInput.d.ts.map +0 -1
  428. package/lib/typescript/components/PlatformList.d.ts +0 -4
  429. package/lib/typescript/components/PlatformList.d.ts.map +0 -1
  430. package/lib/typescript/components/TrainingModal.d.ts +0 -4
  431. package/lib/typescript/components/TrainingModal.d.ts.map +0 -1
  432. package/lib/typescript/components/UniversalOnboarding.d.ts +0 -4
  433. package/lib/typescript/components/UniversalOnboarding.d.ts.map +0 -1
  434. package/lib/typescript/components/onboarding/OAuthWebView.d.ts +0 -10
  435. package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +0 -1
  436. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +0 -11
  437. package/lib/typescript/components/onboarding/OnboardingHeader.d.ts.map +0 -1
  438. package/lib/typescript/components/onboarding/PinInput.d.ts +0 -4
  439. package/lib/typescript/components/onboarding/PinInput.d.ts.map +0 -1
  440. package/lib/typescript/components/onboarding/PlatformConnector.d.ts +0 -13
  441. package/lib/typescript/components/onboarding/PlatformConnector.d.ts.map +0 -1
  442. package/lib/typescript/components/screens/ConnectorScreen.d.ts +0 -9
  443. package/lib/typescript/components/screens/ConnectorScreen.d.ts.map +0 -1
  444. package/lib/typescript/components/screens/LoadingScreen.d.ts +0 -9
  445. package/lib/typescript/components/screens/LoadingScreen.d.ts.map +0 -1
  446. package/lib/typescript/components/screens/PinCreationScreen.d.ts +0 -10
  447. package/lib/typescript/components/screens/PinCreationScreen.d.ts.map +0 -1
  448. package/lib/typescript/constants/index.d.ts +0 -53
  449. package/lib/typescript/constants/index.d.ts.map +0 -1
  450. package/lib/typescript/hooks/useConnections.d.ts +0 -9
  451. package/lib/typescript/hooks/useConnections.d.ts.map +0 -1
  452. package/lib/typescript/hooks/useCredentials.d.ts +0 -9
  453. package/lib/typescript/hooks/useCredentials.d.ts.map +0 -1
  454. package/lib/typescript/index.d.ts +0 -18
  455. package/lib/typescript/index.d.ts.map +0 -1
  456. package/lib/typescript/services/apiKeyService.d.ts +0 -132
  457. package/lib/typescript/services/apiKeyService.d.ts.map +0 -1
  458. package/lib/typescript/services/oauthService.d.ts +0 -50
  459. package/lib/typescript/services/oauthService.d.ts.map +0 -1
  460. package/lib/typescript/services/platformAuthService.d.ts +0 -144
  461. package/lib/typescript/services/platformAuthService.d.ts.map +0 -1
  462. package/lib/typescript/types/index.d.ts +0 -231
  463. package/lib/typescript/types/index.d.ts.map +0 -1
  464. package/lib/typescript/types.d.ts +0 -270
  465. package/lib/typescript/types.d.ts.map +0 -1
  466. package/lib/typescript/utils/Portal.d.ts +0 -14
  467. package/lib/typescript/utils/Portal.d.ts.map +0 -1
  468. package/lib/typescript/utils/api.d.ts +0 -6
  469. package/lib/typescript/utils/api.d.ts.map +0 -1
  470. package/lib/typescript/utils/auth.d.ts +0 -6
  471. package/lib/typescript/utils/auth.d.ts.map +0 -1
  472. package/lib/typescript/utils/crypto.d.ts +0 -4
  473. package/lib/typescript/utils/crypto.d.ts.map +0 -1
  474. package/lib/typescript/utils/debugHelper.d.ts +0 -29
  475. package/lib/typescript/utils/debugHelper.d.ts.map +0 -1
  476. package/lib/typescript/utils/encryption.d.ts +0 -19
  477. package/lib/typescript/utils/encryption.d.ts.map +0 -1
  478. package/lib/typescript/utils/onairosApi.d.ts +0 -87
  479. package/lib/typescript/utils/onairosApi.d.ts.map +0 -1
  480. package/lib/typescript/utils/programmaticFlow.d.ts +0 -23
  481. package/lib/typescript/utils/programmaticFlow.d.ts.map +0 -1
  482. package/lib/typescript/utils/retryHelper.d.ts +0 -69
  483. package/lib/typescript/utils/retryHelper.d.ts.map +0 -1
  484. package/lib/typescript/utils/secureStorage.d.ts +0 -94
  485. package/lib/typescript/utils/secureStorage.d.ts.map +0 -1
  486. package/src/api/index.ts +0 -111
  487. package/src/assets/images/email.png +0 -0
  488. package/src/assets/images/linkedin.png +0 -0
  489. package/src/assets/images/onairos_logo.png +0 -0
  490. package/src/assets/images/reddit.png +0 -0
  491. package/src/assets/images/youtube.png +0 -0
  492. package/src/components/DataRequestModal.tsx +0 -227
  493. package/src/components/DataRequestScreen.tsx +0 -356
  494. package/src/components/EmailVerificationModal.tsx +0 -364
  495. package/src/components/Onairos.tsx +0 -425
  496. package/src/components/OnairosButton.tsx +0 -359
  497. package/src/components/Overlay.tsx +0 -506
  498. package/src/components/PinInput.tsx +0 -343
  499. package/src/components/PlatformList.tsx +0 -145
  500. package/src/components/TrainingModal.tsx +0 -737
  501. package/src/components/UniversalOnboarding.tsx +0 -1839
  502. package/src/components/UniversalOnboarding.tsx.new +0 -455
  503. package/src/components/onboarding/OAuthWebView.tsx +0 -838
  504. package/src/components/onboarding/OnboardingHeader.tsx +0 -70
  505. package/src/components/onboarding/PinInput.tsx +0 -356
  506. package/src/components/onboarding/PlatformConnector.tsx +0 -302
  507. package/src/components/screens/ConnectorScreen.tsx +0 -153
  508. package/src/components/screens/LoadingScreen.tsx +0 -100
  509. package/src/components/screens/PinCreationScreen.tsx +0 -67
  510. package/src/constants/index.ts +0 -83
  511. package/src/hooks/useConnections.ts +0 -163
  512. package/src/hooks/useCredentials.ts +0 -175
  513. package/src/index.js +0 -14
  514. package/src/index.ts +0 -50
  515. package/src/services/SDK_API_KEY_VALIDATION.md +0 -421
  516. package/src/services/apiKeyService.ts +0 -984
  517. package/src/services/oauthService.ts +0 -412
  518. package/src/services/platformAuthService.ts +0 -1113
  519. package/src/types/ambient.d.ts +0 -29
  520. package/src/types/declarations.d.ts +0 -26
  521. package/src/types/index.d.ts +0 -274
  522. package/src/types/index.ts +0 -244
  523. package/src/types/node-fix.d.ts +0 -19
  524. package/src/types/node-override.d.ts +0 -24
  525. package/src/types/opacity.d.ts +0 -16
  526. package/src/types/types.d.ts +0 -18
  527. package/src/types.ts +0 -298
  528. package/src/utils/Portal.tsx +0 -83
  529. package/src/utils/api.js +0 -112
  530. package/src/utils/auth.js +0 -104
  531. package/src/utils/crypto.js +0 -60
  532. package/src/utils/debugHelper.ts +0 -53
  533. package/src/utils/encryption.ts +0 -69
  534. package/src/utils/onairosApi.ts +0 -391
  535. package/src/utils/programmaticFlow.ts +0 -113
  536. package/src/utils/retryHelper.ts +0 -275
  537. package/src/utils/secureStorage.ts +0 -361
  538. package/types/index.d.ts +0 -218
  539. package/types/node-env.d.ts +0 -15
  540. /package/{src/assets/images → lib/commonjs/assets/icons}/farcaster.png +0 -0
  541. /package/{src/assets/images → lib/commonjs/assets/icons}/instagram.png +0 -0
  542. /package/{src/assets/images → lib/commonjs/assets/icons}/pinterest.png +0 -0
  543. /package/{src/assets/images → lib/commonjs/assets/icons}/swerv_logo.png +0 -0
  544. /package/{src/assets/images → lib/commonjs/assets/icons}/twitter.jpg +0 -0
@@ -1,925 +1 @@
1
- import AsyncStorage from '@react-native-async-storage/async-storage';
2
- import NetInfo from '@react-native-community/netinfo';
3
-
4
- // Admin key for backend validation
5
- export const ADMIN_API_KEY = 'OnairosIsAUnicorn2025';
6
-
7
- // API key types
8
- export let ApiKeyType = /*#__PURE__*/function (ApiKeyType) {
9
- ApiKeyType["DEVELOPER"] = "developer";
10
- ApiKeyType["ADMIN"] = "admin";
11
- ApiKeyType["INVALID"] = "invalid";
12
- return ApiKeyType;
13
- }({});
14
-
15
- // JWT token storage key
16
- const JWT_TOKEN_KEY = 'onairos_jwt_token';
17
-
18
- /**
19
- * Two-Tier Authentication Service for Onairos React Native SDK
20
- *
21
- * This service implements the two-tier authentication system:
22
- * 1. Developer API Keys: For app-level operations (email verification, app registration)
23
- * 2. JWT User Tokens: For user-level operations (PIN storage, user profile)
24
- *
25
- * How it works:
26
- * 1. Initialize with developer API key
27
- * 2. Use API key for email verification requests
28
- * 3. Store JWT token from email verification response
29
- * 4. Use JWT token for user-authenticated requests
30
- * 5. Handle token expiration gracefully
31
- *
32
- * Backend Integration:
33
- * - Developer routes: Authorization: Bearer ${API_KEY}
34
- * - User routes: Authorization: Bearer ${JWT_TOKEN}
35
- */
36
-
37
- // Global configuration state
38
- let globalConfig = null;
39
- let validationCache = new Map();
40
- let isInitialized = false;
41
- let userToken = null;
42
-
43
- // Cache duration (5 minutes)
44
- const CACHE_DURATION = 5 * 60 * 1000;
45
-
46
- /**
47
- * Check network connectivity
48
- * @returns Promise<boolean> - true if connected, false otherwise
49
- */
50
- const checkNetworkConnectivity = async () => {
51
- try {
52
- const netInfo = await NetInfo.fetch();
53
- return netInfo.isConnected === true && netInfo.isInternetReachable !== false;
54
- } catch (error) {
55
- console.warn('⚠️ Failed to check network connectivity:', error);
56
- // If we can't check connectivity, assume we're connected and let the request fail naturally
57
- return true;
58
- }
59
- };
60
-
61
- // API endpoints for different environments (updated to handle non-existent dev endpoint)
62
- const API_ENDPOINTS = {
63
- production: 'https://api2.onairos.uk',
64
- staging: 'https://api2.onairos.uk',
65
- // Fallback to production for staging
66
- development: 'https://api2.onairos.uk' // Fallback to production since dev-api2.onairos.uk doesn't exist
67
- };
68
-
69
- /**
70
- * Initialize the SDK with developer API key
71
- * @param config API configuration including developer API key
72
- */
73
- export const initializeApiKey = async config => {
74
- try {
75
- console.log('🔑 Initializing Onairos SDK with developer API key...');
76
- if (!config.apiKey) {
77
- throw new Error('Developer API key is required for SDK initialization');
78
- }
79
-
80
- // Check if it's admin key first (admin key is shorter than 32 chars)
81
- if (!isAdminKey(config.apiKey) && config.apiKey.length < 32) {
82
- throw new Error('Invalid API key format. Developer keys must be at least 32 characters long.');
83
- }
84
-
85
- // Set global configuration
86
- globalConfig = {
87
- apiKey: config.apiKey,
88
- environment: config.environment || 'production',
89
- enableLogging: config.enableLogging !== false,
90
- // Default to true
91
- timeout: config.timeout || 30000,
92
- retryAttempts: config.retryAttempts || 3
93
- };
94
- if (globalConfig.enableLogging) {
95
- console.log('📝 SDK Configuration:', {
96
- environment: globalConfig.environment,
97
- timeout: globalConfig.timeout,
98
- retryAttempts: globalConfig.retryAttempts,
99
- apiKeyPrefix: config.apiKey.substring(0, 8) + '...',
100
- enableLogging: globalConfig.enableLogging
101
- });
102
- }
103
-
104
- // Validate the API key (handles both admin and developer keys)
105
- const validation = await validateApiKey(config.apiKey);
106
- if (!validation.isValid) {
107
- // Use defensive coding to handle cases where validation.error might be undefined
108
- const errorMessage = validation.error || '';
109
-
110
- // Check if it's a network/connectivity issue (either from error message or the flag)
111
- const isNetworkError = validation.isNetworkError || errorMessage.includes('Network request failed') || errorMessage.includes('Network error') || errorMessage.includes('JSON Parse error') || errorMessage.includes('API validation endpoint returned') || errorMessage.includes('timeout') || errorMessage.includes('ENOTFOUND') || errorMessage.includes('fetch') || errorMessage.includes('No network connection');
112
- if (isNetworkError) {
113
- console.warn('⚠️ API key validation failed due to network/connectivity issues');
114
- console.warn('🔄 Continuing in offline mode with basic validation');
115
- console.warn('📝 SDK will function with limited validation. Network connectivity will be retried automatically.');
116
- console.warn('🌐 Error details:', validation.error);
117
-
118
- // Continue initialization in offline mode - don't throw error
119
- console.log('📱 SDK initialized in offline mode - will retry validation when network is available');
120
- } else {
121
- // Only throw for actual API key validation errors (not network issues)
122
- throw new Error(`API key validation failed: ${validation.error}`);
123
- }
124
- }
125
-
126
- // Try to load existing JWT token
127
- await loadJWT();
128
- isInitialized = true;
129
- if (globalConfig.enableLogging) {
130
- console.log('✅ Onairos SDK initialized successfully');
131
- if (isAdminKey(config.apiKey)) {
132
- console.log('🔑 Admin API key ready with full permissions');
133
- } else {
134
- console.log('🔑 Developer API key ready for app-level operations');
135
- }
136
- if (userToken) {
137
- console.log('🎫 User JWT token loaded from storage');
138
- }
139
- if (validation.permissions) {
140
- console.log('🔐 API Key Permissions:', validation.permissions);
141
- }
142
- if (validation.rateLimits) {
143
- console.log('⏱️ Rate Limits:', validation.rateLimits);
144
- }
145
- }
146
- } catch (error) {
147
- console.error('❌ Failed to initialize Onairos SDK:', error);
148
- isInitialized = false;
149
- throw error;
150
- }
151
- };
152
-
153
- /**
154
- * Determine API key type
155
- * @param apiKey The API key to check
156
- * @returns The type of API key
157
- */
158
- export const getApiKeyType = apiKey => {
159
- if (apiKey === ADMIN_API_KEY) {
160
- return ApiKeyType.ADMIN;
161
- }
162
-
163
- // Developer keys should be at least 32 characters and start with specific prefix
164
- if (apiKey.length >= 32 && (apiKey.startsWith('dev_') || apiKey.startsWith('pk_') || apiKey.startsWith('ona_'))) {
165
- return ApiKeyType.DEVELOPER;
166
- }
167
- return ApiKeyType.INVALID;
168
- };
169
-
170
- /**
171
- * Check if API key is admin key
172
- * @param apiKey The API key to check
173
- * @returns True if admin key
174
- */
175
- export const isAdminKey = apiKey => {
176
- return apiKey === ADMIN_API_KEY;
177
- };
178
-
179
- /**
180
- * Validate an API key with the Onairos backend
181
- * @param apiKey The API key to validate
182
- * @returns Validation result with permissions and rate limits
183
- */
184
- export const validateApiKey = async apiKey => {
185
- try {
186
- var _globalConfig2, _globalConfig3, _globalConfig4;
187
- console.log('🔍 Validating API key...');
188
-
189
- // Check if it's an admin key
190
- if (isAdminKey(apiKey)) {
191
- console.log('🔑 Admin key detected - granting full permissions');
192
- return {
193
- isValid: true,
194
- permissions: ['*'],
195
- // Full permissions for admin
196
- rateLimits: {
197
- remaining: 999999,
198
- resetTime: Date.now() + 24 * 60 * 60 * 1000 // 24 hours
199
- },
200
- keyType: ApiKeyType.ADMIN
201
- };
202
- }
203
-
204
- // Check basic format for developer keys
205
- const keyType = getApiKeyType(apiKey);
206
- if (keyType === ApiKeyType.INVALID) {
207
- return {
208
- isValid: false,
209
- error: 'Invalid API key format. Developer keys must be at least 32 characters and start with "dev_", "pk_", or "ona_"',
210
- keyType: ApiKeyType.INVALID
211
- };
212
- }
213
-
214
- // Check cache first
215
- const cached = validationCache.get(apiKey);
216
- if (cached && Date.now() - cached.timestamp < CACHE_DURATION) {
217
- var _globalConfig;
218
- if ((_globalConfig = globalConfig) !== null && _globalConfig !== void 0 && _globalConfig.enableLogging) {
219
- console.log('📋 Using cached API key validation result');
220
- }
221
- return cached.result;
222
- }
223
-
224
- // Check network connectivity before making API calls
225
- const isConnected = await checkNetworkConnectivity();
226
- if (!isConnected) {
227
- console.warn('⚠️ No network connectivity detected');
228
- return {
229
- isValid: false,
230
- error: 'No network connection available. Please check your internet connection and try again.',
231
- keyType: keyType,
232
- isNetworkError: true
233
- };
234
- }
235
- const environment = ((_globalConfig2 = globalConfig) === null || _globalConfig2 === void 0 ? void 0 : _globalConfig2.environment) || 'production';
236
- const baseUrl = API_ENDPOINTS[environment];
237
- const timeout = ((_globalConfig3 = globalConfig) === null || _globalConfig3 === void 0 ? void 0 : _globalConfig3.timeout) || 30000;
238
- const maxRetries = ((_globalConfig4 = globalConfig) === null || _globalConfig4 === void 0 ? void 0 : _globalConfig4.retryAttempts) || 3;
239
-
240
- // Retry logic for network failures
241
- for (let attempt = 1; attempt <= maxRetries; attempt++) {
242
- // Create abort controller for timeout
243
- const controller = new AbortController();
244
- const timeoutId = setTimeout(() => controller.abort(), timeout);
245
- try {
246
- var _globalConfig5;
247
- if ((_globalConfig5 = globalConfig) !== null && _globalConfig5 !== void 0 && _globalConfig5.enableLogging && attempt > 1) {
248
- console.log(`🔄 Retry attempt ${attempt}/${maxRetries} for API key validation`);
249
- }
250
- const response = await fetch(`${baseUrl}/dev/validate`, {
251
- method: 'POST',
252
- headers: {
253
- 'Content-Type': 'application/json',
254
- 'Authorization': `Bearer ${apiKey}`,
255
- 'User-Agent': 'OnairosReactNative/3.3.1',
256
- 'X-API-Key-Type': keyType,
257
- 'X-SDK-Platform': 'react-native',
258
- 'X-Retry-Attempt': attempt.toString()
259
- },
260
- body: JSON.stringify({
261
- environment,
262
- sdk_version: '3.3.1',
263
- platform: 'react-native',
264
- keyType,
265
- timestamp: new Date().toISOString(),
266
- attempt
267
- }),
268
- signal: controller.signal
269
- });
270
- clearTimeout(timeoutId);
271
-
272
- // First check if we got a valid response
273
- if (!response) {
274
- throw new Error('No response received from server');
275
- }
276
-
277
- // Handle common HTTP errors that indicate server issues
278
- if (response.status === 502) {
279
- throw new Error('Onairos API is temporarily unavailable (502 Bad Gateway). Please try again later.');
280
- }
281
- if (response.status === 503) {
282
- throw new Error('Onairos API is under maintenance (503 Service Unavailable). Please try again later.');
283
- }
284
- if (response.status === 504) {
285
- throw new Error('Onairos API request timed out (504 Gateway Timeout). Please try again.');
286
- }
287
-
288
- // Check if response is actually JSON before trying to parse
289
- const contentType = response.headers.get('content-type');
290
- const isJsonResponse = contentType && contentType.includes('application/json');
291
- if (!isJsonResponse) {
292
- const textContent = await response.text();
293
- const previewText = textContent.substring(0, 200);
294
- console.error('❌ API endpoint returned non-JSON response:', {
295
- status: response.status,
296
- statusText: response.statusText,
297
- contentType: contentType || 'unknown',
298
- preview: previewText,
299
- url: `${baseUrl}/dev/validate`,
300
- attempt: attempt
301
- });
302
-
303
- // Handle specific error cases
304
- if (response.status === 404) {
305
- throw new Error(`API validation endpoint not found (404). The endpoint ${baseUrl}/dev/validate may not exist or be configured correctly.`);
306
- } else if (response.status === 500) {
307
- throw new Error(`Server error (500). The Onairos backend is experiencing issues.`);
308
- } else if (response.status === 502 || response.status === 503) {
309
- throw new Error(`Service unavailable (${response.status}). The Onairos backend may be temporarily down.`);
310
- } else if (textContent.includes('<html') || textContent.includes('<!DOCTYPE')) {
311
- throw new Error(`Server returned HTML page instead of JSON API response. This often indicates a routing issue or server misconfiguration.`);
312
- } else {
313
- throw new Error(`API validation endpoint returned ${response.status} - ${response.statusText}. Expected JSON but got ${contentType || 'unknown content type'}.`);
314
- }
315
- }
316
-
317
- // Parse JSON response
318
- let data;
319
- try {
320
- data = await response.json();
321
- } catch (jsonError) {
322
- console.error('❌ Failed to parse JSON response:', {
323
- error: jsonError.message,
324
- status: response.status,
325
- contentType,
326
- attempt: attempt
327
- });
328
- throw new Error(`Failed to parse server response as JSON: ${jsonError.message}`);
329
- }
330
-
331
- // Handle successful response
332
- // Backend returns either {success: true} or {valid: true}
333
- if (response.ok && (data.success || data.valid)) {
334
- var _globalConfig6;
335
- const result = {
336
- isValid: true,
337
- permissions: data.permissions || [],
338
- rateLimits: data.rateLimits || null,
339
- keyType: keyType
340
- };
341
-
342
- // Cache the successful result
343
- validationCache.set(apiKey, {
344
- result,
345
- timestamp: Date.now()
346
- });
347
- if ((_globalConfig6 = globalConfig) !== null && _globalConfig6 !== void 0 && _globalConfig6.enableLogging) {
348
- var _data$apiKey, _data$application, _data$apiKey2;
349
- console.log('✅ API key validation successful', {
350
- apiKeyId: (_data$apiKey = data.apiKey) === null || _data$apiKey === void 0 ? void 0 : _data$apiKey.id,
351
- appName: (_data$application = data.application) === null || _data$application === void 0 ? void 0 : _data$application.name,
352
- usageCount: (_data$apiKey2 = data.apiKey) === null || _data$apiKey2 === void 0 ? void 0 : _data$apiKey2.usageCount
353
- });
354
- }
355
- return result;
356
- } else {
357
- // Handle API errors (invalid key, etc.)
358
- const errorMessage = data.error || data.message || `HTTP ${response.status}: ${response.statusText}`;
359
- const result = {
360
- isValid: false,
361
- error: errorMessage,
362
- keyType: keyType
363
- };
364
-
365
- // For client errors (4xx), don't retry
366
- if (response.status >= 400 && response.status < 500) {
367
- var _globalConfig7;
368
- if ((_globalConfig7 = globalConfig) !== null && _globalConfig7 !== void 0 && _globalConfig7.enableLogging) {
369
- console.error('❌ API key validation failed (client error):', errorMessage);
370
- }
371
- return result;
372
- }
373
-
374
- // For server errors (5xx), retry
375
- throw new Error(errorMessage);
376
- }
377
- } catch (fetchError) {
378
- var _globalConfig8;
379
- clearTimeout(timeoutId);
380
- if (fetchError.name === 'AbortError') {
381
- const errorMessage = `API key validation timeout (${timeout}ms)`;
382
- console.error('⏱️ API key validation timeout');
383
- if (attempt === maxRetries) {
384
- return {
385
- isValid: false,
386
- error: errorMessage,
387
- keyType: keyType
388
- };
389
- }
390
- continue; // Retry timeout errors
391
- }
392
-
393
- // Enhanced error message based on error type
394
- let errorMessage = `Network error during API key validation: ${fetchError.message}`;
395
-
396
- // Add specific guidance for common errors
397
- if (fetchError.message.includes('JSON Parse error') || fetchError.message.includes('Unexpected character')) {
398
- errorMessage = `Server returned invalid JSON response. This usually indicates the API endpoint returned HTML instead of JSON (often a 404 or server error page). ${fetchError.message}`;
399
- } else if (fetchError.message.includes('Network request failed') || fetchError.message.includes('fetch')) {
400
- errorMessage = `Network connectivity issue. Please check internet connection and verify the Onairos API is accessible. ${fetchError.message}`;
401
- } else if (fetchError.message.includes('DNS') || fetchError.message.includes('ENOTFOUND')) {
402
- errorMessage = `DNS resolution failed for ${baseUrl}. Please check network settings and domain accessibility. ${fetchError.message}`;
403
- }
404
- console.error('🌐 Network error during API key validation:', {
405
- error: fetchError,
406
- endpoint: `${baseUrl}/dev/validate`,
407
- attempt: attempt,
408
- maxRetries: maxRetries,
409
- retryable: attempt < maxRetries
410
- });
411
-
412
- // If this is the last attempt, return the error
413
- if (attempt === maxRetries) {
414
- return {
415
- isValid: false,
416
- error: errorMessage,
417
- keyType: keyType,
418
- isNetworkError: true // Flag to indicate this is a network issue, not an API key issue
419
- };
420
- }
421
-
422
- // Wait before retrying (exponential backoff)
423
- const backoffDelay = Math.min(1000 * Math.pow(2, attempt - 1), 5000);
424
- if ((_globalConfig8 = globalConfig) !== null && _globalConfig8 !== void 0 && _globalConfig8.enableLogging) {
425
- console.log(`⏳ Waiting ${backoffDelay}ms before retry...`);
426
- }
427
- await new Promise(resolve => setTimeout(() => resolve(), backoffDelay));
428
- }
429
- }
430
-
431
- // This should never be reached, but just in case
432
- return {
433
- isValid: false,
434
- error: 'All retry attempts exhausted',
435
- keyType: keyType
436
- };
437
- } catch (error) {
438
- const errorMessage = `API key validation error: ${error.message}`;
439
- console.error('❌ API key validation error:', error);
440
- return {
441
- isValid: false,
442
- error: errorMessage,
443
- keyType: ApiKeyType.INVALID
444
- };
445
- }
446
- };
447
-
448
- /**
449
- * Get the current API configuration
450
- * @returns Current API configuration or null if not initialized
451
- */
452
- export const getApiConfig = () => {
453
- return globalConfig;
454
- };
455
-
456
- /**
457
- * Get the current API key
458
- * @returns Current API key or null if not initialized
459
- */
460
- export const getApiKey = () => {
461
- var _globalConfig9;
462
- return ((_globalConfig9 = globalConfig) === null || _globalConfig9 === void 0 ? void 0 : _globalConfig9.apiKey) || null;
463
- };
464
-
465
- /**
466
- * Check if the SDK is properly initialized
467
- * @returns True if initialized with valid API key
468
- */
469
- export const isApiKeyInitialized = () => {
470
- return isInitialized && globalConfig !== null;
471
- };
472
-
473
- /**
474
- * Store JWT token securely after email verification
475
- * @param token JWT token from email verification response
476
- */
477
- export const storeJWT = async token => {
478
- try {
479
- var _globalConfig0;
480
- await AsyncStorage.setItem(JWT_TOKEN_KEY, token);
481
- userToken = token;
482
- if ((_globalConfig0 = globalConfig) !== null && _globalConfig0 !== void 0 && _globalConfig0.enableLogging) {
483
- console.log('🎫 JWT token stored successfully');
484
- }
485
- } catch (error) {
486
- console.error('❌ Failed to store JWT token:', error);
487
- throw error;
488
- }
489
- };
490
-
491
- /**
492
- * Load JWT token from storage
493
- * @returns JWT token or null if not found
494
- */
495
- export const loadJWT = async () => {
496
- try {
497
- const token = await AsyncStorage.getItem(JWT_TOKEN_KEY);
498
- userToken = token;
499
- return token;
500
- } catch (error) {
501
- console.error('❌ Failed to load JWT token:', error);
502
- return null;
503
- }
504
- };
505
-
506
- /**
507
- * Get current JWT token
508
- * @returns JWT token or null if not available
509
- */
510
- export const getJWT = () => {
511
- return userToken;
512
- };
513
-
514
- /**
515
- * Clear JWT token (on logout or token expiration)
516
- */
517
- export const clearJWT = async () => {
518
- try {
519
- var _globalConfig1;
520
- await AsyncStorage.removeItem(JWT_TOKEN_KEY);
521
- userToken = null;
522
- if ((_globalConfig1 = globalConfig) !== null && _globalConfig1 !== void 0 && _globalConfig1.enableLogging) {
523
- console.log('🗑️ JWT token cleared');
524
- }
525
- } catch (error) {
526
- console.error('❌ Failed to clear JWT token:', error);
527
- }
528
- };
529
-
530
- /**
531
- * React Native compatible base64 decoder
532
- * @param str Base64 encoded string
533
- * @returns Decoded string
534
- */
535
- const base64Decode = str => {
536
- // Simple base64 decoding for React Native
537
- const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
538
- let result = '';
539
- let i = 0;
540
- str = str.replace(/[^A-Za-z0-9+/]/g, '');
541
- while (i < str.length) {
542
- const a = chars.indexOf(str.charAt(i++));
543
- const b = chars.indexOf(str.charAt(i++));
544
- const c = chars.indexOf(str.charAt(i++));
545
- const d = chars.indexOf(str.charAt(i++));
546
- const bitmap = a << 18 | b << 12 | c << 6 | d;
547
- result += String.fromCharCode(bitmap >> 16 & 255);
548
- if (c !== 64) result += String.fromCharCode(bitmap >> 8 & 255);
549
- if (d !== 64) result += String.fromCharCode(bitmap & 255);
550
- }
551
- return result;
552
- };
553
-
554
- /**
555
- * Decode JWT token payload (React Native compatible)
556
- * @param token JWT token string
557
- * @returns Decoded payload or null if invalid
558
- */
559
- export const decodeJWTPayload = token => {
560
- try {
561
- // Split JWT token (header.payload.signature)
562
- const parts = token.split('.');
563
- if (parts.length !== 3) {
564
- console.error('❌ Invalid JWT token format');
565
- return null;
566
- }
567
-
568
- // Decode payload (base64url to base64)
569
- const payload = parts[1];
570
- const base64 = payload.replace(/-/g, '+').replace(/_/g, '/');
571
-
572
- // Add padding if needed
573
- const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, '=');
574
-
575
- // Decode base64 to JSON using React Native compatible decoder
576
- const decoded = base64Decode(padded);
577
- return JSON.parse(decoded);
578
- } catch (error) {
579
- console.error('❌ Failed to decode JWT token:', error);
580
- return null;
581
- }
582
- };
583
-
584
- /**
585
- * Extract username from JWT token
586
- * @param token JWT token (optional, uses stored token if not provided)
587
- * @returns Username or null if not found
588
- */
589
- export const extractUsernameFromJWT = token => {
590
- try {
591
- var _globalConfig10;
592
- const jwtToken = token || userToken;
593
- if (!jwtToken) {
594
- console.warn('⚠️ No JWT token available for username extraction');
595
- return null;
596
- }
597
- const payload = decodeJWTPayload(jwtToken);
598
- if (!payload) {
599
- return null;
600
- }
601
-
602
- // Try different possible username fields in order of preference
603
- const username = payload.userName || payload.username || payload.userId || payload.email;
604
- if ((_globalConfig10 = globalConfig) !== null && _globalConfig10 !== void 0 && _globalConfig10.enableLogging) {
605
- console.log('👤 Extracted username from JWT:', username);
606
- }
607
- return username || null;
608
- } catch (error) {
609
- console.error('❌ Failed to extract username from JWT:', error);
610
- return null;
611
- }
612
- };
613
-
614
- /**
615
- * Extract user data from JWT token
616
- * @param token JWT token (optional, uses stored token if not provided)
617
- * @returns User data object or null if not found
618
- */
619
- export const extractUserDataFromJWT = token => {
620
- try {
621
- var _globalConfig11;
622
- const jwtToken = token || userToken;
623
- if (!jwtToken) {
624
- console.warn('⚠️ No JWT token available for user data extraction');
625
- return null;
626
- }
627
- const payload = decodeJWTPayload(jwtToken);
628
- if (!payload) {
629
- return null;
630
- }
631
- const userData = {
632
- id: payload.id,
633
- email: payload.email,
634
- userId: payload.userId,
635
- userName: payload.userName || payload.username,
636
- verified: payload.verified,
637
- iat: payload.iat,
638
- exp: payload.exp
639
- };
640
- if ((_globalConfig11 = globalConfig) !== null && _globalConfig11 !== void 0 && _globalConfig11.enableLogging) {
641
- console.log('👤 Extracted user data from JWT:', userData);
642
- }
643
- return userData;
644
- } catch (error) {
645
- console.error('❌ Failed to extract user data from JWT:', error);
646
- return null;
647
- }
648
- };
649
-
650
- /**
651
- * Check if user is authenticated with JWT token
652
- * @returns True if user has valid JWT token
653
- */
654
- export const isUserAuthenticated = () => {
655
- return !!userToken;
656
- };
657
-
658
- /**
659
- * Get authenticated headers for API requests
660
- * @returns Headers object with Authorization and other required headers
661
- */
662
- export const getAuthHeaders = () => {
663
- var _globalConfig12;
664
- if (!((_globalConfig12 = globalConfig) !== null && _globalConfig12 !== void 0 && _globalConfig12.apiKey)) {
665
- throw new Error('SDK not initialized. Call initializeApiKey() first.');
666
- }
667
- const keyType = getApiKeyType(globalConfig.apiKey);
668
- return {
669
- 'Content-Type': 'application/json',
670
- 'Authorization': `Bearer ${globalConfig.apiKey}`,
671
- 'User-Agent': 'OnairosReactNative/3.0.72',
672
- 'X-SDK-Version': '3.0.72',
673
- 'X-SDK-Environment': globalConfig.environment || 'production',
674
- 'X-API-Key-Type': keyType,
675
- 'X-Timestamp': new Date().toISOString()
676
- };
677
- };
678
-
679
- /**
680
- * Get authentication headers for developer API requests
681
- * @returns Headers with developer API key
682
- */
683
- export const getDeveloperAuthHeaders = () => {
684
- var _globalConfig13;
685
- if (!((_globalConfig13 = globalConfig) !== null && _globalConfig13 !== void 0 && _globalConfig13.apiKey)) {
686
- throw new Error('SDK not initialized. Call initializeApiKey() first.');
687
- }
688
- const keyType = getApiKeyType(globalConfig.apiKey);
689
- return {
690
- 'Content-Type': 'application/json',
691
- 'Authorization': `Bearer ${globalConfig.apiKey}`,
692
- 'User-Agent': 'OnairosSDK/1.0.0',
693
- 'X-SDK-Version': '3.0.72',
694
- 'X-SDK-Environment': globalConfig.environment || 'production',
695
- 'X-API-Key-Type': keyType,
696
- 'X-Timestamp': new Date().toISOString()
697
- };
698
- };
699
-
700
- /**
701
- * Get authentication headers for user JWT requests
702
- * @returns Headers with user JWT token
703
- */
704
- export const getUserAuthHeaders = () => {
705
- var _globalConfig14;
706
- if (!userToken) {
707
- throw new Error('User not authenticated. Please verify email first.');
708
- }
709
- return {
710
- 'Content-Type': 'application/json',
711
- 'Authorization': `Bearer ${userToken}`,
712
- 'User-Agent': 'OnairosSDK/1.0.0',
713
- 'X-SDK-Version': '3.0.72',
714
- 'X-SDK-Environment': ((_globalConfig14 = globalConfig) === null || _globalConfig14 === void 0 ? void 0 : _globalConfig14.environment) || 'production'
715
- };
716
- };
717
-
718
- /**
719
- * Make an authenticated API request
720
- * @param endpoint The API endpoint (relative to base URL)
721
- * @param options Fetch options
722
- * @returns Response promise
723
- */
724
- export const makeAuthenticatedRequest = async (endpoint, options = {}) => {
725
- if (!isApiKeyInitialized()) {
726
- throw new Error('SDK not initialized. Call initializeApiKey() first.');
727
- }
728
- const config = getApiConfig();
729
- const baseUrl = API_ENDPOINTS[config.environment || 'production'];
730
- const url = `${baseUrl}${endpoint.startsWith('/') ? '' : '/'}${endpoint}`;
731
-
732
- // Merge authentication headers
733
- const headers = {
734
- ...getAuthHeaders(),
735
- ...(options.headers || {})
736
- };
737
-
738
- // Add timeout
739
- const controller = new AbortController();
740
- const timeoutId = setTimeout(() => controller.abort(), config.timeout || 30000);
741
- try {
742
- if (config.enableLogging) {
743
- console.log(`🌐 Making authenticated request to: ${endpoint}`);
744
- }
745
- const response = await fetch(url, {
746
- ...options,
747
- headers,
748
- signal: controller.signal
749
- });
750
- clearTimeout(timeoutId);
751
- if (config.enableLogging) {
752
- console.log(`📡 Response status: ${response.status} for ${endpoint}`);
753
- }
754
-
755
- // Handle API key errors
756
- if (response.status === 401) {
757
- console.error('❌ API key authentication failed. Please check your API key.');
758
- throw new Error('Invalid or expired API key');
759
- }
760
- if (response.status === 403) {
761
- console.error('❌ API key permissions insufficient for this operation.');
762
- throw new Error('Insufficient API key permissions');
763
- }
764
- if (response.status === 429) {
765
- console.error('❌ API rate limit exceeded. Please try again later.');
766
- throw new Error('Rate limit exceeded');
767
- }
768
- return response;
769
- } catch (error) {
770
- clearTimeout(timeoutId);
771
- if (error.name === 'AbortError') {
772
- console.error('⏱️ Request timeout for:', endpoint);
773
- throw new Error('Request timeout');
774
- }
775
- throw error;
776
- }
777
- };
778
-
779
- /**
780
- * Make authenticated request with developer API key
781
- * @param endpoint The API endpoint
782
- * @param options Fetch options
783
- * @returns Response promise
784
- */
785
- export const makeDeveloperRequest = async (endpoint, options = {}) => {
786
- if (!isApiKeyInitialized()) {
787
- throw new Error('SDK not initialized. Call initializeApiKey() first.');
788
- }
789
- const config = getApiConfig();
790
- const baseUrl = API_ENDPOINTS[config.environment || 'production'];
791
- const url = `${baseUrl}${endpoint.startsWith('/') ? '' : '/'}${endpoint}`;
792
-
793
- // Merge developer authentication headers
794
- const headers = {
795
- ...getDeveloperAuthHeaders(),
796
- ...(options.headers || {})
797
- };
798
-
799
- // Add timeout
800
- const controller = new AbortController();
801
- const timeoutId = setTimeout(() => controller.abort(), config.timeout || 30000);
802
- try {
803
- if (config.enableLogging) {
804
- console.log(`🌐 Making developer request to: ${endpoint}`);
805
- }
806
- const response = await fetch(url, {
807
- ...options,
808
- headers,
809
- signal: controller.signal
810
- });
811
- clearTimeout(timeoutId);
812
- if (config.enableLogging) {
813
- console.log(`📡 Developer request response: ${response.status} for ${endpoint}`);
814
- }
815
-
816
- // Handle API key errors
817
- if (response.status === 401) {
818
- console.error('❌ Developer API key authentication failed');
819
- throw new Error('Invalid or expired API key');
820
- }
821
- if (response.status === 403) {
822
- console.error('❌ Developer API key permissions insufficient');
823
- throw new Error('Insufficient API key permissions');
824
- }
825
- if (response.status === 429) {
826
- console.error('❌ API rate limit exceeded');
827
- throw new Error('Rate limit exceeded');
828
- }
829
- return response;
830
- } catch (error) {
831
- clearTimeout(timeoutId);
832
- if (error.name === 'AbortError') {
833
- console.error('⏱️ Request timeout for:', endpoint);
834
- throw new Error('Request timeout');
835
- }
836
- throw error;
837
- }
838
- };
839
-
840
- /**
841
- * Make authenticated request with user JWT token
842
- * @param endpoint The API endpoint
843
- * @param options Fetch options
844
- * @returns Response promise
845
- */
846
- export const makeUserRequest = async (endpoint, options = {}) => {
847
- if (!isUserAuthenticated()) {
848
- await loadJWT(); // Try to load from storage
849
- }
850
- if (!isUserAuthenticated()) {
851
- throw new Error('User not authenticated. Please verify email first.');
852
- }
853
- const config = getApiConfig() || {
854
- environment: 'production',
855
- timeout: 30000,
856
- enableLogging: false
857
- };
858
- const baseUrl = API_ENDPOINTS[config.environment || 'production'];
859
- const url = `${baseUrl}${endpoint.startsWith('/') ? '' : '/'}${endpoint}`;
860
-
861
- // Merge user authentication headers
862
- const headers = {
863
- ...getUserAuthHeaders(),
864
- ...(options.headers || {})
865
- };
866
-
867
- // Add timeout
868
- const controller = new AbortController();
869
- const timeoutId = setTimeout(() => controller.abort(), config.timeout || 30000);
870
- try {
871
- if (config.enableLogging) {
872
- console.log(`🌐 Making user request to: ${endpoint}`);
873
- }
874
- const response = await fetch(url, {
875
- ...options,
876
- headers,
877
- signal: controller.signal
878
- });
879
- clearTimeout(timeoutId);
880
- if (config.enableLogging) {
881
- console.log(`📡 User request response: ${response.status} for ${endpoint}`);
882
- }
883
-
884
- // Handle JWT token errors
885
- if (response.status === 401) {
886
- console.error('❌ JWT token authentication failed - token may be expired');
887
- await clearJWT(); // Clear expired token
888
- throw new Error('Authentication expired. Please verify email again.');
889
- }
890
- if (response.status === 403) {
891
- console.error('❌ JWT token permissions insufficient');
892
- throw new Error('Insufficient permissions for this operation');
893
- }
894
- return response;
895
- } catch (error) {
896
- clearTimeout(timeoutId);
897
- if (error.name === 'AbortError') {
898
- console.error('⏱️ Request timeout for:', endpoint);
899
- throw new Error('Request timeout');
900
- }
901
- throw error;
902
- }
903
- };
904
-
905
- /**
906
- * Clear the API key validation cache
907
- */
908
- export const clearValidationCache = () => {
909
- var _globalConfig15;
910
- validationCache.clear();
911
- if ((_globalConfig15 = globalConfig) !== null && _globalConfig15 !== void 0 && _globalConfig15.enableLogging) {
912
- console.log('🗑️ API key validation cache cleared');
913
- }
914
- };
915
-
916
- /**
917
- * Reset the SDK initialization state
918
- */
919
- export const resetApiKeyService = () => {
920
- globalConfig = null;
921
- isInitialized = false;
922
- clearValidationCache();
923
- console.log('🔄 API key service reset');
924
- };
925
- //# sourceMappingURL=apiKeyService.js.map
1
+ import AsyncStorage from'@react-native-async-storage/async-storage';import NetInfo from'@react-native-community/netinfo';import{API_CONFIG}from'../config/api';export let ApiKeyType=function(_0x2790db){const _0x471cf6={'BpIlN':_0x28a3(0x0),'WCUWn':_0x28a3(0x1)};return _0x2790db[_0x471cf6[_0x28a3(0x2)]]='developer',_0x2790db[_0x28a3(0x3)]=_0x471cf6['WCUWn'],_0x2790db;}({});const JWT_TOKEN_KEY=_0x28a3(0x4);let globalConfig=null,validationCache=new Map(),isInitialized=![],userToken=null;const CACHE_DURATION=0x5*0x3c*0x3e8,checkNetworkConnectivity=async()=>{const _0x23c831={'cXCpa':'Invalid\x20or\x20expired\x20API\x20key','XtZsY':function(_0x578bae,_0x1b077c){return _0x578bae===_0x1b077c;},'SoDuN':function(_0x2c14de,_0x357ce0){return _0x2c14de!==_0x357ce0;},'NIeij':_0x28a3(0x5),'RxBma':_0x28a3(0x6),'Wivig':_0x28a3(0x7)};try{const _0x1a3a24=await NetInfo[_0x28a3(0x8)]();return _0x23c831[_0x28a3(0x9)](_0x1a3a24[_0x28a3(0xa)],!![])&&_0x23c831[_0x28a3(0xb)](_0x1a3a24[_0x28a3(0xc)],![]);}catch(_0x42e983){if(_0x23c831[_0x28a3(0xb)](_0x23c831[_0x28a3(0xd)],_0x23c831[_0x28a3(0xe)]))return console['warn'](_0x23c831[_0x28a3(0xf)],_0x42e983),!![];else{_0x37fef5[_0x28a3(0x10)](_0x28a3(0x11));throw new _0x19d617(_0x23c831[_0x28a3(0x12)]);}}},API_ENDPOINTS={'production':''+API_CONFIG[_0x28a3(0x13)],'staging':''+API_CONFIG[_0x28a3(0x13)],'development':''+API_CONFIG[_0x28a3(0x13)]};export const initializeApiKey=async _0x1cb8bd=>{const _0xf4847={'Epguf':function(_0x1b79f9,_0xfc67cf){return _0x1b79f9!==_0xfc67cf;},'aBuYe':_0x28a3(0x14),'SDBVx':_0x28a3(0x15),'GdVSd':_0x28a3(0x16),'xyHMJ':'⏱️\x20Rate\x20Limits:','lgSxK':'Onairos\x20API\x20is\x20temporarily\x20unavailable\x20(502\x20Bad\x20Gateway).\x20Please\x20try\x20again\x20later.','EWaOQ':_0x28a3(0x17),'ITrjP':function(_0x592943,_0x30aa15){return _0x592943!==_0x30aa15;},'xLirV':_0x28a3(0x18),'qilWT':function(_0x3babae,_0x392c2b){return _0x3babae/_0x392c2b;},'rcHbU':function(_0x2b0635,_0x2855aa){return _0x2b0635(_0x2855aa);},'PdYhQ':_0x28a3(0x19),'PAdRi':_0x28a3(0x1a),'cNYYi':_0x28a3(0x1b),'DCgYw':_0x28a3(0x1c),'SVLFI':function(_0x2cccd3,_0x54531d){return _0x2cccd3<_0x54531d;},'XmaEJ':function(_0x222db6,_0x5d496f){return _0x222db6!==_0x5d496f;},'jHXRH':_0x28a3(0x1d),'IHjOV':_0x28a3(0x1e),'KxwcW':_0x28a3(0x1f),'sRepi':_0x28a3(0x20),'cPLUM':'ona_','XFZDk':_0x28a3(0x21),'ZLgdf':'Invalid\x20API\x20key\x20format.\x20Developer\x20keys\x20must\x20start\x20with\x20dev_,\x20ona_,\x20or\x20pk_','PQdvH':_0x28a3(0x22),'VKQrc':function(_0x3fdeca,_0x4dfa0a){return _0x3fdeca!==_0x4dfa0a;},'jNLAm':_0x28a3(0x23),'izSUy':'Network\x20error','WUSkz':_0x28a3(0x24),'DkFcO':_0x28a3(0x25),'EVzIc':'⚠️\x20API\x20key\x20validation\x20failed\x20due\x20to\x20network/connectivity\x20issues','MydVr':_0x28a3(0x26),'kDCNl':_0x28a3(0x27),'NKoKe':_0x28a3(0x28),'LAMWZ':_0x28a3(0x29),'AJiah':function(_0x42853f,_0x27a320){return _0x42853f!==_0x27a320;},'CYSne':_0x28a3(0x2a),'GOOYH':'vHKaQ','cDcrY':_0x28a3(0x2b),'PksOV':_0x28a3(0x2c),'AZeTJ':_0x28a3(0x2d),'NduEF':'🎫\x20User\x20JWT\x20token\x20loaded\x20from\x20storage','rATtX':function(_0x23db4,_0xf873b9){return _0x23db4!==_0xf873b9;},'fXfTx':_0x28a3(0x2e),'qCltS':'❌\x20Failed\x20to\x20initialize\x20Onairos\x20SDK:'};try{if(_0xf4847['PdYhQ']===_0xf4847[_0x28a3(0x2f)]){var _0x480f2f;const _0x58d8dd=_0x2bc8d2||_0x14fc16;if(!_0x58d8dd)return _0x1d4ac5['warn'](_0x28a3(0x30)),null;const _0x5cb54c=_0xc3a59c(_0x58d8dd);if(!_0x5cb54c)return null;const _0x412698={'id':_0x5cb54c['id'],'email':_0x5cb54c[_0x28a3(0x31)],'userId':_0x5cb54c[_0x28a3(0x32)],'userName':_0x5cb54c['userName']||_0x5cb54c[_0x28a3(0x33)],'verified':_0x5cb54c[_0x28a3(0x34)],'iat':_0x5cb54c[_0x28a3(0x35)],'exp':_0x5cb54c[_0x28a3(0x36)]};return _0xf4847[_0x28a3(0x37)](_0x480f2f=_0x1bad21,null)&&_0xf4847[_0x28a3(0x37)](_0x480f2f,void 0x0)&&_0x480f2f[_0x28a3(0x38)]&&_0x5e4c84[_0x28a3(0x39)](_0xf4847[_0x28a3(0x3a)],_0x412698),_0x412698;}else{console[_0x28a3(0x39)](_0xf4847[_0x28a3(0x3b)]);if(!_0x1cb8bd[_0x28a3(0x3c)]){if(_0xf4847['DCgYw']!==_0xf4847[_0x28a3(0x3d)]){_0x569f42['error'](_0xf4847[_0x28a3(0x3e)],_0x5df620);throw new _0xa80e68(_0xf4847[_0x28a3(0x3f)]);}else throw new Error(_0x28a3(0x40));}if(_0xf4847[_0x28a3(0x41)](_0x1cb8bd[_0x28a3(0x3c)]['length'],0x20)){if(_0xf4847[_0x28a3(0x42)](_0xf4847[_0x28a3(0x43)],_0xf4847[_0x28a3(0x44)]))throw new Error(_0xf4847['KxwcW']);else _0xb23ab2[_0x28a3(0x39)](_0xf4847[_0x28a3(0x45)],_0x427a87[_0x28a3(0x46)]);}const _0x5cd123=[_0xf4847[_0x28a3(0x47)],_0xf4847[_0x28a3(0x48)],_0xf4847[_0x28a3(0x49)]],_0x120a50=_0x5cd123[_0x28a3(0x4a)](_0x5c6fc4=>_0x1cb8bd[_0x28a3(0x3c)][_0x28a3(0x4b)](_0x5c6fc4));if(!_0x120a50)throw new Error(_0xf4847['ZLgdf']);globalConfig={'apiKey':_0x1cb8bd[_0x28a3(0x3c)],'environment':_0x1cb8bd['environment']||_0xf4847[_0x28a3(0x4c)],'enableLogging':_0xf4847[_0x28a3(0x4d)](_0x1cb8bd[_0x28a3(0x38)],![]),'timeout':_0x1cb8bd['timeout']||0x7530,'retryAttempts':_0x1cb8bd['retryAttempts']||0x3};globalConfig['enableLogging']&&console['log'](_0x28a3(0x4e),{'environment':globalConfig[_0x28a3(0x4f)],'timeout':globalConfig[_0x28a3(0x25)],'retryAttempts':globalConfig[_0x28a3(0x50)],'apiKeyPrefix':_0x1cb8bd[_0x28a3(0x3c)]['substring'](0x0,0x8)+_0x28a3(0x51),'enableLogging':globalConfig[_0x28a3(0x38)]});const _0x357c13=await validateApiKey(_0x1cb8bd[_0x28a3(0x3c)]);if(!_0x357c13[_0x28a3(0x52)]){const _0xe7b1bd=_0x357c13['error']||'',_0x55f69f=_0x357c13[_0x28a3(0x53)]||_0xe7b1bd[_0x28a3(0x54)](_0xf4847[_0x28a3(0x55)])||_0xe7b1bd[_0x28a3(0x54)](_0xf4847[_0x28a3(0x56)])||_0xe7b1bd[_0x28a3(0x54)](_0x28a3(0x57))||_0xe7b1bd['includes'](_0xf4847['WUSkz'])||_0xe7b1bd['includes'](_0xf4847[_0x28a3(0x58)])||_0xe7b1bd[_0x28a3(0x54)]('ENOTFOUND')||_0xe7b1bd[_0x28a3(0x54)](_0x28a3(0x8))||_0xe7b1bd['includes'](_0x28a3(0x59));if(_0x55f69f)console['warn'](_0xf4847[_0x28a3(0x5a)]),console[_0x28a3(0x5b)](_0xf4847[_0x28a3(0x5c)]),console['warn'](_0xf4847['kDCNl']),console['warn'](_0xf4847[_0x28a3(0x5d)],_0x357c13[_0x28a3(0x10)]),console[_0x28a3(0x39)](_0xf4847[_0x28a3(0x5e)]);else{if(_0xf4847['AJiah'](_0xf4847[_0x28a3(0x5f)],_0xf4847['GOOYH']))throw new Error(_0x28a3(0x60)+_0x357c13[_0x28a3(0x10)]);else throw new _0x4a8185(_0xf4847[_0x28a3(0x61)]);}}await loadJWT(),isInitialized=!![];if(globalConfig['enableLogging']){if(_0x28a3(0x2b)!==_0xf4847[_0x28a3(0x62)])throw new _0x2e0932(_0xf4847[_0x28a3(0x63)]);else{console[_0x28a3(0x39)](_0xf4847[_0x28a3(0x64)]),console['log'](_0xf4847[_0x28a3(0x65)]);userToken&&console[_0x28a3(0x39)](_0xf4847[_0x28a3(0x66)]);if(_0x357c13[_0x28a3(0x67)]){if(_0xf4847['rATtX'](_0x28a3(0x68),_0x28a3(0x69)))console[_0x28a3(0x39)](_0xf4847['fXfTx'],_0x357c13['permissions']);else{const _0x142638=_0x539c7b['split']('.');if(_0xf4847[_0x28a3(0x6a)](_0x142638[_0x28a3(0x6b)],0x3))return _0x56392f[_0x28a3(0x10)](_0xf4847[_0x28a3(0x6c)]),null;const _0x801e13=_0x142638[0x1],_0x100028=_0x801e13[_0x28a3(0x6d)](/-/g,'+')[_0x28a3(0x6d)](/_/g,'/'),_0xa40170=_0x100028[_0x28a3(0x6e)](_0x5b8558[_0x28a3(0x6f)](_0xf4847[_0x28a3(0x70)](_0x100028[_0x28a3(0x6b)],0x4))*0x4,'='),_0xd010c3=_0xf4847['rcHbU'](_0x1361fd,_0xa40170);return _0x13c0a6[_0x28a3(0x71)](_0xd010c3);}}_0x357c13[_0x28a3(0x46)]&&console['log'](_0xf4847['xyHMJ'],_0x357c13['rateLimits']);}}}}catch(_0x3402f4){console[_0x28a3(0x10)](_0xf4847[_0x28a3(0x72)],_0x3402f4),isInitialized=![];throw _0x3402f4;}};export const getApiKeyType=_0x3aca5=>{const _0x74b31={'yQxaO':_0x28a3(0x20),'Upivl':_0x28a3(0x73)};if(_0x3aca5['length']>=0x20&&(_0x3aca5[_0x28a3(0x4b)](_0x74b31[_0x28a3(0x74)])||_0x3aca5[_0x28a3(0x4b)](_0x28a3(0x21))||_0x3aca5[_0x28a3(0x4b)](_0x74b31[_0x28a3(0x75)])))return ApiKeyType[_0x28a3(0x0)];return ApiKeyType['INVALID'];};export const validateApiKey=async _0x22bae6=>{const _0x5dc6b9={'vhSBE':'👤\x20Extracted\x20user\x20data\x20from\x20JWT:','tlIWc':_0x28a3(0x76),'NYOkH':'⏱️\x20Request\x20timeout\x20for:','gHbge':_0x28a3(0x0),'MZIwb':_0x28a3(0x77),'jEWKA':_0x28a3(0x3),'WcHOX':_0x28a3(0x1),'vkXxh':_0x28a3(0x78),'iYqVa':function(_0x59a2d4,_0x282b34){return _0x59a2d4(_0x282b34);},'AsnpL':function(_0x1f0367,_0x432184){return _0x1f0367<_0x432184;},'CtQai':function(_0x2ff0bb,_0x2e32b7){return _0x2ff0bb-_0x2e32b7;},'Wnmbi':function(_0xb60732,_0x424ea4){return _0xb60732===_0x424ea4;},'gxNsN':_0x28a3(0x79),'kiEXw':_0x28a3(0x7a),'mpTbg':function(_0x453544){return _0x453544();},'RvOeM':_0x28a3(0x7b),'eNQPK':_0x28a3(0x7c),'juEdE':function(_0x190259,_0x2cd868){return _0x190259===_0x2cd868;},'dKQFf':'production','rwcow':function(_0x2b5a76,_0x10dcaf){return _0x2b5a76<=_0x10dcaf;},'AJsUR':_0x28a3(0x7d),'XGAcB':function(_0x11a948,_0x5e9c7b){return _0x11a948!==_0x5e9c7b;},'rDFNU':_0x28a3(0x7e),'TlsEK':_0x28a3(0x7f),'iPBlm':function(_0x4963d0,_0x2ec643){return _0x4963d0(_0x2ec643);},'AVbhU':_0x28a3(0x80),'RdTVb':_0x28a3(0x81),'VxEmw':_0x28a3(0x82),'XzXXh':function(_0x462ce2,_0x16e11c){return _0x462ce2===_0x16e11c;},'sXIli':_0x28a3(0x83),'iLMtT':_0x28a3(0x17),'ZqNcv':_0x28a3(0x84),'bwubV':_0x28a3(0x85),'oUPOO':'❌\x20API\x20endpoint\x20returned\x20non-JSON\x20response:','dvYmE':function(_0x86e353,_0x53bd09){return _0x86e353||_0x53bd09;},'XfttG':_0x28a3(0x86),'HwJyA':function(_0x46a1a4,_0x2cc792){return _0x46a1a4===_0x2cc792;},'iXVXr':function(_0x15a177,_0x539e7d){return _0x15a177===_0x539e7d;},'TdJao':_0x28a3(0x87),'RGZLE':_0x28a3(0x88),'pRVVb':function(_0x419379,_0x2139e3){return _0x419379===_0x2139e3;},'Oegca':_0x28a3(0x89),'mirSb':function(_0x55c2c7,_0x35a235){return _0x55c2c7||_0x35a235;},'asKkU':'unknown\x20content\x20type','fSNLb':function(_0x12305d,_0x2cbca5){return _0x12305d===_0x2cbca5;},'rhUMf':_0x28a3(0x8a),'LOLlS':function(_0x4a4d0c,_0x38b876){return _0x4a4d0c!==_0x38b876;},'rNdzl':function(_0x54330e,_0xfc6fb5){return _0x54330e!==_0xfc6fb5;},'TjJFE':'QJsKn','yJous':_0x28a3(0x8b),'yTIcR':'✅\x20API\x20key\x20validation\x20successful','GUPhE':function(_0x2d6c6d,_0x40b058){return _0x2d6c6d===_0x40b058;},'UvyCz':function(_0x416e10,_0x5eeb31){return _0x416e10===_0x5eeb31;},'xzVTq':function(_0x14053e,_0x255bff){return _0x14053e===_0x255bff;},'bvaAy':function(_0x1eab89,_0x1a11f3){return _0x1eab89===_0x1a11f3;},'Zmrda':function(_0x4a687e,_0x172041){return _0x4a687e<_0x172041;},'nwJJw':function(_0x3b43b0,_0x50ccd0){return _0x3b43b0!==_0x50ccd0;},'OhTMF':_0x28a3(0x8c),'DEmeK':'rCvrH','NOzvQ':'⏱️\x20API\x20key\x20validation\x20timeout','sCGlg':_0x28a3(0x57),'yOQgs':'Unexpected\x20character','YKAHy':'Network\x20request\x20failed','iOhHX':_0x28a3(0x8),'RQaAI':_0x28a3(0x8d),'MjewY':'TISff','xPiHL':_0x28a3(0x8e),'qGBaO':function(_0x5d1929,_0x23f366){return _0x5d1929<_0x23f366;},'EIYMI':function(_0xa1da8a,_0x103ef8){return _0xa1da8a*_0x103ef8;},'GZtPA':function(_0x3dab23,_0xd77690){return _0x3dab23-_0xd77690;},'ZtRxL':function(_0x49c764,_0x5f3a8e){return _0x49c764!==_0x5f3a8e;},'emJjX':_0x28a3(0x8f),'kJTqh':'❌\x20API\x20key\x20validation\x20error:'};try{var _0x2f1a86,_0x46987e,_0x463450;console[_0x28a3(0x39)](_0x5dc6b9['vkXxh']);const _0x1d71ae=_0x5dc6b9[_0x28a3(0x90)](getApiKeyType,_0x22bae6);if(_0x1d71ae===ApiKeyType[_0x28a3(0x3)])return{'isValid':![],'error':_0x28a3(0x91),'keyType':ApiKeyType[_0x28a3(0x3)]};const _0x51e247=validationCache['get'](_0x22bae6);if(_0x51e247&&_0x5dc6b9['AsnpL'](_0x5dc6b9['CtQai'](Date[_0x28a3(0x92)](),_0x51e247[_0x28a3(0x93)]),CACHE_DURATION)){var _0x4c2bb7;return(_0x4c2bb7=globalConfig)!==null&&_0x4c2bb7!==void 0x0&&_0x4c2bb7[_0x28a3(0x38)]&&(_0x5dc6b9[_0x28a3(0x94)](_0x5dc6b9[_0x28a3(0x95)],_0x28a3(0x96))?_0x144114['log'](_0x5dc6b9[_0x28a3(0x97)],_0x514646):console[_0x28a3(0x39)](_0x5dc6b9[_0x28a3(0x98)])),_0x51e247[_0x28a3(0x99)];}const _0x37c0b4=await _0x5dc6b9['mpTbg'](checkNetworkConnectivity);if(!_0x37c0b4)return console[_0x28a3(0x5b)](_0x5dc6b9['RvOeM']),{'isValid':![],'error':_0x5dc6b9[_0x28a3(0x9a)],'keyType':_0x1d71ae,'isNetworkError':!![]};const _0x1efd73=((_0x2f1a86=globalConfig)===null||_0x5dc6b9[_0x28a3(0x9b)](_0x2f1a86,void 0x0)?void 0x0:_0x2f1a86[_0x28a3(0x4f)])||_0x5dc6b9['dKQFf'],_0x1d8734=API_ENDPOINTS[_0x1efd73],_0x5143e1=(_0x5dc6b9[_0x28a3(0x9b)](_0x46987e=globalConfig,null)||_0x46987e===void 0x0?void 0x0:_0x46987e[_0x28a3(0x25)])||0x7530,_0x34542a=(_0x5dc6b9['Wnmbi'](_0x463450=globalConfig,null)||_0x5dc6b9[_0x28a3(0x9b)](_0x463450,void 0x0)?void 0x0:_0x463450[_0x28a3(0x50)])||0x3;for(let _0x1ebfe7=0x1;_0x5dc6b9[_0x28a3(0x9c)](_0x1ebfe7,_0x34542a);_0x1ebfe7++){if(_0x5dc6b9[_0x28a3(0x94)](_0x5dc6b9['AJsUR'],'rSEpi')){const _0x251a4a=new AbortController(),_0xc49f0a=setTimeout(()=>_0x251a4a[_0x28a3(0x9d)](),_0x5143e1);try{var _0x15b54c;(_0x15b54c=globalConfig)!==null&&_0x5dc6b9[_0x28a3(0x9e)](_0x15b54c,void 0x0)&&_0x15b54c[_0x28a3(0x38)]&&_0x1ebfe7>0x1&&console[_0x28a3(0x39)](_0x28a3(0x9f)+_0x1ebfe7+'/'+_0x34542a+_0x28a3(0xa0));const _0x3264d7=await fetch(_0x1d8734+'/dev/validate-apikey',{'method':'POST','headers':{'Content-Type':'application/json','Authorization':_0x28a3(0xa1)+_0x22bae6,'User-Agent':_0x5dc6b9[_0x28a3(0xa2)],'X-API-Key-Type':_0x1d71ae,'X-SDK-Platform':'react-native','X-Retry-Attempt':_0x1ebfe7['toString']()},'body':JSON['stringify']({'environment':_0x1efd73,'sdk_version':_0x5dc6b9['TlsEK'],'platform':'react-native','keyType':_0x1d71ae,'timestamp':new Date()['toISOString'](),'attempt':_0x1ebfe7}),'signal':_0x251a4a[_0x28a3(0xa3)]});_0x5dc6b9[_0x28a3(0xa4)](clearTimeout,_0xc49f0a);if(!_0x3264d7){if(_0x5dc6b9['AVbhU']!==_0x5dc6b9[_0x28a3(0xa5)])throw new Error(_0x5dc6b9[_0x28a3(0xa6)]);else throw new _0x262b79(_0x28a3(0x82));}if(_0x5dc6b9['XzXXh'](_0x3264d7[_0x28a3(0xa7)],0x1f6))throw new Error(_0x5dc6b9[_0x28a3(0xa8)]);if(_0x5dc6b9['juEdE'](_0x3264d7[_0x28a3(0xa7)],0x1f7))throw new Error(_0x5dc6b9[_0x28a3(0xa9)]);if(_0x5dc6b9[_0x28a3(0xaa)](_0x3264d7[_0x28a3(0xa7)],0x1f8))throw new Error(_0x5dc6b9[_0x28a3(0xab)]);const _0x2f56e3=_0x3264d7[_0x28a3(0xac)][_0x28a3(0xad)](_0x5dc6b9[_0x28a3(0xae)]),_0x264721=_0x2f56e3&&_0x2f56e3['includes']('application/json');if(!_0x264721){const _0x1eab73=await _0x3264d7[_0x28a3(0xaf)](),_0xab0ce3=_0x1eab73[_0x28a3(0xb0)](0x0,0xc8);console[_0x28a3(0x10)](_0x5dc6b9['oUPOO'],{'status':_0x3264d7[_0x28a3(0xa7)],'statusText':_0x3264d7[_0x28a3(0xb1)],'contentType':_0x5dc6b9[_0x28a3(0xb2)](_0x2f56e3,_0x5dc6b9[_0x28a3(0xb3)]),'preview':_0xab0ce3,'url':_0x1d8734+'/dev/validate-apikey','attempt':_0x1ebfe7});if(_0x5dc6b9[_0x28a3(0xaa)](_0x3264d7[_0x28a3(0xa7)],0x194))throw new Error(_0x28a3(0xb4)+_0x1d8734+'/dev/validate-apikey\x20may\x20not\x20exist\x20or\x20be\x20configured\x20correctly.');else{if(_0x5dc6b9[_0x28a3(0xb5)](_0x3264d7[_0x28a3(0xa7)],0x1f4))throw new Error(_0x28a3(0xb6));else{if(_0x5dc6b9[_0x28a3(0xb5)](_0x3264d7[_0x28a3(0xa7)],0x1f6)||_0x5dc6b9[_0x28a3(0xb7)](_0x3264d7[_0x28a3(0xa7)],0x1f7))throw new Error('Service\x20unavailable\x20('+_0x3264d7[_0x28a3(0xa7)]+_0x28a3(0xb8));else{if(_0x1eab73[_0x28a3(0x54)](_0x5dc6b9['TdJao'])||_0x1eab73[_0x28a3(0x54)](_0x5dc6b9[_0x28a3(0xb9)])){if(_0x5dc6b9[_0x28a3(0xba)](_0x5dc6b9[_0x28a3(0xbb)],_0x28a3(0xbc)))_0x442741[_0x28a3(0x39)](_0x28a3(0xbd)+_0x23b650['status']+_0x28a3(0xbe)+_0x1f4465);else throw new Error(_0x28a3(0xbf));}else throw new Error(_0x28a3(0xc0)+_0x3264d7[_0x28a3(0xa7)]+'\x20-\x20'+_0x3264d7['statusText']+_0x28a3(0xc1)+_0x5dc6b9[_0x28a3(0xc2)](_0x2f56e3,_0x5dc6b9[_0x28a3(0xc3)])+'.');}}}}let _0x46be8e;try{if(_0x5dc6b9[_0x28a3(0xb5)](_0x28a3(0xc4),_0x28a3(0xc4)))_0x46be8e=await _0x3264d7[_0x28a3(0xc5)]();else return{'isValid':![],'error':_0x495e4b,'keyType':_0x39aaa2,'isNetworkError':!![]};}catch(_0x24343f){console[_0x28a3(0x10)]('❌\x20Failed\x20to\x20parse\x20JSON\x20response:',{'error':_0x24343f[_0x28a3(0xc6)],'status':_0x3264d7[_0x28a3(0xa7)],'contentType':_0x2f56e3,'attempt':_0x1ebfe7});throw new Error('Failed\x20to\x20parse\x20server\x20response\x20as\x20JSON:\x20'+_0x24343f['message']);}if(_0x3264d7['ok']&&(_0x46be8e['success']||_0x46be8e['valid'])){if(_0x5dc6b9[_0x28a3(0xc7)](_0x5dc6b9['rhUMf'],_0x5dc6b9[_0x28a3(0xc8)])){var _0x5e46e1;const _0x214d5a={'isValid':!![],'permissions':_0x46be8e[_0x28a3(0x67)]||[],'rateLimits':_0x46be8e[_0x28a3(0x46)]||null,'keyType':_0x1d71ae};validationCache[_0x28a3(0xc9)](_0x22bae6,{'result':_0x214d5a,'timestamp':Date[_0x28a3(0x92)]()});if(_0x5dc6b9[_0x28a3(0xca)](_0x5e46e1=globalConfig,null)&&_0x5dc6b9[_0x28a3(0xcb)](_0x5e46e1,void 0x0)&&_0x5e46e1[_0x28a3(0x38)]){if(_0x5dc6b9['TjJFE']!==_0x5dc6b9[_0x28a3(0xcc)]){var _0x44931a,_0x79f133,_0x132e7f;console[_0x28a3(0x39)](_0x5dc6b9['yTIcR'],{'apiKeyId':_0x5dc6b9[_0x28a3(0xcd)](_0x44931a=_0x46be8e[_0x28a3(0x3c)],null)||_0x5dc6b9[_0x28a3(0xce)](_0x44931a,void 0x0)?void 0x0:_0x44931a['id'],'appName':_0x5dc6b9[_0x28a3(0xcf)](_0x79f133=_0x46be8e[_0x28a3(0xd0)],null)||_0x5dc6b9[_0x28a3(0xb5)](_0x79f133,void 0x0)?void 0x0:_0x79f133[_0x28a3(0xd1)],'usageCount':(_0x132e7f=_0x46be8e['apiKey'])===null||_0x5dc6b9['bvaAy'](_0x132e7f,void 0x0)?void 0x0:_0x132e7f['usageCount']});}else{_0x476a8c(_0x3e44f4);if(_0x197f7f['name']===_0x5dc6b9[_0x28a3(0xd2)]){_0x24c018[_0x28a3(0x10)](_0x5dc6b9[_0x28a3(0xd3)],_0x4e94c0);throw new _0x450cb4(_0x28a3(0x16));}throw _0x51978d;}}return _0x214d5a;}else _0x920047[_0x28a3(0x39)](_0x28a3(0xd4)+_0x2af37d);}else{const _0x479d5e=_0x46be8e[_0x28a3(0x10)]||_0x46be8e[_0x28a3(0xc6)]||_0x28a3(0xd5)+_0x3264d7[_0x28a3(0xa7)]+':\x20'+_0x3264d7[_0x28a3(0xb1)],_0x181dde={'isValid':![],'error':_0x479d5e,'keyType':_0x1d71ae};if(_0x3264d7['status']>=0x190&&_0x5dc6b9[_0x28a3(0xd6)](_0x3264d7[_0x28a3(0xa7)],0x1f4)){var _0x5e2fc4;if(_0x5dc6b9[_0x28a3(0xcb)](_0x5e2fc4=globalConfig,null)&&_0x5dc6b9['nwJJw'](_0x5e2fc4,void 0x0)&&_0x5e2fc4['enableLogging']){if(_0x5dc6b9[_0x28a3(0xd7)]===_0x5dc6b9[_0x28a3(0xd7)])console[_0x28a3(0x10)](_0x28a3(0xd8),_0x479d5e);else return{'isValid':![],'error':_0x1a00f8,'keyType':_0x16f8de};}return _0x181dde;}throw new Error(_0x479d5e);}}catch(_0x6efa3a){var _0x44100d;_0x5dc6b9[_0x28a3(0xa4)](clearTimeout,_0xc49f0a);if(_0x6efa3a[_0x28a3(0xd1)]===_0x5dc6b9['tlIWc']){if(_0x5dc6b9[_0x28a3(0x9e)](_0x5dc6b9[_0x28a3(0xd9)],_0x28a3(0xda))){const _0x471e29=_0x28a3(0xdb)+_0x5143e1+_0x28a3(0xdc);console[_0x28a3(0x10)](_0x5dc6b9[_0x28a3(0xdd)]);if(_0x5dc6b9[_0x28a3(0xc7)](_0x1ebfe7,_0x34542a))return{'isValid':![],'error':_0x471e29,'keyType':_0x1d71ae};continue;}else throw new _0x3a66ea(_0x28a3(0xb4)+_0x5df340+'/dev/validate-apikey\x20may\x20not\x20exist\x20or\x20be\x20configured\x20correctly.');}let _0x1f4aff=_0x28a3(0xde)+_0x6efa3a[_0x28a3(0xc6)];if(_0x6efa3a[_0x28a3(0xc6)][_0x28a3(0x54)](_0x5dc6b9[_0x28a3(0xdf)])||_0x6efa3a[_0x28a3(0xc6)][_0x28a3(0x54)](_0x5dc6b9[_0x28a3(0xe0)]))_0x1f4aff='Server\x20returned\x20invalid\x20JSON\x20response.\x20This\x20usually\x20indicates\x20the\x20API\x20endpoint\x20returned\x20HTML\x20instead\x20of\x20JSON\x20(often\x20a\x20404\x20or\x20server\x20error\x20page).\x20'+_0x6efa3a[_0x28a3(0xc6)];else{if(_0x6efa3a[_0x28a3(0xc6)][_0x28a3(0x54)](_0x5dc6b9[_0x28a3(0xe1)])||_0x6efa3a[_0x28a3(0xc6)]['includes'](_0x5dc6b9[_0x28a3(0xe2)]))_0x1f4aff=_0x28a3(0xe3)+_0x6efa3a[_0x28a3(0xc6)];else{if(_0x6efa3a['message'][_0x28a3(0x54)]('DNS')||_0x6efa3a[_0x28a3(0xc6)][_0x28a3(0x54)](_0x5dc6b9['RQaAI'])){if(_0x5dc6b9['XGAcB'](_0x5dc6b9['MjewY'],_0x5dc6b9[_0x28a3(0xe4)]))return _0x58d600[_0x5dc6b9[_0x28a3(0xe5)]]=_0x5dc6b9[_0x28a3(0xe6)],_0x1a6009[_0x5dc6b9['jEWKA']]=_0x5dc6b9[_0x28a3(0xe7)],_0x22c0e5;else _0x1f4aff='DNS\x20resolution\x20failed\x20for\x20'+_0x1d8734+_0x28a3(0xe8)+_0x6efa3a['message'];}}}console[_0x28a3(0x10)](_0x5dc6b9[_0x28a3(0xe9)],{'error':_0x6efa3a,'endpoint':_0x1d8734+_0x28a3(0xea),'attempt':_0x1ebfe7,'maxRetries':_0x34542a,'retryable':_0x5dc6b9['qGBaO'](_0x1ebfe7,_0x34542a)});if(_0x1ebfe7===_0x34542a)return{'isValid':![],'error':_0x1f4aff,'keyType':_0x1d71ae,'isNetworkError':!![]};const _0x5aa7f6=Math[_0x28a3(0xeb)](_0x5dc6b9[_0x28a3(0xec)](0x3e8,Math[_0x28a3(0xed)](0x2,_0x5dc6b9[_0x28a3(0xee)](_0x1ebfe7,0x1))),0x1388);_0x5dc6b9[_0x28a3(0xef)](_0x44100d=globalConfig,null)&&_0x5dc6b9[_0x28a3(0xf0)](_0x44100d,void 0x0)&&_0x44100d[_0x28a3(0x38)]&&console[_0x28a3(0x39)](_0x28a3(0xf1)+_0x5aa7f6+_0x28a3(0xf2)),await new Promise(_0x56dffe=>setTimeout(()=>_0x56dffe(),_0x5aa7f6));}}else _0x1e1072=_0x28a3(0xf3)+_0x4c3251+_0x28a3(0xe8)+_0x597f81[_0x28a3(0xc6)];}return{'isValid':![],'error':_0x5dc6b9[_0x28a3(0xf4)],'keyType':_0x1d71ae};}catch(_0x580d73){const _0x55f84e=_0x28a3(0xf5)+_0x580d73[_0x28a3(0xc6)];return console[_0x28a3(0x10)](_0x5dc6b9[_0x28a3(0xf6)],_0x580d73),{'isValid':![],'error':_0x55f84e,'keyType':ApiKeyType[_0x28a3(0x3)]};}};export const getApiConfig=()=>{return globalConfig;};export const getApiKey=()=>{const _0x19646a={'uVapf':function(_0x40649f,_0x23437c){return _0x40649f===_0x23437c;}};var _0x571823;return(_0x19646a[_0x28a3(0xf7)](_0x571823=globalConfig,null)||_0x19646a['uVapf'](_0x571823,void 0x0)?void 0x0:_0x571823[_0x28a3(0x3c)])||null;};export const isApiKeyInitialized=()=>{return isInitialized&&globalConfig!==null;};function _0x28a3(_0x10475a,_0x28a358){_0x10475a=_0x10475a-0x0;const _0x4953e5=_0x1047();let _0x36caea=_0x4953e5[_0x10475a];return _0x36caea;}export const storeJWT=async _0x552b28=>{const _0x5b84f9={'AgZep':function(_0x815a1a,_0x278ec8){return _0x815a1a!==_0x278ec8;},'FZkjh':_0x28a3(0xf8),'jQzqt':_0x28a3(0xf9)};try{var _0x324c8f;await AsyncStorage['setItem'](JWT_TOKEN_KEY,_0x552b28),userToken=_0x552b28,(_0x324c8f=globalConfig)!==null&&_0x5b84f9[_0x28a3(0xfa)](_0x324c8f,void 0x0)&&_0x324c8f[_0x28a3(0x38)]&&console['log'](_0x5b84f9[_0x28a3(0xfb)]);}catch(_0x33f574){console[_0x28a3(0x10)](_0x5b84f9[_0x28a3(0xfc)],_0x33f574);throw _0x33f574;}};export const loadJWT=async()=>{const _0x3287e2={'QesKd':_0x28a3(0xfd),'VGfiE':_0x28a3(0x26),'kkliU':_0x28a3(0x29),'glYPm':_0x28a3(0x28),'yWhmM':_0x28a3(0xfe),'fZpan':_0x28a3(0x27),'pUKVy':function(_0x5797b4,_0xfb4948){return _0x5797b4!==_0xfb4948;},'fJgYT':'Jmuvu','XgLvU':_0x28a3(0xff)};try{const _0x1ec424=await AsyncStorage['getItem'](JWT_TOKEN_KEY);return userToken=_0x1ec424,_0x1ec424;}catch(_0x42aa1c){if(_0x3287e2[_0x28a3(0x100)](_0x28a3(0x101),_0x3287e2['fJgYT']))return console['error'](_0x3287e2[_0x28a3(0x102)],_0x42aa1c),null;else{const _0x2ffde2=_0x3287e2[_0x28a3(0x103)][_0x28a3(0x104)]('|');let _0x27331b=0x0;while(!![]){switch(_0x2ffde2[_0x27331b++]){case'0':_0x21603c[_0x28a3(0x5b)](_0x3287e2[_0x28a3(0x105)]);continue;case'1':_0x17611c[_0x28a3(0x39)](_0x3287e2[_0x28a3(0x106)]);continue;case'2':_0x225578['warn'](_0x3287e2[_0x28a3(0x107)],_0x3399a2[_0x28a3(0x10)]);continue;case'3':_0x47eaad[_0x28a3(0x5b)](_0x3287e2['yWhmM']);continue;case'4':_0x2353b8[_0x28a3(0x5b)](_0x3287e2[_0x28a3(0x108)]);continue;}break;}}}};export const getJWT=()=>{return userToken;};export const clearJWT=async()=>{const _0x58c3b5={'xFxnF':function(_0x936b1c,_0x4090f8){return _0x936b1c===_0x4090f8;},'zmTwM':_0x28a3(0x109),'HKEkC':_0x28a3(0x10a),'rGMRM':function(_0x1a9166,_0x5a612f){return _0x1a9166!==_0x5a612f;},'xIKSX':function(_0x15fa1e,_0xed82f0){return _0x15fa1e!==_0xed82f0;},'loCZL':'🗑️\x20JWT\x20token\x20cleared'};try{if(_0x58c3b5['xFxnF'](_0x58c3b5[_0x28a3(0x10b)],_0x58c3b5[_0x28a3(0x10c)]))_0x2b4894[_0x28a3(0x39)](_0x28a3(0x10d)+_0x52024a[_0x28a3(0xa7)]+_0x28a3(0xbe)+_0x464985);else{var _0x109cc4;await AsyncStorage[_0x28a3(0x10e)](JWT_TOKEN_KEY),userToken=null,_0x58c3b5[_0x28a3(0x10f)](_0x109cc4=globalConfig,null)&&_0x58c3b5[_0x28a3(0x110)](_0x109cc4,void 0x0)&&_0x109cc4['enableLogging']&&console[_0x28a3(0x39)](_0x58c3b5[_0x28a3(0x111)]);}}catch(_0x17cf92){console[_0x28a3(0x10)](_0x28a3(0x112),_0x17cf92);}};const base64Decode=_0x27ec4e=>{const _0x2fc5fb={'nfoAd':function(_0x548b50,_0x142e47){return _0x548b50<_0x142e47;},'doHGM':function(_0x4cb190,_0x47366f){return _0x4cb190|_0x47366f;},'VxHrX':function(_0x589606,_0x4597c6){return _0x589606<<_0x4597c6;},'ChQWH':function(_0x32c66e,_0x524a72){return _0x32c66e<<_0x524a72;},'dpuOb':function(_0x4fbbae,_0x24f962){return _0x4fbbae>>_0x24f962;},'UMFGj':function(_0x3ab26d,_0x5ac5c4){return _0x3ab26d!==_0x5ac5c4;},'OCrDC':function(_0x505011,_0x312133){return _0x505011&_0x312133;},'hOswV':function(_0x5f0f36,_0x5549ac){return _0x5f0f36>>_0x5549ac;},'POpYv':function(_0x4bed8e,_0x5e23b9){return _0x4bed8e&_0x5e23b9;}},_0x24fc47=_0x28a3(0x113);let _0x5f3070='',_0x58cd0b=0x0;_0x27ec4e=_0x27ec4e['replace'](/[^A-Za-z0-9+/]/g,'');while(_0x2fc5fb['nfoAd'](_0x58cd0b,_0x27ec4e[_0x28a3(0x6b)])){const _0x1ed687=_0x24fc47[_0x28a3(0x114)](_0x27ec4e[_0x28a3(0x115)](_0x58cd0b++)),_0x350e55=_0x24fc47[_0x28a3(0x114)](_0x27ec4e['charAt'](_0x58cd0b++)),_0xbd5a4f=_0x24fc47[_0x28a3(0x114)](_0x27ec4e[_0x28a3(0x115)](_0x58cd0b++)),_0x5ebbef=_0x24fc47['indexOf'](_0x27ec4e[_0x28a3(0x115)](_0x58cd0b++)),_0x440a3a=_0x2fc5fb[_0x28a3(0x116)](_0x2fc5fb[_0x28a3(0x116)](_0x2fc5fb[_0x28a3(0x117)](_0x1ed687,0x12),_0x2fc5fb[_0x28a3(0x117)](_0x350e55,0xc))|_0x2fc5fb['ChQWH'](_0xbd5a4f,0x6),_0x5ebbef);_0x5f3070+=String[_0x28a3(0x118)](_0x2fc5fb['dpuOb'](_0x440a3a,0x10)&0xff);if(_0x2fc5fb[_0x28a3(0x119)](_0xbd5a4f,0x40))_0x5f3070+=String[_0x28a3(0x118)](_0x2fc5fb[_0x28a3(0x11a)](_0x2fc5fb[_0x28a3(0x11b)](_0x440a3a,0x8),0xff));if(_0x5ebbef!==0x40)_0x5f3070+=String[_0x28a3(0x118)](_0x2fc5fb[_0x28a3(0x11c)](_0x440a3a,0xff));}return _0x5f3070;};export const decodeJWTPayload=_0x25ba65=>{const _0x208d28={'lYFHO':_0x28a3(0x1f),'EgcOd':'❌\x20Failed\x20to\x20extract\x20username\x20from\x20JWT:','ufYjS':function(_0x460c7f,_0x207a92){return _0x460c7f!==_0x207a92;},'uYomy':_0x28a3(0x11d),'aWMTl':function(_0x2d76aa,_0x42fb4c){return _0x2d76aa!==_0x42fb4c;},'BZYDl':function(_0x1c8385,_0xa6fc6c){return _0x1c8385===_0xa6fc6c;},'VuyXi':_0x28a3(0x11e),'ZgZua':_0x28a3(0x18),'WxoAF':function(_0x24e87f,_0x25fa64){return _0x24e87f*_0x25fa64;},'TFXch':function(_0x202c49,_0x4b314e){return _0x202c49/_0x4b314e;},'KsUqh':_0x28a3(0x11f)};try{if(_0x208d28[_0x28a3(0x120)](_0x208d28[_0x28a3(0x121)],_0x208d28['uYomy']))throw new _0x1c49cf(_0x208d28[_0x28a3(0x122)]);else{const _0x37b75f=_0x25ba65[_0x28a3(0x104)]('.');if(_0x208d28[_0x28a3(0x123)](_0x37b75f[_0x28a3(0x6b)],0x3))return _0x208d28[_0x28a3(0x124)](_0x208d28[_0x28a3(0x125)],_0x28a3(0x126))?(_0x3d3d87['error'](_0x208d28[_0x28a3(0x127)],_0x254dc3),null):(console[_0x28a3(0x10)](_0x208d28[_0x28a3(0x128)]),null);const _0x69fb6f=_0x37b75f[0x1],_0x54baca=_0x69fb6f[_0x28a3(0x6d)](/-/g,'+')['replace'](/_/g,'/'),_0x3ef8b3=_0x54baca['padEnd'](_0x208d28[_0x28a3(0x129)](Math[_0x28a3(0x6f)](_0x208d28['TFXch'](_0x54baca['length'],0x4)),0x4),'='),_0x5bfb51=base64Decode(_0x3ef8b3);return JSON[_0x28a3(0x71)](_0x5bfb51);}}catch(_0x2493e1){return console['error'](_0x208d28[_0x28a3(0x12a)],_0x2493e1),null;}};export const extractUsernameFromJWT=_0x39ab23=>{const _0x346b4f={'lbPon':_0x28a3(0x40),'TbvLj':_0x28a3(0x12b),'HfLvu':function(_0x377569,_0x38d53e){return _0x377569||_0x38d53e;},'nzZLZ':function(_0x2944d5,_0xf60612){return _0x2944d5===_0xf60612;},'ajUiS':_0x28a3(0x12c),'fnOHt':_0x28a3(0x12d),'dqAIv':function(_0x401b5f,_0x3c1b72){return _0x401b5f!==_0x3c1b72;},'NcnEf':function(_0x440e51,_0x4a2b98){return _0x440e51!==_0x4a2b98;},'kThCs':function(_0x184189,_0x5eac37){return _0x184189===_0x5eac37;},'lHEiD':_0x28a3(0x12e),'qepjt':_0x28a3(0x12f),'ruDXC':_0x28a3(0x130),'HvRNz':function(_0x3f993e,_0x364bd6){return _0x3f993e||_0x364bd6;},'KbNbm':_0x28a3(0x131),'lkGjX':_0x28a3(0x132),'WGxSQ':'❌\x20Failed\x20to\x20extract\x20username\x20from\x20JWT:'};try{var _0x5e050f;const _0x39de4c=_0x346b4f[_0x28a3(0x133)](_0x39ab23,userToken);if(!_0x39de4c)return console[_0x28a3(0x5b)](_0x346b4f[_0x28a3(0x134)]),null;const _0x447293=decodeJWTPayload(_0x39de4c);if(!_0x447293){if(_0x346b4f['nzZLZ'](_0x346b4f[_0x28a3(0x135)],_0x346b4f['fnOHt']))throw new _0x2abacb(_0x346b4f['lbPon']);else return null;}const _0xe6ba35=_0x447293[_0x28a3(0x136)]||_0x447293['username']||_0x447293[_0x28a3(0x32)]||_0x447293[_0x28a3(0x31)];if(_0x346b4f[_0x28a3(0x137)](_0x5e050f=globalConfig,null)&&_0x346b4f[_0x28a3(0x138)](_0x5e050f,void 0x0)&&_0x5e050f[_0x28a3(0x38)]){if(_0x346b4f[_0x28a3(0x139)](_0x346b4f['lHEiD'],_0x346b4f[_0x28a3(0x13a)]))throw new _0x282d96(_0x28a3(0xb6));else console[_0x28a3(0x39)](_0x346b4f[_0x28a3(0x13b)],_0xe6ba35);}return _0x346b4f[_0x28a3(0x13c)](_0xe6ba35,null);}catch(_0x1a9b02){return _0x346b4f[_0x28a3(0x138)](_0x346b4f[_0x28a3(0x13d)],_0x346b4f['lkGjX'])?(console[_0x28a3(0x10)](_0x346b4f[_0x28a3(0x13e)],_0x1a9b02),null):(_0x867f70[_0x28a3(0x5b)](_0x346b4f[_0x28a3(0x134)]),null);}};export const extractUserDataFromJWT=_0x39a2b1=>{const _0x53c15e={'vUqLW':_0x28a3(0x13f),'kUTbH':function(_0x17e7b8,_0x20dea5){return _0x17e7b8===_0x20dea5;},'DzzrF':function(_0xe2b9c,_0xab153c){return _0xe2b9c===_0xab153c;},'gpShc':function(_0x5e8fdb,_0x2742e5){return _0x5e8fdb||_0x2742e5;},'skdEd':function(_0x751fc6,_0x202a0c){return _0x751fc6!==_0x202a0c;},'qWuJJ':_0x28a3(0x140),'gKdSq':function(_0xd0e111,_0x4ee8fa){return _0xd0e111===_0x4ee8fa;},'iRYtj':_0x28a3(0x141),'cNxyf':'hxomS','HrDNt':'👤\x20Extracted\x20user\x20data\x20from\x20JWT:','hOgzo':_0x28a3(0x142)};try{var _0x320e17;const _0xc62dbb=_0x53c15e[_0x28a3(0x143)](_0x39a2b1,userToken);if(!_0xc62dbb)return _0x53c15e[_0x28a3(0x144)](_0x28a3(0x145),_0x53c15e['qWuJJ'])?(console['warn'](_0x28a3(0x30)),null):(_0x1dbd61[_0x28a3(0x5b)](_0x28a3(0x30)),null);const _0x131295=decodeJWTPayload(_0xc62dbb);if(!_0x131295)return null;const _0x1b9a4d={'id':_0x131295['id'],'email':_0x131295['email'],'userId':_0x131295[_0x28a3(0x32)],'userName':_0x131295[_0x28a3(0x136)]||_0x131295[_0x28a3(0x33)],'verified':_0x131295['verified'],'iat':_0x131295['iat'],'exp':_0x131295[_0x28a3(0x36)]};if(_0x53c15e[_0x28a3(0x144)](_0x320e17=globalConfig,null)&&_0x320e17!==void 0x0&&_0x320e17[_0x28a3(0x38)]){if(_0x53c15e[_0x28a3(0x146)](_0x53c15e[_0x28a3(0x147)],_0x53c15e[_0x28a3(0x148)])){var _0x5cf04a,_0x47c626,_0x4ed095;_0xa566f[_0x28a3(0x39)](_0x53c15e['vUqLW'],{'apiKeyId':(_0x5cf04a=_0x58b45c[_0x28a3(0x3c)])===null||_0x53c15e[_0x28a3(0x149)](_0x5cf04a,void 0x0)?void 0x0:_0x5cf04a['id'],'appName':(_0x47c626=_0x773c92['application'])===null||_0x53c15e[_0x28a3(0x149)](_0x47c626,void 0x0)?void 0x0:_0x47c626[_0x28a3(0xd1)],'usageCount':_0x53c15e['kUTbH'](_0x4ed095=_0x372095[_0x28a3(0x3c)],null)||_0x53c15e[_0x28a3(0x14a)](_0x4ed095,void 0x0)?void 0x0:_0x4ed095[_0x28a3(0x14b)]});}else console[_0x28a3(0x39)](_0x53c15e[_0x28a3(0x14c)],_0x1b9a4d);}return _0x1b9a4d;}catch(_0x2d38cb){return console[_0x28a3(0x10)](_0x53c15e[_0x28a3(0x14d)],_0x2d38cb),null;}};function _0x1047(){const _0x390d95=['DEVELOPER','invalid','BpIlN','INVALID','onairos_jwt_token','oIBSN','ggEuC','⚠️\x20Failed\x20to\x20check\x20network\x20connectivity:','fetch','XtZsY','isConnected','SoDuN','isInternetReachable','NIeij','RxBma','Wivig','error','❌\x20Developer\x20API\x20key\x20authentication\x20failed','cXCpa','BASE_URL','👤\x20Extracted\x20user\x20data\x20from\x20JWT:','⏱️\x20Request\x20timeout\x20for:','Request\x20timeout','Onairos\x20API\x20is\x20under\x20maintenance\x20(503\x20Service\x20Unavailable).\x20Please\x20try\x20again\x20later.','❌\x20Invalid\x20JWT\x20token\x20format','NKVum','lrOWS','🔑\x20Initializing\x20Onairos\x20SDK\x20with\x20developer\x20API\x20key...','ZyqHC','LEMRF','dDLzt','Invalid\x20API\x20key\x20format.\x20Developer\x20keys\x20must\x20be\x20at\x20least\x2032\x20characters\x20long.','dev_','pk_','production','Network\x20request\x20failed','API\x20validation\x20endpoint\x20returned','timeout','🔄\x20Continuing\x20in\x20offline\x20mode\x20with\x20basic\x20validation','📝\x20SDK\x20will\x20function\x20with\x20limited\x20validation.\x20Network\x20connectivity\x20will\x20be\x20retried\x20automatically.','🌐\x20Error\x20details:','📱\x20SDK\x20initialized\x20in\x20offline\x20mode\x20-\x20will\x20retry\x20validation\x20when\x20network\x20is\x20available','PmHYt','IdEwC','✅\x20Onairos\x20SDK\x20initialized\x20successfully','🔑\x20Developer\x20API\x20key\x20ready\x20for\x20app-level\x20operations','🔐\x20API\x20Key\x20Permissions:','PAdRi','⚠️\x20No\x20JWT\x20token\x20available\x20for\x20user\x20data\x20extraction','email','userId','username','verified','iat','exp','Epguf','enableLogging','log','aBuYe','cNYYi','apiKey','DCgYw','SDBVx','GdVSd','Developer\x20API\x20key\x20is\x20required\x20for\x20SDK\x20initialization','SVLFI','XmaEJ','jHXRH','IHjOV','xyHMJ','rateLimits','sRepi','cPLUM','XFZDk','some','startsWith','PQdvH','VKQrc','📝\x20SDK\x20Configuration:','environment','retryAttempts','...','isValid','isNetworkError','includes','jNLAm','izSUy','JSON\x20Parse\x20error','DkFcO','No\x20network\x20connection','EVzIc','warn','MydVr','NKoKe','LAMWZ','CYSne','API\x20key\x20validation\x20failed:\x20','lgSxK','cDcrY','EWaOQ','PksOV','AZeTJ','NduEF','permissions','OPrVB','OLjyb','ITrjP','length','xLirV','replace','padEnd','ceil','qilWT','parse','qCltS','ona_','yQxaO','Upivl','AbortError','developer','🔍\x20Validating\x20developer\x20API\x20key\x20against\x20backend...','pvGjs','📋\x20Using\x20cached\x20API\x20key\x20validation\x20result','⚠️\x20No\x20network\x20connectivity\x20detected','No\x20network\x20connection\x20available.\x20Please\x20check\x20your\x20internet\x20connection\x20and\x20try\x20again.','rSEpi','OnairosReactNative/3.3.1','3.3.1','uhMFh','mNwDq','No\x20response\x20received\x20from\x20server','Onairos\x20API\x20is\x20temporarily\x20unavailable\x20(502\x20Bad\x20Gateway).\x20Please\x20try\x20again\x20later.','Onairos\x20API\x20request\x20timed\x20out\x20(504\x20Gateway\x20Timeout).\x20Please\x20try\x20again.','content-type','unknown','<html','<!DOCTYPE','PxouK','aerNR','JZvWj','iwTxm','ENOTFOUND','🌐\x20Network\x20error\x20during\x20API\x20key\x20validation:','All\x20retry\x20attempts\x20exhausted','iYqVa','Invalid\x20API\x20key\x20format.\x20Developer\x20keys\x20must\x20be\x20at\x20least\x2032\x20characters\x20and\x20start\x20with\x20\x22dev_\x22,\x20\x22pk_\x22,\x20or\x20\x22ona_\x22','now','timestamp','Wnmbi','gxNsN','wRYWK','vhSBE','kiEXw','result','eNQPK','juEdE','rwcow','abort','XGAcB','🔄\x20Retry\x20attempt\x20','\x20for\x20API\x20key\x20validation','Bearer\x20','rDFNU','signal','iPBlm','RdTVb','VxEmw','status','sXIli','iLMtT','XzXXh','ZqNcv','headers','get','bwubV','text','substring','statusText','dvYmE','XfttG','API\x20validation\x20endpoint\x20not\x20found\x20(404).\x20The\x20endpoint\x20','HwJyA','Server\x20error\x20(500).\x20The\x20Onairos\x20backend\x20is\x20experiencing\x20issues.','iXVXr',').\x20The\x20Onairos\x20backend\x20may\x20be\x20temporarily\x20down.','RGZLE','pRVVb','Oegca','lLaqa','📡\x20Developer\x20request\x20response:\x20','\x20for\x20','Server\x20returned\x20HTML\x20page\x20instead\x20of\x20JSON\x20API\x20response.\x20This\x20often\x20indicates\x20a\x20routing\x20issue\x20or\x20server\x20misconfiguration.','API\x20validation\x20endpoint\x20returned\x20','.\x20Expected\x20JSON\x20but\x20got\x20','mirSb','asKkU','Ehape','json','message','fSNLb','rhUMf','set','LOLlS','rNdzl','yJous','GUPhE','UvyCz','xzVTq','application','name','tlIWc','NYOkH','🌐\x20Making\x20developer\x20request\x20to:\x20','HTTP\x20','Zmrda','OhTMF','❌\x20API\x20key\x20validation\x20failed\x20(client\x20error):','DEmeK','rmSQF','API\x20key\x20validation\x20timeout\x20(','ms)','NOzvQ','Network\x20error\x20during\x20API\x20key\x20validation:\x20','sCGlg','yOQgs','YKAHy','iOhHX','Network\x20connectivity\x20issue.\x20Please\x20check\x20internet\x20connection\x20and\x20verify\x20the\x20Onairos\x20API\x20is\x20accessible.\x20','MjewY','gHbge','MZIwb','WcHOX','.\x20Please\x20check\x20network\x20settings\x20and\x20domain\x20accessibility.\x20','xPiHL','/dev/validate-apikey','min','EIYMI','pow','GZtPA','ZtRxL','nwJJw','⏳\x20Waiting\x20','ms\x20before\x20retry...','DNS\x20resolution\x20failed\x20for\x20','emJjX','API\x20key\x20validation\x20error:\x20','kJTqh','uVapf','🎫\x20JWT\x20token\x20stored\x20successfully','❌\x20Failed\x20to\x20store\x20JWT\x20token:','AgZep','FZkjh','jQzqt','3|0|4|2|1','⚠️\x20API\x20key\x20validation\x20failed\x20due\x20to\x20network/connectivity\x20issues','❌\x20Failed\x20to\x20load\x20JWT\x20token:','pUKVy','XNszX','XgLvU','QesKd','split','VGfiE','kkliU','glYPm','fZpan','MbXic','oJhXO','zmTwM','HKEkC','📡\x20User\x20request\x20response:\x20','removeItem','rGMRM','xIKSX','loCZL','❌\x20Failed\x20to\x20clear\x20JWT\x20token:','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/','indexOf','charAt','doHGM','VxHrX','fromCharCode','UMFGj','OCrDC','hOswV','POpYv','mwwOV','tjkrr','❌\x20Failed\x20to\x20decode\x20JWT\x20token:','ufYjS','uYomy','lYFHO','aWMTl','BZYDl','VuyXi','OiWZb','EgcOd','ZgZua','WxoAF','KsUqh','⚠️\x20No\x20JWT\x20token\x20available\x20for\x20username\x20extraction','yTSAr','gzkja','LRfFB','paSwi','👤\x20Extracted\x20username\x20from\x20JWT:','oGJsl','yBfFy','HfLvu','TbvLj','ajUiS','userName','dqAIv','NcnEf','kThCs','qepjt','ruDXC','HvRNz','KbNbm','WGxSQ','✅\x20API\x20key\x20validation\x20successful','cwDUG','gJoJC','❌\x20Failed\x20to\x20extract\x20user\x20data\x20from\x20JWT:','gpShc','skdEd','coFFb','gKdSq','iRYtj','cNxyf','kUTbH','DzzrF','usageCount','HrDNt','hOgzo','OnairosReactNative/3.0.72','sGkPD','SDK\x20not\x20initialized.\x20Call\x20initializeApiKey()\x20first.','MTvrl','wEzEP','fZPPA','rsNHL','unknown\x20content\x20type','VEgGN','OnairosSDK/1.0.0','3.0.72','avSzU','BpUAr','\x20-\x20','AxCrV','grzKc','fuqjc','rABwi','cOsRs','UzrsL','iKcfC','EFSNY','Service\x20unavailable\x20(','User\x20not\x20authenticated.\x20Please\x20verify\x20email\x20first.','IhilX','hAkvl','❌\x20Developer\x20API\x20key\x20permissions\x20insufficient','Insufficient\x20API\x20key\x20permissions','hAxWR','dJRMO','❌\x20API\x20rate\x20limit\x20exceeded.\x20Please\x20try\x20again\x20later.','nJBpG','IXmHw','ziyzF','LZzIS','IRpwB','UAxAS','FoCDe','uDdhw','ffVtD','aOWav','kngNI','mhRtQ','🌐\x20Making\x20authenticated\x20request\x20to:\x20','IUEcU','📡\x20Response\x20status:\x20','WimjL','jXYeO','WkvbP','DPODc','oOGEG','Rate\x20limit\x20exceeded','AZjrC','TBlWR','sVciL','BNINM','gHPXB','🗑️\x20JWT\x20token\x20cleared','❌\x20Failed\x20to\x20parse\x20JSON\x20response:','XpIat','wHjCD','puHOa','VqrGk','Invalid\x20or\x20expired\x20API\x20key','ivpNg','DXtpC','tuTCc','xuEdO','jbCKn','EcNQR','Qbkkp','pnxJl','YTxBi','MIBGb','FJkHU','xIzLb','NLrmJ','nNAJO','tunEj','fCZVB','xfygb','FjNjb','rmwkW','hqbPL','DmfXb','GZxvq','kutLm','zXiGr','TtGNB','Xupwz','kIuLX','WrgGw','❌\x20API\x20rate\x20limit\x20exceeded','RYsPa','oQEMA','TEWla','PPDja','nfAgo','sJmyN','gRAWL','❌\x20Failed\x20to\x20initialize\x20Onairos\x20SDK:','❌\x20JWT\x20token\x20authentication\x20failed\x20-\x20token\x20may\x20be\x20expired','Authentication\x20expired.\x20Please\x20verify\x20email\x20again.','Insufficient\x20permissions\x20for\x20this\x20operation','drZSo','nXTdg','yiKfO','BDGxs','UEdJE','Ogtds','IeQeO','🌐\x20Making\x20user\x20request\x20to:\x20','nYusP','MIVLD','lsHaD','uowSp','swYnM','❌\x20JWT\x20token\x20permissions\x20insufficient','rWTyC','REZVd','IvSKD','JKCQy','🗑️\x20API\x20key\x20validation\x20cache\x20cleared','clear','wqshZ','🔄\x20API\x20key\x20service\x20reset','GEXNY','VotDD'];_0x1047=function(){return _0x390d95;};return _0x1047();}export const isUserAuthenticated=()=>{return!!userToken;};export const getAuthHeaders=()=>{const _0x58be06={'sGkPD':function(_0x6c6068,_0x507f38){return _0x6c6068!==_0x507f38;},'MTvrl':function(_0x3a87ac,_0x321ff8){return _0x3a87ac(_0x321ff8);},'wEzEP':_0x28a3(0x14e),'fZPPA':'3.0.72','rsNHL':_0x28a3(0x22)};var _0x2e3b78;if(!(_0x58be06[_0x28a3(0x14f)](_0x2e3b78=globalConfig,null)&&_0x2e3b78!==void 0x0&&_0x2e3b78['apiKey']))throw new Error(_0x28a3(0x150));const _0x4d96b9=_0x58be06[_0x28a3(0x151)](getApiKeyType,globalConfig[_0x28a3(0x3c)]);return{'Content-Type':'application/json','Authorization':_0x28a3(0xa1)+globalConfig['apiKey'],'User-Agent':_0x58be06[_0x28a3(0x152)],'X-SDK-Version':_0x58be06[_0x28a3(0x153)],'X-SDK-Environment':globalConfig[_0x28a3(0x4f)]||_0x58be06[_0x28a3(0x154)],'X-API-Key-Type':_0x4d96b9,'X-Timestamp':new Date()['toISOString']()};};export const getDeveloperAuthHeaders=()=>{const _0x48b439={'hOhDs':function(_0x4aa71f,_0x3a4374){return _0x4aa71f||_0x3a4374;},'AxCrV':_0x28a3(0x155),'avSzU':function(_0x383f9b,_0x4ed4dd){return _0x383f9b!==_0x4ed4dd;},'BpUAr':_0x28a3(0x156),'grzKc':'SDK\x20not\x20initialized.\x20Call\x20initializeApiKey()\x20first.','fuqjc':function(_0x5ce3eb,_0x55c23f){return _0x5ce3eb(_0x55c23f);},'rABwi':_0x28a3(0x157),'mTMrS':_0x28a3(0x158),'cOsRs':_0x28a3(0x22)};var _0x3f88ad;if(!(_0x48b439[_0x28a3(0x159)](_0x3f88ad=globalConfig,null)&&_0x48b439[_0x28a3(0x159)](_0x3f88ad,void 0x0)&&_0x3f88ad['apiKey'])){if(_0x48b439[_0x28a3(0x159)](_0x28a3(0x156),_0x48b439[_0x28a3(0x15a)]))throw new _0xa87822(_0x28a3(0xc0)+_0x4840ec[_0x28a3(0xa7)]+_0x28a3(0x15b)+_0x2c0d74[_0x28a3(0xb1)]+'.\x20Expected\x20JSON\x20but\x20got\x20'+_0x48b439['hOhDs'](_0x1baed8,_0x48b439[_0x28a3(0x15c)])+'.');else throw new Error(_0x48b439[_0x28a3(0x15d)]);}const _0x1f9351=_0x48b439[_0x28a3(0x15e)](getApiKeyType,globalConfig[_0x28a3(0x3c)]);return{'Content-Type':'application/json','Authorization':'Bearer\x20'+globalConfig[_0x28a3(0x3c)],'User-Agent':_0x48b439[_0x28a3(0x15f)],'X-SDK-Version':_0x48b439['mTMrS'],'X-SDK-Environment':globalConfig[_0x28a3(0x4f)]||_0x48b439[_0x28a3(0x160)],'X-API-Key-Type':_0x1f9351,'X-Timestamp':new Date()['toISOString']()};};export const getUserAuthHeaders=()=>{const _0xe66bf1={'iKcfC':function(_0x40235b,_0x5f3a73){return _0x40235b!==_0x5f3a73;},'EFSNY':_0x28a3(0x161),'IhilX':'OnairosSDK/1.0.0','mAtjx':_0x28a3(0x158),'hAkvl':function(_0x19f097,_0x1aaa52){return _0x19f097===_0x1aaa52;},'SVWlT':_0x28a3(0x22)};var _0x4f5086;if(!userToken){if(_0xe66bf1[_0x28a3(0x162)]('UzrsL',_0xe66bf1[_0x28a3(0x163)]))throw new _0x170b28(_0x28a3(0x164)+_0x16c855[_0x28a3(0xa7)]+_0x28a3(0xb8));else throw new Error(_0x28a3(0x165));}return{'Content-Type':'application/json','Authorization':'Bearer\x20'+userToken,'User-Agent':_0xe66bf1[_0x28a3(0x166)],'X-SDK-Version':_0xe66bf1['mAtjx'],'X-SDK-Environment':((_0x4f5086=globalConfig)===null||_0xe66bf1[_0x28a3(0x167)](_0x4f5086,void 0x0)?void 0x0:_0x4f5086['environment'])||_0xe66bf1['SVWlT']};};export const makeAuthenticatedRequest=async(_0x2f56a1,_0x59f84b={})=>{const _0x282b73={'IRpwB':_0x28a3(0x168),'UAxAS':_0x28a3(0x169),'kngNI':'❌\x20API\x20key\x20authentication\x20failed.\x20Please\x20check\x20your\x20API\x20key.','mhRtQ':'Invalid\x20or\x20expired\x20API\x20key','sVciL':function(_0x3853b4,_0x3de247){return _0x3853b4>=_0x3de247;},'IXmHw':function(_0x5be389){return _0x5be389();},'ziyzF':function(_0x212301,_0x5a51d4){return _0x212301!==_0x5a51d4;},'LZzIS':_0x28a3(0x16a),'FoCDe':'SDK\x20not\x20initialized.\x20Call\x20initializeApiKey()\x20first.','uDdhw':'production','ffVtD':function(_0x577246,_0x119027,_0x2ed7c3){return _0x577246(_0x119027,_0x2ed7c3);},'aOWav':_0x28a3(0x16b),'IUEcU':function(_0x449a43,_0x58ff9d){return _0x449a43(_0x58ff9d);},'WimjL':function(_0x309918,_0x4a64c7){return _0x309918===_0x4a64c7;},'jXYeO':function(_0x4d06f4,_0x55f758){return _0x4d06f4===_0x55f758;},'WkvbP':'FFhmp','DPODc':function(_0x55e436,_0x53d1ef){return _0x55e436===_0x53d1ef;},'oOGEG':_0x28a3(0x16c),'AZjrC':function(_0x598a3e,_0x97c12e){return _0x598a3e(_0x97c12e);},'TBlWR':_0x28a3(0x76),'BzLin':_0x28a3(0x16d),'BNINM':_0x28a3(0x15),'gHPXB':_0x28a3(0x16)};if(!_0x282b73[_0x28a3(0x16e)](isApiKeyInitialized)){if(_0x282b73[_0x28a3(0x16f)](_0x28a3(0x16a),_0x282b73[_0x28a3(0x170)])){_0x489d6c[_0x28a3(0x10)](_0x282b73[_0x28a3(0x171)]);throw new _0x2ddd02(_0x282b73[_0x28a3(0x172)]);}else throw new Error(_0x282b73[_0x28a3(0x173)]);}const _0x537078=_0x282b73[_0x28a3(0x16e)](getApiConfig),_0xacb84a=API_ENDPOINTS[_0x537078[_0x28a3(0x4f)]||_0x282b73[_0x28a3(0x174)]],_0x5b2442=''+_0xacb84a+(_0x2f56a1[_0x28a3(0x4b)]('/')?'':'/')+_0x2f56a1,_0x46f863={...getAuthHeaders(),..._0x59f84b[_0x28a3(0xac)]||{}},_0x12d771=new AbortController(),_0x50d03e=_0x282b73[_0x28a3(0x175)](setTimeout,()=>_0x12d771[_0x28a3(0x9d)](),_0x537078[_0x28a3(0x25)]||0x7530);try{if(_0x282b73[_0x28a3(0x16f)](_0x282b73['aOWav'],_0x282b73[_0x28a3(0x176)])){_0x4fc0ce[_0x28a3(0x10)](_0x282b73[_0x28a3(0x177)]);throw new _0x29bc50(_0x282b73[_0x28a3(0x178)]);}else{_0x537078[_0x28a3(0x38)]&&console[_0x28a3(0x39)](_0x28a3(0x179)+_0x2f56a1);const _0x56891a=await fetch(_0x5b2442,{..._0x59f84b,'headers':_0x46f863,'signal':_0x12d771[_0x28a3(0xa3)]});_0x282b73[_0x28a3(0x17a)](clearTimeout,_0x50d03e);_0x537078[_0x28a3(0x38)]&&console['log'](_0x28a3(0x17b)+_0x56891a[_0x28a3(0xa7)]+_0x28a3(0xbe)+_0x2f56a1);if(_0x282b73[_0x28a3(0x17c)](_0x56891a[_0x28a3(0xa7)],0x191)){if(_0x282b73[_0x28a3(0x17d)](_0x282b73[_0x28a3(0x17e)],_0x282b73['WkvbP'])){console['error'](_0x282b73['kngNI']);throw new Error(_0x282b73[_0x28a3(0x178)]);}else throw new _0x579071('User\x20not\x20authenticated.\x20Please\x20verify\x20email\x20first.');}if(_0x282b73[_0x28a3(0x17f)](_0x56891a[_0x28a3(0xa7)],0x193)){console['error']('❌\x20API\x20key\x20permissions\x20insufficient\x20for\x20this\x20operation.');throw new Error(_0x282b73[_0x28a3(0x172)]);}if(_0x56891a[_0x28a3(0xa7)]===0x1ad){console[_0x28a3(0x10)](_0x282b73[_0x28a3(0x180)]);throw new Error(_0x28a3(0x181));}return _0x56891a;}}catch(_0x370442){_0x282b73[_0x28a3(0x182)](clearTimeout,_0x50d03e);if(_0x370442[_0x28a3(0xd1)]===_0x282b73[_0x28a3(0x183)]){if(_0x28a3(0x16d)!==_0x282b73['BzLin']){if(_0x282b73[_0x28a3(0x184)](_0x46473c['length'],0x20)&&(_0x230639[_0x28a3(0x4b)]('dev_')||_0x5a7491[_0x28a3(0x4b)]('pk_')||_0x5c5a1e[_0x28a3(0x4b)](_0x28a3(0x73))))return _0x38dfef[_0x28a3(0x0)];return _0x365e55['INVALID'];}else{console[_0x28a3(0x10)](_0x282b73[_0x28a3(0x185)],_0x2f56a1);throw new Error(_0x282b73[_0x28a3(0x186)]);}}throw _0x370442;}};export const makeDeveloperRequest=async(_0x3426de,_0x122504={})=>{const _0x302a34={'xIzLb':_0x28a3(0x187),'rmwkW':_0x28a3(0x188),'GZxvq':function(_0x135ae6,_0x7eb4c){return _0x135ae6!==_0x7eb4c;},'kutLm':function(_0x3c932d,_0x4d8d7e){return _0x3c932d!==_0x4d8d7e;},'jbCKn':_0x28a3(0x150),'zXiGr':function(_0x4a1c76,_0x5a0ffe){return _0x4a1c76(_0x5a0ffe);},'TtGNB':_0x28a3(0x14e),'Qbkkp':_0x28a3(0x22),'oQEMA':_0x28a3(0x130),'xuEdO':function(_0x5c5b16){return _0x5c5b16();},'EcNQR':function(_0x1331dc){return _0x1331dc();},'WEAkv':function(_0x29666f){return _0x29666f();},'pnxJl':function(_0x3b436a,_0x51afd0,_0x1ab7f2){return _0x3b436a(_0x51afd0,_0x1ab7f2);},'YTxBi':function(_0x34d6d0,_0x19f4ec){return _0x34d6d0===_0x19f4ec;},'MIBGb':_0x28a3(0x189),'FJkHU':'PXLHh','NLrmJ':function(_0x115507,_0x30780c){return _0x115507(_0x30780c);},'nNAJO':_0x28a3(0x18a),'tunEj':_0x28a3(0x18b),'fCZVB':function(_0x45b98b,_0xb93d1c){return _0x45b98b===_0xb93d1c;},'xfygb':_0x28a3(0x18c),'hqbPL':_0x28a3(0x18d),'vcniP':function(_0x3ec44a,_0xf6884c){return _0x3ec44a!==_0xf6884c;},'DmfXb':_0x28a3(0x18e),'Xupwz':'❌\x20Developer\x20API\x20key\x20permissions\x20insufficient','kIuLX':_0x28a3(0x169),'TEWla':function(_0x2dfe49,_0x4f7edf){return _0x2dfe49===_0x4f7edf;},'WrgGw':function(_0x4c4757,_0x22d8ee){return _0x4c4757===_0x22d8ee;},'saoDv':_0x28a3(0x18f),'RYsPa':_0x28a3(0x181),'PPDja':_0x28a3(0x190),'nfAgo':function(_0x2290bf,_0x3e9b55){return _0x2290bf(_0x3e9b55);},'sJmyN':_0x28a3(0x76),'gRAWL':_0x28a3(0x15)};if(!_0x302a34[_0x28a3(0x191)](isApiKeyInitialized))throw new Error(_0x302a34[_0x28a3(0x192)]);const _0x46dd36=_0x302a34[_0x28a3(0x193)](getApiConfig),_0xb34b4e=API_ENDPOINTS[_0x46dd36[_0x28a3(0x4f)]||_0x302a34[_0x28a3(0x194)]],_0x609361=''+_0xb34b4e+(_0x3426de[_0x28a3(0x4b)]('/')?'':'/')+_0x3426de,_0x47849e={..._0x302a34['WEAkv'](getDeveloperAuthHeaders),..._0x122504['headers']||{}},_0x197eef=new AbortController(),_0x10486b=_0x302a34[_0x28a3(0x195)](setTimeout,()=>_0x197eef[_0x28a3(0x9d)](),_0x46dd36[_0x28a3(0x25)]||0x7530);try{if(_0x302a34[_0x28a3(0x196)](_0x302a34[_0x28a3(0x197)],_0x302a34[_0x28a3(0x198)]))_0x13d8f0['log'](_0x302a34[_0x28a3(0x199)]);else{_0x46dd36[_0x28a3(0x38)]&&console['log'](_0x28a3(0xd4)+_0x3426de);const _0x37907e=await fetch(_0x609361,{..._0x122504,'headers':_0x47849e,'signal':_0x197eef[_0x28a3(0xa3)]});_0x302a34[_0x28a3(0x19a)](clearTimeout,_0x10486b);if(_0x46dd36[_0x28a3(0x38)]){if(_0x302a34[_0x28a3(0x196)](_0x302a34[_0x28a3(0x19b)],_0x302a34[_0x28a3(0x19c)]))return null;else console[_0x28a3(0x39)]('📡\x20Developer\x20request\x20response:\x20'+_0x37907e['status']+_0x28a3(0xbe)+_0x3426de);}if(_0x302a34[_0x28a3(0x19d)](_0x37907e[_0x28a3(0xa7)],0x191)){if(_0x302a34[_0x28a3(0x196)](_0x302a34[_0x28a3(0x19e)],_0x28a3(0x19f))){_0x44e3b1[_0x28a3(0x10)](_0x302a34[_0x28a3(0x1a0)],{'error':_0x4f3490['message'],'status':_0x4bf08c[_0x28a3(0xa7)],'contentType':_0xaa86fd,'attempt':_0x4dbf41});throw new _0x14e61f('Failed\x20to\x20parse\x20server\x20response\x20as\x20JSON:\x20'+_0x973ea1[_0x28a3(0xc6)]);}else{console[_0x28a3(0x10)](_0x28a3(0x11));throw new Error(_0x302a34[_0x28a3(0x1a1)]);}}if(_0x302a34[_0x28a3(0x19d)](_0x37907e['status'],0x193)){if(_0x302a34['vcniP'](_0x302a34[_0x28a3(0x1a2)],_0x28a3(0x18e))){var _0x13c284;if(!(_0x302a34[_0x28a3(0x1a3)](_0x13c284=_0x14d4a1,null)&&_0x302a34[_0x28a3(0x1a4)](_0x13c284,void 0x0)&&_0x13c284[_0x28a3(0x3c)]))throw new _0x33f676(_0x302a34['jbCKn']);const _0x1a3e71=_0x302a34[_0x28a3(0x1a5)](_0x5377ee,_0x47edd3['apiKey']);return{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x204b5e['apiKey'],'User-Agent':_0x302a34[_0x28a3(0x1a6)],'X-SDK-Version':_0x28a3(0x158),'X-SDK-Environment':_0x381b0e[_0x28a3(0x4f)]||_0x302a34[_0x28a3(0x194)],'X-API-Key-Type':_0x1a3e71,'X-Timestamp':new _0xc00fa0()['toISOString']()};}else{console[_0x28a3(0x10)](_0x302a34[_0x28a3(0x1a7)]);throw new Error(_0x302a34[_0x28a3(0x1a8)]);}}if(_0x302a34['TEWla'](_0x37907e['status'],0x1ad)){if(_0x302a34[_0x28a3(0x1a9)](_0x302a34['saoDv'],_0x28a3(0x18f))){console[_0x28a3(0x10)](_0x28a3(0x1aa));throw new Error(_0x302a34[_0x28a3(0x1ab)]);}else _0xc5142e['log'](_0x302a34[_0x28a3(0x1ac)],_0x5d598b);}return _0x37907e;}}catch(_0x2efc87){if(_0x302a34[_0x28a3(0x1ad)](_0x302a34[_0x28a3(0x1ae)],_0x302a34[_0x28a3(0x1ae)])){_0x302a34[_0x28a3(0x1af)](clearTimeout,_0x10486b);if(_0x302a34[_0x28a3(0x1ad)](_0x2efc87[_0x28a3(0xd1)],_0x302a34[_0x28a3(0x1b0)])){console[_0x28a3(0x10)](_0x302a34[_0x28a3(0x1b1)],_0x3426de);throw new Error(_0x28a3(0x16));}throw _0x2efc87;}else _0x2eb0c8[_0x28a3(0x39)](_0x28a3(0x9f)+_0x25111a+'/'+_0x4a11c9+'\x20for\x20API\x20key\x20validation');}};export const makeUserRequest=async(_0x35e79d,_0x58968d={})=>{const _0x2ca228={'OQUZg':_0x28a3(0x1b2),'nXTdg':function(_0x2e8c02){return _0x2e8c02();},'yiKfO':function(_0x59d57c,_0x414995){return _0x59d57c===_0x414995;},'UEdJE':function(_0x5d31e9){return _0x5d31e9();},'Ogtds':'production','IeQeO':function(_0x5c3454,_0xdf2f13,_0x1e5077){return _0x5c3454(_0xdf2f13,_0x1e5077);},'nYusP':function(_0x288103,_0xb839e7){return _0x288103(_0xb839e7);},'MIVLD':function(_0x473838,_0x1347da){return _0x473838===_0x1347da;},'lsHaD':_0x28a3(0x1b3),'uowSp':function(_0x57e375){return _0x57e375();},'swYnM':_0x28a3(0x1b4),'sKQfh':function(_0x372b8b,_0x327eda){return _0x372b8b===_0x327eda;},'rWTyC':_0x28a3(0x1b5),'REZVd':function(_0x42e122,_0xb49d82){return _0x42e122!==_0xb49d82;},'tlEJt':_0x28a3(0x1b6),'IvSKD':_0x28a3(0x15),'JKCQy':_0x28a3(0x16)};if(!_0x2ca228[_0x28a3(0x1b7)](isUserAuthenticated)){if(_0x2ca228[_0x28a3(0x1b8)]('BDGxs',_0x28a3(0x1b9)))await _0x2ca228[_0x28a3(0x1ba)](loadJWT);else{_0x144798[_0x28a3(0x10)](_0x2ca228['OQUZg'],_0x522e7d),_0x6cfbb3=![];throw _0x76d1fb;}}if(!_0x2ca228[_0x28a3(0x1ba)](isUserAuthenticated))throw new Error(_0x28a3(0x165));const _0x3563cd=getApiConfig()||{'environment':_0x2ca228[_0x28a3(0x1bb)],'timeout':0x7530,'enableLogging':![]},_0x3e22a4=API_ENDPOINTS[_0x3563cd[_0x28a3(0x4f)]||_0x2ca228[_0x28a3(0x1bb)]],_0x5f2271=''+_0x3e22a4+(_0x35e79d['startsWith']('/')?'':'/')+_0x35e79d,_0x33b7d9={..._0x2ca228[_0x28a3(0x1b7)](getUserAuthHeaders),..._0x58968d[_0x28a3(0xac)]||{}},_0xc8e7a8=new AbortController(),_0x44cd07=_0x2ca228[_0x28a3(0x1bc)](setTimeout,()=>_0xc8e7a8['abort'](),_0x3563cd[_0x28a3(0x25)]||0x7530);try{_0x3563cd['enableLogging']&&console[_0x28a3(0x39)](_0x28a3(0x1bd)+_0x35e79d);const _0x804a9c=await _0x2ca228[_0x28a3(0x1bc)](fetch,_0x5f2271,{..._0x58968d,'headers':_0x33b7d9,'signal':_0xc8e7a8[_0x28a3(0xa3)]});_0x2ca228[_0x28a3(0x1be)](clearTimeout,_0x44cd07);_0x3563cd['enableLogging']&&console[_0x28a3(0x39)](_0x28a3(0x10d)+_0x804a9c[_0x28a3(0xa7)]+_0x28a3(0xbe)+_0x35e79d);if(_0x2ca228[_0x28a3(0x1bf)](_0x804a9c[_0x28a3(0xa7)],0x191)){console[_0x28a3(0x10)](_0x2ca228[_0x28a3(0x1c0)]),await _0x2ca228[_0x28a3(0x1c1)](clearJWT);throw new Error(_0x2ca228[_0x28a3(0x1c2)]);}if(_0x2ca228['sKQfh'](_0x804a9c[_0x28a3(0xa7)],0x193)){console[_0x28a3(0x10)](_0x28a3(0x1c3));throw new Error(_0x2ca228[_0x28a3(0x1c4)]);}return _0x804a9c;}catch(_0x530458){_0x2ca228[_0x28a3(0x1be)](clearTimeout,_0x44cd07);if(_0x2ca228['MIVLD'](_0x530458['name'],_0x28a3(0x76))){if(_0x2ca228[_0x28a3(0x1c5)](_0x2ca228['tlEJt'],'drZSo'))_0x24f4af[_0x28a3(0x39)](_0x28a3(0x1bd)+_0x8bf6ac);else{console[_0x28a3(0x10)](_0x2ca228[_0x28a3(0x1c6)],_0x35e79d);throw new Error(_0x2ca228[_0x28a3(0x1c7)]);}}throw _0x530458;}};export const clearValidationCache=()=>{const _0x3f170={'wQWVH':function(_0x40cebb,_0x2aad70){return _0x40cebb!==_0x2aad70;},'wqshZ':function(_0xaadd57,_0x138d68){return _0xaadd57!==_0x138d68;},'wUPVG':_0x28a3(0x1c8)};var _0x58852f;validationCache[_0x28a3(0x1c9)](),_0x3f170['wQWVH'](_0x58852f=globalConfig,null)&&_0x3f170[_0x28a3(0x1ca)](_0x58852f,void 0x0)&&_0x58852f[_0x28a3(0x38)]&&console[_0x28a3(0x39)](_0x3f170['wUPVG']);};export const resetApiKeyService=()=>{const _0x5189e7={'GEXNY':function(_0x14b66d){return _0x14b66d();},'VotDD':_0x28a3(0x1cb)};globalConfig=null,isInitialized=![],_0x5189e7[_0x28a3(0x1cc)](clearValidationCache),console['log'](_0x5189e7[_0x28a3(0x1cd)]);};