@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 +1,510 @@
|
|
|
1
|
-
export const SEPHORA_CONSENT_POPUP_SCRIPT=_0x3e3e(0x0);export const SEPHORA_EXPORT_SCRIPT='\x0a(function()\x20{\x0a\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27🔄\x20[SEPHORA]\x20Script\x20version:\x20SDK_V1\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27DEBUG_LOG\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Sephora\x20Script\x20version:\x20SDK_V1\x20loaded\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!document.body)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_ERROR\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Page\x20not\x20ready\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20============================================================\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER\x20API\x20CONFIGURATION\x20-\x20REPLACE\x20WITH\x20ACTUAL\x20ENDPOINTS\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20============================================================\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20SEPHORA_CONFIG\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Base\x20URL\x20for\x20Sephora\x20API\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20baseUrl:\x20\x27https://www.sephora.com\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20apiBase:\x20\x27https://api.sephora.com\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20API\x20Endpoints\x20-\x20PLACEHOLDERS\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20endpoints:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Shopping\x20basket\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20basket:\x20\x27/api/basket\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cart:\x20\x27/api/v3/users/current/basket\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Order\x20history\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orders:\x20\x27/api/v3/users/current/orders\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orderHistory:\x20\x27/api/users/orders\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Favorites/Loves\x20list\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20loves:\x20\x27/api/v3/users/current/loves\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20favorites:\x20\x27/api/users/favorites\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Product\x20ratings/reviews\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ratings:\x20\x27/api/v3/users/current/ratings\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Beauty\x20profile/preferences\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20beautyProfile:\x20\x27/api/v3/users/current/beauty-profile\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20User\x20info\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userInfo:\x20\x27/api/v3/users/current\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Extract\x20authentication\x20data\x20from\x20cookies/page\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20getAuth:\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20auth\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20token:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userId:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sessionId:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20for\x20auth\x20token\x20in\x20cookies\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20tokenMatch\x20=\x20document.cookie.match(/sephora_token=([^;]+)/);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(tokenMatch)\x20auth.token\x20=\x20tokenMatch[1];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Alternative:\x20check\x20for\x20bearer\x20token\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20bearerMatch\x20=\x20document.cookie.match(/access_token=([^;]+)/);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(bearerMatch)\x20auth.token\x20=\x20bearerMatch[1];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20for\x20session\x20ID\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20sessionMatch\x20=\x20document.cookie.match(/JSESSIONID=([^;]+)/);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(sessionMatch)\x20auth.sessionId\x20=\x20sessionMatch[1];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Try\x20to\x20get\x20user\x20ID\x20from\x20page\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20for\x20user\x20data\x20in\x20window\x20object\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(window.user\x20&&\x20window.user.id)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20auth.userId\x20=\x20window.user.id;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20for\x20SephoraData\x20object\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(window.SephoraData\x20&&\x20window.SephoraData.user)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20auth.userId\x20=\x20window.SephoraData.user.id;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20meta\x20tags\x20or\x20data\x20attributes\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20userMeta\x20=\x20document.querySelector(\x27meta[name=\x22user-id\x22]\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(userMeta)\x20auth.userId\x20=\x20userMeta.content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(e)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Could\x20not\x20extract\x20user\x20data\x20from\x20page\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20auth;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Request\x20headers\x20template\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20getHeaders:\x20(auth)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Accept\x27:\x20\x27application/json\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Content-Type\x27:\x20\x27application/json\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Authorization\x27:\x20auth.token\x20?\x20\x27Bearer\x20\x27\x20+\x20auth.token\x20:\x20undefined,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27X-Session-Id\x27:\x20auth.sessionId\x20||\x20undefined,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Sephora-specific\x20headers\x20-\x20PLACEHOLDERS\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20\x27X-Sephora-Client\x27:\x20\x27web\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20\x27X-Sephora-Version\x27:\x20\x271.0\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20============================================================\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27🚀\x20[SEPHORA]\x20Starting\x20extraction...\x27);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20(async\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x201:\x20Get\x20authentication\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_auth\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x202,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Getting\x20authentication...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Getting\x20auth\x20data...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20auth\x20=\x20SEPHORA_CONFIG.getAuth();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Auth:\x27,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hasToken:\x20!!auth.token,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hasSession:\x20!!auth.sessionId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hasUserId:\x20!!auth.userId\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20headers\x20=\x20SEPHORA_CONFIG.getHeaders(auth);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x202:\x20Fetch\x20current\x20basket/cart\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_basket\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2010,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20shopping\x20basket...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20basket\x20=\x20{\x20items:\x20[],\x20total:\x200\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Fetching\x20basket...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20basketResponse\x20=\x20await\x20fetch(SEPHORA_CONFIG.baseUrl\x20+\x20SEPHORA_CONFIG.endpoints.basket,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Basket\x20response:\x27,\x20basketResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(basketResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20basketData\x20=\x20await\x20basketResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20basket\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20items:\x20basketData.items\x20||\x20basketData.products\x20||\x20[],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20total:\x20basketData.total\x20||\x20basketData.subtotal\x20||\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20itemCount:\x20basketData.itemCount\x20||\x20basketData.count\x20||\x200\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Basket\x20items:\x27,\x20basket.items.length);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(basketError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[SEPHORA]\x20Basket\x20fetch\x20error:\x27,\x20basketError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x203:\x20Fetch\x20order\x20history\x20(purchases)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_orders\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2030,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20purchase\x20history...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20orders\x20=\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Fetching\x20orders...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20ordersResponse\x20=\x20await\x20fetch(SEPHORA_CONFIG.baseUrl\x20+\x20SEPHORA_CONFIG.endpoints.orders,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Orders\x20response:\x27,\x20ordersResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(ordersResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20ordersData\x20=\x20await\x20ordersResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orders\x20=\x20ordersData.orders\x20||\x20ordersData.data\x20||\x20ordersData\x20||\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Found\x27,\x20orders.length,\x20\x27orders\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(ordersError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[SEPHORA]\x20Orders\x20fetch\x20error:\x27,\x20ordersError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x204:\x20Fetch\x20loves/favorites\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_loves\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2050,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20favorites...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20loves\x20=\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Fetching\x20loves...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20lovesResponse\x20=\x20await\x20fetch(SEPHORA_CONFIG.baseUrl\x20+\x20SEPHORA_CONFIG.endpoints.loves,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Loves\x20response:\x27,\x20lovesResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(lovesResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20lovesData\x20=\x20await\x20lovesResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20loves\x20=\x20lovesData.products\x20||\x20lovesData.items\x20||\x20lovesData.loves\x20||\x20lovesData\x20||\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Found\x27,\x20loves.length,\x20\x27loved\x20products\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(lovesError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[SEPHORA]\x20Loves\x20fetch\x20error:\x27,\x20lovesError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x205:\x20Fetch\x20product\x20ratings\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_ratings\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2070,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20ratings...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20ratings\x20=\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Fetching\x20ratings...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20ratingsResponse\x20=\x20await\x20fetch(SEPHORA_CONFIG.baseUrl\x20+\x20SEPHORA_CONFIG.endpoints.ratings,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Ratings\x20response:\x27,\x20ratingsResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(ratingsResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20ratingsData\x20=\x20await\x20ratingsResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ratings\x20=\x20ratingsData.ratings\x20||\x20ratingsData.reviews\x20||\x20ratingsData\x20||\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Found\x27,\x20ratings.length,\x20\x27ratings\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(ratingsError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[SEPHORA]\x20Ratings\x20fetch\x20error:\x27,\x20ratingsError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x206:\x20Process\x20and\x20format\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27processing\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2085,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Processing\x20data...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20basket\x20items\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedBasket\x20=\x20basket.items.map(item\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20id:\x20item.id\x20||\x20item.skuId\x20||\x20item.productId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20name:\x20item.displayName\x20||\x20item.name\x20||\x20item.productName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20brand:\x20item.brand\x20||\x20item.brandName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20price:\x20item.price\x20||\x20item.currentPrice,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20quantity:\x20item.quantity\x20||\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20category:\x20item.category\x20||\x20item.productCategory,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20imageUrl:\x20item.image\x20||\x20item.heroImage,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20orders\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedOrders\x20=\x20orders.slice(0,\x2050).map(order\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orderId:\x20order.id\x20||\x20order.orderId\x20||\x20order.orderNumber,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20date:\x20order.date\x20||\x20order.orderDate\x20||\x20order.createdAt,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20total:\x20order.total\x20||\x20order.orderTotal,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20order.status\x20||\x20order.orderStatus,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20items:\x20(order.items\x20||\x20order.products\x20||\x20[]).map(item\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20id:\x20item.id\x20||\x20item.skuId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20name:\x20item.displayName\x20||\x20item.name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20brand:\x20item.brand,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20price:\x20item.price,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20quantity:\x20item.quantity\x20||\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}))\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20loved/favorited\x20products\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedLoves\x20=\x20loves.slice(0,\x20100).map(item\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20id:\x20item.id\x20||\x20item.skuId\x20||\x20item.productId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20name:\x20item.displayName\x20||\x20item.name\x20||\x20item.productName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20brand:\x20item.brand\x20||\x20item.brandName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20category:\x20item.category\x20||\x20item.productCategory,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20price:\x20item.price\x20||\x20item.currentPrice,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20rating:\x20item.rating\x20||\x20item.averageRating,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20addedAt:\x20item.addedAt\x20||\x20item.createdAt,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27love\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20ratings\x20(could\x20indicate\x20dislikes\x20if\x20rating\x20is\x20low)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedRatings\x20=\x20ratings.slice(0,\x2050).map(rating\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20productId:\x20rating.productId\x20||\x20rating.skuId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20productName:\x20rating.productName\x20||\x20rating.displayName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20rating:\x20rating.rating\x20||\x20rating.score,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20review:\x20rating.review\x20||\x20rating.text\x20||\x20\x27\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20date:\x20rating.date\x20||\x20rating.createdAt,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20isRecommended:\x20rating.isRecommended\x20||\x20rating.recommend,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20(rating.rating\x20>=\x204)\x20?\x20\x27positive\x27\x20:\x20(rating.rating\x20<=\x202)\x20?\x20\x27negative\x27\x20:\x20\x27neutral\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x207:\x20Send\x20results\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27✅\x20[SEPHORA]\x20Extraction\x20complete:\x27,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20basket:\x20formattedBasket.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orders:\x20formattedOrders.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20loves:\x20formattedLoves.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ratings:\x20formattedRatings.length\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_COMPLETE\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27success\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20basket:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20items:\x20formattedBasket,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20total:\x20basket.total,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20itemCount:\x20formattedBasket.length\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orders:\x20formattedOrders,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20loves:\x20formattedLoves,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ratings:\x20formattedRatings,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20summary:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20totalBasketItems:\x20formattedBasket.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20totalOrders:\x20formattedOrders.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20totalLovedProducts:\x20formattedLoves.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20totalRatings:\x20formattedRatings.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20positiveRatings:\x20formattedRatings.filter(r\x20=>\x20r.type\x20===\x20\x27positive\x27).length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20negativeRatings:\x20formattedRatings.filter(r\x20=>\x20r.type\x20===\x20\x27negative\x27).length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userId:\x20auth.userId\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20success:\x20true\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(error)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.error(\x27❌\x20[SEPHORA]\x20Export\x20failed:\x27,\x20error.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_ERROR\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetch\x20failed:\x20\x27\x20+\x20error.message,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20success:\x20false\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20})();\x0a\x0a\x20\x20\x20\x20}\x20catch\x20(error)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20console.error(\x27❌\x20[SEPHORA]\x20Init\x20error:\x27,\x20error.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_ERROR\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Script\x20error:\x20\x27\x20+\x20error.message,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20success:\x20false\x0a\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20}\x0a})();\x0atrue;\x0a';function _0x1312(){const _0x3e888e=['\x0a(function()\x20{\x0a\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20existing\x20=\x20document.getElementById(\x27onairos-consent-overlay\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(existing)\x20existing.remove();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20overlay\x20=\x20document.createElement(\x27div\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20overlay.id\x20=\x20\x27onairos-consent-overlay\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20overlay.style.cssText\x20=\x20`\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20fixed;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20left:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20rgba(0,\x200,\x200,\x200.7);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20z-index:\x20999999;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-family:\x20-apple-system,\x20BlinkMacSystemFont,\x20\x27Segoe\x20UI\x27,\x20Roboto,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20\x20\x20`;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20popup\x20=\x20document.createElement(\x27div\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20popup.style.cssText\x20=\x20`\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20white;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2032px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20max-width:\x20400px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x2090%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20box-shadow:\x200\x2020px\x2060px\x20rgba(0,\x200,\x200,\x200.3);\x0a\x20\x20\x20\x20\x20\x20\x20\x20`;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20popup.innerHTML\x20=\x20`\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22text-align:\x20center;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22font-size:\x2048px;\x20margin-bottom:\x2016px;\x22>💄</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h2\x20style=\x22margin:\x200\x200\x2012px\x200;\x20font-size:\x2024px;\x20color:\x20#1a1a1a;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Export\x20Sephora\x20Data?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</h2>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20style=\x22margin:\x200\x200\x2024px\x200;\x20color:\x20#666;\x20font-size:\x2016px;\x20line-height:\x201.5;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Allow\x20Onairos\x20to\x20export\x20your\x20Sephora\x20shopping\x20activity\x20(basket,\x20favorites,\x20purchases)\x20for\x20analysis?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22display:\x20flex;\x20gap:\x2012px;\x20justify-content:\x20center;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20id=\x22onairos-deny\x22\x20style=\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20flex:\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2014px\x2024px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x202px\x20solid\x20#e0e0e0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20white;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20#666;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-weight:\x20600;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22>Deny</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20id=\x22onairos-allow\x22\x20style=\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20flex:\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2014px\x2024px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20linear-gradient(135deg,\x20#000000\x200%,\x20#333333\x20100%);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20white;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-weight:\x20600;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22>Allow</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20`;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20overlay.appendChild(popup);\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.body.appendChild(overlay);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-deny\x27).onclick\x20=\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overlay.remove();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_CONSENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27denied\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-allow\x27).onclick\x20=\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-allow\x27).innerHTML\x20=\x20\x27⏳\x20Starting...\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-allow\x27).disabled\x20=\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_CONSENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27allowed\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(()\x20=>\x20overlay.remove(),\x20500);\x0a\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20}\x20catch\x20(error)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_CONSENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20error.message\x0a\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20}\x0a})();\x0atrue;\x0a','\x0a(function()\x20{\x0a\x20\x20\x20\x20console.log(\x27✅\x20Sephora\x20export\x20successful!\x27);\x0a})();\x0atrue;\x0a','\x0a(function()\x20{\x0a\x20\x20\x20\x20console.log(\x27❌\x20Sephora\x20export\x20failed!\x27);\x0a})();\x0atrue;\x0a'];_0x1312=function(){return _0x3e888e;};return _0x1312();}function _0x3e3e(_0x131213,_0x3e3ee3){_0x131213=_0x131213-0x0;const _0x31731c=_0x1312();let _0x200965=_0x31731c[_0x131213];return _0x200965;}export const SEPHORA_SUCCESS_SCRIPT=_0x3e3e(0x1);export const SEPHORA_ERROR_SCRIPT=_0x3e3e(0x2);
|
|
1
|
+
/**
|
|
2
|
+
* Sephora WebView Injection Scripts
|
|
3
|
+
*
|
|
4
|
+
* JavaScript code injected into Sephora WebView to:
|
|
5
|
+
* 1. Show consent popup for user approval
|
|
6
|
+
* 2. Fetch user shopping data (basket, purchases, favorites)
|
|
7
|
+
* 3. Extract product preferences data
|
|
8
|
+
* 4. Track progress during export
|
|
9
|
+
* 5. Send data back to React Native
|
|
10
|
+
*
|
|
11
|
+
* @reference ChatGPT implementation: src/utils/webviewScripts/chatgpt.ts
|
|
12
|
+
*
|
|
13
|
+
* NOTE: API endpoints and token structures are PLACEHOLDERS
|
|
14
|
+
* Sephora uses multiple APIs for different data types (like Gemini pattern)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Consent Popup Script
|
|
19
|
+
* Shows user consent UI before exporting data
|
|
20
|
+
*/
|
|
21
|
+
export const SEPHORA_CONSENT_POPUP_SCRIPT = `
|
|
22
|
+
(function() {
|
|
23
|
+
try {
|
|
24
|
+
const existing = document.getElementById('onairos-consent-overlay');
|
|
25
|
+
if (existing) existing.remove();
|
|
26
|
+
|
|
27
|
+
const overlay = document.createElement('div');
|
|
28
|
+
overlay.id = 'onairos-consent-overlay';
|
|
29
|
+
overlay.style.cssText = \`
|
|
30
|
+
position: fixed;
|
|
31
|
+
top: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
background: rgba(0, 0, 0, 0.7);
|
|
36
|
+
z-index: 999999;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
41
|
+
\`;
|
|
42
|
+
|
|
43
|
+
const popup = document.createElement('div');
|
|
44
|
+
popup.style.cssText = \`
|
|
45
|
+
background: white;
|
|
46
|
+
border-radius: 16px;
|
|
47
|
+
padding: 32px;
|
|
48
|
+
max-width: 400px;
|
|
49
|
+
width: 90%;
|
|
50
|
+
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
51
|
+
\`;
|
|
52
|
+
|
|
53
|
+
popup.innerHTML = \`
|
|
54
|
+
<div style="text-align: center;">
|
|
55
|
+
<div style="font-size: 48px; margin-bottom: 16px;">💄</div>
|
|
56
|
+
<h2 style="margin: 0 0 12px 0; font-size: 24px; color: #1a1a1a;">
|
|
57
|
+
Export Sephora Data?
|
|
58
|
+
</h2>
|
|
59
|
+
<p style="margin: 0 0 24px 0; color: #666; font-size: 16px; line-height: 1.5;">
|
|
60
|
+
Allow Onairos to export your Sephora shopping activity (basket, favorites, purchases) for analysis?
|
|
61
|
+
</p>
|
|
62
|
+
<div style="display: flex; gap: 12px; justify-content: center;">
|
|
63
|
+
<button id="onairos-deny" style="
|
|
64
|
+
flex: 1;
|
|
65
|
+
padding: 14px 24px;
|
|
66
|
+
border: 2px solid #e0e0e0;
|
|
67
|
+
background: white;
|
|
68
|
+
color: #666;
|
|
69
|
+
border-radius: 8px;
|
|
70
|
+
font-size: 16px;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
">Deny</button>
|
|
74
|
+
<button id="onairos-allow" style="
|
|
75
|
+
flex: 1;
|
|
76
|
+
padding: 14px 24px;
|
|
77
|
+
border: none;
|
|
78
|
+
background: linear-gradient(135deg, #000000 0%, #333333 100%);
|
|
79
|
+
color: white;
|
|
80
|
+
border-radius: 8px;
|
|
81
|
+
font-size: 16px;
|
|
82
|
+
font-weight: 600;
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
">Allow</button>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
\`;
|
|
88
|
+
|
|
89
|
+
overlay.appendChild(popup);
|
|
90
|
+
document.body.appendChild(overlay);
|
|
91
|
+
|
|
92
|
+
document.getElementById('onairos-deny').onclick = () => {
|
|
93
|
+
overlay.remove();
|
|
94
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
95
|
+
type: 'SEPHORA_CONSENT',
|
|
96
|
+
status: 'denied'
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
document.getElementById('onairos-allow').onclick = () => {
|
|
101
|
+
document.getElementById('onairos-allow').innerHTML = '⏳ Starting...';
|
|
102
|
+
document.getElementById('onairos-allow').disabled = true;
|
|
103
|
+
|
|
104
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
105
|
+
type: 'SEPHORA_CONSENT',
|
|
106
|
+
status: 'allowed'
|
|
107
|
+
}));
|
|
108
|
+
|
|
109
|
+
setTimeout(() => overlay.remove(), 500);
|
|
110
|
+
};
|
|
111
|
+
} catch (error) {
|
|
112
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
113
|
+
type: 'SEPHORA_CONSENT',
|
|
114
|
+
status: 'error',
|
|
115
|
+
message: error.message
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
})();
|
|
119
|
+
true;
|
|
120
|
+
`;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Export Script - Sephora data extraction
|
|
124
|
+
*
|
|
125
|
+
* Sephora has multiple APIs (similar to Gemini pattern):
|
|
126
|
+
* 1. Cart/Basket API
|
|
127
|
+
* 2. Order History API
|
|
128
|
+
* 3. Loves/Favorites API
|
|
129
|
+
* 4. Product recommendations/ratings
|
|
130
|
+
*
|
|
131
|
+
* TODO: Fill in actual API endpoints once known:
|
|
132
|
+
* - BASKET_ENDPOINT: Current shopping basket
|
|
133
|
+
* - ORDERS_ENDPOINT: Purchase history
|
|
134
|
+
* - LOVES_ENDPOINT: Liked/favorited products
|
|
135
|
+
* - PROFILE_ENDPOINT: User beauty profile
|
|
136
|
+
*/
|
|
137
|
+
export const SEPHORA_EXPORT_SCRIPT = `
|
|
138
|
+
(function() {
|
|
139
|
+
try {
|
|
140
|
+
console.log('🔄 [SEPHORA] Script version: SDK_V1');
|
|
141
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
142
|
+
type: 'DEBUG_LOG',
|
|
143
|
+
message: 'Sephora Script version: SDK_V1 loaded'
|
|
144
|
+
}));
|
|
145
|
+
|
|
146
|
+
if (!document.body) {
|
|
147
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
148
|
+
type: 'SEPHORA_EXPORT_ERROR',
|
|
149
|
+
message: 'Page not ready'
|
|
150
|
+
}));
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ============================================================
|
|
155
|
+
// PLACEHOLDER API CONFIGURATION - REPLACE WITH ACTUAL ENDPOINTS
|
|
156
|
+
// ============================================================
|
|
157
|
+
const SEPHORA_CONFIG = {
|
|
158
|
+
// Base URL for Sephora API
|
|
159
|
+
baseUrl: 'https://www.sephora.com',
|
|
160
|
+
apiBase: 'https://api.sephora.com', // PLACEHOLDER
|
|
161
|
+
|
|
162
|
+
// API Endpoints - PLACEHOLDERS
|
|
163
|
+
endpoints: {
|
|
164
|
+
// Shopping basket
|
|
165
|
+
basket: '/api/basket', // PLACEHOLDER
|
|
166
|
+
cart: '/api/v3/users/current/basket', // PLACEHOLDER
|
|
167
|
+
|
|
168
|
+
// Order history
|
|
169
|
+
orders: '/api/v3/users/current/orders', // PLACEHOLDER
|
|
170
|
+
orderHistory: '/api/users/orders', // PLACEHOLDER
|
|
171
|
+
|
|
172
|
+
// Favorites/Loves list
|
|
173
|
+
loves: '/api/v3/users/current/loves', // PLACEHOLDER
|
|
174
|
+
favorites: '/api/users/favorites', // PLACEHOLDER
|
|
175
|
+
|
|
176
|
+
// Product ratings/reviews
|
|
177
|
+
ratings: '/api/v3/users/current/ratings', // PLACEHOLDER
|
|
178
|
+
|
|
179
|
+
// Beauty profile/preferences
|
|
180
|
+
beautyProfile: '/api/v3/users/current/beauty-profile', // PLACEHOLDER
|
|
181
|
+
|
|
182
|
+
// User info
|
|
183
|
+
userInfo: '/api/v3/users/current', // PLACEHOLDER
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
// Extract authentication data from cookies/page
|
|
187
|
+
getAuth: () => {
|
|
188
|
+
const auth = {
|
|
189
|
+
token: null,
|
|
190
|
+
userId: null,
|
|
191
|
+
sessionId: null,
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// Check for auth token in cookies
|
|
195
|
+
const tokenMatch = document.cookie.match(/sephora_token=([^;]+)/);
|
|
196
|
+
if (tokenMatch) auth.token = tokenMatch[1];
|
|
197
|
+
|
|
198
|
+
// Alternative: check for bearer token
|
|
199
|
+
const bearerMatch = document.cookie.match(/access_token=([^;]+)/);
|
|
200
|
+
if (bearerMatch) auth.token = bearerMatch[1];
|
|
201
|
+
|
|
202
|
+
// Check for session ID
|
|
203
|
+
const sessionMatch = document.cookie.match(/JSESSIONID=([^;]+)/);
|
|
204
|
+
if (sessionMatch) auth.sessionId = sessionMatch[1];
|
|
205
|
+
|
|
206
|
+
// Try to get user ID from page data
|
|
207
|
+
try {
|
|
208
|
+
// Check for user data in window object
|
|
209
|
+
if (window.user && window.user.id) {
|
|
210
|
+
auth.userId = window.user.id;
|
|
211
|
+
}
|
|
212
|
+
// Check for SephoraData object
|
|
213
|
+
if (window.SephoraData && window.SephoraData.user) {
|
|
214
|
+
auth.userId = window.SephoraData.user.id;
|
|
215
|
+
}
|
|
216
|
+
// Check meta tags or data attributes
|
|
217
|
+
const userMeta = document.querySelector('meta[name="user-id"]');
|
|
218
|
+
if (userMeta) auth.userId = userMeta.content;
|
|
219
|
+
} catch (e) {
|
|
220
|
+
console.log('[SEPHORA] Could not extract user data from page');
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
return auth;
|
|
224
|
+
},
|
|
225
|
+
|
|
226
|
+
// Request headers template
|
|
227
|
+
getHeaders: (auth) => ({
|
|
228
|
+
'Accept': 'application/json',
|
|
229
|
+
'Content-Type': 'application/json',
|
|
230
|
+
'Authorization': auth.token ? 'Bearer ' + auth.token : undefined,
|
|
231
|
+
'X-Session-Id': auth.sessionId || undefined,
|
|
232
|
+
// Sephora-specific headers - PLACEHOLDERS
|
|
233
|
+
// 'X-Sephora-Client': 'web',
|
|
234
|
+
// 'X-Sephora-Version': '1.0',
|
|
235
|
+
})
|
|
236
|
+
};
|
|
237
|
+
// ============================================================
|
|
238
|
+
|
|
239
|
+
console.log('🚀 [SEPHORA] Starting extraction...');
|
|
240
|
+
|
|
241
|
+
(async () => {
|
|
242
|
+
try {
|
|
243
|
+
// STEP 1: Get authentication data
|
|
244
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
245
|
+
type: 'SEPHORA_EXPORT_PROGRESS',
|
|
246
|
+
stage: 'fetching_auth',
|
|
247
|
+
progress: 2,
|
|
248
|
+
message: 'Getting authentication...'
|
|
249
|
+
}));
|
|
250
|
+
|
|
251
|
+
console.log('[SEPHORA] Getting auth data...');
|
|
252
|
+
const auth = SEPHORA_CONFIG.getAuth();
|
|
253
|
+
console.log('[SEPHORA] Auth:', {
|
|
254
|
+
hasToken: !!auth.token,
|
|
255
|
+
hasSession: !!auth.sessionId,
|
|
256
|
+
hasUserId: !!auth.userId
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
const headers = SEPHORA_CONFIG.getHeaders(auth);
|
|
260
|
+
|
|
261
|
+
// STEP 2: Fetch current basket/cart
|
|
262
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
263
|
+
type: 'SEPHORA_EXPORT_PROGRESS',
|
|
264
|
+
stage: 'fetching_basket',
|
|
265
|
+
progress: 10,
|
|
266
|
+
message: 'Fetching shopping basket...'
|
|
267
|
+
}));
|
|
268
|
+
|
|
269
|
+
let basket = { items: [], total: 0 };
|
|
270
|
+
console.log('[SEPHORA] Fetching basket...');
|
|
271
|
+
|
|
272
|
+
try {
|
|
273
|
+
const basketResponse = await fetch(SEPHORA_CONFIG.baseUrl + SEPHORA_CONFIG.endpoints.basket, {
|
|
274
|
+
method: 'GET',
|
|
275
|
+
credentials: 'include',
|
|
276
|
+
headers: headers
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
console.log('[SEPHORA] Basket response:', basketResponse.status);
|
|
280
|
+
|
|
281
|
+
if (basketResponse.ok) {
|
|
282
|
+
const basketData = await basketResponse.json();
|
|
283
|
+
// PLACEHOLDER: Adjust based on actual API response
|
|
284
|
+
basket = {
|
|
285
|
+
items: basketData.items || basketData.products || [],
|
|
286
|
+
total: basketData.total || basketData.subtotal || 0,
|
|
287
|
+
itemCount: basketData.itemCount || basketData.count || 0
|
|
288
|
+
};
|
|
289
|
+
console.log('[SEPHORA] Basket items:', basket.items.length);
|
|
290
|
+
}
|
|
291
|
+
} catch (basketError) {
|
|
292
|
+
console.warn('[SEPHORA] Basket fetch error:', basketError.message);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// STEP 3: Fetch order history (purchases)
|
|
296
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
297
|
+
type: 'SEPHORA_EXPORT_PROGRESS',
|
|
298
|
+
stage: 'fetching_orders',
|
|
299
|
+
progress: 30,
|
|
300
|
+
message: 'Fetching purchase history...'
|
|
301
|
+
}));
|
|
302
|
+
|
|
303
|
+
let orders = [];
|
|
304
|
+
console.log('[SEPHORA] Fetching orders...');
|
|
305
|
+
|
|
306
|
+
try {
|
|
307
|
+
const ordersResponse = await fetch(SEPHORA_CONFIG.baseUrl + SEPHORA_CONFIG.endpoints.orders, {
|
|
308
|
+
method: 'GET',
|
|
309
|
+
credentials: 'include',
|
|
310
|
+
headers: headers
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
console.log('[SEPHORA] Orders response:', ordersResponse.status);
|
|
314
|
+
|
|
315
|
+
if (ordersResponse.ok) {
|
|
316
|
+
const ordersData = await ordersResponse.json();
|
|
317
|
+
// PLACEHOLDER: Adjust based on actual API response
|
|
318
|
+
orders = ordersData.orders || ordersData.data || ordersData || [];
|
|
319
|
+
console.log('[SEPHORA] Found', orders.length, 'orders');
|
|
320
|
+
}
|
|
321
|
+
} catch (ordersError) {
|
|
322
|
+
console.warn('[SEPHORA] Orders fetch error:', ordersError.message);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// STEP 4: Fetch loves/favorites
|
|
326
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
327
|
+
type: 'SEPHORA_EXPORT_PROGRESS',
|
|
328
|
+
stage: 'fetching_loves',
|
|
329
|
+
progress: 50,
|
|
330
|
+
message: 'Fetching favorites...'
|
|
331
|
+
}));
|
|
332
|
+
|
|
333
|
+
let loves = [];
|
|
334
|
+
console.log('[SEPHORA] Fetching loves...');
|
|
335
|
+
|
|
336
|
+
try {
|
|
337
|
+
const lovesResponse = await fetch(SEPHORA_CONFIG.baseUrl + SEPHORA_CONFIG.endpoints.loves, {
|
|
338
|
+
method: 'GET',
|
|
339
|
+
credentials: 'include',
|
|
340
|
+
headers: headers
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
console.log('[SEPHORA] Loves response:', lovesResponse.status);
|
|
344
|
+
|
|
345
|
+
if (lovesResponse.ok) {
|
|
346
|
+
const lovesData = await lovesResponse.json();
|
|
347
|
+
// PLACEHOLDER: Adjust based on actual API response
|
|
348
|
+
loves = lovesData.products || lovesData.items || lovesData.loves || lovesData || [];
|
|
349
|
+
console.log('[SEPHORA] Found', loves.length, 'loved products');
|
|
350
|
+
}
|
|
351
|
+
} catch (lovesError) {
|
|
352
|
+
console.warn('[SEPHORA] Loves fetch error:', lovesError.message);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// STEP 5: Fetch product ratings
|
|
356
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
357
|
+
type: 'SEPHORA_EXPORT_PROGRESS',
|
|
358
|
+
stage: 'fetching_ratings',
|
|
359
|
+
progress: 70,
|
|
360
|
+
message: 'Fetching ratings...'
|
|
361
|
+
}));
|
|
362
|
+
|
|
363
|
+
let ratings = [];
|
|
364
|
+
console.log('[SEPHORA] Fetching ratings...');
|
|
365
|
+
|
|
366
|
+
try {
|
|
367
|
+
const ratingsResponse = await fetch(SEPHORA_CONFIG.baseUrl + SEPHORA_CONFIG.endpoints.ratings, {
|
|
368
|
+
method: 'GET',
|
|
369
|
+
credentials: 'include',
|
|
370
|
+
headers: headers
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
console.log('[SEPHORA] Ratings response:', ratingsResponse.status);
|
|
374
|
+
|
|
375
|
+
if (ratingsResponse.ok) {
|
|
376
|
+
const ratingsData = await ratingsResponse.json();
|
|
377
|
+
// PLACEHOLDER: Adjust based on actual API response
|
|
378
|
+
ratings = ratingsData.ratings || ratingsData.reviews || ratingsData || [];
|
|
379
|
+
console.log('[SEPHORA] Found', ratings.length, 'ratings');
|
|
380
|
+
}
|
|
381
|
+
} catch (ratingsError) {
|
|
382
|
+
console.warn('[SEPHORA] Ratings fetch error:', ratingsError.message);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// STEP 6: Process and format data
|
|
386
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
387
|
+
type: 'SEPHORA_EXPORT_PROGRESS',
|
|
388
|
+
stage: 'processing',
|
|
389
|
+
progress: 85,
|
|
390
|
+
message: 'Processing data...'
|
|
391
|
+
}));
|
|
392
|
+
|
|
393
|
+
// Format basket items
|
|
394
|
+
const formattedBasket = basket.items.map(item => ({
|
|
395
|
+
id: item.id || item.skuId || item.productId,
|
|
396
|
+
name: item.displayName || item.name || item.productName,
|
|
397
|
+
brand: item.brand || item.brandName,
|
|
398
|
+
price: item.price || item.currentPrice,
|
|
399
|
+
quantity: item.quantity || 1,
|
|
400
|
+
category: item.category || item.productCategory,
|
|
401
|
+
imageUrl: item.image || item.heroImage,
|
|
402
|
+
}));
|
|
403
|
+
|
|
404
|
+
// Format orders
|
|
405
|
+
const formattedOrders = orders.slice(0, 50).map(order => ({
|
|
406
|
+
orderId: order.id || order.orderId || order.orderNumber,
|
|
407
|
+
date: order.date || order.orderDate || order.createdAt,
|
|
408
|
+
total: order.total || order.orderTotal,
|
|
409
|
+
status: order.status || order.orderStatus,
|
|
410
|
+
items: (order.items || order.products || []).map(item => ({
|
|
411
|
+
id: item.id || item.skuId,
|
|
412
|
+
name: item.displayName || item.name,
|
|
413
|
+
brand: item.brand,
|
|
414
|
+
price: item.price,
|
|
415
|
+
quantity: item.quantity || 1,
|
|
416
|
+
}))
|
|
417
|
+
}));
|
|
418
|
+
|
|
419
|
+
// Format loved/favorited products
|
|
420
|
+
const formattedLoves = loves.slice(0, 100).map(item => ({
|
|
421
|
+
id: item.id || item.skuId || item.productId,
|
|
422
|
+
name: item.displayName || item.name || item.productName,
|
|
423
|
+
brand: item.brand || item.brandName,
|
|
424
|
+
category: item.category || item.productCategory,
|
|
425
|
+
price: item.price || item.currentPrice,
|
|
426
|
+
rating: item.rating || item.averageRating,
|
|
427
|
+
addedAt: item.addedAt || item.createdAt,
|
|
428
|
+
type: 'love'
|
|
429
|
+
}));
|
|
430
|
+
|
|
431
|
+
// Format ratings (could indicate dislikes if rating is low)
|
|
432
|
+
const formattedRatings = ratings.slice(0, 50).map(rating => ({
|
|
433
|
+
productId: rating.productId || rating.skuId,
|
|
434
|
+
productName: rating.productName || rating.displayName,
|
|
435
|
+
rating: rating.rating || rating.score,
|
|
436
|
+
review: rating.review || rating.text || '',
|
|
437
|
+
date: rating.date || rating.createdAt,
|
|
438
|
+
isRecommended: rating.isRecommended || rating.recommend,
|
|
439
|
+
type: (rating.rating >= 4) ? 'positive' : (rating.rating <= 2) ? 'negative' : 'neutral'
|
|
440
|
+
}));
|
|
441
|
+
|
|
442
|
+
// STEP 7: Send results
|
|
443
|
+
console.log('✅ [SEPHORA] Extraction complete:', {
|
|
444
|
+
basket: formattedBasket.length,
|
|
445
|
+
orders: formattedOrders.length,
|
|
446
|
+
loves: formattedLoves.length,
|
|
447
|
+
ratings: formattedRatings.length
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
451
|
+
type: 'SEPHORA_EXPORT_COMPLETE',
|
|
452
|
+
status: 'success',
|
|
453
|
+
data: {
|
|
454
|
+
basket: {
|
|
455
|
+
items: formattedBasket,
|
|
456
|
+
total: basket.total,
|
|
457
|
+
itemCount: formattedBasket.length
|
|
458
|
+
},
|
|
459
|
+
orders: formattedOrders,
|
|
460
|
+
loves: formattedLoves,
|
|
461
|
+
ratings: formattedRatings,
|
|
462
|
+
summary: {
|
|
463
|
+
totalBasketItems: formattedBasket.length,
|
|
464
|
+
totalOrders: formattedOrders.length,
|
|
465
|
+
totalLovedProducts: formattedLoves.length,
|
|
466
|
+
totalRatings: formattedRatings.length,
|
|
467
|
+
positiveRatings: formattedRatings.filter(r => r.type === 'positive').length,
|
|
468
|
+
negativeRatings: formattedRatings.filter(r => r.type === 'negative').length,
|
|
469
|
+
},
|
|
470
|
+
userId: auth.userId
|
|
471
|
+
},
|
|
472
|
+
success: true
|
|
473
|
+
}));
|
|
474
|
+
|
|
475
|
+
} catch (error) {
|
|
476
|
+
console.error('❌ [SEPHORA] Export failed:', error.message);
|
|
477
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
478
|
+
type: 'SEPHORA_EXPORT_ERROR',
|
|
479
|
+
status: 'error',
|
|
480
|
+
message: 'Fetch failed: ' + error.message,
|
|
481
|
+
success: false
|
|
482
|
+
}));
|
|
483
|
+
}
|
|
484
|
+
})();
|
|
485
|
+
|
|
486
|
+
} catch (error) {
|
|
487
|
+
console.error('❌ [SEPHORA] Init error:', error.message);
|
|
488
|
+
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
489
|
+
type: 'SEPHORA_EXPORT_ERROR',
|
|
490
|
+
status: 'error',
|
|
491
|
+
message: 'Script error: ' + error.message,
|
|
492
|
+
success: false
|
|
493
|
+
}));
|
|
494
|
+
}
|
|
495
|
+
})();
|
|
496
|
+
true;
|
|
497
|
+
`;
|
|
498
|
+
export const SEPHORA_SUCCESS_SCRIPT = `
|
|
499
|
+
(function() {
|
|
500
|
+
console.log('✅ Sephora export successful!');
|
|
501
|
+
})();
|
|
502
|
+
true;
|
|
503
|
+
`;
|
|
504
|
+
export const SEPHORA_ERROR_SCRIPT = `
|
|
505
|
+
(function() {
|
|
506
|
+
console.log('❌ Sephora export failed!');
|
|
507
|
+
})();
|
|
508
|
+
true;
|
|
509
|
+
`;
|
|
510
|
+
//# sourceMappingURL=sephora.js.map
|