@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.
- package/lib/commonjs/api/index.js +219 -9
- package/lib/commonjs/assets/icons/spotify.png +0 -0
- package/lib/commonjs/assets/images/spotify.png +0 -0
- package/lib/commonjs/components/BodyText.js +27 -9
- package/lib/commonjs/components/BrandMark.js +111 -10
- package/lib/commonjs/components/CodeInput.js +116 -9
- package/lib/commonjs/components/EmailInput.js +30 -8
- package/lib/commonjs/components/GoogleButton.js +56 -9
- package/lib/commonjs/components/HeadingGroup.js +43 -9
- package/lib/commonjs/components/LLMDataInputModal.js +664 -14
- package/lib/commonjs/components/ModalHeader.js +99 -9
- package/lib/commonjs/components/ModalSheet.js +47 -9
- package/lib/commonjs/components/Onairos.js +380 -14
- package/lib/commonjs/components/OnairosButton.js +313 -13
- package/lib/commonjs/components/OnairosSignInButton.js +130 -12
- package/lib/commonjs/components/Overlay.js +465 -13
- package/lib/commonjs/components/PersonaImage.js +137 -10
- package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
- package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
- package/lib/commonjs/components/PinCreationScreen.js +403 -12
- package/lib/commonjs/components/PinInput.js +464 -9
- package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
- package/lib/commonjs/components/PlatformList.js +137 -10
- package/lib/commonjs/components/PlatformToggle.js +180 -9
- package/lib/commonjs/components/PrimaryButton.js +180 -10
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
- package/lib/commonjs/components/SignInStep.js +345 -12
- package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
- package/lib/commonjs/components/VerificationStep.js +176 -11
- package/lib/commonjs/components/WelcomeScreen.js +461 -22
- package/lib/commonjs/components/icons/Basicproficon.js +37 -8
- package/lib/commonjs/components/icons/Basicprofile.js +21 -8
- package/lib/commonjs/components/icons/Checkbox.js +21 -8
- package/lib/commonjs/components/icons/Checkmark.js +27 -8
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
- package/lib/commonjs/components/icons/Contenticon.js +39 -8
- package/lib/commonjs/components/icons/EnochE.js +41 -8
- package/lib/commonjs/components/icons/Personalityicon.js +30 -8
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
- package/lib/commonjs/components/icons/Userpreferences.js +21 -8
- package/lib/commonjs/components/icons/index.js +84 -17
- package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
- package/lib/commonjs/components/onboarding/PinInput.js +283 -10
- package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
- package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
- package/lib/commonjs/config/api.js +56 -7
- package/lib/commonjs/constants/index.js +120 -7
- package/lib/commonjs/context/AuthContext.js +345 -10
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
- package/lib/commonjs/hooks/useConnections.js +102 -8
- package/lib/commonjs/hooks/useCredentials.js +178 -10
- package/lib/commonjs/hooks/useUserConnections.js +148 -10
- package/lib/commonjs/index.js +439 -34
- package/lib/commonjs/services/apiClient.js +298 -8
- package/lib/commonjs/services/biometricPinService.js +180 -8
- package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
- package/lib/commonjs/services/chatGPTConversationService.js +275 -9
- package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
- package/lib/commonjs/services/claudeConversationService.js +158 -9
- package/lib/commonjs/services/connectedAccountsService.js +310 -10
- package/lib/commonjs/services/googleAuthService.js +252 -11
- package/lib/commonjs/services/hingeDataExtractor.js +105 -8
- package/lib/commonjs/services/hingeDataService.js +150 -9
- package/lib/commonjs/services/imageCompressionService.js +260 -7
- package/lib/commonjs/services/instagramDataExtractor.js +126 -8
- package/lib/commonjs/services/instagramDataService.js +163 -9
- package/lib/commonjs/services/jwtStorageService.js +276 -7
- package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
- package/lib/commonjs/services/linkedinProfileService.js +222 -9
- package/lib/commonjs/services/linkedinScrapingService.js +230 -8
- package/lib/commonjs/services/llmDataStorage.js +294 -8
- package/lib/commonjs/services/mobileTrainingService.js +186 -8
- package/lib/commonjs/services/netflixDataExtractor.js +120 -8
- package/lib/commonjs/services/netflixDataService.js +198 -9
- package/lib/commonjs/services/pinEncryptionService.js +84 -8
- package/lib/commonjs/services/pinStorageUtils.js +105 -7
- package/lib/commonjs/services/platformAuthService.js +1484 -12
- package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
- package/lib/commonjs/services/sephoraDataService.js +200 -9
- package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
- package/lib/commonjs/services/spotifyDataService.js +241 -9
- package/lib/commonjs/services/storageService.js +404 -8
- package/lib/commonjs/services/telegramDataExtractor.js +115 -8
- package/lib/commonjs/services/telegramDataService.js +499 -9
- package/lib/commonjs/services/trainingApiHelpers.js +73 -7
- package/lib/commonjs/services/userConnectionsService.js +340 -10
- package/lib/commonjs/services/youtubeMigrationService.js +416 -10
- package/lib/commonjs/theme/index.js +250 -7
- package/lib/commonjs/types/ambient.d.js +2 -1
- package/lib/commonjs/types/declarations.d.js +2 -1
- package/lib/commonjs/types/index.js +6 -1
- package/lib/commonjs/types/node-fix.d.js +2 -1
- package/lib/commonjs/types/node-override.d.js +2 -1
- package/lib/commonjs/types/opacity.d.js +2 -1
- package/lib/commonjs/types.js +14 -1
- package/lib/commonjs/utils/Portal.js +98 -8
- package/lib/commonjs/utils/api.js +130 -9
- package/lib/commonjs/utils/assetRegistry.js +210 -35
- package/lib/commonjs/utils/auth.js +112 -9
- package/lib/commonjs/utils/connectorTests.js +613 -29
- package/lib/commonjs/utils/crypto.js +62 -8
- package/lib/commonjs/utils/debugHelper.js +64 -1
- package/lib/commonjs/utils/encryption.js +76 -7
- package/lib/commonjs/utils/eventUtils.js +288 -1
- package/lib/commonjs/utils/haptics.js +66 -9
- package/lib/commonjs/utils/imagePreloader.js +6 -1
- package/lib/commonjs/utils/networkDiagnostics.js +226 -8
- package/lib/commonjs/utils/onairosApi.js +350 -9
- package/lib/commonjs/utils/programmaticFlow.js +117 -9
- package/lib/commonjs/utils/retryHelper.js +220 -1
- package/lib/commonjs/utils/secureStorage.js +349 -10
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
- package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
- package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
- package/lib/commonjs/utils/webviewScripts/index.js +698 -15
- package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
- package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
- package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
- package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
- package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
- package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
- package/lib/module/api/index.js +211 -1
- package/lib/module/assets/icons/spotify.png +0 -0
- package/lib/module/assets/images/spotify.png +0 -0
- package/lib/module/components/BodyText.js +20 -1
- package/lib/module/components/BrandMark.js +104 -1
- package/lib/module/components/CodeInput.js +109 -1
- package/lib/module/components/EmailInput.js +23 -1
- package/lib/module/components/GoogleButton.js +49 -1
- package/lib/module/components/HeadingGroup.js +36 -1
- package/lib/module/components/LLMDataInputModal.js +656 -7
- package/lib/module/components/ModalHeader.js +92 -1
- package/lib/module/components/ModalSheet.js +39 -1
- package/lib/module/components/Onairos.js +373 -1
- package/lib/module/components/OnairosButton.js +305 -1
- package/lib/module/components/OnairosSignInButton.js +121 -1
- package/lib/module/components/Overlay.js +456 -1
- package/lib/module/components/PersonaImage.js +129 -1
- package/lib/module/components/PersonaLoadingScreen.js +310 -1
- package/lib/module/components/PersonalizationConsentScreen.js +460 -1
- package/lib/module/components/PinCreationScreen.js +396 -1
- package/lib/module/components/PinInput.js +456 -1
- package/lib/module/components/PlatformConnectorsStep.js +1302 -6
- package/lib/module/components/PlatformList.js +129 -1
- package/lib/module/components/PlatformToggle.js +173 -1
- package/lib/module/components/PrimaryButton.js +172 -1
- package/lib/module/components/SignInMatchAnimation.js +189 -1
- package/lib/module/components/SignInStep.js +338 -1
- package/lib/module/components/UniversalOnboarding.js +2770 -1
- package/lib/module/components/VerificationStep.js +168 -1
- package/lib/module/components/WelcomeScreen.js +453 -1
- package/lib/module/components/icons/Basicproficon.js +30 -1
- package/lib/module/components/icons/Basicprofile.js +14 -1
- package/lib/module/components/icons/Checkbox.js +14 -1
- package/lib/module/components/icons/Checkmark.js +20 -1
- package/lib/module/components/icons/Contentanalysis.js +14 -1
- package/lib/module/components/icons/Contenticon.js +32 -1
- package/lib/module/components/icons/EnochE.js +34 -1
- package/lib/module/components/icons/Personalityicon.js +23 -1
- package/lib/module/components/icons/Personalityprofile.js +14 -1
- package/lib/module/components/icons/Personalitytraits.js +14 -1
- package/lib/module/components/icons/Userpreferences.js +14 -1
- package/lib/module/components/icons/index.js +13 -1
- package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
- package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
- package/lib/module/components/onboarding/PinInput.js +274 -1
- package/lib/module/components/onboarding/PlatformConnector.js +240 -1
- package/lib/module/config/PLATFORM_APIS.md +849 -0
- package/lib/module/config/api.js +47 -1
- package/lib/module/constants/index.js +114 -1
- package/lib/module/context/AuthContext.js +335 -1
- package/lib/module/hooks/useConnectedAccounts.js +106 -1
- package/lib/module/hooks/useConnections.js +95 -1
- package/lib/module/hooks/useCredentials.js +171 -6
- package/lib/module/hooks/useUserConnections.js +140 -1
- package/lib/module/index.js +172 -1
- package/lib/module/services/apiClient.js +295 -1
- package/lib/module/services/biometricPinService.js +169 -1
- package/lib/module/services/chatGPTConversationExtractor.js +149 -1
- package/lib/module/services/chatGPTConversationService.js +268 -1
- package/lib/module/services/claudeConversationExtractor.js +97 -1
- package/lib/module/services/claudeConversationService.js +151 -1
- package/lib/module/services/connectedAccountsService.js +293 -1
- package/lib/module/services/googleAuthService.js +241 -1
- package/lib/module/services/hingeDataExtractor.js +99 -1
- package/lib/module/services/hingeDataService.js +143 -1
- package/lib/module/services/imageCompressionService.js +250 -1
- package/lib/module/services/instagramDataExtractor.js +120 -1
- package/lib/module/services/instagramDataService.js +156 -1
- package/lib/module/services/jwtStorageService.js +257 -1
- package/lib/module/services/linkedinDOMExtractor.js +234 -1
- package/lib/module/services/linkedinProfileService.js +210 -1
- package/lib/module/services/linkedinScrapingService.js +219 -1
- package/lib/module/services/llmDataStorage.js +277 -1
- package/lib/module/services/mobileTrainingService.js +173 -1
- package/lib/module/services/netflixDataExtractor.js +114 -1
- package/lib/module/services/netflixDataService.js +191 -1
- package/lib/module/services/pinEncryptionService.js +74 -6
- package/lib/module/services/pinStorageUtils.js +93 -1
- package/lib/module/services/platformAuthService.js +1461 -1
- package/lib/module/services/sephoraDataExtractor.js +134 -1
- package/lib/module/services/sephoraDataService.js +193 -1
- package/lib/module/services/spotifyDataExtractor.js +142 -1
- package/lib/module/services/spotifyDataService.js +234 -1
- package/lib/module/services/storageService.js +383 -1
- package/lib/module/services/telegramDataExtractor.js +109 -1
- package/lib/module/services/telegramDataService.js +493 -1
- package/lib/module/services/trainingApiHelpers.js +67 -1
- package/lib/module/services/userConnectionsService.js +329 -1
- package/lib/module/services/youtubeMigrationService.js +405 -1
- package/lib/module/theme/index.js +245 -1
- package/lib/module/types.js +10 -1
- package/lib/module/utils/Portal.js +90 -1
- package/lib/module/utils/api.js +118 -1
- package/lib/module/utils/assetRegistry.js +200 -34
- package/lib/module/utils/auth.js +100 -1
- package/lib/module/utils/connectorTests.js +600 -27
- package/lib/module/utils/crypto.js +54 -1
- package/lib/module/utils/debugHelper.js +54 -1
- package/lib/module/utils/encryption.js +67 -1
- package/lib/module/utils/eventUtils.js +270 -1
- package/lib/module/utils/haptics.js +59 -8
- package/lib/module/utils/imagePreloader.js +3 -1
- package/lib/module/utils/networkDiagnostics.js +217 -1
- package/lib/module/utils/onairosApi.js +333 -1
- package/lib/module/utils/programmaticFlow.js +111 -1
- package/lib/module/utils/retryHelper.js +211 -1
- package/lib/module/utils/secureStorage.js +330 -6
- package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
- package/lib/module/utils/webviewScripts/claude.js +370 -1
- package/lib/module/utils/webviewScripts/hinge.js +405 -1
- package/lib/module/utils/webviewScripts/index.js +434 -1
- package/lib/module/utils/webviewScripts/instagram.js +448 -1
- package/lib/module/utils/webviewScripts/linkedin.js +874 -1
- package/lib/module/utils/webviewScripts/netflix.js +376 -1
- package/lib/module/utils/webviewScripts/sephora.js +510 -1
- package/lib/module/utils/webviewScripts/spotify.js +413 -1
- package/lib/module/utils/webviewScripts/telegram.js +672 -1
- package/package.json +2 -2
|
@@ -1,13 +1,313 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _0xbf0a(_0x49dd44,_0xbf0a5d){_0x49dd44=_0x49dd44-0x0;const _0x22fc65=_0x49dd();let _0x577978=_0x22fc65[_0x49dd44];return _0x577978;}Object['defineProperty'](exports,_0xbf0a(0x0),{'value':!![]}),exports['default']=exports[_0xbf0a(0x1)]=void 0x0;function _0x49dd(){const _0x20eace=['__esModule','OnairosButton','function','default','vedQk','dNdmK','cYWHl','has','set','hasOwnProperty','call','getOwnPropertyDescriptor','get','window','forwardRef','normal','#1BA9D4','black','CHgJw','Onairos\x20SDK\x20not\x20initialized.\x20Developers\x20must\x20call\x20initializeApiKey()\x20with\x20a\x20valid\x20API\x20key\x20before\x20using\x20SDK\x20components.\x20Get\x20your\x20API\x20key\x20from\x20https://dashboard.onairos.uk','❌\x20[OnairosButton]\x20SDK\x20NOT\x20INITIALIZED:','DAkws','erxqv','OoccW','...','sNvuB','wuLtm','[OnairosButton]\x20Precheck\x20failed.\x20Setting\x20showOnboarding\x20to\x20false\x20(indirectly,\x20by\x20not\x20setting\x20to\x20true).','Precheck\x20validation\x20failed','[OnairosButton]\x20handlePress:\x20Setting\x20showOnboarding\x20to\x20true.','[OnairosButton]\x20Error\x20in\x20handlePress:','connect','Connect\x20Onairos','login','Sign\x20in\x20with\x20Onairos','signup','rnrvY','[OnairosButton]\x20Initializing.\x20Initial\x20showOnboarding:','[OnairosButton]\x20Rendering\x20JSX\x20with\x20props:','pill','#f5e7c1','small','#FFFFFF','contain','Free\x20access','Medium','Standard\x20tier','Large','Full\x20personalization','useState','log','FAdpS','useEffect','SFaER','gbqPs','vsjqJ','[OnairosButton]\x20LogEffect:\x20showOnboarding\x20state\x20changed\x20to:','iBNsM','resolve','VWECb','MRaKU','gudCH','kBXab','[OnairosButton]\x20handlePress\x20called.','aIxdA','GPvBr','isApiKeyInitialized','frizH','mEsVF','aUkqY','error','QbjqF','ScyNH','Alert','alert','iKlwj','The\x20Onairos\x20SDK\x20requires\x20initialization\x20with\x20a\x20valid\x20API\x20key.\x0a\x0aDevelopers:\x20Please\x20call\x20initializeApiKey()\x20before\x20using\x20OnairosButton.','bCwNB','idJOE','KczAV','hyopr','FVivH','lDQsa','object','AtGmE','vDtEq','iCBmt','EeaCo','VbLie','apiKey','FIhGI','bfWMu','UQfOk','nNedO','wnrDJ','YXvwQ','KTyJb','QNhls','mLyil','BiqhE','TmaIx','ZSGnS','unjqj','Klpgy','useCallback','OTsFA','PtMTR','lgkeA','[OnairosButton]\x20handleOnboardingComplete:\x20Setting\x20showOnboarding\x20to\x20false.','QmjQC','[OnairosButton]\x20handleOnboardingClose:\x20Setting\x20showOnboarding\x20to\x20false.','blTAZ','zBkcy','dRxxc','User\x20closed\x20onboarding','fgdgy','YKwbp','Fragment','createElement','button','NbGwz','pillButton','swervButton','disabledButton','RssdQ','#C7A047','#8B6914','absolute','DWqjh','Umtmn','View','logoContainer','Image','BRAND_IMAGES','logoImage','Text','buttonText','lOkiM','SuTYh','ipQtc','zTtkz','QpyGW','RIFfU','gbmsT','wmkGU','aaBFf','StyleSheet','create','row','center','#000','hidden','bold','transparent','-2deg','600'];_0x49dd=function(){return _0x20eace;};return _0x49dd();}var _react=_interopRequireWildcard(__ONAIROS_REQ_FUNC__(0x0)),_reactNative=__ONAIROS_REQ_FUNC__(0x1),_reactNativeLinearGradient=_interopRequireDefault(__ONAIROS_REQ_FUNC__(0x2)),_UniversalOnboarding=__ONAIROS_REQ_FUNC__(0x3),_WelcomeScreen=_interopRequireDefault(__ONAIROS_REQ_FUNC__(0x4)),_apiKeyService=__ONAIROS_REQ_FUNC__(0x5),_assetRegistry=__ONAIROS_REQ_FUNC__(0x6);function _interopRequireDefault(_0x2abdce){return _0x2abdce&&_0x2abdce[_0xbf0a(0x0)]?_0x2abdce:{'default':_0x2abdce};}function _interopRequireWildcard(_0x4ee712,_0x2ac0b0){const _0x4a51e0={'cYWHl':function(_0x366c89,_0x22e319){return _0x366c89!=_0x22e319;},'SOjZG':function(_0x4f8fd7,_0xdaa680){return _0x4f8fd7!=_0xdaa680;},'dNdmK':_0xbf0a(0x2),'MRpXv':function(_0x3e6e66,_0x1b04d8){return _0x3e6e66!==_0x1b04d8;},'UEkDC':_0xbf0a(0x3),'NaKhS':function(_0x1f9e60,_0x4bfa46,_0xa4642,_0x2350c5){return _0x1f9e60(_0x4bfa46,_0xa4642,_0x2350c5);},'vedQk':function(_0x4136d2,_0x414344){return _0x4136d2==_0x414344;}};if(_0x4a51e0[_0xbf0a(0x4)](_0x4a51e0[_0xbf0a(0x5)],typeof WeakMap))var _0x22a0c6=new WeakMap(),_0x5bcf93=new WeakMap();return(_interopRequireWildcard=function(_0x256716,_0x3aef25){if(!_0x3aef25&&_0x256716&&_0x256716[_0xbf0a(0x0)])return _0x256716;var _0x1f8a5e,_0x5e1e1f,_0x50b47f={'__proto__':null,'default':_0x256716};if(null===_0x256716||_0x4a51e0[_0xbf0a(0x6)]('object',typeof _0x256716)&&_0x4a51e0['SOjZG'](_0x4a51e0[_0xbf0a(0x5)],typeof _0x256716))return _0x50b47f;if(_0x1f8a5e=_0x3aef25?_0x5bcf93:_0x22a0c6){if(_0x1f8a5e[_0xbf0a(0x7)](_0x256716))return _0x1f8a5e['get'](_0x256716);_0x1f8a5e[_0xbf0a(0x8)](_0x256716,_0x50b47f);}for(const _0x3f7132 in _0x256716)_0x4a51e0['MRpXv'](_0x4a51e0['UEkDC'],_0x3f7132)&&{}[_0xbf0a(0x9)][_0xbf0a(0xa)](_0x256716,_0x3f7132)&&((_0x5e1e1f=(_0x1f8a5e=Object['defineProperty'])&&Object[_0xbf0a(0xb)](_0x256716,_0x3f7132))&&(_0x5e1e1f[_0xbf0a(0xc)]||_0x5e1e1f['set'])?_0x4a51e0['NaKhS'](_0x1f8a5e,_0x50b47f,_0x3f7132,_0x5e1e1f):_0x50b47f[_0x3f7132]=_0x256716[_0x3f7132]);return _0x50b47f;})(_0x4ee712,_0x2ac0b0);}const {width}=_reactNative['Dimensions'][_0xbf0a(0xc)](_0xbf0a(0xd)),OnairosButton=exports[_0xbf0a(0x1)]=(0x0,_react[_0xbf0a(0xe)])(({AppName:_0x363e29,buttonType:buttonType=_0xbf0a(0xf),buttonWidth:buttonWidth=0xb4,buttonHeight:buttonHeight=0x30,hasStroke:hasStroke=![],enabled:enabled=!![],buttonForm:buttonForm=_0xbf0a(0x3),onResolved:_0x1494cd,onRejection:_0x50849d,preCheck:_0x485936,color:color=_0xbf0a(0x10),swerv:swerv=![],darkMode:darkMode=![],returnLink:_0x5dbd50,preferredPlatform:_0xd22077,autoFetch:autoFetch=![],inferenceData:_0x58b97e,textLayout:textLayout='right',textColor:textColor=_0xbf0a(0x11),proofMode:proofMode=![],webpageName:_0x3e6521,debug:debug=![],testMode:testMode=![],requestData:_0x1054e4,onPress:_0xadc3a8,primaryAuthOnly:primaryAuthOnly=![],useNewWelcomeFlow:useNewWelcomeFlow=![]},_0x2eebe0)=>{const _0x3c9877={'SFaER':function(_0x211be6,_0x26daa6){return _0x211be6===_0x26daa6;},'gbqPs':'TbOnl','vsjqJ':_0xbf0a(0x12),'iBNsM':function(_0x5654b9){return _0x5654b9();},'aDZxk':_0xbf0a(0x13),'QbjqF':_0xbf0a(0x14),'VWECb':function(_0x34cf3f,_0x566f47){return _0x34cf3f(_0x566f47);},'iKlwj':'SDK\x20Not\x20Initialized','wnrDJ':'The\x20Onairos\x20SDK\x20requires\x20initialization\x20with\x20a\x20valid\x20API\x20key.\x0a\x0aDevelopers:\x20Please\x20call\x20initializeApiKey()\x20before\x20using\x20OnairosButton.','MRaKU':function(_0x47921c,_0x2efa32){return _0x47921c!=_0x2efa32;},'gudCH':function(_0x58926d,_0x4498fd,_0x37cd40,_0x4f4c85){return _0x58926d(_0x4498fd,_0x37cd40,_0x4f4c85);},'kBXab':_0xbf0a(0x15),'aIxdA':function(_0x1bd1f9,_0x2a34d9){return _0x1bd1f9||_0x2a34d9;},'GPvBr':function(_0x586882,_0x5dcfce){return _0x586882(_0x5dcfce);},'frizH':function(_0x17fd62,_0x2e3097){return _0x17fd62!==_0x2e3097;},'mEsVF':_0xbf0a(0x16),'YXvwQ':function(_0x47d3a0,_0x56e135){return _0x47d3a0(_0x56e135);},'ScyNH':_0xbf0a(0x17),'vDtEq':function(_0x5642cd,_0x4e58ec){return _0x5642cd(_0x4e58ec);},'iCBmt':'[OnairosButton]\x20SDK\x20initialized\x20with\x20API\x20key:','EeaCo':function(_0x2b6e05,_0x437dbe){return _0x2b6e05+_0x437dbe;},'VbLie':function(_0x57941d,_0x2ef1bb){return _0x57941d===_0x2ef1bb;},'FIhGI':function(_0x1a8153,_0x4f99fe){return _0x1a8153===_0x4f99fe;},'vkhxl':_0xbf0a(0x18),'bfWMu':function(_0x1be445,_0x314705){return _0x1be445!==_0x314705;},'UQfOk':_0xbf0a(0x19),'CUmAR':_0xbf0a(0x1a),'nNedO':_0xbf0a(0x1b),'gWxxZ':_0xbf0a(0x1c),'JvRSg':_0xbf0a(0x1d),'KTyJb':_0xbf0a(0x1e),'QRnMm':function(_0x4e14df,_0x3db27b){return _0x4e14df instanceof _0x3db27b;},'QNhls':'Unknown\x20error','mLyil':_0xbf0a(0x1f),'BiqhE':_0xbf0a(0x20),'TmaIx':_0xbf0a(0x21),'ZSGnS':_0xbf0a(0x22),'unjqj':_0xbf0a(0x23),'Klpgy':'Sign\x20up\x20with\x20Onairos','PtMTR':'ECefN','lgkeA':function(_0x3dbc8a,_0x4a9721,_0x3d61ad){return _0x3dbc8a(_0x4a9721,_0x3d61ad);},'QmjQC':function(_0x478026){return _0x478026();},'iwYqg':function(_0x58c491,_0x36239e){return _0x58c491(_0x36239e);},'blTAZ':function(_0x347100,_0x4a2832){return _0x347100===_0x4a2832;},'zBkcy':_0xbf0a(0x24),'dRxxc':function(_0x3405a6,_0x482e35){return _0x3405a6(_0x482e35);},'FAdpS':_0xbf0a(0x25),'YKwbp':_0xbf0a(0x26),'NbGwz':_0xbf0a(0x27),'Ooszo':function(_0x553100,_0x43c346){return _0x553100||_0x43c346;},'RssdQ':_0xbf0a(0x28),'bKBzm':function(_0x425977,_0x20e86e){return _0x425977===_0x20e86e;},'DWqjh':_0xbf0a(0x29),'Umtmn':_0xbf0a(0x2a),'rWvqN':_0xbf0a(0x2b),'lOkiM':function(_0x123f7f,_0xef8b6f){return _0x123f7f||_0xef8b6f;},'SuTYh':'Basic\x20tier','ipQtc':_0xbf0a(0x2c),'zTtkz':_0xbf0a(0x2d),'QpyGW':_0xbf0a(0x2e),'RIFfU':'Premium\x20features','uHuNF':_0xbf0a(0x2f),'gbmsT':'Premium\x20tier','wmkGU':_0xbf0a(0x30),'aaBFf':'onairosevents://auth/callback'},[_0x287e2f,_0x185924]=(0x0,_react[_0xbf0a(0x31)])(![]),[_0x4162ab,_0xac46db]=(0x0,_react[_0xbf0a(0x31)])(![]),[_0x2db6ae,_0x2f0591]=(0x0,_react['useState'])(![]);console[_0xbf0a(0x32)](_0x3c9877[_0xbf0a(0x33)],_0x2db6ae),(0x0,_react[_0xbf0a(0x34)])(()=>{if(_0x3c9877[_0xbf0a(0x35)](_0x3c9877[_0xbf0a(0x36)],_0x3c9877[_0xbf0a(0x37)])){if(_0x22d326[_0xbf0a(0x7)](_0x4caa31))return _0x67bdb2[_0xbf0a(0xc)](_0x1d22f5);_0xf41273[_0xbf0a(0x8)](_0x562ee0,_0x276171);}else console['log'](_0xbf0a(0x38),_0x2db6ae);},[_0x2db6ae]),(0x0,_react['useImperativeHandle'])(_0x2eebe0,()=>({'trigger':async()=>{return await _0x3c9877[_0xbf0a(0x39)](_0x3b6762),Promise[_0xbf0a(0x3a)]();},'reset':async()=>{return Promise[_0xbf0a(0x3a)]();}}));const _0x3b6762=async()=>{const _0xb52436={'aUkqY':function(_0x562f77,_0x157043){return _0x3c9877[_0xbf0a(0x3b)](_0x562f77,_0x157043);},'bCwNB':function(_0x386e0a,_0x1a3f32){return _0x386e0a&&_0x1a3f32;},'idJOE':function(_0x5d4eb5,_0x388441){return _0x3c9877[_0xbf0a(0x3c)](_0x5d4eb5,_0x388441);},'KczAV':'function','cMOua':function(_0x5130ae,_0x27b21a,_0x4c9782,_0x448331){return _0x3c9877[_0xbf0a(0x3d)](_0x5130ae,_0x27b21a,_0x4c9782,_0x448331);}};if(_0x3c9877['kBXab']!==_0x3c9877[_0xbf0a(0x3e)])_0x3c9877[_0xbf0a(0x39)](_0x5a23a2);else{console['log'](_0xbf0a(0x3f));if(_0x3c9877[_0xbf0a(0x40)](!enabled,_0x287e2f))return;_0x3c9877[_0xbf0a(0x41)](_0x185924,!![]);try{if(!(0x0,_apiKeyService[_0xbf0a(0x42)])()){if(_0x3c9877[_0xbf0a(0x43)](_0x3c9877['mEsVF'],_0x3c9877[_0xbf0a(0x44)]))_0xb52436[_0xbf0a(0x45)](_0x5fd3f9,'User\x20closed\x20onboarding');else{const _0x2388ce='Onairos\x20SDK\x20not\x20initialized.\x20Developers\x20must\x20call\x20initializeApiKey()\x20with\x20a\x20valid\x20API\x20key\x20before\x20using\x20SDK\x20components.\x20Get\x20your\x20API\x20key\x20from\x20https://dashboard.onairos.uk';console[_0xbf0a(0x46)](_0x3c9877[_0xbf0a(0x47)],_0x2388ce);if(_0x50849d)_0x3c9877['YXvwQ'](_0x50849d,_0x2388ce);else{if(_0x3c9877[_0xbf0a(0x48)]===_0x3c9877[_0xbf0a(0x48)])_reactNative[_0xbf0a(0x49)][_0xbf0a(0x4a)](_0x3c9877[_0xbf0a(0x4b)],_0xbf0a(0x4c),[{'text':'OK'}]);else{const _0x7ebdc5={'hyopr':function(_0xeae159,_0x14ed6b){return _0xb52436[_0xbf0a(0x4d)](_0xeae159,_0x14ed6b);},'FVivH':function(_0x2957bc,_0x81dbc5){return _0x2957bc===_0x81dbc5;},'lDQsa':function(_0x3a0e78,_0x36df9e){return _0xb52436[_0xbf0a(0x4e)](_0x3a0e78,_0x36df9e);},'AtGmE':_0xb52436['KczAV'],'bErZC':function(_0x39b04e,_0x178b7c,_0x167f8e,_0x102fc6){return _0xb52436['cMOua'](_0x39b04e,_0x178b7c,_0x167f8e,_0x102fc6);}};if(_0xb52436[_0xbf0a(0x4f)]==typeof _0x3c2f2b)var _0x2d3ee4=new _0x36dd77(),_0x517f31=new _0x203438();return(_0x121f25=function(_0x5b680b,_0x5992ca){if(_0x7ebdc5[_0xbf0a(0x50)](!_0x5992ca,_0x5b680b)&&_0x5b680b[_0xbf0a(0x0)])return _0x5b680b;var _0x15930f,_0x2c8d25,_0x27aea3={'__proto__':null,'default':_0x5b680b};if(_0x7ebdc5[_0xbf0a(0x51)](null,_0x5b680b)||_0x7ebdc5[_0xbf0a(0x52)](_0xbf0a(0x53),typeof _0x5b680b)&&_0x7ebdc5[_0xbf0a(0x52)](_0x7ebdc5[_0xbf0a(0x54)],typeof _0x5b680b))return _0x27aea3;if(_0x15930f=_0x5992ca?_0x517f31:_0x2d3ee4){if(_0x15930f[_0xbf0a(0x7)](_0x5b680b))return _0x15930f[_0xbf0a(0xc)](_0x5b680b);_0x15930f[_0xbf0a(0x8)](_0x5b680b,_0x27aea3);}for(const _0x1ea797 in _0x5b680b)_0xbf0a(0x3)!==_0x1ea797&&{}[_0xbf0a(0x9)][_0xbf0a(0xa)](_0x5b680b,_0x1ea797)&&((_0x2c8d25=(_0x15930f=_0xa082d6['defineProperty'])&&_0x49c72f[_0xbf0a(0xb)](_0x5b680b,_0x1ea797))&&(_0x2c8d25['get']||_0x2c8d25['set'])?_0x7ebdc5['bErZC'](_0x15930f,_0x27aea3,_0x1ea797,_0x2c8d25):_0x27aea3[_0x1ea797]=_0x5b680b[_0x1ea797]);return _0x27aea3;})(_0x491d28,_0x2678ff);}}_0x3c9877[_0xbf0a(0x55)](_0x185924,![]);return;}}const _0x22c2fc=(0x0,_apiKeyService['getApiConfig'])();if(debug){var _0x1b82fa;console[_0xbf0a(0x32)](_0x3c9877[_0xbf0a(0x56)],_0x3c9877[_0xbf0a(0x57)](_0x3c9877['SFaER'](_0x22c2fc,null)||_0x3c9877[_0xbf0a(0x58)](_0x22c2fc,void 0x0)||(_0x1b82fa=_0x22c2fc[_0xbf0a(0x59)])===null||_0x3c9877[_0xbf0a(0x5a)](_0x1b82fa,void 0x0)?void 0x0:_0x1b82fa['substring'](0x0,0x8),_0x3c9877['vkhxl']));}if(_0x485936){const _0x48a416=await _0x3c9877[_0xbf0a(0x39)](_0x485936);if(!_0x48a416){if(_0x3c9877[_0xbf0a(0x5b)](_0x3c9877[_0xbf0a(0x5c)],_0x3c9877['CUmAR'])){console[_0xbf0a(0x32)](_0x3c9877[_0xbf0a(0x5d)]),_0x3c9877[_0xbf0a(0x5a)](_0x50849d,null)||_0x3c9877['VbLie'](_0x50849d,void 0x0)||_0x50849d(_0x3c9877['gWxxZ']),_0x3c9877[_0xbf0a(0x41)](_0x185924,![]);return;}else{const _0x54a454=_0x3c9877['aDZxk'];_0x48d874[_0xbf0a(0x46)](_0x3c9877[_0xbf0a(0x47)],_0x54a454);_0xc76e7d?_0x3c9877['VWECb'](_0x27fe53,_0x54a454):_0x3c65a1['Alert']['alert'](_0x3c9877[_0xbf0a(0x4b)],_0x3c9877[_0xbf0a(0x5e)],[{'text':'OK'}]);_0x3c9877[_0xbf0a(0x3b)](_0x1b4c7b,![]);return;}}}console['log'](_0x3c9877['JvRSg']),_0x3c9877['vDtEq'](_0x2f0591,!![]),_0x3c9877[_0xbf0a(0x5f)](_0x185924,![]);}catch(_0x4368af){console[_0xbf0a(0x46)](_0x3c9877[_0xbf0a(0x60)],_0x4368af),_0x50849d===null||_0x3c9877['SFaER'](_0x50849d,void 0x0)||_0x50849d(_0x3c9877['QRnMm'](_0x4368af,Error)?_0x4368af['message']:_0x3c9877[_0xbf0a(0x61)]),_0x3c9877[_0xbf0a(0x5f)](_0x185924,![]);}}},_0x4901b5=()=>{switch(buttonForm){case _0x3c9877[_0xbf0a(0x62)]:return _0x3c9877[_0xbf0a(0x63)];case _0x3c9877[_0xbf0a(0x64)]:return _0x3c9877[_0xbf0a(0x65)];case _0x3c9877[_0xbf0a(0x66)]:return _0x3c9877[_0xbf0a(0x67)];default:return _0x3c9877[_0xbf0a(0x63)];}},_0x3a9641=(0x0,_react[_0xbf0a(0x68)])((_0x55f28c,_0x2fa62f)=>{console[_0xbf0a(0x32)]('[OnairosButton]\x20handleOnboardingComplete:\x20Setting\x20showOnboarding\x20to\x20false.'),_0x3c9877['VWECb'](_0x2f0591,![]);if(_0x1494cd){if(_0x3c9877[_0xbf0a(0x43)](_0xbf0a(0x69),_0x3c9877[_0xbf0a(0x6a)]))_0x3c9877[_0xbf0a(0x6b)](_0x1494cd,_0x55f28c,_0x2fa62f);else switch(_0x329621){case _0x3c9877[_0xbf0a(0x62)]:return _0xbf0a(0x20);case _0x3c9877[_0xbf0a(0x64)]:return _0x3c9877['ZSGnS'];case _0xbf0a(0x23):return _0x3c9877[_0xbf0a(0x67)];default:return _0x3c9877[_0xbf0a(0x63)];}}_0xadc3a8&&_0x3c9877[_0xbf0a(0x39)](_0xadc3a8);},[_0x1494cd,_0xadc3a8]),_0x510c94=(0x0,_react['useCallback'])(()=>{const _0x3d85be={'fgdgy':_0xbf0a(0x6c),'LsuYY':function(_0x36a9ca){return _0x3c9877[_0xbf0a(0x6d)](_0x36a9ca);}};console[_0xbf0a(0x32)](_0xbf0a(0x6e)),_0x3c9877['iwYqg'](_0x2f0591,![]),_0x50849d&&(_0x3c9877[_0xbf0a(0x6f)](_0x3c9877[_0xbf0a(0x70)],_0x3c9877[_0xbf0a(0x70)])?_0x3c9877[_0xbf0a(0x71)](_0x50849d,_0xbf0a(0x72)):(_0x18697f[_0xbf0a(0x32)](_0x3d85be[_0xbf0a(0x73)]),_0x45b506(![]),_0x58d3f2&&_0x36bd59(_0x582de9,_0x46a8a2),_0x5d10b0&&_0x3d85be['LsuYY'](_0x1443b8)));},[_0x50849d]);return console['log'](_0x3c9877[_0xbf0a(0x74)],{'AppName':_0x363e29,'buttonType':buttonType,'buttonWidth':buttonWidth,'buttonHeight':buttonHeight,'hasStroke':hasStroke,'enabled':enabled,'buttonForm':buttonForm,'onResolved':_0x1494cd,'onRejection':_0x50849d,'preCheck':_0x485936,'color':color,'swerv':swerv,'darkMode':darkMode,'returnLink':_0x5dbd50,'preferredPlatform':_0xd22077,'autoFetch':autoFetch,'inferenceData':_0x58b97e,'textLayout':textLayout,'textColor':textColor,'proofMode':proofMode,'webpageName':_0x3e6521,'debug':debug,'testMode':testMode,'requestData':_0x1054e4,'onPress':_0xadc3a8,'primaryAuthOnly':primaryAuthOnly,'useNewWelcomeFlow':useNewWelcomeFlow}),_react[_0xbf0a(0x3)]['createElement'](_react[_0xbf0a(0x3)][_0xbf0a(0x75)],null,_react[_0xbf0a(0x3)][_0xbf0a(0x76)](_reactNative['View'],null,_react[_0xbf0a(0x3)][_0xbf0a(0x76)](_reactNative['TouchableOpacity'],{'style':[styles[_0xbf0a(0x77)],_0x3c9877[_0xbf0a(0x58)](buttonType,_0x3c9877[_0xbf0a(0x78)])&&styles[_0xbf0a(0x79)],hasStroke&&styles['strokedButton'],{'width':buttonWidth,'height':buttonHeight},swerv&&styles[_0xbf0a(0x7a)],!enabled&&styles[_0xbf0a(0x7b)]],'onPress':_0x3b6762,'disabled':_0x3c9877['Ooszo'](!enabled,_0x287e2f),'onPressIn':()=>_0xac46db(!![]),'onPressOut':()=>_0xac46db(![])},_react[_0xbf0a(0x3)][_0xbf0a(0x76)](_reactNativeLinearGradient['default'],{'colors':[_0x3c9877[_0xbf0a(0x7c)],_0xbf0a(0x7d),_0xbf0a(0x7e)],'start':{'x':0x0,'y':0x0},'end':{'x':0x1,'y':0x0},'style':{'position':_0xbf0a(0x7f),'left':0x0,'right':0x0,'top':0x0,'bottom':0x0,'borderRadius':_0x3c9877['bKBzm'](buttonType,_0x3c9877['NbGwz'])?0x18:0x8}}),_0x287e2f?_react['default'][_0xbf0a(0x76)](_reactNative['ActivityIndicator'],{'size':_0x3c9877[_0xbf0a(0x80)],'color':_0x3c9877[_0xbf0a(0x81)]}):_react[_0xbf0a(0x3)][_0xbf0a(0x76)](_reactNative[_0xbf0a(0x82)],{'style':styles['buttonContent']},_react['default'][_0xbf0a(0x76)](_reactNative[_0xbf0a(0x82)],{'style':styles[_0xbf0a(0x83)]},_react[_0xbf0a(0x3)][_0xbf0a(0x76)](_reactNative[_0xbf0a(0x84)],{'source':_assetRegistry[_0xbf0a(0x85)]['onairosLogoAlt'],'style':styles[_0xbf0a(0x86)],'resizeMode':_0x3c9877['rWvqN']})),_react[_0xbf0a(0x3)][_0xbf0a(0x76)](_reactNative[_0xbf0a(0x87)],{'style':[styles[_0xbf0a(0x88)],{'color':_0x3c9877[_0xbf0a(0x81)]}]},_0x4901b5())))),useNewWelcomeFlow?_react[_0xbf0a(0x3)][_0xbf0a(0x76)](_WelcomeScreen[_0xbf0a(0x3)],{'visible':_0x2db6ae,'onClose':_0x510c94,'onComplete':_0x3a9641}):_react[_0xbf0a(0x3)]['createElement'](_UniversalOnboarding['UniversalOnboarding'],{'visible':_0x2db6ae,'onClose':_0x510c94,'AppName':_0x363e29,'requestData':_0x3c9877[_0xbf0a(0x89)](_0x1054e4,{'Small':{'type':'Small','descriptions':_0x3c9877[_0xbf0a(0x8a)],'reward':_0x3c9877[_0xbf0a(0x8b)]},'Medium':{'type':_0x3c9877[_0xbf0a(0x8c)],'descriptions':_0x3c9877[_0xbf0a(0x8d)],'reward':_0x3c9877[_0xbf0a(0x8e)]},'Large':{'type':_0x3c9877['uHuNF'],'descriptions':_0x3c9877[_0xbf0a(0x8f)],'reward':_0x3c9877[_0xbf0a(0x90)]}}),'returnLink':_0x3c9877['lOkiM'](_0x5dbd50,_0x3c9877[_0xbf0a(0x91)]),'onComplete':_0x3a9641,'debug':debug,'test':testMode,'preferredPlatform':_0xd22077,'primaryAuthOnly':primaryAuthOnly}));}),styles=_reactNative[_0xbf0a(0x92)][_0xbf0a(0x93)]({'button':{'flexDirection':_0xbf0a(0x94),'alignItems':_0xbf0a(0x95),'justifyContent':_0xbf0a(0x95),'paddingVertical':0xc,'paddingHorizontal':0x10,'borderRadius':0x8,'shadowColor':_0xbf0a(0x96),'shadowOffset':{'width':0x0,'height':0x2},'shadowOpacity':0.2,'shadowRadius':0x4,'elevation':0x3,'overflow':_0xbf0a(0x97)},'buttonContent':{'flexDirection':_0xbf0a(0x94),'alignItems':'center','justifyContent':_0xbf0a(0x95)},'logoContainer':{'width':0x18,'height':0x18,'alignItems':_0xbf0a(0x95),'justifyContent':'center','marginRight':0x4},'logoText':{'color':'#C7A047','fontWeight':_0xbf0a(0x98),'fontSize':0xe},'logoImage':{'width':0x14,'height':0x14},'pillButton':{'borderRadius':0x18},'strokedButton':{'backgroundColor':_0xbf0a(0x99),'borderWidth':0x1},'swervButton':{'transform':[{'rotate':_0xbf0a(0x9a)}]},'disabledButton':{'opacity':0.6},'buttonText':{'fontSize':0x10,'fontWeight':_0xbf0a(0x9b),'textAlign':_0xbf0a(0x95)}});var _default=exports[_0xbf0a(0x3)]=OnairosButton;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.OnairosButton = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeLinearGradient = _interopRequireDefault(require("react-native-linear-gradient"));
|
|
10
|
+
var _UniversalOnboarding = require("./UniversalOnboarding");
|
|
11
|
+
var _WelcomeScreen = _interopRequireDefault(require("./WelcomeScreen"));
|
|
12
|
+
var _apiKeyService = require("../services/apiKeyService");
|
|
13
|
+
var _assetRegistry = require("../utils/assetRegistry");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
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); }
|
|
16
|
+
const {
|
|
17
|
+
width
|
|
18
|
+
} = _reactNative.Dimensions.get('window');
|
|
19
|
+
const OnairosButton = exports.OnairosButton = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
20
|
+
AppName,
|
|
21
|
+
buttonType = 'normal',
|
|
22
|
+
buttonWidth = 180,
|
|
23
|
+
buttonHeight = 48,
|
|
24
|
+
hasStroke = false,
|
|
25
|
+
enabled = true,
|
|
26
|
+
buttonForm = 'default',
|
|
27
|
+
onResolved,
|
|
28
|
+
onRejection,
|
|
29
|
+
preCheck,
|
|
30
|
+
color = '#1BA9D4',
|
|
31
|
+
swerv = false,
|
|
32
|
+
darkMode = false,
|
|
33
|
+
returnLink,
|
|
34
|
+
preferredPlatform,
|
|
35
|
+
autoFetch = false,
|
|
36
|
+
inferenceData,
|
|
37
|
+
textLayout = 'right',
|
|
38
|
+
textColor = 'black',
|
|
39
|
+
proofMode = false,
|
|
40
|
+
webpageName,
|
|
41
|
+
debug = false,
|
|
42
|
+
testMode = false,
|
|
43
|
+
requestData,
|
|
44
|
+
onPress,
|
|
45
|
+
primaryAuthOnly = false,
|
|
46
|
+
useNewWelcomeFlow = false
|
|
47
|
+
}, ref) => {
|
|
48
|
+
const [isLoading, setIsLoading] = (0, _react.useState)(false);
|
|
49
|
+
const [isPressed, setIsPressed] = (0, _react.useState)(false);
|
|
50
|
+
const [showOnboarding, setShowOnboarding] = (0, _react.useState)(false);
|
|
51
|
+
console.log('[OnairosButton] Initializing. Initial showOnboarding:', showOnboarding);
|
|
52
|
+
(0, _react.useEffect)(() => {
|
|
53
|
+
console.log('[OnairosButton] LogEffect: showOnboarding state changed to:', showOnboarding);
|
|
54
|
+
}, [showOnboarding]);
|
|
55
|
+
|
|
56
|
+
// Expose methods via ref
|
|
57
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
58
|
+
trigger: async () => {
|
|
59
|
+
await handlePress();
|
|
60
|
+
return Promise.resolve();
|
|
61
|
+
},
|
|
62
|
+
reset: async () => {
|
|
63
|
+
return Promise.resolve();
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
const handlePress = async () => {
|
|
67
|
+
console.log('[OnairosButton] handlePress called.');
|
|
68
|
+
if (!enabled || isLoading) return;
|
|
69
|
+
setIsLoading(true);
|
|
70
|
+
try {
|
|
71
|
+
// 🔒 CRITICAL: Check if SDK is properly initialized with valid API key
|
|
72
|
+
if (!(0, _apiKeyService.isApiKeyInitialized)()) {
|
|
73
|
+
const errorMessage = 'Onairos SDK not initialized. Developers must call initializeApiKey() with a valid API key before using SDK components. Get your API key from https://dashboard.onairos.uk';
|
|
74
|
+
console.error('❌ [OnairosButton] SDK NOT INITIALIZED:', errorMessage);
|
|
75
|
+
if (onRejection) {
|
|
76
|
+
onRejection(errorMessage);
|
|
77
|
+
} else {
|
|
78
|
+
_reactNative.Alert.alert('SDK Not Initialized', 'The Onairos SDK requires initialization with a valid API key.\n\nDevelopers: Please call initializeApiKey() before using OnairosButton.', [{
|
|
79
|
+
text: 'OK'
|
|
80
|
+
}]);
|
|
81
|
+
}
|
|
82
|
+
setIsLoading(false);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Log API key status for debugging
|
|
87
|
+
const config = (0, _apiKeyService.getApiConfig)();
|
|
88
|
+
if (debug) {
|
|
89
|
+
var _config$apiKey;
|
|
90
|
+
console.log('[OnairosButton] SDK initialized with API key:', (config === null || config === void 0 || (_config$apiKey = config.apiKey) === null || _config$apiKey === void 0 ? void 0 : _config$apiKey.substring(0, 8)) + '...');
|
|
91
|
+
}
|
|
92
|
+
if (preCheck) {
|
|
93
|
+
const shouldProceed = await preCheck();
|
|
94
|
+
if (!shouldProceed) {
|
|
95
|
+
console.log('[OnairosButton] Precheck failed. Setting showOnboarding to false (indirectly, by not setting to true).');
|
|
96
|
+
onRejection === null || onRejection === void 0 || onRejection('Precheck validation failed');
|
|
97
|
+
setIsLoading(false);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
console.log('[OnairosButton] handlePress: Setting showOnboarding to true.');
|
|
102
|
+
setShowOnboarding(true);
|
|
103
|
+
setIsLoading(false);
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error('[OnairosButton] Error in handlePress:', error);
|
|
106
|
+
onRejection === null || onRejection === void 0 || onRejection(error instanceof Error ? error.message : 'Unknown error');
|
|
107
|
+
setIsLoading(false);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// Compute button text based on buttonForm
|
|
112
|
+
const getButtonText = () => {
|
|
113
|
+
switch (buttonForm) {
|
|
114
|
+
case 'connect':
|
|
115
|
+
return 'Connect Onairos';
|
|
116
|
+
case 'login':
|
|
117
|
+
return 'Sign in with Onairos';
|
|
118
|
+
case 'signup':
|
|
119
|
+
return 'Sign up with Onairos';
|
|
120
|
+
default:
|
|
121
|
+
return 'Connect Onairos';
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// Handle onboarding completion
|
|
126
|
+
const handleOnboardingComplete = (0, _react.useCallback)((token, email) => {
|
|
127
|
+
console.log('[OnairosButton] handleOnboardingComplete: Setting showOnboarding to false.');
|
|
128
|
+
setShowOnboarding(false);
|
|
129
|
+
if (onResolved) {
|
|
130
|
+
// Call onResolved with the token and email
|
|
131
|
+
onResolved(token, email);
|
|
132
|
+
}
|
|
133
|
+
if (onPress) {
|
|
134
|
+
onPress();
|
|
135
|
+
}
|
|
136
|
+
}, [onResolved, onPress]);
|
|
137
|
+
|
|
138
|
+
// Handle onboarding close
|
|
139
|
+
const handleOnboardingClose = (0, _react.useCallback)(() => {
|
|
140
|
+
console.log('[OnairosButton] handleOnboardingClose: Setting showOnboarding to false.');
|
|
141
|
+
setShowOnboarding(false);
|
|
142
|
+
if (onRejection) {
|
|
143
|
+
onRejection('User closed onboarding');
|
|
144
|
+
}
|
|
145
|
+
}, [onRejection]);
|
|
146
|
+
console.log('[OnairosButton] Rendering JSX with props:', {
|
|
147
|
+
AppName,
|
|
148
|
+
buttonType,
|
|
149
|
+
buttonWidth,
|
|
150
|
+
buttonHeight,
|
|
151
|
+
hasStroke,
|
|
152
|
+
enabled,
|
|
153
|
+
buttonForm,
|
|
154
|
+
onResolved,
|
|
155
|
+
onRejection,
|
|
156
|
+
preCheck,
|
|
157
|
+
color,
|
|
158
|
+
swerv,
|
|
159
|
+
darkMode,
|
|
160
|
+
returnLink,
|
|
161
|
+
preferredPlatform,
|
|
162
|
+
autoFetch,
|
|
163
|
+
inferenceData,
|
|
164
|
+
textLayout,
|
|
165
|
+
textColor,
|
|
166
|
+
proofMode,
|
|
167
|
+
webpageName,
|
|
168
|
+
debug,
|
|
169
|
+
testMode,
|
|
170
|
+
requestData,
|
|
171
|
+
onPress,
|
|
172
|
+
primaryAuthOnly,
|
|
173
|
+
useNewWelcomeFlow
|
|
174
|
+
});
|
|
175
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
176
|
+
style: [styles.button, buttonType === 'pill' && styles.pillButton, hasStroke && styles.strokedButton, {
|
|
177
|
+
width: buttonWidth,
|
|
178
|
+
height: buttonHeight
|
|
179
|
+
}, swerv && styles.swervButton, !enabled && styles.disabledButton],
|
|
180
|
+
onPress: handlePress,
|
|
181
|
+
disabled: !enabled || isLoading,
|
|
182
|
+
onPressIn: () => setIsPressed(true),
|
|
183
|
+
onPressOut: () => setIsPressed(false)
|
|
184
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNativeLinearGradient.default, {
|
|
185
|
+
colors: ['#f5e7c1', '#C7A047', '#8B6914'],
|
|
186
|
+
start: {
|
|
187
|
+
x: 0,
|
|
188
|
+
y: 0
|
|
189
|
+
},
|
|
190
|
+
end: {
|
|
191
|
+
x: 1,
|
|
192
|
+
y: 0
|
|
193
|
+
},
|
|
194
|
+
style: {
|
|
195
|
+
position: 'absolute',
|
|
196
|
+
left: 0,
|
|
197
|
+
right: 0,
|
|
198
|
+
top: 0,
|
|
199
|
+
bottom: 0,
|
|
200
|
+
borderRadius: buttonType === 'pill' ? 24 : 8
|
|
201
|
+
}
|
|
202
|
+
}), isLoading ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
203
|
+
size: "small",
|
|
204
|
+
color: "#FFFFFF"
|
|
205
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
206
|
+
style: styles.buttonContent
|
|
207
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
208
|
+
style: styles.logoContainer
|
|
209
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
210
|
+
source: _assetRegistry.BRAND_IMAGES.onairosLogoAlt,
|
|
211
|
+
style: styles.logoImage,
|
|
212
|
+
resizeMode: "contain"
|
|
213
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
214
|
+
style: [styles.buttonText, {
|
|
215
|
+
color: '#FFFFFF'
|
|
216
|
+
}]
|
|
217
|
+
}, getButtonText())))), useNewWelcomeFlow ? /*#__PURE__*/_react.default.createElement(_WelcomeScreen.default, {
|
|
218
|
+
visible: showOnboarding,
|
|
219
|
+
onClose: handleOnboardingClose,
|
|
220
|
+
onComplete: handleOnboardingComplete
|
|
221
|
+
}) : /*#__PURE__*/_react.default.createElement(_UniversalOnboarding.UniversalOnboarding, {
|
|
222
|
+
visible: showOnboarding,
|
|
223
|
+
onClose: handleOnboardingClose,
|
|
224
|
+
AppName: AppName,
|
|
225
|
+
requestData: requestData || {
|
|
226
|
+
Small: {
|
|
227
|
+
type: 'Small',
|
|
228
|
+
descriptions: 'Basic tier',
|
|
229
|
+
reward: 'Free access'
|
|
230
|
+
},
|
|
231
|
+
Medium: {
|
|
232
|
+
type: 'Medium',
|
|
233
|
+
descriptions: 'Standard tier',
|
|
234
|
+
reward: 'Premium features'
|
|
235
|
+
},
|
|
236
|
+
Large: {
|
|
237
|
+
type: 'Large',
|
|
238
|
+
descriptions: 'Premium tier',
|
|
239
|
+
reward: 'Full personalization'
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
returnLink: returnLink || 'onairosevents://auth/callback',
|
|
243
|
+
onComplete: handleOnboardingComplete,
|
|
244
|
+
debug: debug,
|
|
245
|
+
test: testMode,
|
|
246
|
+
preferredPlatform: preferredPlatform,
|
|
247
|
+
primaryAuthOnly: primaryAuthOnly
|
|
248
|
+
}));
|
|
249
|
+
});
|
|
250
|
+
const styles = _reactNative.StyleSheet.create({
|
|
251
|
+
button: {
|
|
252
|
+
flexDirection: 'row',
|
|
253
|
+
alignItems: 'center',
|
|
254
|
+
justifyContent: 'center',
|
|
255
|
+
paddingVertical: 12,
|
|
256
|
+
paddingHorizontal: 16,
|
|
257
|
+
borderRadius: 8,
|
|
258
|
+
shadowColor: '#000',
|
|
259
|
+
shadowOffset: {
|
|
260
|
+
width: 0,
|
|
261
|
+
height: 2
|
|
262
|
+
},
|
|
263
|
+
shadowOpacity: 0.2,
|
|
264
|
+
shadowRadius: 4,
|
|
265
|
+
elevation: 3,
|
|
266
|
+
overflow: 'hidden'
|
|
267
|
+
},
|
|
268
|
+
buttonContent: {
|
|
269
|
+
flexDirection: 'row',
|
|
270
|
+
alignItems: 'center',
|
|
271
|
+
justifyContent: 'center'
|
|
272
|
+
},
|
|
273
|
+
logoContainer: {
|
|
274
|
+
width: 24,
|
|
275
|
+
height: 24,
|
|
276
|
+
// borderRadius: 12, // Removed to eliminate circle shape
|
|
277
|
+
// backgroundColor: '#FFFFFF', // Removed to eliminate white background
|
|
278
|
+
alignItems: 'center',
|
|
279
|
+
justifyContent: 'center',
|
|
280
|
+
marginRight: 4
|
|
281
|
+
},
|
|
282
|
+
logoText: {
|
|
283
|
+
color: '#C7A047',
|
|
284
|
+
fontWeight: 'bold',
|
|
285
|
+
fontSize: 14
|
|
286
|
+
},
|
|
287
|
+
logoImage: {
|
|
288
|
+
width: 20,
|
|
289
|
+
height: 20
|
|
290
|
+
},
|
|
291
|
+
pillButton: {
|
|
292
|
+
borderRadius: 24
|
|
293
|
+
},
|
|
294
|
+
strokedButton: {
|
|
295
|
+
backgroundColor: 'transparent',
|
|
296
|
+
borderWidth: 1
|
|
297
|
+
},
|
|
298
|
+
swervButton: {
|
|
299
|
+
transform: [{
|
|
300
|
+
rotate: '-2deg'
|
|
301
|
+
}]
|
|
302
|
+
},
|
|
303
|
+
disabledButton: {
|
|
304
|
+
opacity: 0.6
|
|
305
|
+
},
|
|
306
|
+
buttonText: {
|
|
307
|
+
fontSize: 16,
|
|
308
|
+
fontWeight: '600',
|
|
309
|
+
textAlign: 'center'
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
var _default = exports.default = OnairosButton;
|
|
313
|
+
//# sourceMappingURL=OnairosButton.js.map
|
|
@@ -1,12 +1,130 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.OnairosSignInButton = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
10
|
+
var _WelcomeScreen = _interopRequireDefault(require("./WelcomeScreen"));
|
|
11
|
+
var _haptics = require("../utils/haptics");
|
|
12
|
+
var _assetRegistry = require("../utils/assetRegistry");
|
|
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
|
+
const OnairosSignInButton = ({
|
|
16
|
+
AppName,
|
|
17
|
+
buttonWidth = 280,
|
|
18
|
+
buttonHeight = 44,
|
|
19
|
+
color = '#D4A536',
|
|
20
|
+
textColor = '#000',
|
|
21
|
+
onResolved,
|
|
22
|
+
onRejection,
|
|
23
|
+
autoFocusEmailInput = true
|
|
24
|
+
}) => {
|
|
25
|
+
const [showWelcomeScreen, setShowWelcomeScreen] = (0, _react.useState)(false);
|
|
26
|
+
const [userEmail, setUserEmail] = (0, _react.useState)('');
|
|
27
|
+
const handleWelcomeComplete = (0, _react.useCallback)((token, email) => {
|
|
28
|
+
console.log('🔍 OnairosSignInButton: handleWelcomeComplete called with:', {
|
|
29
|
+
token,
|
|
30
|
+
email
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Check if we received a JWT token (real authentication) or just a placeholder token
|
|
34
|
+
const isJWTToken = token && token.includes('.') && token.split('.').length === 3;
|
|
35
|
+
console.log('🔍 OnairosSignInButton: Is JWT token?', isJWTToken);
|
|
36
|
+
|
|
37
|
+
// Close the welcome screen
|
|
38
|
+
setShowWelcomeScreen(false);
|
|
39
|
+
if (onResolved) {
|
|
40
|
+
// For JWT tokens, use the provided email or get from storage
|
|
41
|
+
if (isJWTToken) {
|
|
42
|
+
console.log('🔑 Received JWT token from WelcomeScreen, completing sign-in');
|
|
43
|
+
_asyncStorage.default.getItem('user_email').then(storedEmail => {
|
|
44
|
+
const emailToUse = email || storedEmail || userEmail;
|
|
45
|
+
console.log('🔑 OnairosSignInButton: Returning JWT token with email:', emailToUse);
|
|
46
|
+
onResolved(token, emailToUse);
|
|
47
|
+
});
|
|
48
|
+
} else {
|
|
49
|
+
// For placeholder tokens, still complete the flow with the provided email
|
|
50
|
+
console.log('🔑 Received placeholder token from WelcomeScreen, completing sign-in');
|
|
51
|
+
const emailToUse = email || userEmail;
|
|
52
|
+
console.log('🔑 OnairosSignInButton: Returning token with email:', emailToUse);
|
|
53
|
+
onResolved(token, emailToUse);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, [onResolved, userEmail]);
|
|
57
|
+
const handleWelcomeCancel = (0, _react.useCallback)(() => {
|
|
58
|
+
setShowWelcomeScreen(false);
|
|
59
|
+
if (onRejection) {
|
|
60
|
+
onRejection('User closed welcome screen');
|
|
61
|
+
}
|
|
62
|
+
}, [onRejection]);
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
64
|
+
style: styles.container
|
|
65
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
66
|
+
style: [styles.button, {
|
|
67
|
+
width: buttonWidth,
|
|
68
|
+
height: buttonHeight,
|
|
69
|
+
backgroundColor: color
|
|
70
|
+
}],
|
|
71
|
+
onPress: () => {
|
|
72
|
+
console.log('🔘 OnairosSignInButton pressed, showing WelcomeScreen');
|
|
73
|
+
(0, _haptics.triggerHaptic)(_haptics.HapticType.BUTTON_PRESS);
|
|
74
|
+
setShowWelcomeScreen(true);
|
|
75
|
+
console.log('🔘 showWelcomeScreen state set to true');
|
|
76
|
+
},
|
|
77
|
+
activeOpacity: 0.85
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
79
|
+
style: styles.contentRow
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
81
|
+
source: _assetRegistry.BRAND_IMAGES.onairosLogoAlt,
|
|
82
|
+
style: styles.logo,
|
|
83
|
+
resizeMode: "contain",
|
|
84
|
+
accessibilityLabel: "Onairos logo"
|
|
85
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
86
|
+
style: [styles.buttonText, {
|
|
87
|
+
color: textColor
|
|
88
|
+
}]
|
|
89
|
+
}, "Sign in with Onairos"))), /*#__PURE__*/_react.default.createElement(_WelcomeScreen.default, {
|
|
90
|
+
visible: showWelcomeScreen,
|
|
91
|
+
onClose: handleWelcomeCancel,
|
|
92
|
+
onComplete: handleWelcomeComplete
|
|
93
|
+
}));
|
|
94
|
+
};
|
|
95
|
+
exports.OnairosSignInButton = OnairosSignInButton;
|
|
96
|
+
const styles = _reactNative.StyleSheet.create({
|
|
97
|
+
button: {
|
|
98
|
+
borderRadius: 24,
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
shadowColor: '#000',
|
|
102
|
+
shadowOffset: {
|
|
103
|
+
width: 0,
|
|
104
|
+
height: 2
|
|
105
|
+
},
|
|
106
|
+
shadowOpacity: 0.1,
|
|
107
|
+
shadowRadius: 4,
|
|
108
|
+
elevation: 2,
|
|
109
|
+
marginVertical: 8
|
|
110
|
+
},
|
|
111
|
+
contentRow: {
|
|
112
|
+
flexDirection: 'row',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
justifyContent: 'center'
|
|
115
|
+
},
|
|
116
|
+
logo: {
|
|
117
|
+
width: 26,
|
|
118
|
+
height: 26,
|
|
119
|
+
marginRight: 10
|
|
120
|
+
},
|
|
121
|
+
buttonText: {
|
|
122
|
+
fontSize: 16,
|
|
123
|
+
fontWeight: '600',
|
|
124
|
+
textAlign: 'center'
|
|
125
|
+
},
|
|
126
|
+
container: {
|
|
127
|
+
// Add any necessary styles for the container
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=OnairosSignInButton.js.map
|