react-native-inapp-inspector 2.3.25 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/README.md +26 -5
  2. package/dist/commonjs/components/AnalyticsDetail.js +9 -6
  3. package/dist/commonjs/components/AppHeaderLogo.js +4 -6
  4. package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +1 -1
  5. package/dist/commonjs/components/Inspector/AnalyticsTab.js +18 -22
  6. package/dist/commonjs/components/Inspector/ConsoleTab.js +13 -16
  7. package/dist/commonjs/components/Inspector/CrashDetail.js +7 -6
  8. package/dist/commonjs/components/Inspector/CrashTab.js +23 -23
  9. package/dist/commonjs/components/Inspector/DebuggingTab.js +6 -6
  10. package/dist/commonjs/components/Inspector/DeviceInfoTab.js +77 -43
  11. package/dist/commonjs/components/Inspector/FabLauncher.js +8 -9
  12. package/dist/commonjs/components/Inspector/InspectorHeader.js +93 -70
  13. package/dist/commonjs/components/Inspector/LogDetail.js +10 -7
  14. package/dist/commonjs/components/Inspector/MainScreen.js +67 -29
  15. package/dist/commonjs/components/Inspector/NetworkDetail.js +29 -28
  16. package/dist/commonjs/components/Inspector/NetworkFilterModal.js +1 -1
  17. package/dist/commonjs/components/Inspector/NetworkTab.js +87 -85
  18. package/dist/commonjs/components/Inspector/PushCard.d.ts +4 -0
  19. package/dist/commonjs/components/Inspector/PushCard.js +89 -0
  20. package/dist/commonjs/components/Inspector/PushDetail.d.ts +4 -0
  21. package/dist/commonjs/components/Inspector/PushDetail.js +190 -0
  22. package/dist/commonjs/components/Inspector/PushTab.d.ts +3 -0
  23. package/dist/commonjs/components/Inspector/PushTab.js +45 -0
  24. package/dist/commonjs/components/Inspector/ReduxDetail.js +16 -13
  25. package/dist/commonjs/components/Inspector/ReduxTab.js +18 -28
  26. package/dist/commonjs/components/Inspector/SettingsPanel.js +253 -105
  27. package/dist/commonjs/components/Inspector/StorageTab.js +40 -40
  28. package/dist/commonjs/components/Inspector/TabBar.js +9 -8
  29. package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +2 -2
  30. package/dist/commonjs/components/JsonViewer.js +77 -90
  31. package/dist/commonjs/components/LogCard.js +9 -6
  32. package/dist/commonjs/components/ModuleErrorBoundary.d.ts +24 -0
  33. package/dist/commonjs/components/ModuleErrorBoundary.js +33 -0
  34. package/dist/commonjs/components/NetworkIcons.d.ts +3 -3
  35. package/dist/commonjs/components/NetworkIcons.js +10 -6
  36. package/dist/commonjs/components/SegmentedTabs.d.ts +4 -1
  37. package/dist/commonjs/components/SegmentedTabs.js +12 -8
  38. package/dist/commonjs/components/ShareButton.d.ts +11 -0
  39. package/dist/commonjs/components/ShareButton.js +6 -0
  40. package/dist/commonjs/constants/version.d.ts +1 -1
  41. package/dist/commonjs/constants/version.js +1 -1
  42. package/dist/commonjs/customHooks/crashHandler.js +4 -4
  43. package/dist/commonjs/customHooks/networkLogger.js +1 -1
  44. package/dist/commonjs/customHooks/pushNotificationLogger.d.ts +19 -0
  45. package/dist/commonjs/customHooks/pushNotificationLogger.js +1 -0
  46. package/dist/commonjs/helpers/memoryManager.d.ts +2 -1
  47. package/dist/commonjs/helpers/memoryManager.js +1 -1
  48. package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
  49. package/dist/commonjs/helpers/settingsStore.js +1 -1
  50. package/dist/commonjs/helpers/shareFormatter.d.ts +13 -0
  51. package/dist/commonjs/helpers/shareFormatter.js +7 -0
  52. package/dist/commonjs/i18n/locales/en.json +1 -1
  53. package/dist/commonjs/index.d.ts +5 -2
  54. package/dist/commonjs/index.js +4 -4
  55. package/dist/commonjs/push.d.ts +4 -0
  56. package/dist/commonjs/push.js +1 -0
  57. package/dist/commonjs/types/enums.d.ts +30 -0
  58. package/dist/commonjs/types/enums.js +1 -1
  59. package/dist/commonjs/types/index.d.ts +10 -0
  60. package/dist/commonjs/types/interfaces.d.ts +63 -7
  61. package/dist/esm/components/AnalyticsDetail.js +28 -25
  62. package/dist/esm/components/AppHeaderLogo.js +5 -7
  63. package/dist/esm/components/Inspector/AnalyticsFilterModal.js +14 -14
  64. package/dist/esm/components/Inspector/AnalyticsTab.js +36 -40
  65. package/dist/esm/components/Inspector/ConsoleTab.js +52 -55
  66. package/dist/esm/components/Inspector/CrashDetail.js +11 -10
  67. package/dist/esm/components/Inspector/CrashTab.js +23 -23
  68. package/dist/esm/components/Inspector/DebuggingTab.js +10 -10
  69. package/dist/esm/components/Inspector/DeviceInfoTab.js +208 -174
  70. package/dist/esm/components/Inspector/FabLauncher.js +41 -42
  71. package/dist/esm/components/Inspector/InspectorHeader.js +138 -115
  72. package/dist/esm/components/Inspector/LogDetail.js +24 -21
  73. package/dist/esm/components/Inspector/MainScreen.js +100 -62
  74. package/dist/esm/components/Inspector/NetworkDetail.js +88 -87
  75. package/dist/esm/components/Inspector/NetworkFilterModal.js +8 -8
  76. package/dist/esm/components/Inspector/NetworkTab.js +136 -134
  77. package/dist/esm/components/Inspector/PushCard.d.ts +4 -0
  78. package/dist/esm/components/Inspector/PushCard.js +89 -0
  79. package/dist/esm/components/Inspector/PushDetail.d.ts +4 -0
  80. package/dist/esm/components/Inspector/PushDetail.js +190 -0
  81. package/dist/esm/components/Inspector/PushTab.d.ts +3 -0
  82. package/dist/esm/components/Inspector/PushTab.js +45 -0
  83. package/dist/esm/components/Inspector/ReduxDetail.js +40 -37
  84. package/dist/esm/components/Inspector/ReduxTab.js +109 -119
  85. package/dist/esm/components/Inspector/SettingsPanel.js +406 -258
  86. package/dist/esm/components/Inspector/StorageTab.js +174 -174
  87. package/dist/esm/components/Inspector/TabBar.js +28 -27
  88. package/dist/esm/components/Inspector/UpdateAvailableModal.js +1 -1
  89. package/dist/esm/components/JsonViewer.js +101 -114
  90. package/dist/esm/components/LogCard.js +25 -22
  91. package/dist/esm/components/ModuleErrorBoundary.d.ts +24 -0
  92. package/dist/esm/components/ModuleErrorBoundary.js +33 -0
  93. package/dist/esm/components/NetworkIcons.d.ts +3 -3
  94. package/dist/esm/components/NetworkIcons.js +7 -3
  95. package/dist/esm/components/SegmentedTabs.d.ts +4 -1
  96. package/dist/esm/components/SegmentedTabs.js +12 -8
  97. package/dist/esm/components/ShareButton.d.ts +11 -0
  98. package/dist/esm/components/ShareButton.js +6 -0
  99. package/dist/esm/constants/version.d.ts +1 -1
  100. package/dist/esm/constants/version.js +1 -1
  101. package/dist/esm/customHooks/crashHandler.js +6 -6
  102. package/dist/esm/customHooks/networkLogger.js +1 -1
  103. package/dist/esm/customHooks/pushNotificationLogger.d.ts +19 -0
  104. package/dist/esm/customHooks/pushNotificationLogger.js +1 -0
  105. package/dist/esm/helpers/memoryManager.d.ts +2 -1
  106. package/dist/esm/helpers/memoryManager.js +1 -1
  107. package/dist/esm/helpers/settingsStore.d.ts +1 -0
  108. package/dist/esm/helpers/settingsStore.js +1 -1
  109. package/dist/esm/helpers/shareFormatter.d.ts +13 -0
  110. package/dist/esm/helpers/shareFormatter.js +7 -0
  111. package/dist/esm/i18n/locales/en.json +1 -1
  112. package/dist/esm/index.d.ts +5 -2
  113. package/dist/esm/index.js +7 -7
  114. package/dist/esm/push.d.ts +4 -0
  115. package/dist/esm/push.js +1 -0
  116. package/dist/esm/types/enums.d.ts +30 -0
  117. package/dist/esm/types/enums.js +1 -1
  118. package/dist/esm/types/index.d.ts +10 -0
  119. package/dist/esm/types/interfaces.d.ts +63 -7
  120. package/package.json +53 -10
  121. package/src/native/NativeInspector.ts +0 -1
  122. package/dist/commonjs/components/BrandSquareIcon.d.ts +0 -5
  123. package/dist/commonjs/components/BrandSquareIcon.js +0 -112
  124. package/dist/esm/components/BrandSquareIcon.d.ts +0 -5
  125. package/dist/esm/components/BrandSquareIcon.js +0 -112
@@ -12,7 +12,10 @@ interface SegmentedTabsProps {
12
12
  activeKey: string;
13
13
  onChange: (key: string) => void;
14
14
  style?: ViewStyle | ViewStyle[];
15
+ scrollable?: boolean;
15
16
  }
16
17
  export declare const DEFAULT_INNER_TAB_THEMES: Record<string, string>;
17
- declare const SegmentedTabs: React.MemoExoticComponent<({ tabs, activeKey, onChange, style }: SegmentedTabsProps) => React.JSX.Element>;
18
+ declare const SegmentedTabs: React.MemoExoticComponent<({ tabs, activeKey, onChange, style, scrollable }: SegmentedTabsProps & {
19
+ scrollable?: boolean;
20
+ }) => React.JSX.Element>;
18
21
  export default SegmentedTabs;
@@ -1,8 +1,12 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_INNER_TAB_THEMES=void 0;const react_1=__importDefault(require("react")),react_native_1=require("react-native"),AppColors_1=require("../styles/AppColors"),AppFonts_1=require("../styles/AppFonts");exports.DEFAULT_INNER_TAB_THEMES={metadata:AppColors_1.AppColors.sky600,headers:AppColors_1.AppColors.teal600,request:AppColors_1.AppColors.amber600,response:AppColors_1.AppColors.brandPurple,req:AppColors_1.AppColors.amber600,res:AppColors_1.AppColors.brandPurple,output:AppColors_1.AppColors.teal600,arguments:AppColors_1.AppColors.amber600,stack:AppColors_1.AppColors.errorColor,caller:AppColors_1.AppColors.sky600,error:AppColors_1.AppColors.errorColor,app:AppColors_1.AppColors.green600,all:AppColors_1.AppColors.brandPurple,live:AppColors_1.AppColors.violet600,timeline:AppColors_1.AppColors.orange600,persisted:AppColors_1.AppColors.teal600,payload:AppColors_1.AppColors.violet600,diff:AppColors_1.AppColors.green600,raw:AppColors_1.AppColors.slate600,diagnostics:AppColors_1.AppColors.amber600,breadcrumbs:AppColors_1.AppColors.orange600,overview:AppColors_1.AppColors.sky600,json:AppColors_1.AppColors.brandPurple,tree:AppColors_1.AppColors.violet600,pretty:AppColors_1.AppColors.brandPurple,table:AppColors_1.AppColors.teal600,production:AppColors_1.AppColors.brandPurple,files:AppColors_1.AppColors.teal600,packages:AppColors_1.AppColors.orange600,media:AppColors_1.AppColors.pink600,optimizer:AppColors_1.AppColors.violet600,hardware:AppColors_1.AppColors.orange600,network:AppColors_1.AppColors.teal600,display:AppColors_1.AppColors.pink600,runtime:AppColors_1.AppColors.amber600,security:AppColors_1.AppColors.errorColor,fatal:AppColors_1.AppColors.errorColor,promise:AppColors_1.AppColors.orange600,render:AppColors_1.AppColors.pink600,native:AppColors_1.AppColors.cyan600,js:AppColors_1.AppColors.amber600,asyncStorage:AppColors_1.AppColors.brandPurple,mmkv:AppColors_1.AppColors.teal600};const SegmentedTabs=react_1.default.memo(({tabs:r,activeKey:l,onChange:s,style:t})=><react_native_1.View style={[{flexDirection:"row",borderRadius:10,backgroundColor:`${AppColors_1.AppColors.slate200}80`,padding:3,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,gap:3,minWidth:0},t]}>
2
- {r.map(o=>{const e=l===o.key,p=o.themeColor||o.color||exports.DEFAULT_INNER_TAB_THEMES[o.key]||AppColors_1.AppColors.brandPurple;return<react_native_1.Pressable key={o.key}onPress={()=>s(o.key)}style={({pressed:a})=>[{flex:1,paddingVertical:7,paddingHorizontal:6,borderRadius:7,backgroundColor:e?p:"transparent",alignItems:"center",justifyContent:"center",gap:4.5,flexDirection:"row",opacity:a?.8:1},e&&{shadowColor:p,shadowOffset:{width:0,height:1},shadowOpacity:.28,shadowRadius:3,elevation:2}]}>
3
- {o.icon?typeof o.icon=="function"?o.icon(e,p):o.icon:null}
4
- <react_native_1.Text numberOfLines={1}ellipsizeMode="tail"style={{flexShrink:1,fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5,color:e?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText,letterSpacing:.2}}>
5
- {o.label}
6
- </react_native_1.Text>
7
- </react_native_1.Pressable>})}
8
- </react_native_1.View>);exports.default=SegmentedTabs;
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_INNER_TAB_THEMES=void 0;const react_1=__importDefault(require("react")),react_native_1=require("react-native"),AppColors_1=require("../styles/AppColors"),AppFonts_1=require("../styles/AppFonts");exports.DEFAULT_INNER_TAB_THEMES={metadata:AppColors_1.AppColors.sky600,headers:AppColors_1.AppColors.teal600,request:AppColors_1.AppColors.amber600,response:AppColors_1.AppColors.brandPurple,req:AppColors_1.AppColors.amber600,res:AppColors_1.AppColors.brandPurple,output:AppColors_1.AppColors.teal600,arguments:AppColors_1.AppColors.amber600,stack:AppColors_1.AppColors.errorColor,caller:AppColors_1.AppColors.sky600,error:AppColors_1.AppColors.errorColor,app:AppColors_1.AppColors.green600,all:AppColors_1.AppColors.brandPurple,live:AppColors_1.AppColors.violet600,timeline:AppColors_1.AppColors.orange600,persisted:AppColors_1.AppColors.teal600,payload:AppColors_1.AppColors.violet600,diff:AppColors_1.AppColors.green600,raw:AppColors_1.AppColors.brandPurple,diagnostics:AppColors_1.AppColors.amber600,breadcrumbs:AppColors_1.AppColors.orange600,overview:AppColors_1.AppColors.sky600,json:AppColors_1.AppColors.brandPurple,tree:AppColors_1.AppColors.violet600,preview:AppColors_1.AppColors.brandPurple,delivery:AppColors_1.AppColors.amber600,domainAttrs:AppColors_1.AppColors.sky600,pretty:AppColors_1.AppColors.violet600,table:AppColors_1.AppColors.teal600,production:AppColors_1.AppColors.brandPurple,files:AppColors_1.AppColors.teal600,packages:AppColors_1.AppColors.orange600,media:AppColors_1.AppColors.pink600,optimizer:AppColors_1.AppColors.violet600,hardware:AppColors_1.AppColors.orange600,network:AppColors_1.AppColors.teal600,display:AppColors_1.AppColors.pink600,runtime:AppColors_1.AppColors.amber600,security:AppColors_1.AppColors.errorColor,fatal:AppColors_1.AppColors.errorColor,promise:AppColors_1.AppColors.orange600,render:AppColors_1.AppColors.pink600,native:AppColors_1.AppColors.cyan600,js:AppColors_1.AppColors.amber600,asyncStorage:AppColors_1.AppColors.brandPurple,mmkv:AppColors_1.AppColors.teal600};const SegmentedTabs=react_1.default.memo(({tabs:r,activeKey:a,onChange:i,style:s,scrollable:p})=>{const t=r.map(o=>{const e=a===o.key,l=o.themeColor||o.color||exports.DEFAULT_INNER_TAB_THEMES[o.key]||AppColors_1.AppColors.brandPurple;return<react_native_1.Pressable key={o.key}onPress={()=>i(o.key)}style={({pressed:n})=>[{flex:p?void 0:1,paddingVertical:7,paddingHorizontal:p?12:6,borderRadius:7,backgroundColor:e?l:"transparent",alignItems:"center",justifyContent:"center",gap:4.5,flexDirection:"row",opacity:n?.8:1},e&&{shadowColor:l,shadowOffset:{width:0,height:1},shadowOpacity:.28,shadowRadius:3,elevation:2}]}>
2
+ {o.icon?typeof o.icon=="function"?o.icon(e,l):o.icon:null}
3
+ <react_native_1.Text numberOfLines={1}style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5,color:e?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText,letterSpacing:.2}}>
4
+ {o.label}
5
+ </react_native_1.Text>
6
+ </react_native_1.Pressable>});return p?<react_native_1.View style={[{borderRadius:10,backgroundColor:`${AppColors_1.AppColors.slate200}80`,padding:3,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor},s]}>
7
+ <react_native_1.ScrollView horizontal showsHorizontalScrollIndicator={!1}contentContainerStyle={{flexDirection:"row",alignItems:"center",gap:4}}>
8
+ {t}
9
+ </react_native_1.ScrollView>
10
+ </react_native_1.View>:<react_native_1.View style={[{flexDirection:"row",borderRadius:10,backgroundColor:`${AppColors_1.AppColors.slate200}80`,padding:3,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,gap:3,minWidth:0},s]}>
11
+ {t}
12
+ </react_native_1.View>});exports.default=SegmentedTabs;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ export interface ShareButtonProps {
4
+ onShare: () => void | Promise<void>;
5
+ label?: string;
6
+ style?: StyleProp<ViewStyle>;
7
+ color?: string;
8
+ size?: number;
9
+ }
10
+ declare const ShareButton: React.MemoExoticComponent<({ onShare, label, style, color, size, }: ShareButtonProps) => React.JSX.Element>;
11
+ export default ShareButton;
@@ -0,0 +1,6 @@
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,a,t){t===void 0&&(t=a);var n=Object.getOwnPropertyDescriptor(e,a);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[a]}}),Object.defineProperty(r,t,n)}):(function(r,e,a,t){t===void 0&&(t=a),r[t]=e[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),__importStar=this&&this.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(a){var t=[];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[t.length]=n);return t},r(e)};return function(e){if(e&&e.__esModule)return e;var a={};if(e!=null)for(var t=r(e),n=0;n<t.length;n++)t[n]!=="default"&&__createBinding(a,e,t[n]);return __setModuleDefault(a,e),a}})(),__importDefault=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),TouchableScale_1=__importDefault(require("./TouchableScale")),NetworkIcons_1=require("./NetworkIcons"),NativeInspector_1=require("../native/NativeInspector"),AppColors_1=require("../styles/AppColors"),styles_1=__importDefault(require("../styles")),ShareButton=react_1.default.memo(({onShare:r,label:e,style:a,color:t=AppColors_1.AppColors.brandPurple,size:n=14})=>{const[o,i]=(0,react_1.useState)(!1),s=(0,react_1.useCallback)(async()=>{try{(0,NativeInspector_1.triggerNativeHaptic)("medium"),await r(),i(!0),setTimeout(()=>i(!1),1200)}catch{}},[r]),u=[styles_1.default.iconSquareBtn,{backgroundColor:`${t}14`,borderColor:`${t}30`},o&&styles_1.default.iconSquareBtnSuccess,a];return<TouchableScale_1.default accessible={!0}accessibilityRole="button"accessibilityLabel={`Share ${e}`}accessibilityHint={`Opens native share sheet to export ${e}`}style={u}onPress={s}hitSlop={8}>
2
+ {o?<NetworkIcons_1.CheckIcon color={AppColors_1.AppColors.greenColor}size={n}strokeWidth={2.4}/>:<NetworkIcons_1.ShareIcon color={t}size={n}/>}
3
+ {e?<react_native_1.Text style={[styles_1.default.iconSquareBtnText,{color:o?AppColors_1.AppColors.greenColor:t}]}>
4
+ {o?"Shared":e}
5
+ </react_native_1.Text>:null}
6
+ </TouchableScale_1.default>});ShareButton.displayName="ShareButton",exports.default=ShareButton;
@@ -1 +1 @@
1
- export declare const LIB_VERSION = "2.3.25";
1
+ export declare const LIB_VERSION = "2.4.1";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=void 0,exports.LIB_VERSION="2.3.25";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LIB_VERSION=void 0,exports.LIB_VERSION="2.4.1";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setupGlobalCrashHandler=exports.exportCrashReport=exports.simulateTestCrash=exports.recordCustomCrash=exports.handleInterceptedCrash=exports.emitCrashEvent=exports.subscribeCrashEvents=exports.clearCrashRecords=exports.getCrashRecords=exports.computeCrashFingerprint=exports.parseCrashStackTrace=exports.getCrashBreadcrumbs=exports.clearCrashBreadcrumbs=exports.recordUserActionBreadcrumb=exports.recordReduxBreadcrumb=exports.recordNetworkBreadcrumb=exports.recordNavigationBreadcrumb=exports.addCrashBreadcrumb=exports.pruneCrashRecords=exports.getMaxCrashLogsLimit=exports.setMaxCrashLogsLimit=exports.getCrashModuleEnabled=exports.setCrashModuleEnabled=exports.CrashExportFormat=void 0;const react_native_1=require("react-native"),enums_1=require("../types/enums");Object.defineProperty(exports,"CrashExportFormat",{enumerable:!0,get:function(){return enums_1.CrashExportFormat}});const consoleLogger_1=require("./consoleLogger"),NativeInspector_1=require("../native/NativeInspector"),i18n_1=require("../i18n");let crashListeners=[],isCrashHandlerInitialized=!1,lastHandledErrorTimestamp=0,crashRecordsStore=[],breadcrumbsStore=[];const MAX_BREADCRUMBS=50;let maxStoredCrashes=100;const appStartTime=Date.now();let isCrashModuleEnabled=!1;const setCrashModuleEnabled=e=>{isCrashModuleEnabled=e};exports.setCrashModuleEnabled=setCrashModuleEnabled;const getCrashModuleEnabled=()=>isCrashModuleEnabled;exports.getCrashModuleEnabled=getCrashModuleEnabled;const setMaxCrashLogsLimit=e=>{maxStoredCrashes=Math.max(10,e),crashRecordsStore.length>maxStoredCrashes&&(crashRecordsStore=crashRecordsStore.slice(0,maxStoredCrashes))};exports.setMaxCrashLogsLimit=setMaxCrashLogsLimit;const getMaxCrashLogsLimit=()=>maxStoredCrashes;exports.getMaxCrashLogsLimit=getMaxCrashLogsLimit;const pruneCrashRecords=e=>{const t=e!==void 0?Math.max(0,e):Math.floor(crashRecordsStore.length/2),o=crashRecordsStore.length-t;return o>0&&(crashRecordsStore=crashRecordsStore.slice(0,t)),breadcrumbsStore.length>20&&(breadcrumbsStore=breadcrumbsStore.slice(0,20)),Math.max(0,o)};exports.pruneCrashRecords=pruneCrashRecords;const addCrashBreadcrumb=(e,t,o)=>{if(isCrashModuleEnabled)try{const s={type:e,message:t,timestamp:Date.now(),data:o};breadcrumbsStore.unshift(s),breadcrumbsStore.length>MAX_BREADCRUMBS&&(breadcrumbsStore=breadcrumbsStore.slice(0,MAX_BREADCRUMBS))}catch{}};exports.addCrashBreadcrumb=addCrashBreadcrumb;const recordNavigationBreadcrumb=(e,t)=>{(0,exports.addCrashBreadcrumb)("navigation",(0,i18n_1.t)("crash.breadcrumbNavigation",{from:e||"/",to:t||"/"}),{from:e,to:t})};exports.recordNavigationBreadcrumb=recordNavigationBreadcrumb;const recordNetworkBreadcrumb=(e,t,o,s)=>{const r=o!=null?` [${o}]`:"",a=s!=null?` (${Math.round(s)}ms)`:"";(0,exports.addCrashBreadcrumb)("network",`${t.toUpperCase()} ${e}${r}${a}`,{url:e,method:t,status:o,duration:s})};exports.recordNetworkBreadcrumb=recordNetworkBreadcrumb;const recordReduxBreadcrumb=(e,t)=>{(0,exports.addCrashBreadcrumb)("redux",(0,i18n_1.t)("crash.breadcrumbAction",{actionType:e}),{type:e,payloadSummary:typeof t=="object"&&t!==null?Object.keys(t):typeof t})};exports.recordReduxBreadcrumb=recordReduxBreadcrumb;const recordUserActionBreadcrumb=(e,t)=>{(0,exports.addCrashBreadcrumb)("user",e,t)};exports.recordUserActionBreadcrumb=recordUserActionBreadcrumb;const clearCrashBreadcrumbs=()=>{breadcrumbsStore=[]};exports.clearCrashBreadcrumbs=clearCrashBreadcrumbs;const getCrashBreadcrumbs=()=>[...breadcrumbsStore];exports.getCrashBreadcrumbs=getCrashBreadcrumbs;const parseCrashStackTrace=e=>{if(!e||typeof e!="string")return[];const t=e.split(`
2
- `),o=[];for(const s of t){const r=s.trim();if(!r||r.includes("crashHandler.ts")||r.includes("handleInterceptedCrash")||r.includes("addLogFromCrash")||r.includes("setupGlobalCrashHandler"))continue;const a=r.match(/^([^@]+)@(.*):(\d+):(\d+)$/);if(a){const[,c,n,p,d]=a,m=n.split("?")[0].split("/").pop()||n,f=!n.includes("node_modules")&&!n.includes("react-native")&&!n.includes("react-dom")&&!n.includes("hermes")&&!n.includes("internal");o.push({method:c.trim(),file:m,lineNumber:parseInt(p,10),column:parseInt(d,10),raw:r,isAppCode:f});continue}const u=r.match(/^at\s+(.+)\s+\((.+):(\d+):(\d+)\)$/);if(u){const[,c,n,p,d]=u,m=n.split("?")[0].split("/").pop()||n,f=!n.includes("node_modules")&&!n.includes("react-native")&&!n.includes("react-dom")&&!n.includes("internal");o.push({method:c.trim(),file:m,lineNumber:parseInt(p,10),column:parseInt(d,10),raw:r,isAppCode:f});continue}const l=r.match(/^at\s+(.+):(\d+):(\d+)$/);if(l){const[,c,n,p]=l,d=c.split("?")[0].split("/").pop()||c,m=!c.includes("node_modules")&&!c.includes("react-native");o.push({method:"<anonymous>",file:d,lineNumber:parseInt(n,10),column:parseInt(p,10),raw:r,isAppCode:m});continue}const h=r.match(/^at\s+([a-zA-Z0-9_$.]+)\(([a-zA-Z0-9_$]+\.java):(\d+)\)$/);if(h){const[,c,n,p]=h,d=!c.startsWith("com.facebook.react")&&!c.startsWith("android.");o.push({method:c,file:n,lineNumber:parseInt(p,10),column:0,raw:r,isAppCode:d});continue}const i=r.match(/^\d+\s+([^\s]+)\s+(0x[0-9a-fA-F]+)\s+(.+)$/);if(i){const[,c,n,p]=i,d=!c.startsWith("lib")&&!c.startsWith("Core")&&!c.startsWith("React");o.push({method:p,file:c,lineNumber:0,column:0,raw:r,isAppCode:d});continue}o.push({method:r.startsWith("at ")?r.slice(3):r,file:"runtime",lineNumber:0,column:0,raw:r,isAppCode:!1})}return o};exports.parseCrashStackTrace=parseCrashStackTrace;const getMemoryDiagnostics=()=>{try{const e=globalThis.performance;if(e&&e.memory)return{usedJSHeapSize:Math.round(e.memory.usedJSHeapSize/(1024*1024)),totalJSHeapSize:Math.round(e.memory.totalJSHeapSize/(1024*1024))}}catch{}},getScreenDimensions=()=>{try{const e=react_native_1.Dimensions.get("window");return`${Math.round(e.width)}x${Math.round(e.height)} (${e.scale}x)`}catch{return(0,i18n_1.t)("crash.unknown")}},computeCrashFingerprint=e=>{const t=e.type||"js",o=e.name||"Error",s=e.parsedStack&&e.parsedStack.length>0?e.parsedStack[0]:null,r=s?`${s.file}:${s.lineNumber}`:"unknown";return`${t}_${o}_${r}`};exports.computeCrashFingerprint=computeCrashFingerprint;const getCrashRecords=()=>[...crashRecordsStore];exports.getCrashRecords=getCrashRecords;const clearCrashRecords=()=>{crashRecordsStore=[],(0,exports.emitCrashEvent)({error:null,message:"__CLEARED__",timestamp:Date.now()})};exports.clearCrashRecords=clearCrashRecords;const subscribeCrashEvents=e=>(crashListeners.push(e),()=>{crashListeners=crashListeners.filter(t=>t!==e)});exports.subscribeCrashEvents=subscribeCrashEvents;const emitCrashEvent=e=>{if(e.message!=="__CLEARED__"){const t=Date.now();if(t-lastHandledErrorTimestamp<250)return;lastHandledErrorTimestamp=t}crashListeners.forEach(t=>{try{t(e)}catch{}})};exports.emitCrashEvent=emitCrashEvent;const handleInterceptedCrash=(e,t,o=!1,s,r)=>{try{const a=e instanceof Error||typeof e=="object"&&e!==null?e:new Error(String(e||(0,i18n_1.t)("crash.runtimeException"))),u=a.message||(typeof e=="string"?e:(0,i18n_1.t)("crash.runtimeException"));let l="";typeof t=="string"?l=t:Array.isArray(t)?l=t.map(g=>`at ${g.methodName||"<anonymous>"} (${g.file||"unknown"}:${g.lineNumber||0}:${g.column||0})`).join(`
3
- `):l=a.stack||new Error().stack||"";let h=s||enums_1.CrashType.Js;const i=u.toLowerCase();s||(i.includes("native")||i.includes("sigsegv")||i.includes("nsrange")||i.includes("nullpointerexception")||i.includes("fatal signal")?h=enums_1.CrashType.Native:i.includes("promise")||i.includes("unhandled rejection")||i.includes("unhandledrejection")?h=enums_1.CrashType.Promise:i.includes("render")||i.includes("errorboundary")||r?h=enums_1.CrashType.Render:h=enums_1.CrashType.Js);const c=new Date,n=c.toLocaleDateString(),p=c.toLocaleTimeString(),d=(0,exports.parseCrashStackTrace)(l),m=(0,consoleLogger_1.addLogFromCrash)(a,`[${o?(0,i18n_1.t)("crash.logFatalCrash"):(0,i18n_1.t)("crash.logUnhandledError")}] ${u}`,l,o),f=typeof globalThis.HermesInternal<"u",x=typeof globalThis.nativeFabricUIManager<"u",C={id:`crash_${Date.now()}_${Math.random().toString(36).substr(2,6)}`,error:a,isFatal:o,type:h,message:u,name:a.name||(o?(0,i18n_1.t)("crash.errorNameFatal"):(0,i18n_1.t)("crash.errorNameUnhandled")),stack:l,parsedStack:d,componentStack:r||void 0,timestamp:Date.now(),dateStr:n,timeStr:p,deviceInfo:{platform:react_native_1.Platform.OS,osVersion:String(react_native_1.Platform.Version),rnVersion:react_native_1.Platform.constants?.reactNativeVersion?`${react_native_1.Platform.constants.reactNativeVersion.major}.${react_native_1.Platform.constants.reactNativeVersion.minor}.${react_native_1.Platform.constants.reactNativeVersion.patch}`:(0,i18n_1.t)("crash.unknown"),isHermes:f,isFabric:x,appState:react_native_1.AppState.currentState||"active"},memoryInfo:getMemoryDiagnostics(),breadcrumbs:[...breadcrumbsStore],logId:m?.id};crashRecordsStore.unshift(C),crashRecordsStore.length>maxStoredCrashes&&(crashRecordsStore=crashRecordsStore.slice(0,maxStoredCrashes)),(0,exports.emitCrashEvent)({error:a,isFatal:o,message:`[${o?(0,i18n_1.t)("crash.logFatalCrash"):(0,i18n_1.t)("crash.logUnhandledError")}] ${u}`,stack:l,timestamp:Date.now(),logId:m?.id,crashRecord:C});try{(0,NativeInspector_1.showNativeFloatingButton)(),(0,NativeInspector_1.setNativeFloatingButtonBadge)(!0)}catch{}return C}catch{return{id:`crash_${Date.now()}`,isFatal:!0,type:enums_1.CrashType.Js,message:String(e||(0,i18n_1.t)("crash.unknownException")),timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()}}};exports.handleInterceptedCrash=handleInterceptedCrash;const recordCustomCrash=(e,t)=>(0,exports.handleInterceptedCrash)(e,typeof e=="object"?e.stack:void 0,t?.isFatal??!1,t?.type||enums_1.CrashType.Custom,t?.componentStack);exports.recordCustomCrash=recordCustomCrash;const simulateTestCrash=(e=enums_1.CrashType.Js,t,o)=>{const s=new Error(t||_defaultSimMessage(e));return(0,exports.handleInterceptedCrash)(e===enums_1.CrashType.Native?s.message:s,o||s.stack,e===enums_1.CrashType.Native,e,e===enums_1.CrashType.Render?_buildComponentStack():void 0)};exports.simulateTestCrash=simulateTestCrash;const _defaultSimMessage=e=>{switch(e){case"native":return(0,i18n_1.t)("crash.simNativeMessage");case"promise":return(0,i18n_1.t)("crash.simPromiseMessage");case"render":return(0,i18n_1.t)("crash.simRenderMessage");default:return(0,i18n_1.t)("crash.simJsMessage")}},_buildComponentStack=()=>{try{const e=new Error;if(e.stack)return e.stack.split(`
2
+ `),o=[];for(const s of t){const r=s.trim();if(!r||r.includes("crashHandler.ts")||r.includes("handleInterceptedCrash")||r.includes("addLogFromCrash")||r.includes("setupGlobalCrashHandler"))continue;const a=r.match(/^([^@]+)@(.*):(\d+):(\d+)$/);if(a){const[,c,n,p,l]=a,m=n.split("?")[0].split("/").pop()||n,f=!n.includes("node_modules")&&!n.includes("react-native")&&!n.includes("react-dom")&&!n.includes("hermes")&&!n.includes("internal");o.push({method:c.trim(),file:m,lineNumber:parseInt(p,10),column:parseInt(l,10),raw:r,isAppCode:f});continue}const d=r.match(/^at\s+(.+)\s+\((.+):(\d+):(\d+)\)$/);if(d){const[,c,n,p,l]=d,m=n.split("?")[0].split("/").pop()||n,f=!n.includes("node_modules")&&!n.includes("react-native")&&!n.includes("react-dom")&&!n.includes("internal");o.push({method:c.trim(),file:m,lineNumber:parseInt(p,10),column:parseInt(l,10),raw:r,isAppCode:f});continue}const u=r.match(/^at\s+(.+):(\d+):(\d+)$/);if(u){const[,c,n,p]=u,l=c.split("?")[0].split("/").pop()||c,m=!c.includes("node_modules")&&!c.includes("react-native");o.push({method:"<anonymous>",file:l,lineNumber:parseInt(n,10),column:parseInt(p,10),raw:r,isAppCode:m});continue}const h=r.match(/^at\s+([a-zA-Z0-9_$.]+)\(([a-zA-Z0-9_$]+\.java):(\d+)\)$/);if(h){const[,c,n,p]=h,l=!c.startsWith("com.facebook.react")&&!c.startsWith("android.");o.push({method:c,file:n,lineNumber:parseInt(p,10),column:0,raw:r,isAppCode:l});continue}const i=r.match(/^\d+\s+([^\s]+)\s+(0x[0-9a-fA-F]+)\s+(.+)$/);if(i){const[,c,,n]=i,p=!c.startsWith("lib")&&!c.startsWith("Core")&&!c.startsWith("React");o.push({method:n,file:c,lineNumber:0,column:0,raw:r,isAppCode:p});continue}o.push({method:r.startsWith("at ")?r.slice(3):r,file:"runtime",lineNumber:0,column:0,raw:r,isAppCode:!1})}return o};exports.parseCrashStackTrace=parseCrashStackTrace;const getMemoryDiagnostics=()=>{try{const e=globalThis.performance;if(e&&e.memory)return{usedJSHeapSize:Math.round(e.memory.usedJSHeapSize/(1024*1024)),totalJSHeapSize:Math.round(e.memory.totalJSHeapSize/(1024*1024))}}catch{}},getScreenDimensions=()=>{try{const e=react_native_1.Dimensions.get("window");return`${Math.round(e.width)}x${Math.round(e.height)} (${e.scale}x)`}catch{return(0,i18n_1.t)("crash.unknown")}},computeCrashFingerprint=e=>{const t=e.type||"js",o=e.name||"Error",s=e.parsedStack&&e.parsedStack.length>0?e.parsedStack[0]:null,r=s?`${s.file}:${s.lineNumber}`:"unknown";return`${t}_${o}_${r}`};exports.computeCrashFingerprint=computeCrashFingerprint;const getCrashRecords=()=>[...crashRecordsStore];exports.getCrashRecords=getCrashRecords;const clearCrashRecords=()=>{crashRecordsStore=[],(0,exports.emitCrashEvent)({error:null,message:"__CLEARED__",timestamp:Date.now()})};exports.clearCrashRecords=clearCrashRecords;const subscribeCrashEvents=e=>(crashListeners.push(e),()=>{crashListeners=crashListeners.filter(t=>t!==e)});exports.subscribeCrashEvents=subscribeCrashEvents;const emitCrashEvent=e=>{if(e.message!=="__CLEARED__"){const t=Date.now();if(t-lastHandledErrorTimestamp<250)return;lastHandledErrorTimestamp=t}crashListeners.forEach(t=>{try{t(e)}catch{}})};exports.emitCrashEvent=emitCrashEvent;const handleInterceptedCrash=(e,t,o=!1,s,r)=>{try{const a=e instanceof Error||typeof e=="object"&&e!==null?e:new Error(String(e||(0,i18n_1.t)("crash.runtimeException"))),d=a.message||(typeof e=="string"?e:(0,i18n_1.t)("crash.runtimeException"));let u="";typeof t=="string"?u=t:Array.isArray(t)?u=t.map(g=>`at ${g.methodName||"<anonymous>"} (${g.file||"unknown"}:${g.lineNumber||0}:${g.column||0})`).join(`
3
+ `):u=a.stack||new Error().stack||"";let h=s||enums_1.CrashType.Js;const i=d.toLowerCase();s||(i.includes("native")||i.includes("sigsegv")||i.includes("nsrange")||i.includes("nullpointerexception")||i.includes("fatal signal")?h=enums_1.CrashType.Native:i.includes("promise")||i.includes("unhandled rejection")||i.includes("unhandledrejection")?h=enums_1.CrashType.Promise:i.includes("render")||i.includes("errorboundary")||r?h=enums_1.CrashType.Render:h=enums_1.CrashType.Js);const c=new Date,n=c.toLocaleDateString(),p=c.toLocaleTimeString(),l=(0,exports.parseCrashStackTrace)(u),m=(0,consoleLogger_1.addLogFromCrash)(a,`[${o?(0,i18n_1.t)("crash.logFatalCrash"):(0,i18n_1.t)("crash.logUnhandledError")}] ${d}`,u,o),f=typeof globalThis.HermesInternal<"u",x=typeof globalThis.nativeFabricUIManager<"u",C={id:`crash_${Date.now()}_${Math.random().toString(36).substr(2,6)}`,error:a,isFatal:o,type:h,message:d,name:a.name||(o?(0,i18n_1.t)("crash.errorNameFatal"):(0,i18n_1.t)("crash.errorNameUnhandled")),stack:u,parsedStack:l,componentStack:r||void 0,timestamp:Date.now(),dateStr:n,timeStr:p,deviceInfo:{platform:react_native_1.Platform.OS,osVersion:String(react_native_1.Platform.Version),rnVersion:react_native_1.Platform.constants?.reactNativeVersion?`${react_native_1.Platform.constants.reactNativeVersion.major}.${react_native_1.Platform.constants.reactNativeVersion.minor}.${react_native_1.Platform.constants.reactNativeVersion.patch}`:(0,i18n_1.t)("crash.unknown"),isHermes:f,isFabric:x,appState:react_native_1.AppState.currentState||"active"},memoryInfo:getMemoryDiagnostics(),breadcrumbs:[...breadcrumbsStore],logId:m?.id};crashRecordsStore.unshift(C),crashRecordsStore.length>maxStoredCrashes&&(crashRecordsStore=crashRecordsStore.slice(0,maxStoredCrashes)),(0,exports.emitCrashEvent)({error:a,isFatal:o,message:`[${o?(0,i18n_1.t)("crash.logFatalCrash"):(0,i18n_1.t)("crash.logUnhandledError")}] ${d}`,stack:u,timestamp:Date.now(),logId:m?.id,crashRecord:C});try{(0,NativeInspector_1.showNativeFloatingButton)(),(0,NativeInspector_1.setNativeFloatingButtonBadge)(!0)}catch{}return C}catch{return{id:`crash_${Date.now()}`,isFatal:!0,type:enums_1.CrashType.Js,message:String(e||(0,i18n_1.t)("crash.unknownException")),timestamp:Date.now(),dateStr:new Date().toLocaleDateString(),timeStr:new Date().toLocaleTimeString()}}};exports.handleInterceptedCrash=handleInterceptedCrash;const recordCustomCrash=(e,t)=>(0,exports.handleInterceptedCrash)(e,typeof e=="object"?e.stack:void 0,t?.isFatal??!1,t?.type||enums_1.CrashType.Custom,t?.componentStack);exports.recordCustomCrash=recordCustomCrash;const simulateTestCrash=(e=enums_1.CrashType.Js,t,o)=>{const s=new Error(t||_defaultSimMessage(e));return(0,exports.handleInterceptedCrash)(e===enums_1.CrashType.Native?s.message:s,o||s.stack,e===enums_1.CrashType.Native,e,e===enums_1.CrashType.Render?_buildComponentStack():void 0)};exports.simulateTestCrash=simulateTestCrash;const _defaultSimMessage=e=>{switch(e){case"native":return(0,i18n_1.t)("crash.simNativeMessage");case"promise":return(0,i18n_1.t)("crash.simPromiseMessage");case"render":return(0,i18n_1.t)("crash.simRenderMessage");default:return(0,i18n_1.t)("crash.simJsMessage")}},_buildComponentStack=()=>{try{const e=new Error;if(e.stack)return e.stack.split(`
4
4
  `).slice(1,6).map(t=>` ${t.trim()}`).join(`
5
- `)}catch{}},exportCrashReport=(e,t="text")=>{if(t==="json")return JSON.stringify(e,null,2);const o=Math.round((e.timestamp-appStartTime)/1e3);if(t==="markdown"){const r=[];return r.push(`## ${(0,i18n_1.t)("crash.mdReportTitle",{name:e.name||"Error"})}`),r.push(`> **${e.message}**`),r.push(""),r.push(`- **${(0,i18n_1.t)("crash.reportType")}** \`${e.type.toUpperCase()}\``),r.push(`- **${(0,i18n_1.t)("crash.reportFatal")}** \`${e.isFatal?(0,i18n_1.t)("crash.mdSeverityFatal"):(0,i18n_1.t)("crash.mdSeverityHandled")}\``),r.push(`- **${(0,i18n_1.t)("crash.reportTimestamp")}** ${e.dateStr} ${e.timeStr}`),r.push(`- **${(0,i18n_1.t)("crash.reportUptime")}** ${o}s`),r.push(`- **${(0,i18n_1.t)("crash.reportPlatform")}** ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),r.push(`- **${(0,i18n_1.t)("crash.reportReactNative")}** v${e.deviceInfo?.rnVersion||"N/A"}`),r.push(`- **${(0,i18n_1.t)("crash.jsEngine")}** ${e.deviceInfo?.isHermes?(0,i18n_1.t)("crash.hermesEngine"):(0,i18n_1.t)("crash.jsc")}`),r.push(`- **${(0,i18n_1.t)("crash.reportArchitecture")}** ${e.deviceInfo?.isFabric?(0,i18n_1.t)("crash.reportFabricNew"):(0,i18n_1.t)("crash.reportPaperLegacy")}`),e.memoryInfo&&r.push(`- **${(0,i18n_1.t)("crash.reportJsMemory")}** ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),r.push(""),r.push(`### ${(0,i18n_1.t)("crash.mdStackTrace")}`),r.push("```"),r.push(e.stack||(0,i18n_1.t)("crash.reportNoStackTrace")),r.push("```"),e.componentStack&&(r.push(""),r.push(`### ${(0,i18n_1.t)("crash.mdComponentHierarchy")}`),r.push("```"),r.push(e.componentStack),r.push("```")),e.breadcrumbs&&e.breadcrumbs.length>0&&(r.push(""),r.push(`### ${(0,i18n_1.t)("crash.mdRecentBreadcrumbs")}`),e.breadcrumbs.forEach(a=>{const u=new Date(a.timestamp).toLocaleTimeString();r.push(`- \`[${u}]\` **[${a.type.toUpperCase()}]** ${a.message}`)})),r.join(`
5
+ `)}catch{}},exportCrashReport=(e,t="text")=>{if(t==="json")return JSON.stringify(e,null,2);const o=Math.round((e.timestamp-appStartTime)/1e3);if(t==="markdown"){const r=[];return r.push(`## ${(0,i18n_1.t)("crash.mdReportTitle",{name:e.name||"Error"})}`),r.push(`> **${e.message}**`),r.push(""),r.push(`- **${(0,i18n_1.t)("crash.reportType")}** \`${e.type.toUpperCase()}\``),r.push(`- **${(0,i18n_1.t)("crash.reportFatal")}** \`${e.isFatal?(0,i18n_1.t)("crash.mdSeverityFatal"):(0,i18n_1.t)("crash.mdSeverityHandled")}\``),r.push(`- **${(0,i18n_1.t)("crash.reportTimestamp")}** ${e.dateStr} ${e.timeStr}`),r.push(`- **${(0,i18n_1.t)("crash.reportUptime")}** ${o}s`),r.push(`- **${(0,i18n_1.t)("crash.reportPlatform")}** ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),r.push(`- **${(0,i18n_1.t)("crash.reportReactNative")}** v${e.deviceInfo?.rnVersion||"N/A"}`),r.push(`- **${(0,i18n_1.t)("crash.jsEngine")}** ${e.deviceInfo?.isHermes?(0,i18n_1.t)("crash.hermesEngine"):(0,i18n_1.t)("crash.jsc")}`),r.push(`- **${(0,i18n_1.t)("crash.reportArchitecture")}** ${e.deviceInfo?.isFabric?(0,i18n_1.t)("crash.reportFabricNew"):(0,i18n_1.t)("crash.reportPaperLegacy")}`),e.memoryInfo&&r.push(`- **${(0,i18n_1.t)("crash.reportJsMemory")}** ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),r.push(""),r.push(`### ${(0,i18n_1.t)("crash.mdStackTrace")}`),r.push("```"),r.push(e.stack||(0,i18n_1.t)("crash.reportNoStackTrace")),r.push("```"),e.componentStack&&(r.push(""),r.push(`### ${(0,i18n_1.t)("crash.mdComponentHierarchy")}`),r.push("```"),r.push(e.componentStack),r.push("```")),e.breadcrumbs&&e.breadcrumbs.length>0&&(r.push(""),r.push(`### ${(0,i18n_1.t)("crash.mdRecentBreadcrumbs")}`),e.breadcrumbs.forEach(a=>{const d=new Date(a.timestamp).toLocaleTimeString();r.push(`- \`[${d}]\` **[${a.type.toUpperCase()}]** ${a.message}`)})),r.join(`
6
6
  `)}const s=[];return s.push("===================================================="),s.push(` ${(0,i18n_1.t)("crash.reportTitle")} `),s.push("===================================================="),s.push(`${(0,i18n_1.t)("crash.reportErrorName")} ${e.name||"Error"}`),s.push(`${(0,i18n_1.t)("crash.reportMessage")} ${e.message}`),s.push(`${(0,i18n_1.t)("crash.reportType")} ${e.type.toUpperCase()}`),s.push(`${(0,i18n_1.t)("crash.reportFatal")} ${e.isFatal?(0,i18n_1.t)("crash.reportFatalYes"):(0,i18n_1.t)("crash.reportFatalNo")}`),s.push(`${(0,i18n_1.t)("crash.reportTimestamp")} ${e.dateStr} ${e.timeStr} (${e.timestamp})`),s.push(`${(0,i18n_1.t)("crash.reportUptime")} ${(0,i18n_1.t)("crash.reportUptimeValue",{seconds:o})}`),s.push(`${(0,i18n_1.t)("crash.reportPlatform")} ${e.deviceInfo?.platform?.toUpperCase()} (v${e.deviceInfo?.osVersion})`),s.push(`${(0,i18n_1.t)("crash.reportReactNative")} ${e.deviceInfo?.rnVersion||"N/A"}`),s.push(`${(0,i18n_1.t)("crash.reportHermes")} ${e.deviceInfo?.isHermes?(0,i18n_1.t)("crash.reportEnabled"):(0,i18n_1.t)("crash.reportDisabled")}`),s.push(`${(0,i18n_1.t)("crash.reportArchitecture")} ${e.deviceInfo?.isFabric?(0,i18n_1.t)("crash.reportFabricNew"):(0,i18n_1.t)("crash.reportPaperLegacy")}`),s.push(`${(0,i18n_1.t)("crash.reportScreenSize")} ${getScreenDimensions()}`),s.push(`${(0,i18n_1.t)("crash.reportAppState")} ${e.deviceInfo?.appState||"active"}`),e.memoryInfo&&s.push(`${(0,i18n_1.t)("crash.reportJsMemory")} ${e.memoryInfo.usedJSHeapSize} MB / ${e.memoryInfo.totalJSHeapSize} MB`),s.push("----------------------------------------------------"),s.push(`${(0,i18n_1.t)("crash.reportStackTrace")}`),s.push(e.stack||(0,i18n_1.t)("crash.reportNoStackTrace")),e.componentStack&&(s.push("----------------------------------------------------"),s.push(`${(0,i18n_1.t)("crash.reportComponentHierarchy")}`),s.push(e.componentStack)),e.breadcrumbs&&e.breadcrumbs.length>0&&(s.push("----------------------------------------------------"),s.push(`${(0,i18n_1.t)("crash.reportRecentBreadcrumbs")}`),e.breadcrumbs.forEach(r=>{const a=new Date(r.timestamp).toLocaleTimeString();s.push(` [${a}] [${r.type.toUpperCase()}] ${r.message}`)})),s.push("===================================================="),s.join(`
7
- `)};exports.exportCrashReport=exportCrashReport;const setupGlobalCrashHandler=()=>{if(!isCrashHandlerInitialized){isCrashHandlerInitialized=!0;try{react_native_1.LogBox&&typeof react_native_1.LogBox.ignoreAllLogs=="function"&&react_native_1.LogBox.ignoreAllLogs(!0)}catch{}try{const e=require("react-native/Libraries/LogBox/Data/LogBoxData");e&&typeof e.setDisabled=="function"&&e.setDisabled(!0)}catch{}try{const e=react_native_1.NativeModules?.NetworkInspectorModule;e&&(typeof e.enableNativeCrashProtection=="function"&&e.enableNativeCrashProtection(),new react_native_1.NativeEventEmitter(e).addListener("onNativeCrash",o=>{const r=`[${(o?.platform||react_native_1.Platform.OS).toUpperCase()} ${(0,i18n_1.t)("crash.nativeCrashTitle")}] ${o?.message||(0,i18n_1.t)("crash.nativeUncaughtException")}`,a=o?.stack||"";(0,exports.handleInterceptedCrash)(r,a,!0,"native")}))}catch{}try{const e=react_native_1.TurboModuleRegistry||globalThis.__turboModuleProxy,t=react_native_1.NativeModules?.ExceptionsManager||(e?.get?e.get("ExceptionsManager"):null);if(t){t.reportFatalException=(s,r,a)=>{(0,exports.handleInterceptedCrash)(s,r,!0,"native");try{typeof t.dismissRedbox=="function"&&t.dismissRedbox()}catch{}},t.reportSoftException=(s,r,a)=>{(0,exports.handleInterceptedCrash)(s,r,!1,"js");try{typeof t.dismissRedbox=="function"&&t.dismissRedbox()}catch{}},t.reportException=s=>{const r=s?.message||s?.title||(0,i18n_1.t)("crash.nativeException"),a=s?.stack||s?.rawStack;(0,exports.handleInterceptedCrash)(r,a,s?.isFatal??!0,"js");try{typeof t.dismissRedbox=="function"&&t.dismissRedbox()}catch{}},t.updateExceptionMessage=()=>{};try{typeof t.dismissRedbox=="function"&&t.dismissRedbox()}catch{}}const o=react_native_1.NativeModules?.RedBox||react_native_1.NativeModules?.RCTRedBox||(e?.get?e.get("RedBox")||e.get("RCTRedBox"):null);o&&(typeof o.showErrorMessage=="function"&&(o.showErrorMessage=()=>{}),typeof o.showUserError=="function"&&(o.showUserError=()=>{}),typeof o.dismiss=="function"&&o.dismiss())}catch{}try{const t=globalThis.ErrorUtils;t&&(typeof t.setGlobalHandler=="function"&&t.setGlobalHandler((o,s)=>{(0,exports.handleInterceptedCrash)(o,o?.stack,s??!1,"js")}),typeof t.reportFatalError=="function"&&(t.reportFatalError=o=>{(0,exports.handleInterceptedCrash)(o,o?.stack,!0,"js")}),typeof t.reportError=="function"&&(t.reportError=o=>{(0,exports.handleInterceptedCrash)(o,o?.stack,!1,"js")}))}catch{}try{const e=globalThis,t=o=>{try{const s=o?.reason||o?.detail?.reason||o,r=s?.message||String(s||(0,i18n_1.t)("crash.unhandledPromiseRejection")),a=s?.stack||(o?.stack??new Error().stack);(0,exports.handleInterceptedCrash)(s,a,!1,"promise")}catch{}};typeof e.addEventListener=="function"&&e.addEventListener("unhandledrejection",t),typeof e.onunhandledrejection<"u"&&(e.onunhandledrejection=t)}catch{}}};exports.setupGlobalCrashHandler=setupGlobalCrashHandler;
7
+ `)};exports.exportCrashReport=exportCrashReport;const setupGlobalCrashHandler=()=>{if(!isCrashHandlerInitialized){isCrashHandlerInitialized=!0;try{react_native_1.LogBox&&typeof react_native_1.LogBox.ignoreAllLogs=="function"&&react_native_1.LogBox.ignoreAllLogs(!0)}catch{}try{const e=require("react-native/Libraries/LogBox/Data/LogBoxData");e&&typeof e.setDisabled=="function"&&e.setDisabled(!0)}catch{}try{const e=react_native_1.NativeModules?.NetworkInspectorModule;e&&(typeof e.enableNativeCrashProtection=="function"&&e.enableNativeCrashProtection(),new react_native_1.NativeEventEmitter(e).addListener("onNativeCrash",o=>{const r=`[${(o?.platform||react_native_1.Platform.OS).toUpperCase()} ${(0,i18n_1.t)("crash.nativeCrashTitle")}] ${o?.message||(0,i18n_1.t)("crash.nativeUncaughtException")}`,a=o?.stack||"";(0,exports.handleInterceptedCrash)(r,a,!0,"native")}))}catch{}try{const e=react_native_1.TurboModuleRegistry||globalThis.__turboModuleProxy,t=react_native_1.NativeModules?.ExceptionsManager||(e?.get?e.get("ExceptionsManager"):null);if(t){t.reportFatalException=(s,r,a)=>{(0,exports.handleInterceptedCrash)(s,r,!0,"native");try{typeof t.dismissRedbox=="function"&&t.dismissRedbox()}catch{}},t.reportSoftException=(s,r,a)=>{(0,exports.handleInterceptedCrash)(s,r,!1,"js");try{typeof t.dismissRedbox=="function"&&t.dismissRedbox()}catch{}},t.reportException=s=>{const r=s?.message||s?.title||(0,i18n_1.t)("crash.nativeException"),a=s?.stack||s?.rawStack;(0,exports.handleInterceptedCrash)(r,a,s?.isFatal??!0,"js");try{typeof t.dismissRedbox=="function"&&t.dismissRedbox()}catch{}},t.updateExceptionMessage=()=>{};try{typeof t.dismissRedbox=="function"&&t.dismissRedbox()}catch{}}const o=react_native_1.NativeModules?.RedBox||react_native_1.NativeModules?.RCTRedBox||(e?.get?e.get("RedBox")||e.get("RCTRedBox"):null);o&&(typeof o.showErrorMessage=="function"&&(o.showErrorMessage=()=>{}),typeof o.showUserError=="function"&&(o.showUserError=()=>{}),typeof o.dismiss=="function"&&o.dismiss())}catch{}try{const t=globalThis.ErrorUtils;t&&(typeof t.setGlobalHandler=="function"&&t.setGlobalHandler((o,s)=>{(0,exports.handleInterceptedCrash)(o,o?.stack,s??!1,"js")}),typeof t.reportFatalError=="function"&&(t.reportFatalError=o=>{(0,exports.handleInterceptedCrash)(o,o?.stack,!0,"js")}),typeof t.reportError=="function"&&(t.reportError=o=>{(0,exports.handleInterceptedCrash)(o,o?.stack,!1,"js")}))}catch{}try{const e=globalThis,t=o=>{try{const s=o?.reason||o?.detail?.reason||o,r=s?.stack||(o?.stack??new Error().stack);(0,exports.handleInterceptedCrash)(s,r,!1,"promise")}catch{}};typeof e.addEventListener=="function"&&e.addEventListener("unhandledrejection",t),typeof e.onunhandledrejection<"u"&&(e.onunhandledrejection=t)}catch{}}};exports.setupGlobalCrashHandler=setupGlobalCrashHandler;
@@ -1 +1 @@
1
- "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.addAxiosInterceptors=exports.setupNetworkLogger=exports.pruneNetworkLogs=exports.getMaxNetworkLogsLimit=exports.setMaxNetworkLogsLimit=exports.getNetworkLogs=exports.clearNetworkLogs=exports.subscribeNetworkLogs=exports.getNetworkModuleEnabled=exports.setNetworkModuleEnabled=exports.setRouteInfoProvider=void 0;const axios_1=__importDefault(require("axios")),crashHandler_1=require("./crashHandler");let logs=[],listeners=[],counter=0,isNetworkModuleEnabled=!0,currentRouteProvider=null;const setRouteInfoProvider=e=>{currentRouteProvider=e};exports.setRouteInfoProvider=setRouteInfoProvider;const setNetworkModuleEnabled=e=>{isNetworkModuleEnabled=e};exports.setNetworkModuleEnabled=setNetworkModuleEnabled;const getNetworkModuleEnabled=()=>isNetworkModuleEnabled;exports.getNetworkModuleEnabled=getNetworkModuleEnabled;const ALLOWED_METHODS=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],IGNORED_URL_PATTERNS=[/\/symbolicate(?:\?|$)/i,/\/index\.bundle(?:\?|$)/i,/\/open-debugger(?:\?|$)/i,/:(?:8081|8082|8083|19000|19001)\/(?:index\.bundle|symbolicate|hot|message|status)/i,/google-analytics\.com\/mp\/collect/i,/analytics\.google\.com/i];function shouldIgnoreUrl(e){return e?IGNORED_URL_PATTERNS.some(t=>t.test(e)):!1}function parseXHRResponseHeaders(e){if(!e||typeof e!="string")return;const t=e.trim().split(/[\r\n]+/),s={};return t.forEach(o=>{const r=o.indexOf(":");if(r>0){const i=o.substring(0,r).trim().toLowerCase(),n=o.substring(r+1).trim();s[i]=n}}),Object.keys(s).length>0?s:void 0}function normaliseHeaders(e){if(!e)return;if(typeof e.forEach=="function"){const o={};return e.forEach((r,i)=>{o[i]=r}),Object.keys(o).length>0?o:void 0}if(Array.isArray(e)){const o={};return e.forEach(([r,i])=>{o[r]=i}),Object.keys(o).length>0?o:void 0}const t=e,s={};return Object.entries(t).forEach(([o,r])=>{r!=null&&(s[o]=String(r))}),Object.keys(s).length>0?s:void 0}function parseRequestData(e){if(!e)return e;if(e&&e._parts&&Array.isArray(e._parts)){const t={};return e._parts.forEach(s=>{const o=s[0],r=s[1];r&&typeof r=="object"&&r.uri?t[o]={_isFile:!0,name:r.name||"unknown",type:r.type||"unknown",uri:r.uri}:t[o]=r}),{_isFormData:!0,...t}}return e}const subscribeNetworkLogs=e=>(listeners.push(e),e([...logs]),()=>{listeners=listeners.filter(t=>t!==e)});exports.subscribeNetworkLogs=subscribeNetworkLogs;const clearNetworkLogs=()=>{logs=[],notify()};exports.clearNetworkLogs=clearNetworkLogs;const getNetworkLogs=()=>[...logs];exports.getNetworkLogs=getNetworkLogs;let maxNetworkLogsLimit=250;const setMaxNetworkLogsLimit=e=>{maxNetworkLogsLimit=Math.max(10,e),logs.length>maxNetworkLogsLimit&&(logs=logs.slice(0,maxNetworkLogsLimit),notify())};exports.setMaxNetworkLogsLimit=setMaxNetworkLogsLimit;const getMaxNetworkLogsLimit=()=>maxNetworkLogsLimit;exports.getMaxNetworkLogsLimit=getMaxNetworkLogsLimit;const pruneNetworkLogs=e=>{const t=e!==void 0?Math.max(0,e):Math.floor(logs.length/2),s=logs.length-t;return s>0&&(logs=logs.slice(0,t),notify()),Math.max(0,s)};exports.pruneNetworkLogs=pruneNetworkLogs;const notify=()=>{const e=[...logs];listeners.forEach(t=>t(e))},addOrUpdateLog=e=>{if(!isNetworkModuleEnabled)return;const t=e.method?.toUpperCase();if(t&&!ALLOWED_METHODS.includes(t)||shouldIgnoreUrl(e.url))return;const s=logs.findIndex(o=>o.id===e.id);s>=0?logs[s]={...logs[s],...e}:logs.unshift(e),logs=logs.slice(0,maxNetworkLogsLimit),notify()};let isInsideFetch=!1;const setupNetworkLogger=()=>{if(globalThis.__NETWORK_LOGGER_INITIALIZED__)return;globalThis.__NETWORK_LOGGER__=addOrUpdateLog;const e=globalThis.XMLHttpRequest;if(e&&e.prototype&&!globalThis.__XHR_LOGGER_INITIALIZED__){globalThis.__XHR_LOGGER_INITIALIZED__=!0;const s=e.prototype.open,o=e.prototype.send,r=e.prototype.setRequestHeader;e.prototype.open=function(i,n,u,c,l){return this.__logMethod=(i||"GET").toUpperCase(),this.__logUrl=typeof n=="string"?n:String(n),this.__logRequestHeaders={},this.__logStartTime=Date.now(),s.apply(this,[i,n,u!==!1,c,l])},e.prototype.setRequestHeader=function(i,n){return i&&n!=null&&(this.__logRequestHeaders||(this.__logRequestHeaders={}),this.__logRequestHeaders[i.toLowerCase()]=String(n)),r.apply(this,[i,n])},e.prototype.send=function(i){if(!isNetworkModuleEnabled||isInsideFetch||this.__inAppInspectorTracked)return o.apply(this,[i]);const n=this.__logUrl||"",u=this.__logMethod||"GET";if(shouldIgnoreUrl(n))return o.apply(this,[i]);const c=counter++;this.__logId=c;const l=this.__logStartTime||Date.now(),a=this.__logRequestHeaders;let p="xhr";(a?.["apollographql-client-name"]||n.toLowerCase().includes("/graphql"))&&(p="apollo");const f=currentRouteProvider?currentRouteProvider():null;addOrUpdateLog({id:c,url:n,method:u,startTime:l,client:p,routeInfo:f||void 0,request:u==="GET"?void 0:parseRequestData(i),requestHeaders:Object.keys(a||{}).length>0?a:void 0});const h=()=>{if(this.__logFinished)return;this.__logFinished=!0;const _=Date.now()-l;let d=null;try{if(this.responseType===""||this.responseType==="text"){const y=this.responseText;try{d=JSON.parse(y)}catch{d=y}}else this.responseType==="json"?d=this.response:this.responseType==="blob"?d=`[Blob: ${this.response?.size||0} bytes]`:d=`[${this.responseType||"Unknown"} Data]`}catch{d=this.response||null}const x=this.getAllResponseHeaders?this.getAllResponseHeaders():"",T=parseXHRResponseHeaders(x);addOrUpdateLog({id:c,url:n,method:u,status:this.status,response:d,duration:_,startTime:l,client:p,responseHeaders:T})},g=()=>{if(this.__logFinished)return;this.__logFinished=!0;const _=Date.now()-l;addOrUpdateLog({id:c,url:n,method:u,status:this.status||0,response:"Network request failed",duration:_,startTime:l,client:p})};return this.addEventListener("load",h),this.addEventListener("error",g),this.addEventListener("abort",g),this.addEventListener("timeout",g),o.apply(this,[i])}}const t=globalThis.fetch;t&&(globalThis.fetch=async(s,o={})=>{if(!isNetworkModuleEnabled)return t(s,o);const r=(o?.method||"GET").toUpperCase(),i=counter++,n=Date.now(),u=typeof s=="string"?s:s?.url;if(shouldIgnoreUrl(u))return t(s,o);let c,l="fetch";try{c=normaliseHeaders(o?.headers),c?.["apollographql-client-name"]||u?.toLowerCase().includes("/graphql")?l="apollo":c?.["x-requested-with"]?.toLowerCase().includes("xmlhttprequest")&&(l="xhr");const a=currentRouteProvider?currentRouteProvider():null;addOrUpdateLog({id:i,url:u,method:r,startTime:n,client:l,routeInfo:a||void 0,request:r==="GET"?void 0:parseRequestData(o?.body),requestHeaders:c})}catch{}try{isInsideFetch=!0;let a;try{a=await t(s,o)}finally{isInsideFetch=!1}const p=Date.now()-n;try{const f=normaliseHeaders(a.headers);let h=null;if((f?.["content-type"]||f?.["Content-Type"]||"").includes("image/"))h="[Image Data]";else try{const d=await a.clone().text();try{h=JSON.parse(d)}catch{h=d}}catch{}addOrUpdateLog({id:i,url:u,method:r,status:a.status,response:h,duration:p,startTime:n,client:l,responseHeaders:f})}catch{}return a}catch(a){try{addOrUpdateLog({id:i,url:u,method:r,status:0,startTime:n,response:a,client:l,duration:Date.now()-n})}catch{}throw a}});try{if(axios_1.default){(0,exports.addAxiosInterceptors)(axios_1.default);const s=axios_1.default.create;typeof s=="function"&&(axios_1.default.create=function(...o){const r=s.apply(this,o);return(0,exports.addAxiosInterceptors)(r),r})}}catch{}try{(0,crashHandler_1.setupGlobalCrashHandler)()}catch{}globalThis.__NETWORK_LOGGER_INITIALIZED__=!0};exports.setupNetworkLogger=setupNetworkLogger;const addAxiosInterceptors=e=>{e.interceptors.request.use(async t=>{const s=(t.method||"GET").toUpperCase(),o=counter++,r=Date.now();let i=t.url??"";if(i.startsWith("http")||(i=`${t.baseURL??""}${i}`),shouldIgnoreUrl(i))return t;t.__logId=o,t.__logStart=r;const n=currentRouteProvider?currentRouteProvider():null;return addOrUpdateLog({id:o,url:i,method:s,startTime:r,client:"axios",routeInfo:n||void 0,request:s==="GET"?void 0:parseRequestData(t.data),requestHeaders:normaliseHeaders(t.headers)}),t}),e.interceptors.response.use(t=>{const s=t.config||{},o=s.__logId,r=s.__logStart,i=(s.method||"GET").toUpperCase();if(o==null)return t;let n=s.url??"";return n.startsWith("http")||(n=`${s.baseURL??""}${n}`),addOrUpdateLog({id:o,url:n,method:i,status:t.status,response:t.data,startTime:r||Date.now(),duration:r!=null?Date.now()-r:void 0,client:"axios",responseHeaders:normaliseHeaders(t.headers)}),t},t=>{const s=t.config||{},o=s.__logId,r=s.__logStart,i=(s.method||"GET").toUpperCase();if(o!=null){let n=s.url??"";n.startsWith("http")||(n=`${s.baseURL??""}${n}`),addOrUpdateLog({id:o,url:n,method:i,status:t.response?.status??0,response:t.response?.data??t.message,startTime:r||Date.now(),duration:r!=null?Date.now()-r:void 0,client:"axios",responseHeaders:normaliseHeaders(t.response?.headers)})}return Promise.reject(t)})};if(exports.addAxiosInterceptors=addAxiosInterceptors,typeof globalThis<"u")try{(0,exports.setupNetworkLogger)()}catch{}
1
+ "use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.addAxiosInterceptors=exports.setupNetworkLogger=exports.pruneNetworkLogs=exports.getMaxNetworkLogsLimit=exports.setMaxNetworkLogsLimit=exports.getNetworkLogs=exports.clearNetworkLogs=exports.subscribeNetworkLogs=exports.getNetworkModuleEnabled=exports.setNetworkModuleEnabled=exports.setRouteInfoProvider=void 0;const axios_1=__importDefault(require("axios")),crashHandler_1=require("./crashHandler");let logs=[],listeners=[],counter=0,isNetworkModuleEnabled=!0,currentRouteProvider=null;const setRouteInfoProvider=e=>{currentRouteProvider=e};exports.setRouteInfoProvider=setRouteInfoProvider;const setNetworkModuleEnabled=e=>{isNetworkModuleEnabled=e};exports.setNetworkModuleEnabled=setNetworkModuleEnabled;const getNetworkModuleEnabled=()=>isNetworkModuleEnabled;exports.getNetworkModuleEnabled=getNetworkModuleEnabled;const ALLOWED_METHODS=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS","CONNECT","TRACE"],IGNORED_URL_PATTERNS=[/\/symbolicate(?:\?|$)/i,/\/index\.bundle(?:\?|$)/i,/\/open-debugger(?:\?|$)/i,/:(?:8081|8082|8083|19000|19001)\/(?:index\.bundle|symbolicate|hot|message|status)/i,/google-analytics\.com\/mp\/collect/i,/analytics\.google\.com/i];function shouldIgnoreUrl(e){return e?IGNORED_URL_PATTERNS.some(t=>t.test(e)):!1}function parseXHRResponseHeaders(e){if(!e||typeof e!="string")return;const t=e.trim().split(/[\r\n]+/),s={};return t.forEach(o=>{const r=o.indexOf(":");if(r>0){const i=o.substring(0,r).trim().toLowerCase(),n=o.substring(r+1).trim();s[i]=n}}),Object.keys(s).length>0?s:void 0}function normaliseHeaders(e){if(!e)return;if(typeof e.forEach=="function"){const o={};return e.forEach((r,i)=>{o[i]=r}),Object.keys(o).length>0?o:void 0}if(Array.isArray(e)){const o={};return e.forEach(([r,i])=>{o[r]=i}),Object.keys(o).length>0?o:void 0}const t=e,s={};return Object.entries(t).forEach(([o,r])=>{r!=null&&(s[o]=String(r))}),Object.keys(s).length>0?s:void 0}function parseRequestData(e){if(!e)return e;if(e&&e._parts&&Array.isArray(e._parts)){const t={};return e._parts.forEach(s=>{const o=s[0],r=s[1];r&&typeof r=="object"&&r.uri?t[o]={_isFile:!0,name:r.name||"unknown",type:r.type||"unknown",uri:r.uri}:t[o]=r}),{_isFormData:!0,...t}}return e}const subscribeNetworkLogs=e=>(listeners.push(e),e([...logs]),()=>{listeners=listeners.filter(t=>t!==e)});exports.subscribeNetworkLogs=subscribeNetworkLogs;const clearNetworkLogs=()=>{logs=[],notify()};exports.clearNetworkLogs=clearNetworkLogs;const getNetworkLogs=()=>[...logs];exports.getNetworkLogs=getNetworkLogs;let maxNetworkLogsLimit=1/0;const setMaxNetworkLogsLimit=e=>{maxNetworkLogsLimit=e};exports.setMaxNetworkLogsLimit=setMaxNetworkLogsLimit;const getMaxNetworkLogsLimit=()=>maxNetworkLogsLimit;exports.getMaxNetworkLogsLimit=getMaxNetworkLogsLimit;const pruneNetworkLogs=e=>{const t=e!==void 0?Math.max(0,e):Math.floor(logs.length/2),s=logs.length-t;return s>0&&(logs=logs.slice(0,t),notify()),Math.max(0,s)};exports.pruneNetworkLogs=pruneNetworkLogs;const notify=()=>{const e=[...logs];listeners.forEach(t=>t(e))},addOrUpdateLog=e=>{if(!isNetworkModuleEnabled)return;const t=e.method?.toUpperCase();if(t&&!ALLOWED_METHODS.includes(t)||shouldIgnoreUrl(e.url))return;const s=logs.findIndex(o=>o.id===e.id);s>=0?logs[s]={...logs[s],...e}:logs.unshift(e),notify()};let isInsideFetch=!1;const setupNetworkLogger=()=>{if(globalThis.__NETWORK_LOGGER_INITIALIZED__)return;globalThis.__NETWORK_LOGGER__=addOrUpdateLog;const e=globalThis.XMLHttpRequest;if(e&&e.prototype&&!globalThis.__XHR_LOGGER_INITIALIZED__){globalThis.__XHR_LOGGER_INITIALIZED__=!0;const s=e.prototype.open,o=e.prototype.send,r=e.prototype.setRequestHeader;e.prototype.open=function(i,n,u,c,l){return this.__logMethod=(i||"GET").toUpperCase(),this.__logUrl=typeof n=="string"?n:String(n),this.__logRequestHeaders={},this.__logStartTime=Date.now(),s.apply(this,[i,n,u!==!1,c,l])},e.prototype.setRequestHeader=function(i,n){return i&&n!=null&&(this.__logRequestHeaders||(this.__logRequestHeaders={}),this.__logRequestHeaders[i.toLowerCase()]=String(n)),r.apply(this,[i,n])},e.prototype.send=function(i){if(!isNetworkModuleEnabled||isInsideFetch||this.__inAppInspectorTracked)return o.apply(this,[i]);const n=this.__logUrl||"",u=this.__logMethod||"GET";if(shouldIgnoreUrl(n))return o.apply(this,[i]);const c=counter++;this.__logId=c;const l=this.__logStartTime||Date.now(),a=this.__logRequestHeaders;let p="xhr";(a?.["apollographql-client-name"]||n.toLowerCase().includes("/graphql"))&&(p="apollo");const f=currentRouteProvider?currentRouteProvider():null;addOrUpdateLog({id:c,url:n,method:u,startTime:l,client:p,routeInfo:f||void 0,request:u==="GET"?void 0:parseRequestData(i),requestHeaders:Object.keys(a||{}).length>0?a:void 0});const h=()=>{if(this.__logFinished)return;this.__logFinished=!0;const _=Date.now()-l;let d=null;try{if(this.responseType===""||this.responseType==="text"){const y=this.responseText;try{d=JSON.parse(y)}catch{d=y}}else this.responseType==="json"?d=this.response:this.responseType==="blob"?d=`[Blob: ${this.response?.size||0} bytes]`:d=`[${this.responseType||"Unknown"} Data]`}catch{d=this.response||null}const x=this.getAllResponseHeaders?this.getAllResponseHeaders():"",T=parseXHRResponseHeaders(x);addOrUpdateLog({id:c,url:n,method:u,status:this.status,response:d,duration:_,startTime:l,client:p,responseHeaders:T})},g=()=>{if(this.__logFinished)return;this.__logFinished=!0;const _=Date.now()-l;addOrUpdateLog({id:c,url:n,method:u,status:this.status||0,response:"Network request failed",duration:_,startTime:l,client:p})};return this.addEventListener("load",h),this.addEventListener("error",g),this.addEventListener("abort",g),this.addEventListener("timeout",g),o.apply(this,[i])}}const t=globalThis.fetch;t&&(globalThis.fetch=async(s,o={})=>{if(!isNetworkModuleEnabled)return t(s,o);const r=(o?.method||"GET").toUpperCase(),i=counter++,n=Date.now(),u=typeof s=="string"?s:s?.url;if(shouldIgnoreUrl(u))return t(s,o);let c,l="fetch";try{c=normaliseHeaders(o?.headers),c?.["apollographql-client-name"]||u?.toLowerCase().includes("/graphql")?l="apollo":c?.["x-requested-with"]?.toLowerCase().includes("xmlhttprequest")&&(l="xhr");const a=currentRouteProvider?currentRouteProvider():null;addOrUpdateLog({id:i,url:u,method:r,startTime:n,client:l,routeInfo:a||void 0,request:r==="GET"?void 0:parseRequestData(o?.body),requestHeaders:c})}catch{}try{isInsideFetch=!0;let a;try{a=await t(s,o)}finally{isInsideFetch=!1}const p=Date.now()-n;try{const f=normaliseHeaders(a.headers);let h=null;if((f?.["content-type"]||f?.["Content-Type"]||"").includes("image/"))h="[Image Data]";else try{const d=await a.clone().text();try{h=JSON.parse(d)}catch{h=d}}catch{}addOrUpdateLog({id:i,url:u,method:r,status:a.status,response:h,duration:p,startTime:n,client:l,responseHeaders:f})}catch{}return a}catch(a){try{addOrUpdateLog({id:i,url:u,method:r,status:0,startTime:n,response:a,client:l,duration:Date.now()-n})}catch{}throw a}});try{if(axios_1.default){(0,exports.addAxiosInterceptors)(axios_1.default);const s=axios_1.default.create;typeof s=="function"&&(axios_1.default.create=function(...o){const r=s.apply(this,o);return(0,exports.addAxiosInterceptors)(r),r})}}catch{}try{(0,crashHandler_1.setupGlobalCrashHandler)()}catch{}globalThis.__NETWORK_LOGGER_INITIALIZED__=!0};exports.setupNetworkLogger=setupNetworkLogger;const addAxiosInterceptors=e=>{e.interceptors.request.use(async t=>{const s=(t.method||"GET").toUpperCase(),o=counter++,r=Date.now();let i=t.url??"";if(i.startsWith("http")||(i=`${t.baseURL??""}${i}`),shouldIgnoreUrl(i))return t;t.__logId=o,t.__logStart=r;const n=currentRouteProvider?currentRouteProvider():null;return addOrUpdateLog({id:o,url:i,method:s,startTime:r,client:"axios",routeInfo:n||void 0,request:s==="GET"?void 0:parseRequestData(t.data),requestHeaders:normaliseHeaders(t.headers)}),t}),e.interceptors.response.use(t=>{const s=t.config||{},o=s.__logId,r=s.__logStart,i=(s.method||"GET").toUpperCase();if(o==null)return t;let n=s.url??"";return n.startsWith("http")||(n=`${s.baseURL??""}${n}`),addOrUpdateLog({id:o,url:n,method:i,status:t.status,response:t.data,startTime:r||Date.now(),duration:r!=null?Date.now()-r:void 0,client:"axios",responseHeaders:normaliseHeaders(t.headers)}),t},t=>{const s=t.config||{},o=s.__logId,r=s.__logStart,i=(s.method||"GET").toUpperCase();if(o!=null){let n=s.url??"";n.startsWith("http")||(n=`${s.baseURL??""}${n}`),addOrUpdateLog({id:o,url:n,method:i,status:t.response?.status??0,response:t.response?.data??t.message,startTime:r||Date.now(),duration:r!=null?Date.now()-r:void 0,client:"axios",responseHeaders:normaliseHeaders(t.response?.headers)})}return Promise.reject(t)})};if(exports.addAxiosInterceptors=addAxiosInterceptors,typeof globalThis<"u")try{(0,exports.setupNetworkLogger)()}catch{}
@@ -0,0 +1,19 @@
1
+ import type { PushNotificationRecord } from '../types';
2
+ export declare function normalizePushPayload(raw: any, options?: Partial<PushNotificationRecord>): PushNotificationRecord;
3
+ export declare function recordPushNotification(payload: any, options?: Partial<PushNotificationRecord>): PushNotificationRecord;
4
+ export declare function recordSalesforcePush(payload: any, options?: Partial<PushNotificationRecord>): PushNotificationRecord;
5
+ export declare function getPushRecords(): PushNotificationRecord[];
6
+ export declare function clearPushRecords(): void;
7
+ export declare function prunePushRecords(keepCount?: number): void;
8
+ export declare function setMaxPushRecordsLimit(limit: number): void;
9
+ export declare function getMaxPushRecordsLimit(): number;
10
+ export declare const emitPushEvent: typeof recordPushNotification;
11
+ export declare function subscribePushEvents(callback: (records: PushNotificationRecord[]) => void): () => void;
12
+ export declare function getDiscoveredPushSources(): string[];
13
+ export declare function simulateTestPush(preset?: 'salesforce' | 'fcm' | 'apns' | 'deeplink' | 'rich_media' | 'custom', customData?: any): PushNotificationRecord;
14
+ export declare function autoSetupPushLogger(options?: {
15
+ messaging?: any;
16
+ notifee?: any;
17
+ expoNotifications?: any;
18
+ marketingCloud?: any;
19
+ }): () => void;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.emitPushEvent=void 0,exports.normalizePushPayload=normalizePushPayload,exports.recordPushNotification=recordPushNotification,exports.recordSalesforcePush=recordSalesforcePush,exports.getPushRecords=getPushRecords,exports.clearPushRecords=clearPushRecords,exports.prunePushRecords=prunePushRecords,exports.setMaxPushRecordsLimit=setMaxPushRecordsLimit,exports.getMaxPushRecordsLimit=getMaxPushRecordsLimit,exports.subscribePushEvents=subscribePushEvents,exports.getDiscoveredPushSources=getDiscoveredPushSources,exports.simulateTestPush=simulateTestPush,exports.autoSetupPushLogger=autoSetupPushLogger;const react_native_1=require("react-native");let pushRecords=[],maxPushRecordsLimit=50;const listeners=new Set;function notifyListeners(){const e=[...pushRecords];listeners.forEach(t=>{try{t(e)}catch{}})}function generatePushId(){return`push_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function normalizePushPayload(e,t){if(!e||typeof e!="object")return{id:t?.id||generatePushId(),title:t?.title||"Notification",body:t?.body||String(e||""),source:t?.source||"custom",domain:t?.domain||"custom",appState:t?.appState||(react_native_1.AppState.currentState==="active"?"foreground":"background"),action:t?.action||"received",timestamp:t?.timestamp||Date.now(),data:t?.data||{},rawPayload:e};const o=e.notification||e.aps?.alert||e.alert||e,s=e.data||e.custom||e.customKeys||e.userInfo||e.payload||{},n=t?.id||e.id||e.messageId||e.message_id||e._m||e.identifier||e["gcm.message_id"]||e["google.message_id"]||generatePushId(),u=t?.title||(typeof o=="object"?o.title||o.subject||o.headline:null)||s.title||e.title||(typeof e.alert=="string"?e.alert:void 0)||"Push Notification",l=t?.body||(typeof o=="object"?o.body||o.message||o.text||o.alert:null)||s.body||s.message||e.body||e.message||(typeof e.alert=="string"?e.alert:void 0)||"",f=t?.subtitle||(typeof o=="object"?o.subtitle||o.subTitle:null)||s.subtitle||e.subtitle,m=t?.imageUrl||(typeof o=="object"?o.imageUrl||o.image||o.bigPicture:null)||s.imageUrl||s.image||e.imageUrl||e.image||e.fcm_options?.image,r=t?.sound||(typeof o=="object"?o.sound:null)||s.sound||e.sound||e.aps?.sound,d=t?.badge??(typeof e.badge=="number"?e.badge:null)??(typeof e.aps?.badge=="number"?e.aps.badge:null),p=t?.channelId||(typeof o=="object"?o.channelId||o.android?.channelId:null)||s.channelId||e.channelId,h=t?.priority||e.priority||(e.highPriority?"high":void 0);let i=t?.source||"push",c=t?.domain;e._m||e._sid||e._od||e._h||e._r||s._m||s._sid||s.customKeys?(i="salesforce",c="Salesforce Marketing Cloud"):e.ab_||s.ab_||e.braze_id?(i="braze",c="Braze"):e.custom?.i||e.os_||s.os_?(i="onesignal",c="OneSignal"):e.experienceId||e.projectId?(i="expo",c="Expo Notifications"):e["gcm.message_id"]||e.fcm_options||e.from?(i="fcm",c="Firebase Cloud Messaging"):e.aps?(i="apns",c="Apple Push Notification Service"):t?.source&&(i=t.source,c=t.domain||t.source);const a={};i==="salesforce"&&((e._m||s._m)&&(a.messageId=e._m||s._m),(e._sid||s._sid)&&(a.sendId=e._sid||s._sid),(e._od||s._od)&&(a.openDirectUrl=e._od||s._od),(e._h||s._h)&&(a.cloudPageUrl=e._h||s._h),(e._r||s._r)&&(a.receiptUrl=e._r||s._r),(e.customKeys||s.customKeys)&&(a.customKeys=e.customKeys||s.customKeys));const g={...typeof e=="object"?e:{},...typeof s=="object"?s:{},...t?.data||{}},y=react_native_1.AppState.currentState==="active"?"foreground":"background";return{id:String(n),title:u,body:l,subtitle:f,source:i,domain:c||i,appState:t?.appState||y,action:t?.action||"received",actionId:t?.actionId,userText:t?.userText,timestamp:t?.timestamp||Date.now(),data:g,rawPayload:e,channelId:p,imageUrl:m,sound:r?String(r):void 0,badge:d!=null?Number(d):void 0,collapseKey:e.collapseKey||e.collapse_key,priority:h,customDomainAttributes:Object.keys(a).length>0?a:void 0}}function recordPushNotification(e,t){const o=normalizePushPayload(e,t);return pushRecords.unshift(o),pushRecords.length>maxPushRecordsLimit&&(pushRecords=pushRecords.slice(0,maxPushRecordsLimit)),notifyListeners(),o}function recordSalesforcePush(e,t){return recordPushNotification(e,{source:"salesforce",domain:"Salesforce Marketing Cloud",...t})}function getPushRecords(){return[...pushRecords]}function clearPushRecords(){pushRecords=[],notifyListeners()}function prunePushRecords(e=20){pushRecords.length>e&&(pushRecords=pushRecords.slice(0,e),notifyListeners())}function setMaxPushRecordsLimit(e){maxPushRecordsLimit=Math.max(10,Math.min(e,500)),pushRecords.length>maxPushRecordsLimit&&(pushRecords=pushRecords.slice(0,maxPushRecordsLimit),notifyListeners())}function getMaxPushRecordsLimit(){return maxPushRecordsLimit}exports.emitPushEvent=recordPushNotification;function subscribePushEvents(e){return listeners.add(e),e([...pushRecords]),()=>{listeners.delete(e)}}function getDiscoveredPushSources(){const e=new Set;return pushRecords.forEach(t=>{t.source&&e.add(t.source.toLowerCase())}),Array.from(e)}function simulateTestPush(e="salesforce",t){const o=Date.now();switch(e){case"salesforce":return recordPushNotification({_m:`sfmc_msg_${Math.floor(Math.random()*9e5+1e5)}`,_sid:"journey_flash_sale_q3",_od:"app://deals/flash-50-off",_h:"https://cloud.email.salesforce.com/pages/view",_r:`receipt_${o}`,title:"\u{1F525} Salesforce Flash 50% Off Sale!",body:"Special VIP weekend access unlocked! Tap to claim your discount.",customKeys:{campaign:"LaborDayPromo",discountCode:"FLASH50",tier:"Diamond VIP",loyaltyPoints:1250},channelId:"promotions",priority:"high"},{source:"salesforce",domain:"Salesforce Marketing Cloud",appState:"foreground",action:"received"});case"fcm":return recordPushNotification({"gcm.message_id":`fcm_${Math.floor(Math.random()*9e6)}`,notification:{title:"\u{1F4E6} Order #98421 Out for Delivery",body:"Your courier is 5 minutes away with your package.",imageUrl:"https://images.unsplash.com/photo-1549465220-1a8b9238cd48?w=300",channelId:"deliveries"},data:{orderId:"ORD-98421",courier:"Express Delivery",trackingUrl:"https://track.example.com/98421"}},{source:"fcm",domain:"Firebase Cloud Messaging",appState:"background",action:"received"});case"apns":return recordPushNotification({aps:{alert:{title:"\u{1F4AC} New Message from Alex",subtitle:"Direct Message",body:"Hey! Are you ready for the team sync at 11 AM?"},badge:3,sound:"chime.aiff","thread-id":"chat_thread_102"},customData:{senderId:"user_alex_84",chatRoomId:"room_dev_sync"}},{source:"apns",domain:"Apple Push (APNs)",appState:"foreground",action:"received"});case"deeplink":return recordPushNotification({id:`dl_${o}`,title:"\u{1F680} Deep Link Received",body:"Tap to navigate to the new payment analytics dashboard.",data:{deepLink:"myapp://analytics/payments?period=monthly",screen:"AnalyticsDetail",sourceCampaign:"in_app_reminder"}},{source:"deeplink",domain:"Custom Deep Link",appState:"foreground",action:"opened"});case"rich_media":return recordPushNotification({id:`rich_${o}`,title:"\u{1F3AC} New Video Available",body:"Watch the product keynote highlights now in HD.",imageUrl:"https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?w=500",data:{videoId:"vid_launch_2026",category:"Keynotes",duration:340}},{source:"rich_media",domain:"Media Service",appState:"foreground",action:"received"});default:return recordPushNotification(t||{id:`custom_${o}`,title:"\u26A1 Custom Domain Push",body:"This is a flexible dynamic push payload from an arbitrary backend.",data:{domain:"api.mycustomservice.io",event:"custom_alert",nestedData:{level:"high",score:98.4}}},{source:"custom",domain:"Custom API"})}}function autoSetupPushLogger(e){const t=[];if(e?.messaging)try{const o=typeof e.messaging=="function"?e.messaging():e.messaging;if(typeof o.onMessage=="function"){const s=o.onMessage(async n=>{recordPushNotification(n,{source:"fcm",appState:"foreground",action:"received"})});typeof s=="function"&&t.push(s)}if(typeof o.onNotificationOpenedApp=="function"){const s=o.onNotificationOpenedApp(n=>{recordPushNotification(n,{source:"fcm",appState:"background",action:"opened"})});typeof s=="function"&&t.push(s)}}catch{}if(e?.notifee)try{if(typeof e.notifee.onForegroundEvent=="function"){const o=e.notifee.onForegroundEvent(({type:s,detail:n})=>{recordPushNotification(n.notification,{source:"notifee",appState:"foreground",action:s===1?"opened":"received",actionId:n.pressAction?.id})});typeof o=="function"&&t.push(o)}}catch{}if(e?.marketingCloud)try{typeof e.marketingCloud.setNotificationOpenedListener=="function"&&e.marketingCloud.setNotificationOpenedListener(o=>{recordSalesforcePush(o,{action:"opened",appState:"foreground"})})}catch{}return()=>{t.forEach(o=>{try{o()}catch{}})}}
@@ -5,11 +5,12 @@ export interface MemoryPruneSummary {
5
5
  prunedRedux: number;
6
6
  prunedAnalytics: number;
7
7
  prunedCrashes: number;
8
+ prunedPush: number;
8
9
  totalPruned: number;
9
10
  triggeredBy: 'memory-warning' | 'manual' | 'ram-threshold';
10
11
  }
11
12
  type MemoryWarningListener = (summary: MemoryPruneSummary) => void;
12
- export declare const pruneAllLogs: (triggeredBy?: MemoryPruneSummary["triggeredBy"], targetRetentionPct?: number) => MemoryPruneSummary;
13
+ export declare const pruneAllLogs: (triggeredBy?: MemoryPruneSummary["triggeredBy"], _targetRetentionPct?: number) => MemoryPruneSummary;
13
14
  export declare const setupMemoryWarningHandler: () => (() => void);
14
15
  export declare const subscribeMemoryWarning: (listener: MemoryWarningListener) => (() => void);
15
16
  export declare const getLastPruneTimestamp: () => number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isMemoryHandlerActive=exports.getLastPruneTimestamp=exports.subscribeMemoryWarning=exports.setupMemoryWarningHandler=exports.pruneAllLogs=void 0;const react_native_1=require("react-native"),networkLogger_1=require("../customHooks/networkLogger"),consoleLogger_1=require("../customHooks/consoleLogger"),reduxLogger_1=require("../customHooks/reduxLogger"),analyticsLogger_1=require("../customHooks/analyticsLogger"),crashHandler_1=require("../customHooks/crashHandler"),toast_1=require("./toast"),memoryListeners=new Set;let appStateSubscription=null,isMemoryWarningHandlerActive=!1,lastPruneTimestamp=0;const pruneAllLogs=(e="manual",r=.5)=>{const l=Math.max(.1,Math.min(1,r)),o=(0,networkLogger_1.pruneNetworkLogs)(void 0),n=(0,consoleLogger_1.pruneConsoleLogs)(void 0),s=(0,reduxLogger_1.pruneReduxHistory)(void 0),a=(0,analyticsLogger_1.pruneAnalyticsLogs)(void 0),c=(0,crashHandler_1.pruneCrashRecords)(void 0),u=o+n+s+a+c;if(lastPruneTimestamp=Date.now(),typeof globalThis.gc=="function")try{globalThis.gc()}catch{}const t={timestamp:lastPruneTimestamp,prunedNetwork:o,prunedConsole:n,prunedRedux:s,prunedAnalytics:a,prunedCrashes:c,totalPruned:u,triggeredBy:e};try{(0,crashHandler_1.addCrashBreadcrumb)("system",`[MemoryManager] Low memory auto-prune executed (${e}). Freed ${u} log records.`,t)}catch{}return memoryListeners.forEach(i=>{try{i(t)}catch{}}),t};exports.pruneAllLogs=pruneAllLogs;const setupMemoryWarningHandler=()=>{if(isMemoryWarningHandlerActive)return()=>{};isMemoryWarningHandlerActive=!0;try{appStateSubscription=react_native_1.AppState.addEventListener("memoryWarning",e=>{const r=(0,exports.pruneAllLogs)("memory-warning",.5);try{(0,toast_1.showToast)(`Memory Warning: Auto-pruned ${r.totalPruned} inspector logs`)}catch{}})}catch{}return()=>{if(appStateSubscription){try{appStateSubscription.remove()}catch{}appStateSubscription=null}isMemoryWarningHandlerActive=!1}};exports.setupMemoryWarningHandler=setupMemoryWarningHandler;const subscribeMemoryWarning=e=>(memoryListeners.add(e),()=>{memoryListeners.delete(e)});exports.subscribeMemoryWarning=subscribeMemoryWarning;const getLastPruneTimestamp=()=>lastPruneTimestamp;exports.getLastPruneTimestamp=getLastPruneTimestamp;const isMemoryHandlerActive=()=>isMemoryWarningHandlerActive;exports.isMemoryHandlerActive=isMemoryHandlerActive;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isMemoryHandlerActive=exports.getLastPruneTimestamp=exports.subscribeMemoryWarning=exports.setupMemoryWarningHandler=exports.pruneAllLogs=void 0;const react_native_1=require("react-native"),networkLogger_1=require("../customHooks/networkLogger"),consoleLogger_1=require("../customHooks/consoleLogger"),reduxLogger_1=require("../customHooks/reduxLogger"),analyticsLogger_1=require("../customHooks/analyticsLogger"),crashHandler_1=require("../customHooks/crashHandler"),pushNotificationLogger_1=require("../customHooks/pushNotificationLogger"),toast_1=require("./toast"),memoryListeners=new Set;let appStateSubscription=null,isMemoryWarningHandlerActive=!1,lastPruneTimestamp=0;const pruneAllLogs=(e="manual",t=.5)=>{const o=(0,networkLogger_1.pruneNetworkLogs)(void 0),n=(0,consoleLogger_1.pruneConsoleLogs)(void 0),s=(0,reduxLogger_1.pruneReduxHistory)(void 0),a=(0,analyticsLogger_1.pruneAnalyticsLogs)(void 0),u=(0,crashHandler_1.pruneCrashRecords)(void 0),c=0;(0,pushNotificationLogger_1.prunePushRecords)(20);const i=o+n+s+a+u+c;if(lastPruneTimestamp=Date.now(),typeof globalThis.gc=="function")try{globalThis.gc()}catch{}const r={timestamp:lastPruneTimestamp,prunedNetwork:o,prunedConsole:n,prunedRedux:s,prunedAnalytics:a,prunedCrashes:u,prunedPush:c,totalPruned:i,triggeredBy:e};try{(0,crashHandler_1.addCrashBreadcrumb)("system",`[MemoryManager] Low memory auto-prune executed (${e}). Freed ${i} log records.`,r)}catch{}return memoryListeners.forEach(p=>{try{p(r)}catch{}}),r};exports.pruneAllLogs=pruneAllLogs;const setupMemoryWarningHandler=()=>{if(isMemoryWarningHandlerActive)return()=>{};isMemoryWarningHandlerActive=!0;try{appStateSubscription=react_native_1.AppState.addEventListener("memoryWarning",e=>{const t=(0,exports.pruneAllLogs)("memory-warning",.5);try{(0,toast_1.showToast)(`Memory Warning: Auto-pruned ${t.totalPruned} inspector logs`)}catch{}})}catch{}return()=>{if(appStateSubscription){try{appStateSubscription.remove()}catch{}appStateSubscription=null}isMemoryWarningHandlerActive=!1}};exports.setupMemoryWarningHandler=setupMemoryWarningHandler;const subscribeMemoryWarning=e=>(memoryListeners.add(e),()=>{memoryListeners.delete(e)});exports.subscribeMemoryWarning=subscribeMemoryWarning;const getLastPruneTimestamp=()=>lastPruneTimestamp;exports.getLastPruneTimestamp=getLastPruneTimestamp;const isMemoryHandlerActive=()=>isMemoryWarningHandlerActive;exports.isMemoryHandlerActive=isMemoryHandlerActive;
@@ -11,6 +11,7 @@ export interface RamLimitsProfile {
11
11
  maxConsoleLogs: number;
12
12
  maxAnalyticsEvents: number;
13
13
  maxCrashRecords: number;
14
+ maxPushRecords: number;
14
15
  profileName: 'High-End' | 'Standard' | 'Compact' | 'Ultra-Light';
15
16
  freeRamMb: number;
16
17
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isPersistentStorageAvailable=void 0,exports.setCustomStorage=setCustomStorage,exports.loadSettings=loadSettings,exports.saveSettings=saveSettings,exports.clearPersistedSettings=clearPersistedSettings,exports.getCustomStorage=getCustomStorage,exports.calculateRamBasedLimits=calculateRamBasedLimits;const react_native_1=require("react-native"),NativeInspector_1=require("../native/NativeInspector"),memory=new Map;let customStorage=null;function setCustomStorage(t){customStorage=t}const SETTINGS_KEY="rn-inapp-inspector.settings.v1";async function loadSettings(){try{if(customStorage){const e=await customStorage.getItem(SETTINGS_KEY);if(!e)return{};const s=JSON.parse(e);return s&&typeof s=="object"?s:{}}if((0,NativeInspector_1.isNativeModuleAvailable)()){const e=await(0,NativeInspector_1.getNativeStorageItem)(SETTINGS_KEY);if(e){const s=JSON.parse(e);return s&&typeof s=="object"?s:{}}}if(react_native_1.Platform.OS==="ios"){const e=react_native_1.Settings.get(SETTINGS_KEY);if(!e)return{};if(typeof e=="string"){const s=JSON.parse(e);return s&&typeof s=="object"?s:{}}return e&&typeof e=="object"?e:{}}const t=memory.get(SETTINGS_KEY);if(!t)return{};const r=JSON.parse(t);return r&&typeof r=="object"?r:{}}catch{return{}}}function saveSettings(t){try{const r=JSON.stringify(t);if(customStorage){customStorage.setItem(SETTINGS_KEY,r);return}if((0,NativeInspector_1.isNativeModuleAvailable)()&&(0,NativeInspector_1.setNativeStorageItem)(SETTINGS_KEY,r),react_native_1.Platform.OS==="ios"){react_native_1.Settings.set({[SETTINGS_KEY]:r});return}memory.set(SETTINGS_KEY,r)}catch{}}async function clearPersistedSettings(){try{if(customStorage){typeof customStorage.removeItem=="function"?await customStorage.removeItem(SETTINGS_KEY):await customStorage.setItem(SETTINGS_KEY,"");return}if((0,NativeInspector_1.isNativeModuleAvailable)()&&await(0,NativeInspector_1.setNativeStorageItem)(SETTINGS_KEY,null),react_native_1.Platform.OS==="ios"){react_native_1.Settings.set({[SETTINGS_KEY]:null});return}memory.delete(SETTINGS_KEY)}catch{}}const isPersistentStorageAvailable=()=>customStorage!==null||(0,NativeInspector_1.isNativeModuleAvailable)()||react_native_1.Platform.OS==="ios";exports.isPersistentStorageAvailable=isPersistentStorageAvailable;function getCustomStorage(){return customStorage}function calculateRamBasedLimits(t){return t>=3e3?{maxNetworkLogs:500,maxConsoleLogs:500,maxAnalyticsEvents:300,maxCrashRecords:150,profileName:"High-End",freeRamMb:t}:t>=1500?{maxNetworkLogs:300,maxConsoleLogs:300,maxAnalyticsEvents:200,maxCrashRecords:100,profileName:"Standard",freeRamMb:t}:t>=600?{maxNetworkLogs:200,maxConsoleLogs:200,maxAnalyticsEvents:100,maxCrashRecords:50,profileName:"Compact",freeRamMb:t}:{maxNetworkLogs:100,maxConsoleLogs:100,maxAnalyticsEvents:50,maxCrashRecords:25,profileName:"Ultra-Light",freeRamMb:t}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isPersistentStorageAvailable=void 0,exports.setCustomStorage=setCustomStorage,exports.loadSettings=loadSettings,exports.saveSettings=saveSettings,exports.clearPersistedSettings=clearPersistedSettings,exports.getCustomStorage=getCustomStorage,exports.calculateRamBasedLimits=calculateRamBasedLimits;const react_native_1=require("react-native"),NativeInspector_1=require("../native/NativeInspector"),memory=new Map;let customStorage=null;function setCustomStorage(t){customStorage=t}const SETTINGS_KEY="rn-inapp-inspector.settings.v1";async function loadSettings(){try{if(customStorage){const e=await customStorage.getItem(SETTINGS_KEY);if(!e)return{};const s=JSON.parse(e);return s&&typeof s=="object"?s:{}}if((0,NativeInspector_1.isNativeModuleAvailable)()){const e=await(0,NativeInspector_1.getNativeStorageItem)(SETTINGS_KEY);if(e){const s=JSON.parse(e);return s&&typeof s=="object"?s:{}}}if(react_native_1.Platform.OS==="ios"){const e=react_native_1.Settings.get(SETTINGS_KEY);if(!e)return{};if(typeof e=="string"){const s=JSON.parse(e);return s&&typeof s=="object"?s:{}}return e&&typeof e=="object"?e:{}}const t=memory.get(SETTINGS_KEY);if(!t)return{};const r=JSON.parse(t);return r&&typeof r=="object"?r:{}}catch{return{}}}function saveSettings(t){try{const r=JSON.stringify(t);if(customStorage){customStorage.setItem(SETTINGS_KEY,r);return}if((0,NativeInspector_1.isNativeModuleAvailable)()&&(0,NativeInspector_1.setNativeStorageItem)(SETTINGS_KEY,r),react_native_1.Platform.OS==="ios"){react_native_1.Settings.set({[SETTINGS_KEY]:r});return}memory.set(SETTINGS_KEY,r)}catch{}}async function clearPersistedSettings(){try{if(customStorage){typeof customStorage.removeItem=="function"?await customStorage.removeItem(SETTINGS_KEY):await customStorage.setItem(SETTINGS_KEY,"");return}if((0,NativeInspector_1.isNativeModuleAvailable)()&&await(0,NativeInspector_1.setNativeStorageItem)(SETTINGS_KEY,null),react_native_1.Platform.OS==="ios"){react_native_1.Settings.set({[SETTINGS_KEY]:null});return}memory.delete(SETTINGS_KEY)}catch{}}const isPersistentStorageAvailable=()=>customStorage!==null||(0,NativeInspector_1.isNativeModuleAvailable)()||react_native_1.Platform.OS==="ios";exports.isPersistentStorageAvailable=isPersistentStorageAvailable;function getCustomStorage(){return customStorage}function calculateRamBasedLimits(t){return t>=3e3?{maxNetworkLogs:500,maxConsoleLogs:500,maxAnalyticsEvents:300,maxCrashRecords:150,maxPushRecords:100,profileName:"High-End",freeRamMb:t}:t>=1500?{maxNetworkLogs:300,maxConsoleLogs:300,maxAnalyticsEvents:200,maxCrashRecords:100,maxPushRecords:75,profileName:"Standard",freeRamMb:t}:t>=600?{maxNetworkLogs:200,maxConsoleLogs:200,maxAnalyticsEvents:100,maxCrashRecords:50,maxPushRecords:50,profileName:"Compact",freeRamMb:t}:{maxNetworkLogs:100,maxConsoleLogs:100,maxAnalyticsEvents:50,maxCrashRecords:25,maxPushRecords:25,profileName:"Ultra-Light",freeRamMb:t}}
@@ -0,0 +1,13 @@
1
+ import type { AnalyticsEvent, ConsoleLog, CrashRecord, NetworkLog, PushNotificationRecord, ReduxHistoryEntry } from '../types';
2
+ export declare function formatApiReport(log: NetworkLog): string;
3
+ export declare function formatPushReport(record: PushNotificationRecord): string;
4
+ export declare function formatCrashReport(crash: CrashRecord): string;
5
+ export declare function formatAnalyticsReport(event: AnalyticsEvent): string;
6
+ export declare function formatReduxReport(action: ReduxHistoryEntry): string;
7
+ export declare function formatLogReport(log: ConsoleLog): string;
8
+ export declare function shareApiReport(log: NetworkLog): Promise<void>;
9
+ export declare function sharePushReport(record: PushNotificationRecord): Promise<void>;
10
+ export declare function shareCrashReport(crash: CrashRecord): Promise<void>;
11
+ export declare function shareAnalyticsReport(event: AnalyticsEvent): Promise<void>;
12
+ export declare function shareReduxReport(action: ReduxHistoryEntry): Promise<void>;
13
+ export declare function shareLogReport(log: ConsoleLog): Promise<void>;
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatApiReport=formatApiReport,exports.formatPushReport=formatPushReport,exports.formatCrashReport=formatCrashReport,exports.formatAnalyticsReport=formatAnalyticsReport,exports.formatReduxReport=formatReduxReport,exports.formatLogReport=formatLogReport,exports.shareApiReport=shareApiReport,exports.sharePushReport=sharePushReport,exports.shareCrashReport=shareCrashReport,exports.shareAnalyticsReport=shareAnalyticsReport,exports.shareReduxReport=shareReduxReport,exports.shareLogReport=shareLogReport;const react_native_1=require("react-native"),index_1=require("./index");function safeStringify(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function formatApiReport(e){const s=(e.method||"GET").toUpperCase(),t=e.status===0?"Failed / Network Error":e.status!=null?`${e.status} ${e.status===200?"OK":""}`.trim():"Pending",p=e.duration!=null?`${e.duration}ms`:"N/A",n=(0,index_1.formatDateTime)(e.startTime||Date.now()),a=(0,index_1.getCurlCommand)(e),r=["\u{1F680} API INSPECTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Method: ${s}`,`\u{1F4CA} Status: ${t}`,`\u23F1\uFE0F Duration: ${p}`,`\u{1F552} Time: ${n}`];return e.client&&r.push(`\u{1F50C} Client: ${e.client.toUpperCase()}`),r.push(`\u{1F310} URL: ${e.url||"N/A"}`),r.push(""),e.requestHeaders&&Object.keys(e.requestHeaders).length>0&&(r.push("\u{1F4CB} Request Headers:"),r.push(safeStringify(e.requestHeaders)),r.push("")),e.request!=null&&e.request!==""&&(r.push("\u{1F4DD} Request Body:"),r.push(safeStringify(e.request)),r.push("")),e.responseHeaders&&Object.keys(e.responseHeaders).length>0&&(r.push("\u{1F4D1} Response Headers:"),r.push(safeStringify(e.responseHeaders)),r.push("")),e.response!=null&&e.response!==""&&(r.push("\u{1F4E5} Response Data:"),r.push(safeStringify(e.response)),r.push("")),a&&(r.push("\u{1F4BB} cURL Command:"),r.push(a),r.push("")),r.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),r.push("Generated by React Native InApp Inspector"),r.join(`
2
+ `)}function formatPushReport(e){const s=(0,index_1.formatDateTime)(e.timestamp||Date.now()),t=(e.source||"push").toUpperCase(),p=(e.appState||"unknown").toUpperCase(),n=(e.action||"received").toUpperCase(),a=["\u{1F514} PUSH NOTIFICATION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Title: ${e.title||"(No Title)"}`,`\u{1F4DD} Body: ${e.body||"(No Body)"}`,`\u{1F3E2} Source: ${t}${e.domain?` (${e.domain})`:""}`,`\u{1F194} Message ID: ${e.id||"N/A"}`,`\u{1F4F1} App State: ${p}`,`\u{1F3AF} Action: ${n}`,`\u{1F552} Time: ${s}`];return e.subtitle&&a.push(`\u{1F4D1} Subtitle: ${e.subtitle}`),e.channelId&&a.push(`\u{1F3F7}\uFE0F Channel: ${e.channelId}`),e.priority&&a.push(`\u26A1 Priority: ${e.priority}`),e.badge!=null&&a.push(`\u{1F522} Badge: ${e.badge}`),e.sound&&a.push(`\u{1F50A} Sound: ${e.sound}`),e.imageUrl&&a.push(`\u{1F5BC}\uFE0F Image: ${e.imageUrl}`),a.push(""),e.data&&Object.keys(e.data).length>0&&(a.push("\u{1F4E6} Custom Data Payload:"),a.push(safeStringify(e.data)),a.push("")),e.customDomainAttributes&&Object.keys(e.customDomainAttributes).length>0&&(a.push("\u{1F3E2} Domain Attributes:"),a.push(safeStringify(e.customDomainAttributes)),a.push("")),e.rawPayload!=null&&(a.push("\u2699\uFE0F Raw Payload:"),a.push(safeStringify(e.rawPayload)),a.push("")),a.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),a.push("Generated by React Native InApp Inspector"),a.join(`
3
+ `)}function formatCrashReport(e){const s=`${e.dateStr||""} ${e.timeStr||""}`.trim()||(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4A5} CRASH REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u26A0\uFE0F Error: ${e.name||"Error"}: ${e.message||"Unknown error"}`,`\u{1F6A8} Fatal: ${e.isFatal?"YES (Fatal)":"NO (Caught)"}`,`\u{1F3F7}\uFE0F Type: ${(e.type||"js").toUpperCase()}`,`\u{1F552} Time: ${s}`];return e.deviceInfo&&t.push(`\u{1F4F1} Platform: ${e.deviceInfo.platform||"N/A"} (OS: ${e.deviceInfo.osVersion||"N/A"}, RN: ${e.deviceInfo.rnVersion||"N/A"})`),e.memoryInfo?.usedJSHeapSize&&t.push(`\u{1F4BE} Used Heap: ${Math.round(e.memoryInfo.usedJSHeapSize/(1024*1024))} MB`),t.push(""),e.stack&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack),t.push("")),e.breadcrumbs&&e.breadcrumbs.length>0&&(t.push(`\u{1F43E} Breadcrumbs (${e.breadcrumbs.length}):`),e.breadcrumbs.slice(-10).forEach(p=>{t.push(` \u2022 [${p.type}] ${p.message} (${(0,index_1.formatDateTime)(p.timestamp)})`)}),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
4
+ `)}function formatAnalyticsReport(e){const s=(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4CA} ANALYTICS EVENT REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Event Name: ${e.name||"Unknown"}`,`\u{1F3E2} Source: ${(e.source||"manual").toUpperCase()}`,`\u{1F552} Timestamp: ${s}`];return e.screenName&&t.push(`\u{1F4F1} Screen Name: ${e.screenName}`),e.userId&&t.push(`\u{1F464} User ID: ${e.userId}`),e.trackingId&&t.push(`\u{1F194} Tracking ID: ${e.trackingId}`),t.push(""),e.params&&Object.keys(e.params).length>0&&(t.push("\u{1F4E6} Event Parameters:"),t.push(safeStringify(e.params)),t.push("")),e.userProperties&&Object.keys(e.userProperties).length>0&&(t.push("\u{1F464} User Properties:"),t.push(safeStringify(e.userProperties)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
5
+ `)}function formatReduxReport(e){const s=typeof e.timestamp=="number"?(0,index_1.formatDateTime)(e.timestamp):e.timestamp,t=["\u{1F504} REDUX ACTION REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Action Type: ${e.type||"UNKNOWN"}`,`\u{1F552} Timestamp: ${s}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),e.originType&&t.push(`\u2699\uFE0F Origin: ${e.originType}`),e.affectedSlices&&e.affectedSlices.length>0&&t.push(`\u{1F370} Slices: ${e.affectedSlices.join(", ")}`),t.push(""),t.push("\u{1F4E6} Action Payload:"),t.push(safeStringify(e.payload)),t.push(""),e.prevState!==void 0&&(t.push("\u23EE\uFE0F Previous State:"),t.push(safeStringify(e.prevState)),t.push("")),e.nextState!==void 0&&(t.push("\u23ED\uFE0F Next State:"),t.push(safeStringify(e.nextState)),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
6
+ `)}function formatLogReport(e){const s=(0,index_1.formatDateTime)(e.timestamp),t=["\u{1F4DC} CONSOLE LOG REPORT","\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501",`\u{1F4CC} Level: ${(e.type||"info").toUpperCase()}`,`\u{1F552} Timestamp: ${s}`,`\u{1F4AC} Message: ${e.message||""}`];return e.caller&&t.push(`\u{1F4CD} Caller: ${e.caller}`),t.push(""),e.rawArgs&&e.rawArgs.length>0&&(t.push("\u{1F4E6} Arguments:"),t.push(safeStringify(e.rawArgs)),t.push("")),(e.stack||e.errorStack)&&(t.push("\u{1F4DC} Stack Trace:"),t.push(e.stack||e.errorStack||""),t.push("")),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push("Generated by React Native InApp Inspector"),t.join(`
7
+ `)}async function triggerNativeShare(e,s){try{await react_native_1.Share.share({title:e,message:s},{dialogTitle:e})}catch(t){t?.message!=="User did not share"&&react_native_1.Alert.alert("Share Error",t?.message||"Failed to open share sheet")}}async function shareApiReport(e){const s=formatApiReport(e),t=`API: ${e.method||"GET"} ${e.url?.substring(0,40)||""}`;await triggerNativeShare(t,s)}async function sharePushReport(e){const s=formatPushReport(e),t=`Push: ${e.title||e.id||"Notification"}`;await triggerNativeShare(t,s)}async function shareCrashReport(e){const s=formatCrashReport(e),t=`Crash: ${e.name||e.message||"Error"}`;await triggerNativeShare(t,s)}async function shareAnalyticsReport(e){const s=formatAnalyticsReport(e),t=`Analytics: ${e.name||"Event"}`;await triggerNativeShare(t,s)}async function shareReduxReport(e){const s=formatReduxReport(e),t=`Redux: ${e.type||"Action"}`;await triggerNativeShare(t,s)}async function shareLogReport(e){const s=formatLogReport(e),t=`Log: ${(e.type||"info").toUpperCase()} - ${e.message?.substring(0,30)||""}`;await triggerNativeShare(t,s)}