@multiplayer-app/session-recorder-react-native 1.0.1-beta.3 → 1.0.1-beta.5
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/LICENSE +1 -2
- package/README.md +216 -155
- package/SessionRecorderNative.podspec +9 -14
- package/android/build.gradle +21 -44
- package/android/gradle.properties +4 -4
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeConfig.kt +52 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeModule.kt +860 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativePackage.kt +33 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/model/TargetInfo.kt +9 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/util/ViewUtils.kt +72 -0
- package/ios/SessionRecorderNative.podspec +4 -2
- package/ios/SessionRecorderNative.swift +1 -1
- package/ios/SessionRecorderNativeSpec.swift +3 -3
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js +23 -0
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js.map +1 -0
- package/lib/module/components/ScreenRecorderView/index.js +4 -0
- package/lib/module/components/ScreenRecorderView/index.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js +64 -0
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js +74 -0
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js +191 -0
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js +138 -0
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js +177 -0
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js +27 -0
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js +133 -0
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/icons.js +93 -0
- package/lib/module/components/SessionRecorderWidget/icons.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/index.js +5 -0
- package/lib/module/components/SessionRecorderWidget/index.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/styles.js +173 -0
- package/lib/module/components/SessionRecorderWidget/styles.js.map +1 -0
- package/lib/module/components/index.js +5 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/config/constants.js +42 -0
- package/lib/module/config/constants.js.map +1 -0
- package/lib/module/config/defaults.js +81 -0
- package/lib/module/config/defaults.js.map +1 -0
- package/lib/module/config/index.js +9 -0
- package/lib/module/config/index.js.map +1 -0
- package/lib/module/config/masking.js +35 -0
- package/lib/module/config/masking.js.map +1 -0
- package/lib/module/config/session-recorder.js +44 -0
- package/lib/module/config/session-recorder.js.map +1 -0
- package/lib/module/config/validators.js +28 -0
- package/lib/module/config/validators.js.map +1 -0
- package/lib/module/config/widget.js +35 -0
- package/lib/module/config/widget.js.map +1 -0
- package/lib/module/context/SessionRecorderContext.js +93 -0
- package/lib/module/context/SessionRecorderContext.js.map +1 -0
- package/lib/module/context/SessionRecorderStore.js +12 -0
- package/lib/module/context/SessionRecorderStore.js.map +1 -0
- package/lib/module/context/useSessionRecorderStore.js +20 -0
- package/lib/module/context/useSessionRecorderStore.js.map +1 -0
- package/lib/module/context/useStoreSelector.js +27 -0
- package/lib/module/context/useStoreSelector.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/SessionRecorderNative.js +74 -0
- package/lib/module/native/SessionRecorderNative.js.map +1 -0
- package/lib/module/native/index.js +4 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/otel/helpers.js +218 -0
- package/lib/module/otel/helpers.js.map +1 -0
- package/lib/module/otel/index.js +95 -0
- package/lib/module/otel/index.js.map +1 -0
- package/lib/module/otel/instrumentations/index.js +102 -0
- package/lib/module/otel/instrumentations/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/patch/index.js +4 -0
- package/lib/module/patch/index.js.map +1 -0
- package/lib/module/patch/xhr.js +116 -0
- package/lib/module/patch/xhr.js.map +1 -0
- package/lib/module/recorder/eventExporter.js +130 -0
- package/lib/module/recorder/eventExporter.js.map +1 -0
- package/lib/module/recorder/gestureRecorder.js +641 -0
- package/lib/module/recorder/gestureRecorder.js.map +1 -0
- package/lib/module/recorder/index.js +168 -0
- package/lib/module/recorder/index.js.map +1 -0
- package/lib/module/recorder/navigationTracker.js +228 -0
- package/lib/module/recorder/navigationTracker.js.map +1 -0
- package/lib/module/recorder/screenRecorder.js +495 -0
- package/lib/module/recorder/screenRecorder.js.map +1 -0
- package/lib/module/services/api.service.js +149 -0
- package/lib/module/services/api.service.js.map +1 -0
- package/lib/module/services/network.service.js +178 -0
- package/lib/module/services/network.service.js.map +1 -0
- package/lib/module/services/screenMaskingService.js +107 -0
- package/lib/module/services/screenMaskingService.js.map +1 -0
- package/lib/module/services/storage.service.js +179 -0
- package/lib/module/services/storage.service.js.map +1 -0
- package/lib/module/session-recorder.js +541 -0
- package/lib/module/session-recorder.js.map +1 -0
- package/lib/module/types/configs.js +4 -0
- package/lib/module/types/configs.js.map +1 -0
- package/lib/module/types/expo-constants.d.js +2 -0
- package/lib/module/types/expo-constants.d.js.map +1 -0
- package/lib/module/types/index.js +11 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/session-recorder.js +68 -0
- package/lib/module/types/session-recorder.js.map +1 -0
- package/lib/module/types/session.js +9 -0
- package/lib/module/types/session.js.map +1 -0
- package/lib/module/utils/app-metadata.js +28 -0
- package/lib/module/utils/app-metadata.js.map +1 -0
- package/lib/module/utils/constants.optional.expo.js +6 -0
- package/lib/module/utils/constants.optional.expo.js.map +1 -0
- package/lib/module/utils/constants.optional.js +8 -0
- package/lib/module/utils/constants.optional.js.map +1 -0
- package/lib/module/utils/createStore.js +27 -0
- package/lib/module/utils/createStore.js.map +1 -0
- package/lib/module/utils/index.js +11 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/logger.js +185 -0
- package/lib/module/utils/logger.js.map +1 -0
- package/lib/module/utils/platform.js +340 -0
- package/lib/module/utils/platform.js.map +1 -0
- package/lib/module/utils/request-utils.js +58 -0
- package/lib/module/utils/request-utils.js.map +1 -0
- package/lib/module/utils/rrweb-events.js +276 -0
- package/lib/module/utils/rrweb-events.js.map +1 -0
- package/lib/module/utils/session.js +21 -0
- package/lib/module/utils/session.js.map +1 -0
- package/lib/module/utils/shallowEqual.js +17 -0
- package/lib/module/utils/shallowEqual.js.map +1 -0
- package/lib/module/utils/time.js +17 -0
- package/lib/module/utils/time.js.map +1 -0
- package/lib/module/utils/type-utils.js +69 -0
- package/lib/module/utils/type-utils.js.map +1 -0
- package/lib/module/version.js +4 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts +6 -0
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts.map +1 -0
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts +2 -0
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ErrorBanner.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ErrorBanner.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/FinalPopover.d.ts +2 -1
- package/lib/typescript/src/components/SessionRecorderWidget/FinalPopover.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/FloatingButton.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/FloatingButton.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/InitialPopover.d.ts +2 -1
- package/lib/typescript/src/components/SessionRecorderWidget/InitialPopover.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ModalContainer.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ModalContainer.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ModalHeader.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ModalHeader.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/SessionRecorderWidget.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/SessionRecorderWidget.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/icons.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/icons.d.ts.map +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts +3 -0
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/styles.d.ts +4 -3
- package/lib/typescript/src/components/SessionRecorderWidget/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +3 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/constants.d.ts +1 -0
- package/lib/typescript/src/config/constants.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/defaults.d.ts +2 -1
- package/lib/typescript/src/config/defaults.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/index.d.ts +1 -0
- package/lib/typescript/src/config/index.d.ts.map +1 -0
- package/lib/typescript/src/config/masking.d.ts +3 -0
- package/lib/typescript/src/config/masking.d.ts.map +1 -0
- package/lib/typescript/src/config/session-recorder.d.ts +3 -0
- package/lib/typescript/src/config/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/validators.d.ts +1 -0
- package/lib/typescript/src/config/validators.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/widget.d.ts +2 -1
- package/lib/typescript/src/config/widget.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/SessionRecorderContext.d.ts +3 -2
- package/lib/typescript/src/context/SessionRecorderContext.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/SessionRecorderStore.d.ts +2 -1
- package/lib/typescript/src/context/SessionRecorderStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/useSessionRecorderStore.d.ts +4 -3
- package/lib/typescript/src/context/useSessionRecorderStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/useStoreSelector.d.ts +2 -1
- package/lib/typescript/src/context/useStoreSelector.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/native/SessionRecorderNative.d.ts +21 -3
- package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +1 -0
- package/lib/typescript/src/native/index.d.ts +2 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/helpers.d.ts +3 -2
- package/lib/typescript/src/otel/helpers.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/index.d.ts +2 -2
- package/lib/typescript/src/otel/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/instrumentations/index.d.ts +2 -1
- package/lib/typescript/src/otel/instrumentations/index.d.ts.map +1 -0
- package/lib/typescript/src/patch/index.d.ts +2 -0
- package/lib/typescript/src/patch/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/patch/xhr.d.ts +1 -0
- package/lib/typescript/src/patch/xhr.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/eventExporter.d.ts +2 -1
- package/lib/typescript/src/recorder/eventExporter.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/gestureRecorder.d.ts +3 -2
- package/lib/typescript/src/recorder/gestureRecorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/index.d.ts +3 -2
- package/lib/typescript/src/recorder/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/navigationTracker.d.ts +2 -1
- package/lib/typescript/src/recorder/navigationTracker.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/screenRecorder.d.ts +4 -4
- package/lib/typescript/src/recorder/screenRecorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/api.service.d.ts +2 -1
- package/lib/typescript/src/services/api.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/network.service.d.ts +1 -0
- package/lib/typescript/src/services/network.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/screenMaskingService.d.ts +2 -1
- package/lib/typescript/src/services/screenMaskingService.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/storage.service.d.ts +2 -1
- package/lib/typescript/src/services/storage.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/session-recorder.d.ts +3 -2
- package/lib/typescript/src/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/configs.d.ts +3 -2
- package/lib/typescript/src/types/configs.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/index.d.ts +1 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/session-recorder.d.ts +7 -6
- package/lib/typescript/src/types/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/session.d.ts +1 -0
- package/lib/typescript/src/types/session.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/app-metadata.d.ts +1 -0
- package/lib/typescript/src/utils/app-metadata.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/constants.optional.d.ts +1 -0
- package/lib/typescript/src/utils/constants.optional.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/constants.optional.expo.d.ts +1 -0
- package/lib/typescript/src/utils/constants.optional.expo.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/createStore.d.ts +1 -0
- package/lib/typescript/src/utils/createStore.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +8 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/logger.d.ts +2 -1
- package/lib/typescript/src/utils/logger.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/platform.d.ts +2 -1
- package/lib/typescript/src/utils/platform.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/request-utils.d.ts +1 -0
- package/lib/typescript/src/utils/request-utils.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/rrweb-events.d.ts +2 -1
- package/lib/typescript/src/utils/rrweb-events.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/session.d.ts +1 -0
- package/lib/typescript/src/utils/session.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/shallowEqual.d.ts +1 -0
- package/lib/typescript/src/utils/shallowEqual.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/time.d.ts +1 -0
- package/lib/typescript/src/utils/time.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/type-utils.d.ts +1 -0
- package/lib/typescript/src/utils/type-utils.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/version.d.ts +1 -0
- package/lib/typescript/src/version.d.ts.map +1 -0
- package/package.json +133 -44
- package/src/components/ScreenRecorderView/ScreenRecorderView.tsx +20 -0
- package/src/components/ScreenRecorderView/index.ts +1 -0
- package/src/components/SessionRecorderWidget/ErrorBanner.tsx +58 -0
- package/src/components/SessionRecorderWidget/FinalPopover.tsx +96 -0
- package/src/components/SessionRecorderWidget/FloatingButton.tsx +176 -0
- package/src/components/SessionRecorderWidget/InitialPopover.tsx +167 -0
- package/src/components/SessionRecorderWidget/ModalContainer.tsx +189 -0
- package/src/components/SessionRecorderWidget/ModalHeader.tsx +26 -0
- package/src/components/SessionRecorderWidget/SessionRecorderWidget.tsx +150 -0
- package/src/components/SessionRecorderWidget/icons.tsx +80 -0
- package/src/components/SessionRecorderWidget/index.ts +3 -0
- package/src/components/SessionRecorderWidget/styles.ts +168 -0
- package/src/config/constants.ts +67 -0
- package/src/config/defaults.ts +105 -0
- package/src/config/index.ts +6 -0
- package/src/config/masking.ts +60 -0
- package/src/config/session-recorder.ts +87 -0
- package/src/config/validators.ts +54 -0
- package/src/config/widget.ts +47 -0
- package/src/context/SessionRecorderContext.tsx +138 -0
- package/src/context/SessionRecorderStore.ts +22 -0
- package/src/context/useSessionRecorderStore.ts +34 -0
- package/src/context/useStoreSelector.ts +36 -0
- package/src/index.ts +10 -0
- package/src/native/SessionRecorderNative.ts +180 -0
- package/src/native/index.ts +5 -0
- package/src/otel/helpers.ts +290 -0
- package/src/otel/index.ts +132 -0
- package/src/otel/instrumentations/index.ts +118 -0
- package/src/patch/xhr.ts +148 -0
- package/src/recorder/eventExporter.ts +150 -0
- package/src/recorder/gestureRecorder.ts +828 -0
- package/src/recorder/index.ts +203 -0
- package/src/recorder/navigationTracker.ts +268 -0
- package/src/recorder/screenRecorder.ts +600 -0
- package/src/services/api.service.ts +216 -0
- package/src/services/network.service.ts +191 -0
- package/src/services/screenMaskingService.ts +153 -0
- package/src/services/storage.service.ts +248 -0
- package/src/session-recorder.ts +647 -0
- package/src/types/configs.ts +118 -0
- package/src/types/expo-constants.d.ts +7 -0
- package/src/types/index.ts +27 -0
- package/src/types/session-recorder.ts +381 -0
- package/src/types/session.ts +65 -0
- package/src/utils/app-metadata.ts +31 -0
- package/src/utils/constants.optional.expo.ts +5 -0
- package/src/utils/constants.optional.ts +18 -0
- package/src/utils/createStore.ts +32 -0
- package/{dist/utils/index.d.ts → src/utils/index.ts} +1 -0
- package/src/utils/logger.ts +245 -0
- package/src/utils/platform.ts +401 -0
- package/src/utils/request-utils.ts +61 -0
- package/src/utils/rrweb-events.ts +329 -0
- package/src/utils/session.ts +22 -0
- package/src/utils/shallowEqual.ts +20 -0
- package/src/utils/time.ts +20 -0
- package/src/utils/type-utils.ts +75 -0
- package/src/version.ts +1 -0
- package/REACT_NATIVE_SETUP.md +0 -91
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/android/gradlew +0 -249
- package/android/gradlew.bat +0 -92
- package/copy-react-native-dist.sh +0 -56
- package/dist/components/ScreenRecorderView/ScreenRecorderView.d.ts +0 -5
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js +0 -1
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js.map +0 -1
- package/dist/components/ScreenRecorderView/index.d.ts +0 -1
- package/dist/components/ScreenRecorderView/index.js +0 -1
- package/dist/components/ScreenRecorderView/index.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ErrorBanner.js +0 -1
- package/dist/components/SessionRecorderWidget/ErrorBanner.js.map +0 -1
- package/dist/components/SessionRecorderWidget/FinalPopover.js +0 -1
- package/dist/components/SessionRecorderWidget/FinalPopover.js.map +0 -1
- package/dist/components/SessionRecorderWidget/FloatingButton.js +0 -1
- package/dist/components/SessionRecorderWidget/FloatingButton.js.map +0 -1
- package/dist/components/SessionRecorderWidget/InitialPopover.js +0 -1
- package/dist/components/SessionRecorderWidget/InitialPopover.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ModalContainer.js +0 -1
- package/dist/components/SessionRecorderWidget/ModalContainer.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ModalHeader.js +0 -1
- package/dist/components/SessionRecorderWidget/ModalHeader.js.map +0 -1
- package/dist/components/SessionRecorderWidget/SessionRecorderWidget.js +0 -1
- package/dist/components/SessionRecorderWidget/SessionRecorderWidget.js.map +0 -1
- package/dist/components/SessionRecorderWidget/icons.js +0 -1
- package/dist/components/SessionRecorderWidget/icons.js.map +0 -1
- package/dist/components/SessionRecorderWidget/index.d.ts +0 -2
- package/dist/components/SessionRecorderWidget/index.js +0 -1
- package/dist/components/SessionRecorderWidget/index.js.map +0 -1
- package/dist/components/SessionRecorderWidget/styles.js +0 -1
- package/dist/components/SessionRecorderWidget/styles.js.map +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/config/constants.js +0 -1
- package/dist/config/constants.js.map +0 -1
- package/dist/config/defaults.js +0 -1
- package/dist/config/defaults.js.map +0 -1
- package/dist/config/index.js +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/masking.d.ts +0 -2
- package/dist/config/masking.js +0 -1
- package/dist/config/masking.js.map +0 -1
- package/dist/config/session-recorder.d.ts +0 -2
- package/dist/config/session-recorder.js +0 -1
- package/dist/config/session-recorder.js.map +0 -1
- package/dist/config/validators.js +0 -1
- package/dist/config/validators.js.map +0 -1
- package/dist/config/widget.js +0 -1
- package/dist/config/widget.js.map +0 -1
- package/dist/context/SessionRecorderContext.js +0 -1
- package/dist/context/SessionRecorderContext.js.map +0 -1
- package/dist/context/SessionRecorderStore.js +0 -1
- package/dist/context/SessionRecorderStore.js.map +0 -1
- package/dist/context/useSessionRecorderStore.js +0 -1
- package/dist/context/useSessionRecorderStore.js.map +0 -1
- package/dist/context/useStoreSelector.js +0 -1
- package/dist/context/useStoreSelector.js.map +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +0 -1
- package/dist/native/GestureRecorderNative.d.ts +0 -57
- package/dist/native/GestureRecorderNative.js +0 -1
- package/dist/native/GestureRecorderNative.js.map +0 -1
- package/dist/native/GestureRecorderNativeTurboSpec.d.ts +0 -31
- package/dist/native/GestureRecorderNativeTurboSpec.js +0 -1
- package/dist/native/GestureRecorderNativeTurboSpec.js.map +0 -1
- package/dist/native/SessionRecorderNative.js +0 -1
- package/dist/native/SessionRecorderNative.js.map +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.d.ts +0 -17
- package/dist/native/SessionRecorderNativeTurboSpec.js +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.js.map +0 -1
- package/dist/native/index.d.ts +0 -1
- package/dist/native/index.js +0 -1
- package/dist/native/index.js.map +0 -1
- package/dist/otel/helpers.js +0 -1
- package/dist/otel/helpers.js.map +0 -1
- package/dist/otel/index.js +0 -1
- package/dist/otel/index.js.map +0 -1
- package/dist/otel/instrumentations/index.js +0 -1
- package/dist/otel/instrumentations/index.js.map +0 -1
- package/dist/patch/index.js +0 -1
- package/dist/patch/index.js.map +0 -1
- package/dist/patch/xhr.js +0 -1
- package/dist/patch/xhr.js.map +0 -1
- package/dist/recorder/eventExporter.js +0 -1
- package/dist/recorder/eventExporter.js.map +0 -1
- package/dist/recorder/gestureRecorder.js +0 -1
- package/dist/recorder/gestureRecorder.js.map +0 -1
- package/dist/recorder/index.js +0 -1
- package/dist/recorder/index.js.map +0 -1
- package/dist/recorder/navigationTracker.js +0 -1
- package/dist/recorder/navigationTracker.js.map +0 -1
- package/dist/recorder/screenRecorder.js +0 -1
- package/dist/recorder/screenRecorder.js.map +0 -1
- package/dist/services/api.service.js +0 -1
- package/dist/services/api.service.js.map +0 -1
- package/dist/services/network.service.js +0 -1
- package/dist/services/network.service.js.map +0 -1
- package/dist/services/screenMaskingService.js +0 -1
- package/dist/services/screenMaskingService.js.map +0 -1
- package/dist/services/storage.service.js +0 -1
- package/dist/services/storage.service.js.map +0 -1
- package/dist/session-recorder.js +0 -1
- package/dist/session-recorder.js.map +0 -1
- package/dist/types/configs.js +0 -1
- package/dist/types/configs.js.map +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/session-recorder.js +0 -1
- package/dist/types/session-recorder.js.map +0 -1
- package/dist/types/session.js +0 -1
- package/dist/types/session.js.map +0 -1
- package/dist/utils/app-metadata.js +0 -1
- package/dist/utils/app-metadata.js.map +0 -1
- package/dist/utils/constants.optional.expo.js +0 -1
- package/dist/utils/constants.optional.expo.js.map +0 -1
- package/dist/utils/constants.optional.js +0 -1
- package/dist/utils/constants.optional.js.map +0 -1
- package/dist/utils/createStore.js +0 -1
- package/dist/utils/createStore.js.map +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/platform.js +0 -1
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/request-utils.js +0 -1
- package/dist/utils/request-utils.js.map +0 -1
- package/dist/utils/rrweb-events.js +0 -1
- package/dist/utils/rrweb-events.js.map +0 -1
- package/dist/utils/session.js +0 -1
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/shallowEqual.js +0 -1
- package/dist/utils/shallowEqual.js.map +0 -1
- package/dist/utils/time.js +0 -1
- package/dist/utils/time.js.map +0 -1
- package/dist/utils/type-utils.js +0 -1
- package/dist/utils/type-utils.js.map +0 -1
- package/dist/version.js +0 -1
- package/dist/version.js.map +0 -1
- package/docs/AUTO_METADATA_DETECTION.md +0 -108
- package/react-native.config.js +0 -13
- /package/{dist/components/index.d.ts → src/components/index.ts} +0 -0
- /package/{dist/patch/index.d.ts → src/patch/index.ts} +0 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { isFormData, isNullish, isObject, isString } from "../utils/type-utils.js";
|
|
5
|
+
import { formDataToQuery } from "../utils/request-utils.js";
|
|
6
|
+
import { DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE } from "../config/index.js";
|
|
7
|
+
|
|
8
|
+
// Check if we're on web platform
|
|
9
|
+
const isWeb = Platform.OS === 'web';
|
|
10
|
+
let recordRequestHeaders = true;
|
|
11
|
+
let recordResponseHeaders = true;
|
|
12
|
+
let shouldRecordBody = true;
|
|
13
|
+
let maxCapturingHttpPayloadSize = DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE;
|
|
14
|
+
export const setMaxCapturingHttpPayloadSize = _maxCapturingHttpPayloadSize => {
|
|
15
|
+
maxCapturingHttpPayloadSize = _maxCapturingHttpPayloadSize;
|
|
16
|
+
};
|
|
17
|
+
export const setShouldRecordHttpData = (shouldRecordBody, shouldRecordHeaders) => {
|
|
18
|
+
recordRequestHeaders = shouldRecordHeaders;
|
|
19
|
+
recordResponseHeaders = shouldRecordHeaders;
|
|
20
|
+
shouldRecordBody = shouldRecordBody;
|
|
21
|
+
};
|
|
22
|
+
function _tryReadXHRBody({
|
|
23
|
+
body
|
|
24
|
+
}) {
|
|
25
|
+
if (isNullish(body)) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if (isString(body)) {
|
|
29
|
+
return body;
|
|
30
|
+
}
|
|
31
|
+
if (isFormData(body)) {
|
|
32
|
+
return formDataToQuery(body);
|
|
33
|
+
}
|
|
34
|
+
if (isObject(body)) {
|
|
35
|
+
try {
|
|
36
|
+
return JSON.stringify({
|
|
37
|
+
...body
|
|
38
|
+
});
|
|
39
|
+
} catch {
|
|
40
|
+
return '[XHR] Failed to stringify response object';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return `[XHR] Cannot read body of type ${Object.prototype.toString.call(body)}`;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Only patch XMLHttpRequest if not on web platform or if XMLHttpRequest is available
|
|
47
|
+
if (!isWeb && typeof XMLHttpRequest !== 'undefined') {
|
|
48
|
+
(function (xhr) {
|
|
49
|
+
const originalOpen = XMLHttpRequest.prototype.open;
|
|
50
|
+
xhr.open = function (method, url, async = true, username, password) {
|
|
51
|
+
const xhr = this;
|
|
52
|
+
const networkRequest = {};
|
|
53
|
+
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
const requestHeaders = {};
|
|
56
|
+
const originalSetRequestHeader = xhr.setRequestHeader.bind(xhr);
|
|
57
|
+
xhr.setRequestHeader = (header, value) => {
|
|
58
|
+
requestHeaders[header] = value;
|
|
59
|
+
return originalSetRequestHeader(header, value);
|
|
60
|
+
};
|
|
61
|
+
if (recordRequestHeaders) {
|
|
62
|
+
networkRequest.requestHeaders = requestHeaders;
|
|
63
|
+
}
|
|
64
|
+
const originalSend = xhr.send.bind(xhr);
|
|
65
|
+
xhr.send = body => {
|
|
66
|
+
if (shouldRecordBody) {
|
|
67
|
+
const requestBody = _tryReadXHRBody({
|
|
68
|
+
body,
|
|
69
|
+
url
|
|
70
|
+
});
|
|
71
|
+
if (requestBody?.length && requestBody.length <= maxCapturingHttpPayloadSize) {
|
|
72
|
+
networkRequest.requestBody = requestBody;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return originalSend(body);
|
|
76
|
+
};
|
|
77
|
+
xhr.addEventListener('readystatechange', () => {
|
|
78
|
+
if (xhr.readyState !== xhr.DONE) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
const responseHeaders = {};
|
|
84
|
+
const rawHeaders = xhr.getAllResponseHeaders() || '';
|
|
85
|
+
const headers = rawHeaders.trim().split(/[\r\n]+/).filter(Boolean);
|
|
86
|
+
headers.forEach(line => {
|
|
87
|
+
const parts = line.split(': ');
|
|
88
|
+
const header = parts.shift();
|
|
89
|
+
const value = parts.join(': ');
|
|
90
|
+
if (header) {
|
|
91
|
+
responseHeaders[header] = value;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
if (recordResponseHeaders) {
|
|
95
|
+
networkRequest.responseHeaders = responseHeaders;
|
|
96
|
+
}
|
|
97
|
+
if (shouldRecordBody) {
|
|
98
|
+
const responseBody = _tryReadXHRBody({
|
|
99
|
+
body: xhr.response,
|
|
100
|
+
url
|
|
101
|
+
});
|
|
102
|
+
if (responseBody?.length && responseBody.length <= maxCapturingHttpPayloadSize) {
|
|
103
|
+
networkRequest.responseBody = responseBody;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
xhr.networkRequest = networkRequest;
|
|
110
|
+
originalOpen.call(xhr, method, url, async, username, password);
|
|
111
|
+
};
|
|
112
|
+
})(XMLHttpRequest.prototype);
|
|
113
|
+
} else if (isWeb) {
|
|
114
|
+
console.info('XHR patch: Skipping XMLHttpRequest patching on web platform');
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=xhr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","isFormData","isNullish","isObject","isString","formDataToQuery","DEFAULT_MAX_HTTP_CAPTURING_PAYLOAD_SIZE","isWeb","OS","recordRequestHeaders","recordResponseHeaders","shouldRecordBody","maxCapturingHttpPayloadSize","setMaxCapturingHttpPayloadSize","_maxCapturingHttpPayloadSize","setShouldRecordHttpData","shouldRecordHeaders","_tryReadXHRBody","body","JSON","stringify","Object","prototype","toString","call","XMLHttpRequest","xhr","originalOpen","open","method","url","async","username","password","networkRequest","requestHeaders","originalSetRequestHeader","setRequestHeader","bind","header","value","originalSend","send","requestBody","length","addEventListener","readyState","DONE","responseHeaders","rawHeaders","getAllResponseHeaders","headers","trim","split","filter","Boolean","forEach","line","parts","shift","join","responseBody","response","console","info"],"sourceRoot":"../../../src","sources":["patch/xhr.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,UAAU,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,wBAAqB;AAC/E,SAASC,eAAe,QAAQ,2BAAwB;AACxD,SAASC,uCAAuC,QAAQ,oBAAW;;AAEnE;AACA,MAAMC,KAAK,GAAGP,QAAQ,CAACQ,EAAE,KAAK,KAAK;AAEnC,IAAIC,oBAAoB,GAAG,IAAI;AAC/B,IAAIC,qBAAqB,GAAG,IAAI;AAChC,IAAIC,gBAAgB,GAAG,IAAI;AAC3B,IAAIC,2BAA2B,GAAGN,uCAAuC;AAEzE,OAAO,MAAMO,8BAA8B,GACzCC,4BAAoC,IACjC;EACHF,2BAA2B,GAAGE,4BAA4B;AAC5D,CAAC;AAED,OAAO,MAAMC,uBAAuB,GAAGA,CACrCJ,gBAAyB,EACzBK,mBAA4B,KACzB;EACHP,oBAAoB,GAAGO,mBAAmB;EAC1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,qBAAqB,EAAE;UACzBwB,cAAc,CAACc,eAAe,GAAGA,eAAe;QAClD;QACA,IAAIrC,gBAAgB,EAAE;UACpB,MAAMkD,YAAY,GAAG5C,eAAe,CAAC;YAAEC,IAAI,EAAEQ,GAAG,CAACoC,QAAQ;YAAEhC;UAAI,CAAC,CAAC;UAEjE,IACE+B,YAAY,EAAEjB,MAAM,IACpBiB,YAAY,CAACjB,MAAM,IAAIhC,2BAA2B,EAClD;YACAsB,cAAc,CAAC2B,YAAY,GAAGA,YAAY;UAC5C;QACF;MACF,CAAC,CAAC;;MAEF;MACAnC,GAAG,CAACQ,cAAc,GAAGA,cAAc;MAEnCP,YAAY,CAACH,IAAI,CAACE,GAAG,EAAEG,MAAM,EAAEC,GAAG,EAAYC,KAAK,EAAEC,QAAQ,EAAEC,QAAQ,CAAC;IAC1E,CAAC;EACH,CAAC,EAAER,cAAc,CAACH,SAAS,CAAC;AAC9B,CAAC,MAAM,IAAIf,KAAK,EAAE;EAChBwD,OAAO,CAACC,IAAI,CAAC,6DAA6D,CAAC;AAC7E","ignoreList":[]}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import io from 'socket.io-client';
|
|
4
|
+
import { logger } from "../utils/index.js";
|
|
5
|
+
import { SESSION_ADD_EVENT, SESSION_AUTO_CREATED, SESSION_STOPPED_EVENT, SESSION_SUBSCRIBE_EVENT, SESSION_UNSUBSCRIBE_EVENT } from "../config/index.js";
|
|
6
|
+
const MAX_RECONNECTION_ATTEMPTS = 2;
|
|
7
|
+
export class EventExporter {
|
|
8
|
+
socket = null;
|
|
9
|
+
queue = [];
|
|
10
|
+
isConnecting = false;
|
|
11
|
+
isConnected = false;
|
|
12
|
+
attempts = 0;
|
|
13
|
+
sessionId = null;
|
|
14
|
+
constructor(options) {
|
|
15
|
+
this.socketUrl = options.socketUrl;
|
|
16
|
+
this.apiKey = options.apiKey;
|
|
17
|
+
}
|
|
18
|
+
init() {
|
|
19
|
+
if (this.isConnecting || this.isConnected) return;
|
|
20
|
+
this.attempts++;
|
|
21
|
+
this.isConnecting = true;
|
|
22
|
+
this.socket = io(this.socketUrl, {
|
|
23
|
+
path: '/v0/radar/ws',
|
|
24
|
+
auth: {
|
|
25
|
+
'x-api-key': this.apiKey
|
|
26
|
+
},
|
|
27
|
+
reconnectionAttempts: 2,
|
|
28
|
+
transports: ['websocket']
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// this.socket.on('connect', () => {
|
|
32
|
+
// this.isConnecting = false
|
|
33
|
+
// this.isConnected = true
|
|
34
|
+
// this.usePostMessage = false
|
|
35
|
+
// this.flushQueue()
|
|
36
|
+
// })
|
|
37
|
+
|
|
38
|
+
this.socket.on('ready', () => {
|
|
39
|
+
this.isConnecting = false;
|
|
40
|
+
this.isConnected = true;
|
|
41
|
+
logger.info('EventExporter', 'Connected to server');
|
|
42
|
+
this.flushQueue();
|
|
43
|
+
});
|
|
44
|
+
this.socket.on('disconnect', _err => {
|
|
45
|
+
this.isConnecting = false;
|
|
46
|
+
this.isConnected = false;
|
|
47
|
+
logger.info('EventExporter', 'Disconnected from server');
|
|
48
|
+
});
|
|
49
|
+
this.socket.on('connect_error', err => {
|
|
50
|
+
this.isConnecting = false;
|
|
51
|
+
this.isConnected = false;
|
|
52
|
+
this.checkReconnectionAttempts();
|
|
53
|
+
logger.error('EventExporter', 'Error connecting to server', err);
|
|
54
|
+
});
|
|
55
|
+
this.socket.on(SESSION_STOPPED_EVENT, _ => {
|
|
56
|
+
this.unsubscribeFromSession();
|
|
57
|
+
});
|
|
58
|
+
this.socket.on(SESSION_AUTO_CREATED, _ => {});
|
|
59
|
+
}
|
|
60
|
+
setApiKey(apiKey) {
|
|
61
|
+
this.apiKey = apiKey;
|
|
62
|
+
}
|
|
63
|
+
setSocketUrl(socketUrl) {
|
|
64
|
+
this.socketUrl = socketUrl;
|
|
65
|
+
}
|
|
66
|
+
checkReconnectionAttempts() {
|
|
67
|
+
if (this.attempts >= MAX_RECONNECTION_ATTEMPTS) {
|
|
68
|
+
this.flushQueue();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
flushQueue() {
|
|
72
|
+
while (this.queue.length > 0 && this.socket?.connected) {
|
|
73
|
+
const event = this.queue.shift();
|
|
74
|
+
if (!event) continue;
|
|
75
|
+
if (this.socket?.connected) {
|
|
76
|
+
this.socket.emit(event.name, event.data);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
unsubscribeFromSession() {
|
|
81
|
+
const payload = {
|
|
82
|
+
debugSessionId: this.sessionId
|
|
83
|
+
};
|
|
84
|
+
if (this.socket?.connected) {
|
|
85
|
+
this.socket.emit(SESSION_UNSUBSCRIBE_EVENT, payload);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
send(event) {
|
|
89
|
+
if (this.socket?.connected) {
|
|
90
|
+
this.socket.emit(SESSION_ADD_EVENT, event);
|
|
91
|
+
} else {
|
|
92
|
+
this.queue.push({
|
|
93
|
+
data: event,
|
|
94
|
+
name: SESSION_ADD_EVENT
|
|
95
|
+
});
|
|
96
|
+
this.init();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
subscribeToSession(session) {
|
|
100
|
+
this.sessionId = session.shortId || session._id;
|
|
101
|
+
const payload = {
|
|
102
|
+
projectId: session.project,
|
|
103
|
+
workspaceId: session.workspace,
|
|
104
|
+
debugSessionId: this.sessionId,
|
|
105
|
+
sessionType: session.creationType
|
|
106
|
+
};
|
|
107
|
+
if (this.socket?.connected) {
|
|
108
|
+
this.socket.emit(SESSION_SUBSCRIBE_EVENT, payload);
|
|
109
|
+
} else {
|
|
110
|
+
this.queue.push({
|
|
111
|
+
data: payload,
|
|
112
|
+
name: SESSION_SUBSCRIBE_EVENT
|
|
113
|
+
});
|
|
114
|
+
this.init();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
close() {
|
|
118
|
+
if (this.socket?.connected) {
|
|
119
|
+
setTimeout(() => {
|
|
120
|
+
this.unsubscribeFromSession();
|
|
121
|
+
this.attempts = 0;
|
|
122
|
+
this.isConnected = false;
|
|
123
|
+
this.isConnecting = false;
|
|
124
|
+
this.socket?.disconnect();
|
|
125
|
+
this.socket = null;
|
|
126
|
+
}, 500);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=eventExporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["io","logger","SESSION_ADD_EVENT","SESSION_AUTO_CREATED","SESSION_STOPPED_EVENT","SESSION_SUBSCRIBE_EVENT","SESSION_UNSUBSCRIBE_EVENT","MAX_RECONNECTION_ATTEMPTS","EventExporter","socket","queue","isConnecting","isConnected","attempts","sessionId","constructor","options","socketUrl","apiKey","init","path","auth","reconnectionAttempts","transports","on","info","flushQueue","_err","err","checkReconnectionAttempts","error","_","unsubscribeFromSession","setApiKey","setSocketUrl","length","connected","event","shift","emit","name","data","payload","debugSessionId","send","push","subscribeToSession","session","shortId","_id","projectId","project","workspaceId","workspace","sessionType","creationType","close","setTimeout","disconnect"],"sourceRoot":"../../../src","sources":["recorder/eventExporter.ts"],"mappings":";;AAAA,OAAOA,EAAE,MAAkB,kBAAkB;AAG7C,SAASC,MAAM,QAAQ,mBAAU;AAEjC,SACEC,iBAAiB,EACjBC,oBAAoB,EACpBC,qBAAqB,EACrBC,uBAAuB,EACvBC,yBAAyB,QACpB,oBAAW;AAElB,MAAMC,yBAAyB,GAAG,CAAC;AAEnC,OAAO,MAAMC,aAAa,CAAC;EACjBC,MAAM,GAAkB,IAAI;EAC5BC,KAAK,GAAU,EAAE;EACjBC,YAAY,GAAY,KAAK;EAC7BC,WAAW,GAAY,KAAK;EAC5BC,QAAQ,GAAW,CAAC;EACpBC,SAAS,GAAkB,IAAI;EAKvCC,WAAWA,CAACC,OAA8C,EAAE;IAC1D,IAAI,CAACC,SAAS,GAAGD,OAAO,CAACC,SAAS;IAClC,IA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