@onairos/react-native 3.7.1 → 3.7.3

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 (241) hide show
  1. package/lib/commonjs/api/index.js +219 -9
  2. package/lib/commonjs/assets/icons/spotify.png +0 -0
  3. package/lib/commonjs/assets/images/spotify.png +0 -0
  4. package/lib/commonjs/components/BodyText.js +27 -9
  5. package/lib/commonjs/components/BrandMark.js +111 -10
  6. package/lib/commonjs/components/CodeInput.js +116 -9
  7. package/lib/commonjs/components/EmailInput.js +30 -8
  8. package/lib/commonjs/components/GoogleButton.js +56 -9
  9. package/lib/commonjs/components/HeadingGroup.js +43 -9
  10. package/lib/commonjs/components/LLMDataInputModal.js +664 -14
  11. package/lib/commonjs/components/ModalHeader.js +99 -9
  12. package/lib/commonjs/components/ModalSheet.js +47 -9
  13. package/lib/commonjs/components/Onairos.js +380 -14
  14. package/lib/commonjs/components/OnairosButton.js +313 -13
  15. package/lib/commonjs/components/OnairosSignInButton.js +130 -12
  16. package/lib/commonjs/components/Overlay.js +465 -13
  17. package/lib/commonjs/components/PersonaImage.js +137 -10
  18. package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
  19. package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
  20. package/lib/commonjs/components/PinCreationScreen.js +403 -12
  21. package/lib/commonjs/components/PinInput.js +464 -9
  22. package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
  23. package/lib/commonjs/components/PlatformList.js +137 -10
  24. package/lib/commonjs/components/PlatformToggle.js +180 -9
  25. package/lib/commonjs/components/PrimaryButton.js +180 -10
  26. package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
  27. package/lib/commonjs/components/SignInStep.js +345 -12
  28. package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
  29. package/lib/commonjs/components/VerificationStep.js +176 -11
  30. package/lib/commonjs/components/WelcomeScreen.js +461 -22
  31. package/lib/commonjs/components/icons/Basicproficon.js +37 -8
  32. package/lib/commonjs/components/icons/Basicprofile.js +21 -8
  33. package/lib/commonjs/components/icons/Checkbox.js +21 -8
  34. package/lib/commonjs/components/icons/Checkmark.js +27 -8
  35. package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
  36. package/lib/commonjs/components/icons/Contenticon.js +39 -8
  37. package/lib/commonjs/components/icons/EnochE.js +41 -8
  38. package/lib/commonjs/components/icons/Personalityicon.js +30 -8
  39. package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
  40. package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
  41. package/lib/commonjs/components/icons/Userpreferences.js +21 -8
  42. package/lib/commonjs/components/icons/index.js +84 -17
  43. package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
  44. package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
  45. package/lib/commonjs/components/onboarding/PinInput.js +283 -10
  46. package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
  47. package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
  48. package/lib/commonjs/config/api.js +56 -7
  49. package/lib/commonjs/constants/index.js +120 -7
  50. package/lib/commonjs/context/AuthContext.js +345 -10
  51. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
  52. package/lib/commonjs/hooks/useConnections.js +102 -8
  53. package/lib/commonjs/hooks/useCredentials.js +178 -10
  54. package/lib/commonjs/hooks/useUserConnections.js +148 -10
  55. package/lib/commonjs/index.js +439 -34
  56. package/lib/commonjs/services/apiClient.js +298 -8
  57. package/lib/commonjs/services/biometricPinService.js +180 -8
  58. package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
  59. package/lib/commonjs/services/chatGPTConversationService.js +275 -9
  60. package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
  61. package/lib/commonjs/services/claudeConversationService.js +158 -9
  62. package/lib/commonjs/services/connectedAccountsService.js +310 -10
  63. package/lib/commonjs/services/googleAuthService.js +252 -11
  64. package/lib/commonjs/services/hingeDataExtractor.js +105 -8
  65. package/lib/commonjs/services/hingeDataService.js +150 -9
  66. package/lib/commonjs/services/imageCompressionService.js +260 -7
  67. package/lib/commonjs/services/instagramDataExtractor.js +126 -8
  68. package/lib/commonjs/services/instagramDataService.js +163 -9
  69. package/lib/commonjs/services/jwtStorageService.js +276 -7
  70. package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
  71. package/lib/commonjs/services/linkedinProfileService.js +222 -9
  72. package/lib/commonjs/services/linkedinScrapingService.js +230 -8
  73. package/lib/commonjs/services/llmDataStorage.js +294 -8
  74. package/lib/commonjs/services/mobileTrainingService.js +186 -8
  75. package/lib/commonjs/services/netflixDataExtractor.js +120 -8
  76. package/lib/commonjs/services/netflixDataService.js +198 -9
  77. package/lib/commonjs/services/pinEncryptionService.js +84 -8
  78. package/lib/commonjs/services/pinStorageUtils.js +105 -7
  79. package/lib/commonjs/services/platformAuthService.js +1484 -12
  80. package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
  81. package/lib/commonjs/services/sephoraDataService.js +200 -9
  82. package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
  83. package/lib/commonjs/services/spotifyDataService.js +241 -9
  84. package/lib/commonjs/services/storageService.js +404 -8
  85. package/lib/commonjs/services/telegramDataExtractor.js +115 -8
  86. package/lib/commonjs/services/telegramDataService.js +499 -9
  87. package/lib/commonjs/services/trainingApiHelpers.js +73 -7
  88. package/lib/commonjs/services/userConnectionsService.js +340 -10
  89. package/lib/commonjs/services/youtubeMigrationService.js +416 -10
  90. package/lib/commonjs/theme/index.js +250 -7
  91. package/lib/commonjs/types/ambient.d.js +2 -1
  92. package/lib/commonjs/types/declarations.d.js +2 -1
  93. package/lib/commonjs/types/index.js +6 -1
  94. package/lib/commonjs/types/node-fix.d.js +2 -1
  95. package/lib/commonjs/types/node-override.d.js +2 -1
  96. package/lib/commonjs/types/opacity.d.js +2 -1
  97. package/lib/commonjs/types.js +14 -1
  98. package/lib/commonjs/utils/Portal.js +98 -8
  99. package/lib/commonjs/utils/api.js +130 -9
  100. package/lib/commonjs/utils/assetRegistry.js +210 -35
  101. package/lib/commonjs/utils/auth.js +112 -9
  102. package/lib/commonjs/utils/connectorTests.js +613 -29
  103. package/lib/commonjs/utils/crypto.js +62 -8
  104. package/lib/commonjs/utils/debugHelper.js +64 -1
  105. package/lib/commonjs/utils/encryption.js +76 -7
  106. package/lib/commonjs/utils/eventUtils.js +288 -1
  107. package/lib/commonjs/utils/haptics.js +66 -9
  108. package/lib/commonjs/utils/imagePreloader.js +6 -1
  109. package/lib/commonjs/utils/networkDiagnostics.js +226 -8
  110. package/lib/commonjs/utils/onairosApi.js +350 -9
  111. package/lib/commonjs/utils/programmaticFlow.js +117 -9
  112. package/lib/commonjs/utils/retryHelper.js +220 -1
  113. package/lib/commonjs/utils/secureStorage.js +349 -10
  114. package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
  115. package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
  116. package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
  117. package/lib/commonjs/utils/webviewScripts/index.js +698 -15
  118. package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
  119. package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
  120. package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
  121. package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
  122. package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
  123. package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
  124. package/lib/module/api/index.js +211 -1
  125. package/lib/module/assets/icons/spotify.png +0 -0
  126. package/lib/module/assets/images/spotify.png +0 -0
  127. package/lib/module/components/BodyText.js +20 -1
  128. package/lib/module/components/BrandMark.js +104 -1
  129. package/lib/module/components/CodeInput.js +109 -1
  130. package/lib/module/components/EmailInput.js +23 -1
  131. package/lib/module/components/GoogleButton.js +49 -1
  132. package/lib/module/components/HeadingGroup.js +36 -1
  133. package/lib/module/components/LLMDataInputModal.js +656 -7
  134. package/lib/module/components/ModalHeader.js +92 -1
  135. package/lib/module/components/ModalSheet.js +39 -1
  136. package/lib/module/components/Onairos.js +373 -1
  137. package/lib/module/components/OnairosButton.js +305 -1
  138. package/lib/module/components/OnairosSignInButton.js +121 -1
  139. package/lib/module/components/Overlay.js +456 -1
  140. package/lib/module/components/PersonaImage.js +129 -1
  141. package/lib/module/components/PersonaLoadingScreen.js +310 -1
  142. package/lib/module/components/PersonalizationConsentScreen.js +460 -1
  143. package/lib/module/components/PinCreationScreen.js +396 -1
  144. package/lib/module/components/PinInput.js +456 -1
  145. package/lib/module/components/PlatformConnectorsStep.js +1302 -6
  146. package/lib/module/components/PlatformList.js +129 -1
  147. package/lib/module/components/PlatformToggle.js +173 -1
  148. package/lib/module/components/PrimaryButton.js +172 -1
  149. package/lib/module/components/SignInMatchAnimation.js +189 -1
  150. package/lib/module/components/SignInStep.js +338 -1
  151. package/lib/module/components/UniversalOnboarding.js +2770 -1
  152. package/lib/module/components/VerificationStep.js +168 -1
  153. package/lib/module/components/WelcomeScreen.js +453 -1
  154. package/lib/module/components/icons/Basicproficon.js +30 -1
  155. package/lib/module/components/icons/Basicprofile.js +14 -1
  156. package/lib/module/components/icons/Checkbox.js +14 -1
  157. package/lib/module/components/icons/Checkmark.js +20 -1
  158. package/lib/module/components/icons/Contentanalysis.js +14 -1
  159. package/lib/module/components/icons/Contenticon.js +32 -1
  160. package/lib/module/components/icons/EnochE.js +34 -1
  161. package/lib/module/components/icons/Personalityicon.js +23 -1
  162. package/lib/module/components/icons/Personalityprofile.js +14 -1
  163. package/lib/module/components/icons/Personalitytraits.js +14 -1
  164. package/lib/module/components/icons/Userpreferences.js +14 -1
  165. package/lib/module/components/icons/index.js +13 -1
  166. package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
  167. package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
  168. package/lib/module/components/onboarding/PinInput.js +274 -1
  169. package/lib/module/components/onboarding/PlatformConnector.js +240 -1
  170. package/lib/module/config/PLATFORM_APIS.md +849 -0
  171. package/lib/module/config/api.js +47 -1
  172. package/lib/module/constants/index.js +114 -1
  173. package/lib/module/context/AuthContext.js +335 -1
  174. package/lib/module/hooks/useConnectedAccounts.js +106 -1
  175. package/lib/module/hooks/useConnections.js +95 -1
  176. package/lib/module/hooks/useCredentials.js +171 -6
  177. package/lib/module/hooks/useUserConnections.js +140 -1
  178. package/lib/module/index.js +172 -1
  179. package/lib/module/services/apiClient.js +295 -1
  180. package/lib/module/services/biometricPinService.js +169 -1
  181. package/lib/module/services/chatGPTConversationExtractor.js +149 -1
  182. package/lib/module/services/chatGPTConversationService.js +268 -1
  183. package/lib/module/services/claudeConversationExtractor.js +97 -1
  184. package/lib/module/services/claudeConversationService.js +151 -1
  185. package/lib/module/services/connectedAccountsService.js +293 -1
  186. package/lib/module/services/googleAuthService.js +241 -1
  187. package/lib/module/services/hingeDataExtractor.js +99 -1
  188. package/lib/module/services/hingeDataService.js +143 -1
  189. package/lib/module/services/imageCompressionService.js +250 -1
  190. package/lib/module/services/instagramDataExtractor.js +120 -1
  191. package/lib/module/services/instagramDataService.js +156 -1
  192. package/lib/module/services/jwtStorageService.js +257 -1
  193. package/lib/module/services/linkedinDOMExtractor.js +234 -1
  194. package/lib/module/services/linkedinProfileService.js +210 -1
  195. package/lib/module/services/linkedinScrapingService.js +219 -1
  196. package/lib/module/services/llmDataStorage.js +277 -1
  197. package/lib/module/services/mobileTrainingService.js +173 -1
  198. package/lib/module/services/netflixDataExtractor.js +114 -1
  199. package/lib/module/services/netflixDataService.js +191 -1
  200. package/lib/module/services/pinEncryptionService.js +74 -6
  201. package/lib/module/services/pinStorageUtils.js +93 -1
  202. package/lib/module/services/platformAuthService.js +1461 -1
  203. package/lib/module/services/sephoraDataExtractor.js +134 -1
  204. package/lib/module/services/sephoraDataService.js +193 -1
  205. package/lib/module/services/spotifyDataExtractor.js +142 -1
  206. package/lib/module/services/spotifyDataService.js +234 -1
  207. package/lib/module/services/storageService.js +383 -1
  208. package/lib/module/services/telegramDataExtractor.js +109 -1
  209. package/lib/module/services/telegramDataService.js +493 -1
  210. package/lib/module/services/trainingApiHelpers.js +67 -1
  211. package/lib/module/services/userConnectionsService.js +329 -1
  212. package/lib/module/services/youtubeMigrationService.js +405 -1
  213. package/lib/module/theme/index.js +245 -1
  214. package/lib/module/types.js +10 -1
  215. package/lib/module/utils/Portal.js +90 -1
  216. package/lib/module/utils/api.js +118 -1
  217. package/lib/module/utils/assetRegistry.js +200 -34
  218. package/lib/module/utils/auth.js +100 -1
  219. package/lib/module/utils/connectorTests.js +600 -27
  220. package/lib/module/utils/crypto.js +54 -1
  221. package/lib/module/utils/debugHelper.js +54 -1
  222. package/lib/module/utils/encryption.js +67 -1
  223. package/lib/module/utils/eventUtils.js +270 -1
  224. package/lib/module/utils/haptics.js +59 -8
  225. package/lib/module/utils/imagePreloader.js +3 -1
  226. package/lib/module/utils/networkDiagnostics.js +217 -1
  227. package/lib/module/utils/onairosApi.js +333 -1
  228. package/lib/module/utils/programmaticFlow.js +111 -1
  229. package/lib/module/utils/retryHelper.js +211 -1
  230. package/lib/module/utils/secureStorage.js +330 -6
  231. package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
  232. package/lib/module/utils/webviewScripts/claude.js +370 -1
  233. package/lib/module/utils/webviewScripts/hinge.js +405 -1
  234. package/lib/module/utils/webviewScripts/index.js +434 -1
  235. package/lib/module/utils/webviewScripts/instagram.js +448 -1
  236. package/lib/module/utils/webviewScripts/linkedin.js +874 -1
  237. package/lib/module/utils/webviewScripts/netflix.js +376 -1
  238. package/lib/module/utils/webviewScripts/sephora.js +510 -1
  239. package/lib/module/utils/webviewScripts/spotify.js +413 -1
  240. package/lib/module/utils/webviewScripts/telegram.js +672 -1
  241. package/package.json +2 -2
@@ -1,14 +1,664 @@
1
- 'use strict';
2
- // Onairos SDK - Asset Registry (auto-generated)
3
- var __ONAIROS_REQ_REGISTRY__ = [
4
- require("react"),
5
- require("react-native"),
6
- require("../theme"),
7
- require("../utils/haptics"),
8
- require("@react-native-async-storage/async-storage"),
9
- require("../config/api"),
10
- require('react-native-document-picker'),
11
- require('react-native-fs')
12
- ];
13
- function __ONAIROS_REQ_FUNC__(i) { return __ONAIROS_REQ_REGISTRY__[i]; }
14
- Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[_0x46af(0x0)]=void 0x0;var _react=_interopRequireWildcard(__ONAIROS_REQ_FUNC__(0x0)),_reactNative=__ONAIROS_REQ_FUNC__(0x1),_theme=__ONAIROS_REQ_FUNC__(0x2),_haptics=__ONAIROS_REQ_FUNC__(0x3),_asyncStorage=_interopRequireDefault(__ONAIROS_REQ_FUNC__(0x4)),_api=__ONAIROS_REQ_FUNC__(0x5);function _interopRequireDefault(_0x2b754a){return _0x2b754a&&_0x2b754a[_0x46af(0x1)]?_0x2b754a:{'default':_0x2b754a};}function _interopRequireWildcard(_0x550352,_0x42a9c8){const _0x57fa72={'Dpofw':function(_0x252798,_0x487f4a){return _0x252798===_0x487f4a;},'NjRCJ':'assistant','aCzTA':function(_0x1c23d1,_0x54853c){return _0x1c23d1!==_0x54853c;},'GKlTS':_0x46af(0x2),'SdsMZ':_0x46af(0x3),'GjatO':function(_0x3c3a59,_0x3fd402){return _0x3c3a59&&_0x3fd402;},'aWwTK':function(_0x4fc41f,_0x147b04){return _0x4fc41f===_0x147b04;},'MRzvY':function(_0x32ea09,_0x50557b){return _0x32ea09!=_0x50557b;},'wSJVl':_0x46af(0x4),'lNrzM':_0x46af(0x5),'aFFZu':_0x46af(0x0),'BqzJR':function(_0x11d387,_0x1613ea,_0x54af18,_0x510849){return _0x11d387(_0x1613ea,_0x54af18,_0x510849);},'XtXZx':function(_0xca0897,_0x201b94){return _0xca0897==_0x201b94;}};if(_0x57fa72[_0x46af(0x6)](_0x46af(0x5),typeof WeakMap))var _0x5b7e23=new WeakMap(),_0x367506=new WeakMap();return(_interopRequireWildcard=function(_0x469bc8,_0x5d957b){if(_0x57fa72['aCzTA'](_0x57fa72['GKlTS'],_0x57fa72[_0x46af(0x7)])){if(_0x57fa72[_0x46af(0x8)](!_0x5d957b,_0x469bc8)&&_0x469bc8['__esModule'])return _0x469bc8;var _0x267e02,_0x283a60,_0x3d9cdf={'__proto__':null,'default':_0x469bc8};if(_0x57fa72['aWwTK'](null,_0x469bc8)||_0x57fa72[_0x46af(0x9)](_0x57fa72[_0x46af(0xa)],typeof _0x469bc8)&&_0x57fa72[_0x46af(0xb)]!=typeof _0x469bc8)return _0x3d9cdf;if(_0x267e02=_0x5d957b?_0x367506:_0x5b7e23){if(_0x267e02[_0x46af(0xc)](_0x469bc8))return _0x267e02['get'](_0x469bc8);_0x267e02['set'](_0x469bc8,_0x3d9cdf);}for(const _0x43d349 in _0x469bc8)_0x57fa72[_0x46af(0xd)]!==_0x43d349&&{}[_0x46af(0xe)][_0x46af(0xf)](_0x469bc8,_0x43d349)&&((_0x283a60=(_0x267e02=Object['defineProperty'])&&Object[_0x46af(0x10)](_0x469bc8,_0x43d349))&&(_0x283a60[_0x46af(0x11)]||_0x283a60[_0x46af(0x12)])?_0x57fa72[_0x46af(0x13)](_0x267e02,_0x3d9cdf,_0x43d349,_0x283a60):_0x3d9cdf[_0x43d349]=_0x469bc8[_0x43d349]);return _0x3d9cdf;}else _0x1e0687[_0x46af(0x14)]({'id':_0x5d246b[_0x46af(0x15)]||_0x46af(0x16)+_0x54e882,'role':_0x57fa72[_0x46af(0x17)](_0x253f1d[_0x46af(0x18)],_0x46af(0x19))?_0x46af(0x1a):_0x57fa72[_0x46af(0x1b)],'content':_0x1af100[_0x46af(0x1c)]||_0x27d499['content'],'timestamp':_0x41ee47[_0x46af(0x1d)]});})(_0x550352,_0x42a9c8);}let DocumentPicker=null,RNFS=null;function _0x46af(_0x1fb854,_0x46af22){_0x1fb854=_0x1fb854-0x0;const _0x3b4727=_0x1fb8();let _0x14fbc1=_0x3b4727[_0x1fb854];return _0x14fbc1;}try{DocumentPicker=__ONAIROS_REQ_FUNC__(0x6);}catch(_0x567157){console['log']('react-native-document-picker not available - file upload disabled');}try{RNFS=__ONAIROS_REQ_FUNC__(0x7);}catch(_0x52d705){console[_0x46af(0x1e)]('react-native-fs not available - file upload disabled');}function _0x1fb8(){const _0x59eeb2=['default','__esModule','GVONY','ljSLq','object','function','XtXZx','SdsMZ','GjatO','MRzvY','wSJVl','lNrzM','has','aFFZu','hasOwnProperty','call','getOwnPropertyDescriptor','get','set','BqzJR','push','uuid','msg_','Dpofw','sender','human','user','NjRCJ','text','created_at','log','chatgpt','Connect\x20ChatGPT','Export\x20your\x20ChatGPT\x20conversations\x20from\x20Settings\x20→\x20Data\x20Controls\x20→\x20Export\x20data.\x20Then\x20upload\x20the\x20JSON\x20file\x20or\x20paste\x20your\x20conversation\x20data.','Paste\x20your\x20ChatGPT\x20conversation\x20JSON\x20here...','Connect\x20Claude','Paste\x20your\x20Claude\x20conversation\x20JSON\x20here...','gemini','Connect\x20Gemini','Export\x20your\x20Gemini\x20(Google\x20AI)\x20conversations\x20and\x20paste\x20the\x20data\x20below.','Paste\x20your\x20Gemini\x20conversation\x20JSON\x20here...','Connect\x20Grok','Export\x20your\x20Grok\x20conversations\x20from\x20X/Twitter\x20and\x20paste\x20the\x20data\x20below.','Paste\x20your\x20Grok\x20conversation\x20JSON\x20here...','Paste\x20your\x20conversation\x20data\x20below\x20or\x20upload\x20a\x20JSON\x20file.','Paste\x20your\x20conversation\x20JSON\x20here...','PnXWw','File\x20upload\x20requires\x20additional\x20dependencies.\x20Please\x20paste\x20data\x20instead.','YaTcJ','RbnEd','aKJPi','LkVMB','Imported\x20Conversation','RbfzR','unknown','qkBwl','wiCyl','uDHSX','Selected\x20file','content://','ExeZG','utf8','vRMah','DOCUMENT_PICKER_CANCELED','File\x20pick\x20error:','Failed\x20to\x20read\x20file.\x20Please\x20try\x20again\x20or\x20paste\x20data\x20manually.','string','assistant','Please\x20paste\x20or\x20upload\x20conversation\x20data\x20first.','VetNA','No\x20valid\x20conversations\x20found\x20in\x20the\x20data.\x20Please\x20check\x20the\x20format.','enoch_token','Authentication\x20required.\x20Please\x20sign\x20in\x20first.','1.0.0','conversation','mobile_app_import','PtADx','CYFAY','Success!\x20🎉','pcFSF','Submit\x20error:','Failed\x20to\x20import\x20data.\x20Please\x20try\x20again.','zhBIZ','paste','YoHCF','cTAtl','file','slide','pageSheet','ios','Cancel','Upload\x20File\x20','(N/A)','Tap\x20to\x20select\x20a\x20file','\x20characters','#FFFFFF','XlxQx','useState','bFDzI','iyEPH','rbexw','claude','zPxfs','OASuy','zlXnR','kCBQd','NYGIr','KgHkE','xqygn','dUZmB','gssbY','bzEmT','Connect\x20','xnwfo','AXUdO','kJcNK','cGgdV','yjMod','SLlut','XZDBw','SoGJy','dDMtZ','message','TDtin','content','parts','join','trim','svKsA','author','qQOXI','role','create_time','zUQXr','toISOString','parse','isArray','yhQLK','SEOyX','DSiFc','rktEs','AjWni','KthtY','LzjVG','length','nSmVd','fyuOg','conversation_id','now','name','Conversation\x20','updated_at','qNDbe','Bctux','UxDZp','WpevA','kMxUX','tFWkv','vIUCW','defineProperty','fVjPF','conversations','forEach','jEHhf','cMmfj','title','JCVyL','update_time','mapping','messages','NEZaP','conv_','triggerHaptic','anIWq','xtCRR','HapticType','ERROR','QNLNS','fJfGY','UUoMW','error','Error\x20parsing\x20conversation\x20data:','Invalid\x20JSON\x20format.\x20Please\x20check\x20your\x20data\x20and\x20try\x20again.','SiUvy','mZfiX','zjzmq','XePrO','JyDRm','values','YbVBI','pAjxd','HhEuc','HAwmd','Bavri','KILhZ','timestamp','UpvQW','enakd','nZTRp','nGLPQ','chat_messages','zoyub','kRNrn','json','plainText','allFiles','oPaaC','uri','startsWith','UIksG','Qlkrp','lOLgA','qNeGP','readFile','dvBSv','JAQHb','SUCCESS','code','rJvCV','BKCnU','SwkgL','vmuLX','ZHoLx','HImUM','XfgcD','YWRex','VOOqo','sPXtZ','gnjcy','XJKdn','KCOnm','duXIw','feqie','XmmUe','onairos_jwt_token','rXowN','getItem','auth_token','mobile-','API_CONFIG','BASE_URL','/llm-data/store','conversationId','Platform','JRkKs','swWJV','gLQsl','Error\x20storing\x20conversation:','EAZBV','ARhmS','sJJrq','RsGeo','Alert','alert','eWAta','Successfully\x20imported\x20','\x20from\x20','KeKOv','QlHbo','YyYiB','ThZEC','IrCfk','IVMaf','IzOHC','ljbCI','kpVee','cDfwv','pGICJ','SBAfZ','eEtwi','cNkMt','YiGVn','dYcod','otmFc','syyeI','dTGlx','wJIvz','VzMmg','createElement','KeyboardAvoidingView','KGUaT','oVizL','mLgPZ','View','header','TouchableOpacity','closeButton','Text','closeButtonText','QCphr','headerTitle','ScrollView','contentContainer','instructionsContainer','instructionsText','tabContainer','tab','UKMuI','tabActive','lpXPj','opvSw','RbeQk','FyYSb','BUTTON_PRESS','tabTextActive','Paste\x20Data','pSdJN','tabDisabled','aAoih','NBOQV','oCQhE','VFwjH','iZKIh','jJXuu','wFxsQ','krFhV','tabTextDisabled','FNKvg','iOQFi','wUvha','inputContainer','COLORS','grey400','top','fileInputContainer','filePickButton','filePickIcon','YZjOP','kMXLN','fileSelectedContainer','fileSelectedText','errorText','MjxzB','previewContainer','previewTitle','substring','iIoPb','...','toLocaleString','PdFXT','footer','submitButton','submitButtonDisabled','ActivityIndicator','EvqMc','submitButtonText','StyleSheet','create','center','space-between','600','IBM\x20Plex\x20Sans','#F0F9FF','#0369A1','#F3F4F6','#000','Inter','grey800','grey300','Menlo','monospace','dashed','grey600','#F0FDF4','#166534','#FEF2F2','#E5E7EB','#10B981'];_0x1fb8=function(){return _0x59eeb2;};return _0x1fb8();}const FILE_UPLOAD_AVAILABLE=DocumentPicker!==null&&RNFS!==null,LLMDataInputModal=({visible:_0x14b8d0,platform:_0x577e88,platformName:_0x4990ed,onClose:_0x128ad9,onSuccess:_0x1a75c6})=>{const _0x3703a3={'bFDzI':_0x46af(0x1f),'iyEPH':_0x46af(0x20),'ymHnJ':_0x46af(0x21),'rbexw':_0x46af(0x22),'zPxfs':_0x46af(0x23),'OASuy':_0x46af(0x24),'zlXnR':_0x46af(0x25),'kCBQd':_0x46af(0x26),'NYGIr':_0x46af(0x27),'KgHkE':_0x46af(0x28),'xqygn':'grok','dUZmB':_0x46af(0x29),'gssbY':_0x46af(0x2a),'bzEmT':_0x46af(0x2b),'xnwfo':_0x46af(0x2c),'aOoKr':_0x46af(0x2d),'SoGJy':function(_0x43e582,_0x16d996){return _0x43e582!==_0x16d996;},'dDMtZ':function(_0x32ede3,_0x2a7633){return _0x32ede3!==_0x2a7633;},'DSiFc':function(_0x3e1c0f,_0x1e80d4){return _0x3e1c0f!==_0x1e80d4;},'TDtin':function(_0x110a81,_0x1705f3){return _0x110a81!==_0x1705f3;},'svKsA':function(_0xd1f5bc,_0x416da0){return _0xd1f5bc===_0x416da0;},'qQOXI':function(_0x1f498e,_0x47b33a){return _0x1f498e===_0x47b33a;},'zUQXr':function(_0x338b7b,_0x40b9c0){return _0x338b7b*_0x40b9c0;},'yhQLK':_0x46af(0x4),'SEOyX':function(_0x479be1,_0x5ddffc){return _0x479be1!=_0x5ddffc;},'rktEs':'default','AjWni':function(_0x415673,_0x3b27b5,_0x13c01f,_0x46e976){return _0x415673(_0x3b27b5,_0x13c01f,_0x46e976);},'XJKdn':function(_0x460928,_0x5ba99e){return _0x460928(_0x5ba99e);},'fJfGY':function(_0x23dcd5,_0x40e002){return _0x23dcd5>_0x40e002;},'nSmVd':_0x46af(0x2e),'yjMod':function(_0x29dcf4,_0x149963){return _0x29dcf4+_0x149963;},'FyYSb':_0x46af(0x5),'kJcNK':function(_0x294759,_0x233caf){return _0x294759(_0x233caf);},'cGgdV':function(_0x526bde,_0x2bb141){return _0x526bde>_0x2bb141;},'SLlut':_0x46af(0x2f),'XZDBw':_0x46af(0x30),'NEZaP':function(_0x4ddb0d,_0x14271c){return _0x4ddb0d(_0x14271c);},'MjxzB':function(_0xe5fb95,_0x585c43){return _0xe5fb95>_0x585c43;},'xMauu':_0x46af(0x31),'ESFKE':_0x46af(0x32),'QNLNS':_0x46af(0x33),'duXIw':_0x46af(0x34),'mZfiX':function(_0x3bfb09,_0x326f28){return _0x3bfb09!==_0x326f28;},'SiUvy':_0x46af(0x1a),'XfgcD':_0x46af(0x19),'zjzmq':_0x46af(0x35),'XePrO':function(_0x1d6f8b,_0x44f4c6){return _0x1d6f8b===_0x44f4c6;},'JyDRm':_0x46af(0x36),'opvSw':function(_0x18c2cf,_0x146fa1){return _0x18c2cf===_0x146fa1;},'UpvQW':_0x46af(0x37),'enakd':_0x46af(0x38),'HPXqL':_0x46af(0x39),'zoyub':function(_0x17c549,_0x466b96){return _0x17c549(_0x466b96);},'kRNrn':function(_0x229317,_0x17e295){return _0x229317(_0x17e295);},'oPaaC':_0x46af(0x3a),'UIksG':_0x46af(0x3b),'jeIew':_0x46af(0x3c),'Qlkrp':'Rizmi','dvBSv':_0x46af(0x3d),'qNeGP':_0x46af(0x3e),'JAQHb':function(_0x362d6a,_0x207e28){return _0x362d6a(_0x207e28);},'jonMb':_0x46af(0x3f),'Fifei':_0x46af(0x40),'rJvCV':function(_0x221d89,_0x1c57ff){return _0x221d89(_0x1c57ff);},'BKCnU':_0x46af(0x41),'KCOnm':function(_0x13d12f,_0x1ae8cb){return _0x13d12f>_0x1ae8cb;},'SwkgL':function(_0x46aa36,_0x396078){return _0x46aa36!==_0x396078;},'vmuLX':function(_0x45d610,_0x4cc92b){return _0x45d610(_0x4cc92b);},'ZHoLx':_0x46af(0x42),'HImUM':function(_0x2d5789,_0x1aa5ef){return _0x2d5789!==_0x1aa5ef;},'FFqdU':_0x46af(0x43),'YWRex':function(_0x5317bf,_0x459e63){return _0x5317bf===_0x459e63;},'VOOqo':_0x46af(0x44),'sPXtZ':function(_0x5e64d1,_0x5f27e6){return _0x5e64d1(_0x5f27e6);},'jtokn':_0x46af(0x45),'feqie':function(_0xc9bb50,_0x38f169){return _0xc9bb50===_0x38f169;},'XmmUe':_0x46af(0x46),'rXowN':_0x46af(0x47),'wtgCN':_0x46af(0x48),'curPR':function(_0x2af38c,_0x5bbff3,_0x5f26ae){return _0x2af38c(_0x5bbff3,_0x5f26ae);},'JRkKs':_0x46af(0x49),'swWJV':_0x46af(0x4a),'gLQsl':_0x46af(0x4b),'Skmcf':_0x46af(0x4c),'RsGeo':_0x46af(0x4d),'eWAta':_0x46af(0x4e),'ThZEC':function(_0x4f63e0,_0x26ff44){return _0x4f63e0!==_0x26ff44;},'IrCfk':_0x46af(0x4f),'IzOHC':'Failed\x20to\x20import\x20any\x20conversations.\x20Please\x20check\x20your\x20data\x20format.','IcHgx':_0x46af(0x50),'cDfwv':_0x46af(0x51),'pGICJ':function(_0x195b69,_0x57f5c7){return _0x195b69!==_0x57f5c7;},'SBAfZ':function(_0x4a4bfe,_0x332a42){return _0x4a4bfe===_0x332a42;},'eEtwi':function(_0x219308,_0x27599e){return _0x219308===_0x27599e;},'hoGNB':_0x46af(0x52),'cNkMt':function(_0x1ea8c3,_0x2d7854){return _0x1ea8c3(_0x2d7854);},'YiGVn':function(_0x290c9d,_0x2df642){return _0x290c9d(_0x2df642);},'ejcZL':function(_0x230472,_0x519118){return _0x230472(_0x519118);},'XlxQx':_0x46af(0x53),'lpXPj':function(_0x45514a,_0x1d3baf){return _0x45514a&&_0x1d3baf;},'RbeQk':function(_0x5690ce,_0x4df2b0){return _0x5690ce!=_0x4df2b0;},'ofbgS':_0x46af(0x54),'aAoih':function(_0xd39a2f,_0x35b3d1){return _0xd39a2f(_0x35b3d1);},'GHOJq':function(_0x6388ac,_0x19e9c3){return _0x6388ac>_0x19e9c3;},'NBOQV':function(_0x27a362,_0x16934a){return _0x27a362(_0x16934a);},'oCQhE':_0x46af(0x55),'pSdJN':_0x46af(0x56),'iZKIh':function(_0x4d618b,_0x514248){return _0x4d618b!==_0x514248;},'foYfG':'nYYUG','ftkGd':function(_0x322e87,_0xdfeae9){return _0x322e87(_0xdfeae9);},'AXUdO':function(_0x22627e){return _0x22627e();},'VzMmg':_0x46af(0x57),'kSxtK':_0x46af(0x58),'wUvha':function(_0x420e28,_0x49fd4e){return _0x420e28===_0x49fd4e;},'KGUaT':_0x46af(0x59),'oVizL':'padding','mLgPZ':'height','QCphr':_0x46af(0x5a),'CbFEO':'handled','UKMuI':function(_0x1a1d78,_0x19334c){return _0x1a1d78===_0x19334c;},'NaWQT':function(_0x2dcf66,_0xbb71e4){return _0x2dcf66===_0xbb71e4;},'krFhV':function(_0x2ca39f,_0x39ce81){return _0x2ca39f===_0x39ce81;},'FNKvg':_0x46af(0x5b),'iOQFi':_0x46af(0x5c),'YZjOP':function(_0x49873e,_0x2a39cb){return _0x49873e||_0x2a39cb;},'kMXLN':_0x46af(0x5d),'CjMLj':'Data\x20Preview','iIoPb':function(_0x3c0491,_0x55938f){return _0x3c0491>_0x55938f;},'PdFXT':_0x46af(0x5e),'EvqMc':_0x46af(0x5f),'NhwAg':'Import\x20Conversations'},[_0x4d1dcd,_0x2b7dea]=(0x0,_react['useState'])(_0x3703a3[_0x46af(0x60)]),[_0x3d0aca,_0x255a96]=(0x0,_react[_0x46af(0x61)])(''),[_0x39bc74,_0x3470e8]=(0x0,_react[_0x46af(0x61)])(![]),[_0x41bb2f,_0x4be1c8]=(0x0,_react[_0x46af(0x61)])(null),[_0x4255ef,_0x428639]=(0x0,_react[_0x46af(0x61)])(null),[_0x4534c6,_0x22aee4]=(0x0,_react[_0x46af(0x61)])(null),_0x5c3ea5=()=>{switch(_0x577e88){case _0x3703a3[_0x46af(0x62)]:return{'title':_0x3703a3[_0x46af(0x63)],'instructions':_0x3703a3['ymHnJ'],'placeholder':_0x3703a3[_0x46af(0x64)]};case _0x46af(0x65):return{'title':_0x3703a3[_0x46af(0x66)],'instructions':'Export\x20your\x20Claude\x20conversations\x20and\x20paste\x20the\x20JSON\x20data\x20below,\x20or\x20upload\x20your\x20exported\x20file.','placeholder':_0x3703a3[_0x46af(0x67)]};case _0x3703a3[_0x46af(0x68)]:return{'title':_0x3703a3[_0x46af(0x69)],'instructions':_0x3703a3[_0x46af(0x6a)],'placeholder':_0x3703a3[_0x46af(0x6b)]};case _0x3703a3[_0x46af(0x6c)]:return{'title':_0x3703a3[_0x46af(0x6d)],'instructions':_0x3703a3[_0x46af(0x6e)],'placeholder':_0x3703a3[_0x46af(0x6f)]};default:return{'title':_0x46af(0x70)+_0x4990ed,'instructions':_0x3703a3[_0x46af(0x71)],'placeholder':_0x3703a3['aOoKr']};}},{title:_0xdd8b94,instructions:_0x44e1fa,placeholder:_0x29ec65}=_0x3703a3[_0x46af(0x72)](_0x5c3ea5),_0x285793=_0x3e6caf=>{const _0x4c44d8={'qNDbe':_0x3703a3['FyYSb'],'jEHhf':function(_0x763dcc,_0xcf19cb){return _0x3703a3[_0x46af(0x73)](_0x763dcc,_0xcf19cb);},'cMmfj':function(_0x28ead7,_0x135f66){return _0x3703a3[_0x46af(0x74)](_0x28ead7,_0x135f66);},'JCVyL':function(_0x5ecb4f,_0x366f16){return _0x3703a3[_0x46af(0x75)](_0x5ecb4f,_0x366f16);},'Kfmhz':'file','anIWq':function(_0x5f2b39,_0x202a3f){return _0x3703a3['XJKdn'](_0x5f2b39,_0x202a3f);},'xtCRR':_0x3703a3[_0x46af(0x76)]};if('YaTcJ'!==_0x3703a3[_0x46af(0x77)]){var _0x54f97a;if(_0x3703a3[_0x46af(0x78)](_0x5bdbd5,null)&&_0x3703a3[_0x46af(0x79)](_0x4dfcc9,void 0x0)&&_0x3703a3['DSiFc'](_0x54f97a=_0x3d05d5[_0x46af(0x7a)],null)&&_0x3703a3[_0x46af(0x7b)](_0x54f97a,void 0x0)&&(_0x54f97a=_0x54f97a[_0x46af(0x7c)])!==null&&_0x54f97a!==void 0x0&&_0x54f97a[_0x46af(0x7d)]){const _0x4e9130=_0x42c17b[_0x46af(0x7a)]['content']['parts'][_0x46af(0x7e)]('\x0a');if(_0x4e9130[_0x46af(0x7f)]()){var _0x136536;_0x348434[_0x46af(0x14)]({'id':_0x429e6d[_0x46af(0x7a)]['id']||'msg_'+_0x5f13ca,'role':(_0x3703a3[_0x46af(0x80)](_0x136536=_0x3de5db[_0x46af(0x7a)][_0x46af(0x81)],null)||_0x3703a3[_0x46af(0x82)](_0x136536,void 0x0)?void 0x0:_0x136536[_0x46af(0x83)])||_0x46af(0x36),'content':_0x4e9130,'timestamp':_0x133c94[_0x46af(0x7a)][_0x46af(0x84)]?new _0x4e82d5(_0x3703a3[_0x46af(0x85)](_0x1003e2['message'][_0x46af(0x84)],0x3e8))[_0x46af(0x86)]():_0x1e39f8});}}}else try{const _0x4db987=JSON[_0x46af(0x87)](_0x3e6caf),_0x2fe947=[];if(Array[_0x46af(0x88)](_0x4db987))_0x4db987['forEach']((_0xacfab5,_0x444366)=>{const _0x1914c7={'fyuOg':function(_0x3be6f7,_0x1e9d29){return _0x3be6f7(_0x1e9d29);},'Bctux':function(_0x23ebf3,_0x3a11ed){return _0x23ebf3&&_0x3a11ed;},'UxDZp':function(_0x33786e,_0x26f959){return _0x3703a3['qQOXI'](_0x33786e,_0x26f959);},'WpevA':function(_0x317cd6,_0x534caf){return _0x317cd6!=_0x534caf;},'kMxUX':_0x3703a3[_0x46af(0x89)],'QdAJO':function(_0xfd58b7,_0xa3abe0){return _0x3703a3[_0x46af(0x8a)](_0xfd58b7,_0xa3abe0);},'tFWkv':function(_0x364942,_0x189753){return _0x3703a3[_0x46af(0x8b)](_0x364942,_0x189753);},'vIUCW':_0x3703a3[_0x46af(0x8c)],'fVjPF':function(_0x1701c8,_0x44706d,_0x217ac9,_0x53cf20){return _0x3703a3[_0x46af(0x8d)](_0x1701c8,_0x44706d,_0x217ac9,_0x53cf20);}};if(_0x46af(0x8e)!==_0x46af(0x8f)){const _0x56ed2f=_0x3703a3['XJKdn'](_0x2ac171,_0xacfab5);_0x3703a3['fJfGY'](_0x56ed2f[_0x46af(0x90)],0x0)&&(_0x3703a3[_0x46af(0x91)]!==_0x3703a3['nSmVd']?_0x1914c7[_0x46af(0x92)](_0x1e7c90,![]):_0x2fe947[_0x46af(0x14)]({'conversationId':_0xacfab5['id']||_0xacfab5[_0x46af(0x93)]||'conv_'+_0x444366+'_'+Date[_0x46af(0x94)](),'messages':_0x56ed2f,'context':{'title':_0xacfab5['title']||_0xacfab5[_0x46af(0x95)]||_0x46af(0x96)+_0x3703a3['yjMod'](_0x444366,0x1),'create_time':_0xacfab5['create_time']||_0xacfab5['created_at'],'update_time':_0xacfab5['update_time']||_0xacfab5[_0x46af(0x97)]}}));}else{if(_0x4c44d8[_0x46af(0x98)]==typeof _0x182762)var _0x33853e=new _0xedcb69(),_0x581322=new _0x564c35();return(_0x313738=function(_0x25e3b8,_0x5bc2b2){if(_0x1914c7[_0x46af(0x99)](!_0x5bc2b2,_0x25e3b8)&&_0x25e3b8[_0x46af(0x1)])return _0x25e3b8;var _0x46fbbe,_0x825184,_0x5994b7={'__proto__':null,'default':_0x25e3b8};if(_0x1914c7[_0x46af(0x9a)](null,_0x25e3b8)||_0x1914c7[_0x46af(0x9b)](_0x1914c7[_0x46af(0x9c)],typeof _0x25e3b8)&&_0x1914c7['QdAJO'](_0x46af(0x5),typeof _0x25e3b8))return _0x5994b7;if(_0x46fbbe=_0x5bc2b2?_0x581322:_0x33853e){if(_0x46fbbe[_0x46af(0xc)](_0x25e3b8))return _0x46fbbe[_0x46af(0x11)](_0x25e3b8);_0x46fbbe[_0x46af(0x12)](_0x25e3b8,_0x5994b7);}for(const _0x37ea25 in _0x25e3b8)_0x1914c7[_0x46af(0x9d)](_0x1914c7[_0x46af(0x9e)],_0x37ea25)&&{}[_0x46af(0xe)][_0x46af(0xf)](_0x25e3b8,_0x37ea25)&&((_0x825184=(_0x46fbbe=_0x27c128[_0x46af(0x9f)])&&_0x33b590['getOwnPropertyDescriptor'](_0x25e3b8,_0x37ea25))&&(_0x825184[_0x46af(0x11)]||_0x825184[_0x46af(0x12)])?_0x1914c7[_0x46af(0xa0)](_0x46fbbe,_0x5994b7,_0x37ea25,_0x825184):_0x5994b7[_0x37ea25]=_0x25e3b8[_0x37ea25]);return _0x5994b7;})(_0x514a35,_0xa42bba);}});else{if(_0x4db987[_0x46af(0xa1)]&&Array[_0x46af(0x88)](_0x4db987[_0x46af(0xa1)]))_0x4db987[_0x46af(0xa1)][_0x46af(0xa2)]((_0x361d85,_0x8330e5)=>{const _0x42535f=_0x4c44d8[_0x46af(0xa3)](_0x2ac171,_0x361d85);_0x4c44d8[_0x46af(0xa4)](_0x42535f['length'],0x0)&&_0x2fe947[_0x46af(0x14)]({'conversationId':_0x361d85['id']||'conv_'+_0x8330e5+'_'+Date[_0x46af(0x94)](),'messages':_0x42535f,'context':{'title':_0x361d85[_0x46af(0xa5)]||_0x46af(0x96)+_0x4c44d8[_0x46af(0xa6)](_0x8330e5,0x1),'create_time':_0x361d85[_0x46af(0x84)],'update_time':_0x361d85[_0x46af(0xa7)]}});});else{if(_0x4db987[_0x46af(0xa8)]||_0x4db987[_0x46af(0xa9)]){const _0x4d5e09=_0x3703a3[_0x46af(0xaa)](_0x2ac171,_0x4db987);_0x3703a3['MjxzB'](_0x4d5e09['length'],0x0)&&_0x2fe947[_0x46af(0x14)]({'conversationId':_0x4db987['id']||_0x46af(0xab)+Date[_0x46af(0x94)](),'messages':_0x4d5e09,'context':{'title':_0x4db987[_0x46af(0xa5)]||_0x46af(0x34),'create_time':_0x4db987['create_time'],'update_time':_0x4db987[_0x46af(0xa7)]}});}else{if(_0x3703a3['qQOXI'](_0x3703a3['xMauu'],_0x3703a3['ESFKE']))_0x31d50a?(_0x4c44d8['jEHhf'](_0x182b89,_0x4c44d8['Kfmhz']),(0x0,_0xe02657[_0x46af(0xac)])(_0x464d2e['HapticType']['BUTTON_PRESS'])):(_0x4c44d8[_0x46af(0xad)](_0x861284,_0x4c44d8[_0x46af(0xae)]),(0x0,_0x364ad9[_0x46af(0xac)])(_0x1c94d9[_0x46af(0xaf)][_0x46af(0xb0)]));else{const _0x1beba9=_0x3703a3['NEZaP'](_0x2ac171,_0x4db987);if(_0x3703a3['fJfGY'](_0x1beba9[_0x46af(0x90)],0x0)){if(_0x3703a3[_0x46af(0x82)](_0x3703a3[_0x46af(0xb1)],'lnoiT')){const _0x5db8fd={'UUoMW':function(_0x515e69,_0x5d8342){return _0x3703a3[_0x46af(0xb2)](_0x515e69,_0x5d8342);}};_0x2e71b3[_0x46af(0xa2)]((_0x35cb30,_0x31ad1f)=>{const _0x4420bd=_0x3aa9b2(_0x35cb30);_0x5db8fd[_0x46af(0xb3)](_0x4420bd['length'],0x0)&&_0x2217aa['push']({'conversationId':_0x35cb30['id']||_0x35cb30[_0x46af(0x93)]||'conv_'+_0x31ad1f+'_'+_0x263101[_0x46af(0x94)](),'messages':_0x4420bd,'context':{'title':_0x35cb30[_0x46af(0xa5)]||_0x35cb30[_0x46af(0x95)]||_0x46af(0x96)+(_0x31ad1f+0x1),'create_time':_0x35cb30['create_time']||_0x35cb30[_0x46af(0x1d)],'update_time':_0x35cb30[_0x46af(0xa7)]||_0x35cb30['updated_at']}});});}else _0x2fe947[_0x46af(0x14)]({'conversationId':_0x46af(0xab)+Date[_0x46af(0x94)](),'messages':_0x1beba9,'context':{'title':_0x4db987[_0x46af(0xa5)]||_0x3703a3['duXIw']}});}}}}}return _0x2fe947;}catch(_0x357ec9){console[_0x46af(0xb4)](_0x46af(0xb5),_0x357ec9);throw new Error(_0x46af(0xb6));}},_0x2ac171=_0x1e35e2=>{const _0x29ad9d={'eTuPz':_0x3703a3[_0x46af(0xb7)],'YbVBI':function(_0x3469dc,_0x5ce73b){return _0x3469dc!==_0x5ce73b;},'pAjxd':function(_0x3a9575,_0x662111){return _0x3703a3[_0x46af(0x78)](_0x3a9575,_0x662111);},'HhEuc':function(_0x1cbf26,_0xf1a01a){return _0x3703a3[_0x46af(0xb8)](_0x1cbf26,_0xf1a01a);},'rySGP':_0x3703a3[_0x46af(0xb9)],'HAwmd':function(_0x4e4d2c,_0x575c5f){return _0x3703a3[_0x46af(0xba)](_0x4e4d2c,_0x575c5f);},'Bavri':function(_0x5174f4,_0x19137c){return _0x5174f4*_0x19137c;},'nZTRp':function(_0xe295c8,_0x4c772a){return _0x3703a3['qQOXI'](_0xe295c8,_0x4c772a);},'nGLPQ':_0x3703a3[_0x46af(0xbb)]},_0x112306=[];_0x1e35e2['mapping']&&Object[_0x46af(0xbc)](_0x1e35e2[_0x46af(0xa8)])[_0x46af(0xa2)]((_0x135633,_0x5ea294)=>{const _0x5ae8e1={'KILhZ':_0x29ad9d['eTuPz']};var _0x54badb;if(_0x135633!==null&&_0x29ad9d[_0x46af(0xbd)](_0x135633,void 0x0)&&_0x29ad9d[_0x46af(0xbe)](_0x54badb=_0x135633[_0x46af(0x7a)],null)&&_0x29ad9d[_0x46af(0xbf)](_0x54badb,void 0x0)&&(_0x54badb=_0x54badb[_0x46af(0x7c)])!==null&&_0x29ad9d[_0x46af(0xbd)](_0x54badb,void 0x0)&&_0x54badb['parts']){if(_0x29ad9d[_0x46af(0xbe)](_0x29ad9d['rySGP'],'ZIXOT')){const _0x5985a4=_0x135633[_0x46af(0x7a)]['content']['parts'][_0x46af(0x7e)]('\x0a');if(_0x5985a4[_0x46af(0x7f)]()){var _0x5939d9;_0x112306['push']({'id':_0x135633[_0x46af(0x7a)]['id']||_0x46af(0x16)+_0x5ea294,'role':((_0x5939d9=_0x135633['message'][_0x46af(0x81)])===null||_0x29ad9d[_0x46af(0xc0)](_0x5939d9,void 0x0)?void 0x0:_0x5939d9[_0x46af(0x83)])||'unknown','content':_0x5985a4,'timestamp':_0x135633['message'][_0x46af(0x84)]?new Date(_0x29ad9d[_0x46af(0xc1)](_0x135633[_0x46af(0x7a)][_0x46af(0x84)],0x3e8))['toISOString']():undefined});}}else _0x19496e[_0x46af(0x14)]({'id':_0x3a5e5d['id']||'msg_'+_0x3ab586,'role':_0x536256[_0x46af(0x83)]||_0x6c3418[_0x46af(0x81)]||_0x5ae8e1[_0x46af(0xc2)],'content':_0x2b830e,'timestamp':_0x5b7814[_0x46af(0xc3)]||_0x94cecb[_0x46af(0x1d)]});}});if(_0x1e35e2[_0x46af(0xa9)]&&Array[_0x46af(0x88)](_0x1e35e2['messages'])){if(_0x3703a3['opvSw'](_0x3703a3[_0x46af(0xc4)],_0x3703a3[_0x46af(0xc5)])){var _0x306ee0;_0x11cda9[_0x46af(0x14)]({'id':_0x47577e['message']['id']||_0x46af(0x16)+_0x7d4c03,'role':(_0x29ad9d['HAwmd'](_0x306ee0=_0x1a9c30[_0x46af(0x7a)][_0x46af(0x81)],null)||_0x29ad9d[_0x46af(0xc6)](_0x306ee0,void 0x0)?void 0x0:_0x306ee0['role'])||_0x29ad9d[_0x46af(0xc7)],'content':_0x286b16,'timestamp':_0x48ee39['message'][_0x46af(0x84)]?new _0x3089b2(_0x23106d[_0x46af(0x7a)][_0x46af(0x84)]*0x3e8)[_0x46af(0x86)]():_0x526211});}else _0x1e35e2[_0x46af(0xa9)][_0x46af(0xa2)]((_0x33ae19,_0x134604)=>{var _0x190132;const _0x4f64b9=_0x33ae19[_0x46af(0x7c)]||_0x33ae19[_0x46af(0x1c)]||_0x33ae19[_0x46af(0x7a)]||'';if(typeof _0x4f64b9===_0x46af(0x42)&&_0x4f64b9[_0x46af(0x7f)]())_0x112306[_0x46af(0x14)]({'id':_0x33ae19['id']||_0x46af(0x16)+_0x134604,'role':_0x33ae19[_0x46af(0x83)]||_0x33ae19[_0x46af(0x81)]||_0x46af(0x1a),'content':_0x4f64b9,'timestamp':_0x33ae19['timestamp']||_0x33ae19[_0x46af(0x1d)]});else _0x3703a3[_0x46af(0x7b)](_0x190132=_0x33ae19['content'],null)&&_0x3703a3[_0x46af(0xb8)](_0x190132,void 0x0)&&_0x190132[_0x46af(0x7d)]&&_0x112306[_0x46af(0x14)]({'id':_0x33ae19['id']||'msg_'+_0x134604,'role':_0x33ae19[_0x46af(0x83)]||_0x3703a3[_0x46af(0xb7)],'content':_0x33ae19['content'][_0x46af(0x7d)][_0x46af(0x7e)]('\x0a'),'timestamp':_0x33ae19[_0x46af(0xc3)]});});}if(_0x1e35e2[_0x46af(0xc8)]&&Array[_0x46af(0x88)](_0x1e35e2['chat_messages'])){if(_0x3703a3[_0x46af(0x78)](_0x3703a3['HPXqL'],_0x3703a3['HPXqL']))return _0x145a9c&&_0x426556[_0x46af(0x1)]?_0x35435f:{'default':_0x1f672c};else _0x1e35e2[_0x46af(0xc8)][_0x46af(0xa2)]((_0x54e2e5,_0x4d51e2)=>{(_0x54e2e5[_0x46af(0x1c)]||_0x54e2e5[_0x46af(0x7c)])&&_0x112306[_0x46af(0x14)]({'id':_0x54e2e5[_0x46af(0x15)]||_0x46af(0x16)+_0x4d51e2,'role':_0x54e2e5[_0x46af(0x18)]===_0x3703a3['XfgcD']?_0x46af(0x1a):_0x46af(0x43),'content':_0x54e2e5[_0x46af(0x1c)]||_0x54e2e5['content'],'timestamp':_0x54e2e5[_0x46af(0x1d)]});});}return _0x112306;},_0x5ee5e6=async()=>{if(!FILE_UPLOAD_AVAILABLE){_0x3703a3[_0x46af(0xc9)](_0x4be1c8,'File upload requires react-native-document-picker and react-native-fs. Please paste data instead.');return;}try{_0x3703a3[_0x46af(0xaa)](_0x4be1c8,null);const {pick:_0x4741d3,types:_0x46b7a4}=DocumentPicker,_0x5eb6ce=await _0x3703a3[_0x46af(0xca)](_0x4741d3,{'type':[_0x46b7a4[_0x46af(0xcb)],_0x46b7a4[_0x46af(0xcc)],_0x46b7a4[_0x46af(0xcd)]]});if(_0x5eb6ce&&_0x5eb6ce[0x0]){const _0x3eb295=_0x5eb6ce[0x0];_0x3703a3['XJKdn'](_0x428639,_0x3eb295[_0x46af(0x95)]||_0x3703a3[_0x46af(0xce)]);let _0x4be1ba;_0x3eb295[_0x46af(0xcf)][_0x46af(0xd0)](_0x3703a3[_0x46af(0xd1)])?_0x3703a3['jeIew']!==_0x3703a3[_0x46af(0xd2)]?_0x4be1ba=await RNFS['readFile'](_0x3eb295[_0x46af(0xcf)],_0x3703a3['dvBSv']):_0x3ff71a=_0x3703a3[_0x46af(0xc9)](_0x351e51,0x6):_0x3703a3[_0x46af(0xba)](_0x46af(0xd3),_0x3703a3[_0x46af(0xd4)])?_0x442898++:_0x4be1ba=await RNFS[_0x46af(0xd5)](_0x3eb295['uri'],_0x3703a3[_0x46af(0xd6)]),_0x3703a3['zoyub'](_0x22aee4,_0x4be1ba),_0x3703a3[_0x46af(0xd7)](_0x255a96,_0x4be1ba),(0x0,_haptics[_0x46af(0xac)])(_haptics[_0x46af(0xaf)][_0x46af(0xd8)]);}}catch(_0x549848){_0x549848[_0x46af(0xd9)]!==_0x3703a3['jonMb']&&(console['error'](_0x3703a3['Fifei'],_0x549848),_0x3703a3[_0x46af(0xda)](_0x4be1c8,_0x3703a3[_0x46af(0xdb)]),(0x0,_haptics['triggerHaptic'])(_haptics[_0x46af(0xaf)][_0x46af(0xb0)]));}},_0xc86038=async()=>{const _0x2d926b={'EAZBV':function(_0x53f550,_0x12da87){return _0x3703a3[_0x46af(0xdc)](_0x53f550,_0x12da87);},'ARhmS':_0x3703a3['jonMb'],'bbFEw':_0x46af(0x40),'VwAxb':function(_0x23d3e3,_0x16a18e){return _0x3703a3[_0x46af(0xdd)](_0x23d3e3,_0x16a18e);},'fXozt':function(_0x2174b9,_0x2164c5){return _0x3703a3[_0x46af(0x82)](_0x2174b9,_0x2164c5);},'KeKOv':_0x3703a3[_0x46af(0xde)],'QlHbo':_0x3703a3[_0x46af(0xb7)],'YyYiB':function(_0x218bc3,_0x7ffd12){return _0x3703a3[_0x46af(0xdf)](_0x218bc3,_0x7ffd12);},'ljbCI':_0x3703a3[_0x46af(0xe0)],'kpVee':_0x3703a3['FFqdU']},_0x4c35cc=_0x3703a3[_0x46af(0xe1)](_0x4d1dcd,_0x46af(0x56))&&_0x4534c6?_0x4534c6:_0x3d0aca;if(!_0x4c35cc['trim']()){_0x3703a3['JAQHb'](_0x4be1c8,_0x3703a3[_0x46af(0xe2)]),(0x0,_haptics[_0x46af(0xac)])(_haptics['HapticType'][_0x46af(0xb0)]);return;}_0x3703a3[_0x46af(0xe3)](_0x3470e8,!![]),_0x4be1c8(null);try{if(_0x3703a3[_0x46af(0xe1)](_0x3703a3['jtokn'],_0x46af(0xe4))){const _0x497eaa=_0x3703a3[_0x46af(0xe5)](_0x2643d1,_0x507ffb);_0x3703a3[_0x46af(0xe6)](_0x497eaa['length'],0x0)&&_0x3e85ad[_0x46af(0x14)]({'conversationId':_0x4e756e['id']||_0x46af(0xab)+_0xa5e422[_0x46af(0x94)](),'messages':_0x497eaa,'context':{'title':_0x50c47d[_0x46af(0xa5)]||_0x3703a3[_0x46af(0xe7)],'create_time':_0x40c96e['create_time'],'update_time':_0xa30f24[_0x46af(0xa7)]}});}else{const _0x62f08d=_0x3703a3[_0x46af(0xdd)](_0x285793,_0x4c35cc);if(_0x3703a3[_0x46af(0xe8)](_0x62f08d[_0x46af(0x90)],0x0))throw new Error(_0x3703a3[_0x46af(0xe9)]);const _0x42a5ae=await _asyncStorage[_0x46af(0x0)]['getItem'](_0x46af(0xea))||await _asyncStorage[_0x46af(0x0)]['getItem'](_0x3703a3[_0x46af(0xeb)])||await _asyncStorage['default'][_0x46af(0xec)](_0x46af(0xed));if(!_0x42a5ae)throw new Error(_0x3703a3['wtgCN']);const _0x4e3065=_0x46af(0xee)+_0x577e88;let _0x45966c=0x0;for(const _0xa11261 of _0x62f08d){try{const _0x2812de=await _0x3703a3['curPR'](fetch,_api[_0x46af(0xef)][_0x46af(0xf0)]+_0x46af(0xf1),{'method':'POST','headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+_0x42a5ae},'body':JSON['stringify']({'platform':_0x4e3065,'conversationData':{'conversationId':_0xa11261[_0x46af(0xf2)],'messages':_0xa11261[_0x46af(0xa9)],'context':_0xa11261['context'],'mobileMetadata':{'platform':_reactNative[_0x46af(0xf3)]['OS'],'appVersion':_0x3703a3[_0x46af(0xf4)],'osVersion':_reactNative[_0x46af(0xf3)]['Version'],'isOfflineSync':![]}},'memoryType':_0x3703a3[_0x46af(0xf5)],'metadata':{'source':_0x3703a3[_0x46af(0xf6)],'importedAt':new Date()[_0x46af(0x86)](),'originalPlatform':_0x577e88}})});if(_0x2812de['ok'])_0x45966c++;else{const _0x102f8a=await _0x2812de['text']();console[_0x46af(0xb4)]('Failed\x20to\x20store\x20conversation\x20'+_0xa11261[_0x46af(0xf2)]+':',_0x102f8a);}}catch(_0x5c72d3){_0x3703a3[_0x46af(0xe1)](_0x3703a3['Skmcf'],_0x3703a3['Skmcf'])?console[_0x46af(0xb4)](_0x46af(0xf7),_0x5c72d3):_0x2d926b[_0x46af(0xf8)](_0x37879c[_0x46af(0xd9)],_0x2d926b[_0x46af(0xf9)])&&(_0x298fc0[_0x46af(0xb4)](_0x2d926b['bbFEw'],_0x3d9622),_0x2d926b['VwAxb'](_0x211435,'Failed\x20to\x20read\x20file.\x20Please\x20try\x20again\x20or\x20paste\x20data\x20manually.'),(0x0,_0x3e598c[_0x46af(0xac)])(_0x129aab[_0x46af(0xaf)][_0x46af(0xb0)]));}}if(_0x45966c>0x0)_0x3703a3[_0x46af(0xdf)](_0x46af(0xfa),_0x3703a3[_0x46af(0xfb)])?(await _asyncStorage[_0x46af(0x0)]['setItem']('@onairos:llm_connected:'+_0x577e88,JSON['stringify']({'connected':!![],'platform':_0x577e88,'conversationsCount':_0x45966c,'lastSyncAt':new Date()[_0x46af(0x86)]()})),(0x0,_haptics[_0x46af(0xac)])(_haptics['HapticType'][_0x46af(0xd8)]),_reactNative[_0x46af(0xfc)][_0x46af(0xfd)](_0x3703a3[_0x46af(0xfe)],_0x46af(0xff)+_0x45966c+'\x20conversation'+(_0x3703a3[_0x46af(0xe6)](_0x45966c,0x1)?'s':'')+_0x46af(0x100)+_0x4990ed+'.',[{'text':'OK','onPress':()=>_0x1a75c6(_0x577e88)}])):_0x4d96f7['messages'][_0x46af(0xa2)]((_0x519779,_0x57d49b)=>{var _0x546d89;const _0x5a71aa=_0x519779['content']||_0x519779[_0x46af(0x1c)]||_0x519779[_0x46af(0x7a)]||'';if(_0x2d926b['fXozt'](typeof _0x5a71aa,_0x2d926b[_0x46af(0x101)])&&_0x5a71aa[_0x46af(0x7f)]())_0x5755a4[_0x46af(0x14)]({'id':_0x519779['id']||_0x46af(0x16)+_0x57d49b,'role':_0x519779[_0x46af(0x83)]||_0x519779[_0x46af(0x81)]||_0x2d926b[_0x46af(0x102)],'content':_0x5a71aa,'timestamp':_0x519779[_0x46af(0xc3)]||_0x519779[_0x46af(0x1d)]});else _0x2d926b['EAZBV'](_0x546d89=_0x519779[_0x46af(0x7c)],null)&&_0x2d926b[_0x46af(0x103)](_0x546d89,void 0x0)&&_0x546d89[_0x46af(0x7d)]&&_0x167116[_0x46af(0x14)]({'id':_0x519779['id']||'msg_'+_0x57d49b,'role':_0x519779[_0x46af(0x83)]||_0x2d926b[_0x46af(0x102)],'content':_0x519779['content'][_0x46af(0x7d)][_0x46af(0x7e)]('\x0a'),'timestamp':_0x519779['timestamp']});});else{if(_0x3703a3[_0x46af(0x104)](_0x3703a3[_0x46af(0x105)],_0x46af(0x106)))throw new Error(_0x3703a3[_0x46af(0x107)]);else _0x59a087['chat_messages'][_0x46af(0xa2)]((_0x3def86,_0x2fb351)=>{(_0x3def86[_0x46af(0x1c)]||_0x3def86[_0x46af(0x7c)])&&_0x5a2ce0[_0x46af(0x14)]({'id':_0x3def86[_0x46af(0x15)]||_0x46af(0x16)+_0x2fb351,'role':_0x3def86[_0x46af(0x18)]===_0x2d926b[_0x46af(0x108)]?_0x2d926b[_0x46af(0x102)]:_0x2d926b[_0x46af(0x109)],'content':_0x3def86[_0x46af(0x1c)]||_0x3def86[_0x46af(0x7c)],'timestamp':_0x3def86[_0x46af(0x1d)]});});}}}catch(_0x4ccd52){console[_0x46af(0xb4)](_0x3703a3['IcHgx'],_0x4ccd52),_0x4be1c8(_0x4ccd52[_0x46af(0x7a)]||_0x3703a3[_0x46af(0x10a)]),(0x0,_haptics['triggerHaptic'])(_haptics[_0x46af(0xaf)][_0x46af(0xb0)]);}finally{_0x3703a3[_0x46af(0xaa)](_0x3470e8,![]);}},_0xb6c72b=()=>{const _0x184be9={'dYcod':function(_0x50cd22,_0x5e0aad){return _0x3703a3[_0x46af(0x79)](_0x50cd22,_0x5e0aad);},'otmFc':function(_0x31c1ff,_0x46e301){return _0x31c1ff!==_0x46e301;},'syyeI':function(_0x45abe7,_0x1e16de){return _0x3703a3[_0x46af(0x10b)](_0x45abe7,_0x1e16de);},'dTGlx':function(_0x36ac54,_0x175da9){return _0x3703a3[_0x46af(0x10c)](_0x36ac54,_0x175da9);},'wJIvz':function(_0x46f6cf,_0xa510dc){return _0x3703a3[_0x46af(0x10d)](_0x46f6cf,_0xa510dc);},'huoYM':_0x3703a3[_0x46af(0xbb)],'gAsgZ':function(_0x5cb90f,_0x121447){return _0x3703a3[_0x46af(0x85)](_0x5cb90f,_0x121447);}};_0x3703a3[_0x46af(0xe1)](_0x3703a3['hoGNB'],_0x46af(0x52))?(_0x3703a3[_0x46af(0x10e)](_0x255a96,''),_0x22aee4(null),_0x3703a3[_0x46af(0x10f)](_0x428639,null),_0x3703a3[_0x46af(0xd7)](_0x4be1c8,null),_0x3703a3['ejcZL'](_0x2b7dea,_0x3703a3[_0x46af(0x60)]),_0x128ad9()):_0x450411[_0x46af(0xbc)](_0x5d5ff8[_0x46af(0xa8)])[_0x46af(0xa2)]((_0x4cd094,_0x1f418b)=>{var _0x1b9a42;if(_0x184be9[_0x46af(0x110)](_0x4cd094,null)&&_0x184be9[_0x46af(0x110)](_0x4cd094,void 0x0)&&_0x184be9[_0x46af(0x111)](_0x1b9a42=_0x4cd094[_0x46af(0x7a)],null)&&_0x184be9['dYcod'](_0x1b9a42,void 0x0)&&_0x184be9[_0x46af(0x110)](_0x1b9a42=_0x1b9a42[_0x46af(0x7c)],null)&&_0x184be9[_0x46af(0x112)](_0x1b9a42,void 0x0)&&_0x1b9a42[_0x46af(0x7d)]){const _0x1ff345=_0x4cd094['message'][_0x46af(0x7c)][_0x46af(0x7d)]['join']('\x0a');if(_0x1ff345[_0x46af(0x7f)]()){var _0x45405f;_0x27a089[_0x46af(0x14)]({'id':_0x4cd094[_0x46af(0x7a)]['id']||_0x46af(0x16)+_0x1f418b,'role':(_0x184be9[_0x46af(0x113)](_0x45405f=_0x4cd094[_0x46af(0x7a)][_0x46af(0x81)],null)||_0x184be9[_0x46af(0x114)](_0x45405f,void 0x0)?void 0x0:_0x45405f[_0x46af(0x83)])||_0x184be9['huoYM'],'content':_0x1ff345,'timestamp':_0x4cd094['message'][_0x46af(0x84)]?new _0x20c784(_0x184be9['gAsgZ'](_0x4cd094[_0x46af(0x7a)][_0x46af(0x84)],0x3e8))['toISOString']():_0x29f79d});}}});};return _react[_0x46af(0x0)]['createElement'](_reactNative['Modal'],{'visible':_0x14b8d0,'animationType':_0x3703a3[_0x46af(0x115)],'presentationStyle':_0x3703a3['kSxtK'],'onRequestClose':_0xb6c72b},_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x117)],{'style':styles['container'],'behavior':_0x3703a3['wUvha'](_reactNative[_0x46af(0xf3)]['OS'],_0x3703a3[_0x46af(0x118)])?_0x3703a3[_0x46af(0x119)]:_0x3703a3[_0x46af(0x11a)]},_react[_0x46af(0x0)]['createElement'](_reactNative[_0x46af(0x11b)],{'style':styles[_0x46af(0x11c)]},_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11d)],{'style':styles[_0x46af(0x11e)],'onPress':_0xb6c72b},_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11f)],{'style':styles[_0x46af(0x120)]},_0x3703a3[_0x46af(0x121)])),_react[_0x46af(0x0)]['createElement'](_reactNative[_0x46af(0x11f)],{'style':styles[_0x46af(0x122)]},_0xdd8b94),_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative['View'],{'style':styles[_0x46af(0x11e)]})),_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x123)],{'style':styles[_0x46af(0x7c)],'contentContainerStyle':styles[_0x46af(0x124)],'keyboardShouldPersistTaps':_0x3703a3['CbFEO']},_react['default'][_0x46af(0x116)](_reactNative[_0x46af(0x11b)],{'style':styles[_0x46af(0x125)]},_react[_0x46af(0x0)]['createElement'](_reactNative[_0x46af(0x11f)],{'style':styles[_0x46af(0x126)]},_0x44e1fa)),_react[_0x46af(0x0)]['createElement'](_reactNative[_0x46af(0x11b)],{'style':styles[_0x46af(0x127)]},_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative['TouchableOpacity'],{'style':[styles[_0x46af(0x128)],_0x3703a3[_0x46af(0x129)](_0x4d1dcd,_0x3703a3[_0x46af(0x60)])&&styles[_0x46af(0x12a)]],'onPress':()=>{if(_0x3703a3[_0x46af(0xdc)](_0x46af(0x54),_0x3703a3['ofbgS'])){if(_0x3703a3[_0x46af(0x12b)](!_0x59d2c6,_0x12b3fa)&&_0x531eb7[_0x46af(0x1)])return _0x56b1a3;var _0x4307ef,_0x45a624,_0x8c89c0={'__proto__':null,'default':_0x23cabe};if(_0x3703a3[_0x46af(0x12c)](null,_0x1693e2)||_0x3703a3[_0x46af(0x8a)](_0x3703a3[_0x46af(0x89)],typeof _0x4231e0)&&_0x3703a3[_0x46af(0x12d)](_0x3703a3[_0x46af(0x12e)],typeof _0x38062d))return _0x8c89c0;if(_0x4307ef=_0xfa3ab6?_0x558532:_0x333b9e){if(_0x4307ef[_0x46af(0xc)](_0x5b8b2f))return _0x4307ef['get'](_0x38b153);_0x4307ef[_0x46af(0x12)](_0x3bbaee,_0x8c89c0);}for(const _0x579195 in _0x2947b2)_0x3703a3['SoGJy']('default',_0x579195)&&{}[_0x46af(0xe)][_0x46af(0xf)](_0xd05a9a,_0x579195)&&((_0x45a624=(_0x4307ef=_0x214c3e['defineProperty'])&&_0x59df0f[_0x46af(0x10)](_0x448010,_0x579195))&&(_0x45a624[_0x46af(0x11)]||_0x45a624[_0x46af(0x12)])?_0x3703a3[_0x46af(0x8d)](_0x4307ef,_0x8c89c0,_0x579195,_0x45a624):_0x8c89c0[_0x579195]=_0x3e667e[_0x579195]);return _0x8c89c0;}else _0x2b7dea(_0x3703a3[_0x46af(0x60)]),(0x0,_haptics[_0x46af(0xac)])(_haptics[_0x46af(0xaf)][_0x46af(0x12f)]);}},_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11f)],{'style':[styles['tabText'],_0x4d1dcd===_0x3703a3[_0x46af(0x60)]&&styles[_0x46af(0x130)]]},_0x46af(0x131))),_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11d)],{'style':[styles['tab'],_0x3703a3['NaWQT'](_0x4d1dcd,_0x3703a3[_0x46af(0x132)])&&styles[_0x46af(0x12a)],!FILE_UPLOAD_AVAILABLE&&styles[_0x46af(0x133)]],'onPress':()=>{const _0x123705={'gDSyK':function(_0xa2d5fa,_0x5cf294){return _0x3703a3[_0x46af(0x134)](_0xa2d5fa,_0x5cf294);},'VFwjH':function(_0x3a0789,_0x50f489){return _0x3703a3['GHOJq'](_0x3a0789,_0x50f489);},'GEKEj':function(_0x3826a2,_0x506a5f){return _0x3703a3['yjMod'](_0x3826a2,_0x506a5f);},'wFxsQ':function(_0xed2d8c,_0x1b3998){return _0x3703a3[_0x46af(0x135)](_0xed2d8c,_0x1b3998);}};if(FILE_UPLOAD_AVAILABLE){if(_0x3703a3[_0x46af(0x7b)](_0x3703a3['oCQhE'],_0x3703a3[_0x46af(0x136)])){const _0x2658ad=_0x123705['gDSyK'](_0x55dc07,_0x462287);_0x123705[_0x46af(0x137)](_0x2658ad[_0x46af(0x90)],0x0)&&_0x6eed9a[_0x46af(0x14)]({'conversationId':_0x1e819a['id']||_0x46af(0xab)+_0x3c33ba+'_'+_0x2fad71['now'](),'messages':_0x2658ad,'context':{'title':_0x37fbae[_0x46af(0xa5)]||_0x46af(0x96)+_0x123705['GEKEj'](_0xfe7749,0x1),'create_time':_0xed54b1[_0x46af(0x84)],'update_time':_0x13902d[_0x46af(0xa7)]}});}else _0x3703a3[_0x46af(0x135)](_0x2b7dea,_0x3703a3['pSdJN']),(0x0,_haptics['triggerHaptic'])(_haptics[_0x46af(0xaf)]['BUTTON_PRESS']);}else{if(_0x3703a3[_0x46af(0x138)](_0x46af(0x139),_0x3703a3['foYfG']))_0x3703a3['ftkGd'](_0x4be1c8,_0x3703a3['SLlut']),(0x0,_haptics['triggerHaptic'])(_haptics['HapticType']['ERROR']);else{const _0x38eeda=_0x123705[_0x46af(0x13a)](_0x32fa6a,_0x2d4e7a);_0x38eeda['length']>0x0&&_0x56844e[_0x46af(0x14)]({'conversationId':_0x46af(0xab)+_0xe9fa44['now'](),'messages':_0x38eeda,'context':{'title':_0x35dc20[_0x46af(0xa5)]||'Imported\x20Conversation'}});}}}},_react['default'][_0x46af(0x116)](_reactNative[_0x46af(0x11f)],{'style':[styles['tabText'],_0x3703a3[_0x46af(0x13b)](_0x4d1dcd,_0x3703a3[_0x46af(0x132)])&&styles['tabTextActive'],!FILE_UPLOAD_AVAILABLE&&styles[_0x46af(0x13c)]]},_0x3703a3[_0x46af(0x13d)],!FILE_UPLOAD_AVAILABLE&&_0x3703a3[_0x46af(0x13e)]))),_0x3703a3[_0x46af(0x13f)](_0x4d1dcd,_0x3703a3[_0x46af(0x60)])?_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11b)],{'style':styles[_0x46af(0x140)]},_react[_0x46af(0x0)]['createElement'](_reactNative['TextInput'],{'style':styles['textInput'],'multiline':!![],'placeholder':_0x29ec65,'placeholderTextColor':_theme[_0x46af(0x141)][_0x46af(0x142)],'value':_0x3d0aca,'onChangeText':_0x255a96,'textAlignVertical':_0x46af(0x143),'autoCapitalize':'none','autoCorrect':![]})):_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative['View'],{'style':styles[_0x46af(0x144)]},_react[_0x46af(0x0)]['createElement'](_reactNative[_0x46af(0x11d)],{'style':styles[_0x46af(0x145)],'onPress':_0x5ee5e6},_react['default'][_0x46af(0x116)](_reactNative[_0x46af(0x11f)],{'style':styles[_0x46af(0x146)]},'📁'),_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11f)],{'style':styles['filePickText']},_0x3703a3[_0x46af(0x147)](_0x4255ef,_0x3703a3[_0x46af(0x148)]))),_0x4255ef&&_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative['View'],{'style':styles[_0x46af(0x149)]},_react[_0x46af(0x0)]['createElement'](_reactNative[_0x46af(0x11f)],{'style':styles[_0x46af(0x14a)]},'✓\x20',_0x4255ef))),_0x41bb2f&&_react['default'][_0x46af(0x116)](_reactNative[_0x46af(0x11b)],{'style':styles['errorContainer']},_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11f)],{'style':styles[_0x46af(0x14b)]},_0x41bb2f)),_0x3703a3[_0x46af(0x14c)](_0x3d0aca['length'],0x0)&&_react[_0x46af(0x0)]['createElement'](_reactNative[_0x46af(0x11b)],{'style':styles[_0x46af(0x14d)]},_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11f)],{'style':styles[_0x46af(0x14e)]},_0x3703a3['CjMLj']),_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11f)],{'style':styles['previewText'],'numberOfLines':0x5},_0x3d0aca[_0x46af(0x14f)](0x0,0x1f4),_0x3703a3[_0x46af(0x150)](_0x3d0aca[_0x46af(0x90)],0x1f4)?_0x46af(0x151):''),_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative[_0x46af(0x11f)],{'style':styles['previewInfo']},_0x3d0aca[_0x46af(0x90)][_0x46af(0x152)](),_0x3703a3[_0x46af(0x153)]))),_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative['View'],{'style':styles[_0x46af(0x154)]},_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative['TouchableOpacity'],{'style':[styles[_0x46af(0x155)],(!_0x3d0aca['trim']()||_0x39bc74)&&styles[_0x46af(0x156)]],'onPress':_0xc86038,'disabled':!_0x3d0aca[_0x46af(0x7f)]()||_0x39bc74},_0x39bc74?_react['default'][_0x46af(0x116)](_reactNative[_0x46af(0x157)],{'color':_0x3703a3[_0x46af(0x158)],'size':'small'}):_react[_0x46af(0x0)][_0x46af(0x116)](_reactNative['Text'],{'style':styles[_0x46af(0x159)]},_0x3703a3['NhwAg'])))));},styles=_reactNative[_0x46af(0x15a)][_0x46af(0x15b)]({'container':{'flex':0x1,'backgroundColor':_theme[_0x46af(0x141)]['surface']},'header':{'flexDirection':'row','alignItems':_0x46af(0x15c),'justifyContent':_0x46af(0x15d),'paddingHorizontal':0x10,'paddingTop':_reactNative[_0x46af(0xf3)]['OS']==='ios'?0xc:0x10,'paddingBottom':0xc,'borderBottomWidth':0x1,'borderBottomColor':'#E5E7EB'},'headerTitle':{'fontSize':0x11,'fontWeight':_0x46af(0x15e),'color':_theme[_0x46af(0x141)]['grey800'],'fontFamily':_0x46af(0x15f)},'closeButton':{'width':0x3c},'closeButtonText':{'fontSize':0x10,'color':'#3B82F6','fontFamily':'Inter'},'content':{'flex':0x1},'contentContainer':{'padding':0x14,'paddingBottom':0x28},'instructionsContainer':{'backgroundColor':_0x46af(0x160),'borderRadius':0xc,'padding':0x10,'marginBottom':0x14},'instructionsText':{'fontSize':0xe,'lineHeight':0x14,'color':_0x46af(0x161),'fontFamily':'Inter'},'tabContainer':{'flexDirection':'row','backgroundColor':_0x46af(0x162),'borderRadius':0xa,'padding':0x4,'marginBottom':0x14},'tab':{'flex':0x1,'paddingVertical':0xa,'borderRadius':0x8,'alignItems':_0x46af(0x15c)},'tabActive':{'backgroundColor':_0x46af(0x5f),'shadowColor':_0x46af(0x163),'shadowOffset':{'width':0x0,'height':0x1},'shadowOpacity':0.1,'shadowRadius':0x2,'elevation':0x2},'tabText':{'fontSize':0xe,'fontWeight':'500','color':_theme[_0x46af(0x141)]['grey500'],'fontFamily':_0x46af(0x164)},'tabTextActive':{'color':_theme[_0x46af(0x141)][_0x46af(0x165)]},'tabDisabled':{'opacity':0.5},'tabTextDisabled':{'color':_theme[_0x46af(0x141)][_0x46af(0x142)]},'inputContainer':{'marginBottom':0x14},'textInput':{'backgroundColor':_0x46af(0x5f),'borderWidth':0x1,'borderColor':_theme[_0x46af(0x141)][_0x46af(0x166)],'borderRadius':0xc,'padding':0x10,'minHeight':0xc8,'fontSize':0xe,'fontFamily':_reactNative[_0x46af(0xf3)]['OS']===_0x46af(0x59)?_0x46af(0x167):_0x46af(0x168),'color':_theme[_0x46af(0x141)][_0x46af(0x165)]},'fileInputContainer':{'marginBottom':0x14},'filePickButton':{'backgroundColor':_0x46af(0x5f),'borderWidth':0x2,'borderColor':_theme['COLORS'][_0x46af(0x166)],'borderStyle':_0x46af(0x169),'borderRadius':0xc,'padding':0x28,'alignItems':_0x46af(0x15c),'justifyContent':'center'},'filePickIcon':{'fontSize':0x28,'marginBottom':0xc},'filePickText':{'fontSize':0xf,'color':_theme[_0x46af(0x141)][_0x46af(0x16a)],'fontFamily':'Inter'},'fileSelectedContainer':{'marginTop':0xc,'backgroundColor':_0x46af(0x16b),'borderRadius':0x8,'padding':0xc},'fileSelectedText':{'fontSize':0xe,'color':_0x46af(0x16c),'fontFamily':'Inter','fontWeight':'500'},'errorContainer':{'backgroundColor':_0x46af(0x16d),'borderRadius':0x8,'padding':0xc,'marginBottom':0x10},'errorText':{'fontSize':0xe,'color':'#DC2626','fontFamily':_0x46af(0x164)},'previewContainer':{'backgroundColor':_0x46af(0x162),'borderRadius':0xc,'padding':0x10},'previewTitle':{'fontSize':0xe,'fontWeight':_0x46af(0x15e),'color':_theme[_0x46af(0x141)][_0x46af(0x165)],'marginBottom':0x8,'fontFamily':_0x46af(0x164)},'previewText':{'fontSize':0xc,'color':_theme[_0x46af(0x141)][_0x46af(0x16a)],'fontFamily':_reactNative[_0x46af(0xf3)]['OS']==='ios'?_0x46af(0x167):'monospace','lineHeight':0x12},'previewInfo':{'fontSize':0xc,'color':_theme[_0x46af(0x141)]['grey500'],'marginTop':0x8,'fontFamily':_0x46af(0x164)},'footer':{'padding':0x14,'paddingBottom':_reactNative[_0x46af(0xf3)]['OS']===_0x46af(0x59)?0x22:0x14,'borderTopWidth':0x1,'borderTopColor':_0x46af(0x16e),'backgroundColor':_theme[_0x46af(0x141)]['surface']},'submitButton':{'backgroundColor':_0x46af(0x16f),'borderRadius':0xc,'paddingVertical':0x10,'alignItems':_0x46af(0x15c),'justifyContent':'center'},'submitButtonDisabled':{'backgroundColor':_theme['COLORS'][_0x46af(0x166)]},'submitButtonText':{'fontSize':0x10,'fontWeight':_0x46af(0x15e),'color':_0x46af(0x5f),'fontFamily':'Inter'}});var _default=exports[_0x46af(0x0)]=LLMDataInputModal;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _theme = require("../theme");
10
+ var _haptics = require("../utils/haptics");
11
+ var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
12
+ var _api = require("../config/api");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
+ /**
16
+ * LLMDataInputModal.tsx
17
+ *
18
+ * Modal for inputting LLM conversation data via file upload or paste.
19
+ * Supports ChatGPT, Claude, Gemini, and Grok data formats.
20
+ */
21
+
22
+ // Optional dependencies - file upload won't work without them
23
+ let DocumentPicker = null;
24
+ let RNFS = null;
25
+ try {
26
+ DocumentPicker = require('react-native-document-picker');
27
+ } catch (e) {
28
+ console.log('react-native-document-picker not available - file upload disabled');
29
+ }
30
+ try {
31
+ RNFS = require('react-native-fs');
32
+ } catch (e) {
33
+ console.log('react-native-fs not available - file upload disabled');
34
+ }
35
+ const FILE_UPLOAD_AVAILABLE = DocumentPicker !== null && RNFS !== null;
36
+ const LLMDataInputModal = ({
37
+ visible,
38
+ platform,
39
+ platformName,
40
+ onClose,
41
+ onSuccess
42
+ }) => {
43
+ const [inputMode, setInputMode] = (0, _react.useState)('paste');
44
+ const [pastedData, setPastedData] = (0, _react.useState)('');
45
+ const [isLoading, setIsLoading] = (0, _react.useState)(false);
46
+ const [error, setError] = (0, _react.useState)(null);
47
+ const [selectedFileName, setSelectedFileName] = (0, _react.useState)(null);
48
+ const [fileContent, setFileContent] = (0, _react.useState)(null);
49
+
50
+ // Get platform-specific instructions
51
+ const getInstructions = () => {
52
+ switch (platform) {
53
+ case 'chatgpt':
54
+ return {
55
+ title: 'Connect ChatGPT',
56
+ instructions: 'Export your ChatGPT conversations from Settings → Data Controls → Export data. Then upload the JSON file or paste your conversation data.',
57
+ placeholder: 'Paste your ChatGPT conversation JSON here...'
58
+ };
59
+ case 'claude':
60
+ return {
61
+ title: 'Connect Claude',
62
+ instructions: 'Export your Claude conversations and paste the JSON data below, or upload your exported file.',
63
+ placeholder: 'Paste your Claude conversation JSON here...'
64
+ };
65
+ case 'gemini':
66
+ return {
67
+ title: 'Connect Gemini',
68
+ instructions: 'Export your Gemini (Google AI) conversations and paste the data below.',
69
+ placeholder: 'Paste your Gemini conversation JSON here...'
70
+ };
71
+ case 'grok':
72
+ return {
73
+ title: 'Connect Grok',
74
+ instructions: 'Export your Grok conversations from X/Twitter and paste the data below.',
75
+ placeholder: 'Paste your Grok conversation JSON here...'
76
+ };
77
+ default:
78
+ return {
79
+ title: `Connect ${platformName}`,
80
+ instructions: 'Paste your conversation data below or upload a JSON file.',
81
+ placeholder: 'Paste your conversation JSON here...'
82
+ };
83
+ }
84
+ };
85
+ const {
86
+ title,
87
+ instructions,
88
+ placeholder
89
+ } = getInstructions();
90
+
91
+ // Parse conversation data based on platform format
92
+ const parseConversationData = data => {
93
+ try {
94
+ const parsed = JSON.parse(data);
95
+ const conversations = [];
96
+
97
+ // Handle ChatGPT export format
98
+ if (Array.isArray(parsed)) {
99
+ // Array of conversations
100
+ parsed.forEach((conv, index) => {
101
+ const messages = extractMessages(conv);
102
+ if (messages.length > 0) {
103
+ conversations.push({
104
+ conversationId: conv.id || conv.conversation_id || `conv_${index}_${Date.now()}`,
105
+ messages,
106
+ context: {
107
+ title: conv.title || conv.name || `Conversation ${index + 1}`,
108
+ create_time: conv.create_time || conv.created_at,
109
+ update_time: conv.update_time || conv.updated_at
110
+ }
111
+ });
112
+ }
113
+ });
114
+ } else if (parsed.conversations && Array.isArray(parsed.conversations)) {
115
+ // ChatGPT export with conversations array
116
+ parsed.conversations.forEach((conv, index) => {
117
+ const messages = extractMessages(conv);
118
+ if (messages.length > 0) {
119
+ conversations.push({
120
+ conversationId: conv.id || `conv_${index}_${Date.now()}`,
121
+ messages,
122
+ context: {
123
+ title: conv.title || `Conversation ${index + 1}`,
124
+ create_time: conv.create_time,
125
+ update_time: conv.update_time
126
+ }
127
+ });
128
+ }
129
+ });
130
+ } else if (parsed.mapping || parsed.messages) {
131
+ // Single conversation format
132
+ const messages = extractMessages(parsed);
133
+ if (messages.length > 0) {
134
+ conversations.push({
135
+ conversationId: parsed.id || `conv_${Date.now()}`,
136
+ messages,
137
+ context: {
138
+ title: parsed.title || 'Imported Conversation',
139
+ create_time: parsed.create_time,
140
+ update_time: parsed.update_time
141
+ }
142
+ });
143
+ }
144
+ } else {
145
+ // Try to handle as a single object with message array
146
+ const messages = extractMessages(parsed);
147
+ if (messages.length > 0) {
148
+ conversations.push({
149
+ conversationId: `conv_${Date.now()}`,
150
+ messages,
151
+ context: {
152
+ title: parsed.title || 'Imported Conversation'
153
+ }
154
+ });
155
+ }
156
+ }
157
+ return conversations;
158
+ } catch (e) {
159
+ console.error('Error parsing conversation data:', e);
160
+ throw new Error('Invalid JSON format. Please check your data and try again.');
161
+ }
162
+ };
163
+
164
+ // Extract messages from various formats
165
+ const extractMessages = conv => {
166
+ const messages = [];
167
+
168
+ // ChatGPT mapping format
169
+ if (conv.mapping) {
170
+ Object.values(conv.mapping).forEach((node, index) => {
171
+ var _node$message;
172
+ if (node !== null && node !== void 0 && (_node$message = node.message) !== null && _node$message !== void 0 && (_node$message = _node$message.content) !== null && _node$message !== void 0 && _node$message.parts) {
173
+ const content = node.message.content.parts.join('\n');
174
+ if (content.trim()) {
175
+ var _node$message$author;
176
+ messages.push({
177
+ id: node.message.id || `msg_${index}`,
178
+ role: ((_node$message$author = node.message.author) === null || _node$message$author === void 0 ? void 0 : _node$message$author.role) || 'unknown',
179
+ content,
180
+ timestamp: node.message.create_time ? new Date(node.message.create_time * 1000).toISOString() : undefined
181
+ });
182
+ }
183
+ }
184
+ });
185
+ }
186
+
187
+ // Direct messages array
188
+ if (conv.messages && Array.isArray(conv.messages)) {
189
+ conv.messages.forEach((msg, index) => {
190
+ var _msg$content;
191
+ const content = msg.content || msg.text || msg.message || '';
192
+ if (typeof content === 'string' && content.trim()) {
193
+ messages.push({
194
+ id: msg.id || `msg_${index}`,
195
+ role: msg.role || msg.author || 'user',
196
+ content,
197
+ timestamp: msg.timestamp || msg.created_at
198
+ });
199
+ } else if ((_msg$content = msg.content) !== null && _msg$content !== void 0 && _msg$content.parts) {
200
+ messages.push({
201
+ id: msg.id || `msg_${index}`,
202
+ role: msg.role || 'user',
203
+ content: msg.content.parts.join('\n'),
204
+ timestamp: msg.timestamp
205
+ });
206
+ }
207
+ });
208
+ }
209
+
210
+ // Claude format
211
+ if (conv.chat_messages && Array.isArray(conv.chat_messages)) {
212
+ conv.chat_messages.forEach((msg, index) => {
213
+ if (msg.text || msg.content) {
214
+ messages.push({
215
+ id: msg.uuid || `msg_${index}`,
216
+ role: msg.sender === 'human' ? 'user' : 'assistant',
217
+ content: msg.text || msg.content,
218
+ timestamp: msg.created_at
219
+ });
220
+ }
221
+ });
222
+ }
223
+ return messages;
224
+ };
225
+
226
+ // Handle file selection
227
+ const handleFilePick = async () => {
228
+ if (!FILE_UPLOAD_AVAILABLE) {
229
+ setError('File upload requires react-native-document-picker and react-native-fs. Please paste data instead.');
230
+ return;
231
+ }
232
+ try {
233
+ setError(null);
234
+ const {
235
+ pick,
236
+ types
237
+ } = DocumentPicker;
238
+ const result = await pick({
239
+ type: [types.json, types.plainText, types.allFiles]
240
+ });
241
+ if (result && result[0]) {
242
+ const file = result[0];
243
+ setSelectedFileName(file.name || 'Selected file');
244
+
245
+ // Read file content
246
+ let content;
247
+ if (file.uri.startsWith('content://')) {
248
+ // Android content URI
249
+ content = await RNFS.readFile(file.uri, 'utf8');
250
+ } else {
251
+ content = await RNFS.readFile(file.uri, 'utf8');
252
+ }
253
+ setFileContent(content);
254
+ setPastedData(content);
255
+ (0, _haptics.triggerHaptic)(_haptics.HapticType.SUCCESS);
256
+ }
257
+ } catch (err) {
258
+ if (err.code !== 'DOCUMENT_PICKER_CANCELED') {
259
+ console.error('File pick error:', err);
260
+ setError('Failed to read file. Please try again or paste data manually.');
261
+ (0, _haptics.triggerHaptic)(_haptics.HapticType.ERROR);
262
+ }
263
+ }
264
+ };
265
+
266
+ // Submit data to backend
267
+ const handleSubmit = async () => {
268
+ const dataToProcess = inputMode === 'file' && fileContent ? fileContent : pastedData;
269
+ if (!dataToProcess.trim()) {
270
+ setError('Please paste or upload conversation data first.');
271
+ (0, _haptics.triggerHaptic)(_haptics.HapticType.ERROR);
272
+ return;
273
+ }
274
+ setIsLoading(true);
275
+ setError(null);
276
+ try {
277
+ // Parse the conversation data
278
+ const conversations = parseConversationData(dataToProcess);
279
+ if (conversations.length === 0) {
280
+ throw new Error('No valid conversations found in the data. Please check the format.');
281
+ }
282
+
283
+ // Get auth token
284
+ const authToken = (await _asyncStorage.default.getItem('onairos_jwt_token')) || (await _asyncStorage.default.getItem('enoch_token')) || (await _asyncStorage.default.getItem('auth_token'));
285
+ if (!authToken) {
286
+ throw new Error('Authentication required. Please sign in first.');
287
+ }
288
+
289
+ // Send each conversation to backend
290
+ const mobilePlatform = `mobile-${platform}`;
291
+ let successCount = 0;
292
+ for (const conversation of conversations) {
293
+ try {
294
+ const response = await fetch(`${_api.API_CONFIG.BASE_URL}/llm-data/store`, {
295
+ method: 'POST',
296
+ headers: {
297
+ 'Content-Type': 'application/json',
298
+ 'Authorization': `Bearer ${authToken}`
299
+ },
300
+ body: JSON.stringify({
301
+ platform: mobilePlatform,
302
+ conversationData: {
303
+ conversationId: conversation.conversationId,
304
+ messages: conversation.messages,
305
+ context: conversation.context,
306
+ mobileMetadata: {
307
+ platform: _reactNative.Platform.OS,
308
+ appVersion: '1.0.0',
309
+ osVersion: _reactNative.Platform.Version,
310
+ isOfflineSync: false
311
+ }
312
+ },
313
+ memoryType: 'conversation',
314
+ metadata: {
315
+ source: 'mobile_app_import',
316
+ importedAt: new Date().toISOString(),
317
+ originalPlatform: platform
318
+ }
319
+ })
320
+ });
321
+ if (response.ok) {
322
+ successCount++;
323
+ } else {
324
+ const errorText = await response.text();
325
+ console.error(`Failed to store conversation ${conversation.conversationId}:`, errorText);
326
+ }
327
+ } catch (convError) {
328
+ console.error(`Error storing conversation:`, convError);
329
+ }
330
+ }
331
+ if (successCount > 0) {
332
+ // Store connection status locally
333
+ await _asyncStorage.default.setItem(`@onairos:llm_connected:${platform}`, JSON.stringify({
334
+ connected: true,
335
+ platform,
336
+ conversationsCount: successCount,
337
+ lastSyncAt: new Date().toISOString()
338
+ }));
339
+ (0, _haptics.triggerHaptic)(_haptics.HapticType.SUCCESS);
340
+ _reactNative.Alert.alert('Success! 🎉', `Successfully imported ${successCount} conversation${successCount > 1 ? 's' : ''} from ${platformName}.`, [{
341
+ text: 'OK',
342
+ onPress: () => onSuccess(platform)
343
+ }]);
344
+ } else {
345
+ throw new Error('Failed to import any conversations. Please check your data format.');
346
+ }
347
+ } catch (err) {
348
+ console.error('Submit error:', err);
349
+ setError(err.message || 'Failed to import data. Please try again.');
350
+ (0, _haptics.triggerHaptic)(_haptics.HapticType.ERROR);
351
+ } finally {
352
+ setIsLoading(false);
353
+ }
354
+ };
355
+
356
+ // Reset state when modal closes
357
+ const handleClose = () => {
358
+ setPastedData('');
359
+ setFileContent(null);
360
+ setSelectedFileName(null);
361
+ setError(null);
362
+ setInputMode('paste');
363
+ onClose();
364
+ };
365
+ return /*#__PURE__*/_react.default.createElement(_reactNative.Modal, {
366
+ visible: visible,
367
+ animationType: "slide",
368
+ presentationStyle: "pageSheet",
369
+ onRequestClose: handleClose
370
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.KeyboardAvoidingView, {
371
+ style: styles.container,
372
+ behavior: _reactNative.Platform.OS === 'ios' ? 'padding' : 'height'
373
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
374
+ style: styles.header
375
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
376
+ style: styles.closeButton,
377
+ onPress: handleClose
378
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
379
+ style: styles.closeButtonText
380
+ }, "Cancel")), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
381
+ style: styles.headerTitle
382
+ }, title), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
383
+ style: styles.closeButton
384
+ })), /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
385
+ style: styles.content,
386
+ contentContainerStyle: styles.contentContainer,
387
+ keyboardShouldPersistTaps: "handled"
388
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
389
+ style: styles.instructionsContainer
390
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
391
+ style: styles.instructionsText
392
+ }, instructions)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
393
+ style: styles.tabContainer
394
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
395
+ style: [styles.tab, inputMode === 'paste' && styles.tabActive],
396
+ onPress: () => {
397
+ setInputMode('paste');
398
+ (0, _haptics.triggerHaptic)(_haptics.HapticType.BUTTON_PRESS);
399
+ }
400
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
401
+ style: [styles.tabText, inputMode === 'paste' && styles.tabTextActive]
402
+ }, "Paste Data")), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
403
+ style: [styles.tab, inputMode === 'file' && styles.tabActive, !FILE_UPLOAD_AVAILABLE && styles.tabDisabled],
404
+ onPress: () => {
405
+ if (FILE_UPLOAD_AVAILABLE) {
406
+ setInputMode('file');
407
+ (0, _haptics.triggerHaptic)(_haptics.HapticType.BUTTON_PRESS);
408
+ } else {
409
+ setError('File upload requires additional dependencies. Please paste data instead.');
410
+ (0, _haptics.triggerHaptic)(_haptics.HapticType.ERROR);
411
+ }
412
+ }
413
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
414
+ style: [styles.tabText, inputMode === 'file' && styles.tabTextActive, !FILE_UPLOAD_AVAILABLE && styles.tabTextDisabled]
415
+ }, "Upload File ", !FILE_UPLOAD_AVAILABLE && '(N/A)'))), inputMode === 'paste' ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
416
+ style: styles.inputContainer
417
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
418
+ style: styles.textInput,
419
+ multiline: true,
420
+ placeholder: placeholder,
421
+ placeholderTextColor: _theme.COLORS.grey400,
422
+ value: pastedData,
423
+ onChangeText: setPastedData,
424
+ textAlignVertical: "top",
425
+ autoCapitalize: "none",
426
+ autoCorrect: false
427
+ })) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
428
+ style: styles.fileInputContainer
429
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
430
+ style: styles.filePickButton,
431
+ onPress: handleFilePick
432
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
433
+ style: styles.filePickIcon
434
+ }, "\uD83D\uDCC1"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
435
+ style: styles.filePickText
436
+ }, selectedFileName || 'Tap to select a file')), selectedFileName && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
437
+ style: styles.fileSelectedContainer
438
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
439
+ style: styles.fileSelectedText
440
+ }, "\u2713 ", selectedFileName))), error && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
441
+ style: styles.errorContainer
442
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
443
+ style: styles.errorText
444
+ }, error)), pastedData.length > 0 && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
445
+ style: styles.previewContainer
446
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
447
+ style: styles.previewTitle
448
+ }, "Data Preview"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
449
+ style: styles.previewText,
450
+ numberOfLines: 5
451
+ }, pastedData.substring(0, 500), pastedData.length > 500 ? '...' : ''), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
452
+ style: styles.previewInfo
453
+ }, pastedData.length.toLocaleString(), " characters"))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
454
+ style: styles.footer
455
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
456
+ style: [styles.submitButton, (!pastedData.trim() || isLoading) && styles.submitButtonDisabled],
457
+ onPress: handleSubmit,
458
+ disabled: !pastedData.trim() || isLoading
459
+ }, isLoading ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
460
+ color: "#FFFFFF",
461
+ size: "small"
462
+ }) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
463
+ style: styles.submitButtonText
464
+ }, "Import Conversations")))));
465
+ };
466
+ const styles = _reactNative.StyleSheet.create({
467
+ container: {
468
+ flex: 1,
469
+ backgroundColor: _theme.COLORS.surface
470
+ },
471
+ header: {
472
+ flexDirection: 'row',
473
+ alignItems: 'center',
474
+ justifyContent: 'space-between',
475
+ paddingHorizontal: 16,
476
+ paddingTop: _reactNative.Platform.OS === 'ios' ? 12 : 16,
477
+ paddingBottom: 12,
478
+ borderBottomWidth: 1,
479
+ borderBottomColor: '#E5E7EB' // grey200
480
+ },
481
+ headerTitle: {
482
+ fontSize: 17,
483
+ fontWeight: '600',
484
+ color: _theme.COLORS.grey800,
485
+ fontFamily: 'IBM Plex Sans'
486
+ },
487
+ closeButton: {
488
+ width: 60
489
+ },
490
+ closeButtonText: {
491
+ fontSize: 16,
492
+ color: '#3B82F6',
493
+ fontFamily: 'Inter'
494
+ },
495
+ content: {
496
+ flex: 1
497
+ },
498
+ contentContainer: {
499
+ padding: 20,
500
+ paddingBottom: 40
501
+ },
502
+ instructionsContainer: {
503
+ backgroundColor: '#F0F9FF',
504
+ borderRadius: 12,
505
+ padding: 16,
506
+ marginBottom: 20
507
+ },
508
+ instructionsText: {
509
+ fontSize: 14,
510
+ lineHeight: 20,
511
+ color: '#0369A1',
512
+ fontFamily: 'Inter'
513
+ },
514
+ tabContainer: {
515
+ flexDirection: 'row',
516
+ backgroundColor: '#F3F4F6',
517
+ // grey100
518
+ borderRadius: 10,
519
+ padding: 4,
520
+ marginBottom: 20
521
+ },
522
+ tab: {
523
+ flex: 1,
524
+ paddingVertical: 10,
525
+ borderRadius: 8,
526
+ alignItems: 'center'
527
+ },
528
+ tabActive: {
529
+ backgroundColor: '#FFFFFF',
530
+ shadowColor: '#000',
531
+ shadowOffset: {
532
+ width: 0,
533
+ height: 1
534
+ },
535
+ shadowOpacity: 0.1,
536
+ shadowRadius: 2,
537
+ elevation: 2
538
+ },
539
+ tabText: {
540
+ fontSize: 14,
541
+ fontWeight: '500',
542
+ color: _theme.COLORS.grey500,
543
+ fontFamily: 'Inter'
544
+ },
545
+ tabTextActive: {
546
+ color: _theme.COLORS.grey800
547
+ },
548
+ tabDisabled: {
549
+ opacity: 0.5
550
+ },
551
+ tabTextDisabled: {
552
+ color: _theme.COLORS.grey400
553
+ },
554
+ inputContainer: {
555
+ marginBottom: 20
556
+ },
557
+ textInput: {
558
+ backgroundColor: '#FFFFFF',
559
+ borderWidth: 1,
560
+ borderColor: _theme.COLORS.grey300,
561
+ borderRadius: 12,
562
+ padding: 16,
563
+ minHeight: 200,
564
+ fontSize: 14,
565
+ fontFamily: _reactNative.Platform.OS === 'ios' ? 'Menlo' : 'monospace',
566
+ color: _theme.COLORS.grey800
567
+ },
568
+ fileInputContainer: {
569
+ marginBottom: 20
570
+ },
571
+ filePickButton: {
572
+ backgroundColor: '#FFFFFF',
573
+ borderWidth: 2,
574
+ borderColor: _theme.COLORS.grey300,
575
+ borderStyle: 'dashed',
576
+ borderRadius: 12,
577
+ padding: 40,
578
+ alignItems: 'center',
579
+ justifyContent: 'center'
580
+ },
581
+ filePickIcon: {
582
+ fontSize: 40,
583
+ marginBottom: 12
584
+ },
585
+ filePickText: {
586
+ fontSize: 15,
587
+ color: _theme.COLORS.grey600,
588
+ fontFamily: 'Inter'
589
+ },
590
+ fileSelectedContainer: {
591
+ marginTop: 12,
592
+ backgroundColor: '#F0FDF4',
593
+ borderRadius: 8,
594
+ padding: 12
595
+ },
596
+ fileSelectedText: {
597
+ fontSize: 14,
598
+ color: '#166534',
599
+ fontFamily: 'Inter',
600
+ fontWeight: '500'
601
+ },
602
+ errorContainer: {
603
+ backgroundColor: '#FEF2F2',
604
+ borderRadius: 8,
605
+ padding: 12,
606
+ marginBottom: 16
607
+ },
608
+ errorText: {
609
+ fontSize: 14,
610
+ color: '#DC2626',
611
+ fontFamily: 'Inter'
612
+ },
613
+ previewContainer: {
614
+ backgroundColor: '#F3F4F6',
615
+ // grey100
616
+ borderRadius: 12,
617
+ padding: 16
618
+ },
619
+ previewTitle: {
620
+ fontSize: 14,
621
+ fontWeight: '600',
622
+ color: _theme.COLORS.grey800,
623
+ marginBottom: 8,
624
+ fontFamily: 'Inter'
625
+ },
626
+ previewText: {
627
+ fontSize: 12,
628
+ color: _theme.COLORS.grey600,
629
+ fontFamily: _reactNative.Platform.OS === 'ios' ? 'Menlo' : 'monospace',
630
+ lineHeight: 18
631
+ },
632
+ previewInfo: {
633
+ fontSize: 12,
634
+ color: _theme.COLORS.grey500,
635
+ marginTop: 8,
636
+ fontFamily: 'Inter'
637
+ },
638
+ footer: {
639
+ padding: 20,
640
+ paddingBottom: _reactNative.Platform.OS === 'ios' ? 34 : 20,
641
+ borderTopWidth: 1,
642
+ borderTopColor: '#E5E7EB',
643
+ // grey200
644
+ backgroundColor: _theme.COLORS.surface
645
+ },
646
+ submitButton: {
647
+ backgroundColor: '#10B981',
648
+ borderRadius: 12,
649
+ paddingVertical: 16,
650
+ alignItems: 'center',
651
+ justifyContent: 'center'
652
+ },
653
+ submitButtonDisabled: {
654
+ backgroundColor: _theme.COLORS.grey300
655
+ },
656
+ submitButtonText: {
657
+ fontSize: 16,
658
+ fontWeight: '600',
659
+ color: '#FFFFFF',
660
+ fontFamily: 'Inter'
661
+ }
662
+ });
663
+ var _default = exports.default = LLMDataInputModal;
664
+ //# sourceMappingURL=LLMDataInputModal.js.map