@buoy-gg/events 7.0.77 → 7.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/EventsCopySettingsView.js +1 -1
- package/lib/commonjs/components/ReactQueryEventDetail.js +1 -1
- package/lib/commonjs/components/UnifiedEventDetail.js +1 -1
- package/lib/commonjs/components/UnifiedEventList.js +1 -1
- package/lib/commonjs/sync/eventsSyncAdapter.js +1 -1
- package/lib/module/components/EventsCopySettingsView.js +1 -1
- package/lib/module/components/ReactQueryEventDetail.js +1 -1
- package/lib/module/components/UnifiedEventDetail.js +1 -1
- package/lib/module/components/UnifiedEventList.js +1 -1
- package/lib/module/sync/eventsSyncAdapter.js +1 -1
- package/lib/web/index.mjs +9 -9
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.EventsCopySettingsView=EventsCopySettingsView;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _copySettings=require("../types/copySettings");var _eventExportFormatter=require("../utils/eventExportFormatter");var _copySettingsStorage=require("../utils/copySettingsStorage");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");const SIZE_WARNING_THRESHOLD=50*1024;const SIZE_DANGER_THRESHOLD=200*1024;function formatBytes(r){if(r<1024)return`${r} B`;if(r<1024*1024)return`${(r/1024).toFixed(1)} KB`;return`${(r/(1024*1024)).toFixed(1)} MB`}function createMockEvents(){const r=Date.now();return[{id:"mock-1",source:"storage-async",timestamp:r-2e3,title:"Set Item",subtitle:"user_cart",status:"success",originalEvent:{action:"setItem",key:"user_cart",value:{items:2}}},{id:"mock-2",source:"react-query-query",timestamp:r-1500,title:"cart \u203A items",subtitle:"Fetching...",status:"pending",originalEvent:{type:"query-fetch-start",queryKey:["cart","items"]},correlationId:"rq-query-cart",sequenceInGroup:1},{id:"mock-3",source:"react-query-query",timestamp:r-1e3,title:"cart \u203A items",subtitle:"Success \xB7 500ms",status:"success",originalEvent:{type:"query-fetch-success",queryKey:["cart","items"],data:{items:[]}},correlationId:"rq-query-cart",sequenceInGroup:2},{id:"mock-4",source:"network",timestamp:r-500,title:"POST /api/checkout",subtitle:"402 \xB7 450ms",status:"error",originalEvent:{method:"POST",url:"/api/checkout",status:402,error:"Payment required"}}]}function EventsCopySettingsView({events:r=[],initialSettings:y=_copySettings.DEFAULT_COPY_SETTINGS,onSettingsChange:u}){const{isPro:m}=(0,_sharedUi.useFeatureGate)();const[e,v]=(0,_react.useState)(y);const[E,x]=(0,_react.useState)(false);const[D,h]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{let t=true;(0,_copySettingsStorage.loadCopySettings)().then(i=>{if(t&&i){v(i);u?.(i)}if(t){h(true)}});return()=>{t=false}},[u]);const a=(0,_react.useCallback)(t=>{v(t);u?.(t);(0,_copySettingsStorage.saveCopySettings)(t)},[u]);const n=r.length>0;const o=n?r:createMockEvents();const s=(0,_react.useMemo)(()=>(0,_copySettings.detectActivePreset)(e),[e]);const c=(0,_react.useMemo)(()=>(0,_eventExportFormatter.estimateExportSize)(o,e),[o,e]);const S=(0,_react.useMemo)(()=>{if(c>=SIZE_DANGER_THRESHOLD)return"danger";if(c>=SIZE_WARNING_THRESHOLD)return"warning";return"none"},[c]);const d=(0,_react.useCallback)(()=>{return(0,_eventExportFormatter.generateExport)(o,e)},[o,e]);const T=(0,_react.useCallback)(t=>{const i=_copySettings.COPY_PRESETS[t];a({...i,filterSources:[...i.filterSources]})},[a]);const A=(0,_react.useCallback)((t,i)=>{const[l,p]=t.split("::");if(l==="preset"){T(p);return}if(l==="include"){a({...e,[p]:!e[p]});return}if(l==="format"){a({...e,format:i});return}if(l==="timestamp"){a({...e,timestampFormat:i});return}if(l==="filter"){a({...e,filterMode:i});return}if(l==="threshold"){a({...e,dataSizeThreshold:i});return}},[e,a,T]);const g=(0,_react.useCallback)(()=>{const t=o.length;return(0,_jsxRuntime.jsx)(_sharedUi.ExportPreview,{expanded:E,onExpandedChange:x,summary:`${t} event${t!==1?"s":""} \xB7 ~${formatBytes(c)}${!n?" (mock data)":""}`,warningLevel:S,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},testIDs:{expand:`${_testIDs.EVENTS_TEST_ID}-preview-expand`,collapse:`${_testIDs.EVENTS_TEST_ID}-preview-collapse`,summary:`${_testIDs.EVENTS_TEST_ID}-preview-summary`,warning:`${_testIDs.EVENTS_TEST_ID}-preview-size-warning`},renderBody:()=>{const i=d();return e.format==="json"?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{testIDPrefix:`${_testIDs.EVENTS_TEST_ID}-preview-json`,data:JSON.parse(i),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[e.format==="mermaid"&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.mermaidHint,children:"\u{1F4A1} Paste into mermaid.live to visualize"}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:styles.previewScroll,nestedScrollEnabled:true,testID:`${_testIDs.EVENTS_TEST_ID}-preview-scroll`,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.previewText,selectable:m,testID:`${_testIDs.EVENTS_TEST_ID}-preview-text`,children:i})})]})}})},[E,o,e,c,S,n,d,m]);const f=(0,_react.useCallback)(()=>{const t=(0,_eventExportFormatter.getExportSummary)(o);const i=n?`${t.totalEvents} events`:"Mock data (no events captured)";return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statusLabel,testID:`${_testIDs.EVENTS_TEST_ID}-export-status`,children:i}),(0,_jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton,{value:d()})]})},[n,o,d]);const b=(0,_react.useMemo)(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:_copySettings.PRESET_METADATA.llm.label,icon:_sharedUi.Zap,color:_copySettings.PRESET_METADATA.llm.color,value:"llm",isActive:s==="llm",description:_copySettings.PRESET_METADATA.llm.description},{id:"preset::bugReport",label:_copySettings.PRESET_METADATA.bugReport.label,icon:_sharedUi.AlertTriangle,color:_copySettings.PRESET_METADATA.bugReport.color,value:"bugReport",isActive:s==="bugReport",description:_copySettings.PRESET_METADATA.bugReport.description},{id:"preset::json",label:_copySettings.PRESET_METADATA.json.label,icon:_sharedUi.FileCode,color:_copySettings.PRESET_METADATA.json.color,value:"json",isActive:s==="json",description:_copySettings.PRESET_METADATA.json.description},{id:"preset::errors",label:_copySettings.PRESET_METADATA.errors.label,icon:_sharedUi.XCircle,color:_copySettings.PRESET_METADATA.errors.color,value:"errors",isActive:s==="errors",description:_copySettings.PRESET_METADATA.errors.description},{id:"preset::minimal",label:_copySettings.PRESET_METADATA.minimal.label,icon:_sharedUi.FileText,color:_copySettings.PRESET_METADATA.minimal.color,value:"minimal",isActive:s==="minimal",description:_copySettings.PRESET_METADATA.minimal.description},{id:"preset::mermaid",label:_copySettings.PRESET_METADATA.mermaid.label,icon:_sharedUi.GitBranch,color:_copySettings.PRESET_METADATA.mermaid.color,value:"mermaid",isActive:s==="mermaid",description:_copySettings.PRESET_METADATA.mermaid.description},{id:"preset::custom",label:"Custom",icon:_sharedUi.Settings,color:_sharedUi.night.color.textSecondary,value:"custom",isActive:s===null,description:"User-configured"}]},{id:"include",title:"Include",type:"custom",data:[{id:"include::includeSource",label:"Source",value:"includeSource",isActive:e.includeSource},{id:"include::includeStatus",label:"Status",value:"includeStatus",isActive:e.includeStatus},{id:"include::includeTitle",label:"Title",value:"includeTitle",isActive:e.includeTitle},{id:"include::includeSubtitle",label:"Subtitle",value:"includeSubtitle",isActive:e.includeSubtitle},{id:"include::includeCorrelation",label:"Correlation",value:"includeCorrelation",isActive:e.includeCorrelation},{id:"include::includeDuration",label:"Duration",value:"includeDuration",isActive:e.includeDuration},{id:"include::includeSummaryHeader",label:"Summary",value:"includeSummaryHeader",isActive:e.includeSummaryHeader},{id:"include::includeEventData",label:"Data",value:"includeEventData",isActive:e.includeEventData}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"markdown",isActive:e.format==="markdown"},{id:"format::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:e.format==="json"},{id:"format::plaintext",label:"Text",icon:_sharedUi.Hash,color:_sharedUi.night.color.textSecondary,value:"plaintext",isActive:e.format==="plaintext"},{id:"format::mermaid",label:"Diagram",icon:_sharedUi.GitBranch,color:"#A855F7",value:"mermaid",isActive:e.format==="mermaid",description:"Mermaid sequence diagram"}]},{id:"timestamp",title:"Timestamps",type:"custom",data:[{id:"timestamp::relative",label:"Relative",value:"relative",isActive:e.timestampFormat==="relative",description:"+0ms, +150ms"},{id:"timestamp::absolute",label:"Absolute",value:"absolute",isActive:e.timestampFormat==="absolute",description:"ISO format"},{id:"timestamp::both",label:"Both",value:"both",isActive:e.timestampFormat==="both",description:"Both formats"}]},{id:"filter",title:"Filter Events",type:"custom",data:[{id:"filter::all",label:"All",value:"all",isActive:e.filterMode==="all"},{id:"filter::errors",label:"Errors",icon:_sharedUi.XCircle,color:_sharedUi.macOSColors.semantic.error,value:"errors",isActive:e.filterMode==="errors"},{id:"filter::success",label:"Success",color:_sharedUi.macOSColors.semantic.success,value:"success",isActive:e.filterMode==="success"},{id:"filter::pending",label:"Pending",color:_sharedUi.macOSColors.semantic.warning,value:"pending",isActive:e.filterMode==="pending"}]},{id:"llmOptimization",title:"LLM Optimization",type:"custom",data:[{id:"include::compactMode",label:"Compact",value:"compactMode",isActive:e.compactMode,description:"One line per event"},{id:"include::smartJsonParsing",label:"Smart JSON",value:"smartJsonParsing",isActive:e.smartJsonParsing,description:"Parse nested JSON"},{id:"include::reduxChangedOnly",label:"Redux Diff",value:"reduxChangedOnly",isActive:e.reduxChangedOnly,description:"Only show changes"},{id:"include::showStorageDiff",label:"Storage Diff",value:"showStorageDiff",isActive:e.showStorageDiff,description:"Show what changed"},{id:"include::stripVerboseFields",label:"Strip Noise",value:"stripVerboseFields",isActive:e.stripVerboseFields,description:"Remove images/descriptions"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:_sharedUi.Eye,content:g,headerActions:f},onFilterChange:A}),[e,s,A,g,f]);if(!m){return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.gatedContainer,contentContainerStyle:styles.gatedContent,testID:`${_testIDs.EVENTS_TEST_ID}-copy-settings-gated`,children:[(0,_jsxRuntime.jsx)(_sharedUi.ProFeatureBanner,{featureName:"Events Export",description:"Export event flows to share with your team, debug issues, or feed into AI tools.",benefits:["Export to Markdown, JSON, or plain text","Customizable presets (LLM-ready, Bug Report, JSON)","Share event flows with teammates","Feed event context directly to AI assistants"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.gatedPreview,children:(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...b})})]})}return(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...b})}const styles=_reactNative.StyleSheet.create({previewScroll:{maxHeight:300},previewText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.night.color.text,lineHeight:18},mermaidHint:{fontSize:11,color:_sharedUi.night.color.textSecondary,marginBottom:8,paddingHorizontal:8,paddingVertical:6,backgroundColor:"#A855F715",borderRadius:6,overflow:"hidden"},statusLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.night.color.textTertiary,marginRight:8},gatedContainer:{flex:1},gatedContent:{padding:12,gap:12},gatedPreview:{}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.EventsCopySettingsView=EventsCopySettingsView;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _copySettings=require("../types/copySettings");var _eventExportFormatter=require("../utils/eventExportFormatter");var _copySettingsStorage=require("../utils/copySettingsStorage");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");const SIZE_WARNING_THRESHOLD=50*1024;const SIZE_DANGER_THRESHOLD=200*1024;function formatBytes(r){if(r<1024)return`${r} B`;if(r<1024*1024)return`${(r/1024).toFixed(1)} KB`;return`${(r/(1024*1024)).toFixed(1)} MB`}function createMockEvents(){const r=Date.now();return[{id:"mock-1",source:"storage-async",timestamp:r-2e3,title:"Set Item",subtitle:"user_cart",status:"success",originalEvent:{action:"setItem",key:"user_cart",value:{items:2}}},{id:"mock-2",source:"react-query-query",timestamp:r-1500,title:"cart \u203A items",subtitle:"Fetching...",status:"pending",originalEvent:{type:"query-fetch-start",queryKey:["cart","items"]},correlationId:"rq-query-cart",sequenceInGroup:1},{id:"mock-3",source:"react-query-query",timestamp:r-1e3,title:"cart \u203A items",subtitle:"Success \xB7 500ms",status:"success",originalEvent:{type:"query-fetch-success",queryKey:["cart","items"],data:{items:[]}},correlationId:"rq-query-cart",sequenceInGroup:2},{id:"mock-4",source:"network",timestamp:r-500,title:"POST /api/checkout",subtitle:"402 \xB7 450ms",status:"error",originalEvent:{method:"POST",url:"/api/checkout",status:402,error:"Payment required"}}]}function EventsCopySettingsView({events:r=[],initialSettings:y=_copySettings.DEFAULT_COPY_SETTINGS,onSettingsChange:u}){const{isPro:m}=(0,_sharedUi.useFeatureGate)();const[e,v]=(0,_react.useState)(y);const[E,x]=(0,_react.useState)(false);const[D,h]=(0,_react.useState)(false);(0,_react.useEffect)(()=>{let t=true;(0,_copySettingsStorage.loadCopySettings)().then(i=>{if(t&&i){v(i);u?.(i)}if(t){h(true)}});return()=>{t=false}},[u]);const a=(0,_react.useCallback)(t=>{v(t);u?.(t);(0,_copySettingsStorage.saveCopySettings)(t)},[u]);const n=r.length>0;const o=n?r:createMockEvents();const s=(0,_react.useMemo)(()=>(0,_copySettings.detectActivePreset)(e),[e]);const c=(0,_react.useMemo)(()=>(0,_eventExportFormatter.estimateExportSize)(o,e),[o,e]);const S=(0,_react.useMemo)(()=>{if(c>=SIZE_DANGER_THRESHOLD)return"danger";if(c>=SIZE_WARNING_THRESHOLD)return"warning";return"none"},[c]);const d=(0,_react.useCallback)(()=>{return(0,_eventExportFormatter.generateExport)(o,e)},[o,e]);const T=(0,_react.useCallback)(t=>{const i=_copySettings.COPY_PRESETS[t];a({...i,filterSources:[...i.filterSources]})},[a]);const A=(0,_react.useCallback)((t,i)=>{const[l,p]=t.split("::");if(l==="preset"){T(p);return}if(l==="include"){a({...e,[p]:!e[p]});return}if(l==="format"){a({...e,format:i});return}if(l==="timestamp"){a({...e,timestampFormat:i});return}if(l==="filter"){a({...e,filterMode:i});return}if(l==="threshold"){a({...e,dataSizeThreshold:i});return}},[e,a,T]);const g=(0,_react.useCallback)(()=>{const t=o.length;return(0,_jsxRuntime.jsx)(_sharedUi.ExportPreview,{expanded:E,onExpandedChange:x,summary:`${t} event${t!==1?"s":""} \xB7 ~${formatBytes(c)}${!n?" (mock data)":""}`,warningLevel:S,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},testIDs:{expand:`${_testIDs.EVENTS_TEST_ID}-preview-expand`,collapse:`${_testIDs.EVENTS_TEST_ID}-preview-collapse`,summary:`${_testIDs.EVENTS_TEST_ID}-preview-summary`,warning:`${_testIDs.EVENTS_TEST_ID}-preview-size-warning`},renderBody:()=>{const i=d();return e.format==="json"?(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{testIDPrefix:`${_testIDs.EVENTS_TEST_ID}-preview-json`,data:JSON.parse(i),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true}):(0,_jsxRuntime.jsxs)(_reactNative.View,{children:[e.format==="mermaid"&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.mermaidHint,children:"\u{1F4A1} Paste into mermaid.live to visualize"}),(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.previewScroll,nestedScrollEnabled:true,testID:`${_testIDs.EVENTS_TEST_ID}-preview-scroll`,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.previewText,selectable:m,testID:`${_testIDs.EVENTS_TEST_ID}-preview-text`,children:i})})]})}})},[E,o,e,c,S,n,d,m]);const b=(0,_react.useCallback)(()=>{const t=(0,_eventExportFormatter.getExportSummary)(o);const i=n?`${t.totalEvents} events`:"Mock data (no events captured)";return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statusLabel,testID:`${_testIDs.EVENTS_TEST_ID}-export-status`,children:i}),(0,_jsxRuntime.jsx)(_sharedUi.ToolbarCopyButton,{value:d()})]})},[n,o,d]);const f=(0,_react.useMemo)(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:_copySettings.PRESET_METADATA.llm.label,icon:_sharedUi.Zap,color:_copySettings.PRESET_METADATA.llm.color,value:"llm",isActive:s==="llm",description:_copySettings.PRESET_METADATA.llm.description},{id:"preset::bugReport",label:_copySettings.PRESET_METADATA.bugReport.label,icon:_sharedUi.AlertTriangle,color:_copySettings.PRESET_METADATA.bugReport.color,value:"bugReport",isActive:s==="bugReport",description:_copySettings.PRESET_METADATA.bugReport.description},{id:"preset::json",label:_copySettings.PRESET_METADATA.json.label,icon:_sharedUi.FileCode,color:_copySettings.PRESET_METADATA.json.color,value:"json",isActive:s==="json",description:_copySettings.PRESET_METADATA.json.description},{id:"preset::errors",label:_copySettings.PRESET_METADATA.errors.label,icon:_sharedUi.XCircle,color:_copySettings.PRESET_METADATA.errors.color,value:"errors",isActive:s==="errors",description:_copySettings.PRESET_METADATA.errors.description},{id:"preset::minimal",label:_copySettings.PRESET_METADATA.minimal.label,icon:_sharedUi.FileText,color:_copySettings.PRESET_METADATA.minimal.color,value:"minimal",isActive:s==="minimal",description:_copySettings.PRESET_METADATA.minimal.description},{id:"preset::mermaid",label:_copySettings.PRESET_METADATA.mermaid.label,icon:_sharedUi.GitBranch,color:_copySettings.PRESET_METADATA.mermaid.color,value:"mermaid",isActive:s==="mermaid",description:_copySettings.PRESET_METADATA.mermaid.description},{id:"preset::custom",label:"Custom",icon:_sharedUi.Settings,color:_sharedUi.night.color.textSecondary,value:"custom",isActive:s===null,description:"User-configured"}]},{id:"include",title:"Include",type:"custom",data:[{id:"include::includeSource",label:"Source",value:"includeSource",isActive:e.includeSource},{id:"include::includeStatus",label:"Status",value:"includeStatus",isActive:e.includeStatus},{id:"include::includeTitle",label:"Title",value:"includeTitle",isActive:e.includeTitle},{id:"include::includeSubtitle",label:"Subtitle",value:"includeSubtitle",isActive:e.includeSubtitle},{id:"include::includeCorrelation",label:"Correlation",value:"includeCorrelation",isActive:e.includeCorrelation},{id:"include::includeDuration",label:"Duration",value:"includeDuration",isActive:e.includeDuration},{id:"include::includeSummaryHeader",label:"Summary",value:"includeSummaryHeader",isActive:e.includeSummaryHeader},{id:"include::includeEventData",label:"Data",value:"includeEventData",isActive:e.includeEventData}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:_sharedUi.FileText,color:_sharedUi.macOSColors.semantic.info,value:"markdown",isActive:e.format==="markdown"},{id:"format::json",label:"JSON",icon:_sharedUi.FileCode,color:_sharedUi.macOSColors.semantic.warning,value:"json",isActive:e.format==="json"},{id:"format::plaintext",label:"Text",icon:_sharedUi.Hash,color:_sharedUi.night.color.textSecondary,value:"plaintext",isActive:e.format==="plaintext"},{id:"format::mermaid",label:"Diagram",icon:_sharedUi.GitBranch,color:"#A855F7",value:"mermaid",isActive:e.format==="mermaid",description:"Mermaid sequence diagram"}]},{id:"timestamp",title:"Timestamps",type:"custom",data:[{id:"timestamp::relative",label:"Relative",value:"relative",isActive:e.timestampFormat==="relative",description:"+0ms, +150ms"},{id:"timestamp::absolute",label:"Absolute",value:"absolute",isActive:e.timestampFormat==="absolute",description:"ISO format"},{id:"timestamp::both",label:"Both",value:"both",isActive:e.timestampFormat==="both",description:"Both formats"}]},{id:"filter",title:"Filter Events",type:"custom",data:[{id:"filter::all",label:"All",value:"all",isActive:e.filterMode==="all"},{id:"filter::errors",label:"Errors",icon:_sharedUi.XCircle,color:_sharedUi.macOSColors.semantic.error,value:"errors",isActive:e.filterMode==="errors"},{id:"filter::success",label:"Success",color:_sharedUi.macOSColors.semantic.success,value:"success",isActive:e.filterMode==="success"},{id:"filter::pending",label:"Pending",color:_sharedUi.macOSColors.semantic.warning,value:"pending",isActive:e.filterMode==="pending"}]},{id:"llmOptimization",title:"LLM Optimization",type:"custom",data:[{id:"include::compactMode",label:"Compact",value:"compactMode",isActive:e.compactMode,description:"One line per event"},{id:"include::smartJsonParsing",label:"Smart JSON",value:"smartJsonParsing",isActive:e.smartJsonParsing,description:"Parse nested JSON"},{id:"include::reduxChangedOnly",label:"Redux Diff",value:"reduxChangedOnly",isActive:e.reduxChangedOnly,description:"Only show changes"},{id:"include::showStorageDiff",label:"Storage Diff",value:"showStorageDiff",isActive:e.showStorageDiff,description:"Show what changed"},{id:"include::stripVerboseFields",label:"Strip Noise",value:"stripVerboseFields",isActive:e.stripVerboseFields,description:"Remove images/descriptions"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:_sharedUi.Eye,content:g,headerActions:b},onFilterChange:A}),[e,s,A,g,b]);if(!m){return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.gatedContainer,contentContainerStyle:styles.gatedContent,testID:`${_testIDs.EVENTS_TEST_ID}-copy-settings-gated`,children:[(0,_jsxRuntime.jsx)(_sharedUi.ProFeatureBanner,{featureName:"Events Export",description:"Export event flows to share with your team, debug issues, or feed into AI tools.",benefits:["Export to Markdown, JSON, or plain text","Customizable presets (LLM-ready, Bug Report, JSON)","Share event flows with teammates","Feed event context directly to AI assistants"]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.gatedPreview,children:(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...f})})]})}return(0,_jsxRuntime.jsx)(_sharedUi.DynamicFilterView,{...f})}const styles=_reactNative.StyleSheet.create({previewScroll:{maxHeight:300},previewText:{fontFamily:_sharedUi.monoFont,fontSize:11,color:_sharedUi.night.color.text,lineHeight:18},mermaidHint:{fontSize:11,color:_sharedUi.night.color.textSecondary,marginBottom:8,paddingHorizontal:8,paddingVertical:6,backgroundColor:"#A855F715",borderRadius:6,overflow:"hidden"},statusLabel:{fontSize:11,fontWeight:"600",color:_sharedUi.night.color.textTertiary,marginRight:8},gatedContainer:{flex:1},gatedContent:{padding:12,gap:12},gatedPreview:{}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReactQueryEventDetail=void 0;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _jsxRuntime=require("react/jsx-runtime");const EVENT_TYPE_CONFIG={"query-fetch-start":{label:"Query Fetching",color:_sharedUi.night.color.accent,icon:"hourglass"},"query-fetch-success":{label:"Query Success",color:_sharedUi.buoyColors.success,icon:"checkmark"},"query-fetch-error":{label:"Query Error",color:_sharedUi.buoyColors.error,icon:"close"},"query-invalidated":{label:"Query Invalidated",color:_sharedUi.buoyColors.warning,icon:"refresh"},"mutation-start":{label:"Mutation Started",color:_sharedUi.night.color.accent,icon:"hourglass"},"mutation-success":{label:"Mutation Success",color:_sharedUi.buoyColors.success,icon:"checkmark"},"mutation-error":{label:"Mutation Error",color:_sharedUi.buoyColors.error,icon:"close"}};const ReactQueryEventDetail=exports.ReactQueryEventDetail=(0,_react.memo)(function r({event:o}){const e=o.originalEvent;const n=EVENT_TYPE_CONFIG[e.type]||{label:e.type,color:_sharedUi.night.color.textTertiary,icon:"help"};const t=e.type.startsWith("query-");const i=e.type.startsWith("mutation-");const l=(0,_react.useMemo)(()=>{const a=t?e.queryKey:e.mutationKey;if(!a){if(i&&e.mutationId!==void 0){return`Mutation #${e.mutationId}`}return"No key"}return(0,_sharedUi.displayValue)(a,true)},[e,t,i]);const s=new Date(e.timestamp);const c=s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});const d=t?!!e.queryData:!!e.mutationData;const u=t?!!e.queryError:!!e.mutationError;const h=i&&!!e.mutationVariables;return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.container,contentContainerStyle:styles.contentContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.eventTypeContainer,{borderColor:n.color+"4D"}],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.eventTypeHeader,{backgroundColor:n.color+"15",color:n.color}],children:n.label}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.eventTypeContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.keyRow,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{horizontal:true,style:styles.keyScrollView,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.keyText,children:l})}),(0,_jsxRuntime.jsx)(EventStatusChip,{type:e.type,color:n.color})]}),e.duration!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Duration:"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.valueText,children:[e.duration.toFixed(0),"ms"]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Timestamp:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.valueText,children:c})]}),t&&e.queryHash&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Query Hash:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.valueText,styles.hashText],numberOfLines:1,children:e.queryHash})]}),i&&e.mutationId!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Mutation ID:"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.valueText,children:["#",e.mutationId]})]})]})]})}),h&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.dataHeader,{color:_sharedUi.buoyColors.warning}],children:"Variables"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e.mutationVariables,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),d&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.dataHeader,{color:_sharedUi.buoyColors.success}],children:t?"Query Data":"Mutation Result"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t?e.queryData:e.mutationData,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),u&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.dataContainer,styles.errorContainer],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.dataHeader,styles.errorHeader],children:"Error"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t?e.queryError:e.mutationError,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.dataHeader,children:"Event Details"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e,showTypeFilter:true,rawMode:true,initialExpanded:false})})]})})]})});function EventStatusChip({type:r,color:o}){const e=()=>{if(r.includes("start"))return"PENDING";if(r.includes("success"))return"SUCCESS";if(r.includes("error"))return"ERROR";if(r.includes("invalidated"))return"INVALIDATED";return r.toUpperCase()};return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.statusChip,{backgroundColor:o+"15",borderColor:o+"33"}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.statusChipText,{color:o}],children:e()})})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},section:{marginBottom:12},eventTypeContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},eventTypeHeader:{paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},eventTypeContent:{padding:0},keyRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.separator},keyScrollView:{flex:1,marginRight:8},keyText:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,lineHeight:18,backgroundColor:_sharedUi.night.color.accentSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:_sharedUi.night.color.accentBorderStrong},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.separator},labelText:{fontSize:10,color:_sharedUi.night.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},valueText:{fontSize:12,color:_sharedUi.night.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:_sharedUi.monoFont},hashText:{flex:1,textAlign:"right",marginLeft:8},statusChip:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},statusChipText:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:_sharedUi.monoFont},dataContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accentBorderStrong,overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:_sharedUi.night.color.accentSoft,paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},dataContent:{padding:8},errorContainer:{borderColor:_sharedUi.buoyColors.error+"4D"},errorHeader:{backgroundColor:_sharedUi.buoyColors.error+"1A",color:_sharedUi.buoyColors.error,borderBottomColor:_sharedUi.buoyColors.error+"33"}});
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.ReactQueryEventDetail=void 0;var _react=require("react");var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _jsxRuntime=require("react/jsx-runtime");const EVENT_TYPE_CONFIG={"query-fetch-start":{label:"Query Fetching",color:_sharedUi.night.color.accent,icon:"hourglass"},"query-fetch-success":{label:"Query Success",color:_sharedUi.buoyColors.success,icon:"checkmark"},"query-fetch-error":{label:"Query Error",color:_sharedUi.buoyColors.error,icon:"close"},"query-invalidated":{label:"Query Invalidated",color:_sharedUi.buoyColors.warning,icon:"refresh"},"mutation-start":{label:"Mutation Started",color:_sharedUi.night.color.accent,icon:"hourglass"},"mutation-success":{label:"Mutation Success",color:_sharedUi.buoyColors.success,icon:"checkmark"},"mutation-error":{label:"Mutation Error",color:_sharedUi.buoyColors.error,icon:"close"}};const ReactQueryEventDetail=exports.ReactQueryEventDetail=(0,_react.memo)(function r({event:o}){const e=o.originalEvent;const n=EVENT_TYPE_CONFIG[e.type]||{label:e.type,color:_sharedUi.night.color.textTertiary,icon:"help"};const t=e.type.startsWith("query-");const i=e.type.startsWith("mutation-");const l=(0,_react.useMemo)(()=>{const a=t?e.queryKey:e.mutationKey;if(!a){if(i&&e.mutationId!==void 0){return`Mutation #${e.mutationId}`}return"No key"}return(0,_sharedUi.displayValue)(a,true)},[e,t,i]);const s=new Date(e.timestamp);const c=s.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});const d=t?!!e.queryData:!!e.mutationData;const u=t?!!e.queryError:!!e.mutationError;const h=i&&!!e.mutationVariables;return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.container,contentContainerStyle:styles.contentContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.eventTypeContainer,{borderColor:n.color+"4D"}],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.eventTypeHeader,{backgroundColor:n.color+"15",color:n.color}],children:n.label}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.eventTypeContent,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.keyRow,children:[(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{horizontal:true,style:styles.keyScrollView,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.keyText,children:l})}),(0,_jsxRuntime.jsx)(EventStatusChip,{type:e.type,color:n.color})]}),e.duration!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Duration:"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.valueText,children:[e.duration.toFixed(0),"ms"]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Timestamp:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.valueText,children:c})]}),t&&e.queryHash&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Query Hash:"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.valueText,styles.hashText],numberOfLines:1,children:e.queryHash})]}),i&&e.mutationId!==void 0&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.row,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.labelText,children:"Mutation ID:"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.valueText,children:["#",e.mutationId]})]})]})]})}),h&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.dataHeader,{color:_sharedUi.buoyColors.warning}],children:"Variables"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e.mutationVariables,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),d&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.dataHeader,{color:_sharedUi.buoyColors.success}],children:t?"Query Data":"Mutation Result"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t?e.queryData:e.mutationData,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),u&&(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.dataContainer,styles.errorContainer],children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.dataHeader,styles.errorHeader],children:"Error"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:t?e.queryError:e.mutationError,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.dataHeader,children:"Event Details"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContent,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{title:"",data:e,showTypeFilter:true,rawMode:true,initialExpanded:false})})]})})]})});function EventStatusChip({type:r,color:o}){const e=()=>{if(r.includes("start"))return"PENDING";if(r.includes("success"))return"SUCCESS";if(r.includes("error"))return"ERROR";if(r.includes("invalidated"))return"INVALIDATED";return r.toUpperCase()};return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.statusChip,{backgroundColor:o+"15",borderColor:o+"33"}],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.statusChipText,{color:o}],children:e()})})}const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},section:{marginBottom:12},eventTypeContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},eventTypeHeader:{paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},eventTypeContent:{padding:0},keyRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.separator},keyScrollView:{flex:1,marginRight:8},keyText:{fontSize:12,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont,lineHeight:18,backgroundColor:_sharedUi.night.color.accentSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:_sharedUi.night.color.accentBorderStrong},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.separator},labelText:{fontSize:10,color:_sharedUi.night.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},valueText:{fontSize:12,color:_sharedUi.night.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:_sharedUi.monoFont},hashText:{flex:1,textAlign:"right",marginLeft:8},statusChip:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},statusChipText:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:_sharedUi.monoFont},dataContainer:{minWidth:200,backgroundColor:_sharedUi.night.color.surface,borderRadius:6,borderWidth:1,borderColor:_sharedUi.night.color.accentBorderStrong,overflow:"hidden",shadowColor:_sharedUi.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:_sharedUi.night.color.accentSoft,paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:_sharedUi.night.color.accent,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:_sharedUi.monoFont},dataContent:{padding:8},errorContainer:{borderColor:_sharedUi.buoyColors.error+"4D"},errorHeader:{backgroundColor:_sharedUi.buoyColors.error+"1A",color:_sharedUi.buoyColors.error,borderBottomColor:_sharedUi.buoyColors.error+"33"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.UnifiedEventDetail=void 0;var _utils=require("@buoy-gg/shared-ui/utils");var _reactNative=require("react-native");var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _ReactQueryEventDetail=require("./ReactQueryEventDetail");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");function tryLoadOptionalDetailComponents(){const o={StorageEventDetailContent:null,ReduxActionDetailContent:null,NetworkEventDetailView:null,RenderDetailView:null,ZustandStateDetailContent:null,JotaiAtomDetailContent:null,RouteEventDetail:null};try{const e=(0,_utils.loadToolModule)("@buoy-gg/storage");o.StorageEventDetailContent=e.StorageEventDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/redux");o.ReduxActionDetailContent=e.ReduxActionDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/network");o.NetworkEventDetailView=e.NetworkEventDetailView}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/highlight-updates");o.RenderDetailView=e.RenderDetailView}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/zustand");o.ZustandStateDetailContent=e.ZustandStateDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/jotai");o.JotaiAtomDetailContent=e.JotaiAtomDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/route-events");o.RouteEventDetail=e.RouteEventDetail}catch{}return o}let optionalComponents;let componentVersion=-1;function getOptionalComponents(){if(!optionalComponents||componentVersion!==(0,_utils.getToolModuleVersion)()){optionalComponents=tryLoadOptionalDetailComponents();componentVersion=(0,_utils.getToolModuleVersion)()}return optionalComponents}const SOURCE_CONFIG={"storage-async":{label:"AsyncStorage",color:"#8B5CF6"},"storage-mmkv":{label:"MMKV",color:"#F59E0B"},redux:{label:"Redux",color:"#3B82F6"},network:{label:"Network",color:"#10B981"},"react-query":{label:"React Query",color:"#EC4899"},"react-query-query":{label:"Query",color:"#EC4899"},"react-query-mutation":{label:"Mutation",color:"#F97316"},route:{label:"Route",color:"#06B6D4"},zustand:{label:"Zustand",color:"#764ABC"},jotai:{label:"Jotai",color:"#14B8A6"},render:{label:"Render",color:"#F472B6"},three:{label:"Scene loads",color:"#F59E0B"},capacitor:{label:"Capacitor",color:"#119EFF"}};function isStorageEvent(o){return o==="storage-async"||o==="storage-mmkv"}function getValueType(o){const e=(0,_sharedUi.parseValue)(o);if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";if(typeof e==="boolean")return"boolean";if(typeof e==="number")return"number";if(typeof e==="string")return"string";if(typeof e==="object")return"object";return"undefined"}function PassThrough({children:o}){return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:o})}const UnifiedEventDetail=exports.UnifiedEventDetail=(0,_react.memo)(function o({event:e,onBack:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.UnifiedEventDetail=void 0;var _utils=require("@buoy-gg/shared-ui/utils");var _reactNative=require("react-native");var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _dataViewer=require("@buoy-gg/shared-ui/dataViewer");var _ReactQueryEventDetail=require("./ReactQueryEventDetail");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");function tryLoadOptionalDetailComponents(){const o={StorageEventDetailContent:null,ReduxActionDetailContent:null,NetworkEventDetailView:null,RenderDetailView:null,ZustandStateDetailContent:null,JotaiAtomDetailContent:null,RouteEventDetail:null};try{const e=(0,_utils.loadToolModule)("@buoy-gg/storage");o.StorageEventDetailContent=e.StorageEventDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/redux");o.ReduxActionDetailContent=e.ReduxActionDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/network");o.NetworkEventDetailView=e.NetworkEventDetailView}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/highlight-updates");o.RenderDetailView=e.RenderDetailView}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/zustand");o.ZustandStateDetailContent=e.ZustandStateDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/jotai");o.JotaiAtomDetailContent=e.JotaiAtomDetailContent}catch{}try{const e=(0,_utils.loadToolModule)("@buoy-gg/route-events");o.RouteEventDetail=e.RouteEventDetail}catch{}return o}let optionalComponents;let componentVersion=-1;function getOptionalComponents(){if(!optionalComponents||componentVersion!==(0,_utils.getToolModuleVersion)()){optionalComponents=tryLoadOptionalDetailComponents();componentVersion=(0,_utils.getToolModuleVersion)()}return optionalComponents}const SOURCE_CONFIG={"storage-async":{label:"AsyncStorage",color:"#8B5CF6"},"storage-mmkv":{label:"MMKV",color:"#F59E0B"},redux:{label:"Redux",color:"#3B82F6"},network:{label:"Network",color:"#10B981"},"react-query":{label:"React Query",color:"#EC4899"},"react-query-query":{label:"Query",color:"#EC4899"},"react-query-mutation":{label:"Mutation",color:"#F97316"},route:{label:"Route",color:"#06B6D4"},zustand:{label:"Zustand",color:"#764ABC"},jotai:{label:"Jotai",color:"#14B8A6"},render:{label:"Render",color:"#F472B6"},three:{label:"Scene loads",color:"#F59E0B"},capacitor:{label:"Capacitor",color:"#119EFF"}};function isStorageEvent(o){return o==="storage-async"||o==="storage-mmkv"}function getValueType(o){const e=(0,_sharedUi.parseValue)(o);if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";if(typeof e==="boolean")return"boolean";if(typeof e==="number")return"number";if(typeof e==="string")return"string";if(typeof e==="object")return"object";return"undefined"}function PassThrough({children:o}){return(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:o})}const UnifiedEventDetail=exports.UnifiedEventDetail=(0,_react.memo)(function o({event:e,onBack:x,NetworkEventDetailViewComponent:g,networkDetailWrapper:E,RouteEventDetailComponent:y,detailComponents:l,onNavigate:D}){const r=(0,_react.useMemo)(()=>({...getOptionalComponents(),...l}),[l,(0,_utils.getToolModuleVersion)()]);const a=SOURCE_CONFIG[e.source];const i=new Date(e.timestamp);const{values:T,toggle:h}=(0,_sharedUi.useIgnoredPatterns)();const s=(0,_react.useMemo)(()=>{if(!isStorageEvent(e.source))return null;if(!r.StorageEventDetailContent)return null;const n=e.originalEvent;const t={...n,timestamp:new Date(n.timestamp)};return{key:t.data?.key||"unknown",lastEvent:t,events:[t],totalOperations:1,currentValue:t.data?.value,valueType:getValueType(t.data?.value),storageTypes:new Set([t.storageType||"async"])}},[e,r]);if(s&&r.StorageEventDetailContent){const{StorageEventDetailContent:n}=r;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-storage`,children:(0,_jsxRuntime.jsx)(n,{conversation:s,selectedEventIndex:0,onEventIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="redux"&&r.ReduxActionDetailContent){const{ReduxActionDetailContent:n}=r;const t=e.originalEvent;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-redux`,children:(0,_jsxRuntime.jsx)(n,{action:t,actions:[t],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}const c=g??r.NetworkEventDetailView;if(e.source==="network"&&c){const n=e.originalEvent;const t=E??PassThrough;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:(0,_jsxRuntime.jsx)(t,{children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.content,testID:`${_testIDs.EVENTS_TEST_ID}-detail-network`,children:(0,_jsxRuntime.jsx)(c,{event:n,ignoredPatterns:T,onTogglePattern:h})})})})}if(e.source==="react-query"||e.source==="react-query-query"||e.source==="react-query-mutation"){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-react-query`,children:(0,_jsxRuntime.jsx)(_ReactQueryEventDetail.ReactQueryEventDetail,{event:e})})}if(e.source==="zustand"&&r.ZustandStateDetailContent){const{ZustandStateDetailContent:n}=r;const t=e.originalEvent;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-zustand`,children:(0,_jsxRuntime.jsx)(n,{change:t,changes:[t],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="jotai"&&r.JotaiAtomDetailContent){const{JotaiAtomDetailContent:n}=r;const t=e.originalEvent;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-jotai`,children:(0,_jsxRuntime.jsx)(n,{change:t,changes:[t],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="render"&&r.RenderDetailView){const{RenderDetailView:n}=r;const t=e.originalEvent;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.content,testID:`${_testIDs.EVENTS_TEST_ID}-detail-render`,children:(0,_jsxRuntime.jsx)(n,{render:t.render})})})}const d=y??r.RouteEventDetail;if(e.source==="route"&&d){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail-route`,children:(0,_jsxRuntime.jsx)(d,{event:e.originalEvent,onNavigate:D})})})}const u=()=>{return e.originalEvent};const m=async()=>{await(0,_sharedUi.copyToClipboard)({source:e.source,timestamp:i.toISOString(),title:e.title,subtitle:e.subtitle,data:u()})};return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,testID:`${_testIDs.EVENTS_TEST_ID}-detail`,children:(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{keyboardShouldPersistTaps:"handled",style:styles.content,contentContainerStyle:styles.contentContainer,testID:`${_testIDs.EVENTS_TEST_ID}-detail-scroll`,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sourceBadgeRow,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.sourceBadge,{backgroundColor:a.color+"20"}],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.sourceDot,{backgroundColor:a.color}]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.sourceLabel,{color:a.color}],testID:`${_testIDs.EVENTS_TEST_ID}-detail-source`,children:a.label})]})}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.title,testID:`${_testIDs.EVENTS_TEST_ID}-detail-title`,children:e.title}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.subtitle,testID:`${_testIDs.EVENTS_TEST_ID}-detail-subtitle`,children:e.subtitle}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.timestampRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.timestampLabel,children:"Timestamp"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.timestampValue,testID:`${_testIDs.EVENTS_TEST_ID}-detail-timestamp`,children:[i.toLocaleTimeString()," (",(0,_sharedUi.formatRelativeTime)(i),")"]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.dataSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionLabel,children:"Event Data"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.dataContainer,testID:`${_testIDs.EVENTS_TEST_ID}-detail-data`,children:(0,_jsxRuntime.jsx)(_dataViewer.DataViewer,{testIDPrefix:`${_testIDs.EVENTS_TEST_ID}-detail-data`,data:u(),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true})})]})]})})});const styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:"transparent"},content:{flex:1},contentContainer:{padding:16},sourceBadgeRow:{flexDirection:"row",marginBottom:12},sourceBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:6,borderRadius:12,gap:6},sourceDot:{width:6,height:6,borderRadius:3},sourceLabel:{fontSize:12,fontWeight:"600"},title:{fontSize:24,fontWeight:"700",color:_sharedUi.night.color.text,marginBottom:4},subtitle:{fontSize:16,color:_sharedUi.night.color.textTertiary,marginBottom:16},timestampRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:12,borderTopWidth:1,borderTopColor:_sharedUi.night.color.border,borderBottomWidth:1,borderBottomColor:_sharedUi.night.color.border,marginBottom:16},timestampLabel:{fontSize:14,color:_sharedUi.night.color.textTertiary},timestampValue:{fontSize:14,color:_sharedUi.night.color.text,fontFamily:_sharedUi.monoFont},dataSection:{marginTop:8},sectionLabel:{fontSize:12,fontWeight:"600",color:_sharedUi.night.color.textTertiary,textTransform:"uppercase",letterSpacing:.5,marginBottom:8},dataContainer:{backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,overflow:"hidden"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.UnifiedEventList=void 0;var _reactNative=require("react-native");var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _UnifiedEventItem=require("./UnifiedEventItem");var _correlationUtils=require("../utils/correlationUtils");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");const UnifiedEventList=exports.UnifiedEventList=(0,_react.memo)(function E({events:t,selectedEventId:a,expandedEventId:s,onEventPress:l,onNavigate:c,isCapturing:
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.UnifiedEventList=void 0;var _reactNative=require("react-native");var _react=require("react");var _sharedUi=require("@buoy-gg/shared-ui");var _UnifiedEventItem=require("./UnifiedEventItem");var _correlationUtils=require("../utils/correlationUtils");var _testIDs=require("../utils/testIDs");var _jsxRuntime=require("react/jsx-runtime");const UnifiedEventList=exports.UnifiedEventList=(0,_react.memo)(function E({events:t,selectedEventId:a,expandedEventId:s,onEventPress:l,onNavigate:c,isCapturing:h,hiddenEventsCount:r=0,onUpgradePress:d,searchText:u="",totalCount:o=0,sourceCount:g,enabledSourceCount:f}){const p=(0,_react.useMemo)(()=>(0,_correlationUtils.buildCorrelationCountMap)(t),[t]);const y=(0,_react.useCallback)(({item:e})=>{const n=e.correlationId?p.get(e.correlationId)||1:1;const i=(0,_correlationUtils.getCorrelationLabel)(e,t);const x=e.correlationId?(0,_correlationUtils.getCorrelationColor)(e.correlationId):void 0;return(0,_jsxRuntime.jsx)(_UnifiedEventItem.UnifiedEventItem,{event:e,isSelected:e.id===a,isExpanded:e.id===s,onPress:()=>l(e),onNavigate:c,correlationCount:n,correlationLabel:i,correlationColor:x})},[a,s,l,c,p,t]);const b=(0,_react.useCallback)(e=>e.id,[]);const m=(0,_react.useCallback)(()=>{if(r<=0)return null;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{style:styles.hiddenBanner,onPress:d,activeOpacity:.8,testID:`${_testIDs.EVENTS_TEST_ID}-hidden-banner`,accessibilityRole:"button",accessibilityLabel:`${r} hidden event${r!==1?"s":""}, upgrade for the full history`,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.hiddenBannerLeft,children:[(0,_jsxRuntime.jsx)(_sharedUi.Zap,{size:16,color:_sharedUi.night.color.accent}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.hiddenBannerText,testID:`${_testIDs.EVENTS_TEST_ID}-hidden-count`,children:[r," hidden event",r!==1?"s":""]})]}),(0,_jsxRuntime.jsx)(_sharedUi.ProBadge,{})]})},[r,d]);if(t.length===0){const e=g===0;const n=f===0;const i=e?{otto:"scanning",title:"No Event Sources",message:"This tool reports on the other Buoy tools.\nInstall one \u2014 network, storage, redux, routes \u2014 and its events land here."}:n&&!u.trim()&&o>0?{otto:"filtering",title:"Every Source Is Off",message:`${o} event${o===1?" is":"s are"} captured. Turn a source chip back on to see them.`}:(0,_sharedUi.resolveListEmptyState)({subject:"events",search:u,total:o,capturing:h,blocked:n?"Every source chip is off, so there is nothing to search. Turn one back on.":void 0,waiting:{otto:"listening",title:"No Events Yet",message:"Events will appear here as they occur.\nTry interacting with your app."},paused:{title:"Not Capturing",message:"Event capture is paused. Resume to see events."}});return(0,_jsxRuntime.jsx)(_sharedUi.ToolEmptyState,{...i,testID:`${_testIDs.EVENTS_TEST_ID}-empty`,style:styles.emptyContainer})}return(0,_jsxRuntime.jsx)(_reactNative.FlatList,{keyboardShouldPersistTaps:"handled",data:t,renderItem:y,keyExtractor:b,testID:`${_testIDs.EVENTS_TEST_ID}-list`,style:styles.list,contentContainerStyle:styles.listContent,ItemSeparatorComponent:()=>(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.separator}),ListFooterComponent:m,showsVerticalScrollIndicator:true,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,removeClippedSubviews:!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E)})});const styles=_reactNative.StyleSheet.create({list:{flex:1,backgroundColor:"transparent"},listContent:{paddingVertical:16},separator:{height:8},emptyContainer:{flex:1,justifyContent:"center",backgroundColor:"transparent"},hiddenBanner:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginHorizontal:16,marginTop:8,marginBottom:16,paddingVertical:12,paddingHorizontal:16,backgroundColor:_sharedUi.night.color.surface,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border},hiddenBannerLeft:{flexDirection:"row",alignItems:"center",gap:8},hiddenBannerText:{fontSize:13,fontWeight:"500",color:_sharedUi.night.color.text}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.eventsSyncAdapter=void 0;var _sharedUi=require("@buoy-gg/shared-ui");var _unifiedEventStore=require("../stores/unifiedEventStore");var _eventExportFormatter=require("../utils/eventExportFormatter");var _copySettings=require("../types/copySettings");const MAX_SYNC_ORIGINAL_EVENT_BYTES=16*1024;function truncatedMarker(e,r){return{__buoyTruncated:true,approxBytes:e,note:r??`Payload (\u2265${(e/1024).toFixed(0)}KB approx) exceeds the ${MAX_SYNC_ORIGINAL_EVENT_BYTES/1024}KB sync limit and stayed on the device. Open the tool on-device (or use the source tool's detail action) for the full payload.`}}const STATE_TREE_OMITTED={__buoyOmitted:"state-tree",note:"prevState/nextState stay on the device (use get_redux_state / the on-device tool)."};const QUERY_PAYLOAD_OMITTED={__buoyOmitted:"query-payload",note:"Query/mutation data stays on the device (open the Query tool or the on-device Events detail)."};const NETWORK_BODY_OMITTED={__buoyOmitted:"network-body",note:"Request/response body stays on the device (open the Network tool or the on-device Events detail)."};const NETWORK_HEADERS_OMITTED={__buoyOmitted:"network-headers",note:"Request/response headers stay on the device (open the Network tool or the on-device Events detail)."};const GRAPHQL_VARS_OMITTED={__buoyOmitted:"graphql-variables",note:"GraphQL variables stay on the device (open the Network tool or the on-device Events detail)."};const STORAGE_VALUE_OMITTED={__buoyOmitted:"storage-value",note:"Storage value stays on the device (open the Storage tool or the on-device Events detail)."};const ROUTE_PARAMS_OMITTED={__buoyOmitted:"route-params",note:"Navigation params stay on the device (open the Routes tool or the on-device Events detail)."};function isReactQuerySource(e){return e==="react-query"||e==="react-query-query"||e==="react-query-mutation"}function omitIfHeavy(e,r){if(e===void 0)return void 0;return(0,_sharedUi.isOverWireBudget)(e,MAX_SYNC_ORIGINAL_EVENT_BYTES)?{...r}:e}function wireQueryPayload(e){return omitIfHeavy(e,QUERY_PAYLOAD_OMITTED)}function wireError(e){if(e==null)return e;if(e instanceof Error){return{name:e.name,message:e.message}}return wireQueryPayload(e)}const compactionCache=new WeakMap;function compactEventForSync(e){const r=e.originalEvent;if(typeof r!=="object"||r===null)return e;const i=compactionCache.get(e);if(i!==void 0)return i;let n=e;let t=r;if((e.source==="redux"||e.source==="zustand")&&("prevState"in t||"nextState"in t)){t={...t,prevState:{...STATE_TREE_OMITTED},nextState:{...STATE_TREE_OMITTED},...e.source==="zustand"&&"partial"in t?{partial:{...STATE_TREE_OMITTED}}:{}};n={...e,originalEvent:t}}else if(e.source==="jotai"&&("prevValue"in t||"nextValue"in t)){t={...t,prevValue:{...STATE_TREE_OMITTED},nextValue:{...STATE_TREE_OMITTED}};n={...e,originalEvent:t}}else if(e.source==="render"){const o=t.render;const s=t.event;const a=c=>{if(!c||typeof c!=="object")return c;const{hookChanges:E
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.eventsSyncAdapter=void 0;var _sharedUi=require("@buoy-gg/shared-ui");var _unifiedEventStore=require("../stores/unifiedEventStore");var _eventExportFormatter=require("../utils/eventExportFormatter");var _copySettings=require("../types/copySettings");const MAX_SYNC_ORIGINAL_EVENT_BYTES=16*1024;function truncatedMarker(e,r){return{__buoyTruncated:true,approxBytes:e,note:r??`Payload (\u2265${(e/1024).toFixed(0)}KB approx) exceeds the ${MAX_SYNC_ORIGINAL_EVENT_BYTES/1024}KB sync limit and stayed on the device. Open the tool on-device (or use the source tool's detail action) for the full payload.`}}const STATE_TREE_OMITTED={__buoyOmitted:"state-tree",note:"prevState/nextState stay on the device (use get_redux_state / the on-device tool)."};const QUERY_PAYLOAD_OMITTED={__buoyOmitted:"query-payload",note:"Query/mutation data stays on the device (open the Query tool or the on-device Events detail)."};const NETWORK_BODY_OMITTED={__buoyOmitted:"network-body",note:"Request/response body stays on the device (open the Network tool or the on-device Events detail)."};const NETWORK_HEADERS_OMITTED={__buoyOmitted:"network-headers",note:"Request/response headers stay on the device (open the Network tool or the on-device Events detail)."};const GRAPHQL_VARS_OMITTED={__buoyOmitted:"graphql-variables",note:"GraphQL variables stay on the device (open the Network tool or the on-device Events detail)."};const STORAGE_VALUE_OMITTED={__buoyOmitted:"storage-value",note:"Storage value stays on the device (open the Storage tool or the on-device Events detail)."};const ROUTE_PARAMS_OMITTED={__buoyOmitted:"route-params",note:"Navigation params stay on the device (open the Routes tool or the on-device Events detail)."};function isReactQuerySource(e){return e==="react-query"||e==="react-query-query"||e==="react-query-mutation"}function omitIfHeavy(e,r){if(e===void 0)return void 0;return(0,_sharedUi.isOverWireBudget)(e,MAX_SYNC_ORIGINAL_EVENT_BYTES)?{...r}:e}function wireQueryPayload(e){return omitIfHeavy(e,QUERY_PAYLOAD_OMITTED)}function wireError(e){if(e==null)return e;if(e instanceof Error){return{name:e.name,message:e.message}}return wireQueryPayload(e)}const compactionCache=new WeakMap;function compactEventForSync(e){const r=e.originalEvent;if(typeof r!=="object"||r===null)return e;const i=compactionCache.get(e);if(i!==void 0)return i;let n=e;let t=r;if((e.source==="redux"||e.source==="zustand")&&("prevState"in t||"nextState"in t)){t={...t,prevState:{...STATE_TREE_OMITTED},nextState:{...STATE_TREE_OMITTED},...e.source==="zustand"&&"partial"in t?{partial:{...STATE_TREE_OMITTED}}:{}};n={...e,originalEvent:t}}else if(e.source==="jotai"&&("prevValue"in t||"nextValue"in t)){t={...t,prevValue:{...STATE_TREE_OMITTED},nextValue:{...STATE_TREE_OMITTED}};n={...e,originalEvent:t}}else if(e.source==="render"){const o=t.render;const s=t.event;const a=c=>{if(!c||typeof c!=="object")return c;const{hookChanges:p,...E}=c;return E};t={...t,render:o?{...o,renderHistory:void 0,lastRenderCause:a(o.lastRenderCause)}:o,event:s?{...s,capturedProps:void 0,capturedState:void 0,cause:a(s.cause)}:s};n={...e,originalEvent:t}}else if(isReactQuerySource(e.source)){const{query:o,mutation:s,...a}=t;t={...a,queryData:wireQueryPayload(a.queryData),mutationData:wireQueryPayload(a.mutationData),mutationVariables:wireQueryPayload(a.mutationVariables),queryError:wireError(a.queryError),mutationError:wireError(a.mutationError)};n={...e,originalEvent:t}}else if(e.source==="network"){const o=typeof t.requestSize==="number"?t.requestSize:void 0;const s=typeof t.responseSize==="number"?t.responseSize:void 0;t={...t,requestData:o!==void 0&&o>MAX_SYNC_ORIGINAL_EVENT_BYTES?{...NETWORK_BODY_OMITTED}:omitIfHeavy(t.requestData,NETWORK_BODY_OMITTED),responseData:s!==void 0&&s>MAX_SYNC_ORIGINAL_EVENT_BYTES?{...NETWORK_BODY_OMITTED}:omitIfHeavy(t.responseData,NETWORK_BODY_OMITTED),graphqlVariables:omitIfHeavy(t.graphqlVariables,GRAPHQL_VARS_OMITTED),requestHeaders:omitIfHeavy(t.requestHeaders,NETWORK_HEADERS_OMITTED),responseHeaders:omitIfHeavy(t.responseHeaders,NETWORK_HEADERS_OMITTED)};n={...e,originalEvent:t}}else if(e.source==="storage-async"||e.source==="storage-mmkv"){const o=t.data;if(o){t={...t,data:{...o,value:omitIfHeavy(o.value,STORAGE_VALUE_OMITTED),prevValue:omitIfHeavy(o.prevValue,STORAGE_VALUE_OMITTED),pairs:omitIfHeavy(o.pairs,STORAGE_VALUE_OMITTED)}};n={...e,originalEvent:t}}}else if(e.source==="route"){t={...t,params:omitIfHeavy(t.params,ROUTE_PARAMS_OMITTED)};n={...e,originalEvent:t}}const{bytes:u,sawRepeat:d,sawBigInt:l}=(0,_sharedUi.approxJsonSize)(t,MAX_SYNC_ORIGINAL_EVENT_BYTES);if(u>MAX_SYNC_ORIGINAL_EVENT_BYTES){n={...e,originalEvent:truncatedMarker(u)}}else if((d||l)&&!(0,_sharedUi.isJsonSerializable)(t)){n={...e,originalEvent:truncatedMarker(-1,"Payload is not JSON-serializable (cyclic or bigint) and stayed on the device.")}}compactionCache.set(e,n);return n}const eventsSyncAdapter=exports.eventsSyncAdapter={version:2,getSnapshot:()=>({events:_unifiedEventStore.unifiedEventStore.getEvents().map(compactEventForSync),availableSources:Array.from(_unifiedEventStore.unifiedEventStore.getAvailableEventSources())}),subscribe:e=>{_unifiedEventStore.unifiedEventStore.ensureRemoteSourcesDefault();const r=_unifiedEventStore.unifiedEventStore.subscribe(()=>e());return()=>{r();_unifiedEventStore.unifiedEventStore.clearRemoteSources()}},actions:{clearEvents:()=>{_unifiedEventStore.unifiedEventStore.clearEvents()},setEnabledSources:e=>{const r=e?.sources??[];_unifiedEventStore.unifiedEventStore.setRemoteEnabledSources(r);return{enabledSources:r}},exportEvents:e=>{const r=e??{};const i=r.preset&&_copySettings.COPY_PRESETS[r.preset]?_copySettings.COPY_PRESETS[r.preset]:_copySettings.DEFAULT_COPY_SETTINGS;const n={...i,...r.settings??{}};const t=(0,_eventExportFormatter.filterEvents)(_unifiedEventStore.unifiedEventStore.getEvents(),n);const u=typeof r.limit==="number"&&r.limit>0?r.limit:t.length;const d=t.slice(0,u);return{output:(0,_eventExportFormatter.generateExport)(d,n),returned:d.length,totalAvailable:t.length,includedData:n.includeEventData,format:n.format}}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{useCallback as m,useEffect as N,useMemo as S,useState as A}from"react";import{Text as x,StyleSheet as V,ScrollView as M,View as R}from"react-native";import{DynamicFilterView as $,macOSColors as f,night as g,FileText as q,FileCode as L,Hash as J,Zap as G,AlertTriangle as W,Settings as K,Eye as Z,XCircle as j,GitBranch as B,ToolbarCopyButton as U,useFeatureGate as Y,ProFeatureBanner as X,ExportPreview as Q,monoFont as ee}from"@buoy-gg/shared-ui";import{DataViewer as te}from"@buoy-gg/shared-ui/dataViewer";import{DEFAULT_COPY_SETTINGS as ie,COPY_PRESETS as re,PRESET_METADATA as t,detectActivePreset as oe}from"../types/copySettings";import{generateExport as ae,estimateExportSize as
|
|
1
|
+
"use strict";import{useCallback as m,useEffect as N,useMemo as S,useState as A}from"react";import{Text as x,StyleSheet as V,ScrollView as M,View as R}from"react-native";import{DynamicFilterView as $,macOSColors as f,night as g,FileText as q,FileCode as L,Hash as J,Zap as G,AlertTriangle as W,Settings as K,Eye as Z,XCircle as j,GitBranch as B,ToolbarCopyButton as U,useFeatureGate as Y,ProFeatureBanner as X,ExportPreview as Q,monoFont as ee}from"@buoy-gg/shared-ui";import{DataViewer as te}from"@buoy-gg/shared-ui/dataViewer";import{DEFAULT_COPY_SETTINGS as ie,COPY_PRESETS as re,PRESET_METADATA as t,detectActivePreset as oe}from"../types/copySettings";import{generateExport as ae,estimateExportSize as se,getExportSummary as le}from"../utils/eventExportFormatter";import{loadCopySettings as ne,saveCopySettings as ce}from"../utils/copySettingsStorage";import{EVENTS_TEST_ID as s}from"../utils/testIDs";import{jsx as a,jsxs as E,Fragment as de}from"react/jsx-runtime";const ue=50*1024;const me=200*1024;function pe(o){if(o<1024)return`${o} B`;if(o<1024*1024)return`${(o/1024).toFixed(1)} KB`;return`${(o/(1024*1024)).toFixed(1)} MB`}function ve(){const o=Date.now();return[{id:"mock-1",source:"storage-async",timestamp:o-2e3,title:"Set Item",subtitle:"user_cart",status:"success",originalEvent:{action:"setItem",key:"user_cart",value:{items:2}}},{id:"mock-2",source:"react-query-query",timestamp:o-1500,title:"cart \u203A items",subtitle:"Fetching...",status:"pending",originalEvent:{type:"query-fetch-start",queryKey:["cart","items"]},correlationId:"rq-query-cart",sequenceInGroup:1},{id:"mock-3",source:"react-query-query",timestamp:o-1e3,title:"cart \u203A items",subtitle:"Success \xB7 500ms",status:"success",originalEvent:{type:"query-fetch-success",queryKey:["cart","items"],data:{items:[]}},correlationId:"rq-query-cart",sequenceInGroup:2},{id:"mock-4",source:"network",timestamp:o-500,title:"POST /api/checkout",subtitle:"402 \xB7 450ms",status:"error",originalEvent:{method:"POST",url:"/api/checkout",status:402,error:"Payment required"}}]}export function EventsCopySettingsView({events:o=[],initialSettings:_=ie,onSettingsChange:b}){const{isPro:h}=Y();const[e,T]=A(_);const[D,H]=A(false);const[fe,z]=A(false);N(()=>{let i=true;ne().then(r=>{if(i&&r){T(r);b?.(r)}if(i){z(true)}});return()=>{i=false}},[b]);const l=m(i=>{T(i);b?.(i);ce(i)},[b]);const p=o.length>0;const n=p?o:ve();const c=S(()=>oe(e),[e]);const v=S(()=>se(n,e),[n,e]);const C=S(()=>{if(v>=me)return"danger";if(v>=ue)return"warning";return"none"},[v]);const y=m(()=>{return ae(n,e)},[n,e]);const P=m(i=>{const r=re[i];l({...r,filterSources:[...r.filterSources]})},[l]);const F=m((i,r)=>{const[u,w]=i.split("::");if(u==="preset"){P(w);return}if(u==="include"){l({...e,[w]:!e[w]});return}if(u==="format"){l({...e,format:r});return}if(u==="timestamp"){l({...e,timestampFormat:r});return}if(u==="filter"){l({...e,filterMode:r});return}if(u==="threshold"){l({...e,dataSizeThreshold:r});return}},[e,l,P]);const I=m(()=>{const i=n.length;return a(Q,{expanded:D,onExpandedChange:H,summary:`${i} event${i!==1?"s":""} \xB7 ~${pe(v)}${!p?" (mock data)":""}`,warningLevel:C,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},testIDs:{expand:`${s}-preview-expand`,collapse:`${s}-preview-collapse`,summary:`${s}-preview-summary`,warning:`${s}-preview-size-warning`},renderBody:()=>{const r=y();return e.format==="json"?a(te,{testIDPrefix:`${s}-preview-json`,data:JSON.parse(r),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true}):E(R,{children:[e.format==="mermaid"&&a(x,{style:d.mermaidHint,children:"\u{1F4A1} Paste into mermaid.live to visualize"}),a(M,{keyboardShouldPersistTaps:"handled",style:d.previewScroll,nestedScrollEnabled:true,testID:`${s}-preview-scroll`,children:a(x,{style:d.previewText,selectable:h,testID:`${s}-preview-text`,children:r})})]})}})},[D,n,e,v,C,p,y,h]);const O=m(()=>{const i=le(n);const r=p?`${i.totalEvents} events`:"Mock data (no events captured)";return E(de,{children:[a(x,{style:d.statusLabel,testID:`${s}-export-status`,children:r}),a(U,{value:y()})]})},[p,n,y]);const k=S(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:t.llm.label,icon:G,color:t.llm.color,value:"llm",isActive:c==="llm",description:t.llm.description},{id:"preset::bugReport",label:t.bugReport.label,icon:W,color:t.bugReport.color,value:"bugReport",isActive:c==="bugReport",description:t.bugReport.description},{id:"preset::json",label:t.json.label,icon:L,color:t.json.color,value:"json",isActive:c==="json",description:t.json.description},{id:"preset::errors",label:t.errors.label,icon:j,color:t.errors.color,value:"errors",isActive:c==="errors",description:t.errors.description},{id:"preset::minimal",label:t.minimal.label,icon:q,color:t.minimal.color,value:"minimal",isActive:c==="minimal",description:t.minimal.description},{id:"preset::mermaid",label:t.mermaid.label,icon:B,color:t.mermaid.color,value:"mermaid",isActive:c==="mermaid",description:t.mermaid.description},{id:"preset::custom",label:"Custom",icon:K,color:g.color.textSecondary,value:"custom",isActive:c===null,description:"User-configured"}]},{id:"include",title:"Include",type:"custom",data:[{id:"include::includeSource",label:"Source",value:"includeSource",isActive:e.includeSource},{id:"include::includeStatus",label:"Status",value:"includeStatus",isActive:e.includeStatus},{id:"include::includeTitle",label:"Title",value:"includeTitle",isActive:e.includeTitle},{id:"include::includeSubtitle",label:"Subtitle",value:"includeSubtitle",isActive:e.includeSubtitle},{id:"include::includeCorrelation",label:"Correlation",value:"includeCorrelation",isActive:e.includeCorrelation},{id:"include::includeDuration",label:"Duration",value:"includeDuration",isActive:e.includeDuration},{id:"include::includeSummaryHeader",label:"Summary",value:"includeSummaryHeader",isActive:e.includeSummaryHeader},{id:"include::includeEventData",label:"Data",value:"includeEventData",isActive:e.includeEventData}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:q,color:f.semantic.info,value:"markdown",isActive:e.format==="markdown"},{id:"format::json",label:"JSON",icon:L,color:f.semantic.warning,value:"json",isActive:e.format==="json"},{id:"format::plaintext",label:"Text",icon:J,color:g.color.textSecondary,value:"plaintext",isActive:e.format==="plaintext"},{id:"format::mermaid",label:"Diagram",icon:B,color:"#A855F7",value:"mermaid",isActive:e.format==="mermaid",description:"Mermaid sequence diagram"}]},{id:"timestamp",title:"Timestamps",type:"custom",data:[{id:"timestamp::relative",label:"Relative",value:"relative",isActive:e.timestampFormat==="relative",description:"+0ms, +150ms"},{id:"timestamp::absolute",label:"Absolute",value:"absolute",isActive:e.timestampFormat==="absolute",description:"ISO format"},{id:"timestamp::both",label:"Both",value:"both",isActive:e.timestampFormat==="both",description:"Both formats"}]},{id:"filter",title:"Filter Events",type:"custom",data:[{id:"filter::all",label:"All",value:"all",isActive:e.filterMode==="all"},{id:"filter::errors",label:"Errors",icon:j,color:f.semantic.error,value:"errors",isActive:e.filterMode==="errors"},{id:"filter::success",label:"Success",color:f.semantic.success,value:"success",isActive:e.filterMode==="success"},{id:"filter::pending",label:"Pending",color:f.semantic.warning,value:"pending",isActive:e.filterMode==="pending"}]},{id:"llmOptimization",title:"LLM Optimization",type:"custom",data:[{id:"include::compactMode",label:"Compact",value:"compactMode",isActive:e.compactMode,description:"One line per event"},{id:"include::smartJsonParsing",label:"Smart JSON",value:"smartJsonParsing",isActive:e.smartJsonParsing,description:"Parse nested JSON"},{id:"include::reduxChangedOnly",label:"Redux Diff",value:"reduxChangedOnly",isActive:e.reduxChangedOnly,description:"Only show changes"},{id:"include::showStorageDiff",label:"Storage Diff",value:"showStorageDiff",isActive:e.showStorageDiff,description:"Show what changed"},{id:"include::stripVerboseFields",label:"Strip Noise",value:"stripVerboseFields",isActive:e.stripVerboseFields,description:"Remove images/descriptions"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:Z,content:I,headerActions:O},onFilterChange:F}),[e,c,F,I,O]);if(!h){return E(M,{keyboardShouldPersistTaps:"handled",style:d.gatedContainer,contentContainerStyle:d.gatedContent,testID:`${s}-copy-settings-gated`,children:[a(X,{featureName:"Events Export",description:"Export event flows to share with your team, debug issues, or feed into AI tools.",benefits:["Export to Markdown, JSON, or plain text","Customizable presets (LLM-ready, Bug Report, JSON)","Share event flows with teammates","Feed event context directly to AI assistants"]}),a(R,{style:d.gatedPreview,children:a($,{...k})})]})}return a($,{...k})}const d=V.create({previewScroll:{maxHeight:300},previewText:{fontFamily:ee,fontSize:11,color:g.color.text,lineHeight:18},mermaidHint:{fontSize:11,color:g.color.textSecondary,marginBottom:8,paddingHorizontal:8,paddingVertical:6,backgroundColor:"#A855F715",borderRadius:6,overflow:"hidden"},statusLabel:{fontSize:11,fontWeight:"600",color:g.color.textTertiary,marginRight:8},gatedContainer:{flex:1},gatedContent:{padding:12,gap:12},gatedPreview:{}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{memo as S,useMemo as E}from"react";import{View as o,Text as a,StyleSheet as v,ScrollView as f}from"react-native";import{buoyColors as l,night as n,displayValue as k,monoFont as s}from"@buoy-gg/shared-ui";import{DataViewer as m}from"@buoy-gg/shared-ui/dataViewer";import{jsx as r,jsxs as i}from"react/jsx-runtime";const D={"query-fetch-start":{label:"Query Fetching",color:n.color.accent,icon:"hourglass"},"query-fetch-success":{label:"Query Success",color:l.success,icon:"checkmark"},"query-fetch-error":{label:"Query Error",color:l.error,icon:"close"},"query-invalidated":{label:"Query Invalidated",color:l.warning,icon:"refresh"},"mutation-start":{label:"Mutation Started",color:n.color.accent,icon:"hourglass"},"mutation-success":{label:"Mutation Success",color:l.success,icon:"checkmark"},"mutation-error":{label:"Mutation Error",color:l.error,icon:"close"}};export const ReactQueryEventDetail=S(function
|
|
1
|
+
"use strict";import{memo as S,useMemo as E}from"react";import{View as o,Text as a,StyleSheet as v,ScrollView as f}from"react-native";import{buoyColors as l,night as n,displayValue as k,monoFont as s}from"@buoy-gg/shared-ui";import{DataViewer as m}from"@buoy-gg/shared-ui/dataViewer";import{jsx as r,jsxs as i}from"react/jsx-runtime";const D={"query-fetch-start":{label:"Query Fetching",color:n.color.accent,icon:"hourglass"},"query-fetch-success":{label:"Query Success",color:l.success,icon:"checkmark"},"query-fetch-error":{label:"Query Error",color:l.error,icon:"close"},"query-invalidated":{label:"Query Invalidated",color:l.warning,icon:"refresh"},"mutation-start":{label:"Mutation Started",color:n.color.accent,icon:"hourglass"},"mutation-success":{label:"Mutation Success",color:l.success,icon:"checkmark"},"mutation-error":{label:"Mutation Error",color:l.error,icon:"close"}};export const ReactQueryEventDetail=S(function c({event:u}){const t=u.originalEvent;const h=D[t.type]||{label:t.type,color:n.color.textTertiary,icon:"help"};const d=t.type.startsWith("query-");const y=t.type.startsWith("mutation-");const g=E(()=>{const p=d?t.queryKey:t.mutationKey;if(!p){if(y&&t.mutationId!==void 0){return`Mutation #${t.mutationId}`}return"No key"}return k(p,true)},[t,d,y]);const b=new Date(t.timestamp);const C=b.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true});const x=d?!!t.queryData:!!t.mutationData;const w=d?!!t.queryError:!!t.mutationError;const T=y&&!!t.mutationVariables;return i(f,{keyboardShouldPersistTaps:"handled",style:e.container,contentContainerStyle:e.contentContainer,children:[r(o,{style:e.section,children:i(o,{style:[e.eventTypeContainer,{borderColor:h.color+"4D"}],children:[r(a,{style:[e.eventTypeHeader,{backgroundColor:h.color+"15",color:h.color}],children:h.label}),i(o,{style:e.eventTypeContent,children:[i(o,{style:e.keyRow,children:[r(f,{horizontal:true,style:e.keyScrollView,children:r(a,{style:e.keyText,children:g})}),r(H,{type:t.type,color:h.color})]}),t.duration!==void 0&&i(o,{style:e.row,children:[r(a,{style:e.labelText,children:"Duration:"}),i(a,{style:e.valueText,children:[t.duration.toFixed(0),"ms"]})]}),i(o,{style:e.row,children:[r(a,{style:e.labelText,children:"Timestamp:"}),r(a,{style:e.valueText,children:C})]}),d&&t.queryHash&&i(o,{style:e.row,children:[r(a,{style:e.labelText,children:"Query Hash:"}),r(a,{style:[e.valueText,e.hashText],numberOfLines:1,children:t.queryHash})]}),y&&t.mutationId!==void 0&&i(o,{style:e.row,children:[r(a,{style:e.labelText,children:"Mutation ID:"}),i(a,{style:e.valueText,children:["#",t.mutationId]})]})]})]})}),T&&r(o,{style:e.section,children:i(o,{style:e.dataContainer,children:[r(a,{style:[e.dataHeader,{color:l.warning}],children:"Variables"}),r(o,{style:e.dataContent,children:r(m,{title:"",data:t.mutationVariables,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),x&&r(o,{style:e.section,children:i(o,{style:e.dataContainer,children:[r(a,{style:[e.dataHeader,{color:l.success}],children:d?"Query Data":"Mutation Result"}),r(o,{style:e.dataContent,children:r(m,{title:"",data:d?t.queryData:t.mutationData,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),w&&r(o,{style:e.section,children:i(o,{style:[e.dataContainer,e.errorContainer],children:[r(a,{style:[e.dataHeader,e.errorHeader],children:"Error"}),r(o,{style:e.dataContent,children:r(m,{title:"",data:d?t.queryError:t.mutationError,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),r(o,{style:e.section,children:i(o,{style:e.dataContainer,children:[r(a,{style:e.dataHeader,children:"Event Details"}),r(o,{style:e.dataContent,children:r(m,{title:"",data:t,showTypeFilter:true,rawMode:true,initialExpanded:false})})]})})]})});function H({type:c,color:u}){const t=()=>{if(c.includes("start"))return"PENDING";if(c.includes("success"))return"SUCCESS";if(c.includes("error"))return"ERROR";if(c.includes("invalidated"))return"INVALIDATED";return c.toUpperCase()};return r(o,{style:[e.statusChip,{backgroundColor:u+"15",borderColor:u+"33"}],children:r(a,{style:[e.statusChipText,{color:u}],children:t()})})}const e=v.create({container:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},section:{marginBottom:12},eventTypeContainer:{minWidth:200,backgroundColor:n.color.surface,borderRadius:6,borderWidth:1,overflow:"hidden",shadowColor:n.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},eventTypeHeader:{paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,borderBottomWidth:1,borderBottomColor:n.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:s},eventTypeContent:{padding:0},keyRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:n.color.separator},keyScrollView:{flex:1,marginRight:8},keyText:{fontSize:12,color:n.color.text,fontFamily:s,lineHeight:18,backgroundColor:n.color.accentSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:n.color.accentBorderStrong},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:n.color.separator},labelText:{fontSize:10,color:n.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:s},valueText:{fontSize:12,color:n.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:s},hashText:{flex:1,textAlign:"right",marginLeft:8},statusChip:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},statusChipText:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:s},dataContainer:{minWidth:200,backgroundColor:n.color.surface,borderRadius:6,borderWidth:1,borderColor:n.color.accentBorderStrong,overflow:"hidden",shadowColor:n.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:n.color.accentSoft,paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:n.color.accent,borderBottomWidth:1,borderBottomColor:n.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:s},dataContent:{padding:8},errorContainer:{borderColor:l.error+"4D"},errorHeader:{backgroundColor:l.error+"1A",color:l.error,borderBottomColor:l.error+"33"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{loadToolModule as
|
|
1
|
+
"use strict";import{loadToolModule as d,getToolModuleVersion as h}from"@buoy-gg/shared-ui/utils";import{View as a,Text as u,StyleSheet as B,ScrollView as D}from"react-native";import{memo as F,useMemo as x}from"react";import{night as c,formatRelativeTime as A,copyToClipboard as $,parseValue as j,useIgnoredPatterns as z,monoFont as N}from"@buoy-gg/shared-ui";import{DataViewer as P}from"@buoy-gg/shared-ui/dataViewer";import{ReactQueryEventDetail as q}from"./ReactQueryEventDetail";import{EVENTS_TEST_ID as i}from"../utils/testIDs";import{Fragment as L,jsx as e,jsxs as g}from"react/jsx-runtime";function M(){const r={StorageEventDetailContent:null,ReduxActionDetailContent:null,NetworkEventDetailView:null,RenderDetailView:null,ZustandStateDetailContent:null,JotaiAtomDetailContent:null,RouteEventDetail:null};try{const t=d("@buoy-gg/storage");r.StorageEventDetailContent=t.StorageEventDetailContent}catch{}try{const t=d("@buoy-gg/redux");r.ReduxActionDetailContent=t.ReduxActionDetailContent}catch{}try{const t=d("@buoy-gg/network");r.NetworkEventDetailView=t.NetworkEventDetailView}catch{}try{const t=d("@buoy-gg/highlight-updates");r.RenderDetailView=t.RenderDetailView}catch{}try{const t=d("@buoy-gg/zustand");r.ZustandStateDetailContent=t.ZustandStateDetailContent}catch{}try{const t=d("@buoy-gg/jotai");r.JotaiAtomDetailContent=t.JotaiAtomDetailContent}catch{}try{const t=d("@buoy-gg/route-events");r.RouteEventDetail=t.RouteEventDetail}catch{}return r}let p;let S=-1;function W(){if(!p||S!==h()){p=M();S=h()}return p}const J={"storage-async":{label:"AsyncStorage",color:"#8B5CF6"},"storage-mmkv":{label:"MMKV",color:"#F59E0B"},redux:{label:"Redux",color:"#3B82F6"},network:{label:"Network",color:"#10B981"},"react-query":{label:"React Query",color:"#EC4899"},"react-query-query":{label:"Query",color:"#EC4899"},"react-query-mutation":{label:"Mutation",color:"#F97316"},route:{label:"Route",color:"#06B6D4"},zustand:{label:"Zustand",color:"#764ABC"},jotai:{label:"Jotai",color:"#14B8A6"},render:{label:"Render",color:"#F472B6"},three:{label:"Scene loads",color:"#F59E0B"},capacitor:{label:"Capacitor",color:"#119EFF"}};function O(r){return r==="storage-async"||r==="storage-mmkv"}function Z(r){const t=j(r);if(t===null)return"null";if(t===void 0)return"undefined";if(Array.isArray(t))return"array";if(typeof t==="boolean")return"boolean";if(typeof t==="number")return"number";if(typeof t==="string")return"string";if(typeof t==="object")return"object";return"undefined"}function _({children:r}){return e(L,{children:r})}export const UnifiedEventDetail=F(function r({event:t,onBack:U,NetworkEventDetailViewComponent:I,networkDetailWrapper:R,RouteEventDetailComponent:T,detailComponents:b,onNavigate:k}){const l=x(()=>({...W(),...b}),[b,h()]);const m=J[t.source];const y=new Date(t.timestamp);const{values:v,toggle:V}=z();const f=x(()=>{if(!O(t.source))return null;if(!l.StorageEventDetailContent)return null;const s=t.originalEvent;const n={...s,timestamp:new Date(s.timestamp)};return{key:n.data?.key||"unknown",lastEvent:n,events:[n],totalOperations:1,currentValue:n.data?.value,valueType:Z(n.data?.value),storageTypes:new Set([n.storageType||"async"])}},[t,l]);if(f&&l.StorageEventDetailContent){const{StorageEventDetailContent:s}=l;return e(a,{style:o.container,testID:`${i}-detail-storage`,children:e(s,{conversation:f,selectedEventIndex:0,onEventIndexChange:()=>{},disableInternalFooter:true})})}if(t.source==="redux"&&l.ReduxActionDetailContent){const{ReduxActionDetailContent:s}=l;const n=t.originalEvent;return e(a,{style:o.container,testID:`${i}-detail-redux`,children:e(s,{action:n,actions:[n],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}const C=I??l.NetworkEventDetailView;if(t.source==="network"&&C){const s=t.originalEvent;const n=R??_;return e(a,{style:o.container,children:e(n,{children:e(D,{keyboardShouldPersistTaps:"handled",style:o.content,testID:`${i}-detail-network`,children:e(C,{event:s,ignoredPatterns:v,onTogglePattern:V})})})})}if(t.source==="react-query"||t.source==="react-query-query"||t.source==="react-query-mutation"){return e(a,{style:o.container,testID:`${i}-detail-react-query`,children:e(q,{event:t})})}if(t.source==="zustand"&&l.ZustandStateDetailContent){const{ZustandStateDetailContent:s}=l;const n=t.originalEvent;return e(a,{style:o.container,testID:`${i}-detail-zustand`,children:e(s,{change:n,changes:[n],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(t.source==="jotai"&&l.JotaiAtomDetailContent){const{JotaiAtomDetailContent:s}=l;const n=t.originalEvent;return e(a,{style:o.container,testID:`${i}-detail-jotai`,children:e(s,{change:n,changes:[n],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(t.source==="render"&&l.RenderDetailView){const{RenderDetailView:s}=l;const n=t.originalEvent;return e(a,{style:o.container,children:e(D,{keyboardShouldPersistTaps:"handled",style:o.content,testID:`${i}-detail-render`,children:e(s,{render:n.render})})})}const w=T??l.RouteEventDetail;if(t.source==="route"&&w){return e(a,{style:o.container,children:e(a,{style:o.container,testID:`${i}-detail-route`,children:e(w,{event:t.originalEvent,onNavigate:k})})})}const E=()=>{return t.originalEvent};const Q=async()=>{await $({source:t.source,timestamp:y.toISOString(),title:t.title,subtitle:t.subtitle,data:E()})};return e(a,{style:o.container,testID:`${i}-detail`,children:g(D,{keyboardShouldPersistTaps:"handled",style:o.content,contentContainerStyle:o.contentContainer,testID:`${i}-detail-scroll`,children:[e(a,{style:o.sourceBadgeRow,children:g(a,{style:[o.sourceBadge,{backgroundColor:m.color+"20"}],children:[e(a,{style:[o.sourceDot,{backgroundColor:m.color}]}),e(u,{style:[o.sourceLabel,{color:m.color}],testID:`${i}-detail-source`,children:m.label})]})}),e(u,{style:o.title,testID:`${i}-detail-title`,children:t.title}),e(u,{style:o.subtitle,testID:`${i}-detail-subtitle`,children:t.subtitle}),g(a,{style:o.timestampRow,children:[e(u,{style:o.timestampLabel,children:"Timestamp"}),g(u,{style:o.timestampValue,testID:`${i}-detail-timestamp`,children:[y.toLocaleTimeString()," (",A(y),")"]})]}),g(a,{style:o.dataSection,children:[e(u,{style:o.sectionLabel,children:"Event Data"}),e(a,{style:o.dataContainer,testID:`${i}-detail-data`,children:e(P,{testIDPrefix:`${i}-detail-data`,data:E(),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true})})]})]})})});const o=B.create({container:{flex:1,backgroundColor:"transparent"},content:{flex:1},contentContainer:{padding:16},sourceBadgeRow:{flexDirection:"row",marginBottom:12},sourceBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:6,borderRadius:12,gap:6},sourceDot:{width:6,height:6,borderRadius:3},sourceLabel:{fontSize:12,fontWeight:"600"},title:{fontSize:24,fontWeight:"700",color:c.color.text,marginBottom:4},subtitle:{fontSize:16,color:c.color.textTertiary,marginBottom:16},timestampRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:12,borderTopWidth:1,borderTopColor:c.color.border,borderBottomWidth:1,borderBottomColor:c.color.border,marginBottom:16},timestampLabel:{fontSize:14,color:c.color.textTertiary},timestampValue:{fontSize:14,color:c.color.text,fontFamily:N},dataSection:{marginTop:8},sectionLabel:{fontSize:12,fontWeight:"600",color:c.color.textTertiary,textTransform:"uppercase",letterSpacing:.5,marginBottom:8},dataContainer:{backgroundColor:c.color.surface,borderRadius:8,borderWidth:1,borderColor:c.color.border,overflow:"hidden"}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{FlatList as
|
|
1
|
+
"use strict";import{FlatList as k,StyleSheet as B,View as C,Text as v,TouchableOpacity as $}from"react-native";import{memo as j,useCallback as d,useMemo as D}from"react";import{night as s,Zap as _,ProBadge as z,ToolEmptyState as N,resolveListEmptyState as O}from"@buoy-gg/shared-ui";import{UnifiedEventItem as P}from"./UnifiedEventItem";import{buildCorrelationCountMap as R,getCorrelationLabel as V,getCorrelationColor as F}from"../utils/correlationUtils";import{EVENTS_TEST_ID as l}from"../utils/testIDs";import{jsx as n,jsxs as p}from"react/jsx-runtime";export const UnifiedEventList=j(function M({events:o,selectedEventId:u,expandedEventId:f,onEventPress:m,onNavigate:h,isCapturing:S,hiddenEventsCount:r=0,onUpgradePress:g,searchText:y="",totalCount:i=0,sourceCount:I,enabledSourceCount:x}){const b=D(()=>R(o),[o]);const T=d(({item:e})=>{const a=e.correlationId?b.get(e.correlationId)||1:1;const c=V(e,o);const L=e.correlationId?F(e.correlationId):void 0;return n(P,{event:e,isSelected:e.id===u,isExpanded:e.id===f,onPress:()=>m(e),onNavigate:h,correlationCount:a,correlationLabel:c,correlationColor:L})},[u,f,m,h,b,o]);const w=d(e=>e.id,[]);const E=d(()=>{if(r<=0)return null;return p($,{style:t.hiddenBanner,onPress:g,activeOpacity:.8,testID:`${l}-hidden-banner`,accessibilityRole:"button",accessibilityLabel:`${r} hidden event${r!==1?"s":""}, upgrade for the full history`,children:[p(C,{style:t.hiddenBannerLeft,children:[n(_,{size:16,color:s.color.accent}),p(v,{style:t.hiddenBannerText,testID:`${l}-hidden-count`,children:[r," hidden event",r!==1?"s":""]})]}),n(z,{})]})},[r,g]);if(o.length===0){const e=I===0;const a=x===0;const c=e?{otto:"scanning",title:"No Event Sources",message:"This tool reports on the other Buoy tools.\nInstall one \u2014 network, storage, redux, routes \u2014 and its events land here."}:a&&!y.trim()&&i>0?{otto:"filtering",title:"Every Source Is Off",message:`${i} event${i===1?" is":"s are"} captured. Turn a source chip back on to see them.`}:O({subject:"events",search:y,total:i,capturing:S,blocked:a?"Every source chip is off, so there is nothing to search. Turn one back on.":void 0,waiting:{otto:"listening",title:"No Events Yet",message:"Events will appear here as they occur.\nTry interacting with your app."},paused:{title:"Not Capturing",message:"Event capture is paused. Resume to see events."}});return n(N,{...c,testID:`${l}-empty`,style:t.emptyContainer})}return n(k,{keyboardShouldPersistTaps:"handled",data:o,renderItem:T,keyExtractor:w,testID:`${l}-list`,style:t.list,contentContainerStyle:t.listContent,ItemSeparatorComponent:()=>n(C,{style:t.separator}),ListFooterComponent:E,showsVerticalScrollIndicator:true,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,removeClippedSubviews:!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E)})});const t=B.create({list:{flex:1,backgroundColor:"transparent"},listContent:{paddingVertical:16},separator:{height:8},emptyContainer:{flex:1,justifyContent:"center",backgroundColor:"transparent"},hiddenBanner:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginHorizontal:16,marginTop:8,marginBottom:16,paddingVertical:12,paddingHorizontal:16,backgroundColor:s.color.surface,borderRadius:8,borderWidth:1,borderColor:s.color.border},hiddenBannerLeft:{flexDirection:"row",alignItems:"center",gap:8},hiddenBannerText:{fontSize:13,fontWeight:"500",color:s.color.text}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{approxJsonSize as q,isJsonSerializable as D,isOverWireBudget as R}from"@buoy-gg/shared-ui";import{unifiedEventStore as u}from"../stores/unifiedEventStore";import{generateExport as
|
|
1
|
+
"use strict";import{approxJsonSize as q,isJsonSerializable as D,isOverWireBudget as R}from"@buoy-gg/shared-ui";import{unifiedEventStore as u}from"../stores/unifiedEventStore";import{filterEvents as A,generateExport as x}from"../utils/eventExportFormatter";import{DEFAULT_COPY_SETTINGS as V,COPY_PRESETS as _}from"../types/copySettings";const c=16*1024;function S(e,r){return{__buoyTruncated:true,approxBytes:e,note:r??`Payload (\u2265${(e/1024).toFixed(0)}KB approx) exceeds the ${c/1024}KB sync limit and stayed on the device. Open the tool on-device (or use the source tool's detail action) for the full payload.`}}const d={__buoyOmitted:"state-tree",note:"prevState/nextState stay on the device (use get_redux_state / the on-device tool)."};const I={__buoyOmitted:"query-payload",note:"Query/mutation data stays on the device (open the Query tool or the on-device Events detail)."};const y={__buoyOmitted:"network-body",note:"Request/response body stays on the device (open the Network tool or the on-device Events detail)."};const g={__buoyOmitted:"network-headers",note:"Request/response headers stay on the device (open the Network tool or the on-device Events detail)."};const k={__buoyOmitted:"graphql-variables",note:"GraphQL variables stay on the device (open the Network tool or the on-device Events detail)."};const h={__buoyOmitted:"storage-value",note:"Storage value stays on the device (open the Storage tool or the on-device Events detail)."};const w={__buoyOmitted:"route-params",note:"Navigation params stay on the device (open the Routes tool or the on-device Events detail)."};function z(e){return e==="react-query"||e==="react-query-query"||e==="react-query-mutation"}function a(e,r){if(e===void 0)return void 0;return R(e,c)?{...r}:e}function f(e){return a(e,I)}function v(e){if(e==null)return e;if(e instanceof Error){return{name:e.name,message:e.message}}return f(e)}const b=new WeakMap;function M(e){const r=e.originalEvent;if(typeof r!=="object"||r===null)return e;const l=b.get(e);if(l!==void 0)return l;let o=e;let t=r;if((e.source==="redux"||e.source==="zustand")&&("prevState"in t||"nextState"in t)){t={...t,prevState:{...d},nextState:{...d},...e.source==="zustand"&&"partial"in t?{partial:{...d}}:{}};o={...e,originalEvent:t}}else if(e.source==="jotai"&&("prevValue"in t||"nextValue"in t)){t={...t,prevValue:{...d},nextValue:{...d}};o={...e,originalEvent:t}}else if(e.source==="render"){const n=t.render;const i=t.event;const s=m=>{if(!m||typeof m!=="object")return m;const{hookChanges:N,...O}=m;return O};t={...t,render:n?{...n,renderHistory:void 0,lastRenderCause:s(n.lastRenderCause)}:n,event:i?{...i,capturedProps:void 0,capturedState:void 0,cause:s(i.cause)}:i};o={...e,originalEvent:t}}else if(z(e.source)){const{query:n,mutation:i,...s}=t;t={...s,queryData:f(s.queryData),mutationData:f(s.mutationData),mutationVariables:f(s.mutationVariables),queryError:v(s.queryError),mutationError:v(s.mutationError)};o={...e,originalEvent:t}}else if(e.source==="network"){const n=typeof t.requestSize==="number"?t.requestSize:void 0;const i=typeof t.responseSize==="number"?t.responseSize:void 0;t={...t,requestData:n!==void 0&&n>c?{...y}:a(t.requestData,y),responseData:i!==void 0&&i>c?{...y}:a(t.responseData,y),graphqlVariables:a(t.graphqlVariables,k),requestHeaders:a(t.requestHeaders,g),responseHeaders:a(t.responseHeaders,g)};o={...e,originalEvent:t}}else if(e.source==="storage-async"||e.source==="storage-mmkv"){const n=t.data;if(n){t={...t,data:{...n,value:a(n.value,h),prevValue:a(n.prevValue,h),pairs:a(n.pairs,h)}};o={...e,originalEvent:t}}}else if(e.source==="route"){t={...t,params:a(t.params,w)};o={...e,originalEvent:t}}const{bytes:p,sawRepeat:E,sawBigInt:T}=q(t,c);if(p>c){o={...e,originalEvent:S(p)}}else if((E||T)&&!D(t)){o={...e,originalEvent:S(-1,"Payload is not JSON-serializable (cyclic or bigint) and stayed on the device.")}}b.set(e,o);return o}export const eventsSyncAdapter={version:2,getSnapshot:()=>({events:u.getEvents().map(M),availableSources:Array.from(u.getAvailableEventSources())}),subscribe:e=>{u.ensureRemoteSourcesDefault();const r=u.subscribe(()=>e());return()=>{r();u.clearRemoteSources()}},actions:{clearEvents:()=>{u.clearEvents()},setEnabledSources:e=>{const r=e?.sources??[];u.setRemoteEnabledSources(r);return{enabledSources:r}},exportEvents:e=>{const r=e??{};const l=r.preset&&_[r.preset]?_[r.preset]:V;const o={...l,...r.settings??{}};const t=A(u.getEvents(),o);const p=typeof r.limit==="number"&&r.limit>0?r.limit:t.length;const E=t.slice(0,p);return{output:x(E,o),returned:E.length,totalAvailable:t.length,includedData:o.includeEventData,format:o.format}}}};
|
package/lib/web/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use client";var tr=Object.defineProperty;var uo=Object.getOwnPropertyDescriptor;var co=Object.getOwnPropertyNames;var po=Object.prototype.hasOwnProperty;var mo=(e,t)=>{for(var r in t)tr(e,r,{get:t[r],enumerable:true})},rr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of co(t))!po.call(e,a)&&a!==r&&tr(e,a,{get:()=>t[a],enumerable:!(o=uo(t,a))||o.enumerable});return e},ho=(e,t,r)=>(rr(e,t,"default"),r&&rr(r,t,"default"));var fs=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import{EventsIcon as go,EVENTS_ICON_COLOR as fo}from"@buoy-gg/floating-tools-core/web";var or={};mo(or,{AccessibilityInfo:()=>So,ActivityIndicator:()=>Ca,Alert:()=>cr,Animated:()=>ga,AppRegistry:()=>Co,AppState:()=>Eo,Appearance:()=>wo,BackHandler:()=>xo,Button:()=>Ea,CheckBox:()=>Oo,Clipboard:()=>ko,DeviceEventEmitter:()=>ta,Dimensions:()=>$o,Easing:()=>Do,FlatList:()=>ar,I18nManager:()=>Ao,Image:()=>Vo,ImageBackground:()=>Uo,InteractionManager:()=>Io,Keyboard:()=>To,KeyboardAvoidingView:()=>Lo,LayoutAnimation:()=>qo,Linking:()=>Bo,LogBox:()=>ea,Modal:()=>Sa,NativeEventEmitter:()=>Fo,NativeModules:()=>vo,PanResponder:()=>Ro,Picker:()=>Ho,PixelRatio:()=>jo,Platform:()=>Po,Pressable:()=>va,ProgressBar:()=>Ko,RefreshControl:()=>Jo,SafeAreaView:()=>Wo,ScrollView:()=>ue,SectionList:()=>_o,Share:()=>Mo,StatusBar:()=>Qo,StyleSheet:()=>le,Switch:()=>wa,Text:()=>$,TextInput:()=>fa,Touchable:()=>Go,TouchableHighlight:()=>ya,TouchableNativeFeedback:()=>Zo,TouchableOpacity:()=>ge,TouchableWithoutFeedback:()=>ba,UIManager:()=>zo,Vibration:()=>No,View:()=>f,VirtualizedList:()=>Yo,YellowBox:()=>Xo,findNodeHandle:()=>xa,unstable_createElement:()=>bo,useColorScheme:()=>ra,useLocaleContext:()=>oa,useWindowDimensions:()=>aa});ho(or,yo);import*as yo from"react-native-web";import{unstable_createElement as bo,NativeModules as vo,AccessibilityInfo as So,Appearance as wo,AppRegistry as Co,AppState as Eo,BackHandler as xo,Clipboard as ko,Dimensions as $o,Easing as Do,I18nManager as Ao,Keyboard as To,InteractionManager as Io,LayoutAnimation as qo,Linking as Bo,NativeEventEmitter as Fo,PanResponder as Ro,PixelRatio as jo,Platform as Po,Share as Mo,UIManager as zo,Vibration as No,CheckBox as Oo,FlatList as ar,Image as Vo,ImageBackground as Uo,KeyboardAvoidingView as Lo,Picker as Ho,ProgressBar as Ko,RefreshControl as Jo,SafeAreaView as Wo,SectionList as _o,StatusBar as Qo,Touchable as Go,TouchableNativeFeedback as Zo,VirtualizedList as Yo,YellowBox as Xo,LogBox as ea,DeviceEventEmitter as ta,useColorScheme as ra,useLocaleContext as oa,useWindowDimensions as aa}from"react-native-web";import*as H from"react-native-web";import{createElement as Ct,forwardRef as nr,useCallback as na,useRef as ia}from"react";import{useEffect as sa,useState as la}from"react";import{createPortal as ua}from"react-dom";var ca='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as da}from"react/jsx-runtime";var Le=Symbol.for("@buoy-gg/portal-host"),ir=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function sr(){let e=document;if(e[Le])return e[Le].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:ca});let r=()=>{let u=document.fullscreenElement,d=u&&u.tagName!=="CANVAS"?u:document.body;t.parentElement!==d&&d.appendChild(t)},o=new Map,a=u=>{(!t.contains(u.target)||!ir(u.target))&&o.set(u.code||u.key,{key:u.key,code:u.code,location:u.location,keyCode:u.keyCode,which:u.which,altKey:u.altKey,ctrlKey:u.ctrlKey,metaKey:u.metaKey,shiftKey:u.shiftKey})},n=u=>{o.delete(u.code||u.key)},s=()=>o.clear(),l=()=>{let u=[...o.values()];o.clear();for(let d of u)document.dispatchEvent(new KeyboardEvent("keyup",{...d,bubbles:true}))},i=u=>{ir(u.target)&&u.stopPropagation()},c=u=>u.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",s),t.addEventListener("focusin",l),t.addEventListener("keydown",i),t.addEventListener("keyup",i),t.addEventListener("keypress",i),t.addEventListener("wheel",c,{passive:true}),e[Le]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",s),t.remove(),delete e[Le]}},t}function pa({children:e}){let[t,r]=la(null);return sa(()=>{let o=sr(),a=document[Le];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?ua(da("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var Ie=H,ma=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],qe=e=>typeof e=="number"?`${e}px`:e;function Et(e){if(Array.isArray(e)){let d=e.map(Et);return d.some((p,y)=>p!==e[y])?d:e}if(!e||typeof e!="object"||!ma.some(d=>e[d]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:o,shadowRadius:a,textShadowColor:n,textShadowOffset:s,textShadowRadius:l,...i}=e;if(t!=null||r!=null||o!=null||a!=null){let d=t??"black",p=o==null?d:`color-mix(in srgb, ${d} ${Math.min(o,1)*100}%, transparent)`,y=`${qe(r?.width??0)} ${qe(r?.height??0)} ${qe(a??0)} ${p}`;i.boxShadow=typeof i.boxShadow=="string"?`${i.boxShadow}, ${y}`:i.boxShadow??y}let{width:c=0,height:u=0}=s??{};if(n&&(c||u||l)){let d=`${qe(c)} ${qe(u)} ${qe(l??0)} ${n}`;i.textShadow=i.textShadow?`${i.textShadow}, ${d}`:d}return i}var ha=Ie.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function lr(e,t){if(typeof e=="function")return o=>lr(e(o),t);let r=Et(e);return t?[r,ha[t]]:r}var le={...Ie.StyleSheet,create:e=>Ie.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Et(r)])))};function Y(e){let t=nr((o,a)=>{let{accessibilityState:n,accessibilityValue:s,pointerEvents:l,...i}=o;for(let u of["busy","checked","disabled","expanded","selected"])n?.[u]!==void 0&&i[`aria-${u}`]===void 0&&(i[`aria-${u}`]=n[u]);for(let[u,d]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[u]!==void 0&&i[`aria-${d}`]===void 0&&(i[`aria-${d}`]=s[u]);let c=lr(i.style,l);return c!==i.style&&(i.style=c),Ct(e,{...i,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var f=Y(H.View),$=Y(H.Text),ga={...Ie.Animated,View:Ie.Animated.createAnimatedComponent(f),Text:Ie.Animated.createAnimatedComponent($)},fa=Y(H.TextInput),ge=Y(H.TouchableOpacity),ya=Y(H.TouchableHighlight),ba=Y(H.TouchableWithoutFeedback),va=Y(H.Pressable),ue=Y(H.ScrollView),ur=nr((e,t)=>{let r=ia(null),o=na(a=>{if(a){let n=a;for(;n.parentElement&&n.parentElement!==document.body;)n=n.parentElement;n.parentElement===document.body&&(r.current=n,Object.assign(n.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),sr().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return Ct(pa,null,Ct(H.Modal,{...e,ref:o}))});ur.displayName="Modal";var Sa=Y(ur),wa=Y(H.Switch),Ca=Y(H.ActivityIndicator),Ea=Y(H.Button),xa=H.findNodeHandle,cr={alert(e,t,r,o){if(typeof document>"u")return;let a=document.createElement("dialog");a.dataset.buoyRoot="",a.setAttribute("aria-label",e),a.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let n=document.createElement("h2");if(n.textContent=e,n.style.cssText="font-size:18px;margin:0 0 12px",a.appendChild(n),t){let c=document.createElement("p");c.textContent=t,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",a.appendChild(c)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let l=r?.length?r:[{text:"OK"}],i=()=>{a.close?.(),a.remove()};for(let c of l){let u=document.createElement("button");u.type="button",u.textContent=c.text??"OK",u.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${c.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,u.onclick=()=>{i(),c.onPress?.()},s.appendChild(u)}a.addEventListener("cancel",c=>{c.preventDefault(),o?.cancelable!==false&&(i(),o?.onDismiss?.())}),a.appendChild(s),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};import{useState as it,useCallback as Be,useEffect as ka,useRef as $a}from"react";import{JsModal as Da,ModalHeader as X,buoyColors as Aa,night as ee,Trash2 as Ta,Copy as Ia,Search as qa,devToolsStorageKeys as Ba,ToolbarCopyButton as Fa,UpgradeModal as Ra,PowerToggleButton as ja,useSafeRouter as Pa,windowDragProps as Ma}from"@buoy-gg/shared-ui/web";import{useState as fe,useEffect as ye,useCallback as be,useMemo as ve,useRef as xt}from"react";import{useFeatureGate as za,subscribeToSubscriberCountChanges as Na,useIgnoredPatterns as Oa,useLimit as Va}from"@buoy-gg/shared-ui/web";import{appStorageEvent as dr,isDevToolsStorageKey as kt,isBuoyRequest as Ua,isUrlIgnored as La}from"@buoy-gg/shared-ui/web";function st(e){let t=e.originalEvent;if(!t)return false;if((e.source==="storage-async"||e.source==="storage-mmkv")&&(!dr(t)||typeof t.key=="string"&&kt(t.key)))return true;if(e.source==="capacitor"&&t.plugin==="Preferences"){let r=t.options?.key;if(typeof r=="string"&&kt(r))return true}return!!(e.source==="network"&&Ua(t.url||`https://${t.host||""}`))}function $t(e,t){if(e.source!=="network"||t.length===0)return false;let r=e.originalEvent?.url??"";return La(r,t)}function Ha(e,t){return st(e)||$t(e,t)}function pr(e){if(st(e))return null;let t=e.originalEvent;if(!t)return e;if(e.source==="storage-async"||e.source==="storage-mmkv"){let r=dr(t);if(!r)return null;if(r===t)return e;let o=r.data?.pairs?.length??r.data?.keys?.length;return{...e,originalEvent:r,subtitle:o===void 0?e.subtitle:`${o} key${o===1?"":"s"}`}}if(e.source==="capacitor"&&t.plugin==="Preferences"&&Array.isArray(t.result?.keys)){let r=t.result.keys.filter(o=>!kt(o));if(r.length!==t.result.keys.length)return{...e,originalEvent:{...t,result:{...t.result,keys:r}}}}return e}import{loadToolModule as K,getToolModuleVersion as mr}from"@buoy-gg/shared-ui/web/utils";var Ka=0;function ce(e){return`${e}-${Date.now()}-${++Ka}`}function Ja(){try{let{storageEventStore:e}=K("@buoy-gg/storage");return{id:"storage",name:"Storage",eventSources:["storage-async","storage-mmkv"],available:true,subscribe:t=>e.onEvent(r=>{if(r?.data?.initialScan)return;let o=Wa(r);t(o)})}}catch{return null}}function Wa(e){let t=e,r=t.storageType==="async"?"storage-async":"storage-mmkv",o=t.action;t.storageType==="async"&&(o={setItem:"Set Item",removeItem:"Remove Item",mergeItem:"Merge Item",clear:"Clear All",multiSet:"Multi Set",multiRemove:"Multi Remove",multiMerge:"Multi Merge"}[t.action]||t.action);let a="";if(t.storageType==="async")switch(t.action){case"setItem":case"removeItem":case"mergeItem":a=t.data?.key||"unknown key";break;case"multiSet":case"multiMerge":{let s=t.data?.pairs?.length||0;a=`${s} key${s!==1?"s":""}`;break}case"multiRemove":{let s=t.data?.keys?.length||0;a=`${s} key${s!==1?"s":""}`;break}case"clear":a="all keys";break}else a=t.data?.key||t.data?.instanceId||"unknown";let n="neutral";return(t.action.includes("set")||t.action.includes("Set")||t.action.includes("merge")||t.action.includes("Merge"))&&(n="success"),{id:ce(r),source:r,timestamp:t.timestamp.getTime(),title:o,subtitle:a,status:n,originalEvent:e}}function _a(){try{let{reduxActionStore:e}=K("@buoy-gg/redux"),t=null;return{id:"redux",name:"Redux",eventSources:["redux"],available:true,subscribe:r=>e.subscribe(o=>{if(o.length>0){let a=o[0];if(a.id!==t){t=a.id;let n=Qa(a);r(n)}}})}}catch{return null}}function Qa(e){let t=e,r="neutral";switch(t.category){case"fulfilled":r="success";break;case"rejected":r="error";break;case"pending":r="pending";break;default:r=t.hasStateChange?"success":"neutral"}let o="";return t.payloadPreview?o=t.payloadPreview:t.hasStateChange&&t.diffSummary?o=t.diffSummary:t.duration!==void 0?o=`${t.duration.toFixed(1)}ms`:o=t.sliceName||"",{id:ce("redux"),source:"redux",timestamp:t.timestamp,title:t.type,subtitle:o,status:r,originalEvent:e}}function Ga(){try{let{networkEventStore:e,networkListener:t,addNetworkListener:r}=K("@buoy-gg/network"),o=new Map;return{id:"network",name:"Network",eventSources:["network"],available:true,setup:()=>{let a=t();a.isActive||a.startListening(),a.listenerCount===0&&r(n=>{e.processNetworkEvent(n)})},subscribe:a=>{let n=Date.now();return e.onEvent(s=>{let l=s,i=o.get(l.id);if(i){let c=hr(s);c.id=i,a(c)}else{if(typeof l.timestamp=="number"&&l.timestamp<n)return;let c=hr(s);o.set(l.id,c.id),a(c)}},false)}}}catch{return null}}function hr(e){let t=e,r="neutral";t.status===void 0?r="pending":t.error||t.status>=400?r="error":t.status>=200&&t.status<400&&(r="success");let o=t.operationName||`${t.method} ${t.path||t.url}`,a=[];return t.status!==void 0?a.push(`${t.status}`):t.error?a.push("Error"):a.push("Pending"),t.duration!==void 0&&a.push(`${t.duration.toFixed(0)}ms`),t.host&&a.push(t.host),{id:ce("network"),source:"network",timestamp:t.timestamp,title:o,subtitle:a.join(" \xB7 "),status:r,originalEvent:e}}function Za(){try{let{reactQueryEventStore:e}=K("@buoy-gg/react-query"),t=null;return{id:"react-query",name:"React Query",eventSources:["react-query","react-query-query","react-query-mutation"],available:true,subscribe:r=>{let o=true,a=new Set,n=s=>s.queryHash??(s.mutationId!==void 0?`m-${s.mutationId}`:null);return e.subscribe(s=>{if(o){o=false,s.length>0&&(t=s[0].id);return}if(s.length>0){let l=s[0];if(l.id!==t){t=l.id;let i=l.type??"",c=n(l);if(i==="query-fetch-start"||i==="mutation-start")c&&a.add(c);else if((i==="query-fetch-success"||i==="query-fetch-error"||i==="mutation-success"||i==="mutation-error")&&c&&!a.has(c))return;let u=Ya(l);r(u)}}})}}}catch{return null}}function gr(e){return!e||e.length===0?"unknown":e.map(t=>{if(typeof t=="string")return t;if(typeof t=="number")return String(t);if(typeof t=="object"&&t!==null){let r=Object.values(t)[0];return typeof r=="string"||typeof r=="number"?String(r):JSON.stringify(t).slice(0,20)}return String(t)}).join(" \u203A ")}function Ya(e){let t=e,r=t.type.startsWith("mutation-")?"react-query-mutation":"react-query-query",o="neutral";switch(t.type){case"query-fetch-start":case"mutation-start":o="pending";break;case"query-fetch-success":case"mutation-success":o="success";break;case"query-fetch-error":case"mutation-error":o="error";break}let a="";t.queryKey?a=gr(t.queryKey):t.mutationKey?a=gr(t.mutationKey):t.mutationId!==void 0?a=`Mutation #${t.mutationId}`:a=t.type.replace(/-/g," ");let n=[];switch(t.type){case"query-fetch-start":n.push("Fetching");break;case"query-fetch-success":n.push("Success");break;case"query-fetch-error":n.push("Error");break;case"query-invalidated":n.push("Invalidated");break;case"mutation-start":n.push("Mutating");break;case"mutation-success":n.push("Success");break;case"mutation-error":n.push("Error");break}t.duration!==void 0&&n.push(`${t.duration.toFixed(0)}ms`);let s;t.queryHash?s=`rq-query-${t.queryHash}`:t.mutationId!==void 0&&(s=`rq-mutation-${t.mutationId}`);let l=1;switch(t.type){case"query-fetch-start":case"mutation-start":l=1;break;case"query-fetch-success":case"query-fetch-error":case"mutation-success":case"mutation-error":l=2;break;case"query-invalidated":l=3;break}return{id:ce(r),source:r,timestamp:t.timestamp,title:a,subtitle:n.join(" \xB7 "),status:o,originalEvent:e,correlationId:s,sequenceInGroup:l}}function Xa(){try{let{routeEventStore:e}=K("@buoy-gg/route-events");return{id:"route-events",name:"Routes",eventSources:["route"],available:true,subscribe:t=>e.onEvent(r=>{let o=en(r);t(o)})}}catch{return null}}function en(e){let t=e,r="neutral";(t.pathname==="/"||Object.keys(t.params).length>0)&&(r="success");let o=[],a=Object.keys(t.params).length;return a>0&&o.push(`${a} param${a!==1?"s":""}`),t.timeSincePrevious!==void 0&&t.timeSincePrevious>0&&(t.timeSincePrevious<1e3?o.push(`${t.timeSincePrevious}ms`):o.push(`${(t.timeSincePrevious/1e3).toFixed(1)}s`)),t.previousPathname&&t.previousPathname!==t.pathname&&o.push(`from ${t.previousPathname}`),{id:ce("route"),source:"route",timestamp:t.timestamp,title:t.pathname||"/",subtitle:o.join(" \xB7 ")||"navigation",status:r,originalEvent:e}}function tn(){try{let{zustandStateStore:e}=K("@buoy-gg/zustand"),t=null;return{id:"zustand",name:"Zustand",eventSources:["zustand"],available:true,subscribe:r=>e.subscribe(o=>{if(o.length>0){let a=o[0];if(a.id!==t){t=a.id;let n=rn(a);r(n)}}})}}catch{return null}}function rn(e){let t=e,r="neutral";t.isSlowUpdate?r="pending":t.hasStateChange&&(r="success");let o=[];if(t.changedKeys&&t.changedKeys.length>0){let a=t.changedKeys.slice(0,3).join(", "),n=t.changedKeys.length>3?` +${t.changedKeys.length-3}`:"";o.push(`${a}${n}`)}else t.diffSummary&&o.push(t.diffSummary);return t.duration!==void 0&&o.push(`${t.duration.toFixed(1)}ms`),t.category==="replace"&&o.push("replace"),{id:ce("zustand"),source:"zustand",timestamp:t.timestamp,title:t.storeName,subtitle:o.join(" \xB7 ")||(t.hasStateChange?"state changed":"no change"),status:r,originalEvent:e}}function on(){try{let{jotaiStateStore:e}=K("@buoy-gg/jotai"),t=null;return{id:"jotai",name:"Jotai",eventSources:["jotai"],available:true,subscribe:r=>e.subscribe(o=>{if(o.length>0){let a=o[0];if(a.id!==t){t=a.id;let n=an(a);r(n)}}})}}catch{return null}}function an(e){let t=e,r="neutral";t.category==="write"&&t.hasValueChange?r="success":t.category==="read"&&(r="neutral");let o=[];return t.valuePreview?o.push(t.valuePreview):t.diffSummary&&o.push(t.diffSummary),t.category&&o.push(t.category),{id:ce("jotai"),source:"jotai",timestamp:t.timestamp,title:t.atomLabel,subtitle:o.join(" \xB7 ")||(t.hasValueChange?"value changed":"no change"),status:r,originalEvent:e}}function nn(){let e;try{e=K("@buoy-gg/highlight-updates")}catch{return null}try{if(!e.RenderTracker||!e.HighlightUpdatesController)return null;let{RenderTracker:t,HighlightUpdatesController:r}=e;return{id:"render",name:"Render",eventSources:["render"],available:true,setup:()=>{r&&r.enableBackgroundTracking()},subscribe:o=>{r&&!r.isBackgroundTrackingEnabled()&&r.enableBackgroundTracking();let a=t.onRenderEvent((n,s)=>{let l=sn(n,s);o(l)});return()=>{a(),r.disableBackgroundTracking()}}}}catch{return null}}function sn(e,t){let r=e,o=t,a=o.componentName||o.displayName||o.viewType,n=[],s={mount:"mounted",props:"props changed",state:"state changed",hooks:"hooks changed",context:"context changed",parent:"parent re-rendered",unknown:"re-rendered"};if(n.push(s[r.cause.type]||r.cause.type),r.cause.type==="props"&&r.cause.changedKeys?.length){let i=r.cause.changedKeys.slice(0,3).join(", "),c=r.cause.changedKeys.length>3?` +${r.cause.changedKeys.length-3}`:"";n.push(`[${i}${c}]`)}if(r.cause.hookChanges?.length){let i=r.cause.hookChanges[0];i.description&&n.push(i.description)}n.push(`#${r.renderNumber}`);let l="neutral";switch(r.cause.type){case"mount":l="neutral";break;case"props":case"state":case"hooks":case"context":l="success";break;case"parent":l="pending";break;default:l="neutral"}return{id:ce("render"),source:"render",timestamp:r.timestamp,title:a,subtitle:n.join(" \xB7 "),status:l,originalEvent:{event:r,render:o}}}var ln=new Set(["CapacitorHttp","CapacitorCookies","Console","WebView"]),Dt=/token|secret|password|passwd|auth|credential|api[-_]?key|session|cookie/i;function lt(e,t=false,r=0){if(!e||typeof e!="object"||r>4)return e;if(Array.isArray(e))return e.map(s=>lt(s,t,r+1));let o={},a=e,n=t||typeof a.key=="string"&&Dt.test(a.key);for(let[s,l]of Object.entries(a))(Dt.test(s)||n&&s==="value")&&l!=null&&l!==""?o[s]="[hidden]":o[s]=lt(l,false,r+1);return o}function un(){try{let e=K("@buoy-gg/license");return typeof e?.subscribeCapacitorCalls!="function"||!e.isCapacitorBridgeInstalled?.()?null:{id:"capacitor",name:"Capacitor",eventSources:["capacitor"],available:true,subscribe:t=>{let r=new Set,o=0,a=()=>{let s=e.getCapacitorCalls();for(let i of s){if(i.seq<=o||r.has(i.seq))continue;if(ln.has(i.plugin)){r.add(i.seq);continue}(i.end!==void 0||i.kind==="event"||i.method==="addListener")&&(r.add(i.seq),t(cn(i)))}let l=s[0]?.seq??0;if(l>o+1){o=l-1;for(let i of Array.from(r))i<=o&&r.delete(i)}},n=e.getCapacitorCalls();return o=n.length?n[n.length-1].seq:0,e.subscribeCapacitorCalls(a)}}}catch{return null}}function cn(e){let t=[];if(e.kind==="event"?t.push("event"):e.method==="addListener"&&t.push(`listening for ${String(e.options.eventName??"events")}`),e.end!==void 0&&e.kind!=="event"&&t.push(`${Math.max(0,e.end-e.start)}ms`),e.answeredByBuoy&&t.push("answered by Buoy"),e.ok===false){let r=e.error?.message;t.push(typeof r=="string"?r:"failed")}return{id:ce("capacitor"),source:"capacitor",timestamp:e.kind==="event"?e.start:e.end??e.start,title:`${e.plugin}.${e.method}`,subtitle:t.join(" \xB7 ")||"call",status:e.ok===false?"error":e.kind==="event"?"neutral":"success",originalEvent:{plugin:e.plugin,method:e.method,kind:e.kind,options:lt(e.options),result:lt(e.result,typeof e.options.key=="string"&&Dt.test(e.options.key)),error:e.error,durationMs:e.end!==void 0?e.end-e.start:void 0,answeredByBuoy:e.answeredByBuoy??false}}}function dn(){let e=[],t=new Set,r=[Ja,_a,Ga,Za,Xa,tn,on,nn,un,()=>{try{let o=K("@buoy-gg/three");return o?.onThreeLoad?{id:"three",name:"Scene loads",eventSources:["three"],available:true,subscribe:o.onThreeLoad}:null}catch{return null}}];for(let o of r){let a=o();a&&a.available&&(e.push(a),a.eventSources.forEach(n=>t.add(n)))}return{sources:e,availableEventSources:t}}function pn(e){return{"storage-async":{label:"Storage",color:"#8B5CF6",icon:"server-outline"},"storage-mmkv":{label:"MMKV",color:"#F59E0B",icon:"flash-outline"},redux:{label:"Redux",color:"#3B82F6",icon:"git-branch-outline"},network:{label:"Network",color:"#10B981",icon:"globe-outline"},"react-query":{label:"Query",color:"#EC4899",icon:"sync-outline"},"react-query-query":{label:"Query",color:"#EC4899",icon:"sync-outline"},"react-query-mutation":{label:"Mutation",color:"#F97316",icon:"flash-outline"},route:{label:"Route",color:"#06B6D4",icon:"navigate-outline"},zustand:{label:"Zustand",color:"#764ABC",icon:"cube-outline"},jotai:{label:"Jotai",color:"#14B8A6",icon:"ellipse-outline"},render:{label:"Render",color:"#F472B6",icon:"layers-outline"},three:{label:"Scene loads",color:"#F59E0B",icon:"cube-outline"},capacitor:{label:"Capacitor",color:"#119EFF",icon:"hardware-chip-outline"}}[e]||{label:e,color:"#6B7280",icon:"help-outline"}}var At=null,fr=-1;function J(){return(!At||fr!==mr())&&(fr=mr(),At=dn()),At}function mn(){let e=[],t=0;try{let{storageEventStore:r}=K("@buoy-gg/storage"),o=r.getSubscriberCounts();e.push({sourceId:"storage",counts:o}),t+=o.total}catch{}try{let{networkEventStore:r}=K("@buoy-gg/network"),o=r.getSubscriberCounts();e.push({sourceId:"network",counts:o}),t+=o.total}catch{}try{let{routeEventStore:r}=K("@buoy-gg/route-events"),o=r.getSubscriberCounts();e.push({sourceId:"route-events",counts:o}),t+=o.total}catch{}try{let{RenderTracker:r,HighlightUpdatesController:o}=K("@buoy-gg/highlight-updates"),a=r.getRenderEventCallbackCount(),n=o?.isEnabled?.()?1:0,s={eventCallbacks:a,arrayListeners:n,total:a+n};e.push({sourceId:"render",counts:s}),t+=s.total}catch{}return{sources:e,totalSubscribers:t}}import{ChangeLog as hn}from"@buoy-gg/shared-ui/web";var Tt={"storage-async":"storage","storage-mmkv":"storage",redux:"redux",network:"network","react-query":"react-query","react-query-query":"react-query","react-query-mutation":"react-query",route:"route-events",zustand:"zustand",jotai:"jotai",render:"render",capacitor:"capacitor",three:"three"};var gn=200,yr=new Set(["render"]),fn=class extends hn{constructor(){super({max:gn});this.activeSources=new Set;this.remoteAvailableSources=null;this.sourceUnsubscribers=new Map;this.remoteDiscoveryIds=new Set;this.localDiscoveryIds=new Set;this.localSyncChain=Promise.resolve();this.networkEventIdMap=new Map}getDiscoveredSources(){return J().sources}getAvailableEventSources(){return this.remoteAvailableSources?this.remoteAvailableSources:J().availableEventSources}setRemoteAvailableSources(e){let t=e?new Set(e):null,r=this.remoteAvailableSources,o=r===null&&t===null||!!r&&!!t&&r.size===t.size&&[...t].every(a=>r.has(a));this.remoteAvailableSources=t,o||this.notifyListeners()}replaceEvents(e){e=e.map(pr).filter(t=>t!==null),this.activeSources=new Set(e.map(t=>t.source)),this.setItems(e)}async subscribeToAll(){let{sources:e}=J();for(let t of e)yr.has(t.id)||await this.subscribeToSource(t)}async subscribeToSource(e){let t=this.sourceUnsubscribers.get(e.id);if(t){t.refCount++;return}let r={unsubscribe:()=>{},refCount:1};this.sourceUnsubscribers.set(e.id,r);try{e.setup&&await e.setup();let o=await e.subscribe(a=>{this.addEvent(a)});o&&(r.unsubscribe=o)}catch{this.sourceUnsubscribers.get(e.id)===r&&r.refCount<=1&&this.sourceUnsubscribers.delete(e.id)}}unsubscribeFromSource(e){let t=this.sourceUnsubscribers.get(e);t&&(t.refCount--,t.refCount<=0&&(t.unsubscribe(),this.sourceUnsubscribers.delete(e)))}async subscribeToStorage(){let{sources:e}=J(),t=e.find(r=>r.id==="storage");t&&await this.subscribeToSource(t)}unsubscribeFromStorage(){this.unsubscribeFromSource("storage"),this.activeSources.delete("storage-async"),this.activeSources.delete("storage-mmkv")}subscribeToRedux(){let{sources:e}=J(),t=e.find(r=>r.id==="redux");t&&this.subscribeToSource(t)}unsubscribeFromRedux(){this.unsubscribeFromSource("redux"),this.activeSources.delete("redux")}subscribeToNetwork(){let{sources:e}=J(),t=e.find(r=>r.id==="network");t&&this.subscribeToSource(t)}unsubscribeFromNetwork(){this.unsubscribeFromSource("network"),this.activeSources.delete("network")}subscribeToReactQuery(){let{sources:e}=J(),t=e.find(r=>r.id==="react-query");t&&this.subscribeToSource(t)}unsubscribeFromReactQuery(){this.unsubscribeFromSource("react-query"),this.activeSources.delete("react-query"),this.activeSources.delete("react-query-query"),this.activeSources.delete("react-query-mutation")}subscribeToRoutes(){let{sources:e}=J(),t=e.find(r=>r.id==="route-events");t&&this.subscribeToSource(t)}unsubscribeFromRoutes(){this.unsubscribeFromSource("route-events"),this.activeSources.delete("route")}subscribeToZustand(){let{sources:e}=J(),t=e.find(r=>r.id==="zustand");t&&this.subscribeToSource(t)}unsubscribeFromZustand(){this.unsubscribeFromSource("zustand"),this.activeSources.delete("zustand")}subscribeToJotai(){let{sources:e}=J(),t=e.find(r=>r.id==="jotai");t&&this.subscribeToSource(t)}unsubscribeFromJotai(){this.unsubscribeFromSource("jotai"),this.activeSources.delete("jotai")}subscribeToRender(){let{sources:e}=J(),t=e.find(r=>r.id==="render");t&&this.subscribeToSource(t)}unsubscribeFromRender(){this.unsubscribeFromSource("render"),this.activeSources.delete("render")}addEvent(e){let t=pr(e);if(t){if(e=t,e.source==="network"){let r=e.originalEvent;if(r?.id){let o=this.networkEventIdMap.get(r.id);if(o){let a=this.items.findIndex(n=>n.id===o);if(a>=0){e.id=o,this.items=[...this.items.slice(0,a),e,...this.items.slice(a+1)],this.notifyListeners();return}}this.networkEventIdMap.set(r.id,e.id)}}this.push(e),this.activeSources.add(e.source),this.notifyListeners()}}getEvents(e){return!e||e.size===0?this.items:this.items.filter(t=>e.has(t.source))}getActiveSources(){return Array.from(this.activeSources)}getSourceCounts(){let e={"storage-async":0,"storage-mmkv":0,redux:0,network:0,"react-query":0,"react-query-query":0,"react-query-mutation":0,route:0,zustand:0,jotai:0,render:0,capacitor:0,three:0};for(let t of this.items)e[t.source]++;return e}clearEvents(){this.activeSources.clear(),this.networkEventIdMap.clear(),this.clear()}subscribe(e){let t=super.subscribe(e);return e(this.items),t}getEventCount(){return this.items.length}unsubscribeAll(){for(let[,e]of this.sourceUnsubscribers)e.unsubscribe();this.sourceUnsubscribers.clear(),this.activeSources.clear(),this.remoteDiscoveryIds.clear(),this.localDiscoveryIds.clear()}watch(e,t,r=Date.now()){let o=new Set(e),a=new Set;for(let c of e){let u=Tt[c];u&&a.add(u)}let{sources:n}=J(),s=[];for(let c of a){let u=n.find(d=>d.id===c);u&&(s.push(c),this.subscribeToSource(u))}let l=false,i=this.subscribe(c=>{l||t(c.filter(u=>u.timestamp>=r&&o.has(u.source)))});return()=>{if(!l){l=true,i();for(let c of s)this.unsubscribeFromSource(c)}}}setLocalEnabledSources(e){let t=async()=>{let r=new Set;for(let n of e){let s=Tt[n];s&&r.add(s)}let o=this.localDiscoveryIds;this.localDiscoveryIds=r;let{sources:a}=J();for(let n of r)if(!o.has(n)){let s=a.find(l=>l.id===n);s&&await this.subscribeToSource(s)}for(let n of o)r.has(n)||this.unsubscribeFromSource(n)};return this.localSyncChain=this.localSyncChain.then(t,t),this.localSyncChain}async setRemoteEnabledSources(e){let{sources:t}=J(),r;if(e==="all")r=new Set(t.map(a=>a.id).filter(a=>!yr.has(a)));else{r=new Set;for(let a of e){let n=Tt[a];n&&r.add(n)}}let o=this.remoteDiscoveryIds;this.remoteDiscoveryIds=r;for(let a of r)if(!o.has(a)){let n=t.find(s=>s.id===a);n&&await this.subscribeToSource(n)}for(let a of o)r.has(a)||this.unsubscribeFromSource(a)}ensureRemoteSourcesDefault(){this.remoteDiscoveryIds.size===0&&this.setRemoteEnabledSources("all")}clearRemoteSources(){for(let e of this.remoteDiscoveryIds)this.unsubscribeFromSource(e);this.remoteDiscoveryIds.clear()}isSourceSubscribed(e){switch(e){case"storage-async":case"storage-mmkv":return this.sourceUnsubscribers.has("storage");case"redux":return this.sourceUnsubscribers.has("redux");case"network":return this.sourceUnsubscribers.has("network");case"react-query":case"react-query-query":case"react-query-mutation":return this.sourceUnsubscribers.has("react-query");case"route":return this.sourceUnsubscribers.has("route-events");case"zustand":return this.sourceUnsubscribers.has("zustand");case"jotai":return this.sourceUnsubscribers.has("jotai");case"render":return this.sourceUnsubscribers.has("render");case"three":return this.sourceUnsubscribers.has("three");case"capacitor":return this.sourceUnsubscribers.has("capacitor");default:return false}}getSubscriptionStatus(){return{"storage-async":this.sourceUnsubscribers.has("storage"),"storage-mmkv":this.sourceUnsubscribers.has("storage"),redux:this.sourceUnsubscribers.has("redux"),network:this.sourceUnsubscribers.has("network"),"react-query":this.sourceUnsubscribers.has("react-query"),"react-query-query":this.sourceUnsubscribers.has("react-query"),"react-query-mutation":this.sourceUnsubscribers.has("react-query"),route:this.sourceUnsubscribers.has("route-events"),zustand:this.sourceUnsubscribers.has("zustand"),jotai:this.sourceUnsubscribers.has("jotai"),render:this.sourceUnsubscribers.has("render"),capacitor:this.sourceUnsubscribers.has("capacitor"),three:this.sourceUnsubscribers.has("three")}}getSubscriberCounts(){return mn()}},V=new fn;var yn=e=>V.getEvents(e);var bn=()=>V.clearEvents(),vn=e=>V.subscribe(e);var br=e=>V.setLocalEnabledSources(e);var vr=()=>V.getAvailableEventSources();var Sn=(e,t,r)=>V.watch(e,t,r),Sr=()=>V.getSubscriberCounts();import{persistentStorage as Se,devToolsStorageKeys as Fe}from"@buoy-gg/shared-ui/web";async function wn(e){try{let t=Fe.events.enabledSources();await Se.setItem(t,JSON.stringify(e))}catch{}}async function Cn(){try{let e=Fe.events.enabledSources(),t=await Se.getItem(e);return t&&t!==""?JSON.parse(t):null}catch{return null}}async function En(e){try{let t=Fe.events.isCapturing();await Se.setItem(t,JSON.stringify(e))}catch{}}async function xn(){try{let e=Fe.events.isCapturing(),t=await Se.getItem(e);return t!==null&&t!==""?JSON.parse(t):null}catch{return null}}async function wr(e){try{let t=Fe.events.pausedAt();e===null?await Se.removeItem(t):await Se.setItem(t,JSON.stringify(e))}catch{}}async function kn(){try{let e=Fe.events.pausedAt(),t=await Se.getItem(e);if(t!==null&&t!==""){let r=JSON.parse(t);return typeof r=="number"?r:null}return null}catch{return null}}function $n(e,t){if(e.title.toLowerCase().includes(t)||e.subtitle.toLowerCase().includes(t))return true;let r=e.originalEvent?.url;return typeof r=="string"&&r.toLowerCase().includes(t)}var Cr=["storage-async","redux","network","react-query-query","react-query-mutation","route","zustand","jotai","render","capacitor"],Er=Cr.filter(e=>e!=="render"),It={"storage-async":["storage-async","storage-mmkv"],"storage-mmkv":["storage-mmkv"],redux:["redux"],network:["network"],"react-query":["react-query","react-query-query"],"react-query-query":["react-query","react-query-query"],"react-query-mutation":["react-query-mutation"],route:["route"],zustand:["zustand"],jotai:["jotai"],render:["render"],capacitor:["capacitor"],three:["three"]};function qt(e){let{isPro:t}=za(),r=Va("events.entries"),{patterns:o}=Oa(),[a,n]=fe([]),[s,l]=fe(()=>new Set(Er)),[i,c]=fe(true),[u,d]=fe(""),p=xt(false),y=e?.capturingOverride??i,v=xt(null),h=xt([]),[b,m]=fe(0);ye(()=>{y?v.current!==null&&(h.current=[...h.current,[v.current,Date.now()]],v.current=null,m(C=>C+1),wr(null)):v.current===null&&(v.current=Date.now(),m(C=>C+1),wr(v.current))},[y]);let g=be(C=>{let F=v.current;if(F!==null&&C>F)return true;for(let[P,G]of h.current)if(C>P&&C<=G)return true;return false},[]),[k,L]=fe(()=>vr()),[w,T]=fe(0);ye(()=>Na(()=>{T(C=>C+1)}),[]);let x=ve(()=>Cr.filter(C=>(It[C]||[C]).some(F=>k.has(F))),[k]);ye(()=>{let C=null,F=vn(()=>{C==null&&(C=requestAnimationFrame(()=>{C=null,P()}))}),P=()=>{let G=yn();n(G),L(q=>{let R=vr();return q.size===R.size&&[...R].every(ne=>q.has(ne))?q:new Set(R)})};return()=>{F(),C!=null&&cancelAnimationFrame(C)}},[]),ye(()=>{(async()=>{let C=await Cn(),F,P=x.filter(R=>Er.includes(R));if(C&&C.length>0){let R=C.filter(ne=>x.includes(ne));R.length>0?F=new Set(R):F=new Set(P)}else F=new Set(P);l(F);let G=await xn(),q=G!==null?G:true;if(!q&&v.current===null){let R=await kn();v.current=R??Date.now(),m(ne=>ne+1)}c(q),p.current=true,br(q?Array.from(F):[])})()},[x]),ye(()=>{p.current&&br(i?Array.from(s):[])},[s,i]),ye(()=>{p.current&&wn(Array.from(s))},[s]),ye(()=>{p.current&&En(i)},[i]);let j=ve(()=>{let C=new Set;return s.forEach(F=>{let P=It[F];P&&P.forEach(G=>C.add(G))}),C},[s]),N=u.trim().toLowerCase(),me=ve(()=>a.filter(C=>!g(C.timestamp)&&!st(C)&&!$t(C,o)),[a,o,g,b]),_=ve(()=>j.size===0?[]:me.filter(C=>j.has(C.source)&&(N===""||$n(C,N))),[me,j,N]),he=ve(()=>_.slice(0,r),[_,r]),Q=ve(()=>Math.max(0,_.length-r),[_,r]),rt=ve(()=>{let C=me.reduce((q,R)=>(q[R.source]=(q[R.source]??0)+1,q),{}),F=Sr(),P={};for(let q of F.sources)P[q.sourceId]=q.counts.total;let G={"storage-async":"storage","storage-mmkv":"storage",redux:"redux",network:"network","react-query":"react-query","react-query-query":"react-query","react-query-mutation":"react-query",route:"route-events",zustand:"zustand",jotai:"jotai",render:"render",capacitor:"capacitor",three:"three"};return x.map(q=>{let R=(It[q]||[q]).reduce((Z,wt)=>Z+(C[wt]||0),0),ne=pn(q),Te=G[q],nt=Te&&Te in P?P[Te]:void 0;return{source:q,...ne,count:R,enabled:s.has(q),subscriberCount:nt}}).sort((q,R)=>q.enabled&&!R.enabled?-1:!q.enabled&&R.enabled?1:0)},[me,s,x,w]),bt=be(C=>{l(F=>{let P=new Set(F);return P.has(C)?P.delete(C):P.add(C),P})},[]),ot=be(()=>{l(new Set(x))},[x]),Ae=be(()=>{bn()},[]),Ue=be(()=>{c(true)},[]),vt=be(()=>{c(false)},[]),St=be(()=>{c(C=>!C)},[]),at=Sr().totalSubscribers;return{events:a,filteredEvents:he,availableSources:rt,enabledSources:s,searchText:u,setSearchText:d,toggleSource:bt,enableAllSources:ot,clearEvents:Ae,totalCount:me.length,filteredCount:he.length,isCapturing:i,startCapturing:Ue,stopCapturing:vt,toggleCapturing:St,discoveredSources:k,hiddenEventsCount:Q,isPro:t,totalSubscriberCount:at}}import{memo as Dn}from"react";import{night as U}from"@buoy-gg/shared-ui/web";var S="buoy-events";function An(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function xr(e){let t=e.originalEvent??{};switch(e.source){case"storage-async":case"storage-mmkv":{let r=t.data??{},o=r.key??(Array.isArray(r.keys)?r.keys.join("+"):void 0)??(Array.isArray(r.pairs)?r.pairs.map(a=>a[0]).join("+"):void 0);return`${e.title} ${o??""}`}case"network":{let r=String(t.url??""),o=r.split("?")[0]??r;return`${t.method??""} ${o}`}case"react-query":case"react-query-query":case"react-query-mutation":return`${e.title} ${t.type??""}`;default:return e.title}}function kr(e){return`${S}-row-${e.source}-${An(xr(e))}`}function $r(e){return`${S}-filter-${e}`}import{jsx as we,jsxs as Bt}from"react/jsx-runtime";var Ft=Dn(function({availableSources:e,onToggleSource:t,totalCount:r,filteredCount:o}){return e.length===0?null:Bt(f,{style:re.container,testID:`${S}-filter-bar`,children:[we(ue,{horizontal:true,showsHorizontalScrollIndicator:false,contentContainerStyle:re.badgesRow,testID:`${S}-filter-scroll`,children:e.map(a=>{let n=a.enabled!==false,s=a.subscriberCount,l=s!==void 0,i=a.count||0,c=$r(a.source);return Bt(ge,{testID:c,accessibilityRole:"button",accessibilityLabel:`${a.label} filter, ${n?"on":"off"}, ${i} event${i===1?"":"s"}`,style:[re.badge,n?{backgroundColor:U.color.surface,borderColor:a.color+"50"}:re.badgeDisabled],onPress:()=>t(a.source),activeOpacity:.7,children:[l&&we(f,{style:[re.countBadge,{backgroundColor:n?s>0?a.color+"25":U.color.fillSecondary:U.color.fill}],children:we($,{style:[re.countText,{color:n?s>0?a.color:U.color.textTertiary:U.color.textTertiary}],testID:`${c}-subscribers`,children:s})}),we(f,{style:[re.dot,{backgroundColor:n?a.color:U.color.fillTertiary}]}),we($,{style:[re.badgeLabel,{color:n?U.color.text:U.color.textTertiary}],numberOfLines:1,testID:`${c}-label`,children:a.label}),we(f,{style:[re.countBadge,{backgroundColor:n?i>0?a.color+"20":U.color.fill:U.color.fill}],children:we($,{style:[re.countText,{color:n?i>0?a.color:U.color.textTertiary:U.color.textTertiary}],testID:`${c}-count`,children:i})})]},a.source)})}),o<r&&Bt($,{style:re.filterInfo,testID:`${S}-showing`,children:["Showing ",o," of ",r]})]})}),re=le.create({container:{paddingVertical:8,backgroundColor:"transparent",borderBottomWidth:1,borderBottomColor:U.color.border},badgesRow:{flexDirection:"row",gap:8,paddingHorizontal:12},badge:{flexDirection:"row",alignItems:"center",paddingVertical:5,paddingHorizontal:6,borderRadius:20,borderWidth:1,gap:6,flexShrink:0},badgeDisabled:{backgroundColor:U.color.surface,borderColor:U.color.border,opacity:.5},dot:{width:7,height:7,borderRadius:4},badgeLabel:{fontSize:12,fontWeight:"500"},countBadge:{minWidth:18,height:18,borderRadius:9,alignItems:"center",justifyContent:"center",paddingHorizontal:5},countText:{fontSize:10,fontWeight:"600",fontVariant:["tabular-nums"]},filterInfo:{marginTop:6,fontSize:11,color:U.color.textTertiary,textAlign:"center"}});import{memo as Tn,useCallback as Rt,useMemo as In}from"react";import{night as ut,Zap as qn,ProBadge as Bn,ToolEmptyState as Fn,resolveListEmptyState as Rn}from"@buoy-gg/shared-ui/web";import{loadToolModule as Re,getToolModuleVersion as Dr}from"@buoy-gg/shared-ui/web/utils";import{memo as jn}from"react";import{CompactRow as Pn,formatRelativeTime as Mn,Pill as zn}from"@buoy-gg/shared-ui/web";import{jsx as O,jsxs as Nn}from"react/jsx-runtime";function On(){let e={StorageEventCard:null,getValueType:null,ReduxActionItem:null,NetworkEventItemCompact:null,RouteEventItemCompact:null,ZustandStateChangeItem:null,JotaiAtomChangeItem:null};try{let t=Re("@buoy-gg/storage");e.StorageEventCard=t.StorageEventCard,e.getValueType=t.getValueType}catch{}try{let t=Re("@buoy-gg/redux");e.ReduxActionItem=t.ReduxActionItem}catch{}try{let t=Re("@buoy-gg/network");e.NetworkEventItemCompact=t.NetworkEventItemCompact}catch{}try{let t=Re("@buoy-gg/route-events");e.RouteEventItemCompact=t.RouteEventItemCompact}catch{}try{let t=Re("@buoy-gg/zustand");e.ZustandStateChangeItem=t.ZustandStateChangeItem}catch{}try{let t=Re("@buoy-gg/jotai");e.JotaiAtomChangeItem=t.JotaiAtomChangeItem}catch{}return e}var jt,Ar=-1;function Vn(){return(!jt||Ar!==Dr())&&(jt=On(),Ar=Dr()),jt}var Tr={"storage-async":{label:"Storage",color:"#8B5CF6"},"storage-mmkv":{label:"MMKV",color:"#F59E0B"},redux:{label:"Redux",color:"#3B82F6"},network:{label:"Network",color:"#10B981"},"react-query":{label:"Query",color:"#EC4899"},"react-query-query":{label:"Query",color:"#EC4899"},"react-query-mutation":{label:"Mutation",color:"#F97316"},route:{label:"Route",color:"#06B6D4"},zustand:{label:"Zustand",color:"#764ABC"},jotai:{label:"Jotai",color:"#14B8A6"},render:{label:"Render",color:"#F472B6"},three:{label:"Scene loads",color:"#F59E0B"},capacitor:{label:"Capacitor",color:"#119EFF"}};function Un(e){switch(e){case"success":return"#10B981";case"error":return"#EF4444";case"pending":return"#F59E0B";case"neutral":default:return"#6B7280"}}function Ln(e){return e==="storage-async"||e==="storage-mmkv"}function Hn({label:e,color:t,testID:r}){return O(zn,{label:e,color:t,variant:"soft",size:"sm",style:{marginLeft:6},testID:r})}var Kn={"storage-async":"STORAGE","storage-mmkv":"MMKV",redux:"REDUX",network:"NET","react-query":"QUERY","react-query-query":"QUERY","react-query-mutation":"MUTATION",route:"ROUTE",zustand:"ZUSTAND",jotai:"JOTAI",render:"RENDER",capacitor:"CAPACITOR",three:"SCENE"};function He({source:e,testID:t,children:r}){let o=Tr[e].color,a=Kn[e];return Nn(f,{style:Pt.badgeWrapper,testID:t,children:[r,O(f,{style:[Pt.sourceBadge,{backgroundColor:`${o}20`}],children:O($,{style:[Pt.sourceBadgeText,{color:o}],testID:t?`${t}-badge`:void 0,children:a})})]})}var Ir=jn(function({event:e,onPress:t,isSelected:r=false,isExpanded:o=false,onNavigate:a,correlationCount:n=1,correlationLabel:s,correlationColor:l}){let{StorageEventCard:i,getValueType:c,ReduxActionItem:u,NetworkEventItemCompact:d,RouteEventItemCompact:p,ZustandStateChangeItem:y,JotaiAtomChangeItem:v}=Vn(),h=Tr[e.source],b=Un(e.status),m=kr(e);if(Ln(e.source)&&i&&c){let k=e.originalEvent,L={key:k.data?.key||"unknown",lastAction:k.action,totalOperations:1,lastEventTimestamp:new Date(e.timestamp),storageTypes:new Set([k.storageType||"async"]),valueType:k.data?.value!==void 0?c(k.data.value):void 0};return O(He,{source:e.source,testID:m,children:O(i,{data:L,onPress:t,isSelected:r})})}if(e.source==="redux"&&u){let k=e.originalEvent;return O(He,{source:e.source,testID:m,children:O(u,{action:k,onPress:()=>t()})})}if(e.source==="network"&&d){let k=e.originalEvent;return O(f,{testID:m,children:O(d,{event:k,onPress:()=>t()})})}if(e.source==="route"&&p){let k=e.originalEvent;return O(He,{source:e.source,testID:m,children:O(p,{event:k,visitNumber:0,isExpanded:o,onPress:()=>t(),onNavigate:a})})}if(e.source==="zustand"&&y)return O(He,{source:e.source,testID:m,children:O(y,{change:e.originalEvent,onPress:()=>t()})});if(e.source==="jotai"&&v)return O(He,{source:e.source,testID:m,children:O(v,{change:e.originalEvent,onPress:()=>t()})});let g=s&&l?O(Hn,{label:s,color:l,testID:`${m}-correlation`}):null;return O(Pn,{statusDotColor:h.color,statusLabel:h.label,primaryText:e.title,secondaryText:e.subtitle,badgeText:n>1&&!s?`${n}`:"",badgeColor:l||b,customBadge:g,bottomRightText:Mn(new Date(e.timestamp)),showChevron:true,isSelected:r,onPress:t,testID:m})}),Pt=le.create({badgeWrapper:{position:"relative"},sourceBadge:{position:"absolute",top:4,right:12,paddingHorizontal:6,paddingVertical:2,borderRadius:4,zIndex:10},sourceBadgeText:{fontSize:8,fontWeight:"700",letterSpacing:.5}});function Jn(e,t){return e.correlationId?t.filter(r=>r.correlationId===e.correlationId&&r.id!==e.id).sort((r,o)=>r.timestamp-o.timestamp):[]}function Wn(e,t){return e.correlationId?t.some(r=>r.correlationId===e.correlationId&&r.id!==e.id):false}function _n(e,t){return e.correlationId?t.filter(r=>r.correlationId===e.correlationId).length:1}function qr(e){let t=new Map;for(let r of e)if(r.correlationId){let o=t.get(r.correlationId)||0;t.set(r.correlationId,o+1)}return t}function Br(e,t){return t.filter(r=>r.correlationId===e).sort((r,o)=>{let a=r.sequenceInGroup??0,n=o.sequenceInGroup??0;return a!==n?a-n:r.timestamp-o.timestamp})}function Fr(e,t){if(!e.correlationId)return null;let r=Br(e.correlationId,t);if(r.length<=1)return null;let o=r.findIndex(a=>a.id===e.id);return o===-1?null:`${o+1}/${r.length}`}var Rr=["#EC4899","#8B5CF6","#3B82F6","#10B981","#F59E0B","#EF4444","#06B6D4","#84CC16"];function jr(e){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o),t|=0;let r=Math.abs(t)%Rr.length;return Rr[r]}import{jsx as je,jsxs as Mt}from"react/jsx-runtime";var zt=Tn(function({events:e,selectedEventId:t,expandedEventId:r,onEventPress:o,onNavigate:a,isCapturing:n,hiddenEventsCount:s=0,onUpgradePress:l,searchText:i="",totalCount:c=0,sourceCount:u,enabledSourceCount:d}){let p=In(()=>qr(e),[e]),y=Rt(({item:b})=>{let m=b.correlationId&&p.get(b.correlationId)||1,g=Fr(b,e),k=b.correlationId?jr(b.correlationId):void 0;return je(Ir,{event:b,isSelected:b.id===t,isExpanded:b.id===r,onPress:()=>o(b),onNavigate:a,correlationCount:m,correlationLabel:g,correlationColor:k})},[t,r,o,a,p,e]),v=Rt(b=>b.id,[]),h=Rt(()=>s<=0?null:Mt(ge,{style:Ce.hiddenBanner,onPress:l,activeOpacity:.8,testID:`${S}-hidden-banner`,accessibilityRole:"button",accessibilityLabel:`${s} hidden event${s!==1?"s":""}, upgrade for the full history`,children:[Mt(f,{style:Ce.hiddenBannerLeft,children:[je(qn,{size:16,color:ut.color.accent}),Mt($,{style:Ce.hiddenBannerText,testID:`${S}-hidden-count`,children:[s," hidden event",s!==1?"s":""]})]}),je(Bn,{})]}),[s,l]);if(e.length===0){let b=u===0,m=d===0,g=b?{otto:"scanning",title:"No Event Sources",message:`This tool reports on the other Buoy tools.
|
|
2
|
-
Install one \u2014 network, storage, redux, routes \u2014 and its events land here.`}:
|
|
3
|
-
Try interacting with your app.`},paused:{title:"Not Capturing",message:"Event capture is paused. Resume to see events."}});return je(Fn,{...g,testID:`${S}-empty`,style:Ce.emptyContainer})}return je(ar,{data:e,renderItem:y,keyExtractor:v,testID:`${S}-list`,style:Ce.list,contentContainerStyle:Ce.listContent,ItemSeparatorComponent:()=>je(f,{style:Ce.separator}),ListFooterComponent:h,showsVerticalScrollIndicator:true,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,removeClippedSubviews:!(typeof process<"u"&&process.env?.EXPO_PUBLIC_E2E)})}),Ce=le.create({list:{flex:1,backgroundColor:"transparent"},listContent:{paddingVertical:16},separator:{height:8},emptyContainer:{flex:1,justifyContent:"center",backgroundColor:"transparent"},hiddenBanner:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginHorizontal:16,marginTop:8,marginBottom:16,paddingVertical:12,paddingHorizontal:16,backgroundColor:ut.color.surface,borderRadius:8,borderWidth:1,borderColor:ut.color.border},hiddenBannerLeft:{flexDirection:"row",alignItems:"center",gap:8},hiddenBannerText:{fontSize:13,fontWeight:"500",color:ut.color.text}});import{loadToolModule as Ee,getToolModuleVersion as Nt}from"@buoy-gg/shared-ui/web/utils";import{memo as Qn,useMemo as Pr}from"react";import{night as de,formatRelativeTime as Gn,copyToClipboard as Zn,parseValue as Yn,useIgnoredPatterns as Xn,monoFont as ei}from"@buoy-gg/shared-ui/web";import{DataViewer as ti}from"@buoy-gg/shared-ui/web/dataViewer";import{memo as ri,useMemo as oi}from"react";import{buoyColors as oe,night as M,displayValue as ai,monoFont as Pe}from"@buoy-gg/shared-ui/web";import{DataViewer as ct}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as A,jsxs as W}from"react/jsx-runtime";var ni={"query-fetch-start":{label:"Query Fetching",color:M.color.accent,icon:"hourglass"},"query-fetch-success":{label:"Query Success",color:oe.success,icon:"checkmark"},"query-fetch-error":{label:"Query Error",color:oe.error,icon:"close"},"query-invalidated":{label:"Query Invalidated",color:oe.warning,icon:"refresh"},"mutation-start":{label:"Mutation Started",color:M.color.accent,icon:"hourglass"},"mutation-success":{label:"Mutation Success",color:oe.success,icon:"checkmark"},"mutation-error":{label:"Mutation Error",color:oe.error,icon:"close"}},Mr=ri(function({event:e}){let t=e.originalEvent,r=ni[t.type]||{label:t.type,color:M.color.textTertiary,icon:"help"},o=t.type.startsWith("query-"),a=t.type.startsWith("mutation-"),n=oi(()=>{let u=o?t.queryKey:t.mutationKey;return u?ai(u,true):a&&t.mutationId!==void 0?`Mutation #${t.mutationId}`:"No key"},[t,o,a]),s=new Date(t.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true}),l=o?!!t.queryData:!!t.mutationData,i=o?!!t.queryError:!!t.mutationError,c=a&&!!t.mutationVariables;return W(ue,{style:E.container,contentContainerStyle:E.contentContainer,children:[A(f,{style:E.section,children:W(f,{style:[E.eventTypeContainer,{borderColor:r.color+"4D"}],children:[A($,{style:[E.eventTypeHeader,{backgroundColor:r.color+"15",color:r.color}],children:r.label}),W(f,{style:E.eventTypeContent,children:[W(f,{style:E.keyRow,children:[A(ue,{horizontal:true,style:E.keyScrollView,children:A($,{style:E.keyText,children:n})}),A(ii,{type:t.type,color:r.color})]}),t.duration!==void 0&&W(f,{style:E.row,children:[A($,{style:E.labelText,children:"Duration:"}),W($,{style:E.valueText,children:[t.duration.toFixed(0),"ms"]})]}),W(f,{style:E.row,children:[A($,{style:E.labelText,children:"Timestamp:"}),A($,{style:E.valueText,children:s})]}),o&&t.queryHash&&W(f,{style:E.row,children:[A($,{style:E.labelText,children:"Query Hash:"}),A($,{style:[E.valueText,E.hashText],numberOfLines:1,children:t.queryHash})]}),a&&t.mutationId!==void 0&&W(f,{style:E.row,children:[A($,{style:E.labelText,children:"Mutation ID:"}),W($,{style:E.valueText,children:["#",t.mutationId]})]})]})]})}),c&&A(f,{style:E.section,children:W(f,{style:E.dataContainer,children:[A($,{style:[E.dataHeader,{color:oe.warning}],children:"Variables"}),A(f,{style:E.dataContent,children:A(ct,{title:"",data:t.mutationVariables,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),l&&A(f,{style:E.section,children:W(f,{style:E.dataContainer,children:[A($,{style:[E.dataHeader,{color:oe.success}],children:o?"Query Data":"Mutation Result"}),A(f,{style:E.dataContent,children:A(ct,{title:"",data:o?t.queryData:t.mutationData,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),i&&A(f,{style:E.section,children:W(f,{style:[E.dataContainer,E.errorContainer],children:[A($,{style:[E.dataHeader,E.errorHeader],children:"Error"}),A(f,{style:E.dataContent,children:A(ct,{title:"",data:o?t.queryError:t.mutationError,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),A(f,{style:E.section,children:W(f,{style:E.dataContainer,children:[A($,{style:E.dataHeader,children:"Event Details"}),A(f,{style:E.dataContent,children:A(ct,{title:"",data:t,showTypeFilter:true,rawMode:true,initialExpanded:false})})]})})]})});function ii({type:e,color:t}){let r=()=>e.includes("start")?"PENDING":e.includes("success")?"SUCCESS":e.includes("error")?"ERROR":e.includes("invalidated")?"INVALIDATED":e.toUpperCase();return A(f,{style:[E.statusChip,{backgroundColor:t+"15",borderColor:t+"33"}],children:A($,{style:[E.statusChipText,{color:t}],children:r()})})}var E=le.create({container:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},section:{marginBottom:12},eventTypeContainer:{minWidth:200,backgroundColor:M.color.surface,borderRadius:6,borderWidth:1,overflow:"hidden",shadowColor:M.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},eventTypeHeader:{paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,borderBottomWidth:1,borderBottomColor:M.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:Pe},eventTypeContent:{padding:0},keyRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:M.color.separator},keyScrollView:{flex:1,marginRight:8},keyText:{fontSize:12,color:M.color.text,fontFamily:Pe,lineHeight:18,backgroundColor:M.color.accentSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:M.color.accentBorderStrong},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:M.color.separator},labelText:{fontSize:10,color:M.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:Pe},valueText:{fontSize:12,color:M.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:Pe},hashText:{flex:1,textAlign:"right",marginLeft:8},statusChip:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},statusChipText:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:Pe},dataContainer:{minWidth:200,backgroundColor:M.color.surface,borderRadius:6,borderWidth:1,borderColor:M.color.accentBorderStrong,overflow:"hidden",shadowColor:M.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:M.color.accentSoft,paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:M.color.accent,borderBottomWidth:1,borderBottomColor:M.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:Pe},dataContent:{padding:8},errorContainer:{borderColor:oe.error+"4D"},errorHeader:{backgroundColor:oe.error+"1A",color:oe.error,borderBottomColor:oe.error+"33"}});import{Fragment as si,jsx as D,jsxs as Ke}from"react/jsx-runtime";function li(){let e={StorageEventDetailContent:null,ReduxActionDetailContent:null,NetworkEventDetailView:null,RenderDetailView:null,ZustandStateDetailContent:null,JotaiAtomDetailContent:null,RouteEventDetail:null};try{let t=Ee("@buoy-gg/storage");e.StorageEventDetailContent=t.StorageEventDetailContent}catch{}try{let t=Ee("@buoy-gg/redux");e.ReduxActionDetailContent=t.ReduxActionDetailContent}catch{}try{let t=Ee("@buoy-gg/network");e.NetworkEventDetailView=t.NetworkEventDetailView}catch{}try{let t=Ee("@buoy-gg/highlight-updates");e.RenderDetailView=t.RenderDetailView}catch{}try{let t=Ee("@buoy-gg/zustand");e.ZustandStateDetailContent=t.ZustandStateDetailContent}catch{}try{let t=Ee("@buoy-gg/jotai");e.JotaiAtomDetailContent=t.JotaiAtomDetailContent}catch{}try{let t=Ee("@buoy-gg/route-events");e.RouteEventDetail=t.RouteEventDetail}catch{}return e}var Ot,zr=-1;function ui(){return(!Ot||zr!==Nt())&&(Ot=li(),zr=Nt()),Ot}var ci={"storage-async":{label:"AsyncStorage",color:"#8B5CF6"},"storage-mmkv":{label:"MMKV",color:"#F59E0B"},redux:{label:"Redux",color:"#3B82F6"},network:{label:"Network",color:"#10B981"},"react-query":{label:"React Query",color:"#EC4899"},"react-query-query":{label:"Query",color:"#EC4899"},"react-query-mutation":{label:"Mutation",color:"#F97316"},route:{label:"Route",color:"#06B6D4"},zustand:{label:"Zustand",color:"#764ABC"},jotai:{label:"Jotai",color:"#14B8A6"},render:{label:"Render",color:"#F472B6"},three:{label:"Scene loads",color:"#F59E0B"},capacitor:{label:"Capacitor",color:"#119EFF"}};function di(e){return e==="storage-async"||e==="storage-mmkv"}function pi(e){let t=Yn(e);return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t=="boolean"?"boolean":typeof t=="number"?"number":typeof t=="string"?"string":typeof t=="object"?"object":"undefined"}function mi({children:e}){return D(si,{children:e})}var Vt=Qn(function({event:e,onBack:t,NetworkEventDetailViewComponent:r,networkDetailWrapper:o,RouteEventDetailComponent:a,detailComponents:n,onNavigate:s}){let l=Pr(()=>({...ui(),...n}),[n,Nt()]),i=ci[e.source],c=new Date(e.timestamp),{values:u,toggle:d}=Xn(),p=Pr(()=>{if(!di(e.source)||!l.StorageEventDetailContent)return null;let m=e.originalEvent,g={...m,timestamp:new Date(m.timestamp)};return{key:g.data?.key||"unknown",lastEvent:g,events:[g],totalOperations:1,currentValue:g.data?.value,valueType:pi(g.data?.value),storageTypes:new Set([g.storageType||"async"])}},[e,l]);if(p&&l.StorageEventDetailContent){let{StorageEventDetailContent:m}=l;return D(f,{style:B.container,testID:`${S}-detail-storage`,children:D(m,{conversation:p,selectedEventIndex:0,onEventIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="redux"&&l.ReduxActionDetailContent){let{ReduxActionDetailContent:m}=l,g=e.originalEvent;return D(f,{style:B.container,testID:`${S}-detail-redux`,children:D(m,{action:g,actions:[g],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}let y=r??l.NetworkEventDetailView;if(e.source==="network"&&y){let m=e.originalEvent,g=o??mi;return D(f,{style:B.container,children:D(g,{children:D(ue,{style:B.content,testID:`${S}-detail-network`,children:D(y,{event:m,ignoredPatterns:u,onTogglePattern:d})})})})}if(e.source==="react-query"||e.source==="react-query-query"||e.source==="react-query-mutation")return D(f,{style:B.container,testID:`${S}-detail-react-query`,children:D(Mr,{event:e})});if(e.source==="zustand"&&l.ZustandStateDetailContent){let{ZustandStateDetailContent:m}=l,g=e.originalEvent;return D(f,{style:B.container,testID:`${S}-detail-zustand`,children:D(m,{change:g,changes:[g],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="jotai"&&l.JotaiAtomDetailContent){let{JotaiAtomDetailContent:m}=l,g=e.originalEvent;return D(f,{style:B.container,testID:`${S}-detail-jotai`,children:D(m,{change:g,changes:[g],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="render"&&l.RenderDetailView){let{RenderDetailView:m}=l,g=e.originalEvent;return D(f,{style:B.container,children:D(ue,{style:B.content,testID:`${S}-detail-render`,children:D(m,{render:g.render})})})}let v=a??l.RouteEventDetail;if(e.source==="route"&&v)return D(f,{style:B.container,children:D(f,{style:B.container,testID:`${S}-detail-route`,children:D(v,{event:e.originalEvent,onNavigate:s})})});let h=()=>e.originalEvent,b=async()=>{await Zn({source:e.source,timestamp:c.toISOString(),title:e.title,subtitle:e.subtitle,data:h()})};return D(f,{style:B.container,testID:`${S}-detail`,children:Ke(ue,{style:B.content,contentContainerStyle:B.contentContainer,testID:`${S}-detail-scroll`,children:[D(f,{style:B.sourceBadgeRow,children:Ke(f,{style:[B.sourceBadge,{backgroundColor:i.color+"20"}],children:[D(f,{style:[B.sourceDot,{backgroundColor:i.color}]}),D($,{style:[B.sourceLabel,{color:i.color}],testID:`${S}-detail-source`,children:i.label})]})}),D($,{style:B.title,testID:`${S}-detail-title`,children:e.title}),D($,{style:B.subtitle,testID:`${S}-detail-subtitle`,children:e.subtitle}),Ke(f,{style:B.timestampRow,children:[D($,{style:B.timestampLabel,children:"Timestamp"}),Ke($,{style:B.timestampValue,testID:`${S}-detail-timestamp`,children:[c.toLocaleTimeString()," (",Gn(c),")"]})]}),Ke(f,{style:B.dataSection,children:[D($,{style:B.sectionLabel,children:"Event Data"}),D(f,{style:B.dataContainer,testID:`${S}-detail-data`,children:D(ti,{testIDPrefix:`${S}-detail-data`,data:h(),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true})})]})]})})}),B=le.create({container:{flex:1,backgroundColor:"transparent"},content:{flex:1},contentContainer:{padding:16},sourceBadgeRow:{flexDirection:"row",marginBottom:12},sourceBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:6,borderRadius:12,gap:6},sourceDot:{width:6,height:6,borderRadius:3},sourceLabel:{fontSize:12,fontWeight:"600"},title:{fontSize:24,fontWeight:"700",color:de.color.text,marginBottom:4},subtitle:{fontSize:16,color:de.color.textTertiary,marginBottom:16},timestampRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:12,borderTopWidth:1,borderTopColor:de.color.border,borderBottomWidth:1,borderBottomColor:de.color.border,marginBottom:16},timestampLabel:{fontSize:14,color:de.color.textTertiary},timestampValue:{fontSize:14,color:de.color.text,fontFamily:ei},dataSection:{marginTop:8},sectionLabel:{fontSize:12,fontWeight:"600",color:de.color.textTertiary,textTransform:"uppercase",letterSpacing:.5,marginBottom:8},dataContainer:{backgroundColor:de.color.surface,borderRadius:8,borderWidth:1,borderColor:de.color.border,overflow:"hidden"}});import{useCallback as Me,useEffect as hi,useMemo as dt,useState as Ut}from"react";import{DynamicFilterView as Nr,macOSColors as Je,night as We,FileText as Or,FileCode as Vr,Hash as gi,Zap as fi,AlertTriangle as yi,Settings as bi,Eye as vi,XCircle as Ur,GitBranch as Lr,ToolbarCopyButton as Si,useFeatureGate as wi,ProFeatureBanner as Ci,ExportPreview as Ei,monoFont as xi}from"@buoy-gg/shared-ui/web";import{DataViewer as ki}from"@buoy-gg/shared-ui/web/dataViewer";var _e={timestampFormat:"relative",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:true,includeTotalDuration:true,includeEventData:false,dataSizeThreshold:5,format:"markdown",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true},Qe={llm:{timestampFormat:"relative",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:true,includeTotalDuration:true,includeEventData:false,dataSizeThreshold:5,format:"markdown",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true},bugReport:{timestampFormat:"both",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:true,includeTotalDuration:true,includeEventData:true,dataSizeThreshold:10,format:"markdown",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true},json:{timestampFormat:"absolute",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:false,includeTotalDuration:false,includeEventData:true,dataSizeThreshold:-1,format:"json",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:false,showStorageDiff:false,stripVerboseFields:false},errors:{timestampFormat:"relative",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:true,includeTotalDuration:false,includeEventData:true,dataSizeThreshold:10,format:"markdown",filterMode:"errors",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true},minimal:{timestampFormat:"relative",includeSource:false,includeStatus:true,includeTitle:true,includeSubtitle:false,includeCorrelation:false,includeDuration:false,includeSummaryHeader:false,includeTotalDuration:false,includeEventData:false,dataSizeThreshold:1,format:"plaintext",filterMode:"all",filterSources:[],compactMode:true,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:false,stripVerboseFields:true},mermaid:{timestampFormat:"relative",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:false,includeCorrelation:true,includeDuration:true,includeSummaryHeader:false,includeTotalDuration:false,includeEventData:false,dataSizeThreshold:1,format:"mermaid",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true}};function Hr(e){for(let[t,r]of Object.entries(Qe))if(Object.keys(r).every(o=>{let a=e[o],n=r[o];return Array.isArray(a)&&Array.isArray(n)?a.length===n.length&&a.every((s,l)=>s===n[l]):a===n}))return t;return null}var z={llm:{label:"LLM",description:"AI-ready format",color:"#10B981"},bugReport:{label:"Bug Report",description:"Full context",color:"#EF4444"},json:{label:"JSON",description:"Machine-readable",color:"#F59E0B"},errors:{label:"Errors",description:"Failed only",color:"#EF4444"},minimal:{label:"Minimal",description:"Quick reference",color:"#6B7280"},mermaid:{label:"Diagram",description:"Visual flow",color:"#A855F7"}};import{isDevToolsStorageKey as $i}from"@buoy-gg/shared-ui/web";var ze={success:"\u2705",pending:"\u23F3",error:"\u274C",neutral:"\u2796"},Di={success:"[OK]",pending:"[...]",error:"[ERR]",neutral:"[-]"},Lt={"storage-async":"Storage","storage-mmkv":"MMKV",redux:"Redux",network:"Network","react-query":"Query","react-query-query":"Query","react-query-mutation":"Mutation",route:"Route",zustand:"Zustand",jotai:"Jotai",render:"Render",capacitor:"Capacitor",three:"Scene loads"};function xe(e){if(typeof e!="string")return e;let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(e)}catch{return e}}function ke(e){if(e==null)return e;if(typeof e=="string")return xe(e);if(Array.isArray(e))return e.map(ke);if(typeof e=="object"){let t={};for(let[r,o]of Object.entries(e))t[r]=ke(o);return t}return e}var Ai=new Set(["image","imageUrl","imageURL","image_url","thumbnail","thumbnailUrl","thumbnail_url","icon","iconUrl","avatar","avatarUrl","photo","photoUrl","picture","pictureUrl","description","desc","longDescription","shortDescription","meta_description"]);function Ht(e){if(e==null)return e;if(Array.isArray(e))return e.map(Ht);if(typeof e=="object"){let t={};for(let[r,o]of Object.entries(e))Ai.has(r)||typeof o=="string"&&Ti(o)||(t[r]=Ht(o));return t}return e}function Ti(e){if(!e.startsWith("http"))return false;let t=e.toLowerCase();return t.includes("/photo")||t.includes("/image")||t.includes("unsplash.com")||t.includes("cloudinary.com")||t.includes("imgur.com")||/\.(jpg|jpeg|png|gif|webp|svg|bmp)(\?|$)/i.test(e)}function Ii(e){if(e instanceof Date)return e.toISOString();if(!(e&&typeof e=="object"&&Object.keys(e).length===0))return e}function qi(e,t){let r=i=>{if(typeof i!="object"||i===null)return null;let c=i;return typeof c.id=="string"?c.id:typeof c.orderId=="string"?c.orderId:typeof c.key=="string"?c.key:null},o=new Set(e.map(r).filter(Boolean)),a=new Set(t.map(r).filter(Boolean));if(o.size===0&&a.size===0)return null;let n=t.filter(i=>{let c=r(i);return c&&!o.has(c)}),s=e.filter(i=>{let c=r(i);return c&&!a.has(c)}),l=t.length-n.length;return n.length+s.length<e.length&&n.length+s.length<t.length?{added:n,removed:s,unchanged:l}:null}function Bi(e,t){let r={};if(e.action&&(r.action=e.action),e.storageType&&(r.storageType=e.storageType),e.timestamp!==void 0){let o=Ii(e.timestamp);o!==void 0&&(r.timestamp=o)}if(e.data){let o={...e.data};if(t.smartJsonParsing&&(o.value!==void 0&&(o.value=xe(o.value)),o.prevValue!==void 0&&(o.prevValue=xe(o.prevValue))),t.showStorageDiff&&Array.isArray(o.value)&&Array.isArray(o.prevValue)){let a=qi(o.prevValue,o.value);if(a){let n={key:o.key};return a.added.length>0&&(n.added=a.added),a.removed.length>0&&(n.removed=a.removed),a.unchanged>0&&(n.unchangedCount=a.unchanged),r.data=n,r}}r.data=o}return r}function Fi(e,t){if(!t.reduxChangedOnly)return t.smartJsonParsing?ke(e):e;let r={};if(e.type&&(r.type=e.type),e.payload&&(r.payload=t.smartJsonParsing?ke(e.payload):e.payload),e.sliceName&&(r.sliceName=e.sliceName),e.actionName&&(r.actionName=e.actionName),e.duration&&(r.duration=e.duration),e.hasStateChange!==void 0&&(r.hasStateChange=e.hasStateChange),e.diffSummary&&(r.diffSummary=e.diffSummary),e.changedKeysCount!==void 0&&(r.changedKeysCount=e.changedKeysCount),e.hasStateChange===true){let o=e.sliceName;if(o&&e.prevState&&e.nextState){let a=e.prevState,n=e.nextState;(a[o]!==void 0||n[o]!==void 0)&&(r.stateChange={slice:o,before:a[o],after:n[o]})}}return r}function Kr(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.name=="string"?t.name:typeof t.id=="string"?t.id:typeof t.key=="string"?t.key:null}function Ge(e,t){let r=typeof e=="string"?xe(e):e,o=typeof t=="string"?xe(t):t;if(r==null&&o!==null&&o!==void 0)return"Created";if(r!=null&&o==null)return"Deleted";if(Array.isArray(r)&&Array.isArray(o)){let a=r.length,n=o.length,s=r.map(Kr).filter(Boolean),l=o.map(Kr).filter(Boolean);if(a===n&&a>0){let i=new Set(s),c=new Set(l),u=s.filter(d=>c.has(d));if(u.length===0&&s.length>0&&l.length>0)return`\u26A0\uFE0F Replaced: [${s.join(", ")}] \u2192 [${l.join(", ")}]`;if(u.length<a){let d=s.filter(y=>!c.has(y)),p=l.filter(y=>!i.has(y));return`Changed: -${d.join(", ")} +${p.join(", ")}`}}if(a===0&&n>0)return l.length>0?`Added: [${l.join(", ")}]`:`Added ${n} item${n>1?"s":""}`;if(a>0&&n===0)return s.length>0?`Removed all: [${s.join(", ")}]`:`Removed all ${a} item${a>1?"s":""}`;if(n>a){let i=new Set(s),c=l.filter(u=>!i.has(u));return c.length>0?`Added: [${c.join(", ")}] (${a} \u2192 ${n})`:`Added ${n-a} item${n-a>1?"s":""} (${a} \u2192 ${n})`}if(n<a){let i=new Set(l),c=s.filter(u=>!i.has(u));return c.length>0?`Removed: [${c.join(", ")}] (${a} \u2192 ${n})`:`Removed ${a-n} item${a-n>1?"s":""} (${a} \u2192 ${n})`}return`Updated (${n} item${n>1?"s":""})`}if(typeof r=="object"&&typeof o=="object"&&r&&o){let a=Object.keys(r),n=Object.keys(o),s=n.filter(i=>!a.includes(i)),l=a.filter(i=>!n.includes(i));return s.length>0&&l.length>0?`+${s.length} -${l.length} keys`:s.length>0?`Added: ${s.join(", ")}`:l.length>0?`Removed: ${l.join(", ")}`:"Updated"}return null}function Ri(e,t){let r={};if(e.id&&(r.id=e.id),e.type&&(r.type=e.type),e.timestamp&&(r.timestamp=e.timestamp),e.queryKey&&(r.queryKey=e.queryKey),e.mutationKey&&(r.mutationKey=e.mutationKey),e.mutationId&&(r.mutationId=e.mutationId),e.duration&&(r.duration=e.duration),e.queryData!==void 0&&(r.data=t.smartJsonParsing?ke(e.queryData):e.queryData),e.variables!==void 0&&(r.variables=t.smartJsonParsing?ke(e.variables):e.variables),e.queryError!==void 0){let o=e.queryError;o&&typeof o=="object"?r.error=o.message||o.name||o:r.error=e.queryError}if(e.mutationError!==void 0){let o=e.mutationError;o&&typeof o=="object"?r.error=o.message||o.name||o:r.error=e.mutationError}if(e.query&&typeof e.query=="object"){let o=e.query;if(o.state&&typeof o.state=="object"){let a=o.state;if(a.status&&(r.status=a.status),a.fetchStatus&&(r.fetchStatus=a.fetchStatus),a.error){let n=a.error;n&&typeof n=="object"&&(r.error=n.message||n.name||n)}}}if(e.mutation&&typeof e.mutation=="object"){let o=e.mutation;if(o.state&&typeof o.state=="object"){let a=o.state;if(a.status&&(r.status=a.status),a.failureCount&&(r.failureCount=a.failureCount),a.error){let n=a.error;n&&typeof n=="object"&&(r.error=n.message||n.name||n)}if(a.failureReason){let n=a.failureReason;n&&typeof n=="object"&&(r.failureReason=n.message||n.name||n)}}}return r}function pt(e,t){let r=e.originalEvent;if(!r)return null;let o;return e.source==="storage-async"||e.source==="storage-mmkv"?o=Bi(r,t):e.source==="redux"?o=Fi(r,t):e.source==="react-query"||e.source==="react-query-query"||e.source==="react-query-mutation"?o=Ri(r,t):t.smartJsonParsing?o=ke(r):o=r,t.stripVerboseFields&&o&&(o=Ht(o)),o}function Ze(e){let t={totalEvents:e.length,success:0,pending:0,error:0,neutral:0,durationMs:0,sources:new Set};if(e.length===0)return t;let r=1/0,o=-1/0;for(let a of e)t[a.status]++,t.sources.add(a.source),a.timestamp<r&&(r=a.timestamp),a.timestamp>o&&(o=a.timestamp);return t.durationMs=o-r,t}function Ye(e,t){let r=[...e];if(t.filterMode!=="all"&&(r=r.filter(o=>{switch(t.filterMode){case"errors":return o.status==="error";case"success":return o.status==="success";case"pending":return o.status==="pending";default:return true}})),t.filterSources.length>0){let o=new Set(t.filterSources);r=r.filter(a=>o.has(a.source))}return r}function Kt(e){return e<1e3?`+${e}ms`:e<6e4?`+${(e/1e3).toFixed(1)}s`:`+${(e/6e4).toFixed(1)}m`}function Jr(e){return new Date(e).toISOString()}function mt(e,t,r){let o=Kt(e-t),a=Jr(e);switch(r){case"relative":return o;case"absolute":return a;case"both":return`${o} (${a})`}}function Jt(e,t){let r=0,o=[e],a=new Set;for(;o.length>0;){if(r>t)return{over:true,approxBytes:r};let n=o.pop();if(n==null)r+=4;else if(typeof n=="string")r+=n.length+2;else if(typeof n=="number")r+=8;else if(typeof n=="boolean")r+=5;else if(typeof n=="object"){if(a.has(n))continue;if(a.add(n),Array.isArray(n)){r+=2+n.length;for(let s=0;s<n.length;s++)o.push(n[s])}else{r+=2;for(let s in n)r+=s.length+4,o.push(n[s])}}else r+=4}return{over:r>t,approxBytes:r}}function ht(e,t){if(t===-1)return{data:e,truncated:false};let{over:r,approxBytes:o}=Jt(e,t*1024);if(r)return{data:`[Data truncated - \u2265${(o/1024).toFixed(1)}KB exceeds ${t}KB limit]`,truncated:true};try{return JSON.stringify(e),{data:e,truncated:false}}catch{return{data:"[Unable to serialize data]",truncated:true}}}function Wr(e,t){let r=0;for(let o of e)if(t.includeSource&&(r+=20),t.includeStatus&&(r+=10),t.includeTitle&&(r+=(o.title?.length||0)+10),t.includeSubtitle&&(r+=(o.subtitle?.length||0)+10),t.includeCorrelation&&(r+=20),t.includeDuration&&(r+=15),r+=30,t.includeEventData&&o.originalEvent){let a=t.dataSizeThreshold===-1?1048576:t.dataSizeThreshold*1024,{approxBytes:n}=Jt(o.originalEvent,a);r+=Math.min(n,a)}return t.includeSummaryHeader&&(r+=100),t.includeTotalDuration&&(r+=50),t.format==="markdown"&&(r*=1.2),t.format==="json"&&(r*=1.3),Math.round(r)}function ji(e,t,r){let o=[],a=mt(e.timestamp,t,r.timestampFormat);if(o.push(`\`${a}\``),r.includeStatus&&o.push(ze[e.status]),r.includeSource&&o.push(`**${Lt[e.source]}**`),r.includeTitle&&o.push(e.title),r.showStorageDiff&&(e.source==="storage-async"||e.source==="storage-mmkv")){let n=e.originalEvent;if(n?.data){let s=n.data,l=Ge(s.prevValue,s.value);l&&o.push(`\u2192 ${l}`)}}return e.source==="redux"&&e.originalEvent?.hasStateChange===false&&o.push("(no state change)"),r.includeSubtitle&&e.subtitle&&o.push(`- ${e.subtitle}`),o.join(" ")}function Pi(e,t){let r=[],o=e.originalEvent;if(!o?.data)return r;let a=o.data,n=t.smartJsonParsing?xe(a.prevValue):a.prevValue,s=t.smartJsonParsing?xe(a.value):a.value,l=Ge(a.prevValue,a.value);if(l&&r.push(` **Change:** ${l}`),Array.isArray(n)&&Array.isArray(s)){let i=n.map(u=>typeof u=="object"&&u&&"name"in u?u.name:null).filter(Boolean),c=s.map(u=>typeof u=="object"&&u&&"name"in u?u.name:null).filter(Boolean);(i.length>0||c.length>0)&&(i.length>0&&r.push(` Before: [${i.join(", ")}]`),r.push(` After: [${c.join(", ")}]`))}return r}function Wt(e,t){let r=Ye(e,t);if(r.length===0)return"No events to export.";let o=[...r].sort((i,c)=>i.timestamp-c.timestamp),a=o[0].timestamp,n=Ze(o),s=[];if(s.push("## Event Flow"),t.includeSummaryHeader||t.includeTotalDuration){let i=[];if(t.includeTotalDuration&&i.push(`**Duration:** ${Kt(n.durationMs).replace("+","")}`),i.push(`**Events:** ${n.totalEvents}`),t.includeSummaryHeader){let c=[];n.success>0&&c.push(`${n.success} ${ze.success}`),n.pending>0&&c.push(`${n.pending} ${ze.pending}`),n.error>0&&c.push(`${n.error} ${ze.error}`),n.neutral>0&&c.push(`${n.neutral} ${ze.neutral}`),c.length>0&&i.push(`**Status:** ${c.join(" ")}`)}s.push(i.join(" | "))}if(s.push(""),s.push("### Timeline"),s.push(""),t.compactMode)return o.forEach((i,c)=>{s.push(`${c+1}. ${ji(i,a,t)}`)}),s.join(`
|
|
4
|
-
`);o.forEach((i,c)=>{let u=[],d=
|
|
1
|
+
"use client";var tr=Object.defineProperty;var uo=Object.getOwnPropertyDescriptor;var co=Object.getOwnPropertyNames;var po=Object.prototype.hasOwnProperty;var ho=(e,t)=>{for(var r in t)tr(e,r,{get:t[r],enumerable:true})},rr=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of co(t))!po.call(e,a)&&a!==r&&tr(e,a,{get:()=>t[a],enumerable:!(o=uo(t,a))||o.enumerable});return e},mo=(e,t,r)=>(rr(e,t,"default"),r&&rr(r,t,"default"));var fs=(()=>{try{let e=globalThis.Capacitor;if(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform())return e.DEBUG===true}catch{}return process.env.NODE_ENV!=="production"})();typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import{EventsIcon as go,EVENTS_ICON_COLOR as fo}from"@buoy-gg/floating-tools-core/web";var or={};ho(or,{AccessibilityInfo:()=>So,ActivityIndicator:()=>Ca,Alert:()=>cr,Animated:()=>ga,AppRegistry:()=>Co,AppState:()=>Eo,Appearance:()=>wo,BackHandler:()=>xo,Button:()=>Ea,CheckBox:()=>Oo,Clipboard:()=>ko,DeviceEventEmitter:()=>ta,Dimensions:()=>$o,Easing:()=>Do,FlatList:()=>ar,I18nManager:()=>To,Image:()=>Vo,ImageBackground:()=>Uo,InteractionManager:()=>Io,Keyboard:()=>Ao,KeyboardAvoidingView:()=>Lo,LayoutAnimation:()=>qo,Linking:()=>Bo,LogBox:()=>ea,Modal:()=>Sa,NativeEventEmitter:()=>Fo,NativeModules:()=>vo,PanResponder:()=>Ro,Picker:()=>Ho,PixelRatio:()=>jo,Platform:()=>Po,Pressable:()=>va,ProgressBar:()=>Ko,RefreshControl:()=>Jo,SafeAreaView:()=>Wo,ScrollView:()=>ue,SectionList:()=>_o,Share:()=>Mo,StatusBar:()=>Qo,StyleSheet:()=>le,Switch:()=>wa,Text:()=>$,TextInput:()=>fa,Touchable:()=>Go,TouchableHighlight:()=>ya,TouchableNativeFeedback:()=>Zo,TouchableOpacity:()=>ge,TouchableWithoutFeedback:()=>ba,UIManager:()=>zo,Vibration:()=>No,View:()=>f,VirtualizedList:()=>Yo,YellowBox:()=>Xo,findNodeHandle:()=>xa,unstable_createElement:()=>bo,useColorScheme:()=>ra,useLocaleContext:()=>oa,useWindowDimensions:()=>aa});mo(or,yo);import*as yo from"react-native-web";import{unstable_createElement as bo,NativeModules as vo,AccessibilityInfo as So,Appearance as wo,AppRegistry as Co,AppState as Eo,BackHandler as xo,Clipboard as ko,Dimensions as $o,Easing as Do,I18nManager as To,Keyboard as Ao,InteractionManager as Io,LayoutAnimation as qo,Linking as Bo,NativeEventEmitter as Fo,PanResponder as Ro,PixelRatio as jo,Platform as Po,Share as Mo,UIManager as zo,Vibration as No,CheckBox as Oo,FlatList as ar,Image as Vo,ImageBackground as Uo,KeyboardAvoidingView as Lo,Picker as Ho,ProgressBar as Ko,RefreshControl as Jo,SafeAreaView as Wo,SectionList as _o,StatusBar as Qo,Touchable as Go,TouchableNativeFeedback as Zo,VirtualizedList as Yo,YellowBox as Xo,LogBox as ea,DeviceEventEmitter as ta,useColorScheme as ra,useLocaleContext as oa,useWindowDimensions as aa}from"react-native-web";import*as H from"react-native-web";import{createElement as Ct,forwardRef as nr,useCallback as na,useRef as ia}from"react";import{useEffect as sa,useState as la}from"react";import{createPortal as ua}from"react-dom";var ca='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';import{jsx as da}from"react/jsx-runtime";var He=Symbol.for("@buoy-gg/portal-host"),ir=e=>{if(!(e instanceof Element))return false;if(e.closest("input, textarea, select"))return true;let t=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return t===""||t==="true"||t==="plaintext-only"};function sr(){let e=document;if(e[He])return e[He].host;let t=document.createElement("div");t.dataset.buoyPortalHost="",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none",fontFamily:ca});let r=()=>{let u=document.fullscreenElement,d=u&&u.tagName!=="CANVAS"?u:document.body;t.parentElement!==d&&d.appendChild(t)},o=new Map,a=u=>{(!t.contains(u.target)||!ir(u.target))&&o.set(u.code||u.key,{key:u.key,code:u.code,location:u.location,keyCode:u.keyCode,which:u.which,altKey:u.altKey,ctrlKey:u.ctrlKey,metaKey:u.metaKey,shiftKey:u.shiftKey})},n=u=>{o.delete(u.code||u.key)},s=()=>o.clear(),l=()=>{let u=[...o.values()];o.clear();for(let d of u)document.dispatchEvent(new KeyboardEvent("keyup",{...d,bubbles:true}))},i=u=>{ir(u.target)&&u.stopPropagation()},c=u=>u.stopPropagation();return r(),document.addEventListener("fullscreenchange",r),document.addEventListener("keydown",a,true),document.addEventListener("keyup",n,true),window.addEventListener("blur",s),t.addEventListener("focusin",l),t.addEventListener("keydown",i),t.addEventListener("keyup",i),t.addEventListener("keypress",i),t.addEventListener("wheel",c,{passive:true}),e[He]={host:t,users:0,dispose:()=>{document.removeEventListener("fullscreenchange",r),document.removeEventListener("keydown",a,true),document.removeEventListener("keyup",n,true),window.removeEventListener("blur",s),t.remove(),delete e[He]}},t}function pa({children:e}){let[t,r]=la(null);return sa(()=>{let o=sr(),a=document[He];return a.users++,r(o),()=>{--a.users===0&&a.dispose()}},[]),t?ua(da("div",{"data-buoy-root":"",style:{display:"contents",pointerEvents:"auto"},children:e}),t):null}var Ie=H,ha=["shadowColor","shadowOffset","shadowOpacity","shadowRadius","textShadowColor","textShadowOffset","textShadowRadius"],qe=e=>typeof e=="number"?`${e}px`:e;function Et(e){if(Array.isArray(e)){let d=e.map(Et);return d.some((p,y)=>p!==e[y])?d:e}if(!e||typeof e!="object"||!ha.some(d=>e[d]!=null))return e;let{shadowColor:t,shadowOffset:r,shadowOpacity:o,shadowRadius:a,textShadowColor:n,textShadowOffset:s,textShadowRadius:l,...i}=e;if(t!=null||r!=null||o!=null||a!=null){let d=t??"black",p=o==null?d:`color-mix(in srgb, ${d} ${Math.min(o,1)*100}%, transparent)`,y=`${qe(r?.width??0)} ${qe(r?.height??0)} ${qe(a??0)} ${p}`;i.boxShadow=typeof i.boxShadow=="string"?`${i.boxShadow}, ${y}`:i.boxShadow??y}let{width:c=0,height:u=0}=s??{};if(n&&(c||u||l)){let d=`${qe(c)} ${qe(u)} ${qe(l??0)} ${n}`;i.textShadow=i.textShadow?`${i.textShadow}, ${d}`:d}return i}var ma=Ie.StyleSheet.create({auto:{pointerEvents:"auto"},none:{pointerEvents:"none"},"box-none":{pointerEvents:"box-none"},"box-only":{pointerEvents:"box-only"}});function lr(e,t){if(typeof e=="function")return o=>lr(e(o),t);let r=Et(e);return t?[r,ma[t]]:r}var le={...Ie.StyleSheet,create:e=>Ie.StyleSheet.create(Object.fromEntries(Object.entries(e).map(([t,r])=>[t,Et(r)])))};function Y(e){let t=nr((o,a)=>{let{accessibilityState:n,accessibilityValue:s,pointerEvents:l,...i}=o;for(let u of["busy","checked","disabled","expanded","selected"])n?.[u]!==void 0&&i[`aria-${u}`]===void 0&&(i[`aria-${u}`]=n[u]);for(let[u,d]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[u]!==void 0&&i[`aria-${d}`]===void 0&&(i[`aria-${d}`]=s[u]);let c=lr(i.style,l);return c!==i.style&&(i.style=c),Ct(e,{...i,ref:a})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var f=Y(H.View),$=Y(H.Text),ga={...Ie.Animated,View:Ie.Animated.createAnimatedComponent(f),Text:Ie.Animated.createAnimatedComponent($)},fa=Y(H.TextInput),ge=Y(H.TouchableOpacity),ya=Y(H.TouchableHighlight),ba=Y(H.TouchableWithoutFeedback),va=Y(H.Pressable),ue=Y(H.ScrollView),ur=nr((e,t)=>{let r=ia(null),o=na(a=>{if(a){let n=a;for(;n.parentElement&&n.parentElement!==document.body;)n=n.parentElement;n.parentElement===document.body&&(r.current=n,Object.assign(n.style,{position:"relative",zIndex:"2147483647",pointerEvents:"auto"}),sr().appendChild(n))}else r.current&&(document.body.appendChild(r.current),r.current=null);typeof t=="function"?t(a):t&&(t.current=a)},[t]);return Ct(pa,null,Ct(H.Modal,{...e,ref:o}))});ur.displayName="Modal";var Sa=Y(ur),wa=Y(H.Switch),Ca=Y(H.ActivityIndicator),Ea=Y(H.Button),xa=H.findNodeHandle,cr={alert(e,t,r,o){if(typeof document>"u")return;let a=document.createElement("dialog");a.dataset.buoyRoot="",a.setAttribute("aria-label",e),a.style.cssText="position:fixed;inset:0;margin:auto;width:min(440px,90vw);padding:24px;border:1px solid #475569;border-radius:14px;background:#17212e;color:#f1f5f9;font:14px system-ui;box-shadow:0 20px 80px #0008;z-index:2147483647";let n=document.createElement("h2");if(n.textContent=e,n.style.cssText="font-size:18px;margin:0 0 12px",a.appendChild(n),t){let c=document.createElement("p");c.textContent=t,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",a.appendChild(c)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let l=r?.length?r:[{text:"OK"}],i=()=>{a.close?.(),a.remove()};for(let c of l){let u=document.createElement("button");u.type="button",u.textContent=c.text??"OK",u.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${c.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,u.onclick=()=>{i(),c.onPress?.()},s.appendChild(u)}a.addEventListener("cancel",c=>{c.preventDefault(),o?.cancelable!==false&&(i(),o?.onDismiss?.())}),a.appendChild(s),document.body.appendChild(a),a.showModal?a.showModal():a.setAttribute("open","")}};import{useState as it,useCallback as Be,useEffect as ka,useRef as $a}from"react";import{JsModal as Da,ModalHeader as X,buoyColors as Ta,night as ee,Trash2 as Aa,Copy as Ia,Search as qa,devToolsStorageKeys as Ba,ToolbarCopyButton as Fa,UpgradeModal as Ra,PowerToggleButton as ja,useSafeRouter as Pa,windowDragProps as Ma}from"@buoy-gg/shared-ui/web";import{useState as fe,useEffect as ye,useCallback as be,useMemo as ve,useRef as xt}from"react";import{useFeatureGate as za,subscribeToSubscriberCountChanges as Na,useIgnoredPatterns as Oa,useLimit as Va}from"@buoy-gg/shared-ui/web";import{appStorageEvent as dr,isDevToolsStorageKey as kt,isBuoyRequest as Ua,isUrlIgnored as La}from"@buoy-gg/shared-ui/web";function st(e){let t=e.originalEvent;if(!t)return false;if((e.source==="storage-async"||e.source==="storage-mmkv")&&(!dr(t)||typeof t.key=="string"&&kt(t.key)))return true;if(e.source==="capacitor"&&t.plugin==="Preferences"){let r=t.options?.key;if(typeof r=="string"&&kt(r))return true}return!!(e.source==="network"&&Ua(t.url||`https://${t.host||""}`))}function $t(e,t){if(e.source!=="network"||t.length===0)return false;let r=e.originalEvent?.url??"";return La(r,t)}function Ha(e,t){return st(e)||$t(e,t)}function pr(e){if(st(e))return null;let t=e.originalEvent;if(!t)return e;if(e.source==="storage-async"||e.source==="storage-mmkv"){let r=dr(t);if(!r)return null;if(r===t)return e;let o=r.data?.pairs?.length??r.data?.keys?.length;return{...e,originalEvent:r,subtitle:o===void 0?e.subtitle:`${o} key${o===1?"":"s"}`}}if(e.source==="capacitor"&&t.plugin==="Preferences"&&Array.isArray(t.result?.keys)){let r=t.result.keys.filter(o=>!kt(o));if(r.length!==t.result.keys.length)return{...e,originalEvent:{...t,result:{...t.result,keys:r}}}}return e}import{loadToolModule as K,getToolModuleVersion as hr}from"@buoy-gg/shared-ui/web/utils";var Ka=0;function ce(e){return`${e}-${Date.now()}-${++Ka}`}function Ja(){try{let{storageEventStore:e}=K("@buoy-gg/storage");return{id:"storage",name:"Storage",eventSources:["storage-async","storage-mmkv"],available:true,subscribe:t=>e.onEvent(r=>{if(r?.data?.initialScan)return;let o=Wa(r);t(o)})}}catch{return null}}function Wa(e){let t=e,r=t.storageType==="async"?"storage-async":"storage-mmkv",o=t.action;t.storageType==="async"&&(o={setItem:"Set Item",removeItem:"Remove Item",mergeItem:"Merge Item",clear:"Clear All",multiSet:"Multi Set",multiRemove:"Multi Remove",multiMerge:"Multi Merge"}[t.action]||t.action);let a="";if(t.storageType==="async")switch(t.action){case"setItem":case"removeItem":case"mergeItem":a=t.data?.key||"unknown key";break;case"multiSet":case"multiMerge":{let s=t.data?.pairs?.length||0;a=`${s} key${s!==1?"s":""}`;break}case"multiRemove":{let s=t.data?.keys?.length||0;a=`${s} key${s!==1?"s":""}`;break}case"clear":a="all keys";break}else a=t.data?.key||t.data?.instanceId||"unknown";let n="neutral";return(t.action.includes("set")||t.action.includes("Set")||t.action.includes("merge")||t.action.includes("Merge"))&&(n="success"),{id:ce(r),source:r,timestamp:t.timestamp.getTime(),title:o,subtitle:a,status:n,originalEvent:e}}function _a(){try{let{reduxActionStore:e}=K("@buoy-gg/redux"),t=null;return{id:"redux",name:"Redux",eventSources:["redux"],available:true,subscribe:r=>e.subscribe(o=>{if(o.length>0){let a=o[0];if(a.id!==t){t=a.id;let n=Qa(a);r(n)}}})}}catch{return null}}function Qa(e){let t=e,r="neutral";switch(t.category){case"fulfilled":r="success";break;case"rejected":r="error";break;case"pending":r="pending";break;default:r=t.hasStateChange?"success":"neutral"}let o="";return t.payloadPreview?o=t.payloadPreview:t.hasStateChange&&t.diffSummary?o=t.diffSummary:t.duration!==void 0?o=`${t.duration.toFixed(1)}ms`:o=t.sliceName||"",{id:ce("redux"),source:"redux",timestamp:t.timestamp,title:t.type,subtitle:o,status:r,originalEvent:e}}function Ga(){try{let{networkEventStore:e,networkListener:t,addNetworkListener:r}=K("@buoy-gg/network"),o=new Map;return{id:"network",name:"Network",eventSources:["network"],available:true,setup:()=>{let a=t();a.isActive||a.startListening(),a.listenerCount===0&&r(n=>{e.processNetworkEvent(n)})},subscribe:a=>{let n=Date.now();return e.onEvent(s=>{let l=s,i=o.get(l.id);if(i){let c=mr(s);c.id=i,a(c)}else{if(typeof l.timestamp=="number"&&l.timestamp<n)return;let c=mr(s);o.set(l.id,c.id),a(c)}},false)}}}catch{return null}}function mr(e){let t=e,r="neutral";t.status===void 0?r="pending":t.error||t.status>=400?r="error":t.status>=200&&t.status<400&&(r="success");let o=t.operationName||`${t.method} ${t.path||t.url}`,a=[];return t.status!==void 0?a.push(`${t.status}`):t.error?a.push("Error"):a.push("Pending"),t.duration!==void 0&&a.push(`${t.duration.toFixed(0)}ms`),t.host&&a.push(t.host),{id:ce("network"),source:"network",timestamp:t.timestamp,title:o,subtitle:a.join(" \xB7 "),status:r,originalEvent:e}}function Za(){try{let{reactQueryEventStore:e}=K("@buoy-gg/react-query"),t=null;return{id:"react-query",name:"React Query",eventSources:["react-query","react-query-query","react-query-mutation"],available:true,subscribe:r=>{let o=true,a=new Set,n=s=>s.queryHash??(s.mutationId!==void 0?`m-${s.mutationId}`:null);return e.subscribe(s=>{if(o){o=false,s.length>0&&(t=s[0].id);return}if(s.length>0){let l=s[0];if(l.id!==t){t=l.id;let i=l.type??"",c=n(l);if(i==="query-fetch-start"||i==="mutation-start")c&&a.add(c);else if((i==="query-fetch-success"||i==="query-fetch-error"||i==="mutation-success"||i==="mutation-error")&&c&&!a.has(c))return;let u=Ya(l);r(u)}}})}}}catch{return null}}function gr(e){return!e||e.length===0?"unknown":e.map(t=>{if(typeof t=="string")return t;if(typeof t=="number")return String(t);if(typeof t=="object"&&t!==null){let r=Object.values(t)[0];return typeof r=="string"||typeof r=="number"?String(r):JSON.stringify(t).slice(0,20)}return String(t)}).join(" \u203A ")}function Ya(e){let t=e,r=t.type.startsWith("mutation-")?"react-query-mutation":"react-query-query",o="neutral";switch(t.type){case"query-fetch-start":case"mutation-start":o="pending";break;case"query-fetch-success":case"mutation-success":o="success";break;case"query-fetch-error":case"mutation-error":o="error";break}let a="";t.queryKey?a=gr(t.queryKey):t.mutationKey?a=gr(t.mutationKey):t.mutationId!==void 0?a=`Mutation #${t.mutationId}`:a=t.type.replace(/-/g," ");let n=[];switch(t.type){case"query-fetch-start":n.push("Fetching");break;case"query-fetch-success":n.push("Success");break;case"query-fetch-error":n.push("Error");break;case"query-invalidated":n.push("Invalidated");break;case"mutation-start":n.push("Mutating");break;case"mutation-success":n.push("Success");break;case"mutation-error":n.push("Error");break}t.duration!==void 0&&n.push(`${t.duration.toFixed(0)}ms`);let s;t.queryHash?s=`rq-query-${t.queryHash}`:t.mutationId!==void 0&&(s=`rq-mutation-${t.mutationId}`);let l=1;switch(t.type){case"query-fetch-start":case"mutation-start":l=1;break;case"query-fetch-success":case"query-fetch-error":case"mutation-success":case"mutation-error":l=2;break;case"query-invalidated":l=3;break}return{id:ce(r),source:r,timestamp:t.timestamp,title:a,subtitle:n.join(" \xB7 "),status:o,originalEvent:e,correlationId:s,sequenceInGroup:l}}function Xa(){try{let{routeEventStore:e}=K("@buoy-gg/route-events");return{id:"route-events",name:"Routes",eventSources:["route"],available:true,subscribe:t=>e.onEvent(r=>{let o=en(r);t(o)})}}catch{return null}}function en(e){let t=e,r="neutral";(t.pathname==="/"||Object.keys(t.params).length>0)&&(r="success");let o=[],a=Object.keys(t.params).length;return a>0&&o.push(`${a} param${a!==1?"s":""}`),t.timeSincePrevious!==void 0&&t.timeSincePrevious>0&&(t.timeSincePrevious<1e3?o.push(`${t.timeSincePrevious}ms`):o.push(`${(t.timeSincePrevious/1e3).toFixed(1)}s`)),t.previousPathname&&t.previousPathname!==t.pathname&&o.push(`from ${t.previousPathname}`),{id:ce("route"),source:"route",timestamp:t.timestamp,title:t.pathname||"/",subtitle:o.join(" \xB7 ")||"navigation",status:r,originalEvent:e}}function tn(){try{let{zustandStateStore:e}=K("@buoy-gg/zustand"),t=null;return{id:"zustand",name:"Zustand",eventSources:["zustand"],available:true,subscribe:r=>e.subscribe(o=>{if(o.length>0){let a=o[0];if(a.id!==t){t=a.id;let n=rn(a);r(n)}}})}}catch{return null}}function rn(e){let t=e,r="neutral";t.isSlowUpdate?r="pending":t.hasStateChange&&(r="success");let o=[];if(t.changedKeys&&t.changedKeys.length>0){let a=t.changedKeys.slice(0,3).join(", "),n=t.changedKeys.length>3?` +${t.changedKeys.length-3}`:"";o.push(`${a}${n}`)}else t.diffSummary&&o.push(t.diffSummary);return t.duration!==void 0&&o.push(`${t.duration.toFixed(1)}ms`),t.category==="replace"&&o.push("replace"),{id:ce("zustand"),source:"zustand",timestamp:t.timestamp,title:t.storeName,subtitle:o.join(" \xB7 ")||(t.hasStateChange?"state changed":"no change"),status:r,originalEvent:e}}function on(){try{let{jotaiStateStore:e}=K("@buoy-gg/jotai"),t=null;return{id:"jotai",name:"Jotai",eventSources:["jotai"],available:true,subscribe:r=>e.subscribe(o=>{if(o.length>0){let a=o[0];if(a.id!==t){t=a.id;let n=an(a);r(n)}}})}}catch{return null}}function an(e){let t=e,r="neutral";t.category==="write"&&t.hasValueChange?r="success":t.category==="read"&&(r="neutral");let o=[];return t.valuePreview?o.push(t.valuePreview):t.diffSummary&&o.push(t.diffSummary),t.category&&o.push(t.category),{id:ce("jotai"),source:"jotai",timestamp:t.timestamp,title:t.atomLabel,subtitle:o.join(" \xB7 ")||(t.hasValueChange?"value changed":"no change"),status:r,originalEvent:e}}function nn(){let e;try{e=K("@buoy-gg/highlight-updates")}catch{return null}try{if(!e.RenderTracker||!e.HighlightUpdatesController)return null;let{RenderTracker:t,HighlightUpdatesController:r}=e;return{id:"render",name:"Render",eventSources:["render"],available:true,setup:()=>{r&&r.enableBackgroundTracking()},subscribe:o=>{r&&!r.isBackgroundTrackingEnabled()&&r.enableBackgroundTracking();let a=t.onRenderEvent((n,s)=>{let l=sn(n,s);o(l)});return()=>{a(),r.disableBackgroundTracking()}}}}catch{return null}}function sn(e,t){let r=e,o=t,a=o.componentName||o.displayName||o.viewType,n=[],s={mount:"mounted",props:"props changed",state:"state changed",hooks:"hooks changed",context:"context changed",parent:"parent re-rendered",unknown:"re-rendered"};if(n.push(s[r.cause.type]||r.cause.type),r.cause.type==="props"&&r.cause.changedKeys?.length){let i=r.cause.changedKeys.slice(0,3).join(", "),c=r.cause.changedKeys.length>3?` +${r.cause.changedKeys.length-3}`:"";n.push(`[${i}${c}]`)}if(r.cause.hookChanges?.length){let i=r.cause.hookChanges[0];i.description&&n.push(i.description)}n.push(`#${r.renderNumber}`);let l="neutral";switch(r.cause.type){case"mount":l="neutral";break;case"props":case"state":case"hooks":case"context":l="success";break;case"parent":l="pending";break;default:l="neutral"}return{id:ce("render"),source:"render",timestamp:r.timestamp,title:a,subtitle:n.join(" \xB7 "),status:l,originalEvent:{event:r,render:o}}}var ln=new Set(["CapacitorHttp","CapacitorCookies","Console","WebView"]),Dt=/token|secret|password|passwd|auth|credential|api[-_]?key|session|cookie/i;function lt(e,t=false,r=0){if(!e||typeof e!="object"||r>4)return e;if(Array.isArray(e))return e.map(s=>lt(s,t,r+1));let o={},a=e,n=t||typeof a.key=="string"&&Dt.test(a.key);for(let[s,l]of Object.entries(a))(Dt.test(s)||n&&s==="value")&&l!=null&&l!==""?o[s]="[hidden]":o[s]=lt(l,false,r+1);return o}function un(){try{let e=K("@buoy-gg/license");return typeof e?.subscribeCapacitorCalls!="function"||!e.isCapacitorBridgeInstalled?.()?null:{id:"capacitor",name:"Capacitor",eventSources:["capacitor"],available:true,subscribe:t=>{let r=new Set,o=0,a=()=>{let s=e.getCapacitorCalls();for(let i of s){if(i.seq<=o||r.has(i.seq))continue;if(ln.has(i.plugin)){r.add(i.seq);continue}(i.end!==void 0||i.kind==="event"||i.method==="addListener")&&(r.add(i.seq),t(cn(i)))}let l=s[0]?.seq??0;if(l>o+1){o=l-1;for(let i of Array.from(r))i<=o&&r.delete(i)}},n=e.getCapacitorCalls();return o=n.length?n[n.length-1].seq:0,e.subscribeCapacitorCalls(a)}}}catch{return null}}function cn(e){let t=[];if(e.kind==="event"?t.push("event"):e.method==="addListener"&&t.push(`listening for ${String(e.options.eventName??"events")}`),e.end!==void 0&&e.kind!=="event"&&t.push(`${Math.max(0,e.end-e.start)}ms`),e.answeredByBuoy&&t.push("answered by Buoy"),e.ok===false){let r=e.error?.message;t.push(typeof r=="string"?r:"failed")}return{id:ce("capacitor"),source:"capacitor",timestamp:e.kind==="event"?e.start:e.end??e.start,title:`${e.plugin}.${e.method}`,subtitle:t.join(" \xB7 ")||"call",status:e.ok===false?"error":e.kind==="event"?"neutral":"success",originalEvent:{plugin:e.plugin,method:e.method,kind:e.kind,options:lt(e.options),result:lt(e.result,typeof e.options.key=="string"&&Dt.test(e.options.key)),error:e.error,durationMs:e.end!==void 0?e.end-e.start:void 0,answeredByBuoy:e.answeredByBuoy??false}}}function dn(){let e=[],t=new Set,r=[Ja,_a,Ga,Za,Xa,tn,on,nn,un,()=>{try{let o=K("@buoy-gg/three");return o?.onThreeLoad?{id:"three",name:"Scene loads",eventSources:["three"],available:true,subscribe:o.onThreeLoad}:null}catch{return null}}];for(let o of r){let a=o();a&&a.available&&(e.push(a),a.eventSources.forEach(n=>t.add(n)))}return{sources:e,availableEventSources:t}}function pn(e){return{"storage-async":{label:"Storage",color:"#8B5CF6",icon:"server-outline"},"storage-mmkv":{label:"MMKV",color:"#F59E0B",icon:"flash-outline"},redux:{label:"Redux",color:"#3B82F6",icon:"git-branch-outline"},network:{label:"Network",color:"#10B981",icon:"globe-outline"},"react-query":{label:"Query",color:"#EC4899",icon:"sync-outline"},"react-query-query":{label:"Query",color:"#EC4899",icon:"sync-outline"},"react-query-mutation":{label:"Mutation",color:"#F97316",icon:"flash-outline"},route:{label:"Route",color:"#06B6D4",icon:"navigate-outline"},zustand:{label:"Zustand",color:"#764ABC",icon:"cube-outline"},jotai:{label:"Jotai",color:"#14B8A6",icon:"ellipse-outline"},render:{label:"Render",color:"#F472B6",icon:"layers-outline"},three:{label:"Scene loads",color:"#F59E0B",icon:"cube-outline"},capacitor:{label:"Capacitor",color:"#119EFF",icon:"hardware-chip-outline"}}[e]||{label:e,color:"#6B7280",icon:"help-outline"}}var Tt=null,fr=-1;function J(){return(!Tt||fr!==hr())&&(fr=hr(),Tt=dn()),Tt}function hn(){let e=[],t=0;try{let{storageEventStore:r}=K("@buoy-gg/storage"),o=r.getSubscriberCounts();e.push({sourceId:"storage",counts:o}),t+=o.total}catch{}try{let{networkEventStore:r}=K("@buoy-gg/network"),o=r.getSubscriberCounts();e.push({sourceId:"network",counts:o}),t+=o.total}catch{}try{let{routeEventStore:r}=K("@buoy-gg/route-events"),o=r.getSubscriberCounts();e.push({sourceId:"route-events",counts:o}),t+=o.total}catch{}try{let{RenderTracker:r,HighlightUpdatesController:o}=K("@buoy-gg/highlight-updates"),a=r.getRenderEventCallbackCount(),n=o?.isEnabled?.()?1:0,s={eventCallbacks:a,arrayListeners:n,total:a+n};e.push({sourceId:"render",counts:s}),t+=s.total}catch{}return{sources:e,totalSubscribers:t}}import{ChangeLog as mn}from"@buoy-gg/shared-ui/web";var At={"storage-async":"storage","storage-mmkv":"storage",redux:"redux",network:"network","react-query":"react-query","react-query-query":"react-query","react-query-mutation":"react-query",route:"route-events",zustand:"zustand",jotai:"jotai",render:"render",capacitor:"capacitor",three:"three"};var gn=200,yr=new Set(["render"]),fn=class extends mn{constructor(){super({max:gn});this.activeSources=new Set;this.remoteAvailableSources=null;this.sourceUnsubscribers=new Map;this.remoteDiscoveryIds=new Set;this.localDiscoveryIds=new Set;this.localSyncChain=Promise.resolve();this.networkEventIdMap=new Map}getDiscoveredSources(){return J().sources}getAvailableEventSources(){return this.remoteAvailableSources?this.remoteAvailableSources:J().availableEventSources}setRemoteAvailableSources(e){let t=e?new Set(e):null,r=this.remoteAvailableSources,o=r===null&&t===null||!!r&&!!t&&r.size===t.size&&[...t].every(a=>r.has(a));this.remoteAvailableSources=t,o||this.notifyListeners()}replaceEvents(e){e=e.map(pr).filter(t=>t!==null),this.activeSources=new Set(e.map(t=>t.source)),this.setItems(e)}async subscribeToAll(){let{sources:e}=J();for(let t of e)yr.has(t.id)||await this.subscribeToSource(t)}async subscribeToSource(e){let t=this.sourceUnsubscribers.get(e.id);if(t){t.refCount++;return}let r={unsubscribe:()=>{},refCount:1};this.sourceUnsubscribers.set(e.id,r);try{e.setup&&await e.setup();let o=await e.subscribe(a=>{this.addEvent(a)});o&&(r.unsubscribe=o)}catch{this.sourceUnsubscribers.get(e.id)===r&&r.refCount<=1&&this.sourceUnsubscribers.delete(e.id)}}unsubscribeFromSource(e){let t=this.sourceUnsubscribers.get(e);t&&(t.refCount--,t.refCount<=0&&(t.unsubscribe(),this.sourceUnsubscribers.delete(e)))}async subscribeToStorage(){let{sources:e}=J(),t=e.find(r=>r.id==="storage");t&&await this.subscribeToSource(t)}unsubscribeFromStorage(){this.unsubscribeFromSource("storage"),this.activeSources.delete("storage-async"),this.activeSources.delete("storage-mmkv")}subscribeToRedux(){let{sources:e}=J(),t=e.find(r=>r.id==="redux");t&&this.subscribeToSource(t)}unsubscribeFromRedux(){this.unsubscribeFromSource("redux"),this.activeSources.delete("redux")}subscribeToNetwork(){let{sources:e}=J(),t=e.find(r=>r.id==="network");t&&this.subscribeToSource(t)}unsubscribeFromNetwork(){this.unsubscribeFromSource("network"),this.activeSources.delete("network")}subscribeToReactQuery(){let{sources:e}=J(),t=e.find(r=>r.id==="react-query");t&&this.subscribeToSource(t)}unsubscribeFromReactQuery(){this.unsubscribeFromSource("react-query"),this.activeSources.delete("react-query"),this.activeSources.delete("react-query-query"),this.activeSources.delete("react-query-mutation")}subscribeToRoutes(){let{sources:e}=J(),t=e.find(r=>r.id==="route-events");t&&this.subscribeToSource(t)}unsubscribeFromRoutes(){this.unsubscribeFromSource("route-events"),this.activeSources.delete("route")}subscribeToZustand(){let{sources:e}=J(),t=e.find(r=>r.id==="zustand");t&&this.subscribeToSource(t)}unsubscribeFromZustand(){this.unsubscribeFromSource("zustand"),this.activeSources.delete("zustand")}subscribeToJotai(){let{sources:e}=J(),t=e.find(r=>r.id==="jotai");t&&this.subscribeToSource(t)}unsubscribeFromJotai(){this.unsubscribeFromSource("jotai"),this.activeSources.delete("jotai")}subscribeToRender(){let{sources:e}=J(),t=e.find(r=>r.id==="render");t&&this.subscribeToSource(t)}unsubscribeFromRender(){this.unsubscribeFromSource("render"),this.activeSources.delete("render")}addEvent(e){let t=pr(e);if(t){if(e=t,e.source==="network"){let r=e.originalEvent;if(r?.id){let o=this.networkEventIdMap.get(r.id);if(o){let a=this.items.findIndex(n=>n.id===o);if(a>=0){e.id=o,this.items=[...this.items.slice(0,a),e,...this.items.slice(a+1)],this.notifyListeners();return}}this.networkEventIdMap.set(r.id,e.id)}}this.push(e),this.activeSources.add(e.source),this.notifyListeners()}}getEvents(e){return!e||e.size===0?this.items:this.items.filter(t=>e.has(t.source))}getActiveSources(){return Array.from(this.activeSources)}getSourceCounts(){let e={"storage-async":0,"storage-mmkv":0,redux:0,network:0,"react-query":0,"react-query-query":0,"react-query-mutation":0,route:0,zustand:0,jotai:0,render:0,capacitor:0,three:0};for(let t of this.items)e[t.source]++;return e}clearEvents(){this.activeSources.clear(),this.networkEventIdMap.clear(),this.clear()}subscribe(e){let t=super.subscribe(e);return e(this.items),t}getEventCount(){return this.items.length}unsubscribeAll(){for(let[,e]of this.sourceUnsubscribers)e.unsubscribe();this.sourceUnsubscribers.clear(),this.activeSources.clear(),this.remoteDiscoveryIds.clear(),this.localDiscoveryIds.clear()}watch(e,t,r=Date.now()){let o=new Set(e),a=new Set;for(let c of e){let u=At[c];u&&a.add(u)}let{sources:n}=J(),s=[];for(let c of a){let u=n.find(d=>d.id===c);u&&(s.push(c),this.subscribeToSource(u))}let l=false,i=this.subscribe(c=>{l||t(c.filter(u=>u.timestamp>=r&&o.has(u.source)))});return()=>{if(!l){l=true,i();for(let c of s)this.unsubscribeFromSource(c)}}}setLocalEnabledSources(e){let t=async()=>{let r=new Set;for(let n of e){let s=At[n];s&&r.add(s)}let o=this.localDiscoveryIds;this.localDiscoveryIds=r;let{sources:a}=J();for(let n of r)if(!o.has(n)){let s=a.find(l=>l.id===n);s&&await this.subscribeToSource(s)}for(let n of o)r.has(n)||this.unsubscribeFromSource(n)};return this.localSyncChain=this.localSyncChain.then(t,t),this.localSyncChain}async setRemoteEnabledSources(e){let{sources:t}=J(),r;if(e==="all")r=new Set(t.map(a=>a.id).filter(a=>!yr.has(a)));else{r=new Set;for(let a of e){let n=At[a];n&&r.add(n)}}let o=this.remoteDiscoveryIds;this.remoteDiscoveryIds=r;for(let a of r)if(!o.has(a)){let n=t.find(s=>s.id===a);n&&await this.subscribeToSource(n)}for(let a of o)r.has(a)||this.unsubscribeFromSource(a)}ensureRemoteSourcesDefault(){this.remoteDiscoveryIds.size===0&&this.setRemoteEnabledSources("all")}clearRemoteSources(){for(let e of this.remoteDiscoveryIds)this.unsubscribeFromSource(e);this.remoteDiscoveryIds.clear()}isSourceSubscribed(e){switch(e){case"storage-async":case"storage-mmkv":return this.sourceUnsubscribers.has("storage");case"redux":return this.sourceUnsubscribers.has("redux");case"network":return this.sourceUnsubscribers.has("network");case"react-query":case"react-query-query":case"react-query-mutation":return this.sourceUnsubscribers.has("react-query");case"route":return this.sourceUnsubscribers.has("route-events");case"zustand":return this.sourceUnsubscribers.has("zustand");case"jotai":return this.sourceUnsubscribers.has("jotai");case"render":return this.sourceUnsubscribers.has("render");case"three":return this.sourceUnsubscribers.has("three");case"capacitor":return this.sourceUnsubscribers.has("capacitor");default:return false}}getSubscriptionStatus(){return{"storage-async":this.sourceUnsubscribers.has("storage"),"storage-mmkv":this.sourceUnsubscribers.has("storage"),redux:this.sourceUnsubscribers.has("redux"),network:this.sourceUnsubscribers.has("network"),"react-query":this.sourceUnsubscribers.has("react-query"),"react-query-query":this.sourceUnsubscribers.has("react-query"),"react-query-mutation":this.sourceUnsubscribers.has("react-query"),route:this.sourceUnsubscribers.has("route-events"),zustand:this.sourceUnsubscribers.has("zustand"),jotai:this.sourceUnsubscribers.has("jotai"),render:this.sourceUnsubscribers.has("render"),capacitor:this.sourceUnsubscribers.has("capacitor"),three:this.sourceUnsubscribers.has("three")}}getSubscriberCounts(){return hn()}},V=new fn;var yn=e=>V.getEvents(e);var bn=()=>V.clearEvents(),vn=e=>V.subscribe(e);var br=e=>V.setLocalEnabledSources(e);var vr=()=>V.getAvailableEventSources();var Sn=(e,t,r)=>V.watch(e,t,r),Sr=()=>V.getSubscriberCounts();import{persistentStorage as Se,devToolsStorageKeys as Fe}from"@buoy-gg/shared-ui/web";async function wn(e){try{let t=Fe.events.enabledSources();await Se.setItem(t,JSON.stringify(e))}catch{}}async function Cn(){try{let e=Fe.events.enabledSources(),t=await Se.getItem(e);return t&&t!==""?JSON.parse(t):null}catch{return null}}async function En(e){try{let t=Fe.events.isCapturing();await Se.setItem(t,JSON.stringify(e))}catch{}}async function xn(){try{let e=Fe.events.isCapturing(),t=await Se.getItem(e);return t!==null&&t!==""?JSON.parse(t):null}catch{return null}}async function wr(e){try{let t=Fe.events.pausedAt();e===null?await Se.removeItem(t):await Se.setItem(t,JSON.stringify(e))}catch{}}async function kn(){try{let e=Fe.events.pausedAt(),t=await Se.getItem(e);if(t!==null&&t!==""){let r=JSON.parse(t);return typeof r=="number"?r:null}return null}catch{return null}}function $n(e,t){if(e.title.toLowerCase().includes(t)||e.subtitle.toLowerCase().includes(t))return true;let r=e.originalEvent?.url;return typeof r=="string"&&r.toLowerCase().includes(t)}var Cr=["storage-async","redux","network","react-query-query","react-query-mutation","route","zustand","jotai","render","capacitor"],Er=Cr.filter(e=>e!=="render"),It={"storage-async":["storage-async","storage-mmkv"],"storage-mmkv":["storage-mmkv"],redux:["redux"],network:["network"],"react-query":["react-query","react-query-query"],"react-query-query":["react-query","react-query-query"],"react-query-mutation":["react-query-mutation"],route:["route"],zustand:["zustand"],jotai:["jotai"],render:["render"],capacitor:["capacitor"],three:["three"]};function qt(e){let{isPro:t}=za(),r=Va("events.entries"),{patterns:o}=Oa(),[a,n]=fe([]),[s,l]=fe(()=>new Set(Er)),[i,c]=fe(true),[u,d]=fe(""),p=xt(false),y=e?.capturingOverride??i,v=xt(null),m=xt([]),[b,h]=fe(0);ye(()=>{y?v.current!==null&&(m.current=[...m.current,[v.current,Date.now()]],v.current=null,h(C=>C+1),wr(null)):v.current===null&&(v.current=Date.now(),h(C=>C+1),wr(v.current))},[y]);let g=be(C=>{let F=v.current;if(F!==null&&C>F)return true;for(let[P,G]of m.current)if(C>P&&C<=G)return true;return false},[]),[k,L]=fe(()=>vr()),[w,A]=fe(0);ye(()=>Na(()=>{A(C=>C+1)}),[]);let x=ve(()=>Cr.filter(C=>(It[C]||[C]).some(F=>k.has(F))),[k]);ye(()=>{let C=null,F=vn(()=>{C==null&&(C=requestAnimationFrame(()=>{C=null,P()}))}),P=()=>{let G=yn();n(G),L(q=>{let R=vr();return q.size===R.size&&[...R].every(ne=>q.has(ne))?q:new Set(R)})};return()=>{F(),C!=null&&cancelAnimationFrame(C)}},[]),ye(()=>{(async()=>{let C=await Cn(),F,P=x.filter(R=>Er.includes(R));if(C&&C.length>0){let R=C.filter(ne=>x.includes(ne));R.length>0?F=new Set(R):F=new Set(P)}else F=new Set(P);l(F);let G=await xn(),q=G!==null?G:true;if(!q&&v.current===null){let R=await kn();v.current=R??Date.now(),h(ne=>ne+1)}c(q),p.current=true,br(q?Array.from(F):[])})()},[x]),ye(()=>{p.current&&br(i?Array.from(s):[])},[s,i]),ye(()=>{p.current&&wn(Array.from(s))},[s]),ye(()=>{p.current&&En(i)},[i]);let j=ve(()=>{let C=new Set;return s.forEach(F=>{let P=It[F];P&&P.forEach(G=>C.add(G))}),C},[s]),N=u.trim().toLowerCase(),he=ve(()=>a.filter(C=>!g(C.timestamp)&&!st(C)&&!$t(C,o)),[a,o,g,b]),_=ve(()=>j.size===0?[]:he.filter(C=>j.has(C.source)&&(N===""||$n(C,N))),[he,j,N]),me=ve(()=>_.slice(0,r),[_,r]),Q=ve(()=>Math.max(0,_.length-r),[_,r]),rt=ve(()=>{let C=he.reduce((q,R)=>(q[R.source]=(q[R.source]??0)+1,q),{}),F=Sr(),P={};for(let q of F.sources)P[q.sourceId]=q.counts.total;let G={"storage-async":"storage","storage-mmkv":"storage",redux:"redux",network:"network","react-query":"react-query","react-query-query":"react-query","react-query-mutation":"react-query",route:"route-events",zustand:"zustand",jotai:"jotai",render:"render",capacitor:"capacitor",three:"three"};return x.map(q=>{let R=(It[q]||[q]).reduce((Z,wt)=>Z+(C[wt]||0),0),ne=pn(q),Ae=G[q],nt=Ae&&Ae in P?P[Ae]:void 0;return{source:q,...ne,count:R,enabled:s.has(q),subscriberCount:nt}}).sort((q,R)=>q.enabled&&!R.enabled?-1:!q.enabled&&R.enabled?1:0)},[he,s,x,w]),bt=be(C=>{l(F=>{let P=new Set(F);return P.has(C)?P.delete(C):P.add(C),P})},[]),ot=be(()=>{l(new Set(x))},[x]),Te=be(()=>{bn()},[]),Le=be(()=>{c(true)},[]),vt=be(()=>{c(false)},[]),St=be(()=>{c(C=>!C)},[]),at=Sr().totalSubscribers;return{events:a,filteredEvents:me,availableSources:rt,enabledSources:s,searchText:u,setSearchText:d,toggleSource:bt,enableAllSources:ot,clearEvents:Te,totalCount:he.length,filteredCount:me.length,isCapturing:i,startCapturing:Le,stopCapturing:vt,toggleCapturing:St,discoveredSources:k,hiddenEventsCount:Q,isPro:t,totalSubscriberCount:at}}import{memo as Dn}from"react";import{night as U}from"@buoy-gg/shared-ui/web";var S="buoy-events";function Tn(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function xr(e){let t=e.originalEvent??{};switch(e.source){case"storage-async":case"storage-mmkv":{let r=t.data??{},o=r.key??(Array.isArray(r.keys)?r.keys.join("+"):void 0)??(Array.isArray(r.pairs)?r.pairs.map(a=>a[0]).join("+"):void 0);return`${e.title} ${o??""}`}case"network":{let r=String(t.url??""),o=r.split("?")[0]??r;return`${t.method??""} ${o}`}case"react-query":case"react-query-query":case"react-query-mutation":return`${e.title} ${t.type??""}`;default:return e.title}}function kr(e){return`${S}-row-${e.source}-${Tn(xr(e))}`}function $r(e){return`${S}-filter-${e}`}import{jsx as we,jsxs as Bt}from"react/jsx-runtime";var Ft=Dn(function({availableSources:e,onToggleSource:t,totalCount:r,filteredCount:o}){return e.length===0?null:Bt(f,{style:re.container,testID:`${S}-filter-bar`,children:[we(ue,{horizontal:true,showsHorizontalScrollIndicator:false,contentContainerStyle:re.badgesRow,testID:`${S}-filter-scroll`,children:e.map(a=>{let n=a.enabled!==false,s=a.subscriberCount,l=s!==void 0,i=a.count||0,c=$r(a.source);return Bt(ge,{testID:c,accessibilityRole:"button",accessibilityLabel:`${a.label} filter, ${n?"on":"off"}, ${i} event${i===1?"":"s"}`,style:[re.badge,n?{backgroundColor:U.color.surface,borderColor:a.color+"50"}:re.badgeDisabled],onPress:()=>t(a.source),activeOpacity:.7,children:[l&&we(f,{style:[re.countBadge,{backgroundColor:n?s>0?a.color+"25":U.color.fillSecondary:U.color.fill}],children:we($,{style:[re.countText,{color:n?s>0?a.color:U.color.textTertiary:U.color.textTertiary}],testID:`${c}-subscribers`,children:s})}),we(f,{style:[re.dot,{backgroundColor:n?a.color:U.color.fillTertiary}]}),we($,{style:[re.badgeLabel,{color:n?U.color.text:U.color.textTertiary}],numberOfLines:1,testID:`${c}-label`,children:a.label}),we(f,{style:[re.countBadge,{backgroundColor:n?i>0?a.color+"20":U.color.fill:U.color.fill}],children:we($,{style:[re.countText,{color:n?i>0?a.color:U.color.textTertiary:U.color.textTertiary}],testID:`${c}-count`,children:i})})]},a.source)})}),o<r&&Bt($,{style:re.filterInfo,testID:`${S}-showing`,children:["Showing ",o," of ",r]})]})}),re=le.create({container:{paddingVertical:8,backgroundColor:"transparent",borderBottomWidth:1,borderBottomColor:U.color.border},badgesRow:{flexDirection:"row",gap:8,paddingHorizontal:12},badge:{flexDirection:"row",alignItems:"center",paddingVertical:5,paddingHorizontal:6,borderRadius:20,borderWidth:1,gap:6,flexShrink:0},badgeDisabled:{backgroundColor:U.color.surface,borderColor:U.color.border,opacity:.5},dot:{width:7,height:7,borderRadius:4},badgeLabel:{fontSize:12,fontWeight:"500"},countBadge:{minWidth:18,height:18,borderRadius:9,alignItems:"center",justifyContent:"center",paddingHorizontal:5},countText:{fontSize:10,fontWeight:"600",fontVariant:["tabular-nums"]},filterInfo:{marginTop:6,fontSize:11,color:U.color.textTertiary,textAlign:"center"}});import{memo as An,useCallback as Rt,useMemo as In}from"react";import{night as ut,Zap as qn,ProBadge as Bn,ToolEmptyState as Fn,resolveListEmptyState as Rn}from"@buoy-gg/shared-ui/web";import{loadToolModule as Re,getToolModuleVersion as Dr}from"@buoy-gg/shared-ui/web/utils";import{memo as jn}from"react";import{CompactRow as Pn,formatRelativeTime as Mn,Pill as zn}from"@buoy-gg/shared-ui/web";import{jsx as O,jsxs as Nn}from"react/jsx-runtime";function On(){let e={StorageEventCard:null,getValueType:null,ReduxActionItem:null,NetworkEventItemCompact:null,RouteEventItemCompact:null,ZustandStateChangeItem:null,JotaiAtomChangeItem:null};try{let t=Re("@buoy-gg/storage");e.StorageEventCard=t.StorageEventCard,e.getValueType=t.getValueType}catch{}try{let t=Re("@buoy-gg/redux");e.ReduxActionItem=t.ReduxActionItem}catch{}try{let t=Re("@buoy-gg/network");e.NetworkEventItemCompact=t.NetworkEventItemCompact}catch{}try{let t=Re("@buoy-gg/route-events");e.RouteEventItemCompact=t.RouteEventItemCompact}catch{}try{let t=Re("@buoy-gg/zustand");e.ZustandStateChangeItem=t.ZustandStateChangeItem}catch{}try{let t=Re("@buoy-gg/jotai");e.JotaiAtomChangeItem=t.JotaiAtomChangeItem}catch{}return e}var jt,Tr=-1;function Vn(){return(!jt||Tr!==Dr())&&(jt=On(),Tr=Dr()),jt}var Ar={"storage-async":{label:"Storage",color:"#8B5CF6"},"storage-mmkv":{label:"MMKV",color:"#F59E0B"},redux:{label:"Redux",color:"#3B82F6"},network:{label:"Network",color:"#10B981"},"react-query":{label:"Query",color:"#EC4899"},"react-query-query":{label:"Query",color:"#EC4899"},"react-query-mutation":{label:"Mutation",color:"#F97316"},route:{label:"Route",color:"#06B6D4"},zustand:{label:"Zustand",color:"#764ABC"},jotai:{label:"Jotai",color:"#14B8A6"},render:{label:"Render",color:"#F472B6"},three:{label:"Scene loads",color:"#F59E0B"},capacitor:{label:"Capacitor",color:"#119EFF"}};function Un(e){switch(e){case"success":return"#10B981";case"error":return"#EF4444";case"pending":return"#F59E0B";case"neutral":default:return"#6B7280"}}function Ln(e){return e==="storage-async"||e==="storage-mmkv"}function Hn({label:e,color:t,testID:r}){return O(zn,{label:e,color:t,variant:"soft",size:"sm",style:{marginLeft:6},testID:r})}var Kn={"storage-async":"STORAGE","storage-mmkv":"MMKV",redux:"REDUX",network:"NET","react-query":"QUERY","react-query-query":"QUERY","react-query-mutation":"MUTATION",route:"ROUTE",zustand:"ZUSTAND",jotai:"JOTAI",render:"RENDER",capacitor:"CAPACITOR",three:"SCENE"};function Ke({source:e,testID:t,children:r}){let o=Ar[e].color,a=Kn[e];return Nn(f,{style:Pt.badgeWrapper,testID:t,children:[r,O(f,{style:[Pt.sourceBadge,{backgroundColor:`${o}20`}],children:O($,{style:[Pt.sourceBadgeText,{color:o}],testID:t?`${t}-badge`:void 0,children:a})})]})}var Ir=jn(function({event:e,onPress:t,isSelected:r=false,isExpanded:o=false,onNavigate:a,correlationCount:n=1,correlationLabel:s,correlationColor:l}){let{StorageEventCard:i,getValueType:c,ReduxActionItem:u,NetworkEventItemCompact:d,RouteEventItemCompact:p,ZustandStateChangeItem:y,JotaiAtomChangeItem:v}=Vn(),m=Ar[e.source],b=Un(e.status),h=kr(e);if(Ln(e.source)&&i&&c){let k=e.originalEvent,L={key:k.data?.key||"unknown",lastAction:k.action,totalOperations:1,lastEventTimestamp:new Date(e.timestamp),storageTypes:new Set([k.storageType||"async"]),valueType:k.data?.value!==void 0?c(k.data.value):void 0};return O(Ke,{source:e.source,testID:h,children:O(i,{data:L,onPress:t,isSelected:r})})}if(e.source==="redux"&&u){let k=e.originalEvent;return O(Ke,{source:e.source,testID:h,children:O(u,{action:k,onPress:()=>t()})})}if(e.source==="network"&&d){let k=e.originalEvent;return O(f,{testID:h,children:O(d,{event:k,onPress:()=>t()})})}if(e.source==="route"&&p){let k=e.originalEvent;return O(Ke,{source:e.source,testID:h,children:O(p,{event:k,visitNumber:0,isExpanded:o,onPress:()=>t(),onNavigate:a})})}if(e.source==="zustand"&&y)return O(Ke,{source:e.source,testID:h,children:O(y,{change:e.originalEvent,onPress:()=>t()})});if(e.source==="jotai"&&v)return O(Ke,{source:e.source,testID:h,children:O(v,{change:e.originalEvent,onPress:()=>t()})});let g=s&&l?O(Hn,{label:s,color:l,testID:`${h}-correlation`}):null;return O(Pn,{statusDotColor:m.color,statusLabel:m.label,primaryText:e.title,secondaryText:e.subtitle,badgeText:n>1&&!s?`${n}`:"",badgeColor:l||b,customBadge:g,bottomRightText:Mn(new Date(e.timestamp)),showChevron:true,isSelected:r,onPress:t,testID:h})}),Pt=le.create({badgeWrapper:{position:"relative"},sourceBadge:{position:"absolute",top:4,right:12,paddingHorizontal:6,paddingVertical:2,borderRadius:4,zIndex:10},sourceBadgeText:{fontSize:8,fontWeight:"700",letterSpacing:.5}});function Jn(e,t){return e.correlationId?t.filter(r=>r.correlationId===e.correlationId&&r.id!==e.id).sort((r,o)=>r.timestamp-o.timestamp):[]}function Wn(e,t){return e.correlationId?t.some(r=>r.correlationId===e.correlationId&&r.id!==e.id):false}function _n(e,t){return e.correlationId?t.filter(r=>r.correlationId===e.correlationId).length:1}function qr(e){let t=new Map;for(let r of e)if(r.correlationId){let o=t.get(r.correlationId)||0;t.set(r.correlationId,o+1)}return t}function Br(e,t){return t.filter(r=>r.correlationId===e).sort((r,o)=>{let a=r.sequenceInGroup??0,n=o.sequenceInGroup??0;return a!==n?a-n:r.timestamp-o.timestamp})}function Fr(e,t){if(!e.correlationId)return null;let r=Br(e.correlationId,t);if(r.length<=1)return null;let o=r.findIndex(a=>a.id===e.id);return o===-1?null:`${o+1}/${r.length}`}var Rr=["#EC4899","#8B5CF6","#3B82F6","#10B981","#F59E0B","#EF4444","#06B6D4","#84CC16"];function jr(e){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o),t|=0;let r=Math.abs(t)%Rr.length;return Rr[r]}import{jsx as je,jsxs as Mt}from"react/jsx-runtime";var zt=An(function({events:e,selectedEventId:t,expandedEventId:r,onEventPress:o,onNavigate:a,isCapturing:n,hiddenEventsCount:s=0,onUpgradePress:l,searchText:i="",totalCount:c=0,sourceCount:u,enabledSourceCount:d}){let p=In(()=>qr(e),[e]),y=Rt(({item:b})=>{let h=b.correlationId&&p.get(b.correlationId)||1,g=Fr(b,e),k=b.correlationId?jr(b.correlationId):void 0;return je(Ir,{event:b,isSelected:b.id===t,isExpanded:b.id===r,onPress:()=>o(b),onNavigate:a,correlationCount:h,correlationLabel:g,correlationColor:k})},[t,r,o,a,p,e]),v=Rt(b=>b.id,[]),m=Rt(()=>s<=0?null:Mt(ge,{style:Ce.hiddenBanner,onPress:l,activeOpacity:.8,testID:`${S}-hidden-banner`,accessibilityRole:"button",accessibilityLabel:`${s} hidden event${s!==1?"s":""}, upgrade for the full history`,children:[Mt(f,{style:Ce.hiddenBannerLeft,children:[je(qn,{size:16,color:ut.color.accent}),Mt($,{style:Ce.hiddenBannerText,testID:`${S}-hidden-count`,children:[s," hidden event",s!==1?"s":""]})]}),je(Bn,{})]}),[s,l]);if(e.length===0){let b=u===0,h=d===0,g=b?{otto:"scanning",title:"No Event Sources",message:`This tool reports on the other Buoy tools.
|
|
2
|
+
Install one \u2014 network, storage, redux, routes \u2014 and its events land here.`}:h&&!i.trim()&&c>0?{otto:"filtering",title:"Every Source Is Off",message:`${c} event${c===1?" is":"s are"} captured. Turn a source chip back on to see them.`}:Rn({subject:"events",search:i,total:c,capturing:n,blocked:h?"Every source chip is off, so there is nothing to search. Turn one back on.":void 0,waiting:{otto:"listening",title:"No Events Yet",message:`Events will appear here as they occur.
|
|
3
|
+
Try interacting with your app.`},paused:{title:"Not Capturing",message:"Event capture is paused. Resume to see events."}});return je(Fn,{...g,testID:`${S}-empty`,style:Ce.emptyContainer})}return je(ar,{keyboardShouldPersistTaps:"handled",data:e,renderItem:y,keyExtractor:v,testID:`${S}-list`,style:Ce.list,contentContainerStyle:Ce.listContent,ItemSeparatorComponent:()=>je(f,{style:Ce.separator}),ListFooterComponent:m,showsVerticalScrollIndicator:true,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,removeClippedSubviews:!(typeof process<"u"&&process.env?.EXPO_PUBLIC_E2E)})}),Ce=le.create({list:{flex:1,backgroundColor:"transparent"},listContent:{paddingVertical:16},separator:{height:8},emptyContainer:{flex:1,justifyContent:"center",backgroundColor:"transparent"},hiddenBanner:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginHorizontal:16,marginTop:8,marginBottom:16,paddingVertical:12,paddingHorizontal:16,backgroundColor:ut.color.surface,borderRadius:8,borderWidth:1,borderColor:ut.color.border},hiddenBannerLeft:{flexDirection:"row",alignItems:"center",gap:8},hiddenBannerText:{fontSize:13,fontWeight:"500",color:ut.color.text}});import{loadToolModule as Ee,getToolModuleVersion as Nt}from"@buoy-gg/shared-ui/web/utils";import{memo as Qn,useMemo as Pr}from"react";import{night as de,formatRelativeTime as Gn,copyToClipboard as Zn,parseValue as Yn,useIgnoredPatterns as Xn,monoFont as ei}from"@buoy-gg/shared-ui/web";import{DataViewer as ti}from"@buoy-gg/shared-ui/web/dataViewer";import{memo as ri,useMemo as oi}from"react";import{buoyColors as oe,night as M,displayValue as ai,monoFont as Pe}from"@buoy-gg/shared-ui/web";import{DataViewer as ct}from"@buoy-gg/shared-ui/web/dataViewer";import{jsx as T,jsxs as W}from"react/jsx-runtime";var ni={"query-fetch-start":{label:"Query Fetching",color:M.color.accent,icon:"hourglass"},"query-fetch-success":{label:"Query Success",color:oe.success,icon:"checkmark"},"query-fetch-error":{label:"Query Error",color:oe.error,icon:"close"},"query-invalidated":{label:"Query Invalidated",color:oe.warning,icon:"refresh"},"mutation-start":{label:"Mutation Started",color:M.color.accent,icon:"hourglass"},"mutation-success":{label:"Mutation Success",color:oe.success,icon:"checkmark"},"mutation-error":{label:"Mutation Error",color:oe.error,icon:"close"}},Mr=ri(function({event:e}){let t=e.originalEvent,r=ni[t.type]||{label:t.type,color:M.color.textTertiary,icon:"help"},o=t.type.startsWith("query-"),a=t.type.startsWith("mutation-"),n=oi(()=>{let u=o?t.queryKey:t.mutationKey;return u?ai(u,true):a&&t.mutationId!==void 0?`Mutation #${t.mutationId}`:"No key"},[t,o,a]),s=new Date(t.timestamp).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true}),l=o?!!t.queryData:!!t.mutationData,i=o?!!t.queryError:!!t.mutationError,c=a&&!!t.mutationVariables;return W(ue,{keyboardShouldPersistTaps:"handled",style:E.container,contentContainerStyle:E.contentContainer,children:[T(f,{style:E.section,children:W(f,{style:[E.eventTypeContainer,{borderColor:r.color+"4D"}],children:[T($,{style:[E.eventTypeHeader,{backgroundColor:r.color+"15",color:r.color}],children:r.label}),W(f,{style:E.eventTypeContent,children:[W(f,{style:E.keyRow,children:[T(ue,{horizontal:true,style:E.keyScrollView,children:T($,{style:E.keyText,children:n})}),T(ii,{type:t.type,color:r.color})]}),t.duration!==void 0&&W(f,{style:E.row,children:[T($,{style:E.labelText,children:"Duration:"}),W($,{style:E.valueText,children:[t.duration.toFixed(0),"ms"]})]}),W(f,{style:E.row,children:[T($,{style:E.labelText,children:"Timestamp:"}),T($,{style:E.valueText,children:s})]}),o&&t.queryHash&&W(f,{style:E.row,children:[T($,{style:E.labelText,children:"Query Hash:"}),T($,{style:[E.valueText,E.hashText],numberOfLines:1,children:t.queryHash})]}),a&&t.mutationId!==void 0&&W(f,{style:E.row,children:[T($,{style:E.labelText,children:"Mutation ID:"}),W($,{style:E.valueText,children:["#",t.mutationId]})]})]})]})}),c&&T(f,{style:E.section,children:W(f,{style:E.dataContainer,children:[T($,{style:[E.dataHeader,{color:oe.warning}],children:"Variables"}),T(f,{style:E.dataContent,children:T(ct,{title:"",data:t.mutationVariables,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),l&&T(f,{style:E.section,children:W(f,{style:E.dataContainer,children:[T($,{style:[E.dataHeader,{color:oe.success}],children:o?"Query Data":"Mutation Result"}),T(f,{style:E.dataContent,children:T(ct,{title:"",data:o?t.queryData:t.mutationData,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),i&&T(f,{style:E.section,children:W(f,{style:[E.dataContainer,E.errorContainer],children:[T($,{style:[E.dataHeader,E.errorHeader],children:"Error"}),T(f,{style:E.dataContent,children:T(ct,{title:"",data:o?t.queryError:t.mutationError,showTypeFilter:true,rawMode:true,initialExpanded:true})})]})}),T(f,{style:E.section,children:W(f,{style:E.dataContainer,children:[T($,{style:E.dataHeader,children:"Event Details"}),T(f,{style:E.dataContent,children:T(ct,{title:"",data:t,showTypeFilter:true,rawMode:true,initialExpanded:false})})]})})]})});function ii({type:e,color:t}){let r=()=>e.includes("start")?"PENDING":e.includes("success")?"SUCCESS":e.includes("error")?"ERROR":e.includes("invalidated")?"INVALIDATED":e.toUpperCase();return T(f,{style:[E.statusChip,{backgroundColor:t+"15",borderColor:t+"33"}],children:T($,{style:[E.statusChipText,{color:t}],children:r()})})}var E=le.create({container:{flex:1,backgroundColor:"transparent"},contentContainer:{padding:8,paddingBottom:24},section:{marginBottom:12},eventTypeContainer:{minWidth:200,backgroundColor:M.color.surface,borderRadius:6,borderWidth:1,overflow:"hidden",shadowColor:M.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},eventTypeHeader:{paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,borderBottomWidth:1,borderBottomColor:M.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:Pe},eventTypeContent:{padding:0},keyRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:M.color.separator},keyScrollView:{flex:1,marginRight:8},keyText:{fontSize:12,color:M.color.text,fontFamily:Pe,lineHeight:18,backgroundColor:M.color.accentSoft,paddingHorizontal:8,paddingVertical:4,borderRadius:4,borderWidth:1,borderColor:M.color.accentBorderStrong},row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:M.color.separator},labelText:{fontSize:10,color:M.color.textSecondary,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:Pe},valueText:{fontSize:12,color:M.color.text,fontWeight:"500",fontVariant:["tabular-nums"],fontFamily:Pe},hashText:{flex:1,textAlign:"right",marginLeft:8},statusChip:{paddingHorizontal:8,paddingVertical:4,borderWidth:1,borderRadius:6,alignSelf:"flex-start"},statusChipText:{fontSize:11,fontWeight:"600",textTransform:"uppercase",letterSpacing:.5,fontFamily:Pe},dataContainer:{minWidth:200,backgroundColor:M.color.surface,borderRadius:6,borderWidth:1,borderColor:M.color.accentBorderStrong,overflow:"hidden",shadowColor:M.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},dataHeader:{backgroundColor:M.color.accentSoft,paddingHorizontal:12,paddingVertical:10,fontWeight:"600",fontSize:12,color:M.color.accent,borderBottomWidth:1,borderBottomColor:M.color.accentBorder,letterSpacing:.5,textTransform:"uppercase",fontFamily:Pe},dataContent:{padding:8},errorContainer:{borderColor:oe.error+"4D"},errorHeader:{backgroundColor:oe.error+"1A",color:oe.error,borderBottomColor:oe.error+"33"}});import{Fragment as si,jsx as D,jsxs as Je}from"react/jsx-runtime";function li(){let e={StorageEventDetailContent:null,ReduxActionDetailContent:null,NetworkEventDetailView:null,RenderDetailView:null,ZustandStateDetailContent:null,JotaiAtomDetailContent:null,RouteEventDetail:null};try{let t=Ee("@buoy-gg/storage");e.StorageEventDetailContent=t.StorageEventDetailContent}catch{}try{let t=Ee("@buoy-gg/redux");e.ReduxActionDetailContent=t.ReduxActionDetailContent}catch{}try{let t=Ee("@buoy-gg/network");e.NetworkEventDetailView=t.NetworkEventDetailView}catch{}try{let t=Ee("@buoy-gg/highlight-updates");e.RenderDetailView=t.RenderDetailView}catch{}try{let t=Ee("@buoy-gg/zustand");e.ZustandStateDetailContent=t.ZustandStateDetailContent}catch{}try{let t=Ee("@buoy-gg/jotai");e.JotaiAtomDetailContent=t.JotaiAtomDetailContent}catch{}try{let t=Ee("@buoy-gg/route-events");e.RouteEventDetail=t.RouteEventDetail}catch{}return e}var Ot,zr=-1;function ui(){return(!Ot||zr!==Nt())&&(Ot=li(),zr=Nt()),Ot}var ci={"storage-async":{label:"AsyncStorage",color:"#8B5CF6"},"storage-mmkv":{label:"MMKV",color:"#F59E0B"},redux:{label:"Redux",color:"#3B82F6"},network:{label:"Network",color:"#10B981"},"react-query":{label:"React Query",color:"#EC4899"},"react-query-query":{label:"Query",color:"#EC4899"},"react-query-mutation":{label:"Mutation",color:"#F97316"},route:{label:"Route",color:"#06B6D4"},zustand:{label:"Zustand",color:"#764ABC"},jotai:{label:"Jotai",color:"#14B8A6"},render:{label:"Render",color:"#F472B6"},three:{label:"Scene loads",color:"#F59E0B"},capacitor:{label:"Capacitor",color:"#119EFF"}};function di(e){return e==="storage-async"||e==="storage-mmkv"}function pi(e){let t=Yn(e);return t===null?"null":t===void 0?"undefined":Array.isArray(t)?"array":typeof t=="boolean"?"boolean":typeof t=="number"?"number":typeof t=="string"?"string":typeof t=="object"?"object":"undefined"}function hi({children:e}){return D(si,{children:e})}var Vt=Qn(function({event:e,onBack:t,NetworkEventDetailViewComponent:r,networkDetailWrapper:o,RouteEventDetailComponent:a,detailComponents:n,onNavigate:s}){let l=Pr(()=>({...ui(),...n}),[n,Nt()]),i=ci[e.source],c=new Date(e.timestamp),{values:u,toggle:d}=Xn(),p=Pr(()=>{if(!di(e.source)||!l.StorageEventDetailContent)return null;let h=e.originalEvent,g={...h,timestamp:new Date(h.timestamp)};return{key:g.data?.key||"unknown",lastEvent:g,events:[g],totalOperations:1,currentValue:g.data?.value,valueType:pi(g.data?.value),storageTypes:new Set([g.storageType||"async"])}},[e,l]);if(p&&l.StorageEventDetailContent){let{StorageEventDetailContent:h}=l;return D(f,{style:B.container,testID:`${S}-detail-storage`,children:D(h,{conversation:p,selectedEventIndex:0,onEventIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="redux"&&l.ReduxActionDetailContent){let{ReduxActionDetailContent:h}=l,g=e.originalEvent;return D(f,{style:B.container,testID:`${S}-detail-redux`,children:D(h,{action:g,actions:[g],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}let y=r??l.NetworkEventDetailView;if(e.source==="network"&&y){let h=e.originalEvent,g=o??hi;return D(f,{style:B.container,children:D(g,{children:D(ue,{keyboardShouldPersistTaps:"handled",style:B.content,testID:`${S}-detail-network`,children:D(y,{event:h,ignoredPatterns:u,onTogglePattern:d})})})})}if(e.source==="react-query"||e.source==="react-query-query"||e.source==="react-query-mutation")return D(f,{style:B.container,testID:`${S}-detail-react-query`,children:D(Mr,{event:e})});if(e.source==="zustand"&&l.ZustandStateDetailContent){let{ZustandStateDetailContent:h}=l,g=e.originalEvent;return D(f,{style:B.container,testID:`${S}-detail-zustand`,children:D(h,{change:g,changes:[g],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="jotai"&&l.JotaiAtomDetailContent){let{JotaiAtomDetailContent:h}=l,g=e.originalEvent;return D(f,{style:B.container,testID:`${S}-detail-jotai`,children:D(h,{change:g,changes:[g],selectedIndex:0,onIndexChange:()=>{},disableInternalFooter:true})})}if(e.source==="render"&&l.RenderDetailView){let{RenderDetailView:h}=l,g=e.originalEvent;return D(f,{style:B.container,children:D(ue,{keyboardShouldPersistTaps:"handled",style:B.content,testID:`${S}-detail-render`,children:D(h,{render:g.render})})})}let v=a??l.RouteEventDetail;if(e.source==="route"&&v)return D(f,{style:B.container,children:D(f,{style:B.container,testID:`${S}-detail-route`,children:D(v,{event:e.originalEvent,onNavigate:s})})});let m=()=>e.originalEvent,b=async()=>{await Zn({source:e.source,timestamp:c.toISOString(),title:e.title,subtitle:e.subtitle,data:m()})};return D(f,{style:B.container,testID:`${S}-detail`,children:Je(ue,{keyboardShouldPersistTaps:"handled",style:B.content,contentContainerStyle:B.contentContainer,testID:`${S}-detail-scroll`,children:[D(f,{style:B.sourceBadgeRow,children:Je(f,{style:[B.sourceBadge,{backgroundColor:i.color+"20"}],children:[D(f,{style:[B.sourceDot,{backgroundColor:i.color}]}),D($,{style:[B.sourceLabel,{color:i.color}],testID:`${S}-detail-source`,children:i.label})]})}),D($,{style:B.title,testID:`${S}-detail-title`,children:e.title}),D($,{style:B.subtitle,testID:`${S}-detail-subtitle`,children:e.subtitle}),Je(f,{style:B.timestampRow,children:[D($,{style:B.timestampLabel,children:"Timestamp"}),Je($,{style:B.timestampValue,testID:`${S}-detail-timestamp`,children:[c.toLocaleTimeString()," (",Gn(c),")"]})]}),Je(f,{style:B.dataSection,children:[D($,{style:B.sectionLabel,children:"Event Data"}),D(f,{style:B.dataContainer,testID:`${S}-detail-data`,children:D(ti,{testIDPrefix:`${S}-detail-data`,data:m(),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true})})]})]})})}),B=le.create({container:{flex:1,backgroundColor:"transparent"},content:{flex:1},contentContainer:{padding:16},sourceBadgeRow:{flexDirection:"row",marginBottom:12},sourceBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:6,borderRadius:12,gap:6},sourceDot:{width:6,height:6,borderRadius:3},sourceLabel:{fontSize:12,fontWeight:"600"},title:{fontSize:24,fontWeight:"700",color:de.color.text,marginBottom:4},subtitle:{fontSize:16,color:de.color.textTertiary,marginBottom:16},timestampRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:12,borderTopWidth:1,borderTopColor:de.color.border,borderBottomWidth:1,borderBottomColor:de.color.border,marginBottom:16},timestampLabel:{fontSize:14,color:de.color.textTertiary},timestampValue:{fontSize:14,color:de.color.text,fontFamily:ei},dataSection:{marginTop:8},sectionLabel:{fontSize:12,fontWeight:"600",color:de.color.textTertiary,textTransform:"uppercase",letterSpacing:.5,marginBottom:8},dataContainer:{backgroundColor:de.color.surface,borderRadius:8,borderWidth:1,borderColor:de.color.border,overflow:"hidden"}});import{useCallback as Me,useEffect as mi,useMemo as dt,useState as Ut}from"react";import{DynamicFilterView as Nr,macOSColors as We,night as _e,FileText as Or,FileCode as Vr,Hash as gi,Zap as fi,AlertTriangle as yi,Settings as bi,Eye as vi,XCircle as Ur,GitBranch as Lr,ToolbarCopyButton as Si,useFeatureGate as wi,ProFeatureBanner as Ci,ExportPreview as Ei,monoFont as xi}from"@buoy-gg/shared-ui/web";import{DataViewer as ki}from"@buoy-gg/shared-ui/web/dataViewer";var Qe={timestampFormat:"relative",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:true,includeTotalDuration:true,includeEventData:false,dataSizeThreshold:5,format:"markdown",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true},Ge={llm:{timestampFormat:"relative",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:true,includeTotalDuration:true,includeEventData:false,dataSizeThreshold:5,format:"markdown",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true},bugReport:{timestampFormat:"both",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:true,includeTotalDuration:true,includeEventData:true,dataSizeThreshold:10,format:"markdown",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true},json:{timestampFormat:"absolute",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:false,includeTotalDuration:false,includeEventData:true,dataSizeThreshold:-1,format:"json",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:false,showStorageDiff:false,stripVerboseFields:false},errors:{timestampFormat:"relative",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:true,includeCorrelation:true,includeDuration:true,includeSummaryHeader:true,includeTotalDuration:false,includeEventData:true,dataSizeThreshold:10,format:"markdown",filterMode:"errors",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true},minimal:{timestampFormat:"relative",includeSource:false,includeStatus:true,includeTitle:true,includeSubtitle:false,includeCorrelation:false,includeDuration:false,includeSummaryHeader:false,includeTotalDuration:false,includeEventData:false,dataSizeThreshold:1,format:"plaintext",filterMode:"all",filterSources:[],compactMode:true,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:false,stripVerboseFields:true},mermaid:{timestampFormat:"relative",includeSource:true,includeStatus:true,includeTitle:true,includeSubtitle:false,includeCorrelation:true,includeDuration:true,includeSummaryHeader:false,includeTotalDuration:false,includeEventData:false,dataSizeThreshold:1,format:"mermaid",filterMode:"all",filterSources:[],compactMode:false,smartJsonParsing:true,reduxChangedOnly:true,showStorageDiff:true,stripVerboseFields:true}};function Hr(e){for(let[t,r]of Object.entries(Ge))if(Object.keys(r).every(o=>{let a=e[o],n=r[o];return Array.isArray(a)&&Array.isArray(n)?a.length===n.length&&a.every((s,l)=>s===n[l]):a===n}))return t;return null}var z={llm:{label:"LLM",description:"AI-ready format",color:"#10B981"},bugReport:{label:"Bug Report",description:"Full context",color:"#EF4444"},json:{label:"JSON",description:"Machine-readable",color:"#F59E0B"},errors:{label:"Errors",description:"Failed only",color:"#EF4444"},minimal:{label:"Minimal",description:"Quick reference",color:"#6B7280"},mermaid:{label:"Diagram",description:"Visual flow",color:"#A855F7"}};import{isDevToolsStorageKey as $i}from"@buoy-gg/shared-ui/web";var ze={success:"\u2705",pending:"\u23F3",error:"\u274C",neutral:"\u2796"},Di={success:"[OK]",pending:"[...]",error:"[ERR]",neutral:"[-]"},Lt={"storage-async":"Storage","storage-mmkv":"MMKV",redux:"Redux",network:"Network","react-query":"Query","react-query-query":"Query","react-query-mutation":"Mutation",route:"Route",zustand:"Zustand",jotai:"Jotai",render:"Render",capacitor:"Capacitor",three:"Scene loads"};function xe(e){if(typeof e!="string")return e;let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return e;try{return JSON.parse(e)}catch{return e}}function ke(e){if(e==null)return e;if(typeof e=="string")return xe(e);if(Array.isArray(e))return e.map(ke);if(typeof e=="object"){let t={};for(let[r,o]of Object.entries(e))t[r]=ke(o);return t}return e}var Ti=new Set(["image","imageUrl","imageURL","image_url","thumbnail","thumbnailUrl","thumbnail_url","icon","iconUrl","avatar","avatarUrl","photo","photoUrl","picture","pictureUrl","description","desc","longDescription","shortDescription","meta_description"]);function Ht(e){if(e==null)return e;if(Array.isArray(e))return e.map(Ht);if(typeof e=="object"){let t={};for(let[r,o]of Object.entries(e))Ti.has(r)||typeof o=="string"&&Ai(o)||(t[r]=Ht(o));return t}return e}function Ai(e){if(!e.startsWith("http"))return false;let t=e.toLowerCase();return t.includes("/photo")||t.includes("/image")||t.includes("unsplash.com")||t.includes("cloudinary.com")||t.includes("imgur.com")||/\.(jpg|jpeg|png|gif|webp|svg|bmp)(\?|$)/i.test(e)}function Ii(e){if(e instanceof Date)return e.toISOString();if(!(e&&typeof e=="object"&&Object.keys(e).length===0))return e}function qi(e,t){let r=i=>{if(typeof i!="object"||i===null)return null;let c=i;return typeof c.id=="string"?c.id:typeof c.orderId=="string"?c.orderId:typeof c.key=="string"?c.key:null},o=new Set(e.map(r).filter(Boolean)),a=new Set(t.map(r).filter(Boolean));if(o.size===0&&a.size===0)return null;let n=t.filter(i=>{let c=r(i);return c&&!o.has(c)}),s=e.filter(i=>{let c=r(i);return c&&!a.has(c)}),l=t.length-n.length;return n.length+s.length<e.length&&n.length+s.length<t.length?{added:n,removed:s,unchanged:l}:null}function Bi(e,t){let r={};if(e.action&&(r.action=e.action),e.storageType&&(r.storageType=e.storageType),e.timestamp!==void 0){let o=Ii(e.timestamp);o!==void 0&&(r.timestamp=o)}if(e.data){let o={...e.data};if(t.smartJsonParsing&&(o.value!==void 0&&(o.value=xe(o.value)),o.prevValue!==void 0&&(o.prevValue=xe(o.prevValue))),t.showStorageDiff&&Array.isArray(o.value)&&Array.isArray(o.prevValue)){let a=qi(o.prevValue,o.value);if(a){let n={key:o.key};return a.added.length>0&&(n.added=a.added),a.removed.length>0&&(n.removed=a.removed),a.unchanged>0&&(n.unchangedCount=a.unchanged),r.data=n,r}}r.data=o}return r}function Fi(e,t){if(!t.reduxChangedOnly)return t.smartJsonParsing?ke(e):e;let r={};if(e.type&&(r.type=e.type),e.payload&&(r.payload=t.smartJsonParsing?ke(e.payload):e.payload),e.sliceName&&(r.sliceName=e.sliceName),e.actionName&&(r.actionName=e.actionName),e.duration&&(r.duration=e.duration),e.hasStateChange!==void 0&&(r.hasStateChange=e.hasStateChange),e.diffSummary&&(r.diffSummary=e.diffSummary),e.changedKeysCount!==void 0&&(r.changedKeysCount=e.changedKeysCount),e.hasStateChange===true){let o=e.sliceName;if(o&&e.prevState&&e.nextState){let a=e.prevState,n=e.nextState;(a[o]!==void 0||n[o]!==void 0)&&(r.stateChange={slice:o,before:a[o],after:n[o]})}}return r}function Kr(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.name=="string"?t.name:typeof t.id=="string"?t.id:typeof t.key=="string"?t.key:null}function Ze(e,t){let r=typeof e=="string"?xe(e):e,o=typeof t=="string"?xe(t):t;if(r==null&&o!==null&&o!==void 0)return"Created";if(r!=null&&o==null)return"Deleted";if(Array.isArray(r)&&Array.isArray(o)){let a=r.length,n=o.length,s=r.map(Kr).filter(Boolean),l=o.map(Kr).filter(Boolean);if(a===n&&a>0){let i=new Set(s),c=new Set(l),u=s.filter(d=>c.has(d));if(u.length===0&&s.length>0&&l.length>0)return`\u26A0\uFE0F Replaced: [${s.join(", ")}] \u2192 [${l.join(", ")}]`;if(u.length<a){let d=s.filter(y=>!c.has(y)),p=l.filter(y=>!i.has(y));return`Changed: -${d.join(", ")} +${p.join(", ")}`}}if(a===0&&n>0)return l.length>0?`Added: [${l.join(", ")}]`:`Added ${n} item${n>1?"s":""}`;if(a>0&&n===0)return s.length>0?`Removed all: [${s.join(", ")}]`:`Removed all ${a} item${a>1?"s":""}`;if(n>a){let i=new Set(s),c=l.filter(u=>!i.has(u));return c.length>0?`Added: [${c.join(", ")}] (${a} \u2192 ${n})`:`Added ${n-a} item${n-a>1?"s":""} (${a} \u2192 ${n})`}if(n<a){let i=new Set(l),c=s.filter(u=>!i.has(u));return c.length>0?`Removed: [${c.join(", ")}] (${a} \u2192 ${n})`:`Removed ${a-n} item${a-n>1?"s":""} (${a} \u2192 ${n})`}return`Updated (${n} item${n>1?"s":""})`}if(typeof r=="object"&&typeof o=="object"&&r&&o){let a=Object.keys(r),n=Object.keys(o),s=n.filter(i=>!a.includes(i)),l=a.filter(i=>!n.includes(i));return s.length>0&&l.length>0?`+${s.length} -${l.length} keys`:s.length>0?`Added: ${s.join(", ")}`:l.length>0?`Removed: ${l.join(", ")}`:"Updated"}return null}function Ri(e,t){let r={};if(e.id&&(r.id=e.id),e.type&&(r.type=e.type),e.timestamp&&(r.timestamp=e.timestamp),e.queryKey&&(r.queryKey=e.queryKey),e.mutationKey&&(r.mutationKey=e.mutationKey),e.mutationId&&(r.mutationId=e.mutationId),e.duration&&(r.duration=e.duration),e.queryData!==void 0&&(r.data=t.smartJsonParsing?ke(e.queryData):e.queryData),e.variables!==void 0&&(r.variables=t.smartJsonParsing?ke(e.variables):e.variables),e.queryError!==void 0){let o=e.queryError;o&&typeof o=="object"?r.error=o.message||o.name||o:r.error=e.queryError}if(e.mutationError!==void 0){let o=e.mutationError;o&&typeof o=="object"?r.error=o.message||o.name||o:r.error=e.mutationError}if(e.query&&typeof e.query=="object"){let o=e.query;if(o.state&&typeof o.state=="object"){let a=o.state;if(a.status&&(r.status=a.status),a.fetchStatus&&(r.fetchStatus=a.fetchStatus),a.error){let n=a.error;n&&typeof n=="object"&&(r.error=n.message||n.name||n)}}}if(e.mutation&&typeof e.mutation=="object"){let o=e.mutation;if(o.state&&typeof o.state=="object"){let a=o.state;if(a.status&&(r.status=a.status),a.failureCount&&(r.failureCount=a.failureCount),a.error){let n=a.error;n&&typeof n=="object"&&(r.error=n.message||n.name||n)}if(a.failureReason){let n=a.failureReason;n&&typeof n=="object"&&(r.failureReason=n.message||n.name||n)}}}return r}function pt(e,t){let r=e.originalEvent;if(!r)return null;let o;return e.source==="storage-async"||e.source==="storage-mmkv"?o=Bi(r,t):e.source==="redux"?o=Fi(r,t):e.source==="react-query"||e.source==="react-query-query"||e.source==="react-query-mutation"?o=Ri(r,t):t.smartJsonParsing?o=ke(r):o=r,t.stripVerboseFields&&o&&(o=Ht(o)),o}function Ye(e){let t={totalEvents:e.length,success:0,pending:0,error:0,neutral:0,durationMs:0,sources:new Set};if(e.length===0)return t;let r=1/0,o=-1/0;for(let a of e)t[a.status]++,t.sources.add(a.source),a.timestamp<r&&(r=a.timestamp),a.timestamp>o&&(o=a.timestamp);return t.durationMs=o-r,t}function Ne(e,t){let r=[...e];if(t.filterMode!=="all"&&(r=r.filter(o=>{switch(t.filterMode){case"errors":return o.status==="error";case"success":return o.status==="success";case"pending":return o.status==="pending";default:return true}})),t.filterSources.length>0){let o=new Set(t.filterSources);r=r.filter(a=>o.has(a.source))}return r}function Kt(e){return e<1e3?`+${e}ms`:e<6e4?`+${(e/1e3).toFixed(1)}s`:`+${(e/6e4).toFixed(1)}m`}function Jr(e){return new Date(e).toISOString()}function ht(e,t,r){let o=Kt(e-t),a=Jr(e);switch(r){case"relative":return o;case"absolute":return a;case"both":return`${o} (${a})`}}function Jt(e,t){let r=0,o=[e],a=new Set;for(;o.length>0;){if(r>t)return{over:true,approxBytes:r};let n=o.pop();if(n==null)r+=4;else if(typeof n=="string")r+=n.length+2;else if(typeof n=="number")r+=8;else if(typeof n=="boolean")r+=5;else if(typeof n=="object"){if(a.has(n))continue;if(a.add(n),Array.isArray(n)){r+=2+n.length;for(let s=0;s<n.length;s++)o.push(n[s])}else{r+=2;for(let s in n)r+=s.length+4,o.push(n[s])}}else r+=4}return{over:r>t,approxBytes:r}}function mt(e,t){if(t===-1)return{data:e,truncated:false};let{over:r,approxBytes:o}=Jt(e,t*1024);if(r)return{data:`[Data truncated - \u2265${(o/1024).toFixed(1)}KB exceeds ${t}KB limit]`,truncated:true};try{return JSON.stringify(e),{data:e,truncated:false}}catch{return{data:"[Unable to serialize data]",truncated:true}}}function Wr(e,t){let r=0;for(let o of e)if(t.includeSource&&(r+=20),t.includeStatus&&(r+=10),t.includeTitle&&(r+=(o.title?.length||0)+10),t.includeSubtitle&&(r+=(o.subtitle?.length||0)+10),t.includeCorrelation&&(r+=20),t.includeDuration&&(r+=15),r+=30,t.includeEventData&&o.originalEvent){let a=t.dataSizeThreshold===-1?1048576:t.dataSizeThreshold*1024,{approxBytes:n}=Jt(o.originalEvent,a);r+=Math.min(n,a)}return t.includeSummaryHeader&&(r+=100),t.includeTotalDuration&&(r+=50),t.format==="markdown"&&(r*=1.2),t.format==="json"&&(r*=1.3),Math.round(r)}function ji(e,t,r){let o=[],a=ht(e.timestamp,t,r.timestampFormat);if(o.push(`\`${a}\``),r.includeStatus&&o.push(ze[e.status]),r.includeSource&&o.push(`**${Lt[e.source]}**`),r.includeTitle&&o.push(e.title),r.showStorageDiff&&(e.source==="storage-async"||e.source==="storage-mmkv")){let n=e.originalEvent;if(n?.data){let s=n.data,l=Ze(s.prevValue,s.value);l&&o.push(`\u2192 ${l}`)}}return e.source==="redux"&&e.originalEvent?.hasStateChange===false&&o.push("(no state change)"),r.includeSubtitle&&e.subtitle&&o.push(`- ${e.subtitle}`),o.join(" ")}function Pi(e,t){let r=[],o=e.originalEvent;if(!o?.data)return r;let a=o.data,n=t.smartJsonParsing?xe(a.prevValue):a.prevValue,s=t.smartJsonParsing?xe(a.value):a.value,l=Ze(a.prevValue,a.value);if(l&&r.push(` **Change:** ${l}`),Array.isArray(n)&&Array.isArray(s)){let i=n.map(u=>typeof u=="object"&&u&&"name"in u?u.name:null).filter(Boolean),c=s.map(u=>typeof u=="object"&&u&&"name"in u?u.name:null).filter(Boolean);(i.length>0||c.length>0)&&(i.length>0&&r.push(` Before: [${i.join(", ")}]`),r.push(` After: [${c.join(", ")}]`))}return r}function Wt(e,t){let r=Ne(e,t);if(r.length===0)return"No events to export.";let o=[...r].sort((i,c)=>i.timestamp-c.timestamp),a=o[0].timestamp,n=Ye(o),s=[];if(s.push("## Event Flow"),t.includeSummaryHeader||t.includeTotalDuration){let i=[];if(t.includeTotalDuration&&i.push(`**Duration:** ${Kt(n.durationMs).replace("+","")}`),i.push(`**Events:** ${n.totalEvents}`),t.includeSummaryHeader){let c=[];n.success>0&&c.push(`${n.success} ${ze.success}`),n.pending>0&&c.push(`${n.pending} ${ze.pending}`),n.error>0&&c.push(`${n.error} ${ze.error}`),n.neutral>0&&c.push(`${n.neutral} ${ze.neutral}`),c.length>0&&i.push(`**Status:** ${c.join(" ")}`)}s.push(i.join(" | "))}if(s.push(""),s.push("### Timeline"),s.push(""),t.compactMode)return o.forEach((i,c)=>{s.push(`${c+1}. ${ji(i,a,t)}`)}),s.join(`
|
|
4
|
+
`);o.forEach((i,c)=>{let u=[],d=ht(i.timestamp,a,t.timestampFormat);if(u.push(`${c+1}. \`${d}\``),t.includeStatus&&u.push(ze[i.status]),t.includeSource&&u.push(`**${Lt[i.source]}**`),t.includeTitle&&u.push(i.title),t.includeCorrelation&&i.correlationId&&i.sequenceInGroup&&u.push(`(${i.sequenceInGroup})`),s.push(u.join(" ")),t.includeSubtitle&&i.subtitle&&s.push(` \u2514\u2500 ${i.subtitle}`),t.showStorageDiff&&!t.includeEventData&&(i.source==="storage-async"||i.source==="storage-mmkv")){let p=Pi(i,t);s.push(...p)}if(t.includeEventData&&i.originalEvent){let p=pt(i,t),{data:y,truncated:v}=mt(p,t.dataSizeThreshold);if(v)s.push(` \u2514\u2500 ${y}`);else{if(t.showStorageDiff&&(i.source==="storage-async"||i.source==="storage-mmkv")){let m=i.originalEvent;if(m?.data){let b=m.data,h=Ze(b.prevValue,b.value);h&&s.push(` **Change:** ${h}`)}}s.push(" ```json"),s.push(` ${JSON.stringify(y,null,2).split(`
|
|
5
5
|
`).join(`
|
|
6
|
-
`)}`),s.push(" ```")}}s.push("")});let l=o.filter(i=>i.status==="error");if(l.length>0&&t.includeEventData){s.push("---"),s.push(""),s.push("### Errors"),s.push("");for(let i of l){let c=
|
|
7
|
-
`)}function _r(e,t){let r=
|
|
8
|
-
`)}var _t=[{id:"U",icon:"\u{1F464}",label:"User",sources:[],group:"client"},{id:"App",icon:"\u{1F4F1}",label:"App",sources:["route","render"],group:"client"},{id:"Async",icon:"\u{1F4BE}",label:"AsyncStorage",sources:["storage-async"],group:"client"},{id:"MMKV",icon:"\u26A1",label:"MMKV",sources:["storage-mmkv"],group:"client"},{id:"Redux",icon:"\u{1F504}",label:"Redux",sources:["redux"],group:"client"},{id:"API",icon:"\u{1F310}",label:"API",sources:["network"],group:"server"},{id:"Cache",icon:"\u{1F4E6}",label:"QueryCache",sources:["react-query","react-query-query","react-query-mutation"],group:"server"}];function Mi(e){let t=new Set;for(let o of e)t.add(o.source);let r=[];r.push(_t[0]),r.push(_t[1]);for(let o of _t.slice(2))o.sources.some(a=>t.has(a))&&r.push(o);return r}function zi(e){let t=e.some(o=>o.group==="client"),r=e.some(o=>o.group==="server");return t&&r&&e.length>=3}function $e(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function Xe(e){return e.replace(/[#;:]/g," ").replace(/[\n\r]/g," ").replace(/"/g,"'").replace(/\s+/g," ").trim()}function Ni(e){if($i(e))return true;let t=["last-route","@dev/last","__debug","_persist","devtools/internal"],r=e.toLowerCase();return t.some(o=>r.includes(o))}function Qt(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Oi(e){return Jt(e,1024*1024).approxBytes}function Vi(e){try{let t=new URL(e,"http://localhost");return["timestamp","t","_t","debug","client","version","cache","_"].forEach(r=>t.searchParams.delete(r)),t.pathname+(t.searchParams.toString()?"?"+t.searchParams.toString():"")}catch{return e}}function Ui(e){let t=e.replace(/^@[\w-]+\//,"").replace(/^devtools\//,"").replace(/^dev\//,"").replace(/^buoy\//,"").replace(/^pokemon\//,""),r=t.split("/").filter(Boolean);return r.length>1&&(t=r.slice(-1).join("/")),t=t.replace(/-/g," ").replace(/_/g," "),t=t.split(" ").map(o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()).join(" "),t.toLowerCase()==="saved"&&(t="Favorites"),t.substring(0,20)}function Gr(e){let t=e;try{t=new URL(e,"http://localhost").pathname}catch{let o=t.indexOf("?");o>0&&(t=t.substring(0,o))}let r=t.split("/").filter(Boolean);if(r.length>=2){let o=r[r.length-1];return/^\d+$/.test(o)||/^[a-f0-9-]{36}$/i.test(o)?null:o.charAt(0).toUpperCase()+o.slice(1)}return r.length===1?r[0].charAt(0).toUpperCase()+r[0].slice(1):null}function Li(e,t){try{let r=new URL(t,"http://localhost"),o=r.pathname;if(o.includes("graphql"))return"GraphQL Request";o=o.replace(/^\/api\/v\d+/,"").replace(/^\/api/,"");let a=Gr(o),n=o.split("/").filter(Boolean),s=n[0]?n[0].charAt(0).toUpperCase()+n[0].slice(1):"Data",l=r.searchParams.has("q")||r.searchParams.has("query")||r.searchParams.has("search");switch(e.toUpperCase()){case"GET":if(l){let i=r.searchParams.get("q")||r.searchParams.get("query")||r.searchParams.get("search");return i?`Search "${i}"`:`Search ${s}`}return a?`Fetch ${a}`:`Fetch ${s}`;case"POST":return o.includes("search")?`Search ${s}`:a?`Create ${a}`:`Create ${s}`;case"PUT":case"PATCH":return a?`Update ${a}`:`Update ${s}`;case"DELETE":return a?`Delete ${a}`:`Delete ${s}`;default:return`${e} ${s}`}}catch{return`${e} request`}}function Zr(e){if(e==="/"||e==="")return"Home";let t=e.split("/").filter(Boolean);if(t.length===0)return"Home";if(t.length===1)return`${t[0].charAt(0).toUpperCase()+t[0].slice(1)} List`;if(t.length>=2){let r=t[t.length-1];return/^\d+$/.test(r)?`${t[0].charAt(0).toUpperCase()+t[0].slice(1)} #${r}`:`${r.charAt(0).toUpperCase()+r.slice(1)} Details`}return e}function Hi(e,t,r){let o=[],a=[],n=$e(e.timestamp-r);switch(e.source){case"route":{let s=e.originalEvent,l=String(s?.pathname||e.title),i=s?.previousPathname,c=s?.timeSincePrevious,u=Zr(l),d=i?Zr(i):null;d?(o.push(`U->>App: ${d} \u2192 ${u}`),c&&c>0&&a.push(`Note right of App: ${$e(c)} on ${d}`)):o.push(`U->>App: Open ${u}`);break}case"network":{let s=e.originalEvent,l=s?.method||"GET",i=s?.url||"",c=s?.status,u=s?.duration,d=s?.response||s?.data||s?.body,p=s?.responseSize||s?.size||s?.contentLength,y=Li(l,i),v=Gr(i);if(o.push(`App->>+API: ${y}`),e.status==="error"){let b=c?`${c} Error`:"Failed";o.push(`API--x-App: ${b}`)}else{let b=v?`\u2713 ${v}`:"\u2713 Success";o.push(`API-->>-App: ${b}`)}let
|
|
6
|
+
`)}`),s.push(" ```")}}s.push("")});let l=o.filter(i=>i.status==="error");if(l.length>0&&t.includeEventData){s.push("---"),s.push(""),s.push("### Errors"),s.push("");for(let i of l){let c=ht(i.timestamp,a,t.timestampFormat);if(s.push(`**${i.title}** (${c})`),i.originalEvent){let u=pt(i,t),{data:d,truncated:p}=mt(u,t.dataSizeThreshold);p||(s.push("```json"),s.push(JSON.stringify(d,null,2)),s.push("```"))}s.push("")}}return s.join(`
|
|
7
|
+
`)}function _r(e,t){let r=Ne(e,t);if(r.length===0)return"[]";let o=[...r].sort((l,i)=>l.timestamp-i.timestamp),a=o[0].timestamp,n=Ye(o),s={exportedAt:new Date().toISOString()};return t.includeSummaryHeader&&(s.summary={totalEvents:n.totalEvents,success:n.success,pending:n.pending,error:n.error,neutral:n.neutral,durationMs:n.durationMs,sources:Array.from(n.sources)}),s.events=o.map(l=>{let i={};if(i.timestamp=Jr(l.timestamp),(t.timestampFormat==="relative"||t.timestampFormat==="both")&&(i.relativeMs=l.timestamp-a),t.includeSource&&(i.source=l.source),t.includeStatus&&(i.status=l.status),t.includeTitle&&(i.title=l.title),t.includeSubtitle&&(i.subtitle=l.subtitle),t.includeCorrelation&&l.correlationId&&(i.correlationId=l.correlationId,i.sequenceInGroup=l.sequenceInGroup),t.includeEventData&&l.originalEvent){let c=pt(l,t),{data:u,truncated:d}=mt(c,t.dataSizeThreshold);if(i.data=u,d&&(i.dataTruncated=true),t.showStorageDiff&&(l.source==="storage-async"||l.source==="storage-mmkv")){let p=l.originalEvent;if(p?.data){let y=p.data,v=Ze(y.prevValue,y.value);v&&(i.changeSummary=v)}}}return i}),JSON.stringify(s,null,2)}function Qr(e,t){let r=Ne(e,t);if(r.length===0)return"No events to export.";let o=[...r].sort((l,i)=>l.timestamp-i.timestamp),a=o[0].timestamp,n=Ye(o),s=[];if(t.includeSummaryHeader||t.includeTotalDuration){let l=[`Event Flow (${n.totalEvents} events`];if(t.includeTotalDuration&&(l[0]+=`, ${Kt(n.durationMs).replace("+","")}`),l[0]+=")",s.push(l[0]),t.includeSummaryHeader){let i=[];n.success>0&&i.push(`${n.success} success`),n.pending>0&&i.push(`${n.pending} pending`),n.error>0&&i.push(`${n.error} error`),n.neutral>0&&i.push(`${n.neutral} neutral`),i.length>0&&s.push(i.join(", "))}s.push("")}for(let l of o){let i=[],c=ht(l.timestamp,a,t.timestampFormat);if(i.push(c.padEnd(12)),t.includeStatus&&i.push(Di[l.status]),t.includeSource&&i.push(`${Lt[l.source]}:`),t.includeTitle&&i.push(l.title),t.showStorageDiff&&(l.source==="storage-async"||l.source==="storage-mmkv")){let u=l.originalEvent;if(u?.data){let d=u.data,p=Ze(d.prevValue,d.value);p&&i.push(`-> ${p}`)}}if(l.source==="redux"&&l.originalEvent?.hasStateChange===false&&i.push("(no change)"),t.includeSubtitle&&l.subtitle&&i.push(`- ${l.subtitle}`),s.push(i.join(" ")),t.includeEventData&&l.originalEvent){let u=pt(l,t),{data:d,truncated:p}=mt(u,t.dataSizeThreshold);p?s.push(` ${d}`):s.push(` Data: ${JSON.stringify(d)}`)}}return s.join(`
|
|
8
|
+
`)}var _t=[{id:"U",icon:"\u{1F464}",label:"User",sources:[],group:"client"},{id:"App",icon:"\u{1F4F1}",label:"App",sources:["route","render"],group:"client"},{id:"Async",icon:"\u{1F4BE}",label:"AsyncStorage",sources:["storage-async"],group:"client"},{id:"MMKV",icon:"\u26A1",label:"MMKV",sources:["storage-mmkv"],group:"client"},{id:"Redux",icon:"\u{1F504}",label:"Redux",sources:["redux"],group:"client"},{id:"API",icon:"\u{1F310}",label:"API",sources:["network"],group:"server"},{id:"Cache",icon:"\u{1F4E6}",label:"QueryCache",sources:["react-query","react-query-query","react-query-mutation"],group:"server"}];function Mi(e){let t=new Set;for(let o of e)t.add(o.source);let r=[];r.push(_t[0]),r.push(_t[1]);for(let o of _t.slice(2))o.sources.some(a=>t.has(a))&&r.push(o);return r}function zi(e){let t=e.some(o=>o.group==="client"),r=e.some(o=>o.group==="server");return t&&r&&e.length>=3}function $e(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function Xe(e){return e.replace(/[#;:]/g," ").replace(/[\n\r]/g," ").replace(/"/g,"'").replace(/\s+/g," ").trim()}function Ni(e){if($i(e))return true;let t=["last-route","@dev/last","__debug","_persist","devtools/internal"],r=e.toLowerCase();return t.some(o=>r.includes(o))}function Qt(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Oi(e){return Jt(e,1024*1024).approxBytes}function Vi(e){try{let t=new URL(e,"http://localhost");return["timestamp","t","_t","debug","client","version","cache","_"].forEach(r=>t.searchParams.delete(r)),t.pathname+(t.searchParams.toString()?"?"+t.searchParams.toString():"")}catch{return e}}function Ui(e){let t=e.replace(/^@[\w-]+\//,"").replace(/^devtools\//,"").replace(/^dev\//,"").replace(/^buoy\//,"").replace(/^pokemon\//,""),r=t.split("/").filter(Boolean);return r.length>1&&(t=r.slice(-1).join("/")),t=t.replace(/-/g," ").replace(/_/g," "),t=t.split(" ").map(o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()).join(" "),t.toLowerCase()==="saved"&&(t="Favorites"),t.substring(0,20)}function Gr(e){let t=e;try{t=new URL(e,"http://localhost").pathname}catch{let o=t.indexOf("?");o>0&&(t=t.substring(0,o))}let r=t.split("/").filter(Boolean);if(r.length>=2){let o=r[r.length-1];return/^\d+$/.test(o)||/^[a-f0-9-]{36}$/i.test(o)?null:o.charAt(0).toUpperCase()+o.slice(1)}return r.length===1?r[0].charAt(0).toUpperCase()+r[0].slice(1):null}function Li(e,t){try{let r=new URL(t,"http://localhost"),o=r.pathname;if(o.includes("graphql"))return"GraphQL Request";o=o.replace(/^\/api\/v\d+/,"").replace(/^\/api/,"");let a=Gr(o),n=o.split("/").filter(Boolean),s=n[0]?n[0].charAt(0).toUpperCase()+n[0].slice(1):"Data",l=r.searchParams.has("q")||r.searchParams.has("query")||r.searchParams.has("search");switch(e.toUpperCase()){case"GET":if(l){let i=r.searchParams.get("q")||r.searchParams.get("query")||r.searchParams.get("search");return i?`Search "${i}"`:`Search ${s}`}return a?`Fetch ${a}`:`Fetch ${s}`;case"POST":return o.includes("search")?`Search ${s}`:a?`Create ${a}`:`Create ${s}`;case"PUT":case"PATCH":return a?`Update ${a}`:`Update ${s}`;case"DELETE":return a?`Delete ${a}`:`Delete ${s}`;default:return`${e} ${s}`}}catch{return`${e} request`}}function Zr(e){if(e==="/"||e==="")return"Home";let t=e.split("/").filter(Boolean);if(t.length===0)return"Home";if(t.length===1)return`${t[0].charAt(0).toUpperCase()+t[0].slice(1)} List`;if(t.length>=2){let r=t[t.length-1];return/^\d+$/.test(r)?`${t[0].charAt(0).toUpperCase()+t[0].slice(1)} #${r}`:`${r.charAt(0).toUpperCase()+r.slice(1)} Details`}return e}function Hi(e,t,r){let o=[],a=[],n=$e(e.timestamp-r);switch(e.source){case"route":{let s=e.originalEvent,l=String(s?.pathname||e.title),i=s?.previousPathname,c=s?.timeSincePrevious,u=Zr(l),d=i?Zr(i):null;d?(o.push(`U->>App: ${d} \u2192 ${u}`),c&&c>0&&a.push(`Note right of App: ${$e(c)} on ${d}`)):o.push(`U->>App: Open ${u}`);break}case"network":{let s=e.originalEvent,l=s?.method||"GET",i=s?.url||"",c=s?.status,u=s?.duration,d=s?.response||s?.data||s?.body,p=s?.responseSize||s?.size||s?.contentLength,y=Li(l,i),v=Gr(i);if(o.push(`App->>+API: ${y}`),e.status==="error"){let b=c?`${c} Error`:"Failed";o.push(`API--x-App: ${b}`)}else{let b=v?`\u2713 ${v}`:"\u2713 Success";o.push(`API-->>-App: ${b}`)}let m=[];if(u&&m.push($e(u)),p&&p>0)m.push(Qt(p));else if(d){let b=Oi(d);b>1024&&m.push(Qt(b))}m.length>0&&a.push(`Note right of API: ${m.join(" \xB7 ")}`);break}case"storage-async":case"storage-mmkv":{let s=e.originalEvent,l=s?.data,i=s?.action||"access",c=l?.key||"data";if(Ni(c))return{messages:[],notes:[],skip:true};let u=Ui(c),d=e.source==="storage-mmkv"?"MMKV":"Async",p=w=>{if(typeof w=="string")return w;if(typeof w=="number")return String(w);if(typeof w=="object"&&w){if("name"in w)return String(w.name);if("id"in w)return String(w.id)}return null},y=w=>w.charAt(0).toUpperCase()+w.slice(1),v="",m="",b="",h="",g=l?.prevValue,k=l?.value;if(Array.isArray(g)&&Array.isArray(k)){let w=g.length,A=k.length;if(h=`${w} \u2192 ${A} items`,A>w){v="\u2795",m="Add";let x=new Set(g.map(p).filter(Boolean));for(let j of k){let N=p(j);if(N&&!x.has(N)){b=y(N);break}}}else if(A<w){v="\u2796",m="Remove";let x=new Set(k.map(p).filter(Boolean));for(let j of g){let N=p(j);if(N&&!x.has(N)){b=y(N);break}}}else v="\u{1F4DD}",m="Update"}else if(Array.isArray(k)&&(!g||Array.isArray(g)&&g.length===0)){if(v="\u2795",m="Add",h=`\u2192 ${k.length} items`,k.length>0){let w=p(k[0]);w&&(b=y(w))}}else Array.isArray(g)&&(!k||Array.isArray(k)&&k.length===0)?(v="\u2796",m="Clear",h=`${g.length} \u2192 0 items`):i==="getItem"?(v="\u{1F4D6}",m="Load"):i==="removeItem"?(v="\u2796",m="Remove"):i==="clear"?(v="\u{1F5D1}\uFE0F",m="Clear"):(v="\u{1F4BE}",m="Save");let L;b?L=`App->>${d}: ${v} ${m} ${b} \u2192 ${u}`:L=`App->>${d}: ${v} ${m} ${u}`,o.push(L),h&&a.push(`Note right of ${d}: ${h}`);break}case"react-query":case"react-query-query":{let s=e.originalEvent,l=s?.type||"",i=s?.queryKey,c=s?.duration,u="data";if(Array.isArray(i)&&i.length>0){let d=i[i.length-1];typeof d=="string"&&!/^\d+$/.test(d)?u=d.charAt(0).toUpperCase()+d.slice(1):i.length>1&&typeof i[0]=="string"&&(u=i[0].charAt(0).toUpperCase()+i[0].slice(1))}if(l.includes("start")||l.includes("fetch")||e.status==="pending")o.push(`App->>+Cache: Fetch ${u}`);else if(e.status==="error")o.push("Cache--x-App: Failed to load");else if(e.status==="success"){let d=`\u2713 ${u} ready`;c&&(d+=` (${$e(c)})`),o.push(`Cache-->>-App: ${d}`)}else l.includes("invalidate")?o.push(`App->>Cache: Refresh ${u}`):o.push(`Cache-->>App: ${Xe(l)}`);break}case"react-query-mutation":{let s=e.originalEvent,l=s?.type||"",i=s?.mutationKey,c=s?.duration,u="Update";if(Array.isArray(i)&&i.length>0){let d=String(i[0]);d.includes("add")||d.includes("create")?u="Add":d.includes("delete")||d.includes("remove")?u="Delete":d.includes("update")||d.includes("edit")?u="Update":u=d.charAt(0).toUpperCase()+d.slice(1)}if(l.includes("start")||l.includes("loading")||e.status==="pending")o.push(`App->>+Cache: ${u}`);else if(e.status==="error")o.push(`Cache--x-App: ${u} failed`);else if(e.status==="success"){let d=`\u2713 ${u} complete`;c&&(d+=` (${$e(c)})`),o.push(`Cache-->>-App: ${d}`)}break}case"redux":{let s=e.originalEvent,l=s?.type||e.title,i=s?.hasStateChange,c=s?.diffSummary,u=l.split("/"),d;if(u.length>=2){let p=u[0].charAt(0).toUpperCase()+u[0].slice(1),y=u[1].replace(/([A-Z])/g," $1").replace(/(pending|fulfilled|rejected)$/i,"").trim();y=y.charAt(0).toUpperCase()+y.slice(1),d=`${y} (${p})`}else d=Xe(l).substring(0,25);o.push(`App->>Redux: ${d}`),i===false?a.push("Note right of Redux: No change"):c&&a.push(`Note right of Redux: ${Xe(c).substring(0,35)}`);break}case"render":{let s=e.originalEvent?.renderData,l=Xe(e.title).substring(0,20),i=s?.cause||"update",c=i==="mount"?"mounted":i==="props"?"props changed":i==="state"?"state changed":i==="context"?"context changed":i==="parent"?"parent re-rendered":i==="hooks"?"hook changed":i;o.push(`App->>App: Render ${l}`),a.push(`Note right of App: ${c}`);break}default:o.push(`App->>App: ${Xe(e.title).substring(0,30)}`)}return{messages:o,notes:a}}function Yr(e,t){let r=Ne(e,t);if(r.length===0)return`sequenceDiagram
|
|
9
9
|
participant U as \u{1F464} User
|
|
10
10
|
participant App as \u{1F4F1} App
|
|
11
|
-
Note over U,App: No events captured`;let o=[...r].sort((
|
|
12
|
-
`)}function Gt(e,t){switch(t.format){case"markdown":return Wt(e,t);case"json":return _r(e,t);case"plaintext":return Qr(e,t);case"mermaid":return Yr(e,t);default:return Wt(e,t)}}import{definePersistedSetting as Ki,devToolsStorageKeys as Ji}from"@buoy-gg/shared-ui/web";var Zt=Ki(Ji.events.copySettings(),_e,{sanitize:(e,t)=>({...e,filterSources:t?.filterSources??_e.filterSources})});async function Xr(e){await Zt.save(e)}async function eo(){return Zt.loadOrNull()}async function Wi(){await Zt.clear()}import{Fragment as _i,jsx as ae,jsxs as Yt}from"react/jsx-runtime";var Qi=50*1024,Gi=200*1024;function Zi(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Yi(){let e=Date.now();return[{id:"mock-1",source:"storage-async",timestamp:e-2e3,title:"Set Item",subtitle:"user_cart",status:"success",originalEvent:{action:"setItem",key:"user_cart",value:{items:2}}},{id:"mock-2",source:"react-query-query",timestamp:e-1500,title:"cart \u203A items",subtitle:"Fetching...",status:"pending",originalEvent:{type:"query-fetch-start",queryKey:["cart","items"]},correlationId:"rq-query-cart",sequenceInGroup:1},{id:"mock-3",source:"react-query-query",timestamp:e-1e3,title:"cart \u203A items",subtitle:"Success \xB7 500ms",status:"success",originalEvent:{type:"query-fetch-success",queryKey:["cart","items"],data:{items:[]}},correlationId:"rq-query-cart",sequenceInGroup:2},{id:"mock-4",source:"network",timestamp:e-500,title:"POST /api/checkout",subtitle:"402 \xB7 450ms",status:"error",originalEvent:{method:"POST",url:"/api/checkout",status:402,error:"Payment required"}}]}function to({events:e=[],initialSettings:t=_e,onSettingsChange:r}){let{isPro:o}=wi(),[a,n]=Ut(t),[s,l]=Ut(false),[i,c]=Ut(false);hi(()=>{let T=true;return eo().then(x=>{T&&x&&(n(x),r?.(x)),T&&c(true)}),()=>{T=false}},[r]);let u=Me(T=>{n(T),r?.(T),Xr(T)},[r]),d=e.length>0,p=d?e:Yi(),y=dt(()=>Hr(a),[a]),v=dt(()=>Wr(p,a),[p,a]),h=dt(()=>v>=Gi?"danger":v>=Qi?"warning":"none",[v]),b=Me(()=>Gt(p,a),[p,a]),m=Me(T=>{let x=Qe[T];u({...x,filterSources:[...x.filterSources]})},[u]),g=Me((T,x)=>{let[j,N]=T.split("::");if(j==="preset"){m(N);return}if(j==="include"){u({...a,[N]:!a[N]});return}if(j==="format"){u({...a,format:x});return}if(j==="timestamp"){u({...a,timestampFormat:x});return}if(j==="filter"){u({...a,filterMode:x});return}if(j==="threshold"){u({...a,dataSizeThreshold:x});return}},[a,u,m]),k=Me(()=>{let T=p.length;return ae(Ei,{expanded:s,onExpandedChange:l,summary:`${T} event${T!==1?"s":""} \xB7 ~${Zi(v)}${d?"":" (mock data)"}`,warningLevel:h,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},testIDs:{expand:`${S}-preview-expand`,collapse:`${S}-preview-collapse`,summary:`${S}-preview-summary`,warning:`${S}-preview-size-warning`},renderBody:()=>{let x=b();return a.format==="json"?ae(ki,{testIDPrefix:`${S}-preview-json`,data:JSON.parse(x),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true}):Yt(f,{children:[a.format==="mermaid"&&ae($,{style:De.mermaidHint,children:"\u{1F4A1} Paste into mermaid.live to visualize"}),ae(ue,{style:De.previewScroll,nestedScrollEnabled:true,testID:`${S}-preview-scroll`,children:ae($,{style:De.previewText,selectable:o,testID:`${S}-preview-text`,children:x})})]})}})},[s,p,a,v,h,d,b,o]),L=Me(()=>{let T=Ze(p),x=d?`${T.totalEvents} events`:"Mock data (no events captured)";return Yt(_i,{children:[ae($,{style:De.statusLabel,testID:`${S}-export-status`,children:x}),ae(Si,{value:b()})]})},[d,p,b]),w=dt(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:z.llm.label,icon:fi,color:z.llm.color,value:"llm",isActive:y==="llm",description:z.llm.description},{id:"preset::bugReport",label:z.bugReport.label,icon:yi,color:z.bugReport.color,value:"bugReport",isActive:y==="bugReport",description:z.bugReport.description},{id:"preset::json",label:z.json.label,icon:Vr,color:z.json.color,value:"json",isActive:y==="json",description:z.json.description},{id:"preset::errors",label:z.errors.label,icon:Ur,color:z.errors.color,value:"errors",isActive:y==="errors",description:z.errors.description},{id:"preset::minimal",label:z.minimal.label,icon:Or,color:z.minimal.color,value:"minimal",isActive:y==="minimal",description:z.minimal.description},{id:"preset::mermaid",label:z.mermaid.label,icon:Lr,color:z.mermaid.color,value:"mermaid",isActive:y==="mermaid",description:z.mermaid.description},{id:"preset::custom",label:"Custom",icon:bi,color:We.color.textSecondary,value:"custom",isActive:y===null,description:"User-configured"}]},{id:"include",title:"Include",type:"custom",data:[{id:"include::includeSource",label:"Source",value:"includeSource",isActive:a.includeSource},{id:"include::includeStatus",label:"Status",value:"includeStatus",isActive:a.includeStatus},{id:"include::includeTitle",label:"Title",value:"includeTitle",isActive:a.includeTitle},{id:"include::includeSubtitle",label:"Subtitle",value:"includeSubtitle",isActive:a.includeSubtitle},{id:"include::includeCorrelation",label:"Correlation",value:"includeCorrelation",isActive:a.includeCorrelation},{id:"include::includeDuration",label:"Duration",value:"includeDuration",isActive:a.includeDuration},{id:"include::includeSummaryHeader",label:"Summary",value:"includeSummaryHeader",isActive:a.includeSummaryHeader},{id:"include::includeEventData",label:"Data",value:"includeEventData",isActive:a.includeEventData}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:Or,color:Je.semantic.info,value:"markdown",isActive:a.format==="markdown"},{id:"format::json",label:"JSON",icon:Vr,color:Je.semantic.warning,value:"json",isActive:a.format==="json"},{id:"format::plaintext",label:"Text",icon:gi,color:We.color.textSecondary,value:"plaintext",isActive:a.format==="plaintext"},{id:"format::mermaid",label:"Diagram",icon:Lr,color:"#A855F7",value:"mermaid",isActive:a.format==="mermaid",description:"Mermaid sequence diagram"}]},{id:"timestamp",title:"Timestamps",type:"custom",data:[{id:"timestamp::relative",label:"Relative",value:"relative",isActive:a.timestampFormat==="relative",description:"+0ms, +150ms"},{id:"timestamp::absolute",label:"Absolute",value:"absolute",isActive:a.timestampFormat==="absolute",description:"ISO format"},{id:"timestamp::both",label:"Both",value:"both",isActive:a.timestampFormat==="both",description:"Both formats"}]},{id:"filter",title:"Filter Events",type:"custom",data:[{id:"filter::all",label:"All",value:"all",isActive:a.filterMode==="all"},{id:"filter::errors",label:"Errors",icon:Ur,color:Je.semantic.error,value:"errors",isActive:a.filterMode==="errors"},{id:"filter::success",label:"Success",color:Je.semantic.success,value:"success",isActive:a.filterMode==="success"},{id:"filter::pending",label:"Pending",color:Je.semantic.warning,value:"pending",isActive:a.filterMode==="pending"}]},{id:"llmOptimization",title:"LLM Optimization",type:"custom",data:[{id:"include::compactMode",label:"Compact",value:"compactMode",isActive:a.compactMode,description:"One line per event"},{id:"include::smartJsonParsing",label:"Smart JSON",value:"smartJsonParsing",isActive:a.smartJsonParsing,description:"Parse nested JSON"},{id:"include::reduxChangedOnly",label:"Redux Diff",value:"reduxChangedOnly",isActive:a.reduxChangedOnly,description:"Only show changes"},{id:"include::showStorageDiff",label:"Storage Diff",value:"showStorageDiff",isActive:a.showStorageDiff,description:"Show what changed"},{id:"include::stripVerboseFields",label:"Strip Noise",value:"stripVerboseFields",isActive:a.stripVerboseFields,description:"Remove images/descriptions"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:vi,content:k,headerActions:L},onFilterChange:g}),[a,y,g,k,L]);return o?ae(Nr,{...w}):Yt(ue,{style:De.gatedContainer,contentContainerStyle:De.gatedContent,testID:`${S}-copy-settings-gated`,children:[ae(Ci,{featureName:"Events Export",description:"Export event flows to share with your team, debug issues, or feed into AI tools.",benefits:["Export to Markdown, JSON, or plain text","Customizable presets (LLM-ready, Bug Report, JSON)","Share event flows with teammates","Feed event context directly to AI assistants"]}),ae(f,{style:De.gatedPreview,children:ae(Nr,{...w})})]})}var De=le.create({previewScroll:{maxHeight:300},previewText:{fontFamily:xi,fontSize:11,color:We.color.text,lineHeight:18},mermaidHint:{fontSize:11,color:We.color.textSecondary,marginBottom:8,paddingHorizontal:8,paddingVertical:6,backgroundColor:"#A855F715",borderRadius:6,overflow:"hidden"},statusLabel:{fontSize:11,fontWeight:"600",color:We.color.textTertiary,marginRight:8},gatedContainer:{flex:1},gatedContent:{padding:12,gap:12},gatedPreview:{}});import{TickProvider as ro}from"@buoy-gg/shared-ui/web";import{Fragment as gt,jsx as I,jsxs as ie}from"react/jsx-runtime";function Xt({visible:e,onClose:t,onBack:r,onMinimize:o,enableSharedModalDimensions:a=false,inline:n=false,capturing:s,onCapturingChange:l,networkDetailWrapper:i,NetworkEventDetailViewComponent:c,RouteEventDetailComponent:u,detailComponents:d}){let p=Pa(),y=s!=null&&l!=null,{filteredEvents:v,availableSources:h,toggleSource:b,clearEvents:m,totalCount:g,filteredCount:k,isCapturing:L,toggleCapturing:w,hiddenEventsCount:T,searchText:x,setSearchText:j}=qt(y?{capturingOverride:s}:void 0),N=y?s:L,me=y?()=>l(!s):w,[_,he]=it("list"),[Q,rt]=it(null),[bt,ot]=it(false),[Ae,Ue]=it(false),vt=$a(null);ka(()=>{if(!Ae)return;let Z=requestAnimationFrame(()=>{vt.current?.focus()});return()=>cancelAnimationFrame(Z)},[Ae]);let St=Be(()=>{Ue(false),j("")},[j]),at=Be(Z=>{try{p.push(Z)}catch(wt){cr.alert("Navigation Error",String(wt))}},[p]),C=Be(Z=>{rt(Z),he("detail")},[]),F=Be(()=>{_==="detail"?(rt(null),he("list")):_==="copySettings"&&he("list")},[_]),P=Be(()=>{he("copySettings")},[]),G=Be(Z=>{},[]),q=a?Ba.modal.root():"buoy-events-modal";if(!e)return null;let R=()=>{if(_==="detail"&&Q){let Z={source:Q.source,title:Q.title,subtitle:Q.subtitle,status:Q.status,timestamp:new Date(Q.timestamp).toISOString(),data:Q.originalEvent};return ie(X,{children:[I(X.Navigation,{onBack:F}),I(X.Content,{title:Q.title,testID:`${S}-detail-heading`}),I(X.Actions,{children:I(Fa,{value:Z})})]})}return _==="copySettings"?ie(X,{children:[I(X.Navigation,{onBack:F}),I(X.Content,{title:"Copy Settings",testID:`${S}-copy-settings-heading`})]}):ie(X,{children:[r&&I(X.Navigation,{onBack:r}),I(X.Content,{title:"",children:Ae?I(X.Search,{value:x,onChangeText:j,onCancel:St,placeholder:"Search events...",accessibilityLabel:"Search events",iconSize:14,testID:`${S}-search-field`,containerTestID:`${S}-search`,clearTestID:`${S}-search-clear`,onBlur:()=>{x.length===0&&Ue(false)}}):ie(f,{style:te.headerTitleContainer,children:[I($,{style:te.headerTitle,testID:`${S}-title`,children:"Events"}),ie($,{style:te.headerSubtitle,testID:`${S}-count`,children:[g," captured"]})]})}),ie(X.Actions,{children:[!Ae&&I(ge,{onPress:()=>Ue(true),style:[te.headerActionButton,x.length>0&&te.headerActionButtonActive],testID:`${S}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search events",children:I(qa,{size:14,color:x.length>0?ee.color.accent:ee.color.textSecondary})}),I(ge,{onPress:P,style:[te.headerActionButton,g===0&&te.headerActionButtonDisabled],disabled:g===0,testID:`${S}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy events",children:I(Ia,{size:14,color:g>0?ee.color.textSecondary:ee.color.textTertiary})}),I(ja,{isEnabled:N,onToggle:me,testID:`${S}-power`,accessibilityLabel:"Toggle event capture"}),I(ge,{onPress:m,style:[te.headerActionButton,g===0&&te.headerActionButtonDisabled],disabled:g===0,testID:`${S}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear events",children:I(Ta,{size:14,color:g>0?ee.color.textSecondary:ee.color.textTertiary})})]})]})},ne=I(f,{style:te.container,children:_==="copySettings"?I(to,{events:v}):_==="detail"&&Q?I(Vt,{event:Q,onBack:F,onNavigate:at,networkDetailWrapper:i,NetworkEventDetailViewComponent:c,RouteEventDetailComponent:u,detailComponents:d}):ie(gt,{children:[I(Ft,{availableSources:h,onToggleSource:b,totalCount:g,filteredCount:k}),I(zt,{events:v,selectedEventId:void 0,expandedEventId:void 0,onEventPress:C,onNavigate:at,isCapturing:N,hiddenEventsCount:T,searchText:x,totalCount:g,sourceCount:h.length,enabledSourceCount:h.filter(Z=>Z.enabled!==false).length,onUpgradePress:()=>ot(true)})]})}),Te=ro?I(ro,{children:ne}):ne,nt=I(gt,{children:I(Ra,{visible:bt,onClose:()=>ot(false),featureName:"Unlimited Events",description:"View your complete event history to debug complex flows and track down issues.",benefits:["Unlimited event history (vs 25 events)","Export events to Markdown, JSON, or plain text","Share event flows with teammates","Feed event context directly to AI assistants"]})});return n?ie(gt,{children:[ie(f,{style:te.inlineRoot,children:[I(f,{style:te.inlineHeader,...Ma,children:R()}),Te]}),nt]}):ie(gt,{children:[I(Da,{visible:e,onClose:t,onMinimize:o,persistenceKey:q,header:{showToggleButton:true,customContent:R()},onModeChange:G,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},disableScrollWrapper:true,children:Te}),nt]})}var te=le.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Aa.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerTitleContainer:{flexDirection:"row",alignItems:"baseline",gap:8},headerTitle:{fontSize:16,fontWeight:"600",color:ee.color.text},headerSubtitle:{fontSize:12,color:ee.color.textTertiary},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:ee.color.buttonSurface,borderWidth:1,borderColor:ee.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:ee.color.accentSoft,borderColor:ee.color.accentBorderStrong}});function Xi(e={}){return I(Xt,{...e,inline:true,visible:true,onClose:()=>{}})}import{createToolFactory as es,defineToolPreset as ts}from"@buoy-gg/shared-ui/web";import{jsx as rs}from"react/jsx-runtime";var oo=ts({id:"events",name:"EVENTS",description:"Unified event timeline",slot:"both",icon:({size:e,color:t})=>rs(go,{size:e,color:t||fo}),component:Xt,props:{enableSharedModalDimensions:false}}),os=es(oo);import{useState as as,useCallback as ao}from"react";import{night as pe,Trash2 as ns}from"@buoy-gg/shared-ui/web";import{jsx as Ne,jsxs as et}from"react/jsx-runtime";function is(){let{filteredEvents:e,availableSources:t,toggleSource:r,clearEvents:o,totalCount:a,filteredCount:n,isCapturing:s}=qt(),[l,i]=as(null),c=ao(d=>{i(d)},[]),u=ao(()=>{i(null)},[]);return l?Ne(Vt,{event:l,onBack:u}):et(f,{style:Oe.container,children:[et(f,{style:Oe.header,children:[et(f,{children:[Ne($,{style:Oe.title,children:"Events"}),et($,{style:Oe.subtitle,children:[a," event",a!==1?"s":""," captured"]})]}),et(ge,{style:Oe.clearButton,onPress:o,activeOpacity:.7,disabled:a===0,children:[Ne(ns,{size:16,color:a===0?pe.color.textTertiary:pe.color.danger}),Ne($,{style:[Oe.clearText,{color:a===0?pe.color.textTertiary:pe.color.danger}],children:"Clear"})]})]}),Ne(Ft,{availableSources:t,onToggleSource:r,totalCount:a,filteredCount:n}),Ne(zt,{events:e,selectedEventId:void 0,onEventPress:c,isCapturing:s,totalCount:a,sourceCount:t.length,enabledSourceCount:t.filter(d=>d.enabled!==false).length})]})}var Oe=le.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:16,paddingVertical:12,backgroundColor:pe.color.surface,borderBottomWidth:1,borderBottomColor:pe.color.border},title:{fontSize:20,fontWeight:"700",color:pe.color.text},subtitle:{fontSize:12,color:pe.color.textTertiary,marginTop:2},clearButton:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:8,borderRadius:6,backgroundColor:pe.color.dangerSoft},clearText:{fontSize:14,fontWeight:"600"}});import{approxJsonSize as ss,isJsonSerializable as ls,isOverWireBudget as us}from"@buoy-gg/shared-ui/web";var Ve=16*1024;function no(e,t){return{__buoyTruncated:true,approxBytes:e,note:t??`Payload (\u2265${(e/1024).toFixed(0)}KB approx) exceeds the ${Ve/1024}KB sync limit and stayed on the device. Open the tool on-device (or use the source tool's detail action) for the full payload.`}}var tt={__buoyOmitted:"state-tree",note:"prevState/nextState stay on the device (use get_redux_state / the on-device tool)."},cs={__buoyOmitted:"query-payload",note:"Query/mutation data stays on the device (open the Query tool or the on-device Events detail)."},ft={__buoyOmitted:"network-body",note:"Request/response body stays on the device (open the Network tool or the on-device Events detail)."},io={__buoyOmitted:"network-headers",note:"Request/response headers stay on the device (open the Network tool or the on-device Events detail)."},ds={__buoyOmitted:"graphql-variables",note:"GraphQL variables stay on the device (open the Network tool or the on-device Events detail)."},er={__buoyOmitted:"storage-value",note:"Storage value stays on the device (open the Storage tool or the on-device Events detail)."},ps={__buoyOmitted:"route-params",note:"Navigation params stay on the device (open the Routes tool or the on-device Events detail)."};function ms(e){return e==="react-query"||e==="react-query-query"||e==="react-query-mutation"}function se(e,t){if(e!==void 0)return us(e,Ve)?{...t}:e}function yt(e){return se(e,cs)}function so(e){return e==null?e:e instanceof Error?{name:e.name,message:e.message}:yt(e)}var lo=new WeakMap;function hs(e){let t=e.originalEvent;if(typeof t!="object"||t===null)return e;let r=lo.get(e);if(r!==void 0)return r;let o=e,a=t;if((e.source==="redux"||e.source==="zustand")&&("prevState"in a||"nextState"in a))a={...a,prevState:{...tt},nextState:{...tt},...e.source==="zustand"&&"partial"in a?{partial:{...tt}}:{}},o={...e,originalEvent:a};else if(e.source==="jotai"&&("prevValue"in a||"nextValue"in a))a={...a,prevValue:{...tt},nextValue:{...tt}},o={...e,originalEvent:a};else if(e.source==="render"){let i=a.render,c=a.event,u=d=>{if(!d||typeof d!="object")return d;let{hookChanges:p,...y}=d;return y};a={...a,render:i&&{...i,renderHistory:void 0,lastRenderCause:u(i.lastRenderCause)},event:c&&{...c,capturedProps:void 0,capturedState:void 0,cause:u(c.cause)}},o={...e,originalEvent:a}}else if(ms(e.source)){let{query:i,mutation:c,...u}=a;a={...u,queryData:yt(u.queryData),mutationData:yt(u.mutationData),mutationVariables:yt(u.mutationVariables),queryError:so(u.queryError),mutationError:so(u.mutationError)},o={...e,originalEvent:a}}else if(e.source==="network"){let i=typeof a.requestSize=="number"?a.requestSize:void 0,c=typeof a.responseSize=="number"?a.responseSize:void 0;a={...a,requestData:i!==void 0&&i>Ve?{...ft}:se(a.requestData,ft),responseData:c!==void 0&&c>Ve?{...ft}:se(a.responseData,ft),graphqlVariables:se(a.graphqlVariables,ds),requestHeaders:se(a.requestHeaders,io),responseHeaders:se(a.responseHeaders,io)},o={...e,originalEvent:a}}else if(e.source==="storage-async"||e.source==="storage-mmkv"){let i=a.data;i&&(a={...a,data:{...i,value:se(i.value,er),prevValue:se(i.prevValue,er),pairs:se(i.pairs,er)}},o={...e,originalEvent:a})}else e.source==="route"&&(a={...a,params:se(a.params,ps)},o={...e,originalEvent:a});let{bytes:n,sawRepeat:s,sawBigInt:l}=ss(a,Ve);return n>Ve?o={...e,originalEvent:no(n)}:(s||l)&&!ls(a)&&(o={...e,originalEvent:no(-1,"Payload is not JSON-serializable (cyclic or bigint) and stayed on the device.")}),lo.set(e,o),o}var gs={version:2,getSnapshot:()=>({events:V.getEvents().map(hs),availableSources:Array.from(V.getAvailableEventSources())}),subscribe:e=>{V.ensureRemoteSourcesDefault();let t=V.subscribe(()=>e());return()=>{t(),V.clearRemoteSources()}},actions:{clearEvents:()=>{V.clearEvents()},setEnabledSources:e=>{let t=e?.sources??[];return V.setRemoteEnabledSources(t),{enabledSources:t}},exportEvents:e=>{let t=e??{},r={...t.preset&&Qe[t.preset]?Qe[t.preset]:_e,...t.settings??{}},o=V.getEvents(),a=typeof t.limit=="number"&&t.limit>0?t.limit:o.length,n=o.slice(0,a);return{output:Gt(n,r),returned:n.length,totalAvailable:o.length,includedData:r.includeEventData,format:r.format}}}};export{Qe as COPY_PRESETS,_e as DEFAULT_COPY_SETTINGS,S as EVENTS_TEST_ID,to as EventsCopySettingsView,Xt as EventsModal,Xi as EventsToolView,z as PRESET_METADATA,Mr as ReactQueryEventDetail,Vt as UnifiedEventDetail,Ft as UnifiedEventFilters,Ir as UnifiedEventItem,zt as UnifiedEventList,is as UnifiedEventViewer,qr as buildCorrelationCountMap,Wi as clearCopySettings,os as createEventsTool,Hr as detectActivePreset,Wr as estimateExportSize,$r as eventFilterTestID,xr as eventIdentity,kr as eventRowTestID,gs as eventsSyncAdapter,oo as eventsToolPreset,Ye as filterEvents,Jn as findRelatedEvents,Gt as generateExport,_r as generateJsonExport,Wt as generateMarkdownExport,Yr as generateMermaidExport,Qr as generatePlaintextExport,jr as getCorrelationColor,Br as getCorrelationGroup,Fr as getCorrelationLabel,Ze as getExportSummary,_n as getRelatedEventsCount,Wn as hasRelatedEvents,st as isBuoyInternalEvent,Ha as isEventHiddenFromTool,$t as isNetworkEventIgnored,eo as loadCopySettings,Xr as saveCopySettings,V as unifiedEventStore,qt as useUnifiedEvents,Sn as watchEvents};
|
|
11
|
+
Note over U,App: No events captured`;let o=[...r].sort((m,b)=>m.timestamp-b.timestamp),a=o[0].timestamp,n=Mi(o),s=zi(n),l=["sequenceDiagram"];if(l.push(" autonumber"),l.push(""),s){let m=n.filter(h=>h.group==="client"),b=n.filter(h=>h.group==="server");if(m.length>0){l.push(" box rgb(240, 248, 255) Client");for(let h of m)l.push(` participant ${h.id} as ${h.icon} ${h.label}`);l.push(" end")}if(b.length>0){l.push(" box rgb(255, 248, 240) External");for(let h of b)l.push(` participant ${h.id} as ${h.icon} ${h.label}`);l.push(" end")}}else for(let m of n)l.push(` participant ${m.id} as ${m.icon} ${m.label}`);l.push("");let i=o[o.length-1].timestamp-a,c=o.filter(m=>m.source==="network"),u=c.reduce((m,b)=>{let h=b.originalEvent,g=h?.responseSize||h?.size||0;return m+g},0),d=o.filter(m=>m.status==="error").length,p=[];p.push(`\u23F1\uFE0F ${$e(i)}`),p.push(`\u{1F4CA} ${o.length} events`),c.length>0&&p.push(`\u{1F310} ${c.length} API calls`),u>0&&p.push(`\u{1F4E6} ${Qt(u)}`),d>0&&p.push(`\u274C ${d} errors`),l.push(` Note over U,API: ${p.join(" \xB7 ")}`),l.push("");let y=new Map,v=0;for(let m of o){let b=Hi(m,t,a);if(b.skip){v++;continue}let{messages:h,notes:g}=b,k=false,L="";if(m.source==="network"){let w=m.originalEvent?.url;if(w){let A=Vi(w),x=y.get(A);if(x&&m.timestamp-x.timestamp<3e4){k=true;let j=m.timestamp-x.timestamp;L=`\u26A0\uFE0F Already fetched ${$e(j)} ago`,y.set(A,{timestamp:m.timestamp,count:x.count+1})}else y.set(A,{timestamp:m.timestamp,count:1})}}if(k){l.push(" rect rgb(255, 245, 230)"),l.push(` Note over App,API: ${L}`);for(let w of h)l.push(` ${w}`);for(let w of g)l.push(` ${w}`);l.push(" end")}else if(m.status==="error"){l.push(" rect rgb(255, 235, 235)");for(let w of h)l.push(` ${w}`);for(let w of g)l.push(` ${w}`);l.push(" end")}else{for(let w of h)l.push(` ${w}`);for(let w of g)l.push(` ${w}`)}}return v>0&&(l.push(""),l.push(` Note over App: ${v} internal events hidden`)),l.join(`
|
|
12
|
+
`)}function Gt(e,t){switch(t.format){case"markdown":return Wt(e,t);case"json":return _r(e,t);case"plaintext":return Qr(e,t);case"mermaid":return Yr(e,t);default:return Wt(e,t)}}import{definePersistedSetting as Ki,devToolsStorageKeys as Ji}from"@buoy-gg/shared-ui/web";var Zt=Ki(Ji.events.copySettings(),Qe,{sanitize:(e,t)=>({...e,filterSources:t?.filterSources??Qe.filterSources})});async function Xr(e){await Zt.save(e)}async function eo(){return Zt.loadOrNull()}async function Wi(){await Zt.clear()}import{Fragment as _i,jsx as ae,jsxs as Yt}from"react/jsx-runtime";var Qi=50*1024,Gi=200*1024;function Zi(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Yi(){let e=Date.now();return[{id:"mock-1",source:"storage-async",timestamp:e-2e3,title:"Set Item",subtitle:"user_cart",status:"success",originalEvent:{action:"setItem",key:"user_cart",value:{items:2}}},{id:"mock-2",source:"react-query-query",timestamp:e-1500,title:"cart \u203A items",subtitle:"Fetching...",status:"pending",originalEvent:{type:"query-fetch-start",queryKey:["cart","items"]},correlationId:"rq-query-cart",sequenceInGroup:1},{id:"mock-3",source:"react-query-query",timestamp:e-1e3,title:"cart \u203A items",subtitle:"Success \xB7 500ms",status:"success",originalEvent:{type:"query-fetch-success",queryKey:["cart","items"],data:{items:[]}},correlationId:"rq-query-cart",sequenceInGroup:2},{id:"mock-4",source:"network",timestamp:e-500,title:"POST /api/checkout",subtitle:"402 \xB7 450ms",status:"error",originalEvent:{method:"POST",url:"/api/checkout",status:402,error:"Payment required"}}]}function to({events:e=[],initialSettings:t=Qe,onSettingsChange:r}){let{isPro:o}=wi(),[a,n]=Ut(t),[s,l]=Ut(false),[i,c]=Ut(false);mi(()=>{let A=true;return eo().then(x=>{A&&x&&(n(x),r?.(x)),A&&c(true)}),()=>{A=false}},[r]);let u=Me(A=>{n(A),r?.(A),Xr(A)},[r]),d=e.length>0,p=d?e:Yi(),y=dt(()=>Hr(a),[a]),v=dt(()=>Wr(p,a),[p,a]),m=dt(()=>v>=Gi?"danger":v>=Qi?"warning":"none",[v]),b=Me(()=>Gt(p,a),[p,a]),h=Me(A=>{let x=Ge[A];u({...x,filterSources:[...x.filterSources]})},[u]),g=Me((A,x)=>{let[j,N]=A.split("::");if(j==="preset"){h(N);return}if(j==="include"){u({...a,[N]:!a[N]});return}if(j==="format"){u({...a,format:x});return}if(j==="timestamp"){u({...a,timestampFormat:x});return}if(j==="filter"){u({...a,filterMode:x});return}if(j==="threshold"){u({...a,dataSizeThreshold:x});return}},[a,u,h]),k=Me(()=>{let A=p.length;return ae(Ei,{expanded:s,onExpandedChange:l,summary:`${A} event${A!==1?"s":""} \xB7 ~${Zi(v)}${d?"":" (mock data)"}`,warningLevel:m,warningText:{warning:"Large payload - preview may be slow",danger:"Very large payload - may cause performance issues"},testIDs:{expand:`${S}-preview-expand`,collapse:`${S}-preview-collapse`,summary:`${S}-preview-summary`,warning:`${S}-preview-size-warning`},renderBody:()=>{let x=b();return a.format==="json"?ae(ki,{testIDPrefix:`${S}-preview-json`,data:JSON.parse(x),title:"",showTypeFilter:true,rawMode:true,initialExpanded:true}):Yt(f,{children:[a.format==="mermaid"&&ae($,{style:De.mermaidHint,children:"\u{1F4A1} Paste into mermaid.live to visualize"}),ae(ue,{keyboardShouldPersistTaps:"handled",style:De.previewScroll,nestedScrollEnabled:true,testID:`${S}-preview-scroll`,children:ae($,{style:De.previewText,selectable:o,testID:`${S}-preview-text`,children:x})})]})}})},[s,p,a,v,m,d,b,o]),L=Me(()=>{let A=Ye(p),x=d?`${A.totalEvents} events`:"Mock data (no events captured)";return Yt(_i,{children:[ae($,{style:De.statusLabel,testID:`${S}-export-status`,children:x}),ae(Si,{value:b()})]})},[d,p,b]),w=dt(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:z.llm.label,icon:fi,color:z.llm.color,value:"llm",isActive:y==="llm",description:z.llm.description},{id:"preset::bugReport",label:z.bugReport.label,icon:yi,color:z.bugReport.color,value:"bugReport",isActive:y==="bugReport",description:z.bugReport.description},{id:"preset::json",label:z.json.label,icon:Vr,color:z.json.color,value:"json",isActive:y==="json",description:z.json.description},{id:"preset::errors",label:z.errors.label,icon:Ur,color:z.errors.color,value:"errors",isActive:y==="errors",description:z.errors.description},{id:"preset::minimal",label:z.minimal.label,icon:Or,color:z.minimal.color,value:"minimal",isActive:y==="minimal",description:z.minimal.description},{id:"preset::mermaid",label:z.mermaid.label,icon:Lr,color:z.mermaid.color,value:"mermaid",isActive:y==="mermaid",description:z.mermaid.description},{id:"preset::custom",label:"Custom",icon:bi,color:_e.color.textSecondary,value:"custom",isActive:y===null,description:"User-configured"}]},{id:"include",title:"Include",type:"custom",data:[{id:"include::includeSource",label:"Source",value:"includeSource",isActive:a.includeSource},{id:"include::includeStatus",label:"Status",value:"includeStatus",isActive:a.includeStatus},{id:"include::includeTitle",label:"Title",value:"includeTitle",isActive:a.includeTitle},{id:"include::includeSubtitle",label:"Subtitle",value:"includeSubtitle",isActive:a.includeSubtitle},{id:"include::includeCorrelation",label:"Correlation",value:"includeCorrelation",isActive:a.includeCorrelation},{id:"include::includeDuration",label:"Duration",value:"includeDuration",isActive:a.includeDuration},{id:"include::includeSummaryHeader",label:"Summary",value:"includeSummaryHeader",isActive:a.includeSummaryHeader},{id:"include::includeEventData",label:"Data",value:"includeEventData",isActive:a.includeEventData}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::markdown",label:"Markdown",icon:Or,color:We.semantic.info,value:"markdown",isActive:a.format==="markdown"},{id:"format::json",label:"JSON",icon:Vr,color:We.semantic.warning,value:"json",isActive:a.format==="json"},{id:"format::plaintext",label:"Text",icon:gi,color:_e.color.textSecondary,value:"plaintext",isActive:a.format==="plaintext"},{id:"format::mermaid",label:"Diagram",icon:Lr,color:"#A855F7",value:"mermaid",isActive:a.format==="mermaid",description:"Mermaid sequence diagram"}]},{id:"timestamp",title:"Timestamps",type:"custom",data:[{id:"timestamp::relative",label:"Relative",value:"relative",isActive:a.timestampFormat==="relative",description:"+0ms, +150ms"},{id:"timestamp::absolute",label:"Absolute",value:"absolute",isActive:a.timestampFormat==="absolute",description:"ISO format"},{id:"timestamp::both",label:"Both",value:"both",isActive:a.timestampFormat==="both",description:"Both formats"}]},{id:"filter",title:"Filter Events",type:"custom",data:[{id:"filter::all",label:"All",value:"all",isActive:a.filterMode==="all"},{id:"filter::errors",label:"Errors",icon:Ur,color:We.semantic.error,value:"errors",isActive:a.filterMode==="errors"},{id:"filter::success",label:"Success",color:We.semantic.success,value:"success",isActive:a.filterMode==="success"},{id:"filter::pending",label:"Pending",color:We.semantic.warning,value:"pending",isActive:a.filterMode==="pending"}]},{id:"llmOptimization",title:"LLM Optimization",type:"custom",data:[{id:"include::compactMode",label:"Compact",value:"compactMode",isActive:a.compactMode,description:"One line per event"},{id:"include::smartJsonParsing",label:"Smart JSON",value:"smartJsonParsing",isActive:a.smartJsonParsing,description:"Parse nested JSON"},{id:"include::reduxChangedOnly",label:"Redux Diff",value:"reduxChangedOnly",isActive:a.reduxChangedOnly,description:"Only show changes"},{id:"include::showStorageDiff",label:"Storage Diff",value:"showStorageDiff",isActive:a.showStorageDiff,description:"Show what changed"},{id:"include::stripVerboseFields",label:"Strip Noise",value:"stripVerboseFields",isActive:a.stripVerboseFields,description:"Remove images/descriptions"}]}],previewSection:{enabled:true,title:"PREVIEW",icon:vi,content:k,headerActions:L},onFilterChange:g}),[a,y,g,k,L]);return o?ae(Nr,{...w}):Yt(ue,{keyboardShouldPersistTaps:"handled",style:De.gatedContainer,contentContainerStyle:De.gatedContent,testID:`${S}-copy-settings-gated`,children:[ae(Ci,{featureName:"Events Export",description:"Export event flows to share with your team, debug issues, or feed into AI tools.",benefits:["Export to Markdown, JSON, or plain text","Customizable presets (LLM-ready, Bug Report, JSON)","Share event flows with teammates","Feed event context directly to AI assistants"]}),ae(f,{style:De.gatedPreview,children:ae(Nr,{...w})})]})}var De=le.create({previewScroll:{maxHeight:300},previewText:{fontFamily:xi,fontSize:11,color:_e.color.text,lineHeight:18},mermaidHint:{fontSize:11,color:_e.color.textSecondary,marginBottom:8,paddingHorizontal:8,paddingVertical:6,backgroundColor:"#A855F715",borderRadius:6,overflow:"hidden"},statusLabel:{fontSize:11,fontWeight:"600",color:_e.color.textTertiary,marginRight:8},gatedContainer:{flex:1},gatedContent:{padding:12,gap:12},gatedPreview:{}});import{TickProvider as ro}from"@buoy-gg/shared-ui/web";import{Fragment as gt,jsx as I,jsxs as ie}from"react/jsx-runtime";function Xt({visible:e,onClose:t,onBack:r,onMinimize:o,enableSharedModalDimensions:a=false,inline:n=false,capturing:s,onCapturingChange:l,networkDetailWrapper:i,NetworkEventDetailViewComponent:c,RouteEventDetailComponent:u,detailComponents:d}){let p=Pa(),y=s!=null&&l!=null,{filteredEvents:v,availableSources:m,toggleSource:b,clearEvents:h,totalCount:g,filteredCount:k,isCapturing:L,toggleCapturing:w,hiddenEventsCount:A,searchText:x,setSearchText:j}=qt(y?{capturingOverride:s}:void 0),N=y?s:L,he=y?()=>l(!s):w,[_,me]=it("list"),[Q,rt]=it(null),[bt,ot]=it(false),[Te,Le]=it(false),vt=$a(null);ka(()=>{if(!Te)return;let Z=requestAnimationFrame(()=>{vt.current?.focus()});return()=>cancelAnimationFrame(Z)},[Te]);let St=Be(()=>{Le(false),j("")},[j]),at=Be(Z=>{try{p.push(Z)}catch(wt){cr.alert("Navigation Error",String(wt))}},[p]),C=Be(Z=>{rt(Z),me("detail")},[]),F=Be(()=>{_==="detail"?(rt(null),me("list")):_==="copySettings"&&me("list")},[_]),P=Be(()=>{me("copySettings")},[]),G=Be(Z=>{},[]),q=a?Ba.modal.root():"buoy-events-modal";if(!e)return null;let R=()=>{if(_==="detail"&&Q){let Z={source:Q.source,title:Q.title,subtitle:Q.subtitle,status:Q.status,timestamp:new Date(Q.timestamp).toISOString(),data:Q.originalEvent};return ie(X,{children:[I(X.Navigation,{onBack:F}),I(X.Content,{title:Q.title,testID:`${S}-detail-heading`}),I(X.Actions,{children:I(Fa,{value:Z})})]})}return _==="copySettings"?ie(X,{children:[I(X.Navigation,{onBack:F}),I(X.Content,{title:"Copy Settings",testID:`${S}-copy-settings-heading`})]}):ie(X,{children:[r&&I(X.Navigation,{onBack:r}),I(X.Content,{title:"",children:Te?I(X.Search,{value:x,onChangeText:j,onCancel:St,placeholder:"Search events...",accessibilityLabel:"Search events",iconSize:14,testID:`${S}-search-field`,containerTestID:`${S}-search`,clearTestID:`${S}-search-clear`,onBlur:()=>{x.length===0&&Le(false)}}):ie(f,{style:te.headerTitleContainer,children:[I($,{style:te.headerTitle,testID:`${S}-title`,children:"Events"}),ie($,{style:te.headerSubtitle,testID:`${S}-count`,children:[g," captured"]})]})}),ie(X.Actions,{children:[!Te&&I(ge,{onPress:()=>Le(true),style:[te.headerActionButton,x.length>0&&te.headerActionButtonActive],testID:`${S}-search-open`,accessibilityRole:"button",accessibilityLabel:"Search events",children:I(qa,{size:14,color:x.length>0?ee.color.accent:ee.color.textSecondary})}),I(ge,{onPress:P,style:[te.headerActionButton,g===0&&te.headerActionButtonDisabled],disabled:g===0,testID:`${S}-copy`,accessibilityRole:"button",accessibilityLabel:"Copy events",children:I(Ia,{size:14,color:g>0?ee.color.textSecondary:ee.color.textTertiary})}),I(ja,{isEnabled:N,onToggle:he,testID:`${S}-power`,accessibilityLabel:"Toggle event capture"}),I(ge,{onPress:h,style:[te.headerActionButton,g===0&&te.headerActionButtonDisabled],disabled:g===0,testID:`${S}-clear`,accessibilityRole:"button",accessibilityLabel:"Clear events",children:I(Aa,{size:14,color:g>0?ee.color.textSecondary:ee.color.textTertiary})})]})]})},ne=I(f,{style:te.container,children:_==="copySettings"?I(to,{events:v}):_==="detail"&&Q?I(Vt,{event:Q,onBack:F,onNavigate:at,networkDetailWrapper:i,NetworkEventDetailViewComponent:c,RouteEventDetailComponent:u,detailComponents:d}):ie(gt,{children:[I(Ft,{availableSources:m,onToggleSource:b,totalCount:g,filteredCount:k}),I(zt,{events:v,selectedEventId:void 0,expandedEventId:void 0,onEventPress:C,onNavigate:at,isCapturing:N,hiddenEventsCount:A,searchText:x,totalCount:g,sourceCount:m.length,enabledSourceCount:m.filter(Z=>Z.enabled!==false).length,onUpgradePress:()=>ot(true)})]})}),Ae=ro?I(ro,{children:ne}):ne,nt=I(gt,{children:I(Ra,{visible:bt,onClose:()=>ot(false),featureName:"Unlimited Events",description:"View your complete event history to debug complex flows and track down issues.",benefits:["Unlimited event history (vs 25 events)","Export events to Markdown, JSON, or plain text","Share event flows with teammates","Feed event context directly to AI assistants"]})});return n?ie(gt,{children:[ie(f,{style:te.inlineRoot,children:[I(f,{style:te.inlineHeader,...Ma,children:R()}),Ae]}),nt]}):ie(gt,{children:[I(Da,{visible:e,onClose:t,onMinimize:o,persistenceKey:q,header:{showToggleButton:true,customContent:R()},onModeChange:G,enablePersistence:true,initialMode:"bottomSheet",enableGlitchEffects:true,styles:{},disableScrollWrapper:true,children:Ae}),nt]})}var te=le.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:Ta.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},headerTitleContainer:{flexDirection:"row",alignItems:"baseline",gap:8},headerTitle:{fontSize:16,fontWeight:"600",color:ee.color.text},headerSubtitle:{fontSize:12,color:ee.color.textTertiary},headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:ee.color.buttonSurface,borderWidth:1,borderColor:ee.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},headerActionButtonActive:{backgroundColor:ee.color.accentSoft,borderColor:ee.color.accentBorderStrong}});function Xi(e={}){return I(Xt,{...e,inline:true,visible:true,onClose:()=>{}})}import{createToolFactory as es,defineToolPreset as ts}from"@buoy-gg/shared-ui/web";import{jsx as rs}from"react/jsx-runtime";var oo=ts({id:"events",name:"EVENTS",description:"Unified event timeline",slot:"both",icon:({size:e,color:t})=>rs(go,{size:e,color:t||fo}),component:Xt,props:{enableSharedModalDimensions:false}}),os=es(oo);import{useState as as,useCallback as ao}from"react";import{night as pe,Trash2 as ns}from"@buoy-gg/shared-ui/web";import{jsx as Oe,jsxs as et}from"react/jsx-runtime";function is(){let{filteredEvents:e,availableSources:t,toggleSource:r,clearEvents:o,totalCount:a,filteredCount:n,isCapturing:s}=qt(),[l,i]=as(null),c=ao(d=>{i(d)},[]),u=ao(()=>{i(null)},[]);return l?Oe(Vt,{event:l,onBack:u}):et(f,{style:Ve.container,children:[et(f,{style:Ve.header,children:[et(f,{children:[Oe($,{style:Ve.title,children:"Events"}),et($,{style:Ve.subtitle,children:[a," event",a!==1?"s":""," captured"]})]}),et(ge,{style:Ve.clearButton,onPress:o,activeOpacity:.7,disabled:a===0,children:[Oe(ns,{size:16,color:a===0?pe.color.textTertiary:pe.color.danger}),Oe($,{style:[Ve.clearText,{color:a===0?pe.color.textTertiary:pe.color.danger}],children:"Clear"})]})]}),Oe(Ft,{availableSources:t,onToggleSource:r,totalCount:a,filteredCount:n}),Oe(zt,{events:e,selectedEventId:void 0,onEventPress:c,isCapturing:s,totalCount:a,sourceCount:t.length,enabledSourceCount:t.filter(d=>d.enabled!==false).length})]})}var Ve=le.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:16,paddingVertical:12,backgroundColor:pe.color.surface,borderBottomWidth:1,borderBottomColor:pe.color.border},title:{fontSize:20,fontWeight:"700",color:pe.color.text},subtitle:{fontSize:12,color:pe.color.textTertiary,marginTop:2},clearButton:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:8,borderRadius:6,backgroundColor:pe.color.dangerSoft},clearText:{fontSize:14,fontWeight:"600"}});import{approxJsonSize as ss,isJsonSerializable as ls,isOverWireBudget as us}from"@buoy-gg/shared-ui/web";var Ue=16*1024;function no(e,t){return{__buoyTruncated:true,approxBytes:e,note:t??`Payload (\u2265${(e/1024).toFixed(0)}KB approx) exceeds the ${Ue/1024}KB sync limit and stayed on the device. Open the tool on-device (or use the source tool's detail action) for the full payload.`}}var tt={__buoyOmitted:"state-tree",note:"prevState/nextState stay on the device (use get_redux_state / the on-device tool)."},cs={__buoyOmitted:"query-payload",note:"Query/mutation data stays on the device (open the Query tool or the on-device Events detail)."},ft={__buoyOmitted:"network-body",note:"Request/response body stays on the device (open the Network tool or the on-device Events detail)."},io={__buoyOmitted:"network-headers",note:"Request/response headers stay on the device (open the Network tool or the on-device Events detail)."},ds={__buoyOmitted:"graphql-variables",note:"GraphQL variables stay on the device (open the Network tool or the on-device Events detail)."},er={__buoyOmitted:"storage-value",note:"Storage value stays on the device (open the Storage tool or the on-device Events detail)."},ps={__buoyOmitted:"route-params",note:"Navigation params stay on the device (open the Routes tool or the on-device Events detail)."};function hs(e){return e==="react-query"||e==="react-query-query"||e==="react-query-mutation"}function se(e,t){if(e!==void 0)return us(e,Ue)?{...t}:e}function yt(e){return se(e,cs)}function so(e){return e==null?e:e instanceof Error?{name:e.name,message:e.message}:yt(e)}var lo=new WeakMap;function ms(e){let t=e.originalEvent;if(typeof t!="object"||t===null)return e;let r=lo.get(e);if(r!==void 0)return r;let o=e,a=t;if((e.source==="redux"||e.source==="zustand")&&("prevState"in a||"nextState"in a))a={...a,prevState:{...tt},nextState:{...tt},...e.source==="zustand"&&"partial"in a?{partial:{...tt}}:{}},o={...e,originalEvent:a};else if(e.source==="jotai"&&("prevValue"in a||"nextValue"in a))a={...a,prevValue:{...tt},nextValue:{...tt}},o={...e,originalEvent:a};else if(e.source==="render"){let i=a.render,c=a.event,u=d=>{if(!d||typeof d!="object")return d;let{hookChanges:p,...y}=d;return y};a={...a,render:i&&{...i,renderHistory:void 0,lastRenderCause:u(i.lastRenderCause)},event:c&&{...c,capturedProps:void 0,capturedState:void 0,cause:u(c.cause)}},o={...e,originalEvent:a}}else if(hs(e.source)){let{query:i,mutation:c,...u}=a;a={...u,queryData:yt(u.queryData),mutationData:yt(u.mutationData),mutationVariables:yt(u.mutationVariables),queryError:so(u.queryError),mutationError:so(u.mutationError)},o={...e,originalEvent:a}}else if(e.source==="network"){let i=typeof a.requestSize=="number"?a.requestSize:void 0,c=typeof a.responseSize=="number"?a.responseSize:void 0;a={...a,requestData:i!==void 0&&i>Ue?{...ft}:se(a.requestData,ft),responseData:c!==void 0&&c>Ue?{...ft}:se(a.responseData,ft),graphqlVariables:se(a.graphqlVariables,ds),requestHeaders:se(a.requestHeaders,io),responseHeaders:se(a.responseHeaders,io)},o={...e,originalEvent:a}}else if(e.source==="storage-async"||e.source==="storage-mmkv"){let i=a.data;i&&(a={...a,data:{...i,value:se(i.value,er),prevValue:se(i.prevValue,er),pairs:se(i.pairs,er)}},o={...e,originalEvent:a})}else e.source==="route"&&(a={...a,params:se(a.params,ps)},o={...e,originalEvent:a});let{bytes:n,sawRepeat:s,sawBigInt:l}=ss(a,Ue);return n>Ue?o={...e,originalEvent:no(n)}:(s||l)&&!ls(a)&&(o={...e,originalEvent:no(-1,"Payload is not JSON-serializable (cyclic or bigint) and stayed on the device.")}),lo.set(e,o),o}var gs={version:2,getSnapshot:()=>({events:V.getEvents().map(ms),availableSources:Array.from(V.getAvailableEventSources())}),subscribe:e=>{V.ensureRemoteSourcesDefault();let t=V.subscribe(()=>e());return()=>{t(),V.clearRemoteSources()}},actions:{clearEvents:()=>{V.clearEvents()},setEnabledSources:e=>{let t=e?.sources??[];return V.setRemoteEnabledSources(t),{enabledSources:t}},exportEvents:e=>{let t=e??{},r={...t.preset&&Ge[t.preset]?Ge[t.preset]:Qe,...t.settings??{}},o=Ne(V.getEvents(),r),a=typeof t.limit=="number"&&t.limit>0?t.limit:o.length,n=o.slice(0,a);return{output:Gt(n,r),returned:n.length,totalAvailable:o.length,includedData:r.includeEventData,format:r.format}}}};export{Ge as COPY_PRESETS,Qe as DEFAULT_COPY_SETTINGS,S as EVENTS_TEST_ID,to as EventsCopySettingsView,Xt as EventsModal,Xi as EventsToolView,z as PRESET_METADATA,Mr as ReactQueryEventDetail,Vt as UnifiedEventDetail,Ft as UnifiedEventFilters,Ir as UnifiedEventItem,zt as UnifiedEventList,is as UnifiedEventViewer,qr as buildCorrelationCountMap,Wi as clearCopySettings,os as createEventsTool,Hr as detectActivePreset,Wr as estimateExportSize,$r as eventFilterTestID,xr as eventIdentity,kr as eventRowTestID,gs as eventsSyncAdapter,oo as eventsToolPreset,Ne as filterEvents,Jn as findRelatedEvents,Gt as generateExport,_r as generateJsonExport,Wt as generateMarkdownExport,Yr as generateMermaidExport,Qr as generatePlaintextExport,jr as getCorrelationColor,Br as getCorrelationGroup,Fr as getCorrelationLabel,Ye as getExportSummary,_n as getRelatedEventsCount,Wn as hasRelatedEvents,st as isBuoyInternalEvent,Ha as isEventHiddenFromTool,$t as isNetworkEventIgnored,eo as loadCopySettings,Xr as saveCopySettings,V as unifiedEventStore,qt as useUnifiedEvents,Sn as watchEvents};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/events",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.79",
|
|
4
4
|
"description": "Review retained events from connected Buoy tools and export timeline data for investigation.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
],
|
|
35
35
|
"sideEffects": false,
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
38
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
37
|
+
"@buoy-gg/floating-tools-core": "^7.0.79",
|
|
38
|
+
"@buoy-gg/shared-ui": "^7.0.79"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "*"
|