@nathanclaire/edge-telemetry-sdk 3.0.0 → 4.0.0
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/README.md +831 -186
- package/dist/appLifecycle-CECgRVu_.cjs +2 -0
- package/dist/appLifecycle-CECgRVu_.cjs.map +1 -0
- package/dist/appLifecycle-DQErzJIR.js +22 -0
- package/dist/appLifecycle-DQErzJIR.js.map +1 -0
- package/dist/batch-CwoO7noL.js +56 -0
- package/dist/batch-CwoO7noL.js.map +1 -0
- package/dist/batch-DNu8Xr9T.cjs +2 -0
- package/dist/batch-DNu8Xr9T.cjs.map +1 -0
- package/dist/crashCapture-BOJ8nSAZ.cjs +4 -0
- package/dist/crashCapture-BOJ8nSAZ.cjs.map +1 -0
- package/dist/crashCapture-BW8WuyaU.js +70 -0
- package/dist/crashCapture-BW8WuyaU.js.map +1 -0
- package/dist/crashHandler.web-8F_k2veo.js +29 -0
- package/dist/crashHandler.web-8F_k2veo.js.map +1 -0
- package/dist/crashHandler.web-CWmF56mJ.cjs +2 -0
- package/dist/crashHandler.web-CWmF56mJ.cjs.map +1 -0
- package/dist/crashHandlerNative.native-C2kSikDt.cjs +2 -0
- package/dist/crashHandlerNative.native-C2kSikDt.cjs.map +1 -0
- package/dist/crashHandlerNative.native-FupMnr1U.js +39 -0
- package/dist/crashHandlerNative.native-FupMnr1U.js.map +1 -0
- package/dist/deviceInfo.native-BJ-3Jj1T.js +53 -0
- package/dist/deviceInfo.native-BJ-3Jj1T.js.map +1 -0
- package/dist/deviceInfo.native-BoeTZcD6.cjs +2 -0
- package/dist/deviceInfo.native-BoeTZcD6.cjs.map +1 -0
- package/dist/deviceInfo.web-3L3IDQQA.cjs +2 -0
- package/dist/deviceInfo.web-3L3IDQQA.cjs.map +1 -0
- package/dist/deviceInfo.web-BFB1-pcA.js +41 -0
- package/dist/deviceInfo.web-BFB1-pcA.js.map +1 -0
- package/dist/frameTracker-CHG6sIx9.cjs +2 -0
- package/dist/frameTracker-CHG6sIx9.cjs.map +1 -0
- package/dist/frameTracker-DdB8W_kC.js +54 -0
- package/dist/frameTracker-DdB8W_kC.js.map +1 -0
- package/dist/httpAttributes-BrrtM8zh.js +70 -0
- package/dist/httpAttributes-BrrtM8zh.js.map +1 -0
- package/dist/httpAttributes-D0m6UID7.cjs +2 -0
- package/dist/httpAttributes-D0m6UID7.cjs.map +1 -0
- package/dist/index-BtLlV1HA.js +57 -0
- package/dist/index-BtLlV1HA.js.map +1 -0
- package/dist/{deviceInfo.native-D2k0LDhI.js → index-C2XQ-EYw.js} +362 -411
- package/dist/index-C2XQ-EYw.js.map +1 -0
- package/dist/index-CXsVZY35.cjs +2 -0
- package/dist/index-CXsVZY35.cjs.map +1 -0
- package/dist/index-DLquF88M.cjs +2 -0
- package/dist/index-DLquF88M.cjs.map +1 -0
- package/dist/index.native.cjs +1 -1
- package/dist/index.native.cjs.map +1 -1
- package/dist/index.native.js +94 -59
- package/dist/index.native.js.map +1 -1
- package/dist/index.web.cjs +1 -1
- package/dist/index.web.cjs.map +1 -1
- package/dist/index.web.js +88 -33
- package/dist/index.web.js.map +1 -1
- package/dist/interactionWeb.web-Bl_cZlgh.cjs +2 -0
- package/dist/interactionWeb.web-Bl_cZlgh.cjs.map +1 -0
- package/dist/interactionWeb.web-CJAviVQ7.js +109 -0
- package/dist/interactionWeb.web-CJAviVQ7.js.map +1 -0
- package/dist/interceptFetchWeb.web-T88kO-bE.cjs +2 -0
- package/dist/interceptFetchWeb.web-T88kO-bE.cjs.map +1 -0
- package/dist/interceptFetchWeb.web-UXC2Lb6X.js +61 -0
- package/dist/interceptFetchWeb.web-UXC2Lb6X.js.map +1 -0
- package/dist/interceptHttpNative.native-BVpFuoNB.cjs +2 -0
- package/dist/interceptHttpNative.native-BVpFuoNB.cjs.map +1 -0
- package/dist/interceptHttpNative.native-rX-lPNST.js +18 -0
- package/dist/interceptHttpNative.native-rX-lPNST.js.map +1 -0
- package/dist/loadingTime-Bhomd9qq.cjs +2 -0
- package/dist/loadingTime-Bhomd9qq.cjs.map +1 -0
- package/dist/loadingTime-ZkYvFijA.js +70 -0
- package/dist/loadingTime-ZkYvFijA.js.map +1 -0
- package/dist/memoryNative.native-C42h9SjK.js +54 -0
- package/dist/memoryNative.native-C42h9SjK.js.map +1 -0
- package/dist/memoryNative.native-CA-7w9w1.cjs +2 -0
- package/dist/memoryNative.native-CA-7w9w1.cjs.map +1 -0
- package/dist/memoryStore-BIGZmmfD.cjs +2 -0
- package/dist/memoryStore-BIGZmmfD.cjs.map +1 -0
- package/dist/memoryStore-F5I-GQKM.js +193 -0
- package/dist/memoryStore-F5I-GQKM.js.map +1 -0
- package/dist/nativeSender-CfQaRuDK.cjs +2 -0
- package/dist/nativeSender-CfQaRuDK.cjs.map +1 -0
- package/dist/nativeSender-pgVSIv-X.js +59 -0
- package/dist/nativeSender-pgVSIv-X.js.map +1 -0
- package/dist/navigationRef-BzYbs8cm.js +28 -0
- package/dist/navigationRef-BzYbs8cm.js.map +1 -0
- package/dist/navigationRef-C-_qhb43.cjs +2 -0
- package/dist/navigationRef-C-_qhb43.cjs.map +1 -0
- package/dist/{navigationTracker-Cts68dgG.js → navigationTracker-BmywA_Bg.js} +4 -4
- package/dist/navigationTracker-BmywA_Bg.js.map +1 -0
- package/dist/navigationTracker-HkwVyywz.cjs +2 -0
- package/dist/navigationTracker-HkwVyywz.cjs.map +1 -0
- package/dist/navigationWeb.web-CW_z7Ca4.cjs +2 -0
- package/dist/navigationWeb.web-CW_z7Ca4.cjs.map +1 -0
- package/dist/navigationWeb.web-CcwgKuIZ.js +55 -0
- package/dist/navigationWeb.web-CcwgKuIZ.js.map +1 -0
- package/dist/{networkInfo.native-BK5fpAOL.js → networkInfo.native-CGrx9cnH.js} +15 -15
- package/dist/{networkInfo.native-BK5fpAOL.js.map → networkInfo.native-CGrx9cnH.js.map} +1 -1
- package/dist/{networkInfo.native-cxuw93Uy.cjs → networkInfo.native-YVySdv3S.cjs} +2 -2
- package/dist/{networkInfo.native-cxuw93Uy.cjs.map → networkInfo.native-YVySdv3S.cjs.map} +1 -1
- package/dist/{networkInfo.web-twcNn_hc.js → networkInfo.web-B2YlLNsI.js} +3 -3
- package/dist/networkInfo.web-B2YlLNsI.js.map +1 -0
- package/dist/networkInfo.web-PltJTHsy.cjs +2 -0
- package/dist/networkInfo.web-PltJTHsy.cjs.map +1 -0
- package/dist/runtimeReady.native-Bh7EcYmK.js +14 -0
- package/dist/runtimeReady.native-Bh7EcYmK.js.map +1 -0
- package/dist/runtimeReady.native-jUmuE1lV.cjs +2 -0
- package/dist/runtimeReady.native-jUmuE1lV.cjs.map +1 -0
- package/dist/runtimeReady.web-C8fdIbVR.js +25 -0
- package/dist/runtimeReady.web-C8fdIbVR.js.map +1 -0
- package/dist/runtimeReady.web-DHW682RN.cjs +2 -0
- package/dist/runtimeReady.web-DHW682RN.cjs.map +1 -0
- package/dist/seedRuntimeReady-BKwkBEAF.cjs +2 -0
- package/dist/seedRuntimeReady-BKwkBEAF.cjs.map +1 -0
- package/dist/seedRuntimeReady-Cz8nOKoo.js +10 -0
- package/dist/seedRuntimeReady-Cz8nOKoo.js.map +1 -0
- package/dist/src/adapters/appLifecycle.d.ts +8 -1
- package/dist/src/adapters/batch.d.ts +2 -0
- package/dist/src/adapters/crashCapture.d.ts +38 -9
- package/dist/src/adapters/failedEvents.d.ts +43 -0
- package/dist/src/adapters/frameAggregate.d.ts +8 -3
- package/dist/src/adapters/frameTracker.d.ts +30 -0
- package/dist/src/adapters/httpAttributes.d.ts +18 -0
- package/dist/src/adapters/loadingTime.d.ts +67 -0
- package/dist/src/adapters/native/interceptHttpNative.native.d.ts +18 -0
- package/dist/src/adapters/native/memoryNative.native.d.ts +15 -11
- package/dist/src/adapters/native/runtimeReady.native.d.ts +1 -0
- package/dist/src/adapters/native/store.native.d.ts +10 -0
- package/dist/src/adapters/nativeSender.d.ts +2 -2
- package/dist/src/adapters/navigationRef.d.ts +21 -0
- package/dist/src/adapters/navigationTracker.d.ts +1 -1
- package/dist/src/adapters/screenTiming.d.ts +8 -2
- package/dist/src/adapters/seedRuntimeReady.d.ts +8 -0
- package/dist/src/adapters/traceHeader.d.ts +33 -0
- package/dist/src/adapters/traceManager.d.ts +131 -0
- package/dist/src/adapters/uiInteraction.d.ts +111 -0
- package/dist/src/adapters/viewManager.d.ts +161 -0
- package/dist/src/adapters/viewport.d.ts +15 -0
- package/dist/src/adapters/web/interactionWeb.web.d.ts +36 -0
- package/dist/src/adapters/web/interceptFetchWeb.web.d.ts +3 -11
- package/dist/src/adapters/web/navigationWeb.web.d.ts +10 -0
- package/dist/src/adapters/web/runtimeReady.web.d.ts +5 -0
- package/dist/src/adapters/web/store.web.d.ts +12 -0
- package/dist/src/adapters/web/webVitals.web.d.ts +49 -0
- package/dist/src/adapters/webSender.d.ts +2 -2
- package/dist/src/adapters/webVitals.d.ts +25 -0
- package/dist/src/adapters/xhrIntercept.d.ts +53 -0
- package/dist/src/core/beforeSend.d.ts +20 -0
- package/dist/src/core/debug.d.ts +7 -0
- package/dist/src/core/memoryStore.d.ts +23 -0
- package/dist/src/core/store.d.ts +41 -0
- package/dist/src/core/telemetry.d.ts +305 -35
- package/dist/src/core/userProfile.d.ts +12 -0
- package/dist/src/core/utils/json.d.ts +7 -0
- package/dist/src/core/utils/uuid.d.ts +10 -1
- package/dist/src/createTelemetry.native.d.ts +7 -0
- package/dist/src/createTelemetry.web.d.ts +7 -0
- package/dist/src/index.base.d.ts +17 -1
- package/dist/src/index.native.d.ts +46 -9
- package/dist/src/index.web.d.ts +33 -2
- package/dist/store.native-BYBJcy6o.js +32 -0
- package/dist/store.native-BYBJcy6o.js.map +1 -0
- package/dist/store.native-TPqXngmF.cjs +2 -0
- package/dist/store.native-TPqXngmF.cjs.map +1 -0
- package/dist/store.web-CvqqN-_Z.cjs +2 -0
- package/dist/store.web-CvqqN-_Z.cjs.map +1 -0
- package/dist/store.web-DJAlN0nc.js +31 -0
- package/dist/store.web-DJAlN0nc.js.map +1 -0
- package/dist/telemetry-ByDJIz_9.js +1280 -0
- package/dist/telemetry-ByDJIz_9.js.map +1 -0
- package/dist/telemetry-CrU7i1Jc.cjs +2 -0
- package/dist/telemetry-CrU7i1Jc.cjs.map +1 -0
- package/dist/uiInteraction-CdzvEI1p.cjs +2 -0
- package/dist/uiInteraction-CdzvEI1p.cjs.map +1 -0
- package/dist/uiInteraction-DAqxxz0q.js +104 -0
- package/dist/uiInteraction-DAqxxz0q.js.map +1 -0
- package/dist/viewport-Dd85GUNO.cjs +2 -0
- package/dist/viewport-Dd85GUNO.cjs.map +1 -0
- package/dist/viewport-Dzmt5QwK.js +15 -0
- package/dist/viewport-Dzmt5QwK.js.map +1 -0
- package/dist/web-vitals.attribution-CVCPiX-h.cjs +2 -0
- package/dist/web-vitals.attribution-CVCPiX-h.cjs.map +1 -0
- package/dist/web-vitals.attribution-xw9N5MKQ.js +488 -0
- package/dist/web-vitals.attribution-xw9N5MKQ.js.map +1 -0
- package/dist/webSender-BIwslfpT.js +63 -0
- package/dist/webSender-BIwslfpT.js.map +1 -0
- package/dist/webSender-CVtE4sOF.cjs +2 -0
- package/dist/webSender-CVtE4sOF.cjs.map +1 -0
- package/dist/webVitals.web-CNIpsKlA.js +85 -0
- package/dist/webVitals.web-CNIpsKlA.js.map +1 -0
- package/dist/webVitals.web-DpWJ-iYp.cjs +2 -0
- package/dist/webVitals.web-DpWJ-iYp.cjs.map +1 -0
- package/dist/xhrIntercept-BADex6Cq.cjs +2 -0
- package/dist/xhrIntercept-BADex6Cq.cjs.map +1 -0
- package/dist/xhrIntercept-BNiA41Mj.js +53 -0
- package/dist/xhrIntercept-BNiA41Mj.js.map +1 -0
- package/docs/migration-v4.md +190 -0
- package/package.json +12 -4
- package/dist/appLifecycle-Cynw0kAv.js +0 -14
- package/dist/appLifecycle-Cynw0kAv.js.map +0 -1
- package/dist/appLifecycle-DvJIt7ym.cjs +0 -2
- package/dist/appLifecycle-DvJIt7ym.cjs.map +0 -1
- package/dist/batch-CLBFgYPC.cjs +0 -2
- package/dist/batch-CLBFgYPC.cjs.map +0 -1
- package/dist/batch-DLG_gtOm.js +0 -12
- package/dist/batch-DLG_gtOm.js.map +0 -1
- package/dist/crashCapture-BYTM4FLC.cjs +0 -2
- package/dist/crashCapture-BYTM4FLC.cjs.map +0 -1
- package/dist/crashCapture-D_rkkBVa.js +0 -31
- package/dist/crashCapture-D_rkkBVa.js.map +0 -1
- package/dist/crashHandler.web-BSxDpFTo.cjs +0 -2
- package/dist/crashHandler.web-BSxDpFTo.cjs.map +0 -1
- package/dist/crashHandler.web-D59bmhg9.js +0 -32
- package/dist/crashHandler.web-D59bmhg9.js.map +0 -1
- package/dist/crashHandlerNative.native-DeAFze4E.cjs +0 -2
- package/dist/crashHandlerNative.native-DeAFze4E.cjs.map +0 -1
- package/dist/crashHandlerNative.native-d7qJkzA6.js +0 -41
- package/dist/crashHandlerNative.native-d7qJkzA6.js.map +0 -1
- package/dist/debug-DsvQ9y3W.js +0 -68
- package/dist/debug-DsvQ9y3W.js.map +0 -1
- package/dist/debug-rnOOxFpN.cjs +0 -2
- package/dist/debug-rnOOxFpN.cjs.map +0 -1
- package/dist/deviceInfo.native-7hbRYixR.cjs +0 -2
- package/dist/deviceInfo.native-7hbRYixR.cjs.map +0 -1
- package/dist/deviceInfo.native-D2k0LDhI.js.map +0 -1
- package/dist/deviceInfo.web-ByNAlEJh.cjs +0 -2
- package/dist/deviceInfo.web-ByNAlEJh.cjs.map +0 -1
- package/dist/deviceInfo.web-DzQyEku6.js +0 -40
- package/dist/deviceInfo.web-DzQyEku6.js.map +0 -1
- package/dist/frameAggregate-C_HoVFcK.cjs +0 -2
- package/dist/frameAggregate-C_HoVFcK.cjs.map +0 -1
- package/dist/frameAggregate-Cwh1juw1.js +0 -17
- package/dist/frameAggregate-Cwh1juw1.js.map +0 -1
- package/dist/frameDropsNative.native-CP7zrXDf.js +0 -23
- package/dist/frameDropsNative.native-CP7zrXDf.js.map +0 -1
- package/dist/frameDropsNative.native-DKqEDqip.cjs +0 -2
- package/dist/frameDropsNative.native-DKqEDqip.cjs.map +0 -1
- package/dist/frameDropsWeb.web-C9Lt3Fuj.js +0 -22
- package/dist/frameDropsWeb.web-C9Lt3Fuj.js.map +0 -1
- package/dist/frameDropsWeb.web-azpwQCUz.cjs +0 -2
- package/dist/frameDropsWeb.web-azpwQCUz.cjs.map +0 -1
- package/dist/httpAttributes-BV50UKQU.js +0 -19
- package/dist/httpAttributes-BV50UKQU.js.map +0 -1
- package/dist/httpAttributes-xXOD9trQ.cjs +0 -2
- package/dist/httpAttributes-xXOD9trQ.cjs.map +0 -1
- package/dist/interaction-CH8yoY5-.js +0 -23
- package/dist/interaction-CH8yoY5-.js.map +0 -1
- package/dist/interaction-DcNFBW7a.cjs +0 -2
- package/dist/interaction-DcNFBW7a.cjs.map +0 -1
- package/dist/interceptFetchNative.native-VlhtMG-U.js +0 -49
- package/dist/interceptFetchNative.native-VlhtMG-U.js.map +0 -1
- package/dist/interceptFetchNative.native-jEAldH14.cjs +0 -2
- package/dist/interceptFetchNative.native-jEAldH14.cjs.map +0 -1
- package/dist/interceptFetchWeb.web-DFzZliik.cjs +0 -2
- package/dist/interceptFetchWeb.web-DFzZliik.cjs.map +0 -1
- package/dist/interceptFetchWeb.web-DfsMfoRP.js +0 -77
- package/dist/interceptFetchWeb.web-DfsMfoRP.js.map +0 -1
- package/dist/memoryNative.native-BWLh2S9L.js +0 -48
- package/dist/memoryNative.native-BWLh2S9L.js.map +0 -1
- package/dist/memoryNative.native-DCXSOd4Q.cjs +0 -2
- package/dist/memoryNative.native-DCXSOd4Q.cjs.map +0 -1
- package/dist/memoryWeb.web-B3YuV-cB.js +0 -48
- package/dist/memoryWeb.web-B3YuV-cB.js.map +0 -1
- package/dist/memoryWeb.web-CheXAcJn.cjs +0 -2
- package/dist/memoryWeb.web-CheXAcJn.cjs.map +0 -1
- package/dist/nativeSender-BE_mzw_S.js +0 -70
- package/dist/nativeSender-BE_mzw_S.js.map +0 -1
- package/dist/nativeSender-DyAUGY7c.cjs +0 -2
- package/dist/nativeSender-DyAUGY7c.cjs.map +0 -1
- package/dist/navigationNative.native-3tO5JxSd.cjs +0 -2
- package/dist/navigationNative.native-3tO5JxSd.cjs.map +0 -1
- package/dist/navigationNative.native-BUCGPQX2.js +0 -25
- package/dist/navigationNative.native-BUCGPQX2.js.map +0 -1
- package/dist/navigationTracker-B2GMwyKk.cjs +0 -2
- package/dist/navigationTracker-B2GMwyKk.cjs.map +0 -1
- package/dist/navigationTracker-Cts68dgG.js.map +0 -1
- package/dist/navigationWeb.web-B0necr5j.cjs +0 -2
- package/dist/navigationWeb.web-B0necr5j.cjs.map +0 -1
- package/dist/navigationWeb.web-CORzE_Id.js +0 -46
- package/dist/navigationWeb.web-CORzE_Id.js.map +0 -1
- package/dist/networkInfo.web-DJmw1sNK.cjs +0 -2
- package/dist/networkInfo.web-DJmw1sNK.cjs.map +0 -1
- package/dist/networkInfo.web-twcNn_hc.js.map +0 -1
- package/dist/src/adapters/interaction.d.ts +0 -17
- package/dist/src/adapters/native/frameDropsNative.native.d.ts +0 -16
- package/dist/src/adapters/native/interceptFetchNative.native.d.ts +0 -23
- package/dist/src/adapters/native/navigationNative.native.d.ts +0 -12
- package/dist/src/adapters/web/frameDropsWeb.web.d.ts +0 -16
- package/dist/src/adapters/web/memoryWeb.web.d.ts +0 -26
- package/dist/telemetry-Co4MYdwa.cjs +0 -2
- package/dist/telemetry-Co4MYdwa.cjs.map +0 -1
- package/dist/telemetry-KI0x4gzC.js +0 -389
- package/dist/telemetry-KI0x4gzC.js.map +0 -1
- package/dist/v4-BysszJq8.js +0 -31
- package/dist/v4-BysszJq8.js.map +0 -1
- package/dist/v4-CqdK_b8Y.cjs +0 -2
- package/dist/v4-CqdK_b8Y.cjs.map +0 -1
- package/dist/webSender-B27tmT1w.js +0 -42
- package/dist/webSender-B27tmT1w.js.map +0 -1
- package/dist/webSender-BWi4x1df.cjs +0 -2
- package/dist/webSender-BWi4x1df.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"networkInfo.native-cxuw93Uy.cjs","sources":["../node_modules/@react-native-community/netinfo/lib/module/internal/defaultConfiguration.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/privateTypes.js","../node_modules/@react-native-community/netinfo/lib/module/internal/types.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeModule.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeInterface.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/internetReachability.js","../node_modules/@react-native-community/netinfo/lib/module/internal/state.js","../node_modules/@react-native-community/netinfo/lib/module/index.js","../src/adapters/native/networkInfo.native.ts"],"sourcesContent":["const DEFAULT_CONFIGURATION = {\n reachabilityUrl: '/',\n reachabilityMethod: \"HEAD\",\n reachabilityHeaders: {},\n reachabilityTest: response => Promise.resolve(response.status === 200),\n reachabilityShortTimeout: 5 * 1000,\n // 5s\n reachabilityLongTimeout: 60 * 1000,\n // 60s\n reachabilityRequestTimeout: 15 * 1000,\n // 15s\n reachabilityShouldRun: () => true,\n shouldFetchWiFiSSID: true,\n useNativeReachability: true\n};\nexport default DEFAULT_CONFIGURATION;\n//# sourceMappingURL=defaultConfiguration.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport const DEVICE_CONNECTIVITY_EVENT = 'netInfo.networkStatusDidChange'; // Certain properties are optional when sent by the native module and are handled by the JS code\n//# sourceMappingURL=privateTypes.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport let NetInfoStateType;\n\n(function (NetInfoStateType) {\n NetInfoStateType[\"unknown\"] = \"unknown\";\n NetInfoStateType[\"none\"] = \"none\";\n NetInfoStateType[\"cellular\"] = \"cellular\";\n NetInfoStateType[\"wifi\"] = \"wifi\";\n NetInfoStateType[\"bluetooth\"] = \"bluetooth\";\n NetInfoStateType[\"ethernet\"] = \"ethernet\";\n NetInfoStateType[\"wimax\"] = \"wimax\";\n NetInfoStateType[\"vpn\"] = \"vpn\";\n NetInfoStateType[\"other\"] = \"other\";\n})(NetInfoStateType || (NetInfoStateType = {}));\n\nexport let NetInfoCellularGeneration;\n\n(function (NetInfoCellularGeneration) {\n NetInfoCellularGeneration[\"2g\"] = \"2g\";\n NetInfoCellularGeneration[\"3g\"] = \"3g\";\n NetInfoCellularGeneration[\"4g\"] = \"4g\";\n NetInfoCellularGeneration[\"5g\"] = \"5g\";\n})(NetInfoCellularGeneration || (NetInfoCellularGeneration = {}));\n//# sourceMappingURL=types.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nimport { NetInfoCellularGeneration, NetInfoStateType } from './types'; // See https://wicg.github.io/netinfo/#dom-connectiontype\n\n// Use a constant test of this form because in SSR on next.js, optional chaining is not sufficient,\n// but this test correctly detects that window is not available and allows for conditionals before access\nconst isWindowPresent = typeof window !== 'undefined'; // Check if window exists and if the browser supports the connection API\n\nconst connection = isWindowPresent && !window.hasOwnProperty('tizen') && !window.hasOwnProperty('webOS') ? window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection : undefined; // Map browser types to native types\n\nconst typeMapping = {\n bluetooth: NetInfoStateType.bluetooth,\n cellular: NetInfoStateType.cellular,\n ethernet: NetInfoStateType.ethernet,\n none: NetInfoStateType.none,\n other: NetInfoStateType.other,\n unknown: NetInfoStateType.unknown,\n wifi: NetInfoStateType.wifi,\n wimax: NetInfoStateType.wimax,\n mixed: NetInfoStateType.other\n};\nconst effectiveTypeMapping = {\n '2g': NetInfoCellularGeneration['2g'],\n '3g': NetInfoCellularGeneration['3g'],\n '4g': NetInfoCellularGeneration['4g'],\n 'slow-2g': NetInfoCellularGeneration['2g']\n}; // Determine current state of connection\n\nconst getCurrentState = _requestedInterface => {\n const isConnected = isWindowPresent ? navigator.onLine : false;\n const baseState = {\n isInternetReachable: null\n }; // If we don't have a connection object, we return minimal information\n\n if (!connection) {\n if (isConnected) {\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive: false\n }\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type: NetInfoStateType.none,\n details: null\n };\n return state;\n } // Otherwise try to return detailed information\n\n\n const isConnectionExpensive = connection.saveData;\n const type = connection.type ? typeMapping[connection.type] : isConnected ? NetInfoStateType.other : NetInfoStateType.unknown;\n\n if (type === NetInfoStateType.bluetooth) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.cellular) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n cellularGeneration: effectiveTypeMapping[connection.effectiveType] || null,\n carrier: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.ethernet) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ipAddress: null,\n subnet: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wifi) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ssid: null,\n bssid: null,\n strength: null,\n ipAddress: null,\n subnet: null,\n frequency: null,\n linkSpeed: null,\n rxLinkSpeed: null,\n txLinkSpeed: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wimax) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.none) {\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type,\n details: null\n };\n return state;\n } else if (type === NetInfoStateType.unknown) {\n const state = { ...baseState,\n isConnected,\n isInternetReachable: null,\n type,\n details: null\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n};\n\nconst handlers = [];\nconst nativeHandlers = [];\nconst RNCNetInfo = {\n addListener(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n const nativeHandler = () => {\n handler(getCurrentState());\n };\n\n if (connection) {\n connection.addEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.addEventListener('online', nativeHandler, false);\n window.addEventListener('offline', nativeHandler, false);\n }\n } // Remember handlers\n\n\n handlers.push(handler);\n nativeHandlers.push(nativeHandler);\n break;\n }\n }\n },\n\n removeListeners(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n // Get native handler\n const index = handlers.indexOf(handler);\n const nativeHandler = nativeHandlers[index];\n\n if (connection) {\n connection.removeEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.removeEventListener('online', nativeHandler);\n window.removeEventListener('offline', nativeHandler);\n }\n } // Remove handlers\n\n\n handlers.splice(index, 1);\n nativeHandlers.splice(index, 1);\n break;\n }\n }\n },\n\n async getCurrentState(requestedInterface) {\n return getCurrentState(requestedInterface);\n },\n\n configure() {\n return;\n }\n\n};\nexport default RNCNetInfo;\n//# sourceMappingURL=nativeModule.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { NativeEventEmitter } from 'react-native';\nimport RNCNetInfo from './nativeModule';\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nconst nativeEventEmitter = new NativeEventEmitter(); // Listen to connectivity events\n\nRNCNetInfo.addListener(DEVICE_CONNECTIVITY_EVENT, event => {\n nativeEventEmitter.emit(DEVICE_CONNECTIVITY_EVENT, event);\n});\nexport default { ...RNCNetInfo,\n eventEmitter: nativeEventEmitter\n};\n//# sourceMappingURL=nativeInterface.web.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport default class InternetReachability {\n constructor(configuration, listener) {\n _defineProperty(this, \"_configuration\", void 0);\n\n _defineProperty(this, \"_listener\", void 0);\n\n _defineProperty(this, \"_isInternetReachable\", undefined);\n\n _defineProperty(this, \"_currentInternetReachabilityCheckHandler\", null);\n\n _defineProperty(this, \"_currentTimeoutHandle\", null);\n\n _defineProperty(this, \"_setIsInternetReachable\", isInternetReachable => {\n if (this._isInternetReachable === isInternetReachable) {\n return;\n }\n\n this._isInternetReachable = isInternetReachable;\n\n this._listener(this._isInternetReachable);\n });\n\n _defineProperty(this, \"_setExpectsConnection\", expectsConnection => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n\n if (expectsConnection && this._configuration.reachabilityShouldRun()) {\n // If we expect a connection, start the process for finding if we have one\n // Set the state to \"null\" if it was previously false\n if (!this._isInternetReachable) {\n this._setIsInternetReachable(null);\n } // Start a network request to check for internet\n\n\n this._currentInternetReachabilityCheckHandler = this._checkInternetReachability();\n } else {\n // If we don't expect a connection or don't run reachability check, just change the state to \"false\"\n this._setIsInternetReachable(false);\n }\n });\n\n _defineProperty(this, \"_checkInternetReachability\", () => {\n const controller = new AbortController();\n const responsePromise = fetch(this._configuration.reachabilityUrl, {\n headers: this._configuration.reachabilityHeaders,\n method: this._configuration.reachabilityMethod,\n cache: 'no-cache',\n signal: controller.signal\n }); // Create promise that will reject after the request timeout has been reached\n\n let timeoutHandle;\n const timeoutPromise = new Promise((_, reject) => {\n timeoutHandle = setTimeout(() => reject('timedout'), this._configuration.reachabilityRequestTimeout);\n }); // Create promise that makes it possible to cancel a pending request through a reject\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n\n let cancel = () => {};\n\n const cancelPromise = new Promise((_, reject) => {\n cancel = () => reject('canceled');\n });\n const promise = Promise.race([responsePromise, timeoutPromise, cancelPromise]).then(response => {\n return this._configuration.reachabilityTest(response);\n }).then(result => {\n this._setIsInternetReachable(result);\n\n const nextTimeoutInterval = this._isInternetReachable ? this._configuration.reachabilityLongTimeout : this._configuration.reachabilityShortTimeout;\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, nextTimeoutInterval);\n }).catch(error => {\n if ('canceled' === error) {\n controller.abort();\n } else {\n if ('timedout' === error) {\n controller.abort();\n }\n\n this._setIsInternetReachable(false);\n\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, this._configuration.reachabilityShortTimeout);\n }\n }) // Clear request timeout and propagate any errors\n .then(() => {\n clearTimeout(timeoutHandle);\n }, error => {\n clearTimeout(timeoutHandle);\n throw error;\n });\n return {\n promise,\n cancel\n };\n });\n\n _defineProperty(this, \"update\", state => {\n if (typeof state.isInternetReachable === 'boolean' && this._configuration.useNativeReachability) {\n this._setIsInternetReachable(state.isInternetReachable);\n } else {\n this._setExpectsConnection(state.isConnected);\n }\n });\n\n _defineProperty(this, \"currentState\", () => {\n return this._isInternetReachable;\n });\n\n _defineProperty(this, \"tearDown\", () => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n });\n\n this._configuration = configuration;\n this._listener = listener;\n }\n\n}\n//# sourceMappingURL=internetReachability.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport NativeInterface from './nativeInterface';\nimport InternetReachability from './internetReachability';\nimport * as PrivateTypes from './privateTypes';\nexport default class State {\n constructor(configuration) {\n _defineProperty(this, \"_nativeEventSubscription\", null);\n\n _defineProperty(this, \"_subscriptions\", new Set());\n\n _defineProperty(this, \"_latestState\", null);\n\n _defineProperty(this, \"_internetReachability\", void 0);\n\n _defineProperty(this, \"_handleNativeStateUpdate\", state => {\n // Update the internet reachability module\n this._internetReachability.update(state); // Convert the state from native to JS shape\n\n\n const convertedState = this._convertState(state); // Update the listeners\n\n\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n });\n\n _defineProperty(this, \"_handleInternetReachabilityUpdate\", isInternetReachable => {\n if (!this._latestState) {\n return;\n }\n\n const nextState = { ...this._latestState,\n isInternetReachable\n };\n this._latestState = nextState;\n\n this._subscriptions.forEach(handler => handler(nextState));\n });\n\n _defineProperty(this, \"_fetchCurrentState\", async requestedInterface => {\n const state = await NativeInterface.getCurrentState(requestedInterface); // Update the internet reachability module\n\n this._internetReachability.update(state); // Convert and store the new state\n\n\n const convertedState = this._convertState(state);\n\n if (!requestedInterface) {\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n }\n\n return convertedState;\n });\n\n _defineProperty(this, \"_convertState\", input => {\n if (typeof input.isInternetReachable === 'boolean') {\n return input;\n } else {\n return { ...input,\n isInternetReachable: this._internetReachability.currentState()\n };\n }\n });\n\n _defineProperty(this, \"latest\", requestedInterface => {\n if (requestedInterface) {\n return this._fetchCurrentState(requestedInterface);\n } else if (this._latestState) {\n return Promise.resolve(this._latestState);\n } else {\n return this._fetchCurrentState();\n }\n });\n\n _defineProperty(this, \"add\", handler => {\n // Add the subscription handler to our set\n this._subscriptions.add(handler); // Send it the latest data we have\n\n\n if (this._latestState) {\n handler(this._latestState);\n } else {\n this.latest().then(handler);\n }\n });\n\n _defineProperty(this, \"remove\", handler => {\n this._subscriptions.delete(handler);\n });\n\n _defineProperty(this, \"tearDown\", () => {\n if (this._internetReachability) {\n this._internetReachability.tearDown();\n }\n\n if (this._nativeEventSubscription) {\n this._nativeEventSubscription.remove();\n }\n\n this._subscriptions.clear();\n });\n\n // Add the listener to the internet connectivity events\n this._internetReachability = new InternetReachability(configuration, this._handleInternetReachabilityUpdate); // Add the subscription to the native events\n\n this._nativeEventSubscription = NativeInterface.eventEmitter.addListener(PrivateTypes.DEVICE_CONNECTIVITY_EVENT, this._handleNativeStateUpdate); // Fetch the current state from the native module\n\n this._fetchCurrentState();\n }\n\n}\n//# sourceMappingURL=state.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { Platform } from 'react-native';\nimport DEFAULT_CONFIGURATION from './internal/defaultConfiguration';\nimport NativeInterface from './internal/nativeInterface';\nimport State from './internal/state';\nimport * as Types from './internal/types'; // Stores the currently used configuration\n\nlet _configuration = DEFAULT_CONFIGURATION; // Stores the singleton reference to the state manager\n\nlet _state = null;\n\nconst createState = () => {\n return new State(_configuration);\n}; // Track ongoing requests\n\n\nlet isRequestInProgress = false;\nlet requestQueue = [];\n/**\n * Configures the library with the given configuration. Note that calling this will stop all\n * previously added listeners from being called again. It is best to call this right when your\n * application is started to avoid issues. The configuration sets up a global singleton instance.\n *\n * @param configuration The new configuration to set.\n */\n\nexport function configure(configuration) {\n _configuration = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n\n if (_state) {\n _state.tearDown();\n\n _state = createState();\n }\n\n if (Platform.OS === 'ios') {\n NativeInterface.configure(configuration);\n }\n}\n/**\n * Returns a `Promise` that resolves to a `NetInfoState` object.\n * This function operates on the global singleton instance configured using `configure()`\n *\n * @param [requestedInterface] interface from which to obtain the information\n *\n * @returns A Promise which contains the current connection state.\n */\n\nexport function fetch(requestedInterface) {\n if (!_state) {\n _state = createState();\n }\n\n return _state.latest(requestedInterface);\n}\n/**\n * Force-refreshes the internal state of the global singleton managed by this library.\n *\n * @returns A Promise which contains the updated connection state.\n */\n\nexport function refresh() {\n if (!_state) {\n _state = createState();\n } // If a request is already in progress, return a promise that will resolve when the current request finishes\n\n\n if (isRequestInProgress) {\n return new Promise(resolve => {\n requestQueue.push(resolve);\n });\n }\n\n isRequestInProgress = true;\n return _state._fetchCurrentState().then(result => {\n requestQueue.forEach(resolve => resolve(result));\n requestQueue = [];\n return result;\n }).finally(() => {\n isRequestInProgress = false;\n });\n}\n/**\n * Subscribe to the global singleton's connection information. The callback is called with a parameter of type\n * [`NetInfoState`](README.md#netinfostate) whenever the connection state changes. Your listener\n * will be called with the latest information soon after you subscribe and then with any\n * subsequent changes afterwards. You should not assume that the listener is called in the same\n * way across devices or platforms.\n *\n * @param listener The listener which is called when the network state changes.\n *\n * @returns A function which can be called to unsubscribe.\n */\n\nexport function addEventListener(listener) {\n if (!_state) {\n _state = createState();\n }\n\n _state.add(listener);\n\n return () => {\n _state && _state.remove(listener);\n };\n}\n/**\n * A React Hook into this library's singleton which updates when the connection state changes.\n *\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns The connection state.\n */\n\nexport function useNetInfo(configuration) {\n if (configuration) {\n configure(configuration);\n }\n\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n const unsubscribe = addEventListener(setNetInfo);\n return () => unsubscribe();\n }, []);\n return netInfo;\n}\n/**\n * A React Hook which manages an isolated instance of the network info manager.\n * This is not a hook into a singleton shared state. NetInfo.configure, NetInfo.addEventListener,\n * NetInfo.fetch, NetInfo.refresh are performed on a global singleton and have no affect on this hook.\n * @param {boolean} isPaused - Pause the internal network checks.\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns the netInfo state and a refresh function\n */\n\nexport function useNetInfoInstance(isPaused = false, configuration) {\n const [networkInfoManager, setNetworkInfoManager] = useState();\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n if (isPaused) {\n return;\n }\n\n const config = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n const state = new State(config);\n setNetworkInfoManager(state);\n state.add(setNetInfo);\n return state.tearDown;\n }, [isPaused, configuration]);\n const refresh = useCallback(() => {\n if (networkInfoManager && !isRequestInProgress) {\n isRequestInProgress = true;\n\n networkInfoManager._fetchCurrentState().finally(() => {\n isRequestInProgress = false;\n });\n }\n }, [networkInfoManager]);\n return {\n netInfo,\n refresh\n };\n}\nexport * from './internal/types';\nexport default {\n configure,\n fetch,\n refresh,\n addEventListener,\n useNetInfo,\n useNetInfoInstance\n};\n//# sourceMappingURL=index.js.map","// adapters/native/networkInfoNative.native.ts\nimport NetInfo from \"@react-native-community/netinfo\";\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\nexport class NetworkInfoTrackerNative {\n private telemetry?: Telemetry;\n\n constructor() {\n\n }\n\n async collect(): Promise<NetworkInfo> {\n try {\n const netState = await NetInfo.fetch();\n return {\n type: netState.type,\n isConnected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", isConnected: undefined };\n }\n }\n\n /**\n * collect() feeds the steady-state Context block on every event (no standalone\n * network_info event, ADR-0002). A connectivity *transition* is still its own\n * v3 `network_change` event, emitted via the shared NetworkChangeEmitter.\n */\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n NetInfo.addEventListener(state => changes.onSample(state.type));\n return info;\n }\n}\n"],"names":["DEFAULT_CONFIGURATION","response","DEVICE_CONNECTIVITY_EVENT","NetInfoStateType","NetInfoCellularGeneration","isWindowPresent","connection","typeMapping","effectiveTypeMapping","getCurrentState","_requestedInterface","isConnected","baseState","isConnectionExpensive","type","handlers","nativeHandlers","RNCNetInfo","handler","nativeHandler","index","requestedInterface","nativeEventEmitter","NativeEventEmitter","event","NativeInterface","_defineProperty","obj","key","value","InternetReachability","configuration","listener","isInternetReachable","expectsConnection","controller","responsePromise","timeoutHandle","timeoutPromise","_","reject","cancel","cancelPromise","result","nextTimeoutInterval","error","state","State","convertedState","nextState","input","PrivateTypes.DEVICE_CONNECTIVITY_EVENT","_configuration","_state","createState","isRequestInProgress","requestQueue","configure","Platform","fetch","refresh","resolve","addEventListener","useNetInfo","netInfo","setNetInfo","useState","Types.NetInfoStateType","useEffect","unsubscribe","useNetInfoInstance","isPaused","networkInfoManager","setNetworkInfoManager","config","useCallback","NetInfo","NetworkInfoTrackerNative","netState","telemetry","changes","NetworkChangeEmitter","info"],"mappings":"6KAAMA,EAAwB,CAC5B,gBAAiB,IACjB,mBAAoB,OACpB,oBAAqB,CAAA,EACrB,iBAAkBC,GAAY,QAAQ,QAAQA,EAAS,SAAW,GAAG,EACrE,yBAA0B,EAAI,IAE9B,wBAAyB,GAAK,IAE9B,2BAA4B,GAAK,IAEjC,sBAAuB,IAAM,GAC7B,oBAAqB,GACrB,sBAAuB,EACzB,ECNaC,EAA4B,iCCAlC,IAAIC,GAEV,SAAUA,EAAkB,CAC3BA,EAAiB,QAAa,UAC9BA,EAAiB,KAAU,OAC3BA,EAAiB,SAAc,WAC/BA,EAAiB,KAAU,OAC3BA,EAAiB,UAAe,YAChCA,EAAiB,SAAc,WAC/BA,EAAiB,MAAW,QAC5BA,EAAiB,IAAS,MAC1BA,EAAiB,MAAW,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
|
+
{"version":3,"file":"networkInfo.native-YVySdv3S.cjs","sources":["../node_modules/@react-native-community/netinfo/lib/module/internal/defaultConfiguration.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/privateTypes.js","../node_modules/@react-native-community/netinfo/lib/module/internal/types.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeModule.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/nativeInterface.web.js","../node_modules/@react-native-community/netinfo/lib/module/internal/internetReachability.js","../node_modules/@react-native-community/netinfo/lib/module/internal/state.js","../node_modules/@react-native-community/netinfo/lib/module/index.js","../src/adapters/native/networkInfo.native.ts"],"sourcesContent":["const DEFAULT_CONFIGURATION = {\n reachabilityUrl: '/',\n reachabilityMethod: \"HEAD\",\n reachabilityHeaders: {},\n reachabilityTest: response => Promise.resolve(response.status === 200),\n reachabilityShortTimeout: 5 * 1000,\n // 5s\n reachabilityLongTimeout: 60 * 1000,\n // 60s\n reachabilityRequestTimeout: 15 * 1000,\n // 15s\n reachabilityShouldRun: () => true,\n shouldFetchWiFiSSID: true,\n useNativeReachability: true\n};\nexport default DEFAULT_CONFIGURATION;\n//# sourceMappingURL=defaultConfiguration.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport const DEVICE_CONNECTIVITY_EVENT = 'netInfo.networkStatusDidChange'; // Certain properties are optional when sent by the native module and are handled by the JS code\n//# sourceMappingURL=privateTypes.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport let NetInfoStateType;\n\n(function (NetInfoStateType) {\n NetInfoStateType[\"unknown\"] = \"unknown\";\n NetInfoStateType[\"none\"] = \"none\";\n NetInfoStateType[\"cellular\"] = \"cellular\";\n NetInfoStateType[\"wifi\"] = \"wifi\";\n NetInfoStateType[\"bluetooth\"] = \"bluetooth\";\n NetInfoStateType[\"ethernet\"] = \"ethernet\";\n NetInfoStateType[\"wimax\"] = \"wimax\";\n NetInfoStateType[\"vpn\"] = \"vpn\";\n NetInfoStateType[\"other\"] = \"other\";\n})(NetInfoStateType || (NetInfoStateType = {}));\n\nexport let NetInfoCellularGeneration;\n\n(function (NetInfoCellularGeneration) {\n NetInfoCellularGeneration[\"2g\"] = \"2g\";\n NetInfoCellularGeneration[\"3g\"] = \"3g\";\n NetInfoCellularGeneration[\"4g\"] = \"4g\";\n NetInfoCellularGeneration[\"5g\"] = \"5g\";\n})(NetInfoCellularGeneration || (NetInfoCellularGeneration = {}));\n//# sourceMappingURL=types.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nimport { NetInfoCellularGeneration, NetInfoStateType } from './types'; // See https://wicg.github.io/netinfo/#dom-connectiontype\n\n// Use a constant test of this form because in SSR on next.js, optional chaining is not sufficient,\n// but this test correctly detects that window is not available and allows for conditionals before access\nconst isWindowPresent = typeof window !== 'undefined'; // Check if window exists and if the browser supports the connection API\n\nconst connection = isWindowPresent && !window.hasOwnProperty('tizen') && !window.hasOwnProperty('webOS') ? window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection : undefined; // Map browser types to native types\n\nconst typeMapping = {\n bluetooth: NetInfoStateType.bluetooth,\n cellular: NetInfoStateType.cellular,\n ethernet: NetInfoStateType.ethernet,\n none: NetInfoStateType.none,\n other: NetInfoStateType.other,\n unknown: NetInfoStateType.unknown,\n wifi: NetInfoStateType.wifi,\n wimax: NetInfoStateType.wimax,\n mixed: NetInfoStateType.other\n};\nconst effectiveTypeMapping = {\n '2g': NetInfoCellularGeneration['2g'],\n '3g': NetInfoCellularGeneration['3g'],\n '4g': NetInfoCellularGeneration['4g'],\n 'slow-2g': NetInfoCellularGeneration['2g']\n}; // Determine current state of connection\n\nconst getCurrentState = _requestedInterface => {\n const isConnected = isWindowPresent ? navigator.onLine : false;\n const baseState = {\n isInternetReachable: null\n }; // If we don't have a connection object, we return minimal information\n\n if (!connection) {\n if (isConnected) {\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive: false\n }\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type: NetInfoStateType.none,\n details: null\n };\n return state;\n } // Otherwise try to return detailed information\n\n\n const isConnectionExpensive = connection.saveData;\n const type = connection.type ? typeMapping[connection.type] : isConnected ? NetInfoStateType.other : NetInfoStateType.unknown;\n\n if (type === NetInfoStateType.bluetooth) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.cellular) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n cellularGeneration: effectiveTypeMapping[connection.effectiveType] || null,\n carrier: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.ethernet) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ipAddress: null,\n subnet: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wifi) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive,\n ssid: null,\n bssid: null,\n strength: null,\n ipAddress: null,\n subnet: null,\n frequency: null,\n linkSpeed: null,\n rxLinkSpeed: null,\n txLinkSpeed: null\n }\n };\n return state;\n } else if (type === NetInfoStateType.wimax) {\n const state = { ...baseState,\n isConnected: true,\n type,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n } else if (type === NetInfoStateType.none) {\n const state = { ...baseState,\n isConnected: false,\n isInternetReachable: false,\n type,\n details: null\n };\n return state;\n } else if (type === NetInfoStateType.unknown) {\n const state = { ...baseState,\n isConnected,\n isInternetReachable: null,\n type,\n details: null\n };\n return state;\n }\n\n const state = { ...baseState,\n isConnected: true,\n type: NetInfoStateType.other,\n details: {\n isConnectionExpensive\n }\n };\n return state;\n};\n\nconst handlers = [];\nconst nativeHandlers = [];\nconst RNCNetInfo = {\n addListener(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n const nativeHandler = () => {\n handler(getCurrentState());\n };\n\n if (connection) {\n connection.addEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.addEventListener('online', nativeHandler, false);\n window.addEventListener('offline', nativeHandler, false);\n }\n } // Remember handlers\n\n\n handlers.push(handler);\n nativeHandlers.push(nativeHandler);\n break;\n }\n }\n },\n\n removeListeners(type, handler) {\n switch (type) {\n case DEVICE_CONNECTIVITY_EVENT:\n {\n // Get native handler\n const index = handlers.indexOf(handler);\n const nativeHandler = nativeHandlers[index];\n\n if (connection) {\n connection.removeEventListener('change', nativeHandler);\n } else {\n if (isWindowPresent) {\n window.removeEventListener('online', nativeHandler);\n window.removeEventListener('offline', nativeHandler);\n }\n } // Remove handlers\n\n\n handlers.splice(index, 1);\n nativeHandlers.splice(index, 1);\n break;\n }\n }\n },\n\n async getCurrentState(requestedInterface) {\n return getCurrentState(requestedInterface);\n },\n\n configure() {\n return;\n }\n\n};\nexport default RNCNetInfo;\n//# sourceMappingURL=nativeModule.web.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { NativeEventEmitter } from 'react-native';\nimport RNCNetInfo from './nativeModule';\nimport { DEVICE_CONNECTIVITY_EVENT } from './privateTypes';\nconst nativeEventEmitter = new NativeEventEmitter(); // Listen to connectivity events\n\nRNCNetInfo.addListener(DEVICE_CONNECTIVITY_EVENT, event => {\n nativeEventEmitter.emit(DEVICE_CONNECTIVITY_EVENT, event);\n});\nexport default { ...RNCNetInfo,\n eventEmitter: nativeEventEmitter\n};\n//# sourceMappingURL=nativeInterface.web.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nexport default class InternetReachability {\n constructor(configuration, listener) {\n _defineProperty(this, \"_configuration\", void 0);\n\n _defineProperty(this, \"_listener\", void 0);\n\n _defineProperty(this, \"_isInternetReachable\", undefined);\n\n _defineProperty(this, \"_currentInternetReachabilityCheckHandler\", null);\n\n _defineProperty(this, \"_currentTimeoutHandle\", null);\n\n _defineProperty(this, \"_setIsInternetReachable\", isInternetReachable => {\n if (this._isInternetReachable === isInternetReachable) {\n return;\n }\n\n this._isInternetReachable = isInternetReachable;\n\n this._listener(this._isInternetReachable);\n });\n\n _defineProperty(this, \"_setExpectsConnection\", expectsConnection => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n\n if (expectsConnection && this._configuration.reachabilityShouldRun()) {\n // If we expect a connection, start the process for finding if we have one\n // Set the state to \"null\" if it was previously false\n if (!this._isInternetReachable) {\n this._setIsInternetReachable(null);\n } // Start a network request to check for internet\n\n\n this._currentInternetReachabilityCheckHandler = this._checkInternetReachability();\n } else {\n // If we don't expect a connection or don't run reachability check, just change the state to \"false\"\n this._setIsInternetReachable(false);\n }\n });\n\n _defineProperty(this, \"_checkInternetReachability\", () => {\n const controller = new AbortController();\n const responsePromise = fetch(this._configuration.reachabilityUrl, {\n headers: this._configuration.reachabilityHeaders,\n method: this._configuration.reachabilityMethod,\n cache: 'no-cache',\n signal: controller.signal\n }); // Create promise that will reject after the request timeout has been reached\n\n let timeoutHandle;\n const timeoutPromise = new Promise((_, reject) => {\n timeoutHandle = setTimeout(() => reject('timedout'), this._configuration.reachabilityRequestTimeout);\n }); // Create promise that makes it possible to cancel a pending request through a reject\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n\n let cancel = () => {};\n\n const cancelPromise = new Promise((_, reject) => {\n cancel = () => reject('canceled');\n });\n const promise = Promise.race([responsePromise, timeoutPromise, cancelPromise]).then(response => {\n return this._configuration.reachabilityTest(response);\n }).then(result => {\n this._setIsInternetReachable(result);\n\n const nextTimeoutInterval = this._isInternetReachable ? this._configuration.reachabilityLongTimeout : this._configuration.reachabilityShortTimeout;\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, nextTimeoutInterval);\n }).catch(error => {\n if ('canceled' === error) {\n controller.abort();\n } else {\n if ('timedout' === error) {\n controller.abort();\n }\n\n this._setIsInternetReachable(false);\n\n this._currentTimeoutHandle = setTimeout(this._checkInternetReachability, this._configuration.reachabilityShortTimeout);\n }\n }) // Clear request timeout and propagate any errors\n .then(() => {\n clearTimeout(timeoutHandle);\n }, error => {\n clearTimeout(timeoutHandle);\n throw error;\n });\n return {\n promise,\n cancel\n };\n });\n\n _defineProperty(this, \"update\", state => {\n if (typeof state.isInternetReachable === 'boolean' && this._configuration.useNativeReachability) {\n this._setIsInternetReachable(state.isInternetReachable);\n } else {\n this._setExpectsConnection(state.isConnected);\n }\n });\n\n _defineProperty(this, \"currentState\", () => {\n return this._isInternetReachable;\n });\n\n _defineProperty(this, \"tearDown\", () => {\n // Cancel any pending check\n if (this._currentInternetReachabilityCheckHandler !== null) {\n this._currentInternetReachabilityCheckHandler.cancel();\n\n this._currentInternetReachabilityCheckHandler = null;\n } // Cancel any pending timeout\n\n\n if (this._currentTimeoutHandle !== null) {\n clearTimeout(this._currentTimeoutHandle);\n this._currentTimeoutHandle = null;\n }\n });\n\n this._configuration = configuration;\n this._listener = listener;\n }\n\n}\n//# sourceMappingURL=internetReachability.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport NativeInterface from './nativeInterface';\nimport InternetReachability from './internetReachability';\nimport * as PrivateTypes from './privateTypes';\nexport default class State {\n constructor(configuration) {\n _defineProperty(this, \"_nativeEventSubscription\", null);\n\n _defineProperty(this, \"_subscriptions\", new Set());\n\n _defineProperty(this, \"_latestState\", null);\n\n _defineProperty(this, \"_internetReachability\", void 0);\n\n _defineProperty(this, \"_handleNativeStateUpdate\", state => {\n // Update the internet reachability module\n this._internetReachability.update(state); // Convert the state from native to JS shape\n\n\n const convertedState = this._convertState(state); // Update the listeners\n\n\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n });\n\n _defineProperty(this, \"_handleInternetReachabilityUpdate\", isInternetReachable => {\n if (!this._latestState) {\n return;\n }\n\n const nextState = { ...this._latestState,\n isInternetReachable\n };\n this._latestState = nextState;\n\n this._subscriptions.forEach(handler => handler(nextState));\n });\n\n _defineProperty(this, \"_fetchCurrentState\", async requestedInterface => {\n const state = await NativeInterface.getCurrentState(requestedInterface); // Update the internet reachability module\n\n this._internetReachability.update(state); // Convert and store the new state\n\n\n const convertedState = this._convertState(state);\n\n if (!requestedInterface) {\n this._latestState = convertedState;\n\n this._subscriptions.forEach(handler => handler(convertedState));\n }\n\n return convertedState;\n });\n\n _defineProperty(this, \"_convertState\", input => {\n if (typeof input.isInternetReachable === 'boolean') {\n return input;\n } else {\n return { ...input,\n isInternetReachable: this._internetReachability.currentState()\n };\n }\n });\n\n _defineProperty(this, \"latest\", requestedInterface => {\n if (requestedInterface) {\n return this._fetchCurrentState(requestedInterface);\n } else if (this._latestState) {\n return Promise.resolve(this._latestState);\n } else {\n return this._fetchCurrentState();\n }\n });\n\n _defineProperty(this, \"add\", handler => {\n // Add the subscription handler to our set\n this._subscriptions.add(handler); // Send it the latest data we have\n\n\n if (this._latestState) {\n handler(this._latestState);\n } else {\n this.latest().then(handler);\n }\n });\n\n _defineProperty(this, \"remove\", handler => {\n this._subscriptions.delete(handler);\n });\n\n _defineProperty(this, \"tearDown\", () => {\n if (this._internetReachability) {\n this._internetReachability.tearDown();\n }\n\n if (this._nativeEventSubscription) {\n this._nativeEventSubscription.remove();\n }\n\n this._subscriptions.clear();\n });\n\n // Add the listener to the internet connectivity events\n this._internetReachability = new InternetReachability(configuration, this._handleInternetReachabilityUpdate); // Add the subscription to the native events\n\n this._nativeEventSubscription = NativeInterface.eventEmitter.addListener(PrivateTypes.DEVICE_CONNECTIVITY_EVENT, this._handleNativeStateUpdate); // Fetch the current state from the native module\n\n this._fetchCurrentState();\n }\n\n}\n//# sourceMappingURL=state.js.map","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\nimport { useState, useEffect, useCallback } from 'react';\nimport { Platform } from 'react-native';\nimport DEFAULT_CONFIGURATION from './internal/defaultConfiguration';\nimport NativeInterface from './internal/nativeInterface';\nimport State from './internal/state';\nimport * as Types from './internal/types'; // Stores the currently used configuration\n\nlet _configuration = DEFAULT_CONFIGURATION; // Stores the singleton reference to the state manager\n\nlet _state = null;\n\nconst createState = () => {\n return new State(_configuration);\n}; // Track ongoing requests\n\n\nlet isRequestInProgress = false;\nlet requestQueue = [];\n/**\n * Configures the library with the given configuration. Note that calling this will stop all\n * previously added listeners from being called again. It is best to call this right when your\n * application is started to avoid issues. The configuration sets up a global singleton instance.\n *\n * @param configuration The new configuration to set.\n */\n\nexport function configure(configuration) {\n _configuration = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n\n if (_state) {\n _state.tearDown();\n\n _state = createState();\n }\n\n if (Platform.OS === 'ios') {\n NativeInterface.configure(configuration);\n }\n}\n/**\n * Returns a `Promise` that resolves to a `NetInfoState` object.\n * This function operates on the global singleton instance configured using `configure()`\n *\n * @param [requestedInterface] interface from which to obtain the information\n *\n * @returns A Promise which contains the current connection state.\n */\n\nexport function fetch(requestedInterface) {\n if (!_state) {\n _state = createState();\n }\n\n return _state.latest(requestedInterface);\n}\n/**\n * Force-refreshes the internal state of the global singleton managed by this library.\n *\n * @returns A Promise which contains the updated connection state.\n */\n\nexport function refresh() {\n if (!_state) {\n _state = createState();\n } // If a request is already in progress, return a promise that will resolve when the current request finishes\n\n\n if (isRequestInProgress) {\n return new Promise(resolve => {\n requestQueue.push(resolve);\n });\n }\n\n isRequestInProgress = true;\n return _state._fetchCurrentState().then(result => {\n requestQueue.forEach(resolve => resolve(result));\n requestQueue = [];\n return result;\n }).finally(() => {\n isRequestInProgress = false;\n });\n}\n/**\n * Subscribe to the global singleton's connection information. The callback is called with a parameter of type\n * [`NetInfoState`](README.md#netinfostate) whenever the connection state changes. Your listener\n * will be called with the latest information soon after you subscribe and then with any\n * subsequent changes afterwards. You should not assume that the listener is called in the same\n * way across devices or platforms.\n *\n * @param listener The listener which is called when the network state changes.\n *\n * @returns A function which can be called to unsubscribe.\n */\n\nexport function addEventListener(listener) {\n if (!_state) {\n _state = createState();\n }\n\n _state.add(listener);\n\n return () => {\n _state && _state.remove(listener);\n };\n}\n/**\n * A React Hook into this library's singleton which updates when the connection state changes.\n *\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns The connection state.\n */\n\nexport function useNetInfo(configuration) {\n if (configuration) {\n configure(configuration);\n }\n\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n const unsubscribe = addEventListener(setNetInfo);\n return () => unsubscribe();\n }, []);\n return netInfo;\n}\n/**\n * A React Hook which manages an isolated instance of the network info manager.\n * This is not a hook into a singleton shared state. NetInfo.configure, NetInfo.addEventListener,\n * NetInfo.fetch, NetInfo.refresh are performed on a global singleton and have no affect on this hook.\n * @param {boolean} isPaused - Pause the internal network checks.\n * @param {Partial<Types.NetInfoConfiguration>} configuration - Configure the isolated network checker managed by this hook\n *\n * @returns the netInfo state and a refresh function\n */\n\nexport function useNetInfoInstance(isPaused = false, configuration) {\n const [networkInfoManager, setNetworkInfoManager] = useState();\n const [netInfo, setNetInfo] = useState({\n type: Types.NetInfoStateType.unknown,\n isConnected: null,\n isInternetReachable: null,\n details: null\n });\n useEffect(() => {\n if (isPaused) {\n return;\n }\n\n const config = { ...DEFAULT_CONFIGURATION,\n ...configuration\n };\n const state = new State(config);\n setNetworkInfoManager(state);\n state.add(setNetInfo);\n return state.tearDown;\n }, [isPaused, configuration]);\n const refresh = useCallback(() => {\n if (networkInfoManager && !isRequestInProgress) {\n isRequestInProgress = true;\n\n networkInfoManager._fetchCurrentState().finally(() => {\n isRequestInProgress = false;\n });\n }\n }, [networkInfoManager]);\n return {\n netInfo,\n refresh\n };\n}\nexport * from './internal/types';\nexport default {\n configure,\n fetch,\n refresh,\n addEventListener,\n useNetInfo,\n useNetInfoInstance\n};\n//# sourceMappingURL=index.js.map","// adapters/native/networkInfoNative.native.ts\nimport NetInfo from \"@react-native-community/netinfo\";\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\nexport class NetworkInfoTrackerNative {\n private telemetry?: Telemetry;\n\n constructor() {\n\n }\n\n async collect(): Promise<NetworkInfo> {\n try {\n const netState = await NetInfo.fetch();\n return {\n type: netState.type,\n is_connected: netState.isConnected ?? undefined,\n };\n } catch {\n return { type: \"unknown\", is_connected: undefined };\n }\n }\n\n /**\n * collect() feeds the steady-state Context block on every event (no standalone\n * network_info event, ADR-0002). A connectivity *transition* is still its own\n * v3 `network_change` event, emitted via the shared NetworkChangeEmitter.\n */\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n NetInfo.addEventListener(state => changes.onSample(state.type));\n return info;\n }\n}\n"],"names":["DEFAULT_CONFIGURATION","response","DEVICE_CONNECTIVITY_EVENT","NetInfoStateType","NetInfoCellularGeneration","isWindowPresent","connection","typeMapping","effectiveTypeMapping","getCurrentState","_requestedInterface","isConnected","baseState","isConnectionExpensive","type","handlers","nativeHandlers","RNCNetInfo","handler","nativeHandler","index","requestedInterface","nativeEventEmitter","NativeEventEmitter","event","NativeInterface","_defineProperty","obj","key","value","InternetReachability","configuration","listener","isInternetReachable","expectsConnection","controller","responsePromise","timeoutHandle","timeoutPromise","_","reject","cancel","cancelPromise","result","nextTimeoutInterval","error","state","State","convertedState","nextState","input","PrivateTypes.DEVICE_CONNECTIVITY_EVENT","_configuration","_state","createState","isRequestInProgress","requestQueue","configure","Platform","fetch","refresh","resolve","addEventListener","useNetInfo","netInfo","setNetInfo","useState","Types.NetInfoStateType","useEffect","unsubscribe","useNetInfoInstance","isPaused","networkInfoManager","setNetworkInfoManager","config","useCallback","NetInfo","NetworkInfoTrackerNative","netState","telemetry","changes","NetworkChangeEmitter","info"],"mappings":"6KAAMA,EAAwB,CAC5B,gBAAiB,IACjB,mBAAoB,OACpB,oBAAqB,CAAA,EACrB,iBAAkBC,GAAY,QAAQ,QAAQA,EAAS,SAAW,GAAG,EACrE,yBAA0B,EAAI,IAE9B,wBAAyB,GAAK,IAE9B,2BAA4B,GAAK,IAEjC,sBAAuB,IAAM,GAC7B,oBAAqB,GACrB,sBAAuB,EACzB,ECNaC,EAA4B,iCCAlC,IAAIC,GAEV,SAAUA,EAAkB,CAC3BA,EAAiB,QAAa,UAC9BA,EAAiB,KAAU,OAC3BA,EAAiB,SAAc,WAC/BA,EAAiB,KAAU,OAC3BA,EAAiB,UAAe,YAChCA,EAAiB,SAAc,WAC/BA,EAAiB,MAAW,QAC5BA,EAAiB,IAAS,MAC1BA,EAAiB,MAAW,OAC9B,GAAGA,IAAqBA,EAAmB,CAAA,EAAG,EAEvC,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
|
|
2
2
|
async function i() {
|
|
3
3
|
return typeof navigator < "u" && "connection" in navigator ? {
|
|
4
4
|
type: navigator.connection.type || "unknown",
|
|
5
|
-
|
|
5
|
+
is_connected: navigator.onLine
|
|
6
6
|
// downlink: conn.downlink,
|
|
7
7
|
// effectiveType: conn.effectiveType,
|
|
8
8
|
} : {
|
|
9
9
|
type: "unknown",
|
|
10
|
-
|
|
10
|
+
is_connected: typeof navigator < "u" ? navigator.onLine : void 0
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
class d {
|
|
@@ -29,4 +29,4 @@ export {
|
|
|
29
29
|
d as NetworkInfoTrackerWeb,
|
|
30
30
|
i as getNetworkInfo
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=networkInfo.web-
|
|
32
|
+
//# sourceMappingURL=networkInfo.web-B2YlLNsI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkInfo.web-B2YlLNsI.js","sources":["../src/adapters/web/networkInfo.web.ts"],"sourcesContent":["// adapters/web/networkInfoWeb.web.ts\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\n\n\nexport async function getNetworkInfo(): Promise<NetworkInfo> {\n if (typeof navigator !== \"undefined\" && \"connection\" in navigator) {\n const conn = (navigator as any).connection;\n return {\n type: conn.type || \"unknown\",\n is_connected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n is_connected: typeof navigator !== \"undefined\" ? navigator.onLine : undefined,\n };\n}\n\nexport class NetworkInfoTrackerWeb {\n // constructor(private telemetry: Telemetry) { }\n constructor() { }\n\n async collect(): Promise<NetworkInfo> {\n return getNetworkInfo();\n }\n\n private telemetry!: Telemetry;\n\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n // collect() feeds the steady-state Context block (no standalone network_info event,\n // ADR-0002). A connectivity *transition* is its own v3 `network_change` event,\n // emitted via the shared NetworkChangeEmitter (lockstep with native).\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n const sample = async () => changes.onSample((await getNetworkInfo()).type);\n\n const conn = typeof navigator !== \"undefined\" ? (navigator as any).connection : undefined;\n conn?.addEventListener?.(\"change\", sample);\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"online\", sample);\n window.addEventListener(\"offline\", sample);\n }\n return info;\n }\n}\n"],"names":["getNetworkInfo","NetworkInfoTrackerWeb","telemetry","changes","NetworkChangeEmitter","info","sample"],"mappings":";AAOA,eAAsBA,IAAuC;AACzD,SAAI,OAAO,YAAc,OAAe,gBAAgB,YAE7C;AAAA,IACH,MAFU,UAAkB,WAEjB,QAAQ;AAAA,IACnB,cAAc,UAAU;AAAA;AAAA;AAAA,EAAA,IAOzB;AAAA,IACH,MAAM;AAAA,IACN,cAAc,OAAO,YAAc,MAAc,UAAU,SAAS;AAAA,EAAA;AAE5E;AAEO,MAAMC,EAAsB;AAAA;AAAA,EAE/B,cAAc;AAAA,EAAE;AAAA,EAEhB,MAAM,UAAgC;AAClC,WAAOD,EAAA;AAAA,EACX;AAAA,EAIA,MAAM,MAAME,GAA4C;AAIpD,SAAK,YAAYA;AACjB,UAAMC,IAAU,IAAIC,EAAqBF,CAAS,GAC5CG,IAAO,MAAM,KAAK,QAAA;AACxB,IAAAF,EAAQ,SAASE,EAAK,IAAI;AAC1B,UAAMC,IAAS,YAAYH,EAAQ,UAAU,MAAMH,EAAA,GAAkB,IAAI;AAGzE,YADa,OAAO,YAAc,MAAe,UAAkB,aAAa,SAC1E,mBAAmB,UAAUM,CAAM,GACrC,OAAO,SAAW,QAClB,OAAO,iBAAiB,UAAUA,CAAM,GACxC,OAAO,iBAAiB,WAAWA,CAAM,IAEtCD;AAAA,EACX;AACJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./networkChange-CUO1hRLj.cjs");async function e(){return typeof navigator<"u"&&"connection"in navigator?{type:navigator.connection.type||"unknown",is_connected:navigator.onLine}:{type:"unknown",is_connected:typeof navigator<"u"?navigator.onLine:void 0}}class c{constructor(){}async collect(){return e()}async start(t){this.telemetry=t;const o=new r.NetworkChangeEmitter(t),i=await this.collect();o.onSample(i.type);const n=async()=>o.onSample((await e()).type);return(typeof navigator<"u"?navigator.connection:void 0)?.addEventListener?.("change",n),typeof window<"u"&&(window.addEventListener("online",n),window.addEventListener("offline",n)),i}}exports.NetworkInfoTrackerWeb=c;exports.getNetworkInfo=e;
|
|
2
|
+
//# sourceMappingURL=networkInfo.web-PltJTHsy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"networkInfo.web-PltJTHsy.cjs","sources":["../src/adapters/web/networkInfo.web.ts"],"sourcesContent":["// adapters/web/networkInfoWeb.web.ts\nimport { NetworkInfo, Telemetry } from \"../../core/telemetry\";\nimport { NetworkChangeEmitter } from \"../networkChange\";\n\n\n\n\nexport async function getNetworkInfo(): Promise<NetworkInfo> {\n if (typeof navigator !== \"undefined\" && \"connection\" in navigator) {\n const conn = (navigator as any).connection;\n return {\n type: conn.type || \"unknown\",\n is_connected: navigator.onLine,\n // downlink: conn.downlink,\n // effectiveType: conn.effectiveType,\n };\n }\n\n // Fallback\n return {\n type: \"unknown\",\n is_connected: typeof navigator !== \"undefined\" ? navigator.onLine : undefined,\n };\n}\n\nexport class NetworkInfoTrackerWeb {\n // constructor(private telemetry: Telemetry) { }\n constructor() { }\n\n async collect(): Promise<NetworkInfo> {\n return getNetworkInfo();\n }\n\n private telemetry!: Telemetry;\n\n async start(telemetry: Telemetry): Promise<NetworkInfo> {\n // collect() feeds the steady-state Context block (no standalone network_info event,\n // ADR-0002). A connectivity *transition* is its own v3 `network_change` event,\n // emitted via the shared NetworkChangeEmitter (lockstep with native).\n this.telemetry = telemetry;\n const changes = new NetworkChangeEmitter(telemetry);\n const info = await this.collect();\n changes.onSample(info.type); // seed baseline so the first real transition emits\n const sample = async () => changes.onSample((await getNetworkInfo()).type);\n\n const conn = typeof navigator !== \"undefined\" ? (navigator as any).connection : undefined;\n conn?.addEventListener?.(\"change\", sample);\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"online\", sample);\n window.addEventListener(\"offline\", sample);\n }\n return info;\n }\n}\n"],"names":["getNetworkInfo","NetworkInfoTrackerWeb","telemetry","changes","NetworkChangeEmitter","info","sample"],"mappings":"gIAOA,eAAsBA,GAAuC,CACzD,OAAI,OAAO,UAAc,KAAe,eAAgB,UAE7C,CACH,KAFU,UAAkB,WAEjB,MAAQ,UACnB,aAAc,UAAU,MAAA,EAOzB,CACH,KAAM,UACN,aAAc,OAAO,UAAc,IAAc,UAAU,OAAS,MAAA,CAE5E,CAEO,MAAMC,CAAsB,CAE/B,aAAc,CAAE,CAEhB,MAAM,SAAgC,CAClC,OAAOD,EAAA,CACX,CAIA,MAAM,MAAME,EAA4C,CAIpD,KAAK,UAAYA,EACjB,MAAMC,EAAU,IAAIC,EAAAA,qBAAqBF,CAAS,EAC5CG,EAAO,MAAM,KAAK,QAAA,EACxBF,EAAQ,SAASE,EAAK,IAAI,EAC1B,MAAMC,EAAS,SAAYH,EAAQ,UAAU,MAAMH,EAAA,GAAkB,IAAI,EAGzE,OADa,OAAO,UAAc,IAAe,UAAkB,WAAa,SAC1E,mBAAmB,SAAUM,CAAM,EACrC,OAAO,OAAW,MAClB,OAAO,iBAAiB,SAAUA,CAAM,EACxC,OAAO,iBAAiB,UAAWA,CAAM,GAEtCD,CACX,CACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function t() {
|
|
2
|
+
const e = globalThis.performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd;
|
|
3
|
+
return typeof e == "number" && e > 0 ? e : void 0;
|
|
4
|
+
}
|
|
5
|
+
async function i() {
|
|
6
|
+
const n = t();
|
|
7
|
+
return n !== void 0 ? n : (await new Promise((e) => {
|
|
8
|
+
setTimeout(e, 0)?.unref?.();
|
|
9
|
+
}), t());
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
i as runtimeReadyAt
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=runtimeReady.native-Bh7EcYmK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.native-Bh7EcYmK.js","sources":["../src/adapters/native/runtimeReady.native.ts"],"sourcesContent":["// The native half of §4.5.2's `initial_load` seed. `performance.rnStartupTiming` is a\n// natively-anchored process-start marker that needs no native module; the bundle-evaluated\n// entry is the one §4.3 pins `app.start.js_ready_ms` to, and this reuses it rather than\n// inventing a second definition of \"the runtime is ready\".\n//\n// ⚠ Absent on the Old Architecture and on runtimes that omit it. Absent resolves to\n// `undefined`, which releases the gate — a marker that never arrives must not make every\n// launch report `abandoned`.\n\n/** Epoch ms of \"bundle evaluated\", or undefined where the runtime does not publish it. */\ntype StartupTiming = { executeJavaScriptBundleEntryPointEnd?: unknown };\n\nfunction read(): number | undefined {\n // `performance` is a native-only global here and the field is absent on the Old\n // Architecture, so it is read defensively rather than typed as present.\n const perf = (globalThis as { performance?: { rnStartupTiming?: StartupTiming } }).performance;\n const end = perf?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd;\n return typeof end === \"number\" && end > 0 ? end : undefined;\n}\n\nexport async function runtimeReadyAt(): Promise<number | undefined> {\n const early = read();\n if (early !== undefined) return early;\n\n // `executeJavaScriptBundleEntryPointEnd` is stamped only once the bundle entry point has\n // finished, and the common wiring constructs the SDK at module scope — i.e. inside that\n // entry point, before the field exists. One turn of the event loop is after it by\n // construction, so re-read once rather than reporting \"no marker\" to every real app.\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 0);\n (timer as { unref?: () => void })?.unref?.();\n });\n return read();\n}\n"],"names":["read","end","runtimeReadyAt","early","resolve"],"mappings":"AAYA,SAASA,IAA2B;AAIhC,QAAMC,IADQ,WAAqE,aACjE,iBAAiB;AACnC,SAAO,OAAOA,KAAQ,YAAYA,IAAM,IAAIA,IAAM;AACtD;AAEA,eAAsBC,IAA8C;AAChE,QAAMC,IAAQH,EAAA;AACd,SAAIG,MAAU,SAAkBA,KAMhC,MAAM,IAAI,QAAc,CAACC,MAAY;AAEhC,IADa,WAAWA,GAAS,CAAC,GACA,QAAA;AAAA,EACvC,CAAC,GACMJ,EAAA;AACX;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(){const e=globalThis.performance?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd;return typeof e=="number"&&e>0?e:void 0}async function r(){const t=n();return t!==void 0?t:(await new Promise(e=>{setTimeout(e,0)?.unref?.()}),n())}exports.runtimeReadyAt=r;
|
|
2
|
+
//# sourceMappingURL=runtimeReady.native-jUmuE1lV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.native-jUmuE1lV.cjs","sources":["../src/adapters/native/runtimeReady.native.ts"],"sourcesContent":["// The native half of §4.5.2's `initial_load` seed. `performance.rnStartupTiming` is a\n// natively-anchored process-start marker that needs no native module; the bundle-evaluated\n// entry is the one §4.3 pins `app.start.js_ready_ms` to, and this reuses it rather than\n// inventing a second definition of \"the runtime is ready\".\n//\n// ⚠ Absent on the Old Architecture and on runtimes that omit it. Absent resolves to\n// `undefined`, which releases the gate — a marker that never arrives must not make every\n// launch report `abandoned`.\n\n/** Epoch ms of \"bundle evaluated\", or undefined where the runtime does not publish it. */\ntype StartupTiming = { executeJavaScriptBundleEntryPointEnd?: unknown };\n\nfunction read(): number | undefined {\n // `performance` is a native-only global here and the field is absent on the Old\n // Architecture, so it is read defensively rather than typed as present.\n const perf = (globalThis as { performance?: { rnStartupTiming?: StartupTiming } }).performance;\n const end = perf?.rnStartupTiming?.executeJavaScriptBundleEntryPointEnd;\n return typeof end === \"number\" && end > 0 ? end : undefined;\n}\n\nexport async function runtimeReadyAt(): Promise<number | undefined> {\n const early = read();\n if (early !== undefined) return early;\n\n // `executeJavaScriptBundleEntryPointEnd` is stamped only once the bundle entry point has\n // finished, and the common wiring constructs the SDK at module scope — i.e. inside that\n // entry point, before the field exists. One turn of the event loop is after it by\n // construction, so re-read once rather than reporting \"no marker\" to every real app.\n await new Promise<void>((resolve) => {\n const timer = setTimeout(resolve, 0);\n (timer as { unref?: () => void })?.unref?.();\n });\n return read();\n}\n"],"names":["read","end","runtimeReadyAt","early","resolve"],"mappings":"gFAYA,SAASA,GAA2B,CAIhC,MAAMC,EADQ,WAAqE,aACjE,iBAAiB,qCACnC,OAAO,OAAOA,GAAQ,UAAYA,EAAM,EAAIA,EAAM,MACtD,CAEA,eAAsBC,GAA8C,CAChE,MAAMC,EAAQH,EAAA,EACd,OAAIG,IAAU,OAAkBA,GAMhC,MAAM,IAAI,QAAeC,GAAY,CACnB,WAAWA,EAAS,CAAC,GACA,QAAA,CACvC,CAAC,EACMJ,EAAA,EACX"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { L as d } from "./loadingTime-ZkYvFijA.js";
|
|
2
|
+
function o() {
|
|
3
|
+
if (typeof performance > "u") return;
|
|
4
|
+
const e = performance.getEntriesByType?.("navigation")?.[0];
|
|
5
|
+
if (e && e.loadEventEnd > 0) return performance.timeOrigin + e.loadEventEnd;
|
|
6
|
+
const n = performance.timing?.loadEventEnd;
|
|
7
|
+
return typeof n == "number" && n > 0 ? n : void 0;
|
|
8
|
+
}
|
|
9
|
+
function m() {
|
|
10
|
+
if (typeof window > "u") return Promise.resolve(void 0);
|
|
11
|
+
const e = o();
|
|
12
|
+
return e !== void 0 ? Promise.resolve(e) : typeof document < "u" && document.readyState === "complete" ? Promise.resolve(void 0) : new Promise((n) => {
|
|
13
|
+
let r = !1;
|
|
14
|
+
const t = (i) => {
|
|
15
|
+
r || (r = !0, n(i));
|
|
16
|
+
};
|
|
17
|
+
window.addEventListener("load", () => {
|
|
18
|
+
t(o() ?? Date.now());
|
|
19
|
+
}, { once: !0 }), setTimeout(() => t(void 0), d)?.unref?.();
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
m as runtimeReadyAt
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=runtimeReady.web-C8fdIbVR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.web-C8fdIbVR.js","sources":["../src/adapters/web/runtimeReady.web.ts"],"sourcesContent":["// The web half of §4.5.2's `initial_load` seed: the launch view is busy until the document's\n// own load marker, then settles. `loadEventEnd` is the platform's answer to \"the runtime is\n// ready\"; the SDK does not invent one.\n//\n// ⚠ Web's `initial_load` is systematically LARGER than native's — it includes DNS, TLS and\n// document download where native reads a bundle off local disk. Cross-platform `initial_load`\n// comparison is not apples-to-apples (§4.5.2); within-platform release comparison is fine.\n\nimport { LOADING_TIME_CAP_MS } from \"../loadingTime\";\n\n/** Epoch ms of `loadEventEnd`, or undefined where the entry is unavailable. */\nfunction readMarker(): number | undefined {\n if (typeof performance === \"undefined\") return undefined;\n const nav = performance.getEntriesByType?.(\"navigation\")?.[0] as PerformanceNavigationTiming | undefined;\n // Navigation-timing values are relative to timeOrigin; the settle module works in epoch ms.\n if (nav && nav.loadEventEnd > 0) return performance.timeOrigin + nav.loadEventEnd;\n // `performance.timing` is the removed-but-still-shipped legacy API; not in lib.dom's types.\n const legacy = (performance as unknown as { timing?: { loadEventEnd?: number } }).timing?.loadEventEnd;\n return typeof legacy === \"number\" && legacy > 0 ? legacy : undefined;\n}\n\n/**\n * Resolves once the marker is known — `undefined` when the platform has none to give, which\n * releases the gate rather than leaving every launch reporting `abandoned` (§4.5.2).\n */\nexport function runtimeReadyAt(): Promise<number | undefined> {\n if (typeof window === \"undefined\") return Promise.resolve(undefined);\n\n const early = readMarker();\n if (early !== undefined) return Promise.resolve(early);\n // Already loaded but the entry is missing (an old browser, a same-document navigation):\n // nothing more is coming, so release rather than wait forever.\n if (typeof document !== \"undefined\" && document.readyState === \"complete\") {\n return Promise.resolve(undefined);\n }\n\n return new Promise((resolve) => {\n let settled = false;\n const finish = (at?: number) => { if (!settled) { settled = true; resolve(at); } };\n\n window.addEventListener(\"load\", () => {\n // `loadEventEnd` is stamped *after* the load handlers run, so it is still 0 inside\n // one of them. Now is a truthful marker either way — we are in the load event.\n finish(readMarker() ?? Date.now());\n }, { once: true });\n\n // A `load` that never fires — a stalled subresource, a runtime with no such event —\n // would otherwise leave the gate shut forever and make every launch report\n // `abandoned`, which is the exact failure this module exists to avoid. Past the cap\n // the launch view is capped anyway, so there is nothing left to wait for.\n const timer = setTimeout(() => finish(undefined), LOADING_TIME_CAP_MS);\n (timer as any)?.unref?.(); // never hold a Node process open for a marker\n });\n}\n"],"names":["readMarker","nav","legacy","runtimeReadyAt","early","resolve","settled","finish","at","LOADING_TIME_CAP_MS"],"mappings":";AAWA,SAASA,IAAiC;AACtC,MAAI,OAAO,cAAgB,IAAa;AACxC,QAAMC,IAAM,YAAY,mBAAmB,YAAY,IAAI,CAAC;AAE5D,MAAIA,KAAOA,EAAI,eAAe,EAAG,QAAO,YAAY,aAAaA,EAAI;AAErE,QAAMC,IAAU,YAAkE,QAAQ;AAC1F,SAAO,OAAOA,KAAW,YAAYA,IAAS,IAAIA,IAAS;AAC/D;AAMO,SAASC,IAA8C;AAC1D,MAAI,OAAO,SAAW,IAAa,QAAO,QAAQ,QAAQ,MAAS;AAEnE,QAAMC,IAAQJ,EAAA;AACd,SAAII,MAAU,SAAkB,QAAQ,QAAQA,CAAK,IAGjD,OAAO,WAAa,OAAe,SAAS,eAAe,aACpD,QAAQ,QAAQ,MAAS,IAG7B,IAAI,QAAQ,CAACC,MAAY;AAC5B,QAAIC,IAAU;AACd,UAAMC,IAAS,CAACC,MAAgB;AAAE,MAAKF,MAAWA,IAAU,IAAMD,EAAQG,CAAE;AAAA,IAAK;AAEjF,WAAO,iBAAiB,QAAQ,MAAM;AAGlC,MAAAD,EAAOP,EAAA,KAAgB,KAAK,IAAA,CAAK;AAAA,IACrC,GAAG,EAAE,MAAM,IAAM,GAMH,WAAW,MAAMO,EAAO,MAAS,GAAGE,CAAmB,GACrD,QAAA;AAAA,EACpB,CAAC;AACL;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./loadingTime-Bhomd9qq.cjs");function o(){if(typeof performance>"u")return;const e=performance.getEntriesByType?.("navigation")?.[0];if(e&&e.loadEventEnd>0)return performance.timeOrigin+e.loadEventEnd;const n=performance.timing?.loadEventEnd;return typeof n=="number"&&n>0?n:void 0}function a(){if(typeof window>"u")return Promise.resolve(void 0);const e=o();return e!==void 0?Promise.resolve(e):typeof document<"u"&&document.readyState==="complete"?Promise.resolve(void 0):new Promise(n=>{let t=!1;const r=i=>{t||(t=!0,n(i))};window.addEventListener("load",()=>{r(o()??Date.now())},{once:!0}),setTimeout(()=>r(void 0),d.LOADING_TIME_CAP_MS)?.unref?.()})}exports.runtimeReadyAt=a;
|
|
2
|
+
//# sourceMappingURL=runtimeReady.web-DHW682RN.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeReady.web-DHW682RN.cjs","sources":["../src/adapters/web/runtimeReady.web.ts"],"sourcesContent":["// The web half of §4.5.2's `initial_load` seed: the launch view is busy until the document's\n// own load marker, then settles. `loadEventEnd` is the platform's answer to \"the runtime is\n// ready\"; the SDK does not invent one.\n//\n// ⚠ Web's `initial_load` is systematically LARGER than native's — it includes DNS, TLS and\n// document download where native reads a bundle off local disk. Cross-platform `initial_load`\n// comparison is not apples-to-apples (§4.5.2); within-platform release comparison is fine.\n\nimport { LOADING_TIME_CAP_MS } from \"../loadingTime\";\n\n/** Epoch ms of `loadEventEnd`, or undefined where the entry is unavailable. */\nfunction readMarker(): number | undefined {\n if (typeof performance === \"undefined\") return undefined;\n const nav = performance.getEntriesByType?.(\"navigation\")?.[0] as PerformanceNavigationTiming | undefined;\n // Navigation-timing values are relative to timeOrigin; the settle module works in epoch ms.\n if (nav && nav.loadEventEnd > 0) return performance.timeOrigin + nav.loadEventEnd;\n // `performance.timing` is the removed-but-still-shipped legacy API; not in lib.dom's types.\n const legacy = (performance as unknown as { timing?: { loadEventEnd?: number } }).timing?.loadEventEnd;\n return typeof legacy === \"number\" && legacy > 0 ? legacy : undefined;\n}\n\n/**\n * Resolves once the marker is known — `undefined` when the platform has none to give, which\n * releases the gate rather than leaving every launch reporting `abandoned` (§4.5.2).\n */\nexport function runtimeReadyAt(): Promise<number | undefined> {\n if (typeof window === \"undefined\") return Promise.resolve(undefined);\n\n const early = readMarker();\n if (early !== undefined) return Promise.resolve(early);\n // Already loaded but the entry is missing (an old browser, a same-document navigation):\n // nothing more is coming, so release rather than wait forever.\n if (typeof document !== \"undefined\" && document.readyState === \"complete\") {\n return Promise.resolve(undefined);\n }\n\n return new Promise((resolve) => {\n let settled = false;\n const finish = (at?: number) => { if (!settled) { settled = true; resolve(at); } };\n\n window.addEventListener(\"load\", () => {\n // `loadEventEnd` is stamped *after* the load handlers run, so it is still 0 inside\n // one of them. Now is a truthful marker either way — we are in the load event.\n finish(readMarker() ?? Date.now());\n }, { once: true });\n\n // A `load` that never fires — a stalled subresource, a runtime with no such event —\n // would otherwise leave the gate shut forever and make every launch report\n // `abandoned`, which is the exact failure this module exists to avoid. Past the cap\n // the launch view is capped anyway, so there is nothing left to wait for.\n const timer = setTimeout(() => finish(undefined), LOADING_TIME_CAP_MS);\n (timer as any)?.unref?.(); // never hold a Node process open for a marker\n });\n}\n"],"names":["readMarker","nav","legacy","runtimeReadyAt","early","resolve","settled","finish","at","LOADING_TIME_CAP_MS"],"mappings":"8HAWA,SAASA,GAAiC,CACtC,GAAI,OAAO,YAAgB,IAAa,OACxC,MAAMC,EAAM,YAAY,mBAAmB,YAAY,IAAI,CAAC,EAE5D,GAAIA,GAAOA,EAAI,aAAe,EAAG,OAAO,YAAY,WAAaA,EAAI,aAErE,MAAMC,EAAU,YAAkE,QAAQ,aAC1F,OAAO,OAAOA,GAAW,UAAYA,EAAS,EAAIA,EAAS,MAC/D,CAMO,SAASC,GAA8C,CAC1D,GAAI,OAAO,OAAW,IAAa,OAAO,QAAQ,QAAQ,MAAS,EAEnE,MAAMC,EAAQJ,EAAA,EACd,OAAII,IAAU,OAAkB,QAAQ,QAAQA,CAAK,EAGjD,OAAO,SAAa,KAAe,SAAS,aAAe,WACpD,QAAQ,QAAQ,MAAS,EAG7B,IAAI,QAASC,GAAY,CAC5B,IAAIC,EAAU,GACd,MAAMC,EAAUC,GAAgB,CAAOF,IAAWA,EAAU,GAAMD,EAAQG,CAAE,EAAK,EAEjF,OAAO,iBAAiB,OAAQ,IAAM,CAGlCD,EAAOP,EAAA,GAAgB,KAAK,IAAA,CAAK,CACrC,EAAG,CAAE,KAAM,GAAM,EAMH,WAAW,IAAMO,EAAO,MAAS,EAAGE,EAAAA,mBAAmB,GACrD,QAAA,CACpB,CAAC,CACL"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./memoryStore-BIGZmmfD.cjs");function a(t,r,d){Promise.resolve().then(r).then(e=>t.seedRuntimeReady(e)).catch(e=>{n.debug.warn(`${d} runtime-ready marker unavailable:`,e),t.seedRuntimeReady(void 0)})}exports.seedRuntimeReady=a;
|
|
2
|
+
//# sourceMappingURL=seedRuntimeReady-BKwkBEAF.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seedRuntimeReady-BKwkBEAF.cjs","sources":["../src/adapters/seedRuntimeReady.ts"],"sourcesContent":["// Arming §4.5.2's `initial_load` seed, shared by both entries because only the *source* of the\n// marker is platform-specific — the failure handling around it is not, and it is the part that\n// must not be got wrong twice.\n//\n// Every path here ends in exactly one `seedRuntimeReady()` call. A gate that is never released\n// makes every launch report `abandoned`, which is the one outcome this seed exists to prevent.\n\nimport { debug } from \"../core/debug\";\nimport type { ViewManager } from \"./viewManager\";\n\nexport type RuntimeReadyReader = () => Promise<number | undefined>;\n\n/**\n * Fire-and-forget on purpose: on web the marker arrives with the load event, and blocking init\n * on it would put every host call behind the page's own images. The caller awaits the *module*\n * import instead, so the seed is armed before the instance is visible.\n */\nexport function seedRuntimeReady(views: ViewManager, read: RuntimeReadyReader, build: string): void {\n // `Promise.resolve().then` and not a bare call: a reader that throws *synchronously* would\n // sidestep the catch below and leave the gate shut.\n void Promise.resolve()\n .then(read)\n .then((at) => views.seedRuntimeReady(at))\n .catch((err: unknown) => {\n debug.warn(`${build} runtime-ready marker unavailable:`, err);\n views.seedRuntimeReady(undefined); // release the gate anyway\n });\n}\n"],"names":["seedRuntimeReady","views","read","build","at","err","debug"],"mappings":"8HAiBO,SAASA,EAAiBC,EAAoBC,EAA0BC,EAAqB,CAG3F,QAAQ,QAAA,EACR,KAAKD,CAAI,EACT,KAAME,GAAOH,EAAM,iBAAiBG,CAAE,CAAC,EACvC,MAAOC,GAAiB,CACrBC,EAAAA,MAAM,KAAK,GAAGH,CAAK,qCAAsCE,CAAG,EAC5DJ,EAAM,iBAAiB,MAAS,CACpC,CAAC,CACT"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { d as r } from "./memoryStore-F5I-GQKM.js";
|
|
2
|
+
function i(a, d, n) {
|
|
3
|
+
Promise.resolve().then(d).then((e) => a.seedRuntimeReady(e)).catch((e) => {
|
|
4
|
+
r.warn(`${n} runtime-ready marker unavailable:`, e), a.seedRuntimeReady(void 0);
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
i as seedRuntimeReady
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=seedRuntimeReady-Cz8nOKoo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seedRuntimeReady-Cz8nOKoo.js","sources":["../src/adapters/seedRuntimeReady.ts"],"sourcesContent":["// Arming §4.5.2's `initial_load` seed, shared by both entries because only the *source* of the\n// marker is platform-specific — the failure handling around it is not, and it is the part that\n// must not be got wrong twice.\n//\n// Every path here ends in exactly one `seedRuntimeReady()` call. A gate that is never released\n// makes every launch report `abandoned`, which is the one outcome this seed exists to prevent.\n\nimport { debug } from \"../core/debug\";\nimport type { ViewManager } from \"./viewManager\";\n\nexport type RuntimeReadyReader = () => Promise<number | undefined>;\n\n/**\n * Fire-and-forget on purpose: on web the marker arrives with the load event, and blocking init\n * on it would put every host call behind the page's own images. The caller awaits the *module*\n * import instead, so the seed is armed before the instance is visible.\n */\nexport function seedRuntimeReady(views: ViewManager, read: RuntimeReadyReader, build: string): void {\n // `Promise.resolve().then` and not a bare call: a reader that throws *synchronously* would\n // sidestep the catch below and leave the gate shut.\n void Promise.resolve()\n .then(read)\n .then((at) => views.seedRuntimeReady(at))\n .catch((err: unknown) => {\n debug.warn(`${build} runtime-ready marker unavailable:`, err);\n views.seedRuntimeReady(undefined); // release the gate anyway\n });\n}\n"],"names":["seedRuntimeReady","views","read","build","at","err","debug"],"mappings":";AAiBO,SAASA,EAAiBC,GAAoBC,GAA0BC,GAAqB;AAGhG,EAAK,QAAQ,QAAA,EACR,KAAKD,CAAI,EACT,KAAK,CAACE,MAAOH,EAAM,iBAAiBG,CAAE,CAAC,EACvC,MAAM,CAACC,MAAiB;AACrB,IAAAC,EAAM,KAAK,GAAGH,CAAK,sCAAsCE,CAAG,GAC5DJ,EAAM,iBAAiB,MAAS;AAAA,EACpC,CAAC;AACT;"}
|
|
@@ -11,5 +11,12 @@ export declare class AppLifecycleEmitter {
|
|
|
11
11
|
private telemetry;
|
|
12
12
|
private active?;
|
|
13
13
|
constructor(telemetry: Telemetry);
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Returns once the transition's rows are enqueued — **await it before flushing**. The
|
|
16
|
+
* background boundary's `view` row is the one most likely to be lost to an OS kill, and
|
|
17
|
+
* the whole point of §4.5's background boundary is that it flushes while the app is still
|
|
18
|
+
* reliably alive. A caller that fires the flush on the next line instead sends the batch
|
|
19
|
+
* before the row exists.
|
|
20
|
+
*/
|
|
21
|
+
onState(isActive: boolean): Promise<void>;
|
|
15
22
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { TelemetryEvent } from '../core/telemetry';
|
|
2
2
|
export declare function buildBatch(events: TelemetryEvent[]): string;
|
|
3
|
+
export declare function buildHeaders(credential: string | undefined): Record<string, string>;
|
|
4
|
+
export declare const DEFAULT_ENDPOINT = "https://your.telemetry.endpoint/telemetry";
|
|
@@ -1,13 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* §4.7 — the error surface. Two event names, not one: `app.crash` is unhandled /
|
|
3
|
+
* fatal-ish, `app.error` is handled or non-fatal, so
|
|
4
|
+
* `COUNT(event_name='app.crash') / sessions` is a crash-free rate with no `WHERE`
|
|
5
|
+
* clause anyone can forget. All five v3 `crash.*` keys are retired for dotted
|
|
6
|
+
* `error.*`, and both explicit wire nulls go with them. #100
|
|
7
|
+
*/
|
|
8
|
+
/** `error.source` — a full re-cut of v3's `crash.cause`, not a rename. 5 values. */
|
|
9
|
+
export type ErrorSource = "global_handler" | "unhandled_rejection" | "cross_origin" | "console" | "reported";
|
|
10
|
+
/**
|
|
11
|
+
* `error.type` is read from `error.name` **only, never `constructor.name`**: RN production
|
|
12
|
+
* bundles minify class names, so `class PaymentError extends Error {}` would report as `"a"`
|
|
13
|
+
* — not merely unreadable but *unstable across builds*, refragmenting grouping on every
|
|
14
|
+
* deploy. `error.name` is a string literal in the author's source. Un-named classes report
|
|
15
|
+
* `"Error"`: low cardinality, but honest.
|
|
16
|
+
*/
|
|
17
|
+
export declare function errorType(error: unknown): string;
|
|
18
|
+
/**
|
|
19
|
+
* The `error.*` block for both event names. `error.handled` does not exist — the event name
|
|
20
|
+
* carries that bit, and carrying both is a denormalization that can disagree. `error.fatal`
|
|
21
|
+
* is passed only by the native build (§4.7: on web nothing is fatal).
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildErrorAttributes(source: ErrorSource, error: unknown, opts?: {
|
|
24
|
+
fallbackMessage?: unknown;
|
|
6
25
|
fatal?: boolean;
|
|
7
26
|
}): Record<string, any>;
|
|
27
|
+
/** What `captureConsole` needs of a `Telemetry` — structural. */
|
|
28
|
+
type ErrorSink = {
|
|
29
|
+
captureError(error: unknown, context?: Record<string, any>, source?: ErrorSource): unknown;
|
|
30
|
+
addBreadcrumb(name: string, data?: Record<string, any>): void;
|
|
31
|
+
};
|
|
8
32
|
/**
|
|
9
|
-
* Patch console.error
|
|
10
|
-
*
|
|
11
|
-
*
|
|
33
|
+
* Patch console.error → `app.error` (source `console`) and console.warn → a **breadcrumb**.
|
|
34
|
+
* `ConsoleWarn` is deleted outright: React's own dev-mode warnings were the dominant
|
|
35
|
+
* contributor to v3's crash count, which is what made "is my app crashing more?"
|
|
36
|
+
* unanswerable. Opt-*in* now — `captureConsole` defaults off (§4.7).
|
|
37
|
+
*
|
|
38
|
+
* Returns a restore fn. A reentrancy guard keeps the SDK's own console writes during
|
|
39
|
+
* logging from re-capturing.
|
|
12
40
|
*/
|
|
13
|
-
export declare function captureConsole(telemetry:
|
|
41
|
+
export declare function captureConsole(telemetry: ErrorSink, target?: Pick<Console, "error" | "warn">): () => void;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { StoreRead } from '../core/store';
|
|
2
|
+
import { TelemetryEvent } from '../core/telemetry';
|
|
3
|
+
export declare const FAILED_EVENTS_KEY = "telemetry_failed_events";
|
|
4
|
+
/**
|
|
5
|
+
* Decode a stored batch.
|
|
6
|
+
*
|
|
7
|
+
* The Store port never throws, and neither does this. An unavailable store, a key that
|
|
8
|
+
* was never written, a half-written payload and a non-array JSON value all mean the
|
|
9
|
+
* same thing to a caller — nothing replayable — so they all return `[]`. Before the
|
|
10
|
+
* port, this was a bare `JSON.parse(... || "[]")` that threw straight through
|
|
11
|
+
* `replayFailed()` on any corrupt payload and took startup with it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function decodeFailed(read: StoreRead): TelemetryEvent[];
|
|
14
|
+
/**
|
|
15
|
+
* The offline store's cap (§9.4). Real numbers, not chosen ones: Android caps AsyncStorage
|
|
16
|
+
* at 6 MB for the whole app and web `localStorage` is the *host app's* ~5 MB — an
|
|
17
|
+
* append-only telemetry queue inside either is a slow eviction of the consumer's own data.
|
|
18
|
+
*/
|
|
19
|
+
export declare const STORE_MAX_EVENTS = 500;
|
|
20
|
+
export declare const STORE_MAX_BYTES = 1000000;
|
|
21
|
+
/**
|
|
22
|
+
* Encode the queue after appending `incoming`, oldest first, capped per §9.4 and
|
|
23
|
+
* reporting how many rows the cap cost.
|
|
24
|
+
*
|
|
25
|
+
* The caller books the count as `sdk.drop_reason = "store_full"`; returning it rather
|
|
26
|
+
* than counting in here keeps this module free of the Telemetry instance it would
|
|
27
|
+
* otherwise need a handle on.
|
|
28
|
+
*/
|
|
29
|
+
export declare function encodeFailed(existing: TelemetryEvent[], incoming: TelemetryEvent[]): {
|
|
30
|
+
json: string;
|
|
31
|
+
dropped: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* One drain per sender, however many callers there are (#113).
|
|
35
|
+
*
|
|
36
|
+
* `takeFailed()` clears the key before the send is attempted, so a *single* drain can
|
|
37
|
+
* never double-send. Two concurrent drains can: both read the payload before either
|
|
38
|
+
* removes it, and the recovered batch goes out twice — worst exactly when the network
|
|
39
|
+
* was bad, which is when the data mattered. Returning the in-flight promise makes the
|
|
40
|
+
* second caller a no-op that still awaits the first, and the guard is per-sender rather
|
|
41
|
+
* than per-module so two `Telemetry` instances in one process keep their own.
|
|
42
|
+
*/
|
|
43
|
+
export declare function guardedDrain(drain: () => Promise<void>): () => Promise<void>;
|
|
@@ -4,9 +4,14 @@ export interface FrameAggregate {
|
|
|
4
4
|
"frame.max_ms": number;
|
|
5
5
|
"frame.p95_ms": number;
|
|
6
6
|
"frame.dropped_count": number;
|
|
7
|
-
"frame.
|
|
7
|
+
"frame.target_fps": number;
|
|
8
|
+
"frame.window_duration_ms": number;
|
|
8
9
|
"frame.source": string;
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
|
-
/**
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* `deltas` must be non-empty. Percentile is nearest-rank on the sorted deltas.
|
|
14
|
+
* `windowMs` is the *actual* elapsed window — variable-length since §5.1's view-boundary
|
|
15
|
+
* reset, which is exactly why `frame.window_duration_ms` is required on the wire.
|
|
16
|
+
*/
|
|
17
|
+
export declare function aggregateFrames(deltas: number[], windowMs: number, source: string): FrameAggregate;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All this tracker needs of core. Structural, so it is testable without a `Telemetry`.
|
|
3
|
+
*/
|
|
4
|
+
type FrameEmitter = {
|
|
5
|
+
logMetric(name: string, value: number, data?: Record<string, any>): unknown;
|
|
6
|
+
views: {
|
|
7
|
+
onBoundary(fn: () => unknown): () => void;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare class FrameDropTracker {
|
|
11
|
+
private telemetry;
|
|
12
|
+
private windowMs;
|
|
13
|
+
private lastFrameTime;
|
|
14
|
+
private windowStart;
|
|
15
|
+
private deltas;
|
|
16
|
+
private started;
|
|
17
|
+
constructor(telemetry: FrameEmitter, windowMs?: number);
|
|
18
|
+
/** Idempotent in full: a second call must not start a second rAF loop double-counting frames. */
|
|
19
|
+
start(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Close the open window and ship it. `ViewManager` **awaits** this at a boundary and
|
|
22
|
+
* before the successor mints, which is what lands a route change's dropped frames on the
|
|
23
|
+
* departing `view.id` rather than the arriving one (§5.1).
|
|
24
|
+
*
|
|
25
|
+
* An empty window emits nothing — a p95 over no samples is not a number — but it still
|
|
26
|
+
* resets the clock, so `frame.window_duration_ms` always describes the samples it carries.
|
|
27
|
+
*/
|
|
28
|
+
private emitWindow;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path → route template. `/` stays `/`, no case folding, trailing slash dropped, depth capped
|
|
3
|
+
* at 6 segments with a trailing `/…`. No cardinality guard: a client-side rolling collapse
|
|
4
|
+
* would make one row mean different things on different phones.
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeRoute(path: string): string;
|
|
7
|
+
/** UTF-8 byte length. v3 shipped `String.length` — UTF-16 code units, 2-3× short on non-ASCII. */
|
|
8
|
+
export declare function utf8Bytes(s: string): number;
|
|
9
|
+
/**
|
|
10
|
+
* Body size for every type measurable **without consuming the body**. `FormData` and streams
|
|
11
|
+
* return undefined and the key is omitted — draining a consumer's request body is a far worse
|
|
12
|
+
* bug than a missing key.
|
|
13
|
+
*/
|
|
14
|
+
export declare function requestBodySize(body: unknown): number | undefined;
|
|
15
|
+
/** `content-length` → a response size. Absent or unparseable → undefined, so the key is omitted. */
|
|
16
|
+
export declare function contentLengthSize(header: string | null | undefined): number | undefined;
|
|
17
|
+
/** The #95 invariant, in one place: an `http.request` never describes the collector POST. */
|
|
18
|
+
export declare function isCollectorUrl(url: string, endpoint: string | undefined): boolean;
|
|
1
19
|
export declare function buildHttpAttributes(args: {
|
|
2
20
|
url: string;
|
|
3
21
|
method: string;
|