@buoy-gg/highlight-updates 7.0.39 → 7.0.41

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.
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ var to=Object.defineProperty;var Ps=Object.getOwnPropertyDescriptor;var Vs=Object.getOwnPropertyNames;var Ls=Object.prototype.hasOwnProperty;var Mt=(e,t)=>()=>(e&&(t=e(e=0)),t);var Kr=(e,t)=>{for(var n in t)to(e,n,{get:t[n],enumerable:!0})},eo=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Vs(t))!Ls.call(e,r)&&r!==n&&to(e,r,{get:()=>t[r],enumerable:!(o=Ps(t,r))||o.enumerable});return e},ie=(e,t,n)=>(eo(e,t,"default"),n&&eo(n,t,"default"));var Es=e=>eo(to({},"__esModule",{value:!0}),e);var _,P=Mt(()=>{"use strict";_=process.env.NODE_ENV!=="production";typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis)});function pn(e){return mt[e]||e}function El(e){for(let[t,n]of Object.entries(mt))if(n===e)return t;return null}function Nl(e){return e in mt}function Hl(){return Object.keys(mt)}function zl(){return[...new Set(Object.values(mt))]}var mt,lo=Mt(()=>{"use strict";P();mt={RCTView:"View",RCTSafeAreaView:"SafeAreaView",RCTModalHostView:"Modal",RCTText:"Text",RCTRawText:"RawText",RCTVirtualText:"VirtualText",RCTTextInlineImage:"TextInlineImage",RCTImageView:"Image",RCTImage:"Image",RCTScrollView:"ScrollView",RCTScrollContentView:"ScrollContentView",AndroidHorizontalScrollView:"HorizontalScrollView",AndroidHorizontalScrollContentView:"HorizontalScrollContentView",RCTSinglelineTextInputView:"TextInput",RCTMultilineTextInputView:"TextInput (Multiline)",AndroidTextInput:"TextInput",RCTInputAccessoryView:"InputAccessoryView",RCTRefreshControl:"RefreshControl",AndroidSwipeRefreshLayout:"RefreshControl",PullToRefreshView:"RefreshControl",RCTSwitch:"Switch",AndroidSwitch:"Switch",RCTSlider:"Slider",RCTActivityIndicatorView:"ActivityIndicator",AndroidProgressBar:"ActivityIndicator",AndroidDrawerLayout:"DrawerLayout",VirtualView:"VirtualView",VirtualViewExperimental:"VirtualView",DebuggingOverlay:"DebuggingOverlay",LayoutConformance:"LayoutConformance",UnimplementedNativeView:"UnimplementedView",RKShimmeringView:"ShimmeringView",RCTTemplateView:"TemplateView",RCTAxialGradientView:"AxialGradientView",RCTMap:"Map",RCTWebView:"WebView",RCTKeyframes:"Keyframes",RCTImpressionTrackingView:"ImpressionTrackingView",RNSVGSvgView:"Svg",RNSVGGroup:"G",RNSVGPath:"Path",RNSVGText:"SvgText",RNSVGTSpan:"TSpan",RNSVGTextPath:"TextPath",RNSVGImage:"SvgImage",RNSVGCircle:"Circle",RNSVGEllipse:"Ellipse",RNSVGLine:"Line",RNSVGRect:"Rect",RNSVGClipPath:"ClipPath",RNSVGDefs:"Defs",RNSVGUse:"Use",RNSVGSymbol:"Symbol",RNSVGPattern:"Pattern",RNSVGMask:"Mask",RNSVGForeignObject:"ForeignObject",RNSVGMarker:"Marker",RNSVGLinearGradient:"LinearGradient",RNSVGRadialGradient:"RadialGradient",RNSVGFilter:"Filter",RNSVGFeBlend:"FeBlend",RNSVGFeColorMatrix:"FeColorMatrix",RNSVGFeComposite:"FeComposite",RNSVGFeFlood:"FeFlood",RNSVGFeGaussianBlur:"FeGaussianBlur",RNSVGFeMerge:"FeMerge",RNSVGFeOffset:"FeOffset",RNSVGPolygon:"Polygon",RNSVGPolyline:"Polyline",RNSVGStop:"Stop",RNGestureHandlerRootView:"GestureHandlerRootView",RNGestureHandlerButton:"GestureHandlerButton",RNCSafeAreaProvider:"SafeAreaProvider",RNCSafeAreaView:"SafeAreaView",RNSScreen:"Screen",RNSScreenContainer:"ScreenContainer",RNSScreenStack:"ScreenStack",RNSScreenStackHeaderConfig:"ScreenStackHeaderConfig",RNSScreenStackHeaderSubview:"ScreenStackHeaderSubview",RNSSearchBar:"SearchBar",RNSFullWindowOverlay:"FullWindowOverlay",RNSModalScreen:"ModalScreen",ReanimatedView:"Animated.View",ExpoView:"ExpoView",ExpoBlurView:"BlurView",ExpoLinearGradient:"LinearGradient",ExpoImage:"ExpoImage",ExpoVideoView:"VideoView",ExpoCamera:"Camera",ExpoBarCodeScannerView:"BarCodeScanner",RNCWebView:"WebView",AIRMap:"MapView",AIRMapMarker:"Marker",AIRMapPolyline:"Polyline",AIRMapPolygon:"Polygon",AIRMapCircle:"Circle",AIRMapCallout:"Callout",RCTVideo:"Video",LottieAnimationView:"LottieView",FastImageView:"FastImage"}});function qr(){return gn=performance.now(),gn}function Xr(e,t){gn>0&&e>0&&(gn=0)}var gn,co,ze,Wt=Mt(()=>{"use strict";P();gn=0;co=class{constructor(){this.enabled=!1;this.batchCounter=0;this.listeners=new Set;this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:1/0,avgMeasurementTime:0};this.recentBatches=[];this.MAX_HISTORY=100;this.summaryInterval=null;this.SUMMARY_INTERVAL_MS=1e4}setEnabled(t){let n=this.enabled;this.enabled=t,t&&!n?this.resetStats():!t&&n&&this.stopSummaryInterval()}isEnabled(){return this.enabled}startBatch(t,n){let o=`batch_${++this.batchCounter}`,r=performance.now(),i=null,s=null,a=null,l=null,c=null,u=0,y=0,v=0,S=0,C;return{markFilteringComplete:(h,f)=>{i=performance.now(),u=h,y=f},markMeasurementStart:()=>{s=performance.now()},markMeasurementComplete:(h,f)=>{a=performance.now(),v=h,S=f},markTrackingComplete:()=>{l=performance.now()},markCallbackComplete:()=>{c=performance.now()},setOverlayRenderTime:h=>{C=h},getBatchId:()=>o,finish:()=>{let h=performance.now(),f={batchId:o,timestamp:Date.now(),nodesReceived:t,nodesFiltered:u,nodesToProcess:y,batchSize:n,nodesInBatch:Math.min(y,n),filteringTime:i?i-r:0,measurementTime:s&&a?a-s:0,trackingTime:a&&l?l-a:0,callbackTime:l&&c?c-l:0,totalTime:h-r,measurementSuccessCount:v,measurementFailCount:S,overlayRenderTime:C};return this.enabled&&this.recordMetrics(f),f}}}recordMetrics(t){this.rollingStats.batchCount++,this.rollingStats.totalNodes+=t.nodesReceived,this.rollingStats.totalFiltered+=t.nodesFiltered,this.rollingStats.totalProcessed+=t.nodesInBatch,this.rollingStats.totalTime+=t.totalTime,this.rollingStats.maxTime=Math.max(this.rollingStats.maxTime,t.totalTime),this.rollingStats.minTime=Math.min(this.rollingStats.minTime,t.totalTime);let n=this.rollingStats.avgMeasurementTime,o=this.rollingStats.batchCount;this.rollingStats.avgMeasurementTime=n+(t.measurementTime-n)/o,this.recentBatches.push(t),this.recentBatches.length>this.MAX_HISTORY&&this.recentBatches.shift(),this.notifyListeners(t)}logBatch(t){let{batchId:n,nodesReceived:o,nodesFiltered:r,nodesInBatch:i,batchSize:s,filteringTime:a,measurementTime:l,trackingTime:c,callbackTime:u,totalTime:y,measurementSuccessCount:v,measurementFailCount:S,overlayRenderTime:C}=t;console.log(`[HighlightPerf] ${n} | In:${o} Filt:${r} Proc:${i}/${s} | Filter:${a.toFixed(1)}ms Measure:${l.toFixed(1)}ms Track:${c.toFixed(1)}ms Callback:${u.toFixed(1)}ms | Total:${y.toFixed(1)}ms`+(C?` Render:${C.toFixed(1)}ms`:"")+` | Success:${v} Fail:${S}`),y>100&&console.warn(`[HighlightPerf] \u26A0\uFE0F SLOW BATCH: ${y.toFixed(1)}ms - Measurement phase: ${l.toFixed(1)}ms (${(l/y*100).toFixed(0)}%)`)}logSummary(){if(this.rollingStats.batchCount===0)return;let t=this.rollingStats,n=t.totalTime/t.batchCount,o=t.totalNodes/t.batchCount;console.log(`
3
+ [HighlightPerf] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 SUMMARY (last ${this.SUMMARY_INTERVAL_MS/1e3}s) \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
4
+ Batches: ${t.batchCount}
5
+ Avg nodes/batch: ${o.toFixed(1)} (filtered: ${(t.totalFiltered/t.batchCount).toFixed(1)})
6
+ Avg total time: ${n.toFixed(1)}ms
7
+ Avg measurement time: ${t.avgMeasurementTime.toFixed(1)}ms
8
+ Min/Max time: ${t.minTime.toFixed(1)}ms / ${t.maxTime.toFixed(1)}ms
9
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
10
+ `),this.resetStats()}resetStats(){this.rollingStats={batchCount:0,totalNodes:0,totalFiltered:0,totalProcessed:0,totalTime:0,maxTime:0,minTime:1/0,avgMeasurementTime:0}}startSummaryInterval(){this.stopSummaryInterval(),this.summaryInterval=setInterval(()=>{this.logSummary()},this.SUMMARY_INTERVAL_MS)}stopSummaryInterval(){this.summaryInterval&&(clearInterval(this.summaryInterval),this.summaryInterval=null)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notifyListeners(t){for(let n of this.listeners)try{n(t)}catch(o){console.error("[HighlightPerf] Error in metrics listener:",o)}}getRecentBatches(){return[...this.recentBatches]}getRollingStats(){return{...this.rollingStats}}clear(){this.recentBatches=[],this.resetStats(),this.batchCounter=0}generateReport(){let t=this.recentBatches;if(t.length===0)return"No performance data collected yet.";let o=t.reduce((c,u)=>c+u.totalTime,0)/t.length,i=t.reduce((c,u)=>c+u.measurementTime,0)/t.length,s=t.filter(c=>c.totalTime>100),a=t.filter(c=>c.totalTime<20);return`
11
+ \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
12
+ \u2551 HIGHLIGHT UPDATES PERFORMANCE REPORT \u2551
13
+ \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
14
+ \u2551 Total batches analyzed: ${t.length.toString().padStart(5)} \u2551
15
+ \u2551 Average total time: ${o.toFixed(1).padStart(5)}ms \u2551
16
+ \u2551 Average measure time: ${i.toFixed(1).padStart(5)}ms (${(i/o*100).toFixed(0)}% of total) \u2551
17
+ \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
18
+ \u2551 Fast batches (<20ms): ${a.length.toString().padStart(5)} (${(a.length/t.length*100).toFixed(0)}%) \u2551
19
+ \u2551 Slow batches (>100ms): ${s.length.toString().padStart(5)} (${(s.length/t.length*100).toFixed(0)}%) \u2551
20
+ \u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563
21
+ \u2551 Time breakdown (avg): \u2551
22
+ \u2551 Filtering: ${t.reduce((c,u)=>c+u.filteringTime,0/t.length).toFixed(1).padStart(6)}ms \u2551
23
+ \u2551 Measurement: ${i.toFixed(1).padStart(6)}ms \u2190 Primary bottleneck \u2551
24
+ \u2551 Tracking: ${(t.reduce((c,u)=>c+u.trackingTime,0)/t.length).toFixed(1).padStart(6)}ms \u2551
25
+ \u2551 Callback: ${(t.reduce((c,u)=>c+u.callbackTime,0)/t.length).toFixed(1).padStart(6)}ms \u2551
26
+ \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
27
+ `}},ze=new co});function Jr(e){if(e.testID&&e.testID.trim())return!0;let t=(e.componentName??"").trim();if(!t||Yr.has(t)||Al.has(t))return!1;let n=(e.viewType??"").trim();return!(n&&Yr.has(n)&&t===n||/^comp(\s|$)/i.test(t)||t.startsWith("_"))}var Yr,Al,Qr=Mt(()=>{"use strict";P();Yr=new Set(["View","RCTView","Text","RCTText","RawText","RCTRawText","VirtualText","RCTVirtualText","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","Pressable","TouchableOpacity","Image","RCTImageView"]),Al=new Set(["Unknown","Anonymous","CellRenderer","NativeComponent"])});var ei={};Kr(ei,{RenderTracker:()=>E,default:()=>Ml});var Zr,Ol,uo,E,Ml,Le=Mt(()=>{"use strict";P();lo();Wt();Qr();Zr=200,Ol=150,uo=class{constructor(){this.renders=new Map;this.listeners=new Set;this.stateListeners=new Set;this.settingsListeners=new Set;this.filterListeners=new Set;this.renderEventCallbacks=new Set;this.isTracking=!1;this.isPaused=!1;this.settings={batchSize:Ol,showRenderCount:!0,performanceLogging:!1,trackRenderCauses:!1,enableRenderHistory:!1,maxRenderHistoryPerComponent:20,capturePropsOnRender:!1,captureStateOnRender:!1,debugLogLevel:"off",excludeDevTools:!0,showHostViews:!1};this.isBatchMode=!1;this.batchDirty=!1;this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[]}}trackRender(t){if(this.isPaused)return;let n=String(t.nativeTag),o=Date.now(),r=this.renders.get(n);if(r){if(r.renderCount=t.count,r.lastRenderTime=o,r.color=t.color,t.measurements&&(r.measurements=t.measurements),t.testID&&!r.testID&&(r.testID=t.testID),t.nativeID&&!r.nativeID&&(r.nativeID=t.nativeID),t.accessibilityLabel&&!r.accessibilityLabel&&(r.accessibilityLabel=t.accessibilityLabel),t.componentName&&!r.componentName&&(r.componentName=t.componentName),t.renderCause&&(r.lastRenderCause=t.renderCause),this.settings.enableRenderHistory){let i=t.renderCause||{type:"unknown",timestamp:o};this.addRenderEvent(r,i,t.capturedProps,t.capturedState)}}else{let i={id:n,nativeTag:t.nativeTag,viewType:t.viewType,displayName:pn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,renderCount:t.count,firstRenderTime:o,lastRenderTime:o,measurements:t.measurements,color:t.color,lastRenderCause:t.renderCause};if(this.settings.enableRenderHistory){i.renderHistory=[];let s=t.renderCause||{type:t.count===1?"mount":"unknown",timestamp:o};this.addRenderEvent(i,s,t.capturedProps,t.capturedState)}if(this.renders.set(n,i),this.renders.size>Zr){let a=Array.from(this.renders.values()).sort((l,c)=>l.lastRenderTime-c.lastRenderTime).slice(0,this.renders.size-Zr);for(let l of a)this.renders.delete(l.id)}}this.isBatchMode?this.batchDirty=!0:this.notifyListeners()}addRenderEvent(t,n,o,r){t.renderHistory||(t.renderHistory=[]);let i={id:`${t.nativeTag}-${n.timestamp}`,timestamp:n.timestamp,cause:n,renderNumber:t.renderCount,capturedProps:this.settings.capturePropsOnRender?o:void 0,capturedState:this.settings.captureStateOnRender?r:void 0};t.renderHistory.push(i);let s=Math.max(5,Math.min(50,this.settings.maxRenderHistoryPerComponent));t.renderHistory.length>s&&(t.renderHistory=t.renderHistory.slice(-s)),this.notifyRenderEventCallbacks(i,t)}notifyRenderEventCallbacks(t,n){this.renderEventCallbacks.forEach(o=>{try{o(t,n)}catch{}})}emitRenderEvent(t){if(this.renderEventCallbacks.size===0)return;let n=Date.now(),o=t.renderCause||{type:"unknown",timestamp:n},r={id:String(t.nativeTag),nativeTag:t.nativeTag,viewType:t.viewType,displayName:pn(t.viewType),testID:t.testID,nativeID:t.nativeID,accessibilityLabel:t.accessibilityLabel,componentName:t.componentName,renderCount:t.count,firstRenderTime:n,lastRenderTime:n,measurements:t.measurements,color:t.color,lastRenderCause:o,renderHistory:[]},i={id:`${t.nativeTag}-${n}-${t.count}`,timestamp:n,renderNumber:t.count,cause:o,capturedProps:void 0,capturedState:void 0};this.notifyRenderEventCallbacks(i,r)}startBatch(){this.isBatchMode=!0,this.batchDirty=!1}endBatch(){this.isBatchMode=!1,this.batchDirty&&(this.batchDirty=!1,this.notifyListeners())}getRenders(){return Array.from(this.renders.values()).map(t=>({...t}))}passesFilters(t){if(this.filters.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,this.filters.includePatterns)||this.filters.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,this.filters.excludePatterns))return!1;if(this.filters.includeViewType.size>0){let n=t.viewType||"",o=t.displayName||"";if(!this.matchesPattern(n,this.filters.includeViewType)&&!this.matchesPattern(o,this.filters.includeViewType))return!1}if(this.filters.includeTestID.size>0&&(!t.testID||!this.matchesPattern(t.testID,this.filters.includeTestID))||this.filters.includeNativeID.size>0&&(!t.nativeID||!this.matchesPattern(t.nativeID,this.filters.includeNativeID))||this.filters.includeComponent.size>0&&(!t.componentName||!this.matchesPattern(t.componentName,this.filters.includeComponent)))return!1;if(this.filters.excludeViewType.size>0){let n=t.viewType||"",o=t.displayName||"";if(this.matchesPattern(n,this.filters.excludeViewType)||this.matchesPattern(o,this.filters.excludeViewType))return!1}return!(this.filters.excludeTestID.size>0&&t.testID&&this.matchesPattern(t.testID,this.filters.excludeTestID)||this.filters.excludeNativeID.size>0&&t.nativeID&&this.matchesPattern(t.nativeID,this.filters.excludeNativeID)||this.filters.excludeComponent.size>0&&t.componentName&&this.matchesPattern(t.componentName,this.filters.excludeComponent))}matchesAnyPatternForInfo(t,n){for(let o of n){let r=o.value.toLowerCase();switch(o.type){case"any":if(t.viewType.toLowerCase().includes(r)||t.displayName?.toLowerCase().includes(r)||t.testID?.toLowerCase().includes(r)||t.nativeID?.toLowerCase().includes(r)||t.componentName?.toLowerCase().includes(r)||t.accessibilityLabel?.toLowerCase().includes(r))return!0;break;case"viewType":if(t.viewType.toLowerCase().includes(r)||t.displayName?.toLowerCase().includes(r))return!0;break;case"testID":if(t.testID?.toLowerCase().includes(r))return!0;break;case"nativeID":if(t.nativeID?.toLowerCase().includes(r))return!0;break;case"component":if(t.componentName?.toLowerCase().includes(r))return!0;break;case"accessibilityLabel":if(t.accessibilityLabel?.toLowerCase().includes(r))return!0;break}}return!1}hasActiveFilters(){return this.filters.includePatterns.length>0||this.filters.excludePatterns.length>0||this.filters.includeViewType.size>0||this.filters.includeTestID.size>0||this.filters.includeNativeID.size>0||this.filters.includeComponent.size>0||this.filters.excludeViewType.size>0||this.filters.excludeTestID.size>0||this.filters.excludeNativeID.size>0||this.filters.excludeComponent.size>0||this.filters.minRenderCount!==void 0||this.filters.maxRenderCount!==void 0}getFilteredRenders(t=""){let n=this.getRenders();if(this.settings.showHostViews||(n=n.filter(Jr)),t.trim()){let o=t.toLowerCase();n=n.filter(r=>r.viewType.toLowerCase().includes(o)||r.displayName.toLowerCase().includes(o)||r.testID?.toLowerCase().includes(o)||r.nativeID?.toLowerCase().includes(o)||r.accessibilityLabel?.toLowerCase().includes(o)||r.componentName?.toLowerCase().includes(o)||String(r.nativeTag).includes(o))}return n=n.filter(o=>this.passesFilters(o)),this.filters.minRenderCount!==void 0&&(n=n.filter(o=>o.renderCount>=this.filters.minRenderCount)),this.filters.maxRenderCount!==void 0&&(n=n.filter(o=>o.renderCount<=this.filters.maxRenderCount)),n.sort((o,r)=>r.lastRenderTime-o.lastRenderTime)}matchesPattern(t,n){let o=t.toLowerCase();for(let r of n){let i=r.toLowerCase();if(o.includes(i))return!0}return!1}getRender(t){return this.renders.get(t)}clear(){this.renders.clear(),this.notifyListeners()}resetRenderCount(t){let n=this.renders.get(t);n&&(n.renderCount=0,this.notifyListeners())}start(){this.isTracking=!0,this.isPaused=!1,this.notifyStateListeners()}stop(){this.isTracking=!1,this.isPaused=!1,this.notifyStateListeners()}pause(){this.isPaused=!0,this.notifyStateListeners()}resume(){this.isPaused=!1,this.notifyStateListeners()}togglePause(){this.isPaused=!this.isPaused,this.notifyStateListeners()}getState(){return{isTracking:this.isTracking,isPaused:this.isPaused}}replaceRenders(t,n){let o=new Map;for(let[r,i]of this.renders)i.renderHistory&&i.renderHistory.length>0&&o.set(r,i.renderHistory);this.renders=new Map(t.map(r=>{let i=o.get(r.id),s=i&&!(r.renderHistory&&r.renderHistory.length>0)?{...r,renderHistory:i}:r;return[s.id,s]})),n&&(this.isTracking!==n.isTracking||this.isPaused!==n.isPaused)&&(this.isTracking=n.isTracking,this.isPaused=n.isPaused,this.notifyStateListeners()),this.notifyListeners()}hydrateRender(t){let n=this.renders.get(t.id);this.renders.set(t.id,n?{...n,...t}:t),this.notifyListeners()}getFilters(){return this.filters}setFilters(t){this.filters={...this.filters,...t},this.notifyListeners(),this.notifyFilterListeners()}addIncludePattern(t,n){let o=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].add(n),this.notifyListeners()}removeIncludePattern(t,n){let o=`include${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].delete(n),this.notifyListeners()}addExcludePattern(t,n){let o=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].add(n),this.notifyListeners()}removeExcludePattern(t,n){let o=`exclude${t.charAt(0).toUpperCase()+t.slice(1)}`;this.filters[o].delete(n),this.notifyListeners()}clearFilters(){this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[],minRenderCount:void 0,maxRenderCount:void 0},this.notifyListeners()}getAvailableProps(){let t=new Set,n=new Set,o=new Set,r=new Set,i=new Set;for(let s of this.renders.values())s.viewType&&t.add(s.viewType),s.testID&&n.add(s.testID),s.nativeID&&o.add(s.nativeID),s.componentName&&r.add(s.componentName),s.accessibilityLabel&&i.add(s.accessibilityLabel);return{viewTypes:Array.from(t).sort(),testIDs:Array.from(n).sort(),nativeIDs:Array.from(o).sort(),componentNames:Array.from(r).sort(),accessibilityLabels:Array.from(i).sort()}}getStats(){let t=0;for(let n of this.renders.values())t+=n.renderCount;return{totalComponents:this.renders.size,totalRenders:t}}subscribe(t){return this.listeners.add(t),t(this.getRenders()),()=>{this.listeners.delete(t)}}subscribeToState(t){return this.stateListeners.add(t),t(this.getState()),()=>{this.stateListeners.delete(t)}}subscribeToSettings(t){return this.settingsListeners.add(t),t(this.settings),()=>{this.settingsListeners.delete(t)}}subscribeToFilters(t){return this.filterListeners.add(t),t(this.filters),()=>{this.filterListeners.delete(t)}}onRenderEvent(t){return this.renderEventCallbacks.add(t),()=>{this.renderEventCallbacks.delete(t)}}getRenderEventCallbackCount(){return this.renderEventCallbacks.size}shouldShowRender(t){let n=this.filters;return!(n.includePatterns.length>0&&!this.matchesAnyPatternForInfo(t,n.includePatterns)||n.excludePatterns.length>0&&this.matchesAnyPatternForInfo(t,n.excludePatterns)||(n.includeViewType.size>0||n.includeTestID.size>0||n.includeNativeID.size>0||n.includeComponent.size>0)&&!(n.includeViewType.size>0&&n.includeViewType.has(t.viewType)||n.includeTestID.size>0&&t.testID&&n.includeTestID.has(t.testID)||n.includeNativeID.size>0&&t.nativeID&&n.includeNativeID.has(t.nativeID)||n.includeComponent.size>0&&t.componentName&&n.includeComponent.has(t.componentName))||n.excludeViewType.has(t.viewType)||t.testID&&n.excludeTestID.has(t.testID)||t.nativeID&&n.excludeNativeID.has(t.nativeID)||t.componentName&&n.excludeComponent.has(t.componentName))}getSettings(){return{...this.settings}}setSettings(t){t.batchSize!==void 0&&(t.batchSize=Math.max(10,Math.min(500,t.batchSize))),t.maxRenderHistoryPerComponent!==void 0&&(t.maxRenderHistoryPerComponent=Math.max(5,Math.min(50,t.maxRenderHistoryPerComponent))),t.enableRenderHistory&&!this.settings.trackRenderCauses&&(t.trackRenderCauses=!0),t.trackRenderCauses===!1&&this.settings.enableRenderHistory&&(t.enableRenderHistory=!1),this.settings={...this.settings,...t},t.performanceLogging!==void 0&&ze.setEnabled(t.performanceLogging),this.notifySettingsListeners()}clearAllRenderHistory(){for(let t of this.renders.values())t.renderHistory=[];this.notifyListeners()}clearRenderHistory(t){let n=this.renders.get(t);n&&(n.renderHistory=[],this.notifyListeners())}getRenderHistoryStats(){let t=0,n=0;for(let o of this.renders.values())o.renderHistory&&o.renderHistory.length>0&&(t+=o.renderHistory.length,n++);return{totalEvents:t,componentsWithHistory:n,averageEventsPerComponent:n>0?t/n:0}}getBatchSize(){return this.settings.batchSize}setBatchSize(t){this.setSettings({batchSize:t})}notifyListeners(){let t=this.getRenders();for(let n of this.listeners)try{n(t)}catch(o){console.error("[RenderTracker] Error in listener:",o)}}notifyStateListeners(){let t=this.getState();for(let n of this.stateListeners)try{n(t)}catch(o){console.error("[RenderTracker] Error in state listener:",o)}}notifySettingsListeners(){let t=this.getSettings();for(let n of this.settingsListeners)try{n(t)}catch(o){console.error("[RenderTracker] Error in settings listener:",o)}}notifyFilterListeners(){let t=this.getFilters();for(let n of this.filterListeners)try{n(t)}catch(o){console.error("[RenderTracker] Error in filter listener:",o)}}},E=new uo,Ml=E});P();P();import{useState as fr,useEffect as mr,useCallback as dp}from"react";import{HighlighterIcon as Ka,HighlightIcon as ja}from"@buoy-gg/floating-tools-core/web";P();import{getDOMFiber as Oo,getDOMNodeHandle as Ac,getDOMPublicInstance as Oc,isDOMElement as Mc}from"@buoy-gg/shared-ui/web/utils";P();var gt=null,ft=null,_t=!1,Ft=!1,un=null;function jr(e){if(!e)return{type:"null"};let t=e,n={};if(t.canonical){n.type="Fabric";let o=t.canonical;if(o.publicInstance){let r=o.publicInstance;n.hasMeasure=typeof r.measure=="function",n.nativeTag=r.__nativeTag??r._nativeTag??"unknown"}}else typeof t.measure=="function"?(n.type="Legacy",n.hasMeasure=!0,n.nativeTag=t.__nativeTag??t._nativeTag??t.nativeTag??"unknown"):(n.type="Unknown",n.keys=Object.keys(t).slice(0,10));return n}function Ns(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;!e||typeof e.emit!="function"||gt||(gt=e.emit.bind(e),e.emit=function(t,...n){if(t==="traceUpdates"&&Ft){let o=n[0];o.size>0&&console.log(`[PROFILER] traceUpdates: ${o.size} nodes`,Array.from(o).map((r,i)=>({index:i,...jr(r)}))),un&&un(o)}return gt(t,...n)})}function Hs(){let t=window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.reactDevtoolsAgent;!t||typeof t.emit!="function"||ft||(ft=t.emit.bind(t),t.emit=function(n,...o){if(Ft&&n==="drawTraceUpdates"){let r=o[0];r.length>0&&console.log(`[PROFILER] drawTraceUpdates: ${r.length} nodes`,r.map((i,s)=>({index:s,color:i.color,...jr(i.node)})))}return ft(n,...o)})}function zs(){let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;e?.rendererInterfaces&&e.rendererInterfaces.forEach(t=>{if(typeof t.setTraceUpdatesEnabled=="function")try{t.setTraceUpdatesEnabled(!1)}catch{}})}function no(e){un=e}function oo(){typeof _<"u"&&!_||_t||(Ns(),Hs(),_t=!0)}function ro(){if(!_t)return;let e=window.__REACT_DEVTOOLS_GLOBAL_HOOK__;gt&&e&&(e.emit=gt,gt=null),ft&&e?.reactDevtoolsAgent&&(e.reactDevtoolsAgent.emit=ft,ft=null),zs(),un=null,_t=!1}function As(){return _t}function Os(){Ft=!0}function Ms(){Ft=!1}function _s(){return Ft}var K={};Kr(K,{AccessibilityInfo:()=>Xs,ActivityIndicator:()=>Us,Alert:()=>Ks,Animated:()=>Ys,AppRegistry:()=>Qs,AppState:()=>Zs,Appearance:()=>Js,BackHandler:()=>el,Button:()=>Gs,CheckBox:()=>gl,Clipboard:()=>tl,DeviceEventEmitter:()=>Dl,Dimensions:()=>Qe,Easing:()=>nl,FlatList:()=>so,I18nManager:()=>ol,Image:()=>fl,ImageBackground:()=>ml,InteractionManager:()=>il,Keyboard:()=>rl,KeyboardAvoidingView:()=>hl,LayoutAnimation:()=>al,Linking:()=>sl,LogBox:()=>kl,Modal:()=>ao,NativeEventEmitter:()=>ll,NativeModules:()=>qs,PanResponder:()=>cl,Picker:()=>yl,PixelRatio:()=>dn,Platform:()=>ul,Pressable:()=>io,ProgressBar:()=>bl,RefreshControl:()=>Tl,SafeAreaView:()=>Cl,ScrollView:()=>Re,SectionList:()=>vl,Share:()=>dl,StatusBar:()=>wl,StyleSheet:()=>oe,Switch:()=>Ye,Text:()=>p,TextInput:()=>Bt,Touchable:()=>Sl,TouchableHighlight:()=>$s,TouchableNativeFeedback:()=>xl,TouchableOpacity:()=>q,TouchableWithoutFeedback:()=>Ws,UIManager:()=>$t,Vibration:()=>pl,View:()=>d,VirtualizedList:()=>Rl,YellowBox:()=>Il,findNodeHandle:()=>Je,unstable_createElement:()=>js,useColorScheme:()=>Pl,useLocaleContext:()=>Vl,useWindowDimensions:()=>Ll});P();ie(K,ig);import*as ig from"react-native-web";import{unstable_createElement as js,NativeModules as qs,AccessibilityInfo as Xs,Animated as Ys,Appearance as Js,AppRegistry as Qs,AppState as Zs,BackHandler as el,Clipboard as tl,Dimensions as Qe,Easing as nl,I18nManager as ol,Keyboard as rl,InteractionManager as il,LayoutAnimation as al,Linking as sl,NativeEventEmitter as ll,PanResponder as cl,PixelRatio as dn,Platform as ul,Share as dl,StyleSheet as oe,UIManager as $t,Vibration as pl,CheckBox as gl,FlatList as so,Image as fl,ImageBackground as ml,KeyboardAvoidingView as hl,Picker as yl,ProgressBar as bl,RefreshControl as Tl,SafeAreaView as Cl,SectionList as vl,StatusBar as wl,Touchable as Sl,TouchableNativeFeedback as xl,VirtualizedList as Rl,YellowBox as Il,LogBox as kl,DeviceEventEmitter as Dl,useColorScheme as Pl,useLocaleContext as Vl,useWindowDimensions as Ll}from"react-native-web";import*as te from"react-native-web";import{createElement as Fs,forwardRef as Bs}from"react";function xe(e){let t=Bs((o,r)=>{let{accessibilityState:i,accessibilityValue:s,...a}=o;for(let l of["busy","checked","disabled","expanded","selected"])i?.[l]!==void 0&&a[`aria-${l}`]===void 0&&(a[`aria-${l}`]=i[l]);for(let[l,c]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))s?.[l]!==void 0&&a[`aria-${c}`]===void 0&&(a[`aria-${c}`]=s[l]);return Fs(e,{...a,ref:r})}),n=e.State;return n&&Object.assign(t,{State:n}),t.displayName=e.displayName??e.name??"NativeWebView",t}var d=xe(te.View),p=xe(te.Text),Bt=xe(te.TextInput),q=xe(te.TouchableOpacity),$s=xe(te.TouchableHighlight),Ws=xe(te.TouchableWithoutFeedback),io=xe(te.Pressable),Re=xe(te.ScrollView),ao=xe(te.Modal),Ye=xe(te.Switch),Us=xe(te.ActivityIndicator),Gs=xe(te.Button),Je=te.findNodeHandle,Ks={alert(e,t,n,o){if(typeof document>"u")return;let r=document.createElement("dialog");r.dataset.buoyRoot="",r.setAttribute("aria-label",e),r.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 i=document.createElement("h2");if(i.textContent=e,i.style.cssText="font-size:18px;margin:0 0 12px",r.appendChild(i),t){let c=document.createElement("p");c.textContent=t,c.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",r.appendChild(c)}let s=document.createElement("div");s.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let a=n?.length?n:[{text:"OK"}],l=()=>{r.close?.(),r.remove()};for(let c of a){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=()=>{l(),c.onPress?.()},s.appendChild(u)}r.addEventListener("cancel",c=>{c.preventDefault(),o?.cancelable!==!1&&(l(),o?.onDismiss?.())}),r.appendChild(s),document.body.appendChild(r),r.showModal?r.showModal():r.setAttribute("open","")}};Le();P();import{getDOMControlProps as Fl,getDOMNodeHandle as Bl,getDOMPublicInstance as $l,isDOMElement as Wl}from"@buoy-gg/shared-ui/web/utils";P();function _l(e){return e?e.x>=-.1&&e.x<=1.1&&e.y>=-.1&&e.y<=1.1:!1}function fn(e,t,n){if(!e||t<=0||n<=0)return!1;let o=e.x+e.width/2,r=e.y+e.height/2,i=t*.1,s=n*.1;return o>=-i&&o<=t+i&&r>=-s&&r<=n+s}function ti(e){return String(e??"").toLowerCase().replace(/\s+/g," ").replace(/(\d)[,\u00a0\u202f](?=\d{3}\b)/g,"$1").trim()}function Ut(e,t){if(t.nativeTag!=null&&e.nativeTag===t.nativeTag)return 1e3;let n=String(t.query??t.testID??"").trim().toLowerCase();if(!n)return 0;let o=[e.testID,e.label,e.text,e.name].filter(Boolean).map(a=>a.toLowerCase()),r=0;for(let a of o)a===n?r=Math.max(r,100):a.startsWith(n)?r=Math.max(r,50):a.includes(n)&&(r=Math.max(r,25));let i=ti(n);if(i)for(let a of o){let l=ti(a);l===i?r=Math.max(r,90):l.startsWith(i)?r=Math.max(r,45):l.includes(i)&&(r=Math.max(r,22))}return t.testID&&e.testID&&e.testID.toLowerCase()===t.testID.toLowerCase()&&(r=Math.max(r,200)),r===0?0:((e.testID??"").toLowerCase().startsWith("buoy-dial-")&&(r+=40),e.tap&&(_l(e.tap)?r+=20:r-=40),r)}var Ul=22,ai=new Set(["View","RCTView","ScrollView","RCTScrollView","RCTScrollContentView","SafeAreaView","RCTSafeAreaView","AndroidHorizontalScrollContentView","KeyboardAvoidingView","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","AnimatedComponent","Wrapper"]);function si(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}var po=0,ni=!1;function Gl(){if(ni)return;let e=si();if(!e)return;let t=e.onCommitFiberRoot;e.onCommitFiberRoot=function(...n){return po++,typeof t=="function"?t.apply(e,n):void 0},ni=!0}var Kl=250;function jl(){let e=new Map;return t=>{let n=[],o=t,r=0,i=!1;for(;o&&r<400;){let s=e.get(o);if(s!==void 0){i=s;break}if(_e(o)?.__buoyDevToolsRoot){i=!0,e.set(o,!0);break}n.push(o),o=o.return,r++}for(let s of n)e.set(s,i);return i}}function li(){let e=si();if(!e)return[];let t=[];try{if(e.renderers&&typeof e.renderers.forEach=="function"&&e.renderers.forEach((n,o)=>{try{let r=e.getFiberRoots?.(o);r&&r.forEach(i=>t.push(i))}catch{}}),t.length===0&&e.getFiberRoots){let n=e.getFiberRoots(1);n&&n.forEach(o=>t.push(o))}}catch{}return t}function ql(e){return e.tag===Ul&&e.memoizedState!==null}function Xl(e){let t=e.memoizedProps?.activityState;return t===0||t===1||e.memoizedProps?.isPageFocused===!1}function Gt(e,t,n=0,o=new Set){if(!(!e||o.has(e)||n>500)){if(o.add(e),ql(e)||Xl(e)){e.sibling&&Gt(e.sibling,t,n,o);return}t(e),e.child&&Gt(e.child,t,n+1,o),e.sibling&&Gt(e.sibling,t,n,o)}}function oi(e){let t=$l(e);if(t)return t;if(!e)return null;let n=e;return n.canonical?.publicInstance?n.canonical.publicInstance:n.canonical&&typeof n.canonical.measure=="function"?n.canonical:typeof n.measure=="function"||typeof n.measureInWindow=="function"?n:null}function go(e){let t=Bl(e);if(t!==null)return t;if(e==null)return null;let n=e;if(typeof n.__nativeTag=="number")return n.__nativeTag;if(typeof n._nativeTag=="number")return n._nativeTag;if(typeof n.nativeTag=="number")return n.nativeTag;if(n.canonical){if(typeof n.canonical.__nativeTag=="number")return n.canonical.__nativeTag;if(typeof n.canonical._nativeTag=="number")return n.canonical._nativeTag;if(typeof n.canonical.nativeTag=="number")return n.canonical.nativeTag}return null}function Yl(e){let t=oi(e.stateNode);if(t)return{instance:t,nativeTag:go(e.stateNode),stateNode:e.stateNode};let n=[];e.child&&n.push(e.child);let o=0;for(;n.length>0&&o<4e3;){o++;let r=n.pop();if(!r)continue;let i=oi(r.stateNode);if(i)return{instance:i,nativeTag:go(r.stateNode),stateNode:r.stateNode};r.child&&n.push(r.child),r.sibling&&n.push(r.sibling)}return null}function Jl(e){let t=e,n=0;for(;t&&n++<200;){let o=t.stateNode;if(o&&typeof o.scrollTo=="function"){let r=typeof o.getNativeScrollRef=="function"&&o.getNativeScrollRef()||null,i=typeof o.getInnerViewNode=="function"&&o.getInnerViewNode()||typeof o.getScrollableNode=="function"&&o.getScrollableNode()||o;return{instance:o,nativeRef:r,innerNode:i}}t=t.return}return null}async function Ql(e,t,n,o){try{if(Wl(n))return n.scrollIntoView({block:"nearest",inline:"nearest",behavior:"instant"}),await new Promise(l=>setTimeout(l,16)),!0;let r=Jl(e);if(!r)return!1;let i=t,s=null,a=l=>new Promise(c=>{let u=!1,y=S=>{u||(u=!0,c(S))},v=setTimeout(()=>y(null),600);try{l(S=>{clearTimeout(v),y(S)})}catch{clearTimeout(v),y(null)}});if(r.nativeRef&&typeof i.measureLayout=="function"&&(s=await a(l=>i.measureLayout(r.nativeRef,(c,u)=>l(u),()=>l(null)))),s==null){let l=Je(t),c=typeof r.innerNode=="number"?r.innerNode:Je(r.innerNode);l!=null&&c!=null&&(s=await a(u=>$t.measureLayout(l,c,()=>u(null),(y,v)=>u(v))))}return s==null?!1:(r.instance.scrollTo({y:Math.max(0,s-o),animated:!1}),await new Promise(l=>setTimeout(l,120)),!0)}catch{return!1}}function ci(e){let t=e?.type;return t?typeof t=="string"?t:t.displayName||t.name||null:null}function Zl(e){let t=e?._debugOwner||e?.return,n=0;for(;t&&n<30;){n++;let o=ci(t);if(o&&!ai.has(o)&&typeof t.type!="string")return o;t=t.return}return null}function _e(e){return Fl(e?.stateNode,e?.memoizedProps??e?.pendingProps??null)}function ui(e,t=0){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isFinite(e))return String(e);if(Array.isArray(e)&&t<4){let n=[];for(let o of e){let r=ui(o,t+1);r&&n.push(r)}return n.length>0?n.join(""):void 0}}function ec(e){return e.replace(/\s+/g," ").trim()}function di(e){if(!e)return;let t=n=>{let o=ui(n);if(o===void 0)return;let r=ec(o);return r?r.slice(0,80):void 0};return t(e.children)??t(e.title)??t(e.label)??t(e.placeholder)??void 0}function tc(e,t){let n=[],o=(i,s)=>{if(!i||s>t||n.length>=4)return;if(i!==e){let l=_e(i);if(l&&(typeof l.onPress=="function"||typeof l.onLongPress=="function"))return}let a=di(_e(i));a&&!n.includes(a)&&n.push(a),i.child&&o(i.child,s+1),i!==e&&i.sibling&&o(i.sibling,s)};e.child&&o(e.child,1);let r=n.join(" ").trim();return r?r.slice(0,80):void 0}function nc(e){let t=e,n=0,o=null,r=null;for(;t&&n<25&&!(o&&r);){let i=_e(t);i&&(!o&&typeof i.onPress=="function"&&(o=i.onPress),!r&&typeof i.onLongPress=="function"&&(r=i.onLongPress)),t=t.return,n++}return o?{handler:o,kind:"onPress",longPress:r??void 0}:r?{handler:r,kind:"onLongPress"}:null}function mn(e){return new Promise(t=>{let n=!1,o=r=>{n||(n=!0,t(r))};setTimeout(()=>o(null),1e3);try{typeof e.measureInWindow=="function"?e.measureInWindow((r,i,s,a)=>{s>0&&a>0?o({x:r,y:i,width:s,height:a}):o(null)}):typeof e.measure=="function"?e.measure((r,i,s,a,l,c)=>{s>0&&a>0&&l!=null&&c!=null?o({x:l,y:c,width:s,height:a}):o(null)}):o(null)}catch{o(null)}})}var oc=new Set(["RCTActivityIndicatorView","AndroidProgressBar"]);function fo(){let e=li();if(e.length===0)return[];let t=[],n=new Map,o=new Map,r=jl();for(let i of e)Gt(i.current,s=>{let a=_e(s);if(!a)return;let l=typeof a.onPress=="function"||typeof a.onLongPress=="function",c=typeof a.onValueChange=="function",u=typeof a.onChangeText=="function",y=a.testID||void 0,v=a.accessibilityLabel||void 0,S=a.accessibilityRole||a.role||void 0,C=di(a),T=S==="button"||S==="link"||S==="menuitem"||S==="tab"||S==="switch"||S==="checkbox",h=typeof s.type=="string"&&oc.has(s.type)&&a.animating!==!1;if(!l&&!c&&!u&&!y&&!v&&!C&&!T&&!h)return;let f=null,m=null,R=null;if(c){let ne=a.value,w=typeof ne=="number"||typeof a.minimumValue=="number";m={handler:a.onValueChange,kind:w?"slider":"toggle",current:ne,min:typeof a.minimumValue=="number"?a.minimumValue:void 0,max:typeof a.maximumValue=="number"?a.maximumValue:void 0}}else u?R={handler:a.onChangeText,current:typeof a.value=="string"?a.value:void 0}:f=nc(s);let L=ci(s),D=L??"Unknown";(!L||ai.has(L)||typeof s.type=="string")&&(D=Zl(s)??L??"Unknown");let k=Yl(s);if(!k&&!y)return;!C&&!v&&l&&(C=tc(s,6));let U=k?.instance??null,ee=k?.nativeTag??null,G=(U?n.get(U):void 0)??(ee!=null?o.get(ee):void 0);if(G){!G.press&&f?G.press=f:G.press&&f?.longPress&&!G.press.longPress&&(G.press.longPress=f.longPress),!G.valueControl&&m&&(G.valueControl=m),!G.textControl&&R&&(G.textControl=R),!G.testID&&y&&(G.testID=y),!G.label&&v&&(G.label=v),!G.text&&C&&(G.text=C),U&&!n.has(U)&&n.set(U,G),ee!=null&&!o.has(ee)&&o.set(ee,G);return}let M={nativeTag:ee,name:D,role:S??(h?"progressbar":void 0),testID:y,label:v,text:C,instance:U,stateNode:k?.stateNode??null,fiber:s,press:f,valueControl:m,textControl:R,rect:null,buoy:r(s)};t.push(M),U&&n.set(U,M),ee!=null&&o.set(ee,M)});return t}function rc(e,t){return t.nativeTag!=null?e.nativeTag===t.nativeTag:t.testID&&e.testID?e.testID.toLowerCase()===t.testID.toLowerCase():!1}function pi(e){let t=fo();return e.includeBuoy?t:t.filter(n=>!n.buoy||rc(n,e))}async function gi(e){await Promise.all(e.map(async t=>{t.instance&&(t.rect=await mn(t.instance))}))}async function hn(e={}){let t=fo(),n=e.includeBuoy?t:t.filter(l=>!l.buoy),o=t.length-n.length;await gi(n);let r=Qe.get("window"),i=Math.round(r.width)||1,s=Math.round(r.height)||1,a=[];for(let l of n){let c=l.rect;if(!c&&!l.testID)continue;let u,y;if(c){let C=c.x+c.width/2,T=c.y+c.height/2;if(T<-s*.1||T>s*1.1||C<-i*.1||C>i*1.1)continue;u={x:ht(C/i),y:ht(T/s)},y={x:ht(c.x/i),y:ht(c.y/s),width:ht(c.width/i),height:ht(c.height/s)}}let v=l.valueControl?l.valueControl.kind:l.textControl?"text":void 0,S=l.valueControl?l.valueControl.current:l.textControl?.current;a.push({nativeTag:l.nativeTag,name:l.name,role:l.role,testID:l.testID,label:l.label,text:l.text,interactive:!!(l.press||l.valueControl||l.textControl),longPressable:l.press&&(l.press.kind==="onLongPress"||l.press.longPress)?!0:void 0,control:v,value:S,tap:u,frame:y})}return a.sort((l,c)=>{let u=l.tap?.y??2,y=c.tap?.y??2;return Math.abs(u-y)>.02?u-y:(l.tap?.x??2)-(c.tap?.x??2)}),{screen:{width:i,height:s},count:a.length,elements:a,...o>0?{hiddenBuoy:o}:{}}}function ht(e){return Math.round(e*100)/100}function fi(e){return{nativeTag:e.nativeTag,testID:e.testID,label:e.label,text:e.text,name:e.name}}function mi(e,t){return Ut(fi(e),t)}function ri(e,t,n){if(!(!e||!t||!n))return{x:(e.x+e.width/2)/t,y:(e.y+e.height/2)/n}}function ii(e){let t=e?e.x+e.width/2:0,n=e?e.y+e.height/2:0;return{nativeEvent:{locationX:e?e.width/2:0,locationY:e?e.height/2:0,pageX:t,pageY:n,timestamp:0,target:null,identifier:1,touches:[],changedTouches:[]},persist:()=>{},preventDefault:()=>{},stopPropagation:()=>{},isDefaultPrevented:()=>!1,isPropagationStopped:()=>!1,target:null,currentTarget:null,type:"press",timeStamp:0}}async function hi(e){let t=pi(e);if(t.length===0)return{tapped:!1,reason:"No React fiber roots / elements found on screen."};let n=t.map(m=>({c:m,score:mi(m,e)})).filter(m=>m.score>0).sort((m,R)=>R.score-m.score),o=m=>!!(m.press||m.valueControl||m.textControl);if(n.length===0)return{tapped:!1,reason:"No element matched. Call describe_screen to see available elements (match by testID, text, or name).",candidates:t.filter(o).slice(0,12).map(m=>({nativeTag:m.nativeTag,name:m.name,testID:m.testID,text:m.text}))};let r=Qe.get("window"),i=r.width||1,s=r.height||1,a=n.slice(0,15);await Promise.all(a.map(async m=>{m.c.instance&&!m.c.rect&&(m.c.rect=await mn(m.c.instance))}));for(let m of a)m.score=Ut({...fi(m.c),tap:ri(m.c.rect,i,s)},e);a.sort((m,R)=>R.score-m.score);let l=a.find(m=>o(m.c))??n.find(m=>o(m.c))??a[0],c=l.c,u=(m,R)=>m.press&&m.press.handler===R.press?.handler||m.valueControl&&m.valueControl.handler===R.valueControl?.handler||m.textControl&&m.textControl.handler===R.textControl?.handler,y=a.filter(m=>m!==l&&o(m.c)&&m.score===l.score).filter(m=>!u(m.c,c)).filter((m,R,L)=>L.findIndex(D=>u(D.c,m.c))===R).slice(0,3).map(m=>({nativeTag:m.c.nativeTag,name:m.c.name,testID:m.c.testID,text:m.c.text,tap:ri(m.c.rect,i,s)}));if(!o(c))return{tapped:!1,reason:`Matched "${c.name}"${c.text?` ("${c.text}")`:""} but it has no onPress / onValueChange / onChangeText handler (e.g. a react-native-gesture-handler GestureDetector). This element can't be driven in JS.`,matched:{nativeTag:c.nativeTag,name:c.name,testID:c.testID,label:c.label,text:c.text,via:"onPress"}};c.instance&&!c.rect&&(c.rect=await mn(c.instance));let v=!1;(c.rect==null||!fn(c.rect,i,s))&&e.scrollIntoView!==!1&&c.instance&&(v=await Ql(c.fiber,c.instance,c.stateNode,80),v&&(c.rect=await mn(c.instance)));let C={nativeTag:c.nativeTag,name:c.name,testID:c.testID,label:c.label,text:c.text};Gl();let T=po,h=Date.now(),f=async m=>(await new Promise(R=>setTimeout(R,Kl)),{tapped:!0,scrolled:v,matched:m,effect:{commits:po-T,observedMs:Date.now()-h},...y.length?{alsoMatched:y}:{}});try{if(c.press){if(e.longPress){let R=c.press.kind==="onLongPress"?c.press.handler:c.press.longPress;return R?(R(ii(c.rect)),await f({...C,via:"onLongPress"})):{tapped:!1,scrolled:v,reason:`Matched "${c.name}"${c.text?` ("${c.text}")`:""} but it has no onLongPress handler \u2014 call tap_element without longPress to tap it normally.`,matched:{...C,via:"onPress"}}}return c.press.handler(ii(c.rect)),await f({...C,via:c.press.kind})}if(c.valueControl){let R=c.valueControl,L;if(R.kind==="toggle")L=typeof e.value=="boolean"?e.value:!R.current;else{let D=R.min??0,k=R.max??1;typeof e.value=="number"?L=Math.min(k,Math.max(D,e.value)):L=R.current===k?D:k}return R.handler(L),await f({...C,via:"onValueChange",value:L})}let m=e.text??(typeof e.value=="string"?e.value:"");return c.textControl.handler(m),await f({...C,via:"onChangeText",value:m})}catch(m){return{tapped:!1,scrolled:v,reason:`handler threw: ${m instanceof Error?m.message:String(m)}`,matched:{...C,via:c.press?c.press.kind:c.valueControl?"onValueChange":"onChangeText"}}}}var ic=5e3,ac=3e4,sc=50,lc=150;async function yi(e){if(!(e.nativeTag!=null||!!String(e.testID??"").trim()||!!String(e.query??"").trim()))return{ok:!1,waitedMs:0,polls:0,reason:"Nothing to wait for \u2014 pass nativeTag, testID or query."};let n=Math.min(Math.max(e.timeoutMs??ic,0),ac),o=Math.max(e.pollMs??lc,sc),r=e.gone===!0,i=Date.now(),s=0;for(;;){s+=1;let{hit:a,closest:l}=await cc(e);if(r?!a:a)return{ok:!0,waitedMs:Date.now()-i,polls:s,matched:a??void 0};if(Date.now()-i>=n){let c=l?.length?l:void 0,u=r?`Still on screen after ${n}ms.`:c?`Not on screen after ${n}ms \u2014 ${c.length===1?"one element":`${c.length} elements`} matched but ${c.some(y=>y.onScreen)?"not well enough":"none is visible"}. See \`closest\`; do not retry with different words, call describeScreen.`:`Not on screen after ${n}ms, and nothing matched those words at all. Call describeScreen to see what is there.`;return{ok:!1,waitedMs:Date.now()-i,polls:s,reason:u,matched:a??void 0,closest:c}}await new Promise(c=>setTimeout(c,o))}}async function cc(e){let t=pi(e).map(a=>({c:a,score:mi(a,e)})).filter(a=>a.score>0).sort((a,l)=>l.score-a.score).slice(0,8);if(t.length===0)return{hit:null,closest:void 0};await gi(t.map(a=>a.c));let n=Qe.get("window"),o=Math.round(n.width)||1,r=Math.round(n.height)||1,i=null;for(let{c:a}of t)if(fn(a.rect,o,r)){i={nativeTag:a.nativeTag,name:a.name,testID:a.testID,label:a.label,text:a.text,interactive:!!(a.press||a.valueControl||a.textControl)};break}let s=t.slice(0,3).map(({c:a})=>({name:a.name,testID:a.testID,text:a.text,onScreen:fn(a.rect,o,r)}));return{hit:i,closest:s}}function uc(e){let t=e,n=0;for(;t&&n<400;){if(_e(t)?.__buoyDevToolsRoot)return!0;t=t.return,n++}return!1}function dc(e,t){let n=_e(e.fiber);if(typeof n?.onPress=="function"||typeof n?.onValueChange=="function"||typeof n?.onChangeText=="function")return e;let o=null,r=e.fiber?.return,i=0;for(;r&&i<25;){if(typeof _e(r)?.onPress=="function"){o=r;break}r=r.return,i++}if(!o)return e;let s=o;for(let a=0;a<6&&s;a++){let l=t.get(s);if(l)return l;s=s.return}return e}function mo(e){let t=fo();if(t.length===0)return null;let n=new Map;for(let a of t)n.set(a.fiber,a);let o=t.find(a=>a.nativeTag===e),r=null;if(!o){for(let a of li())if(Gt(a.current,l=>{r||l.stateNode&&go(l.stateNode)===e&&(r=l)}),r)break}let i=o??null;if(!i&&r){let a=r,l=0,c=null;for(;a&&l<25;){let u=n.get(a);if(u){if(u.press||u.valueControl||u.textControl){i=u;break}c||(c=u)}a=a.return,l++}i||(i=c)}if(!i||(i=dc(i,n),!i.press&&!i.valueControl&&!i.textControl)||uc(i.fiber))return null;let s=i.valueControl?i.valueControl.kind:i.textControl?"text":"press";return{nativeTag:i.nativeTag,name:i.name,role:i.role,testID:i.testID,label:i.label,text:i.text,control:s,value:i.valueControl?i.valueControl.current:i.textControl?i.textControl.current:void 0}}Wt();P();P();function pc(e){return!!e&&typeof e=="object"&&("next"in e||"queue"in e||"memoizedState"in e)}function ho(e,t,n){if(e===t)return!1;if(n?.isClassComponent||!pc(t))return!0;let o=e,r=t;for(let i=0;r!=null&&i<64;i++){if(r.queue!=null&&(o==null||!Object.is(o.memoizedState,r.memoizedState)))return!0;r=r.next,o=o!=null?o.next:null}return!1}function bi(e,t){return ho(e?.memoizedState,t?.memoizedState,{isClassComponent:t?.tag===1})}var yo={RCTText:{alwaysTrack:["children"],skip:[],description:"Text component - children is the displayed content"},RCTVirtualText:{alwaysTrack:["children"],skip:[],description:"Virtual Text (nested) - children is the displayed content"},RCTView:{alwaysTrack:[],skip:["children"],description:"View container - children are React elements"},RCTImageView:{alwaysTrack:["source"],skip:["children"],description:"Image - source contains the image URL/require"},RCTTextInput:{alwaysTrack:["value","defaultValue"],skip:["children"],description:"TextInput - value is the input content"},RCTSwitch:{alwaysTrack:["value"],skip:["children"],description:"Switch - value is the toggle state"},default:{alwaysTrack:[],skip:["children"],description:"Unknown component type"}};function gc(e){return e&&yo[e]||yo.default}var Cn=new WeakMap;function bo(e){if(!e)return;let t=Cn.get(e);if(t||e.alternate&&(t=Cn.get(e.alternate),t))return t}function fc(e,t){e&&(Cn.set(e,t),e.alternate&&Cn.set(e.alternate,t))}var Ie=new Map,To=500,mc=10,vo=50,Si=50,hc=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","Fragment","Suspense","Provider","Consumer","Context","ForwardRef","Unknown","Component"]);function xi(e){return!!(!e||hc.has(e)||e.startsWith("Animated"))}function Ri(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,o=null;for(;t&&n<30;){let r=t.tag;if(r===0||r===1||r===11||r===15){let i=Fe(t);if(o||(o=t),!xi(i))return t}t=t.return,n++}return o}function Fe(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.name)return t.name;if(t.displayName)return t.displayName}return null}function yc(e){if(!e||typeof e!="object")return"unknown";if(e.queue!==null&&e.queue!==void 0)return"useState";let t=e.memoizedState;if(t!==null&&typeof t=="object"&&!Array.isArray(t)&&"current"in t&&Object.keys(t).length===1)return"useRef";if(Array.isArray(t)&&t.length===2){let[,n]=t;if(Array.isArray(n)||n===null)return typeof t[0]=="function"?"useCallback":"useMemo"}return t!==null&&typeof t=="object"&&!Array.isArray(t)&&("tag"in t||"create"in t||"destroy"in t)?"useEffect":"unknown"}function bc(e,t){let n=e?.memoizedState;switch(t){case"useState":case"useReducer":return n;case"useRef":return n?.current;case"useMemo":case"useCallback":return Array.isArray(n)?n[0]:n;case"useEffect":return"[effect]";default:return n}}function bt(e){if(!e?.memoizedState)return null;let t=e.memoizedState;if(typeof t!="object"||t===null||!("next"in t)&&!("queue"in t)&&!("memoizedState"in t))return null;let n=[],o=t,r=0;for(;o!==null&&r<vo;){let i=yc(o),s=bc(o,i);n.push({index:r,type:i,value:s,rawState:o.memoizedState}),o=o.next,r++}return n.length>0?n:null}function Tc(e,t){if(!e||!t)return null;let n=[],o=Math.max(e.length,t.length);for(let r=0;r<o;r++){let i=e[r],s=t[r];if(!i&&s){n.push({index:r,type:s.type,currentValue:yn(s.value,s.type),description:`Hook[${r}] added`});continue}if(i&&!s){n.push({index:r,type:i.type,previousValue:yn(i.value,i.type),description:`Hook[${r}] removed`});continue}if(i&&s){if(i.rawState===s.rawState||s.type==="useEffect"||s.type==="useMemo"||s.type==="useCallback")continue;if(s.type==="useState"||s.type==="useReducer"||s.type==="useRef"){let a=yn(i.value,i.type),l=yn(s.value,s.type);n.push({index:r,type:s.type,previousValue:a,currentValue:l,description:`${a} \u2192 ${l}`})}}}return n.length>0?n:null}function yn(e,t){return Ze(e)}function Ze(e){if(e===null)return null;if(e!==void 0)return typeof e=="boolean"||typeof e=="number"?e:typeof e=="string"?e.length>30?e.slice(0,30)+"...":e:typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`{Object: ${Object.keys(e).length} keys}`:String(e)}function Cc(e){if(!e)return{cause:"unknown",hookChanges:null};let t=e,n=e.alternate,o=bo(e);if(o&&n){let c=bt(e),u=bt(n),y=o.extractedHooks;if(c&&u&&y&&y.length>0){let v=y.find(S=>S.type==="useState");if(v){let S=c.find(T=>T.index===v.index),C=u.find(T=>T.index===v.index);if(S&&C){let T=S.value===v.value,h=C.value===v.value;T&&!h&&(t=n,n=e)}}}}let r=bt(t),i=null,s=null,a=null;return n?(i=n.memoizedProps,s=n.memoizedState,a=bt(n)):o&&(i=o.memoizedProps,s=o.memoizedState,a=o.extractedHooks),fc(t,{memoizedProps:t.memoizedProps,memoizedState:t.memoizedState,extractedHooks:r}),i===null?{cause:"mount",hookChanges:null}:Co(i,t.memoizedProps)?ho(s,t.memoizedState,{isClassComponent:t.tag===1})?{cause:"state",hookChanges:Tc(a,r)}:{cause:"parent",hookChanges:null}:{cause:"props",hookChanges:null}}function Co(e,t){if(e===t)return!0;if(!e||!t||typeof e!="object"||typeof t!="object")return!1;let n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function yt(e,t=3){let n=new WeakSet;function o(r,i){if(i>t)return"[MAX_DEPTH]";if(r===null)return null;if(r===void 0)return;if(typeof r=="function")return`[Function: ${r.name||"anonymous"}]`;if(typeof r=="symbol")return`[Symbol: ${r.toString()}]`;if(typeof r!="object")return r;if(n.has(r))return"[Circular]";if(n.add(r),Array.isArray(r))return r.slice(0,10).map(l=>o(l,i+1));let s={},a=Object.keys(r).slice(0,20);for(let l of a)try{s[l]=o(r[l],i+1)}catch{s[l]="[Error accessing]"}return s}return o(e,0)}function Kt(e){return e===void 0?"undefined":{0:"FunctionComponent",1:"ClassComponent",2:"IndeterminateComponent",3:"HostRoot",4:"HostPortal",5:"HostComponent",6:"HostText",7:"Fragment",8:"Mode",9:"ContextConsumer",10:"ContextProvider",11:"ForwardRef",12:"Profiler",13:"SuspenseComponent",14:"MemoComponent",15:"SimpleMemoComponent"}[e]||`Unknown(${e})`}function vc(e,t){if(!(!t.hookChanges||t.hookChanges.length===0))for(let n of t.hookChanges)console.log(`[${e||"Unknown"}] ${n.type}[${n.index}]: ${n.previousValue} \u2192 ${n.currentValue}`)}function wc(e,t,n,o,r){let i=Fe(n)||"Unknown",s=typeof t?.type=="string"?t.type:"Unknown",{cause:a,hookChanges:l}=o;if(console.log(`[RENDER] ${i} (${s}:${e}) | Cause: ${a.toUpperCase()}`+(r&&r.length>0?` | Props: [${r.join(", ")}]`:"")),l&&l.length>0)for(let c of l)console.log(` \u2514\u2500 ${c.type}[${c.index}]: ${c.previousValue} \u2192 ${c.currentValue}`)}function Ti(e,t,n,o,r,i,s){let a=Fe(n)||"Unknown",l=typeof t?.type=="string"?t.type:"Unknown";console.log(`
28
+ [RN-BUOY RENDER DEBUG] \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550`),console.log(`Render #${s} for ${l} (nativeTag: ${e})`),console.log(`Timestamp: ${new Date().toISOString()}`),console.log(`\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
29
+ `),console.log(`NATIVE FIBER (${l}):`),console.log(` type: "${t?.type}"`),console.log(` tag: ${t?.tag} (${Kt(t?.tag)})`);let c=t?.alternate;console.log(` Previous values source: ${c?"alternate":o?"storage":"none"}`);let y=t?.memoizedProps?.children,v=c?.memoizedProps?.children,S=v!==void 0?v:o?.memoizedProps?.children,C=S!==void 0?y!==S:!1;console.log(` memoizedProps.children: ${Ze(y)}${C?` (was: ${Ze(S)})`:S!==void 0?" (unchanged)":" (first render)"}`);let T=t?.memoizedProps?.style,h=c?.memoizedProps?.style,f=h!==void 0?h:o?.memoizedProps?.style,m=f!==void 0?T!==f:!1;if(T&&(console.log(` memoizedProps.style: ${JSON.stringify(yt(T,2))}${m?" (REFERENCE CHANGED)":""}`),m&&f)){let M=vn(T,f);console.log(` \u2514\u2500 Values actually changed: ${!M}`)}console.log(` All memoizedProps keys: [${Object.keys(t?.memoizedProps||{}).join(", ")}]`);let R=t?.memoizedProps?.testID,L=t?.memoizedProps?.nativeID,D=t?.memoizedProps?.accessibilityLabel;if(R&&console.log(` testID: "${R}"`),L&&console.log(` nativeID: "${L}"`),D&&console.log(` accessibilityLabel: "${D}"`),console.log(` alternate: ${c?"YES":"NO"}`),c&&console.log(` alternate.memoizedProps.children: ${Ze(v)}`),console.log(" Tree structure:"),console.log(` return (parent): ${t?.return?Kt(t.return.tag):"null"}`),console.log(` child: ${t?.child?Kt(t.child.tag):"null"}`),console.log(` sibling: ${t?.sibling?Kt(t.sibling.tag):"null"}`),console.log(""),console.log(`COMPONENT FIBER (${a}):`),n){if(console.log(` name: "${a}"`),console.log(` type: ${typeof n.type} (${n.type?.name||n.type?.displayName||"anonymous"})`),console.log(` tag: ${n.tag} (${Kt(n.tag)})`),console.log(` memoizedProps: ${JSON.stringify(yt(n.memoizedProps,2))}`),console.log(` alternate: ${n.alternate?"YES":"NO"}`),n.alternate){console.log(` ALTERNATE memoizedProps: ${JSON.stringify(yt(n.alternate.memoizedProps,2))}`);let H=!Co(n.alternate.memoizedProps,n.memoizedProps);console.log(` Props changed (vs alternate): ${H?"YES":"NO"}`),console.log(` ALTERNATE memoizedState: ${n.alternate.memoizedState===n.memoizedState?"SAME":"DIFFERENT"}`)}let M=bo(n);if(M){console.log(` WeakMap PREVIOUS memoizedProps: ${JSON.stringify(yt(M.memoizedProps,2))}`);let H=!Co(M.memoizedProps,n.memoizedProps);console.log(` Props changed (vs WeakMap): ${H?"YES":"NO"}`)}else console.log(" WeakMap PREVIOUS state: (not found - first render or WeakMap cleared)");if(n._debugOwner){let H=Fe(n._debugOwner);console.log(` _debugOwner: "${H}"`);let pe=n._debugOwner,ye=1;for(;pe&&ye<5;){let Ve=Fe(pe);console.log(` \u2514\u2500[${ye}] ${Ve||"unknown"} (tag: ${pe.tag})`),pe=pe._debugOwner,ye++}}let ne=0,w=t._debugOwner||t.return;for(;w&&w!==n&&ne<30;)w=w.return,ne++;console.log(` Depth from native fiber: ${ne}`)}else console.log(" (No component fiber found - could not walk up tree)");if(console.log(""),console.log("HOOKS:"),n?.memoizedState){let M=bt(n),ne=n.alternate?bt(n.alternate):null,w=bo(n),H=ne||w?.extractedHooks,pe=ne?"alternate":w?"WeakMap":"none";M&&M.length>0?(console.log(` Total hooks: ${M.length}`),console.log(` Previous values source: ${pe}`),M.forEach((ye,Ve)=>{let je=H?.[Ve],pt=je?je.rawState!==ye.rawState:!1,sn=je?Ze(je.value):"N/A",ln=pt?" \u2190 CHANGED":"";console.log(` [${Ve}] ${ye.type}: ${Ze(ye.value)}${je?` (was: ${sn})`:" (first render)"}${ln}`)})):(console.log(" (Could not extract hooks - memoizedState structure not recognized)"),console.log(` Raw memoizedState type: ${typeof n.memoizedState}`),console.log(` Has 'next' property: ${"next"in(n.memoizedState||{})}`),console.log(` Has 'queue' property: ${"queue"in(n.memoizedState||{})}`))}else console.log(" (No memoizedState - class component, no hooks, or not a function component)");if(console.log(""),console.log("RAW HOOKS DATA:"),n?.memoizedState&&typeof n.memoizedState=="object"){let M=n.memoizedState,ne=0;for(;M&&ne<10;)console.log(` Hook[${ne}]:`),console.log(` memoizedState: ${yt(M.memoizedState,2)}`),console.log(` baseState: ${yt(M.baseState,2)}`),console.log(` queue: ${M.queue?"[Queue present]":"null"}`),console.log(` next: ${M.next?"[Next hook]":"null"}`),M=M.next,ne++;ne===0&&console.log(" (memoizedState is not a hooks linked list)")}console.log(""),console.log("DETECTION RESULTS:"),console.log(` Component Cause: ${r.cause.toUpperCase()}`),r.hookChanges&&r.hookChanges.length>0&&(console.log(" Hook Changes Detected:"),r.hookChanges.forEach(M=>{console.log(` [${M.index}] ${M.type}: ${M.previousValue} \u2192 ${M.currentValue}`),M.description&&console.log(` ${M.description}`)}));let k=typeof t?.type=="string"?t.type:void 0,U=Ii(o?.memoizedProps,t?.memoizedProps,k);U&&U.length>0?console.log(` Native Props Changed: [${U.join(", ")}]`):o&&console.log(" Native Props Changed: (none detected)"),console.log(""),console.log("BATCH CONTEXT:"),console.log(` Batch size: ${i.size}`),console.log(` All tags in batch: [${Array.from(i).slice(0,20).join(", ")}${i.size>20?"...":""}]`);let ee=ki(t),G=ee!==null&&i.has(ee);if(console.log(` Parent nativeTag: ${ee??"not found"}`),console.log(` Parent in batch: ${G?"YES":"NO"}`),i.size>1){console.log(" Components in same batch:");let M=t?.return,ne=0;for(;M&&ne<10;){let w=Di(M.stateNode);if(w!==null&&i.has(w)){let H=Fe(M)||M.type;console.log(` [depth ${ne}] ${H} (tag: ${w})`)}M=M.return,ne++}}console.log(`
30
+ \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
31
+ `)}function wn(e,t,n,o="off"){let r=Date.now();if(!t)return{type:"unknown",timestamp:r};let i=t,s=t.alternate,a=Ie.get(e);if(a&&s){let k=a.memoizedProps?.children,U=t.memoizedProps?.children,ee=s.memoizedProps?.children,G=t.memoizedProps===a.memoizedProps||k!==void 0&&U===k,M=s.memoizedProps===a.memoizedProps||k!==void 0&&ee===k;G&&!M&&(i=s,s=t,o==="all"&&console.log("[RenderCause] Detected fiber swap - using alternate as current"))}let l=null,c=null;s?(l=s.memoizedProps,c=s.memoizedState):a&&(l=a.memoizedProps,c=a.memoizedState);let u=l!==null?{memoizedProps:l,memoizedState:c,timestamp:r}:void 0,y={memoizedProps:i.memoizedProps,memoizedState:i.memoizedState,timestamp:r};Ic(e,y);let v=Ri(i),S=Fe(v)||void 0,C=Rc(i,S)||void 0,T=Cc(v),h=T.cause,f=T.hookChanges;if(!u){if(o!=="off"){if(o==="minimal")console.log(`[${S||"Unknown"}] MOUNT`);else if(o==="verbose"){let k=typeof i?.type=="string"?i.type:"Unknown";console.log(`[RENDER] ${S||"Unknown"} (${k}:${e}) | Cause: MOUNT`)}else if(o==="all"){let k=Ie.has(e)?Ie.size:1;Ti(e,i,v,u,T,n,k)}}return{type:"mount",timestamp:r,componentCause:"mount",componentName:S}}let m=typeof i.type=="string"?i.type:void 0,R=Ii(u.memoizedProps,y.memoizedProps,m);if(o!=="off"){if(o==="minimal")vc(S,T);else if(o==="verbose")wc(e,i,v,T,R);else if(o==="all"){let k=Ie.has(e)?Ie.size:1;Ti(e,i,v,u,T,n,k)}}if(R&&R.length>0)return{type:"props",changedKeys:R.slice(0,mc),timestamp:r,componentCause:h,componentName:S,parentComponentName:C,hookChanges:f||void 0};let L=Sc(u.memoizedState,y.memoizedState);if(L&&L.length>0)return{type:"hooks",hookIndices:L,timestamp:r,componentCause:h,componentName:S,parentComponentName:C,hookChanges:f||void 0};let D=ki(i);return D&&n.has(D)?{type:"parent",timestamp:r,componentCause:h,componentName:S,parentComponentName:C,hookChanges:f||void 0}:h==="state"?{type:"state",timestamp:r,componentCause:h,componentName:S,parentComponentName:C,hookChanges:f||void 0}:h==="props"?{type:"props",timestamp:r,componentCause:h,componentName:S,parentComponentName:C}:h==="parent"?{type:"parent",timestamp:r,componentCause:h,componentName:S,parentComponentName:C}:{type:"unknown",timestamp:r,componentCause:h,componentName:S,parentComponentName:C}}function Ii(e,t,n){if(e===t||!e||!t||typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t))return null;let o=gc(n),r=new Set([...Object.keys(e),...Object.keys(t)]),i=[];for(let s of r)if(!s.startsWith("__")&&!o.skip.includes(s)){if(s==="children"){if(!o.alwaysTrack.includes("children"))continue;let a=e[s],l=t[s];a!==l&&(Ci(a)&&Ci(l)?i.push(`children: ${vi(a)} \u2192 ${vi(l)}`):i.push("children (content)"));continue}if(e[s]!==t[s]){let a=e[s],l=t[s];s==="style"?vn(a,l)?i.push(`${s} (ref only)`):i.push(s):typeof a=="function"&&typeof l=="function"?i.push(`${s} (fn ref)`):i.push(s)}}return i.length>0?i:null}function vn(e,t,n=0){if(n>5)return!1;if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e!="object"||e===null||t===null)return e===t;if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!vn(e[i],t[i],n+1))return!1;return!0}let o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;for(let i of o)if(!r.includes(i)||!vn(e[i],t[i],n+1))return!1;return!0}function Ci(e){return e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}function vi(e){return e===null?"null":e===void 0?"undefined":typeof e=="string"?e.length>20?`"${e.slice(0,20)}..."`:`"${e}"`:typeof e=="number"||typeof e=="boolean"?String(e):"[object]"}function Sc(e,t){if(e===t||e==null||t==null||typeof e!="object"||typeof t!="object")return null;let n=[],o=e,r=t,i=0;for(;r!==null&&i<vo;)(o===null||xc(o,r))&&n.push(i),r=r?.next??null,o=o?.next??null,i++;return n.length>0?n:null}function xc(e,t){return e===t?!1:e.memoizedState!==t.memoizedState||e.baseState!==void 0&&e.baseState!==t.baseState}function ki(e){let t=e?.return,n=0;for(;t&&n<Si;){if(t.stateNode){let o=Di(t.stateNode);if(o!=null)return o}t=t.return,n++}return null}function Rc(e,t){if(!e)return null;let n=Ri(e);if(!n)return null;let o=n.return,r=0;for(;o&&r<Si;){let i=o.tag;if(i===0||i===1||i===11||i===15){let s=Fe(o);if(s&&!xi(s)&&s!==t)return s}o=o.return,r++}return null}function Di(e){return e?typeof e.__nativeTag=="number"?e.__nativeTag:typeof e._nativeTag=="number"?e._nativeTag:typeof e.canonical?.__nativeTag=="number"?e.canonical.__nativeTag:typeof e.canonical?.publicInstance?.__nativeTag=="number"?e.canonical.publicInstance.__nativeTag:null:null}function Ic(e,t){if(Ie.size>=To){let n=Array.from(Ie.entries());n.sort((r,i)=>r[1].timestamp-i[1].timestamp);let o=Math.floor(To/4);for(let r=0;r<o;r++)Ie.delete(n[r][0])}Ie.set(e,t)}function wo(){Ie.clear()}function kc(e){Ie.delete(e)}function Dc(){return{storedStates:Ie.size,maxStates:To}}var Pc=5,wi=200,bn=20,Tn=30;function Be(e,t=0,n=new WeakSet){if(e==null||typeof e=="boolean"||typeof e=="number")return e;if(typeof e=="string")return e.length>wi?e.slice(0,wi)+"...":e;if(typeof e=="function")return`[Function: ${e.name||"anonymous"}]`;if(typeof e=="symbol")return`[Symbol: ${e.description||""}]`;if(t>=Pc)return Array.isArray(e)?`[Array: ${e.length} items]`:typeof e=="object"?`[Object: ${Object.keys(e).length} keys]`:"[...]";if(typeof e=="object"){if(n.has(e))return"[Circular]";n.add(e)}if(Array.isArray(e)){let o=e.slice(0,bn).map(r=>Be(r,t+1,n));return e.length>bn&&o.push(`[...${e.length-bn} more]`),o}if(e instanceof Date)return e.toISOString();if(e instanceof Error)return`[Error: ${e.message}]`;if(e instanceof RegExp)return e.toString();if(e instanceof Map){let o={__type:"Map",__size:e.size},r=0;for(let[i,s]of e){if(r>=Tn){o[`...${e.size-r} more`]=!0;break}let a=typeof i=="string"?i:String(i);o[a]=Be(s,t+1,n),r++}return o}if(e instanceof Set)return{__type:"Set",__size:e.size,values:Array.from(e).slice(0,bn).map(o=>Be(o,t+1,n))};if(typeof e=="object"){let o={},r=Object.keys(e),i=r.slice(0,Tn);for(let s of i)if(!(s.startsWith("__")||s==="children"))try{o[s]=Be(e[s],t+1,n)}catch{o[s]="[Error accessing property]"}return r.length>Tn&&(o[`...${r.length-Tn} more keys`]=!0),o}return"[Unknown type]"}function Vc(e){if(e?.memoizedProps)return Be(e.memoizedProps)}function Lc(e){if(!e?.memoizedState)return;let t=e.memoizedState;if(typeof t=="object"&&t!==null&&"next"in t){let n=[],o=t,r=0;for(;o&&r<vo;)n.push({index:r,memoizedState:Be(o.memoizedState)}),o=o.next,r++;return{__type:"Hooks",hooks:n}}return Be(t)}import{notifySubscriberCountChange as Oi}from"@buoy-gg/shared-ui/web";P();var xn=new Set(["HighlightUpdatesOverlay","HighlightUpdatesModal","HighlightFilterView","RenderDetailView","RenderListItem","RenderListItemInner","RenderHistoryViewer","RenderHistoryFooter","RenderCauseBadge","TwoLevelCauseBadge","EnhancedCauseDisplay","IsolatedRenderList","IsolatedRenderListInner","StatsDisplay","StatsDisplayInner","CurrentStateView","EventStepperFooter","EventsModal","UnifiedEventList","UnifiedEventItem","UnifiedEventDetail","UnifiedEventFilters","UnifiedEventViewer","ReactQueryEventDetail","EventsCopySettingsView"]),Tt=["HighlightUpdates","RenderList","RenderDetail","RenderHistory","RenderCause","EventStepper","UnifiedEvent","EventsModal","EventsCopy"],So=new Set(["JsModalComponent","JsModal","TypePicker","PatternInput","PatternChip","DetectedItemsSection","DetectedCategoryBadge","IdentifierBadge","CategoryBadge","AppRenderer","AppOverlay","FloatingTools","DialDevTools","DevToolsVisibilityProvider","AppHostProvider","MinimizedToolsProvider","ModalHeader","TabSelector","SectionHeader","DraggableHeader","WindowControls","TreeDiffViewer","DataViewer","SplitDiffViewer","VirtualizedDataExplorer","DiffSummary","TypeLegend","IndentGuides","IndentGuidesOverlay","CyberpunkInput","DiffView","AnswerCard","DetailsSection","DetailRow","QuickActionsSection","FilterOptionCard","SearchSection","SearchSectionInner","HeaderActions","HeaderActionsInner","MainListHeader","FilterViewHeader","DetailViewHeader","FloatingMenu","FloatingDevTools","MinimizedToolsStack","MinimizedToolsContext","GlitchToolButton","ExpandablePopover","CollapsedPeek","ExpandedWrapper","DialIcon","DialMenu","DialIconItem","OnboardingTooltip","MenuLauncherIcon","DevToolsSettingsModal","SettingsModal","ImageOverlayModal","ImageOverlayStandalone","ToolCard","ToolIcon","GripVerticalIcon","UserStatus","Divider","ChevronDown","ChevronUp","ChevronLeft","ChevronRight","ChevronDownIcon","ChevronUpIcon","ChevronLeftIcon","ChevronRightIcon","LogBox","LogBoxLog","LogBoxLogNotification","LogBoxNotificationContainer","_LogBoxNotificationContainer","LogBoxInspector","LogBoxInspectorContainer","LogBoxInspectorHeader","LogBoxInspectorBody","LogBoxInspectorFooter","LogBoxInspectorMessageHeader","LogBoxInspectorStackFrame","LogBoxInspectorSection","LogBoxButton","LogBoxMessage","PerfMonitorOverlay","PerfMonitorModal","PerfMonitorRoot","PerfHudInline","PerfDiagnostics","MetricSparkline","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","PerfHudInlineInner","PerfMonitorOverlayInner","MiniMetric","MetricRow","MetricNumber","MetricSparklineInner","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection","TaskTable","TaskRow","BusySparkline"]),Sn=["JsModal","ImageOverlay","PerfMonitor","PerfHud","JsTop"],xo=new Set(["VirtualizedDataExplorer","TreeDiffView","TreeDiffRow","DataViewer","DiffView","DiffSummary","FloatingDevTools","FloatingMenu","FloatingBubble","MinimizedDock","DialMenu","DialItem","ExpandableSection","ChevronIcon","GlitchText","SettingsModal","SettingsRow","OnboardingFlow","DevToolsMenu"]),Ro=!1;function Ec(e){Ro=e}function Io(){return Ro}var Nc=new Set(["PerfHudInline","PerfHudInlineInner","PerfDiagnostics","MetricSparkline","MetricSparklineInner","JsFallbackNotice","AutomationConfigView","AutomationProgressOverlay","AutomationResumer","SaveBenchmarkPrompt","SavedCasesModal","BatchBarReport","BatchReportView","MiniMetric","MetricRow","MetricNumber","RecColumn","PillBody","FullBody","TargetLine","PagesSection","ProbesSection"]);function ko(e){return e.startsWith("PerfMonitor")||e.startsWith("PerfHud")||Nc.has(e)}var Hc=new Set(["TaskTable","TaskRow","BusySparkline"]);function zc(e){return e.startsWith("JsTop")||Hc.has(e)}function Pi(e){if(xn.has(e))return!0;for(let t=0;t<Tt.length;t++)if(e.startsWith(Tt[t]))return!0;if(Ro)return ko(e)||zc(e);if(So.has(e)||xo.has(e))return!0;for(let t=0;t<Sn.length;t++)if(e.startsWith(Sn[t]))return!0;return!1}function Vi(e){if(xn.has(e))return!0;for(let t=0;t<Tt.length;t++)if(e.startsWith(Tt[t]))return!0;return!1}var ge=!1,vt=!1,$e=!1,Ae=!1,ue=null,Oe=null,Rn=null,jt=null,Mi=!1,ve=!1,In=new Set,Vo=new Set,Lo=new Map,Eo=["#37afa9","#63b19e","#80b393","#97b488","#abb67d","#beb771","#cfb965","#dfba57","#efbb49","#febc38"],_c=!1;function J(e,t){_c&&(t!==void 0?console.log(`[HighlightUpdates] ${e}`,t):console.log(`[HighlightUpdates] ${e}`))}function No(e){let t=Oc(e);if(t)return t;if(!e)return null;let n=e;return n.canonical?.publicInstance?n.canonical.publicInstance:n.canonical&&typeof n.canonical.measure=="function"?n.canonical:typeof n.measure=="function"?n:null}function Ct(e){let t=Ac(e);if(t!==null)return t;if(e==null)return null;let n=e;if(n.__nativeTag!=null)return n.__nativeTag;if(n._nativeTag!=null)return n._nativeTag;if(n.nativeTag!=null)return n.nativeTag;if(n.canonical){if(n.canonical.__nativeTag!=null)return n.canonical.__nativeTag;if(n.canonical._nativeTag!=null)return n.canonical._nativeTag;if(n.canonical.nativeTag!=null)return n.canonical.nativeTag}return null}function Do(e){let t=e,n={viewType:"Unknown"};t?.canonical?.viewConfig?.uiViewClassName?n.viewType=t.canonical.viewConfig.uiViewClassName:t?.viewConfig?.uiViewClassName&&(n.viewType=t.viewConfig.uiViewClassName);let o=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Oo(t),r=t?.canonical?.currentProps,i=t?.canonical?.pendingProps,s=o?.pendingProps,a=o?.memoizedProps;return n.testID=r?.testID||i?.testID||s?.testID||a?.testID||void 0,n.nativeID=r?.nativeID||i?.nativeID||s?.nativeID||a?.nativeID||void 0,n.accessibilityLabel=r?.accessibilityLabel||i?.accessibilityLabel||s?.accessibilityLabel||a?.accessibilityLabel||void 0,n.componentName=jc(o)||void 0,n}var Li=!1,Fc=!1,Po=null;var Bc=new Set;var $c=new Set(["highlight-updates-overlay","__rn_buoy__highlight-modal"]),Wc=new Set(["jsmodal-root","image-overlay-standalone","logbox_inspector","logbox"]),et=new Map,Ei=500;function Uc(){et.clear()}function Ni(e){return e?!!($c.has(e)||e.startsWith("__highlight_")):!1}function Hi(e){if(!e)return!1;if(Wc.has(e))return!0;let t=e.charCodeAt(0);return!!(t===95&&e.startsWith("__rn_buoy__")||t===108&&e.startsWith("logbox"))}function _i(e){if(!e)return null;let t=e.type;if(t){if(typeof t=="string")return t;if(t.name)return t.name;if(t.displayName)return t.displayName}let n=e.elementType;if(n){if(n.name)return n.name;if(n.displayName)return n.displayName}return null}var Gc=new Set(["View","Text","TextImpl","Image","ScrollView","FlatList","SectionList","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","Pressable","TextInput","Switch","ActivityIndicator","Modal","StatusBar","KeyboardAvoidingView","AnimatedComponent","AnimatedComponentWrapper","ScreenContainer","ScreenStack","Screen","ScreenContentWrapper","Svg","G","Path","Rect","Circle","Line","Polygon","Polyline","Ellipse","Text as SVGText","TSpan","TextPath","Use","Symbol","Defs","ClipPath","LinearGradient","RadialGradient","Stop","Mask","Pattern","Image as SVGImage","SafeAreaProvider","SafeAreaView","SafeAreaListener","GestureHandlerRootView","GestureDetector","ReanimatedView","ReanimatedText","ReanimatedImage","ReanimatedScrollView","Fragment","Suspense","Provider","Consumer","Context","ForwardRef"]);function Kc(e){return!!(!e||Gc.has(e)||e==="Unknown"||e==="Component"||e.startsWith("Animated"))}function jc(e){if(!e)return null;let t=e._debugOwner||e.return,n=0,o=null;for(;t&&n<30;){let r=_i(t);if(r&&typeof t.type!="string"&&(o||(o=r),!Kc(r)))return r;t=t.return,n++}return o}function qc(e){let t=e,n=t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Oo(t),o=Ct(e)||Ct(t?.canonical?.publicInstance),r=Io(),i=!r&&E.getSettings().excludeDevTools;if(i&&Mc(e)&&e.closest("[data-buoy-root]"))return!0;if(o!=null&&i){let l=et.get(o);if(l!==void 0)return l}let s=!1,a=n?.pendingProps?.nativeID||n?.memoizedProps?.nativeID||t?.canonical?.currentProps?.nativeID||null;if((Ni(a)||i&&Hi(a))&&(s=!0),!s&&n){let l=n,c=0;for(;l&&c<30;){let u=_i(l);if(u){if(xn.has(u)){s=!0;break}for(let v of Tt)if(u.startsWith(v)){s=!0;break}if(s)break;if(r&&ko(u)){s=!0;break}if(i){if(So.has(u)||xo.has(u)){s=!0;break}for(let v of Sn)if(u.startsWith(v)){s=!0;break}if(s)break}}let y=l.pendingProps?.nativeID||l.memoizedProps?.nativeID;if(Ni(y)){s=!0;break}if(i&&Hi(y)){s=!0;break}l=l.return,c++}}if(s&&o!=null&&i){if(et.size>=Ei){let l=Array.from(et.keys());for(let c=0;c<Ei/2;c++)et.delete(l[c])}et.set(o,s)}return s}function Xc(e){let t=Math.min(e-1,Eo.length-1);return Eo[Math.max(0,t)]}function Yc(e){if(e.size===0||!ge&&!$e||E.getState().isPaused)return;ze.isEnabled()&&qr();let n=E.getBatchSize(),o=ze.startBatch(e.size,n),r=[],i=0,s=0,a=E.hasActiveFilters();for(let u of e)if(u&&typeof u=="object")try{if(qc(u)){i++;continue}let y=No(u),v=Ct(u)||Ct(y);if(v==null)continue;let S=Do(u);if(a&&!E.passesFilters(S)){s++;continue}let C=E.getSettings().showRenderCount,T,h;C?(T=(Lo.get(v)||0)+1,Lo.set(v,T),h=Xc(T)):(T=0,h=Eo[0]),r.push({node:u,color:h,count:T})}catch{}if(o.markFilteringComplete(i+s,r.length),r.length===0){o.finish();return}Li&&console.log(`[HighlightUpdates] ${r.length} component(s) re-rendered`);let l=E.getRenderEventCallbackCount()>0;if(!Oe&&!l){Li&&console.log("[HighlightUpdates] No highlightCallback and no event callbacks - skipping render"),Mi=!1;return}o.markMeasurementStart();let c=r.slice(0,n*4).map(({node:u,color:y,count:v})=>new Promise(S=>{let C=!1,T=L=>{C||(C=!0,clearTimeout(h),S(L))},h=setTimeout(()=>T({rect:null,stateNode:u,color:y,count:v}),500),f=No(u),m=Ct(u)||Ct(f);if(m==null){T({rect:null,stateNode:u,color:y,count:v});return}let R=(L,D,k,U,ee,G)=>{if(ee==null||G==null||k==null||U==null){T({rect:null,stateNode:u,color:y,count:v});return}T({rect:{id:m,x:ee,y:G,width:k,height:U,color:y,count:v},stateNode:u,color:y,count:v})};if(!f){let L=u.node,D=globalThis.nativeFabricUIManager;if(L&&D?.measure){try{D.measure(L,R)}catch{T({rect:null,stateNode:u,color:y,count:v})}return}T({rect:null,stateNode:u,color:y,count:v});return}try{f.measure(R)}catch{T({rect:null,stateNode:u,color:y,count:v})}}));Promise.all(c).then(u=>{let y=u.filter(S=>S.rect!==null),v=y.map(S=>S.rect);o.markMeasurementComplete(y.length,u.length-y.length),v.length>0&&Oe&&ge&&!vt&&Oe(v),setTimeout(()=>{try{for(let h of y)h.rect&&Jc(h.rect.id,h.stateNode)}catch(h){J("registerTrackedNode batch failed",h)}let S=E.getSettings(),C=S.trackRenderCauses&&S.showRenderCount,T=null;if(C){T=new Set;for(let{rect:h}of y)h&&T.add(h.id)}if(ge){E.startBatch();for(let{rect:h,stateNode:f,color:m,count:R}of y)if(h){let L=Do(f),D;if(C&&T){let U=Ho(f);D=wn(h.id,U,T,S.debugLogLevel)}E.trackRender({nativeTag:h.id,viewType:L.viewType,testID:L.testID,nativeID:L.nativeID,accessibilityLabel:L.accessibilityLabel,componentName:L.componentName,measurements:{x:h.x,y:h.y,width:h.width,height:h.height},color:m,count:R,renderCause:D})}E.endBatch()}else for(let{rect:h,stateNode:f,color:m,count:R}of y)if(h){let L=Do(f),D;if(C&&T){let U=Ho(f);D=wn(h.id,U,T,S.debugLogLevel)}E.emitRenderEvent({nativeTag:h.id,viewType:L.viewType,testID:L.testID,nativeID:L.nativeID,accessibilityLabel:L.accessibilityLabel,componentName:L.componentName,measurements:{x:h.x,y:h.y,width:h.width,height:h.height},color:m,count:R,renderCause:D})}o.markTrackingComplete(),o.markCallbackComplete(),o.finish()},0)}).catch(u=>{console.error("[HighlightUpdates] Error in measurement pipeline:",u),o.finish()})}var zi=globalThis.WeakRef,kn=new Map;function Jc(e,t){if(!(e==null||t==null||typeof t!="object"))try{kn.set(e,zi?new zi(t):{deref:()=>t})}catch{kn.set(e,{deref:()=>t})}}function Qc(e){let n=kn.get(e)?.deref();return n||kn.delete(e),n??null}function Zc(e){return new Promise(t=>{try{e.measure((n,o,r,i,s,a)=>{s==null||a==null||r==null||i==null?t(null):t({x:s,y:a,width:r,height:i})})}catch{t(null)}})}function Ho(e){let t=e;return t?.canonical?.internalInstanceHandle||t?._internalInstanceHandle||t?._internalFiberInstanceHandleDEV||Oo(t)||null}function eu(e){let t=Ho(e),n=0;for(;t&&n++<200;){let o=t.stateNode;if(o&&typeof o.scrollTo=="function"){let r=typeof o.getNativeScrollRef=="function"&&o.getNativeScrollRef()||null,i=typeof o.getInnerViewNode=="function"&&o.getInnerViewNode()||typeof o.getScrollableNode=="function"&&o.getScrollableNode()||o;return{instance:o,nativeRef:r,innerNode:i}}t=t.return}return null}async function tu(e,t,n){try{let o=eu(e);if(!o)return!1;let r=t,i=null,s=a=>new Promise(l=>{let c=!1,u=v=>{c||(c=!0,l(v))},y=setTimeout(()=>u(null),600);try{a(v=>{clearTimeout(y),u(v)})}catch{clearTimeout(y),u(null)}});if(o.nativeRef&&typeof r.measureLayout=="function"&&(i=await s(a=>r.measureLayout(o.nativeRef,(l,c)=>a(c),()=>a(null)))),i==null){let a=Je(t),l=typeof o.innerNode=="number"?o.innerNode:Je(o.innerNode);a!=null&&l!=null&&(i=await s(c=>$t.measureLayout(a,l,()=>c(null),(u,y)=>c(y))))}return i==null?!1:(o.instance.scrollTo({y:Math.max(0,i-n),animated:!1}),await new Promise(a=>setTimeout(a,80)),!0)}catch{return!1}}function nu(e,t){let n=[e.testID,e.nativeID,e.accessibilityLabel,e.componentName,e.viewType,String(e.nativeTag)],o=0;for(let r of n){if(!r)continue;let i=r.toLowerCase();if(i===t)return 3;i.startsWith(t)?o=Math.max(o,2):i.includes(t)&&(o=Math.max(o,1))}return o}async function ou(e){let t=e.scrollIntoView!==!1,n=typeof e.margin=="number"?e.margin:12,o=E.getRenders(),r=async()=>{let f=await hn(),m=(e.query??"").trim().toLowerCase(),R;for(let k of f.elements){if(e.nativeTag!=null&&k.nativeTag===e.nativeTag){R={el:k,score:1e3};break}let U=Ut({nativeTag:k.nativeTag,testID:k.testID,label:k.label,text:k.text,name:k.name,tap:k.tap},{query:m||void 0,nativeTag:e.nativeTag});U<=0||(!R||U>R.score)&&(R={el:k,score:U})}if(!R?.el.frame)return{matched:!1,reason:"no-match",candidates:[]};let L=f.screen,D=R.el.frame;return{matched:!0,live:!0,rect:{x:D.x*L.width,y:D.y*L.height,width:D.width*L.width,height:D.height*L.height},scale:dn.get(),screen:{width:L.width,height:L.height},nativeTag:R.el.nativeTag??void 0,componentName:R.el.name,testID:R.el.testID}};if(o.length===0)return r();let i=(e.query??"").trim().toLowerCase(),s=i?o.map(f=>({r:f,score:nu(f,i)})).filter(f=>f.score>0).sort((f,m)=>m.score-f.score||m.r.lastRenderTime-f.r.lastRenderTime):[],a=s.slice(0,8).map(({r:f})=>({nativeTag:f.nativeTag,componentName:f.componentName,testID:f.testID,nativeID:f.nativeID,viewType:f.viewType,renderCount:f.renderCount})),l=e.nativeTag??(s.length>0?s[0].r.nativeTag:void 0);if(l==null){let f=await r();return f.matched?f:{matched:!1,reason:"no-match",candidates:a}}let c=o.find(f=>f.nativeTag===l),u=null,y=!1,v=!1,S=Qc(l);if(S){let f=No(S);f&&(t&&(v=await tu(S,f,n)),u=await Zc(f),y=!!u)}if(!u&&c?.measurements&&(u={...c.measurements}),!u)return{matched:!1,reason:"no-measurement",nativeTag:l,candidates:a};let C=dn.get(),T=Qe.get("window"),h=u.x>=-1&&u.y>=-1&&u.x+u.width<=T.width+1&&u.y+u.height<=T.height+1;return{matched:!0,live:y,scrolled:v,inView:h,rect:u,scale:C,screen:{width:T.width,height:T.height},nativeTag:l,componentName:c?.componentName,testID:c?.testID,candidates:a}}function Fi(e){if(!ue?.rendererInterfaces){J("No rendererInterfaces available");return}let t=0;if(ue.rendererInterfaces.forEach((n,o)=>{if(typeof n.setTraceUpdatesEnabled=="function")try{n.setTraceUpdatesEnabled(e),t++,J(`Renderer ${o}: setTraceUpdatesEnabled(${e})`)}catch(r){J(`Renderer ${o}: error setting trace updates`,r)}else J(`Renderer ${o}: no setTraceUpdatesEnabled method`)}),J(`Set trace updates ${e?"enabled":"disabled"} on ${t} renderer(s)`),ue.reactDevtoolsAgent?.setTraceUpdatesEnabled)try{ue.reactDevtoolsAgent.setTraceUpdatesEnabled(e),J("Also set trace updates on agent")}catch(n){J("Error setting trace updates on agent",n)}}function Bi(){ue&&(jt||(J("Subscribing to traceUpdates event"),typeof ue.sub=="function"?(jt=ue.sub("traceUpdates",Yc),J("Subscribed using hook.sub()")):J("hook.sub not available, traceUpdates may not work"),Fi(!0)))}function Mo(){Fi(!1),jt&&(jt(),jt=null,J("Unsubscribed from traceUpdates event"))}function $i(e){Oe=e,J(`Highlight callback ${e?"set":"cleared"}`)}function ru(e){Rn=e,J(`Badge press callback ${e?"set":"cleared"}`)}function iu(){return Rn}function au(e){Rn&&Rn(e)}var zo=null,Dn=null;function su(e){zo=e,e&&Dn!==null&&e(Dn)}function lu(e){if(be){be("setSpotlight",{nativeTag:e});return}Dn=e,zo&&zo(e)}var be=null;function cu(e){be=e}function uu(e){ge!==e.enabled&&(ge=e.enabled,_o()),ve!==e.frozen&&(ve=e.frozen,Vn())}function du(){return Dn}function _o(){Vo.forEach(e=>{try{e(ge)}catch(t){console.error("[HighlightUpdates] Error in state listener:",t)}})}function Wi(e){return Vo.add(e),e(ge),()=>{Vo.delete(e)}}function Pn(){if(typeof _<"u"&&!_)return J("Only available in development builds"),!1;if(be||Ae)return!0;if(ue=window?.__REACT_DEVTOOLS_GLOBAL_HOOK__||null,!ue)return J("React DevTools hook not found"),!1;if(J("Hook found"),J(`Hook has sub: ${typeof ue.sub=="function"}`),J(`Hook has on: ${typeof ue.on=="function"}`),J(`Hook has emit: ${typeof ue.emit=="function"}`),oo(),ue.rendererInterfaces&&ue.rendererInterfaces.size>0)return Ae=!0,J(`Initialized with ${ue.rendererInterfaces.size} renderer(s)`),Ai(),!0;let e=setInterval(()=>{ue?.rendererInterfaces&&ue.rendererInterfaces.size>0&&(clearInterval(e),Ae=!0,J(`Initialized with ${ue.rendererInterfaces.size} renderer(s) (delayed)`),Ai())},100);return setTimeout(()=>clearInterval(e),1e4),!1}function Ai(){typeof window<"u"&&(window.__HIGHLIGHT_UPDATES_CONTROLLER__={enable:qt,disable:Xt,toggle:Ui,isEnabled:Gi,setEnabled:Ki,subscribe:Wi,initialize:Pn,destroy:Xi,isInitialized:()=>Ae,setHighlightCallback:$i})}function qt(){typeof _<"u"&&!_||(Ae||Pn(),vt&&(vt=!1),!ge&&(J("Enabling highlights"),$e||Bi(),E.start(),ge=!0,_o(),Oi("render")))}function Xt(){typeof _<"u"&&!_||ge&&(J("Disabling highlights"),Fc=!1,Mi=!1,Po&&(clearTimeout(Po),Po=null),Bc.clear(),et.clear(),wo(),ve&&(ve=!1,Vn()),$e||Mo(),E.stop(),ge=!1,_o(),Oi("render"))}function pu(){typeof _<"u"&&!_||$e||(Ae||Pn(),J("Enabling background tracking"),ge||Bi(),$e=!0)}function gu(){typeof _<"u"&&!_||$e&&(J("Disabling background tracking"),$e=!1,ge||Mo())}function fu(){return $e}function Ui(){if(!(typeof _<"u"&&!_)){if(be){be("toggle");return}ge?Xt():qt()}}function mu(){if(be){be("clearRenderCounts");return}Lo.clear(),E.clear(),J("Cleared render counts")}function Gi(){return ge}function Ki(e){if(be){be("setEnabled",{enabled:e});return}e?qt():Xt()}function Ao(e){vt!==e&&(vt=e,e&&Oe&&Oe([]))}function hu(){return vt}function yu(e){if(be){be("setSilentTracking",{enabled:e});return}e?(qt(),Ao(!0)):(Ao(!1),Xt())}function bu(){return Ae}function Vn(){In.forEach(e=>{try{e(ve)}catch(t){console.error("[HighlightUpdates] Error in freeze listener:",t)}})}function Tu(e){return In.add(e),e(ve),()=>{In.delete(e)}}function ji(){typeof _<"u"&&!_||ve||(ve=!0,J("Freeze mode enabled"),Vn())}function qi(){typeof _<"u"&&!_||ve&&(ve=!1,J("Freeze mode disabled"),Oe&&Oe([]),Vn())}function Cu(){if(be){be("toggleFreeze");return}ve?qi():ji()}function vu(){return ve}function Xi(){Ae&&(Mo(),ro(),no(null),ve=!1,In.clear(),ge=!1,ue=null,Oe=null,Ae=!1,typeof window<"u"&&delete window.__HIGHLIGHT_UPDATES_CONTROLLER__,J("Destroyed"))}var wu={subscribe:Wi,enable:qt,disable:Xt,toggle:Ui,isEnabled:Gi,setEnabled:Ki,initialize:Pn,destroy:Xi,isInitialized:bu,setHighlightCallback:$i,clearRenderCounts:mu,freeze:ji,unfreeze:qi,toggleFreeze:Cu,getFrozen:vu,subscribeToFreeze:Tu,setBadgePressCallback:ru,getBadgePressCallback:iu,handleBadgePress:au,setSpotlightCallback:su,setSpotlight:lu,getSpotlight:du,clearDevToolsCache:Uc,enableBackgroundTracking:pu,disableBackgroundTracking:gu,isBackgroundTrackingEnabled:fu,setRemoteHandler:cu,replaceRemoteState:uu,locateComponent:ou,setHighlightsSuppressed:Ao,getHighlightsSuppressed:hu,setSilentTracking:yu},N=wu;P();import np,{useState as he,useEffect as ke,useRef as st,useCallback as le}from"react";import{Power as op,JsModal as rp,devToolsStorageKeys as Nt,persistentStorage as Mn,night as nn,TickProvider as Ga,windowDragProps as ip}from"@buoy-gg/shared-ui/web";import{useIsPro as ap}from"@buoy-gg/license/web";Le();P();import{useMemo as En,useState as aa,useCallback as Yt}from"react";import{CopyButton as zu,formatRelativeTime as Au,PlusIcon as Ou,MinusIcon as Mu,EventStepperFooter as _u,Lock as Fu,night as B,useLimit as Bu,monoFont as St}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as $u}from"@buoy-gg/shared-ui/web/dataViewer";P();import{buoyColors as We,night as se,monoFont as tt}from"@buoy-gg/shared-ui/web";import{Fragment as xu,jsx as X,jsxs as de}from"react/jsx-runtime";var Ee={mount:{label:"MOUNT",color:We.success,tip:"First render of this component."},props:{label:"PROPS",color:We.warning,tip:"Native props changed. Consider React.memo() or useCallback for handlers."},state:{label:"STATE",color:"#a855f7",tip:"Component state changed via setState."},hooks:{label:"HOOKS",color:"#ec4899",tip:"Hook values changed (useState, useReducer, useMemo, etc.)."},context:{label:"CONTEXT",color:"#06b6d4",tip:"React context value changed."},parent:{label:"PARENT",color:We.textSecondary,tip:"Parent component re-rendered. Consider wrapping with React.memo()."},unknown:{label:"?",color:We.textMuted,tip:"Could not determine render cause."}},wt={mount:{label:"mount",color:We.success,tip:"First render of this component."},props:{label:"props",color:We.warning,tip:"Component received different props from parent."},state:{label:"state",color:"#a855f7",tip:"Component's own state changed (useState/useReducer)."},parent:{label:"parent",color:We.textSecondary,tip:"Parent re-rendered but this component's props/state didn't change. Consider React.memo()."},unknown:{label:"?",color:We.textMuted,tip:"Could not determine component render cause."}};function Fo({cause:e,compact:t=!1,showKeys:n=!1,showTwoLevel:o=!1,testID:r}){let i=Ee[e.type],s=e.componentCause?wt[e.componentCause]:null,a=o&&s&&e.componentCause!==e.type;return de(d,{nativeID:"__rn_buoy__cause-badge",testID:r,style:[z.container,t&&z.containerCompact],children:[a&&de(xu,{children:[X(d,{style:[z.badge,t&&z.badgeCompact,z.componentBadge,{backgroundColor:s.color+"15"}],children:X(p,{testID:r?`${r}-component`:void 0,style:[z.badgeText,t&&z.badgeTextCompact,z.componentBadgeText,{color:s.color}],children:s.label})}),X(p,{style:[z.arrowText,t&&z.arrowTextCompact],children:"\u2192"})]}),X(d,{style:[z.badge,t&&z.badgeCompact,{backgroundColor:i.color+"20"}],children:X(p,{testID:r?`${r}-native`:void 0,style:[z.badgeText,t&&z.badgeTextCompact,{color:i.color}],children:i.label})}),n&&e.changedKeys&&e.changedKeys.length>0&&X(p,{testID:r?`${r}-keys`:void 0,style:[z.keysText,t&&z.keysTextCompact],numberOfLines:1,children:e.changedKeys.join(", ")}),n&&e.hookIndices&&e.hookIndices.length>0&&de(p,{testID:r?`${r}-hooks`:void 0,style:[z.keysText,t&&z.keysTextCompact],numberOfLines:1,children:["Hook ",e.hookIndices.join(", ")]})]})}function Su({cause:e}){let t=Ee[e.type],n=e.componentCause?wt[e.componentCause]:null,o=e.componentName||"Component";return de(d,{nativeID:"__rn_buoy__two-level-cause",style:z.twoLevelContainer,children:[n&&de(d,{style:z.twoLevelRow,children:[X(p,{style:z.twoLevelLabel,children:"Component:"}),X(p,{style:z.twoLevelName,children:o}),X(p,{style:z.twoLevelText,children:"re-rendered due to"}),X(d,{style:[z.badge,{backgroundColor:n.color+"20"}],children:X(p,{style:[z.badgeText,{color:n.color}],children:n.label.toUpperCase()})})]}),de(d,{style:z.twoLevelRow,children:[X(p,{style:z.twoLevelLabel,children:"Native:"}),X(d,{style:[z.badge,{backgroundColor:t.color+"20"}],children:X(p,{style:[z.badgeText,{color:t.color}],children:t.label})}),e.changedKeys&&e.changedKeys.length>0&&de(p,{style:z.twoLevelKeys,children:["[",e.changedKeys.join(", "),"]"]})]})]})}function Bo({cause:e,nativeType:t}){let n=Ee[e.type],o=e.componentCause?wt[e.componentCause]:null,r=e.componentName||"Unknown",i=e.hookChanges&&e.hookChanges.length>0,s=e.changedKeys&&e.changedKeys.length>0,a=e.changedKeys?.filter(c=>c.includes("(ref only)")||c.includes("(fn ref)"))||[],l=e.changedKeys?.filter(c=>!c.includes("(ref only)")&&!c.includes("(fn ref)"))||[];return de(d,{nativeID:"__rn_buoy__enhanced-cause",style:z.enhancedContainer,children:[de(d,{style:z.enhancedHeader,children:[X(p,{style:z.enhancedComponentName,children:r}),t&&X(d,{style:z.enhancedNativeTag,children:X(p,{style:z.enhancedNativeTagText,children:t})})]}),de(d,{style:z.enhancedFlowContainer,children:[X(p,{style:z.enhancedFlowLabel,children:"Cause:"}),o&&X(d,{style:[z.enhancedFlowBadge,{backgroundColor:o.color+"20"}],children:X(p,{style:[z.enhancedFlowBadgeText,{color:o.color}],children:o.label.toUpperCase()})}),X(p,{style:z.enhancedFlowArrow,children:"\u2192"}),X(d,{style:[z.enhancedFlowBadge,{backgroundColor:n.color+"20"}],children:X(p,{style:[z.enhancedFlowBadgeText,{color:n.color}],children:n.label})})]}),i&&de(d,{style:z.enhancedSection,children:[X(p,{style:z.enhancedSectionTitle,children:"Component State Changed:"}),e.hookChanges.map(c=>de(d,{style:z.enhancedChangeRow,children:[X(p,{style:z.enhancedChangeIcon,children:"\u26A1"}),de(p,{style:z.enhancedChangeText,children:["Hook[",c.index,"] (",c.type,"): ",c.description]})]},c.index))]}),l.length>0&&de(d,{style:z.enhancedSection,children:[X(p,{style:z.enhancedSectionTitle,children:"Native Props Changed:"}),l.map((c,u)=>de(d,{style:z.enhancedChangeRow,children:[X(p,{style:z.enhancedChangeIcon,children:"~"}),X(p,{style:z.enhancedChangeText,children:c})]},u))]}),a.length>0&&de(d,{style:z.enhancedSection,children:[X(p,{style:[z.enhancedSectionTitle,{color:se.color.textTertiary}],children:"Reference Changes (optimization opportunity):"}),a.map((c,u)=>de(d,{style:z.enhancedChangeRow,children:[X(p,{style:[z.enhancedChangeIcon,{color:se.color.textTertiary}],children:"\u25CB"}),X(p,{style:[z.enhancedChangeText,{color:se.color.textTertiary}],children:c})]},u))]}),!i&&!s&&e.type!=="mount"&&X(d,{style:z.enhancedSection,children:X(p,{style:z.enhancedNoChanges,children:e.type==="parent"?"Parent re-rendered (consider React.memo)":"No specific changes detected"})})]})}var z=oe.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{paddingVertical:3,paddingHorizontal:6,borderRadius:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5},componentBadge:{borderStyle:"dashed",borderWidth:1,borderColor:se.color.border},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},componentBadgeText:{fontWeight:"500",textTransform:"lowercase"},arrowText:{fontSize:10,color:se.color.textTertiary},arrowTextCompact:{fontSize:9},keysText:{fontSize:11,color:se.color.textSecondary,fontFamily:tt,flex:1},keysTextCompact:{fontSize:10},twoLevelContainer:{gap:8},twoLevelRow:{flexDirection:"row",alignItems:"center",flexWrap:"wrap",gap:6},twoLevelLabel:{fontSize:11,fontWeight:"600",color:se.color.textSecondary,minWidth:70},twoLevelName:{fontSize:11,fontWeight:"600",color:se.color.text,fontFamily:tt},twoLevelText:{fontSize:11,color:se.color.textSecondary},twoLevelKeys:{fontSize:10,color:se.color.textSecondary,fontFamily:tt},enhancedContainer:{gap:12},enhancedHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},enhancedComponentName:{fontSize:14,fontWeight:"700",color:se.color.text,fontFamily:tt},enhancedNativeTag:{backgroundColor:se.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},enhancedNativeTagText:{fontSize:10,fontWeight:"600",color:se.color.textTertiary,fontFamily:tt},enhancedFlowContainer:{flexDirection:"row",alignItems:"center",gap:8,paddingVertical:8,paddingHorizontal:12,backgroundColor:se.color.bg,borderRadius:6},enhancedFlowLabel:{fontSize:11,fontWeight:"600",color:se.color.textSecondary},enhancedFlowBadge:{paddingVertical:3,paddingHorizontal:8,borderRadius:4},enhancedFlowBadgeText:{fontSize:10,fontWeight:"700"},enhancedFlowArrow:{fontSize:14,color:se.color.textTertiary,fontWeight:"300"},enhancedSection:{gap:6},enhancedSectionTitle:{fontSize:11,fontWeight:"600",color:se.color.textSecondary,letterSpacing:.3},enhancedChangeRow:{flexDirection:"row",alignItems:"flex-start",gap:6,paddingLeft:4},enhancedChangeIcon:{fontSize:12,color:se.color.warning,fontFamily:tt,width:16},enhancedChangeText:{fontSize:12,color:se.color.text,fontFamily:tt,flex:1},enhancedNoChanges:{fontSize:12,color:se.color.textTertiary,fontStyle:"italic",paddingLeft:4}});P();function Ru(e,t){let n=e.filter(C=>C.renderCount>=t.minRenders);if(t.filterCauses.length>0){let C=new Set(t.filterCauses);n=n.filter(T=>C.has(T.lastRenderCause?.type??"unknown"))}let o=e.flatMap(C=>[C.firstRenderTime,C.lastRenderTime]).filter(C=>Number.isFinite(C)),r=o.length>0?Math.max(...o)-Math.min(...o):0,i=Math.max(.001,r/1e3),a=(t.groupByName?Iu(n):n.map(C=>[C])).map(C=>ku(C,t,i));Pu(a,t.sortBy);let l=t.topN===-1?0:Math.max(0,a.length-t.topN),c=t.topN===-1?a:a.slice(0,t.topN),u=e.reduce((C,T)=>C+T.renderCount,0),y=Du(e),v=0,S=!1;for(let C of e)C.lastRenderCause||(v+=C.renderCount),C.renderHistory&&C.renderHistory.length>0&&(S=!0);return{totalUniqueComponents:n.length,totalRenders:u,windowMs:r,causeBreakdown:y,rows:c,truncated:l,dataGaps:{historyOff:!S,propsCaptureOff:!e.some(C=>C.renderHistory?.some(T=>T.capturedProps!==void 0)),stateCaptureOff:!e.some(C=>C.renderHistory?.some(T=>T.capturedState!==void 0)),rendersWithoutCause:v}}}function Iu(e){let t=new Map;for(let n of e){let o=n.componentName||n.displayName||n.viewType,r=t.get(o);r?r.push(n):t.set(o,[n])}return Array.from(t.values())}function ku(e,t,n){let o=e[0],r=o.componentName||o.displayName||o.viewType,i=0,s={},a=new Map,l=new Map,c=new Map,u=0,y=0,v=0;for(let D of e){i+=D.renderCount;let k=D.lastRenderCause;if(!k)continue;let U=k.type;s[U]=(s[U]??0)+D.renderCount;let ee=(k.hookChanges?.length??0)>0,G=(k.changedKeys?.length??0)>0;if(U==="parent"&&(k.componentCause==="state"||k.componentCause==="props"||ee||G?y+=D.renderCount:v+=D.renderCount),U==="props"&&!G&&(u+=D.renderCount),k.parentComponentName&&c.set(k.parentComponentName,(c.get(k.parentComponentName)??0)+1),t.aggregateCauses&&k.hookChanges)for(let M of k.hookChanges){let ne=`${M.type}[${M.index}]`,w=a.get(ne);w?w.count+=1:a.set(ne,{count:1,sample:Vu(M)})}if(k.changedKeys)for(let M of k.changedKeys)M.includes("(ref only)")||l.set(M,(l.get(M)??0)+1)}let S=Array.from(a.entries()).sort((D,k)=>k[1].count-D[1].count).slice(0,3).map(([D,k])=>({hook:D,count:k.count,sample:k.sample})),C=Array.from(l.entries()).sort((D,k)=>k[1]-D[1]).slice(0,5).map(([D])=>D),T="unknown",h=-1;for(let[D,k]of Object.entries(s))(k??0)>h&&(h=k??0,T=D);let f,m=0;for(let[D,k]of c)k>m&&(m=k,f=D);let R=e.map(D=>D.renderCount).sort((D,k)=>k-D),L=i/n;return{name:r,viewType:o.viewType,instances:e.length,renders:i,causeMix:s,dominantCause:T,hookCauses:S,changedKeys:C,unknownPropsCount:u,parentWithOwnChange:y,parentNoChange:v,parentName:f,instanceCounts:R,rate:L,source:e}}function Du(e){let t={};for(let n of e){let o=n.lastRenderCause?.type??"unknown";t[o]=(t[o]??0)+n.renderCount}return t}function Pu(e,t){switch(t){case"renderCount":e.sort((n,o)=>o.renders-n.renders);break;case"rate":e.sort((n,o)=>o.rate-n.rate);break;case"name":e.sort((n,o)=>n.name.localeCompare(o.name));break}}var Yi=32;function Ji(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="function")return"[Fn]";if(typeof e=="object")return Array.isArray(e)?`[Array(${e.length})]`:"[Obj]";let t=String(e);return t.length>Yi?t.slice(0,Yi-1)+"\u2026":t}function Vu(e){return e.previousValue===void 0&&e.currentValue===void 0?e.description:`${Ji(e.previousValue)} \u2192 ${Ji(e.currentValue)}`}function Zi(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function $o(e){return e>=100?`${e.toFixed(0)}/s`:e>=10?`${e.toFixed(1)}/s`:`${e.toFixed(2)}/s`}function ea(e){let t=Object.entries(e).sort((n,o)=>(o[1]??0)-(n[1]??0));return t.length===0?"(no causes recorded)":t.map(([n,o])=>`${n} ${o}`).join(" \xB7 ")}function ta(e){let t=[],n=Object.entries(e.causeMix).filter(([,r])=>(r??0)>0).sort((r,i)=>(i[1]??0)-(r[1]??0)),o=n.length>=2&&(n[1]?.[1]??0)>=e.renders*.1;if(e.dominantCause==="hooks"&&e.hookCauses.length>0){let r=e.hookCauses[0];r.sample?t.push(`hooks \xD7${r.count} ${r.hook}: ${r.sample}`):t.push(`hooks \xD7${r.count} ${r.hook}`)}else if(e.dominantCause==="props"){if(e.changedKeys.length>0){let r=e.changedKeys.slice(0,3).join(", ");t.push(`props (${r})`)}else t.push("props (keys not captured)");e.unknownPropsCount>0&&e.changedKeys.length>0&&t.push(`[${e.unknownPropsCount} unidentified]`)}else if(e.dominantCause==="parent"){let r="parent cascade";e.parentNoChange>0&&e.parentWithOwnChange===0&&(r="parent cascade, no own change"),e.parentName&&(r+=` \u2190 ${e.parentName}`),t.push(r)}else e.dominantCause==="mount"?t.push("mount"):e.dominantCause==="state"?t.push("state"):e.dominantCause==="context"?t.push("context"):t.push("unknown");if(o){let r=n.map(([i,s])=>`${i}:${s}`).join(" + ");t.push(`(${r})`)}return t.join(" ")}function na(e){if(e.instances<=1)return e.name;let t=e.instanceCounts,n=t[0]??0,o=t[t.length-1]??0;if(n-o<=1)return`${e.name} \xD7${e.instances} (${n} each)`;let i=t.slice(1),s=i.reduce((l,c)=>l+c,0),a=i.length>0?s/i.length:0;return`${e.name} \xD7${e.instances} (top ${n}, others ~${Math.round(a)})`}var Lu="React Native render report \u2014 review the data and identify why components are re-rendering.";function Qi(e,t){let n=[];n.push(Lu),n.push(""),n.push(`Window: ${Zi(e.windowMs)} \xB7 ${e.totalUniqueComponents} components \xB7 ${e.totalRenders} renders`),n.push(`Cause mix: ${ea(e.causeBreakdown)}`),n.push(""),n.push("Top offenders (count \xB7 rate \xB7 component \xB7 cause):"),n.push("");let o=e.rows.map(na),r=Math.min(36,Math.max(8,...o.map(l=>l.length))),i=Math.max(3,...e.rows.map(l=>`\xD7${l.renders}`.length)),s=Math.max(5,...e.rows.map(l=>$o(l.rate).length));for(let l=0;l<e.rows.length;l++){let c=e.rows[l],u=(o[l]??c.name).padEnd(r),y=`\xD7${c.renders}`.padStart(i),v=$o(c.rate).padStart(s),S=ta(c);n.push(` ${y} ${v} ${u} ${S}`)}e.truncated>0&&(n.push(""),n.push(`... ${e.truncated} more (set topN=-1 to expand)`));let a=oa(e);if(a.length>0){n.push(""),n.push("Data availability:");for(let l of a)n.push(` \xB7 ${l}`)}return n.join(`
32
+ `)}function oa(e){let t=[];return e.dataGaps.rendersWithoutCause>0&&t.push(`${e.dataGaps.rendersWithoutCause} renders had no cause info (enable trackRenderCauses for more detail)`),e.dataGaps.propsCaptureOff&&t.push("prop snapshots not captured (enable capturePropsOnRender to see prop diffs for 'props (keys not captured)' rows)"),e.dataGaps.stateCaptureOff&&t.push("state snapshots not captured (enable captureStateOnRender)"),e.dataGaps.historyOff&&t.push("render history off (enable enableRenderHistory for per-render timeline)"),t}function Eu(e,t){let n=[];n.push("# React Render Report"),n.push(""),n.push(`**Window:** ${Zi(e.windowMs)} \xB7 **Components:** ${e.totalUniqueComponents} \xB7 **Renders:** ${e.totalRenders}`),n.push(`**Cause mix:** ${ea(e.causeBreakdown)}`),n.push(""),n.push("| Component | Renders | Rate | Cause |"),n.push("|---|---:|---:|---|");for(let r of e.rows){let i=na(r),s=ta(r).replace(/\|/g,"\\|");n.push(`| ${i} | ${r.renders} | ${$o(r.rate)} | ${s} |`)}e.truncated>0&&(n.push(""),n.push(`_... ${e.truncated} more rows_`));let o=oa(e);if(o.length>0){n.push(""),n.push("**Data availability:**");for(let r of o)n.push(`- ${r}`)}return n.join(`
33
+ `)}function Nu(e,t,n){let o={exportedAt:new Date().toISOString(),summary:{windowMs:t.windowMs,totalComponents:t.totalUniqueComponents,totalRenders:t.totalRenders,causeBreakdown:t.causeBreakdown,truncated:t.truncated,dataGaps:t.dataGaps},components:t.rows.map(r=>({name:r.name,viewType:r.viewType,instances:r.instances,instanceCounts:r.instances>1?r.instanceCounts:void 0,renders:r.renders,ratePerSec:Number(r.rate.toFixed(3)),dominantCause:r.dominantCause,causeMix:r.causeMix,hookCauses:r.hookCauses,changedKeys:r.changedKeys,unknownPropsCount:r.unknownPropsCount||void 0,parentName:r.parentName,parentWithOwnChange:r.parentWithOwnChange||void 0,parentNoChange:r.parentNoChange||void 0,...n.includeHistory?{history:Hu(r.source)}:{}}))};return n.includeHistory?JSON.stringify(o,null,2):JSON.stringify(o)}function Hu(e){return e.map(t=>({name:t.componentName||t.displayName,nativeTag:t.nativeTag,renderCount:t.renderCount,history:t.renderHistory?.map(n=>({n:n.renderNumber,t:n.timestamp,cause:{type:n.cause.type,componentCause:n.cause.componentCause,changedKeys:n.cause.changedKeys,parentComponentName:n.cause.parentComponentName,hookChanges:n.cause.hookChanges?.map(o=>({type:o.type,index:o.index,desc:o.description}))}}))}))}function Ln(e,t){let n=Ru(e,t);switch(t.format){case"summary":return Qi(n,t);case"markdown-table":return Eu(n,t);case"json":return Nu(e,n,t);default:return Qi(n,t)}}function ra(e,t){return Ln(e,t).length}function Wo(e){return{totalComponents:e.length,totalRenders:e.reduce((t,n)=>t+n.renderCount,0)}}function ia(e){return Ln([e],{format:"summary",topN:-1,minRenders:1,filterCauses:[],groupByName:!1,aggregateCauses:!0,sortBy:"renderCount",includeHistory:!1})}import{jsx as $,jsxs as re}from"react/jsx-runtime";function Go({render:e,disableInternalFooter:t=!1,selectedEventIndex:n,onEventIndexChange:o,onAddFilter:r,isPro:i=!1}){let[s,a]=aa(0),l=n??s,c=o??a,u=En(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((G,M)=>G.timestamp-M.timestamp),[e.renderHistory]),y=u.length,v=u[l],S=Bu("highlightUpdates.detailEvents"),C=i?1/0:S,T=En(()=>Math.max(0,y-C),[C,y]),h=v?.cause||e.lastRenderCause,f=Yt(()=>{l>0&&c(l-1)},[l,c]),m=Yt(()=>{let G=Math.min(C-1,y-1);l<G&&c(l+1)},[l,y,c,C]),R=En(()=>ia(e),[e]),L=e.componentName||e.displayName,D=e.viewType,k=e.lastRenderTime-e.firstRenderTime,U=k>0?(e.renderCount/(k/1e3)).toFixed(1):e.renderCount.toString(),ee=!t&&y>1;return re(d,{style:V.container,children:[re(d,{style:V.header,children:[re(d,{style:V.headerLeft,children:[$(p,{testID:"buoy-highlight-detail-name",style:V.componentName,numberOfLines:1,children:L}),$(d,{style:V.nativeTypeBadge,children:$(p,{testID:"buoy-highlight-detail-type",style:V.nativeTypeText,children:D})})]}),$(zu,{value:R,size:14,testID:"buoy-highlight-detail-copy"})]}),re(Re,{testID:"buoy-highlight-detail-scroll",style:V.scrollView,contentContainerStyle:[V.scrollContent,ee&&{paddingBottom:100}],showsVerticalScrollIndicator:!1,children:[h&&$(Wu,{cause:h,renderNumber:v?.renderNumber}),$(Uu,{render:e,rendersPerSec:U}),T>0&&re(d,{testID:"buoy-highlight-detail-locked",style:V.lockedBanner,children:[$(Fu,{size:14,color:B.color.warning}),re(p,{testID:"buoy-highlight-detail-locked-text",style:V.lockedBannerText,children:[T," ",T===1?"event":"events"," hidden"]}),$(p,{style:V.lockedBannerSubtext,children:"Upgrade to Pro"})]}),r&&$(Gu,{render:e,onAddFilter:r})]}),ee&&$(_u,{currentIndex:l,totalItems:y,onPrevious:f,onNext:m,itemLabel:"Render",subtitle:v?.timestamp?Au(new Date(v.timestamp)):void 0,applySafeAreaInset:!1,absolute:!0})]})}function Wu({cause:e,renderNumber:t}){let n=e.componentCause||e.type,o=e.componentCause?wt[e.componentCause]:Ee[e.type],r=e.hookChanges&&e.hookChanges.length>0,i=e.changedKeys&&e.changedKeys.length>0,s=()=>e.type==="mount"?"First render":n==="parent"?"Triggered by":"Changed:";return re(d,{testID:"buoy-highlight-detail-cause",style:V.answerCard,children:[re(d,{style:V.causeBadgeRow,children:[$(p,{testID:"buoy-highlight-detail-cause-label",style:V.causeLabel,children:s()}),$(d,{style:[V.causeBadgeLarge,{backgroundColor:o.color+"20"}],children:$(p,{testID:"buoy-highlight-detail-cause-badge",style:[V.causeBadgeLargeText,{color:o.color}],children:o.label.toUpperCase()})})]}),r&&$(d,{style:V.hookChangesContainer,children:e.hookChanges.map((a,l)=>{let c=`${a.type}[${a.index}]`,u={[c]:a.previousValue},y={[c]:a.currentValue};return $(d,{style:V.hookDiffContainer,children:$($u,{oldValue:u,newValue:y,theme:"dark",showUnchanged:!1})},l)})}),!r&&i&&$(d,{style:V.propsChangesContainer,children:e.changedKeys.filter(a=>!a.includes("(ref only)")).slice(0,5).map((a,l)=>$(d,{style:V.propChangeChip,children:$(p,{testID:`buoy-highlight-detail-changed-${l}`,style:V.propChangeText,children:a})},l))})]})}function Uu({render:e,rendersPerSec:t}){let n=e.testID||e.nativeID||e.accessibilityLabel,o=e.measurements;return re(d,{style:V.detailsSection,children:[n&&re(d,{testID:"buoy-highlight-detail-identifiers",style:V.detailsCard,children:[$(p,{style:V.detailsCardTitle,children:"Identifiers"}),e.testID&&$(Uo,{label:"testID",value:e.testID}),e.nativeID&&$(Uo,{label:"nativeID",value:e.nativeID}),e.accessibilityLabel&&$(Uo,{label:"a11y",value:e.accessibilityLabel})]}),re(d,{testID:"buoy-highlight-detail-stats",style:V.statsRow,children:[re(d,{testID:"buoy-highlight-detail-stat-renders",style:V.statItem,children:[$(p,{testID:"buoy-highlight-detail-stat-renders-value",style:[V.statValue,{color:e.color}],children:e.renderCount}),$(p,{style:V.statLabel,children:"renders"})]}),$(d,{style:V.statDivider}),re(d,{testID:"buoy-highlight-detail-stat-rate",style:V.statItem,children:[$(p,{testID:"buoy-highlight-detail-stat-rate-value",style:V.statValue,children:t}),$(p,{style:V.statLabel,children:"/sec"})]}),$(d,{style:V.statDivider}),re(d,{testID:"buoy-highlight-detail-stat-tag",style:V.statItem,children:[$(p,{testID:"buoy-highlight-detail-stat-tag-value",style:V.statValue,children:e.nativeTag}),$(p,{style:V.statLabel,children:"tag"})]})]}),o&&re(d,{testID:"buoy-highlight-detail-measure",style:V.measurementsRow,children:[re(d,{style:V.measurementItem,children:[$(p,{style:V.measurementLabel,children:"x"}),$(p,{testID:"buoy-highlight-detail-measure-x",style:V.measurementValue,children:Math.round(e.measurements.x)})]}),re(d,{style:V.measurementItem,children:[$(p,{style:V.measurementLabel,children:"y"}),$(p,{testID:"buoy-highlight-detail-measure-y",style:V.measurementValue,children:Math.round(e.measurements.y)})]}),re(d,{style:V.measurementItem,children:[$(p,{style:V.measurementLabel,children:"w"}),$(p,{testID:"buoy-highlight-detail-measure-w",style:V.measurementValue,children:Math.round(e.measurements.width)})]}),re(d,{style:V.measurementItem,children:[$(p,{style:V.measurementLabel,children:"h"}),$(p,{testID:"buoy-highlight-detail-measure-h",style:V.measurementValue,children:Math.round(e.measurements.height)})]})]})]})}function Uo({label:e,value:t}){let n=`buoy-highlight-detail-id-${e.toLowerCase()}`;return re(d,{testID:n,style:V.detailRow,children:[$(p,{style:V.detailLabel,children:e}),$(p,{testID:`${n}-value`,style:V.detailValue,numberOfLines:1,children:t})]})}function Gu({render:e,onAddFilter:t}){let[n,o]=aa(null),r=En(()=>{let c=[];return e.nativeID&&c.push({type:"nativeID",value:e.nativeID,label:"nativeID"}),e.testID&&c.push({type:"testID",value:e.testID,label:"testID"}),e.accessibilityLabel&&c.push({type:"accessibilityLabel",value:e.accessibilityLabel,label:"a11y"}),e.componentName&&c.push({type:"component",value:e.componentName,label:"component"}),c.push({type:"viewType",value:e.viewType,label:"viewType"}),c},[e]),i=n!==null?r[n]:null,s=Yt(c=>{o(u=>u===c?null:c)},[]),a=Yt(()=>{i&&(t({type:i.type,value:i.value},"include"),o(null))},[i,t]),l=Yt(()=>{i&&(t({type:i.type,value:i.value},"exclude"),o(null))},[i,t]);return re(d,{testID:"buoy-highlight-quick",style:V.quickActionsSection,children:[$(p,{style:V.quickActionsTitle,children:"Quick Filters"}),$(d,{style:V.filterOptionsList,children:r.map((c,u)=>$(Ku,{testID:`buoy-highlight-quick-${c.type.toLowerCase()}`,label:c.label,value:c.value,isSelected:n===u,onSelect:()=>s(u)},c.type))}),re(d,{style:V.filterActionButtons,children:[re(q,{testID:"buoy-highlight-quick-include",accessibilityRole:"button",accessibilityLabel:"Only show this",style:[V.filterActionButton,V.filterActionButtonInclude,!i&&V.filterActionButtonDisabled],onPress:a,disabled:!i,activeOpacity:.7,children:[$(Ou,{size:14,color:i?B.color.accent:B.color.textTertiary}),$(p,{style:[V.filterActionButtonText,{color:i?B.color.accent:B.color.textTertiary}],children:"Only Show This"})]}),re(q,{testID:"buoy-highlight-quick-exclude",accessibilityRole:"button",accessibilityLabel:"Hide this",style:[V.filterActionButton,V.filterActionButtonExclude,!i&&V.filterActionButtonDisabled],onPress:l,disabled:!i,activeOpacity:.7,children:[$(Mu,{size:14,color:i?B.color.danger:B.color.textTertiary}),$(p,{style:[V.filterActionButtonText,{color:i?B.color.danger:B.color.textTertiary}],children:"Hide This"})]})]})]})}function Ku({testID:e,label:t,value:n,isSelected:o,onSelect:r}){return re(q,{testID:e,accessibilityRole:"button",accessibilityLabel:`${t}, ${n}`,style:[V.filterOptionCard,o&&V.filterOptionCardSelected],onPress:r,activeOpacity:.7,children:[$(p,{style:[V.filterOptionLabel,o&&V.filterOptionLabelSelected],children:t}),$(p,{testID:e?`${e}-value`:void 0,style:[V.filterOptionValue,o&&V.filterOptionValueSelected],numberOfLines:1,children:n})]})}var V=oe.create({container:{flex:1,backgroundColor:"transparent"},header:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:12,padding:16,paddingBottom:0},scrollView:{flex:1},scrollContent:{padding:16,paddingTop:12,paddingBottom:80,gap:12},headerLeft:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:10},componentName:{fontSize:18,fontWeight:"700",color:B.color.text,flexShrink:1},nativeTypeBadge:{backgroundColor:B.color.bg,paddingVertical:3,paddingHorizontal:8,borderRadius:4},nativeTypeText:{fontSize:11,fontWeight:"600",color:B.color.textTertiary,fontFamily:St},answerCard:{backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:12,gap:6},causeBadgeRow:{flexDirection:"row",alignItems:"center",gap:8},causeBadgeLarge:{paddingVertical:4,paddingHorizontal:10,borderRadius:4},causeBadgeLargeText:{fontSize:11,fontWeight:"700",letterSpacing:.5},causeLabel:{fontSize:12,color:B.color.textSecondary,fontWeight:"500"},hookChangesContainer:{gap:6},hookDiffContainer:{backgroundColor:B.color.bg,borderRadius:6,overflow:"hidden"},propsChangesContainer:{flexDirection:"row",flexWrap:"wrap",gap:4},propChangeChip:{backgroundColor:B.color.bg,paddingVertical:2,paddingHorizontal:6,borderRadius:4},propChangeText:{fontSize:11,color:B.color.text,fontFamily:St},detailsSection:{gap:10},detailsCard:{backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:12,gap:6},detailsCardTitle:{fontSize:10,fontWeight:"600",color:B.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:4},detailRow:{flexDirection:"row",alignItems:"center",gap:8},detailLabel:{fontSize:11,fontWeight:"600",color:B.color.textSecondary,minWidth:55},detailValue:{fontSize:12,color:B.color.text,fontFamily:St,flex:1},statsRow:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,paddingVertical:10,paddingHorizontal:16},statItem:{flex:1,alignItems:"center"},statValue:{fontSize:16,fontWeight:"700",color:B.color.text,fontFamily:St},statLabel:{fontSize:10,color:B.color.textTertiary,marginTop:2},statDivider:{width:1,height:24,backgroundColor:B.color.border,marginHorizontal:12},measurementsRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-around",backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,paddingVertical:8,paddingHorizontal:12},measurementItem:{flexDirection:"row",alignItems:"baseline",gap:4},measurementLabel:{fontSize:10,fontWeight:"600",color:B.color.textTertiary,textTransform:"uppercase"},measurementValue:{fontSize:12,fontWeight:"600",color:B.color.text,fontFamily:St},quickActionsSection:{backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.border,padding:12,gap:10},quickActionsTitle:{fontSize:10,fontWeight:"600",color:B.color.textTertiary,letterSpacing:.5,textTransform:"uppercase",marginBottom:2},filterOptionsList:{gap:6},filterOptionCard:{flexDirection:"row",alignItems:"center",backgroundColor:B.color.surfaceElevated,borderRadius:6,paddingVertical:10,paddingHorizontal:12,borderWidth:1,borderColor:"transparent",gap:10},filterOptionCardSelected:{borderColor:B.color.accentBorderStrong,backgroundColor:B.color.accentSoft},filterOptionLabel:{fontSize:10,fontWeight:"600",color:B.color.textTertiary,minWidth:70},filterOptionLabelSelected:{color:B.color.accent},filterOptionValue:{fontSize:12,color:B.color.text,fontFamily:St,flex:1},filterOptionValueSelected:{color:B.color.text},filterActionButtons:{flexDirection:"row",gap:8,marginTop:12},filterActionButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:4,paddingVertical:8,paddingHorizontal:10,borderRadius:6,borderWidth:1},filterActionButtonInclude:{backgroundColor:B.color.accentSoft,borderColor:B.color.accentBorderStrong},filterActionButtonExclude:{backgroundColor:B.color.dangerSoft,borderColor:B.color.danger+"40"},filterActionButtonDisabled:{backgroundColor:B.color.surfaceElevated,borderColor:B.color.border,opacity:.5},filterActionButtonText:{fontSize:11,fontWeight:"600"},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:B.color.surface,borderRadius:8,borderWidth:1,borderColor:B.color.warning+"40",paddingVertical:12,paddingHorizontal:16,gap:8},lockedBannerText:{color:B.color.warning,fontSize:13,fontWeight:"600"},lockedBannerSubtext:{color:B.color.textTertiary,fontSize:12}});import{EventStepperFooter as sp}from"@buoy-gg/shared-ui/web";P();import{useState as it,useCallback as rt}from"react";import{Eye as ua,Filter as Qo,Plus as da,X as Nn,Box as ma,Settings as Qu,Hash as Zu,SectionHeader as ae,night as x,monoFont as It}from"@buoy-gg/shared-ui/web";P();import{Box as ju,Hash as sa,Layers as qu,Eye as Xu,Search as Yu,FileCode as Ju,buoyColors as Ko,night as ca,monoFont as la}from"@buoy-gg/shared-ui/web";import{jsx as xt,jsxs as jo}from"react/jsx-runtime";var qo={viewType:{label:"ViewType",shortLabel:"View",color:ca.color.accent,icon:ju},testID:{label:"testID",shortLabel:"test",color:Ko.success,icon:sa},nativeID:{label:"nativeID",shortLabel:"native",color:"#f59e0b",icon:sa},component:{label:"Component",shortLabel:"Comp",color:"#a855f7",icon:Ju},accessibilityLabel:{label:"a11y",shortLabel:"a11y",color:"#ec4899",icon:Xu},nativeTag:{label:"tag",shortLabel:"tag",color:Ko.textMuted,icon:qu},any:{label:"Any",shortLabel:"Any",color:Ko.warning,icon:Yu}};function nt({type:e,value:t,compact:n=!1,badgeOnly:o=!1,valueOnly:r=!1,shortLabel:i=!1,showIcon:s=!1,testID:a}){let l=qo[e],c=l.icon,u=i?l.shortLabel:l.label;return r?xt(p,{testID:a?`${a}-value`:void 0,style:[Te.valueOnly,n&&Te.valueOnlyCompact,{color:l.color}],numberOfLines:1,children:t}):o?jo(d,{testID:a,style:[Te.badgeOnly,n&&Te.badgeOnlyCompact,{backgroundColor:l.color+"20",borderColor:l.color+"40"}],children:[s&&xt(c,{size:n?10:12,color:l.color}),xt(p,{style:[Te.badgeOnlyText,n&&Te.badgeOnlyTextCompact,{color:l.color}],children:u})]}):jo(d,{testID:a,accessibilityLabel:`${l.label} ${t}`,style:[Te.container,n&&Te.containerCompact],children:[jo(d,{style:[Te.badge,n&&Te.badgeCompact,{backgroundColor:l.color+"20"}],children:[s&&xt(c,{size:n?8:10,color:l.color}),xt(p,{style:[Te.badgeText,n&&Te.badgeTextCompact,{color:l.color}],children:u})]}),xt(p,{testID:a?`${a}-value`:void 0,style:[Te.value,n&&Te.valueCompact],numberOfLines:1,children:t})]})}var Te=oe.create({container:{flexDirection:"row",alignItems:"center",gap:6},containerCompact:{gap:4},badge:{flexDirection:"row",alignItems:"center",paddingVertical:3,paddingHorizontal:6,borderRadius:4,gap:4},badgeCompact:{paddingVertical:2,paddingHorizontal:5,gap:3},badgeText:{fontSize:10,fontWeight:"700"},badgeTextCompact:{fontSize:9},value:{fontSize:12,color:ca.color.text,fontFamily:la,flex:1},valueCompact:{fontSize:11},badgeOnly:{flexDirection:"row",alignItems:"center",paddingVertical:4,paddingHorizontal:8,borderRadius:6,borderWidth:1,gap:5},badgeOnlyCompact:{paddingVertical:2,paddingHorizontal:6,borderRadius:4,gap:4},badgeOnlyText:{fontSize:11,fontWeight:"600"},badgeOnlyTextCompact:{fontSize:9,fontWeight:"700"},valueOnly:{fontSize:12,fontFamily:la},valueOnlyCompact:{fontSize:11},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCount:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCountText:{fontSize:10,fontWeight:"600"}});P();function Rt(e){return String(e).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function Xo(e){return`buoy-highlight-row-${Rt(e)}`}function Yo(e,t){return`buoy-highlight-detected-${Rt(e)}-${Rt(t)}`}function Jo(e,t,n){return`buoy-highlight-${e}-chip-${Rt(t)}-${Rt(n)}`}function ot(e){return`buoy-highlight-setting-${e}`}import{Fragment as er,jsx as b,jsxs as F}from"react/jsx-runtime";var Jt=e=>qo[e],ed=["any","viewType","testID","nativeID","component","accessibilityLabel"];function pa({mode:e,onSelect:t,onCancel:n}){return F(d,{nativeID:"__rn_buoy__type-picker",testID:`buoy-highlight-${e}-types`,style:g.typePicker,children:[b(d,{style:g.typePickerRow,children:ed.map(o=>{let r=Jt(o),i=r.icon;return F(q,{testID:`buoy-highlight-${e}-type-${o.toLowerCase()}`,accessibilityRole:"button",accessibilityLabel:r.label,style:[g.typeOption,{backgroundColor:r.color+"15",borderColor:r.color+"40"}],onPress:()=>t(o),children:[b(i,{size:14,color:r.color}),b(p,{style:[g.typeOptionText,{color:r.color}],children:r.label})]},o)})}),b(q,{testID:`buoy-highlight-${e}-types-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:n,style:g.typePickerCancel,children:b(Nn,{size:16,color:x.color.textTertiary})})]})}function ga({mode:e,type:t,onSubmit:n,onCancel:o}){let[r,i]=it(""),s=Jt(t),a=()=>{r.trim()&&n(r.trim())};return F(d,{nativeID:"__rn_buoy__pattern-input",testID:`buoy-highlight-${e}-input-row`,style:g.patternInputContainer,children:[b(nt,{type:t,value:"",badgeOnly:!0,compact:!0}),b(Bt,{testID:`buoy-highlight-${e}-input`,value:r,onChangeText:i,onSubmitEditing:a,placeholder:"Enter pattern...",placeholderTextColor:x.color.placeholder,style:g.patternInput,autoFocus:!0,returnKeyType:"done",autoCorrect:!1,autoCapitalize:"none"}),r.trim()&&b(q,{testID:`buoy-highlight-${e}-submit`,accessibilityRole:"button",accessibilityLabel:"Add pattern",onPress:a,style:[g.addPatternButton,{backgroundColor:s.color+"20"}],children:b(p,{style:[g.addPatternButtonText,{color:s.color}],children:"Add"})}),b(q,{testID:`buoy-highlight-${e}-input-cancel`,accessibilityRole:"button",accessibilityLabel:"Cancel",onPress:o,style:g.cancelButton,children:b(Nn,{size:16,color:x.color.textTertiary})})]})}function fa({mode:e,pattern:t,onRemove:n}){let o=Jt(t.type);return F(q,{testID:Jo(e,t.type,t.value),accessibilityRole:"button",accessibilityLabel:`${o.label} ${t.value}, tap to remove`,style:[g.patternChip,{borderColor:o.color+"40"}],onPress:n,activeOpacity:.7,children:[b(d,{style:[g.patternChipBadge,{backgroundColor:o.color+"20"}],children:b(p,{style:[g.patternChipBadgeText,{color:o.color}],children:o.shortLabel})}),b(p,{style:g.patternChipValue,numberOfLines:1,children:t.value}),b(Nn,{size:12,color:x.color.textTertiary,style:g.patternChipX})]})}var td={label:"All",shortLabel:"All",color:x.color.textSecondary,icon:ma};function kt({filterType:e,count:t,isSelected:n,onPress:o}){let r=e==="all"?td:Jt(e),i=`buoy-highlight-detected-cat-${String(e).toLowerCase()}`;return F(q,{testID:i,accessibilityRole:"button",accessibilityLabel:`${r.label}, ${t}`,style:[g.categoryBadge,{backgroundColor:r.color+"15",borderColor:n?r.color:r.color+"40",borderWidth:n?2:1}],onPress:o,children:[b(r.icon,{size:12,color:r.color}),b(p,{style:[g.categoryBadgeText,{color:r.color}],children:r.label}),b(d,{style:[g.categoryBadgeCountBubble,{backgroundColor:r.color+"25"}],children:b(p,{testID:`${i}-count`,style:[g.categoryBadgeCount,{color:r.color}],children:t})})]})}var nd=[{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"},{value:150,label:"150"},{value:250,label:"250"},{value:500,label:"500"}],Zo=[{value:"off",label:"Off",description:"No debug logging"},{value:"minimal",label:"Minimal",description:"Only hook value changes"},{value:"verbose",label:"Verbose",description:"Component + cause + changes"},{value:"all",label:"All",description:"Full fiber dump"}];function tr({filters:e,onFilterChange:t,settings:n,onSettingsChange:o,availableProps:r,activeTab:i}){let[s,a]=it(!1),[l,c]=it(!1),[u,y]=it(null),[v,S]=it(null),[C,T]=it("all"),[h,f]=it(null),R=(w=>{switch(w){case"viewType":return r.viewTypes.map(H=>({value:H,type:"viewType"}));case"testID":return r.testIDs.map(H=>({value:H,type:"testID"}));case"nativeID":return r.nativeIDs.map(H=>({value:H,type:"nativeID"}));case"component":return r.componentNames.map(H=>({value:H,type:"component"}));case"accessibilityLabel":return r.accessibilityLabels.map(H=>({value:H,type:"accessibilityLabel"}));case"all":default:return[...r.viewTypes.map(H=>({value:H,type:"viewType"})),...r.testIDs.map(H=>({value:H,type:"testID"})),...r.nativeIDs.map(H=>({value:H,type:"nativeID"})),...r.componentNames.map(H=>({value:H,type:"component"})),...r.accessibilityLabels.map(H=>({value:H,type:"accessibilityLabel"}))]}})(C),L=r.viewTypes.length+r.testIDs.length+r.nativeIDs.length+r.componentNames.length+r.accessibilityLabels.length,D=rt((w,H)=>{let pe=[...e.includePatterns,{type:w,value:H}];t({includePatterns:pe}),y(null)},[e.includePatterns,t]),k=rt((w,H)=>{let pe=[...e.excludePatterns,{type:w,value:H}];t({excludePatterns:pe}),S(null)},[e.excludePatterns,t]),U=rt(w=>{let H=e.includePatterns.filter((pe,ye)=>ye!==w);t({includePatterns:H})},[e.includePatterns,t]),ee=rt(w=>{let H=e.excludePatterns.filter((pe,ye)=>ye!==w);t({excludePatterns:H})},[e.excludePatterns,t]),G=rt((w,H)=>{f({type:w,value:H})},[]),M=rt(()=>{h&&(D(h.type,h.value),f(null))},[h,D]),ne=rt(()=>{h&&(k(h.type,h.value),f(null))},[h,k]);return b(d,{style:g.container,children:b(Re,{nativeID:"__rn_buoy__filter-view",testID:"buoy-highlight-filter-scroll",style:g.scrollView,contentContainerStyle:g.scrollContent,showsVerticalScrollIndicator:!1,children:i==="filters"?F(er,{children:[F(d,{style:g.section,children:[F(ae,{children:[b(ae.Icon,{icon:ua,color:x.color.accent,size:12}),b(ae.Title,{children:"INCLUDE ONLY"}),e.includePatterns.length>0&&b(ae.Badge,{testID:"buoy-highlight-include-count",count:e.includePatterns.length,color:x.color.accent})]}),b(p,{style:g.sectionDescription,children:"Show only components matching these patterns. If any are set, components must match at least one."}),e.includePatterns.length>0&&b(d,{style:g.patternChips,children:e.includePatterns.map((w,H)=>b(fa,{mode:"include",pattern:w,onRemove:()=>U(H)},`${w.type}-${w.value}-${H}`))}),b(d,{style:g.addPatternRow,children:s?b(pa,{mode:"include",onSelect:w=>{a(!1),y(w)},onCancel:()=>a(!1)}):u?b(ga,{mode:"include",type:u,onSubmit:w=>D(u,w),onCancel:()=>y(null)}):F(q,{testID:"buoy-highlight-include-add",accessibilityRole:"button",accessibilityLabel:"Add include pattern",style:[g.addButton,{borderColor:x.color.accentBorderStrong}],onPress:()=>a(!0),children:[b(da,{size:14,color:x.color.accent}),b(p,{style:[g.addButtonText,{color:x.color.accent}],children:"Add include pattern"})]})})]}),F(d,{style:g.section,children:[F(ae,{children:[b(ae.Icon,{icon:Qo,color:x.color.accent,size:12}),b(ae.Title,{children:"EXCLUDE"}),e.excludePatterns.length>0&&b(ae.Badge,{testID:"buoy-highlight-exclude-count",count:e.excludePatterns.length,color:x.color.accent})]}),b(p,{style:g.sectionDescription,children:"Hide components matching these patterns from the list."}),e.excludePatterns.length>0&&b(d,{style:g.patternChips,children:e.excludePatterns.map((w,H)=>b(fa,{mode:"exclude",pattern:w,onRemove:()=>ee(H)},`${w.type}-${w.value}-${H}`))}),b(d,{style:g.addPatternRow,children:l?b(pa,{mode:"exclude",onSelect:w=>{c(!1),S(w)},onCancel:()=>c(!1)}):v?b(ga,{mode:"exclude",type:v,onSubmit:w=>k(v,w),onCancel:()=>S(null)}):F(q,{testID:"buoy-highlight-exclude-add",accessibilityRole:"button",accessibilityLabel:"Add exclude pattern",style:[g.addButton,{borderColor:x.color.accentBorderStrong}],onPress:()=>c(!0),children:[b(da,{size:14,color:x.color.accent}),b(p,{style:[g.addButtonText,{color:x.color.accent}],children:"Add exclude pattern"})]})})]}),F(d,{style:g.section,children:[F(ae,{children:[b(ae.Icon,{icon:Zu,color:x.color.warning,size:12}),b(ae.Title,{children:"RENDER COUNT RANGE"}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&b(ae.Badge,{count:1,color:x.color.warning})]}),b(p,{style:g.sectionDescription,children:"Show only components with render count in a specific range."}),F(d,{nativeID:"__rn_buoy__render-count-range",testID:"buoy-highlight-range",style:g.renderCountRangeContainer,children:[F(d,{style:g.renderCountInputRow,children:[F(d,{style:g.renderCountInputGroup,children:[b(p,{style:g.renderCountLabel,children:"Min"}),b(Bt,{value:e.minRenderCount!==void 0?String(e.minRenderCount):"",onChangeText:w=>{let H=parseInt(w,10);w===""||w===void 0?t({minRenderCount:void 0}):!isNaN(H)&&H>=0&&t({minRenderCount:H})},testID:"buoy-highlight-range-min",placeholder:"0",placeholderTextColor:x.color.placeholder,style:g.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]}),b(p,{style:g.renderCountSeparator,children:"to"}),F(d,{style:g.renderCountInputGroup,children:[b(p,{style:g.renderCountLabel,children:"Max"}),b(Bt,{value:e.maxRenderCount!==void 0?String(e.maxRenderCount):"",onChangeText:w=>{let H=parseInt(w,10);w===""||w===void 0?t({maxRenderCount:void 0}):!isNaN(H)&&H>=0&&t({maxRenderCount:H})},testID:"buoy-highlight-range-max",placeholder:"\u221E",placeholderTextColor:x.color.placeholder,style:g.renderCountInput,keyboardType:"number-pad",returnKeyType:"done"})]})]}),(e.minRenderCount!==void 0||e.maxRenderCount!==void 0)&&F(q,{testID:"buoy-highlight-range-clear",accessibilityRole:"button",accessibilityLabel:"Clear range",style:g.clearRangeButton,onPress:()=>t({minRenderCount:void 0,maxRenderCount:void 0}),children:[b(Nn,{size:12,color:x.color.warning}),b(p,{style:g.clearRangeButtonText,children:"Clear Range"})]})]})]}),F(d,{style:g.section,children:[F(ae,{children:[b(ae.Icon,{icon:ma,color:x.color.textSecondary,size:12}),b(ae.Title,{children:"DETECTED ITEMS"})]}),b(p,{style:g.sectionDescription,children:"Tap an item to quickly add it as an exclude pattern."}),F(Re,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:g.categoryBadgeScroll,contentContainerStyle:g.categoryBadgeScrollContent,children:[L>0&&b(kt,{filterType:"all",count:L,isSelected:C==="all",onPress:()=>T("all")}),r.viewTypes.length>0&&b(kt,{filterType:"viewType",count:r.viewTypes.length,isSelected:C==="viewType",onPress:()=>T("viewType")}),r.testIDs.length>0&&b(kt,{filterType:"testID",count:r.testIDs.length,isSelected:C==="testID",onPress:()=>T("testID")}),r.nativeIDs.length>0&&b(kt,{filterType:"nativeID",count:r.nativeIDs.length,isSelected:C==="nativeID",onPress:()=>T("nativeID")}),r.componentNames.length>0&&b(kt,{filterType:"component",count:r.componentNames.length,isSelected:C==="component",onPress:()=>T("component")}),r.accessibilityLabels.length>0&&b(kt,{filterType:"accessibilityLabel",count:r.accessibilityLabels.length,isSelected:C==="accessibilityLabel",onPress:()=>T("accessibilityLabel")})]}),b(d,{nativeID:"__rn_buoy__detected-items",testID:"buoy-highlight-detected",style:g.detectedItemsContainer,children:R.length>0?b(Re,{testID:"buoy-highlight-detected-scroll",style:g.detectedItemsScroll,contentContainerStyle:g.detectedItems,nestedScrollEnabled:!0,showsVerticalScrollIndicator:!0,children:R.map(w=>{let H=Jt(w.type);return b(q,{testID:Yo(w.type,w.value),accessibilityRole:"button",accessibilityLabel:`${H.label} ${w.value}`,style:[g.detectedItem,{borderColor:H.color+"40"}],onPress:()=>G(w.type,w.value),children:C==="all"?b(nt,{type:w.type,value:w.value,compact:!0,shortLabel:!0}):b(p,{style:g.detectedItemText,numberOfLines:1,children:w.value})},`${w.type}-${w.value}`)})}):b(p,{testID:"buoy-highlight-detected-empty",style:g.emptyText,children:"No items detected yet. Start tracking to see components here."})})]}),b(ao,{visible:h!==null,transparent:!0,animationType:"fade",onRequestClose:()=>f(null),children:b(io,{accessible:!1,testID:"buoy-highlight-detected-popup-backdrop",style:g.modalOverlay,onPress:()=>f(null),children:b(d,{accessible:!1,testID:"buoy-highlight-detected-popup",style:g.actionPopup,children:h&&F(er,{children:[b(d,{style:g.actionPopupHeader,children:b(nt,{type:h.type,value:h.value,compact:!0,shortLabel:!0})}),F(d,{style:g.actionPopupButtons,children:[F(q,{testID:"buoy-highlight-detected-popup-include",accessibilityRole:"button",accessibilityLabel:"Include only",style:[g.actionPopupButton,g.actionPopupInclude],onPress:M,children:[b(ua,{size:16,color:x.color.accent}),b(p,{style:[g.actionPopupButtonText,{color:x.color.accent}],children:"Include Only"})]}),F(q,{testID:"buoy-highlight-detected-popup-exclude",accessibilityRole:"button",accessibilityLabel:"Exclude",style:[g.actionPopupButton,g.actionPopupExclude],onPress:ne,children:[b(Qo,{size:16,color:x.color.accent}),b(p,{style:[g.actionPopupButtonText,{color:x.color.accent}],children:"Exclude"})]})]}),b(q,{testID:"buoy-highlight-detected-popup-cancel",accessibilityRole:"button",accessibilityLabel:"Cancel",style:g.actionPopupCancel,onPress:()=>f(null),children:b(p,{style:g.actionPopupCancelText,children:"Cancel"})})]})})})}),F(d,{style:g.section,children:[F(ae,{children:[b(ae.Icon,{icon:Qo,color:x.color.textTertiary,size:12}),b(ae.Title,{children:"HOW FILTERS WORK"})]}),b(d,{style:g.howItWorks,children:F(p,{style:g.howItWorksText,children:[b(p,{style:g.howItWorksBold,children:"Any:"})," Matches against all fields",`
34
+ `,b(p,{style:g.howItWorksBold,children:"ViewType:"})," Native component class (RCTView, RCTText)",`
35
+ `,b(p,{style:g.howItWorksBold,children:"testID:"})," Component testID prop",`
36
+ `,b(p,{style:g.howItWorksBold,children:"Component:"})," React component name from fiber"]})})]})]}):b(er,{children:F(d,{style:g.section,children:[F(ae,{children:[b(ae.Icon,{icon:Qu,color:x.color.textTertiary,size:12}),b(ae.Title,{children:"SETTINGS"})]}),F(d,{style:g.settingsSection,children:[F(d,{style:g.settingItem,children:[F(d,{style:g.settingHeader,children:[b(p,{style:g.settingLabel,children:"Show Render Count"}),b(Ye,{testID:ot("showRenderCount"),value:n.showRenderCount,onValueChange:w=>{o({showRenderCount:w}),!w&&n.trackRenderCauses&&o({trackRenderCauses:!1})},trackColor:{false:x.color.surfaceElevated,true:x.color.accent+"80"},thumbColor:n.showRenderCount?x.color.accent:x.color.knob})]}),b(p,{style:g.settingDescription,children:"Display render count badge on highlights. Disabling improves performance by skipping count tracking."})]}),F(d,{style:[g.settingItem,g.settingItemSpaced],children:[F(d,{style:g.settingHeader,children:[b(p,{style:[g.settingLabel,!n.showRenderCount&&g.settingLabelDisabled],children:"Track Render Causes"}),b(Ye,{testID:ot("trackRenderCauses"),value:n.trackRenderCauses,onValueChange:w=>o({trackRenderCauses:w}),trackColor:{false:x.color.surfaceElevated,true:x.color.warning+"80"},thumbColor:n.trackRenderCauses?x.color.warning:x.color.knob,disabled:!n.showRenderCount})]}),F(p,{style:g.settingDescription,children:["Detect WHY components render (props, hooks, parent re-render).",!n.showRenderCount&&F(p,{style:g.settingWarning,children:[`
37
+ `,'Requires "Show Render Count" to be enabled.']})]})]}),F(d,{style:[g.settingItem,g.settingItemSpaced],children:[F(d,{style:g.settingHeader,children:[b(p,{style:[g.settingLabel,!n.trackRenderCauses&&g.settingLabelDisabled],children:"Enable Render History"}),b(Ye,{testID:ot("enableRenderHistory"),value:n.enableRenderHistory,onValueChange:w=>o({enableRenderHistory:w}),trackColor:{false:x.color.surfaceElevated,true:x.color.accent+"80"},thumbColor:n.enableRenderHistory?x.color.accent:x.color.knob,disabled:!n.trackRenderCauses})]}),F(p,{style:g.settingDescription,children:["Store render events for each component to view in the History tab.",!n.trackRenderCauses&&F(p,{style:g.settingWarning,children:[`
38
+ `,'Requires "Track Render Causes" to be enabled.']})]})]}),F(d,{style:[g.settingItem,g.settingItemSpaced],children:[F(d,{style:g.settingHeader,children:[b(p,{style:g.settingLabel,children:"Debug Log Level"}),b(d,{style:g.settingValue,children:b(p,{testID:"buoy-highlight-setting-debugLogLevel-value",style:[g.settingValueText,n.debugLogLevel!=="off"&&{color:x.color.warning}],children:Zo.find(w=>w.value===n.debugLogLevel)?.label||"Off"})})]}),b(p,{style:g.settingDescription,children:"Control console logging verbosity for render cause detection."}),b(d,{style:g.batchSizePresets,children:Zo.map(w=>b(q,{style:[g.batchSizePreset,n.debugLogLevel===w.value&&g.batchSizePresetActive,w.value!=="off"&&n.debugLogLevel===w.value&&{backgroundColor:x.color.warningSoft,borderColor:x.color.warning}],onPress:()=>o({debugLogLevel:w.value}),testID:`buoy-highlight-preset-log-${w.value}`,accessibilityRole:"button",accessibilityLabel:`Debug log level ${w.label}`,children:b(p,{style:[g.batchSizePresetText,n.debugLogLevel===w.value&&g.batchSizePresetTextActive,w.value!=="off"&&n.debugLogLevel===w.value&&{color:x.color.warning}],children:w.label})},w.value))}),F(p,{style:g.settingDescriptionMuted,children:[Zo.find(w=>w.value===n.debugLogLevel)?.description,n.debugLogLevel!=="off"&&" \u2022 Check Metro console for logs"]})]}),F(d,{style:[g.settingItem,g.settingItemSpaced],children:[F(d,{style:g.settingHeader,children:[b(p,{style:g.settingLabel,children:"Batch Size"}),b(d,{style:g.settingValue,children:b(p,{testID:"buoy-highlight-setting-batchSize-value",style:g.settingValueText,children:n.batchSize})})]}),b(p,{style:g.settingDescription,children:"Maximum components to highlight per render update. Higher values capture more re-renders but may impact performance on complex screens."}),b(d,{style:g.batchSizePresets,children:nd.map(w=>b(q,{style:[g.batchSizePreset,n.batchSize===w.value&&g.batchSizePresetActive],onPress:()=>o({batchSize:w.value}),testID:`buoy-highlight-preset-batch-${w.value}`,accessibilityRole:"button",accessibilityLabel:`Batch size ${w.label}`,children:b(p,{style:[g.batchSizePresetText,n.batchSize===w.value&&g.batchSizePresetTextActive],children:w.label})},w.value))})]}),F(d,{style:[g.settingItem,g.settingItemSpaced],children:[F(d,{style:g.settingHeader,children:[b(p,{style:g.settingLabel,children:"Show host views"}),b(Ye,{testID:ot("showHostViews"),value:!!n.showHostViews,onValueChange:w=>o({showHostViews:w}),trackColor:{false:x.color.surfaceElevated,true:x.color.accent+"80"},thumbColor:n.showHostViews?x.color.accent:x.color.knob})]}),b(p,{style:g.settingDescription,children:"Include anonymous View / RCTView / Text hosts. Off by default so the list is named composites (what actually re-rendered)."})]}),F(d,{style:[g.settingItem,g.settingItemSpaced],children:[F(d,{style:g.settingHeader,children:[b(p,{style:g.settingLabel,children:"Highlight Dev Tools"}),b(Ye,{testID:ot("excludeDevTools"),value:!n.excludeDevTools,onValueChange:w=>o({excludeDevTools:!w}),trackColor:{false:x.color.surfaceElevated,true:x.color.accent+"80"},thumbColor:n.excludeDevTools?x.color.knob:x.color.accent})]}),F(p,{style:g.settingDescription,children:["Show re-render highlights on Buoy dev tools (floating menu, modals, etc.). Useful for optimizing the dev tools themselves.",!n.excludeDevTools&&F(p,{style:g.settingWarning,children:[`
39
+ `,"The highlight overlay is always excluded to prevent infinite loops."]})]})]})]})]})})})})}var g=oe.create({container:{flex:1,backgroundColor:"transparent"},scrollView:{flex:1},scrollContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:32},section:{backgroundColor:x.color.surface,borderRadius:8,borderWidth:1,borderColor:x.color.border,marginBottom:12,overflow:"hidden"},sectionDescription:{fontSize:11,color:x.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:16},patternChips:{flexDirection:"row",flexWrap:"wrap",gap:8,paddingHorizontal:16,paddingTop:12},patternChip:{flexDirection:"row",alignItems:"center",backgroundColor:x.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:4,paddingLeft:4,paddingRight:6,maxWidth:"100%",gap:4},patternChipBadge:{paddingVertical:2,paddingHorizontal:5,borderRadius:4},patternChipBadgeText:{fontSize:9,fontWeight:"700"},patternChipValue:{fontSize:11,color:x.color.text,fontFamily:It,flexShrink:1},patternChipX:{marginLeft:2},addPatternRow:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},addButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderStyle:"dashed",gap:6},addButtonText:{fontSize:12,fontWeight:"500"},typePicker:{flexDirection:"row",alignItems:"center",gap:8},typePickerRow:{flex:1,flexDirection:"row",flexWrap:"wrap",gap:8},typeOption:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,borderWidth:1,backgroundColor:x.color.surfaceElevated,gap:6},typeOptionText:{fontSize:11,fontWeight:"600"},typePickerCancel:{padding:8},patternInputContainer:{flexDirection:"row",alignItems:"center",backgroundColor:x.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:x.color.border,paddingLeft:4,paddingRight:8,paddingVertical:4,gap:4},patternInput:{flex:1,fontSize:12,color:x.color.text,paddingVertical:6,paddingHorizontal:4},addPatternButton:{paddingVertical:6,paddingHorizontal:10,borderRadius:4},addPatternButtonText:{fontSize:11,fontWeight:"600"},cancelButton:{padding:4},categoryBadgeScroll:{marginTop:12},categoryBadgeScrollContent:{paddingHorizontal:16,gap:8},categoryBadge:{flexDirection:"row",alignItems:"center",paddingVertical:8,paddingLeft:10,paddingRight:6,borderRadius:8,borderWidth:1,gap:6},categoryBadgeText:{fontSize:11,fontWeight:"600"},categoryBadgeCountBubble:{paddingHorizontal:6,paddingVertical:2,borderRadius:10,minWidth:20,alignItems:"center"},categoryBadgeCount:{fontSize:10,fontWeight:"600"},detectedItemsContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16},detectedItemsScroll:{maxHeight:200},detectedItems:{flexDirection:"row",flexWrap:"wrap",gap:8},detectedItem:{flexDirection:"row",alignItems:"center",backgroundColor:x.color.surfaceElevated,borderRadius:6,borderWidth:1,paddingVertical:6,paddingHorizontal:10,gap:6},detectedItemText:{fontSize:11,color:x.color.text,fontFamily:It},emptyText:{fontSize:11,color:x.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:16,paddingHorizontal:16},howItWorks:{paddingHorizontal:16,paddingVertical:12},howItWorksText:{fontSize:11,color:x.color.textTertiary,lineHeight:18,fontFamily:It},howItWorksBold:{fontWeight:"700",color:x.color.textSecondary},modalOverlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.5)",justifyContent:"center",alignItems:"center",padding:32},actionPopup:{backgroundColor:x.color.surface,borderRadius:12,borderWidth:1,borderColor:x.color.border,width:"100%",maxWidth:300,overflow:"hidden"},actionPopupHeader:{padding:16,borderBottomWidth:1,borderBottomColor:x.color.separator,alignItems:"center"},actionPopupButtons:{flexDirection:"row",padding:12,gap:8},actionPopupButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:12,borderRadius:8,gap:8},actionPopupInclude:{backgroundColor:x.color.accentSoft},actionPopupExclude:{backgroundColor:x.color.accentSoft},actionPopupButtonText:{fontSize:13,fontWeight:"600"},actionPopupCancel:{padding:12,borderTopWidth:1,borderTopColor:x.color.separator,alignItems:"center"},actionPopupCancelText:{fontSize:13,color:x.color.textTertiary,fontWeight:"500"},settingsSection:{paddingHorizontal:16,paddingTop:8,paddingBottom:16},settingItem:{gap:8},settingItemSpaced:{marginTop:16,paddingTop:16,borderTopWidth:1,borderTopColor:x.color.separator},settingHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},settingLabel:{fontSize:13,fontWeight:"600",color:x.color.text},settingValue:{backgroundColor:x.color.fillSecondary,paddingHorizontal:10,paddingVertical:4,borderRadius:6},settingValueText:{fontSize:12,fontWeight:"700",color:x.color.textTertiary,fontFamily:It},settingDescription:{fontSize:11,color:x.color.textSecondary,lineHeight:16},settingDescriptionMuted:{fontSize:10,color:x.color.textTertiary,lineHeight:14,marginTop:4,fontStyle:"italic"},settingLabelDisabled:{color:x.color.textTertiary},settingWarning:{color:x.color.warning,fontWeight:"500"},batchSizePresets:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:4},batchSizePreset:{paddingVertical:8,paddingHorizontal:14,borderRadius:6,backgroundColor:x.color.surfaceElevated,borderWidth:1,borderColor:x.color.border},batchSizePresetActive:{backgroundColor:x.color.fillSecondary,borderColor:x.color.fillTertiary},batchSizePresetText:{fontSize:12,fontWeight:"500",color:x.color.textSecondary,fontFamily:It},batchSizePresetTextActive:{color:x.color.textTertiary,fontWeight:"700"},renderCountRangeContainer:{paddingHorizontal:16,paddingTop:12,paddingBottom:16,gap:12},renderCountInputRow:{flexDirection:"row",alignItems:"center",gap:12},renderCountInputGroup:{flex:1,gap:4},renderCountLabel:{fontSize:10,fontWeight:"600",color:x.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},renderCountInput:{backgroundColor:x.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:x.color.border,paddingVertical:10,paddingHorizontal:12,fontSize:14,fontWeight:"600",color:x.color.text,fontFamily:It,textAlign:"center"},renderCountSeparator:{fontSize:12,color:x.color.textTertiary,marginTop:18},clearRangeButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:8,paddingHorizontal:12,borderRadius:6,backgroundColor:x.color.warningSoft,borderWidth:1,borderColor:x.color.warning+"40",gap:6,alignSelf:"center"},clearRangeButtonText:{fontSize:11,fontWeight:"600",color:x.color.warning}});P();import{useState as sd,useEffect as ba,useRef as ld,useCallback as or,memo as cd,useMemo as Ta}from"react";Le();P();import od,{useMemo as ha}from"react";import{ChevronRight as rd,night as at,useRelativeTime as id,monoFont as ya}from"@buoy-gg/shared-ui/web";import{jsx as De,jsxs as Dt}from"react/jsx-runtime";function ad({render:e,onPress:t}){let n=ha(()=>e.testID?{type:"testID",value:e.testID}:e.nativeID?{type:"nativeID",value:e.nativeID}:e.componentName?{type:"component",value:e.componentName}:e.accessibilityLabel?{type:"accessibilityLabel",value:e.accessibilityLabel}:{type:"nativeTag",value:String(e.nativeTag)},[e.testID,e.nativeID,e.componentName,e.accessibilityLabel,e.nativeTag]),o=ha(()=>e.accessibilityLabel&&n.type!=="accessibilityLabel"?{type:"accessibilityLabel",value:e.accessibilityLabel}:null,[e.accessibilityLabel,n.type]),r=id(e.lastRenderTime),i=Xo(n.value);return Dt(q,{testID:i,accessibilityRole:"button",accessibilityLabel:`${e.displayName}, ${n.type} ${n.value}, ${e.renderCount} renders`,style:we.container,onPress:()=>t(e),activeOpacity:.7,children:[De(d,{style:[we.colorIndicator,{backgroundColor:e.color}]}),Dt(d,{style:we.content,children:[Dt(d,{style:we.topRow,children:[Dt(d,{style:we.viewTypeContainer,children:[De(p,{testID:`${i}-name`,style:we.viewType,numberOfLines:1,children:e.displayName}),o?De(nt,{type:o.type,value:o.value,compact:!0,shortLabel:!0}):e.displayName!==e.viewType?De(p,{testID:`${i}-type`,style:we.nativeType,numberOfLines:1,children:e.viewType}):null]}),De(d,{style:[we.renderCountBadge,{backgroundColor:e.color+"30"}],children:Dt(p,{testID:`${i}-count`,style:[we.renderCount,{color:e.color}],children:[e.renderCount,"x"]})})]}),e.lastRenderCause&&De(d,{style:we.causeRow,children:De(Fo,{testID:`${i}-cause`,cause:e.lastRenderCause,compact:!0,showKeys:!0,showTwoLevel:!0})}),Dt(d,{style:we.bottomRow,children:[De(d,{style:we.identifierContainer,children:De(nt,{testID:`${i}-identifier`,type:n.type,value:n.value,compact:!0,shortLabel:!0})}),De(p,{testID:`${i}-time`,style:we.timing,children:r})]})]}),De(rd,{size:16,color:at.color.textTertiary})]})}var nr=od.memo(ad,(e,t)=>{let n=e.render,o=t.render;return n.id===o.id&&n.renderCount===o.renderCount&&n.color===o.color&&n.lastRenderTime===o.lastRenderTime&&n.lastRenderCause?.type===o.lastRenderCause?.type&&n.lastRenderCause?.componentCause===o.lastRenderCause?.componentCause&&e.onPress===t.onPress}),we=oe.create({container:{flexDirection:"row",alignItems:"center",paddingVertical:10,paddingHorizontal:12,marginHorizontal:12,marginBottom:6,backgroundColor:at.color.surface,borderRadius:8,borderWidth:1,borderColor:at.color.border},colorIndicator:{width:4,height:36,borderRadius:2,marginRight:10},content:{flex:1,marginRight:8},topRow:{flexDirection:"row",alignItems:"center",marginBottom:4},causeRow:{marginBottom:4},viewTypeContainer:{flex:1,marginRight:8},viewType:{fontSize:13,fontWeight:"600",color:at.color.text},nativeType:{fontSize:10,color:at.color.textTertiary,fontFamily:ya,marginTop:1},accessibilityLabel:{fontSize:10,color:at.color.accent,fontStyle:"italic",marginTop:1},renderCountBadge:{paddingHorizontal:8,paddingVertical:2,borderRadius:10},renderCount:{fontSize:11,fontWeight:"700",fontFamily:ya},bottomRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:8},identifierContainer:{flex:1,flexShrink:1,overflow:"hidden"},timing:{fontSize:10,color:at.color.textTertiary,fontWeight:"500",flexShrink:0}});import{Lock as ud,night as rr,useLimit as dd,ToolEmptyState as pd,resolveListEmptyState as gd}from"@buoy-gg/shared-ui/web";import{jsx as Qt,jsxs as Ca}from"react/jsx-runtime";function fd({searchText:e,filters:t,onSelectRender:n,onStatsChange:o,onRendersChange:r,isTracking:i,isPro:s=!1}){let[a,l]=sd(()=>E.getFilteredRenders(e)),c=ld(null);ba(()=>E.subscribe(()=>{let m=E.getFilteredRenders(e);l(m),o(E.getStats()),r?.(m)}),[e,o,r]),ba(()=>{let f=E.getFilteredRenders(e);l(f),r?.(f)},[e,t,r]);let u=dd("highlightUpdates.components"),y=s?1/0:u,v=Ta(()=>a.slice(0,y),[a,y]),S=Ta(()=>Math.max(0,a.length-y),[a.length,y]),C=or(f=>f.id,[]),T=or(({item:f,index:m})=>Qt(nr,{render:f,onPress:()=>n(f,m,v)}),[n,v]),h=or(()=>S<=0?null:Ca(d,{testID:"buoy-highlight-locked",style:Hn.lockedBanner,children:[Qt(ud,{size:14,color:rr.color.warning}),Ca(p,{testID:"buoy-highlight-locked-text",style:Hn.lockedBannerText,children:[S," more ",S===1?"component":"components"," locked"]}),Qt(p,{style:Hn.lockedBannerSubtext,children:"Upgrade to Pro"})]}),[S]);if(a.length===0){let f=e.trim(),m=E.getStats().totalComponents,R=f?E.getFilteredRenders("").length:0,L=gd({subject:"components",verb:"tracked",search:e,total:f?R:m,capturing:i,blocked:f&&R===0&&m>0?"The active filters hide everything tracked, so there is nothing to search.":void 0,waiting:{otto:"stare",title:"No renders tracked",message:"Component renders will appear here"},paused:{title:"No renders tracked",message:"Enable tracking to start capturing"}});return Qt(pd,{...L,testID:"buoy-highlight-empty"})}return Qt(so,{testID:"buoy-highlight-list",ref:c,data:v,renderItem:T,keyExtractor:C,contentContainerStyle:Hn.listContent,showsVerticalScrollIndicator:!0,initialNumToRender:10,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:!1,ListFooterComponent:h})}var va=cd(fd),Hn=oe.create({listContent:{paddingTop:8},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:12,paddingHorizontal:16,marginTop:8,gap:8},lockedBannerText:{color:rr.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:rr.color.textTertiary,fontSize:12}});P();import{memo as Pt}from"react";import{Trash2 as wd,Search as Sd,Filter as xd,Pause as Rd,Copy as Id,ModalHeader as me,TabSelector as Ra,night as fe,PowerToggleButton as kd}from"@buoy-gg/shared-ui/web";P();import{useState as md,useEffect as hd,memo as yd}from"react";Le();import{Activity as bd,night as zn,monoFont as Td}from"@buoy-gg/shared-ui/web";import{jsx as Sa,jsxs as vd}from"react/jsx-runtime";function Cd(){let[e,t]=md({totalComponents:0,totalRenders:0});return hd(()=>E.subscribe(()=>{t(E.getStats())}),[]),vd(d,{nativeID:"__rn_buoy__stats-row",testID:"buoy-highlight-stats",accessibilityLabel:`${e.totalComponents} components tracked`,style:wa.headerChip,children:[Sa(bd,{size:12,color:zn.color.accent}),Sa(p,{testID:"buoy-highlight-stats-value",style:[wa.headerChipValue,{color:zn.color.accent}],children:e.totalComponents})]})}var xa=yd(Cd),wa=oe.create({headerChip:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:zn.color.buttonSurface,paddingHorizontal:8,paddingVertical:5,borderRadius:12,borderWidth:1,borderColor:zn.color.border},headerChipValue:{fontSize:12,fontWeight:"600",fontFamily:Td}});import{jsx as Z,jsxs as Zt}from"react/jsx-runtime";var Dd=Pt(function({isActive:t,searchText:n,onSearchChange:o,onSearchClose:r}){return t?Z(me.Search,{value:n,onChangeText:o,onCancel:()=>{o(""),r()},onDismiss:r,dismissOnBlur:!0,clearOnlyWhenText:!0,placeholder:"Search testID, nativeID, component...",accessibilityLabel:"Search renders",iconSize:14,testID:"buoy-highlight-search-field",containerTestID:"buoy-highlight-search-container",containerNativeID:"__rn_buoy__search-container",clearTestID:"buoy-highlight-search-clear"}):null}),Pd=Dd,Vd=Pt(function({onSearchToggle:t,onFilterToggle:n,onToggleTracking:o,onToggleFreeze:r,onClear:i,onOpenCopySettings:s,isTracking:a,isFrozen:l,activeFilterCount:c,hasRenders:u}){return Zt(me.Actions,{children:[Z(q,{testID:"buoy-highlight-search",accessibilityRole:"button",accessibilityLabel:"Search renders",onPress:t,style:Ne.headerActionButton,children:Z(Sd,{size:14,color:fe.color.textSecondary})}),Z(q,{testID:"buoy-highlight-filters",accessibilityRole:"button",accessibilityLabel:c>0?`Filters, ${c} active`:"Filters",onPress:n,style:[Ne.headerActionButton,c>0&&Ne.activeFilterButton],children:Z(xd,{size:14,color:c>0?fe.color.accent:fe.color.textTertiary})}),Z(q,{testID:"buoy-highlight-copy",accessibilityRole:"button",onPress:s,style:[Ne.headerActionButton,!u&&Ne.headerActionButtonDisabled],disabled:!u,accessibilityLabel:"Open copy settings",children:Z(Id,{size:14,color:u?fe.color.textSecondary:fe.color.textTertiary})}),Z(q,{testID:"buoy-highlight-freeze",accessibilityRole:"button",accessibilityLabel:l?"Unfreeze frame":"Freeze frame",onPress:r,style:[Ne.headerActionButton,l&&Ne.freezeButton,!a&&Ne.headerActionButtonDisabled],disabled:!a,children:Z(Rd,{size:14,color:a?l?fe.color.accent:fe.color.textTertiary:fe.color.textTertiary})}),Z(kd,{testID:"buoy-highlight-power",isEnabled:a,onToggle:o,accessibilityLabel:"Toggle render tracking"}),Z(q,{testID:"buoy-highlight-clear",accessibilityRole:"button",accessibilityLabel:"Clear tracked renders",onPress:i,style:[Ne.headerActionButton,!u&&Ne.headerActionButtonDisabled],disabled:!u,children:Z(wd,{size:14,color:u?fe.color.textTertiary:fe.color.textTertiary})})]})}),Ld=Vd,Ia=Pt(function({onBack:t,isSearchActive:n,searchText:o,onSearchChange:r,onSearchToggle:i,onSearchClose:s,onFilterToggle:a,onToggleTracking:l,onToggleFreeze:c,onClear:u,onOpenCopySettings:y,isTracking:v,isFrozen:S,activeFilterCount:C,hasRenders:T,searchInputRef:h}){return Zt(me,{children:[t&&Z(me.Navigation,{onBack:t}),Z(me.Content,{title:"",children:n?Z(Pd,{isActive:n,searchText:o,onSearchChange:r,onSearchClose:s,searchInputRef:h}):Z(xa,{})}),Z(Ld,{onSearchToggle:i,onFilterToggle:a,onToggleTracking:l,onToggleFreeze:c,onClear:u,onOpenCopySettings:y,isTracking:v,isFrozen:S,activeFilterCount:C,hasRenders:T})]})}),ka=Pt(function({onBack:t,activeTab:n,onTabChange:o,activeFilterCount:r=0}){let i=[{key:"filters",label:`Filters${r>0?` (${r})`:""}`},{key:"settings",label:"Settings"}];return Zt(me,{children:[Z(me.Navigation,{onBack:t}),Z(me.Content,{title:"",noMargin:!0,children:Z(Ra,{tabs:i,activeTab:n,onTabChange:s=>o(s),testIDPrefix:"buoy-highlight-filter-tab"})}),Z(me.Actions,{})]})}),Da=Pt(function({onBack:t,activeTab:n,onTabChange:o,hasHistory:r=!0}){let i=[{key:"details",label:"Details"},{key:"history",label:"History",disabled:!r}];return Zt(me,{children:[Z(me.Navigation,{onBack:t}),Z(me.Content,{title:"",noMargin:!0,children:Z(Ra,{tabs:i,activeTab:n,onTabChange:s=>o(s),testIDPrefix:"buoy-highlight-detail-tab"})}),Z(me.Actions,{})]})}),Pa=Pt(function({onBack:t}){return Zt(me,{children:[Z(me.Navigation,{onBack:t}),Z(me.Content,{title:"Copy Settings",testID:"buoy-highlight-copy-title"})]})}),Ne=oe.create({headerActionButton:{width:32,height:32,borderRadius:8,backgroundColor:fe.color.buttonSurface,borderWidth:1,borderColor:fe.color.border,alignItems:"center",justifyContent:"center"},headerActionButtonDisabled:{opacity:.55},activeFilterButton:{backgroundColor:fe.color.accentSoft,borderColor:fe.color.accentBorderStrong},freezeButton:{backgroundColor:fe.color.accentSoft,borderColor:fe.color.accentBorderStrong}});P();import{useState as ir,useCallback as An,useMemo as en}from"react";Le();import{Clock as Ed,GitBranch as Nd,Database as Ea,Lock as Hd,formatRelativeTime as Na,SectionHeader as Vt,EventStepperFooter as Ha,buoyColors as Va,night as A,useLimit as za,ToolEmptyState as zd,monoFont as Ue}from"@buoy-gg/shared-ui/web";import{TreeDiffViewer as La}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Md,jsx as O,jsxs as Y}from"react/jsx-runtime";function ar(e){let t=new Date(e),n=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),r=t.getSeconds().toString().padStart(2,"0"),i=t.getMilliseconds().toString().padStart(3,"0");return`${n}:${o}:${r}.${i}`}function sr({render:e,disableInternalFooter:t=!1,selectedEventIndex:n,onEventIndexChange:o,isPro:r=!1}){let[i,s]=ir(0),a=n??i,l=o??s,[c,u]=ir("current"),y=en(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((D,k)=>D.timestamp-k.timestamp),[e.renderHistory]),v=za("highlightUpdates.historyEvents"),S=r?1/0:v,C=en(()=>y.slice(-S),[y,S]),T=en(()=>Math.max(0,y.length-S),[y.length,S]),h=C.length,f=C[a],m=a>0?C[a-1]:null,R=An(()=>{a>0&&l(a-1)},[a,l]),L=An(()=>{a<h-1&&l(a+1)},[a,h,l]);if(h===0){let D=E.getSettings().enableRenderHistory;return O(zd,{testID:"buoy-highlight-history-empty",otto:D?"stare":"paused",title:"No Render History",message:D?"History is on and armed \u2014 this component has not re-rendered since. Interact with the app to record one.":"Enable render history tracking in settings to see render events here."})}return Y(Md,{children:[Y(d,{style:[I.container,{paddingBottom:!t&&h>1?80:0}],children:[T>0&&Y(d,{testID:"buoy-highlight-history-locked",style:I.lockedBanner,children:[O(Hd,{size:14,color:A.color.warning}),Y(p,{testID:"buoy-highlight-history-locked-text",style:I.lockedBannerText,children:[T," older ",T===1?"render":"renders"," locked"]}),O(p,{style:I.lockedBannerSubtext,children:"Upgrade to Pro"})]}),Y(d,{style:I.viewToggleContainer,children:[Y(q,{testID:"buoy-highlight-history-mode-current",accessibilityRole:"button",accessibilityLabel:"Current state",style:[I.viewToggleCard,c==="current"&&I.viewToggleCardActive],onPress:()=>u("current"),activeOpacity:.8,children:[Y(d,{style:I.viewToggleContent,children:[O(Ea,{size:16,color:c==="current"?A.color.accent:A.color.textSecondary}),O(p,{style:[I.viewToggleLabel,c==="current"&&I.viewToggleLabelActive],children:"CURRENT STATE"})]}),Y(p,{style:[I.viewToggleDescription,c==="current"&&{color:A.color.text}],children:["View render #",f?.renderNumber??0," details"]})]}),Y(d,{testID:"buoy-highlight-history-mode-diff",accessibilityLabel:"Diff view, coming soon",style:[I.viewToggleCard,I.viewToggleCardDisabled],children:[Y(d,{style:I.viewToggleContent,children:[O(Nd,{size:16,color:A.color.textTertiary}),O(p,{style:[I.viewToggleLabel,I.viewToggleLabelDisabled],children:"DIFF VIEW"}),O(d,{style:I.todoBadge,children:O(p,{style:I.todoBadgeText,children:"TODO"})})]}),O(p,{style:[I.viewToggleDescription,{color:A.color.textTertiary}],children:"Compare renders side by side (coming soon)"})]})]}),O(Re,{testID:"buoy-highlight-history-scroll",style:I.contentScroll,contentContainerStyle:I.contentContainer,showsVerticalScrollIndicator:!1,children:c==="current"?O(Ad,{event:f,render:e}):O(Od,{previousEvent:m,currentEvent:f,render:e})})]}),!t&&O(Ha,{currentIndex:a,totalItems:h,onPrevious:R,onNext:L,itemLabel:"Render",subtitle:Na(new Date(f?.timestamp??Date.now()))})]})}function Ad({event:e,render:t}){if(!e)return O(d,{testID:"buoy-highlight-history-no-event",style:I.noEventContainer,children:O(p,{style:I.noEventText,children:"No event selected"})});let n=Ee[e.cause.type];return Y(d,{style:I.currentStateContainer,children:[Y(d,{style:I.eventHeader,children:[Y(d,{style:I.eventHeaderLeft,children:[Y(p,{testID:"buoy-highlight-history-event-title",style:I.eventTitle,children:["Render #",e.renderNumber]}),O(p,{testID:"buoy-highlight-history-event-time",style:I.eventTime,children:ar(e.timestamp)})]}),Y(d,{style:[I.eventBadge,{backgroundColor:t.color+"30"}],children:[O(d,{style:[I.eventBadgeDot,{backgroundColor:t.color}]}),O(p,{testID:"buoy-highlight-history-event-cause",style:[I.eventBadgeText,{color:t.color}],children:e.cause.type.toUpperCase()})]})]}),Y(d,{style:I.section,children:[Y(Vt,{children:[O(Vt.Icon,{icon:Ed,color:n.color,size:12}),O(Vt.Title,{children:"WHY DID THIS RENDER?"})]}),O(d,{style:I.sectionContent,children:O(Bo,{cause:e.cause,nativeType:t.viewType})})]}),e.capturedProps&&Object.keys(e.capturedProps).length>0&&Y(d,{style:I.section,children:[Y(Vt,{children:[O(Vt.Icon,{icon:Ea,color:A.color.accent,size:12}),O(Vt.Title,{children:"CAPTURED PROPS"})]}),O(d,{style:I.sectionContent,children:O(Re,{horizontal:!0,showsHorizontalScrollIndicator:!1,style:I.propsScrollView,children:O(p,{testID:"buoy-highlight-history-props",style:I.propsJson,children:JSON.stringify(e.capturedProps,null,2)})})})]})]})}function Od({previousEvent:e,currentEvent:t,render:n}){let[o,r]=ir("props");if(!e||!t)return O(d,{style:I.noEventContainer,children:O(p,{style:I.noEventText,children:"Select an event with a previous event to compare"})});let i=Ee[e.cause.type],s=Ee[t.cause.type],a=e.capturedProps&&t.capturedProps,l=e.capturedState&&t.capturedState;return Y(d,{style:I.diffContainer,children:[Y(d,{style:I.compareBar,children:[Y(d,{style:I.compareSide,children:[Y(d,{style:I.compareLabelRow,children:[O(p,{style:[I.compareLabel,{color:Va.warning}],children:"PREV"}),O(d,{style:[I.compareActionBadge,{backgroundColor:`${i.color}20`}],children:O(p,{style:[I.compareActionText,{color:i.color}],children:e.cause.type.toUpperCase()})})]}),Y(d,{style:I.compareMeta,children:[Y(p,{style:I.compareIndex,children:["#",e.renderNumber]}),O(p,{style:I.compareTime,children:ar(e.timestamp)})]})]}),O(d,{style:I.compareDivider,children:O(p,{style:I.compareArrow,children:"\u2192"})}),Y(d,{style:I.compareSide,children:[Y(d,{style:I.compareLabelRow,children:[O(p,{style:[I.compareLabel,{color:Va.success}],children:"CUR"}),O(d,{style:[I.compareActionBadge,{backgroundColor:`${s.color}20`}],children:O(p,{style:[I.compareActionText,{color:s.color}],children:t.cause.type.toUpperCase()})})]}),Y(d,{style:I.compareMeta,children:[Y(p,{style:I.compareIndex,children:["#",t.renderNumber]}),O(p,{style:I.compareTime,children:ar(t.timestamp)})]})]})]}),Y(d,{style:I.diffModeTabs,children:[O(q,{style:[I.diffModeTab,o==="cause"&&I.diffModeTabActive],onPress:()=>r("cause"),activeOpacity:.7,children:O(p,{style:[I.diffModeTabText,o==="cause"&&I.diffModeTabTextActive],children:"CAUSE"})}),O(q,{style:[I.diffModeTab,o==="props"&&I.diffModeTabActive,!a&&I.diffModeTabDisabled],onPress:()=>a&&r("props"),activeOpacity:a?.7:1,children:O(p,{style:[I.diffModeTabText,o==="props"&&I.diffModeTabTextActive,!a&&I.diffModeTabTextDisabled],children:"PROPS"})}),O(q,{style:[I.diffModeTab,o==="state"&&I.diffModeTabActive,!l&&I.diffModeTabDisabled],onPress:()=>l&&r("state"),activeOpacity:l?.7:1,children:O(p,{style:[I.diffModeTabText,o==="state"&&I.diffModeTabTextActive,!l&&I.diffModeTabTextDisabled],children:"STATE"})})]}),o==="cause"&&O(d,{style:I.diffSummary,children:O(Bo,{cause:t.cause,nativeType:n.viewType})}),o==="props"&&O(d,{style:I.treeDiffContainer,children:a?O(La,{oldValue:e.capturedProps,newValue:t.capturedProps,theme:"dark",showUnchanged:!0}):Y(d,{style:I.noDiffData,children:[O(p,{style:I.noDiffDataTitle,children:"Props Not Captured"}),O(p,{style:I.noDiffDataText,children:'Enable "Capture Props on Render" in settings to see props diff.'})]})}),o==="state"&&O(d,{style:I.treeDiffContainer,children:l?O(La,{oldValue:e.capturedState,newValue:t.capturedState,theme:"dark",showUnchanged:!0}):Y(d,{style:I.noDiffData,children:[O(p,{style:I.noDiffDataTitle,children:"State Not Captured"}),O(p,{style:I.noDiffDataText,children:'Enable "Capture State on Render" in settings to see state diff.'})]})})]})}function lr({render:e,selectedEventIndex:t=0,onEventIndexChange:n=()=>{},isPro:o=!1}){let r=en(()=>!e.renderHistory||e.renderHistory.length===0?[]:[...e.renderHistory].sort((v,S)=>v.timestamp-S.timestamp),[e.renderHistory]),i=za("highlightUpdates.historyEvents"),s=o?1/0:i,a=en(()=>r.slice(-s),[r,s]),l=a.length,c=a[t],u=An(()=>{n(Math.max(0,t-1))},[t,n]),y=An(()=>{n(Math.min(l-1,t+1))},[t,l,n]);return l<=1?null:O(Ha,{currentIndex:t,totalItems:l,onPrevious:u,onNext:y,itemLabel:"Render",subtitle:c?Na(new Date(c.timestamp)):void 0})}var I=oe.create({container:{flex:1,backgroundColor:"transparent"},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",padding:32,gap:12},emptyTitle:{fontSize:16,fontWeight:"600",color:A.color.text},emptyText:{fontSize:13,color:A.color.textSecondary,textAlign:"center",lineHeight:18},viewToggleContainer:{flexDirection:"row",padding:12,gap:8},viewToggleCard:{flex:1,backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:10,gap:4},viewToggleCardActive:{borderColor:A.color.accentBorderStrong,backgroundColor:A.color.accentSoft},viewToggleCardDisabled:{opacity:.5},todoBadge:{backgroundColor:A.color.fillSecondary,paddingHorizontal:6,paddingVertical:2,borderRadius:4,marginLeft:4},todoBadgeText:{fontSize:9,fontWeight:"700",color:A.color.textTertiary,letterSpacing:.3},viewToggleContent:{flexDirection:"row",alignItems:"center",gap:6},viewToggleLabel:{fontSize:10,fontWeight:"700",color:A.color.textSecondary,letterSpacing:.5},viewToggleLabelActive:{color:A.color.accent},viewToggleLabelDisabled:{color:A.color.textTertiary},viewToggleDescription:{fontSize:11,color:A.color.textTertiary,marginTop:2},contentScroll:{flex:1},contentContainer:{padding:12,paddingTop:0},noEventContainer:{padding:24,alignItems:"center"},noEventText:{fontSize:13,color:A.color.textTertiary},currentStateContainer:{gap:12},eventHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:12},eventHeaderLeft:{gap:2},eventTitle:{fontSize:15,fontWeight:"700",color:A.color.text},eventTime:{fontSize:11,color:A.color.textTertiary,fontFamily:Ue},eventBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:4,borderRadius:12,gap:6},eventBadgeDot:{width:6,height:6,borderRadius:3},eventBadgeText:{fontSize:10,fontWeight:"700",fontFamily:Ue},section:{backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,overflow:"hidden"},sectionContent:{padding:12,paddingTop:8},causeContainer:{marginBottom:12},changedList:{marginBottom:12,paddingLeft:4},changedListTitle:{fontSize:11,fontWeight:"600",color:A.color.textSecondary,marginBottom:6},changedItem:{fontSize:12,color:A.color.text,fontFamily:Ue,marginBottom:3,paddingLeft:8},propsScrollView:{maxHeight:150},propsJson:{fontSize:11,fontFamily:Ue,color:A.color.text,backgroundColor:A.color.bg,padding:10,borderRadius:6},diffContainer:{gap:12},compareBar:{flexDirection:"row",backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:10},compareSide:{flex:1,gap:4},compareLabelRow:{flexDirection:"row",alignItems:"center",gap:8},compareLabel:{fontSize:10,fontWeight:"700",letterSpacing:.5},compareActionBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:4},compareActionText:{fontSize:9,fontWeight:"600"},compareMeta:{flexDirection:"row",alignItems:"center",gap:6},compareIndex:{fontSize:12,fontWeight:"600",color:A.color.text},compareTime:{fontSize:10,color:A.color.textTertiary,fontFamily:Ue},compareDivider:{width:30,alignItems:"center",justifyContent:"center"},compareArrow:{fontSize:16,color:A.color.textTertiary},diffSummary:{backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:12},diffSummaryTitle:{fontSize:11,fontWeight:"600",color:A.color.textSecondary,marginBottom:8},diffChanges:{gap:4},diffChangeItem:{flexDirection:"row",alignItems:"center",gap:6},diffChangeIcon:{fontSize:12,fontWeight:"700",color:A.color.warning,fontFamily:Ue},diffChangeKey:{fontSize:12,color:A.color.text,fontFamily:Ue},diffNoChanges:{fontSize:12,color:A.color.textTertiary,fontStyle:"italic"},diffPlaceholder:{fontSize:12,color:A.color.textTertiary,fontStyle:"italic",textAlign:"center",padding:16},diffModeTabs:{flexDirection:"row",backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,padding:4,gap:4},diffModeTab:{flex:1,paddingVertical:8,paddingHorizontal:12,borderRadius:6,alignItems:"center"},diffModeTabActive:{backgroundColor:A.color.accentSoft},diffModeTabDisabled:{opacity:.4},diffModeTabText:{fontSize:10,fontWeight:"600",color:A.color.textSecondary,letterSpacing:.5},diffModeTabTextActive:{color:A.color.accent},diffModeTabTextDisabled:{color:A.color.textTertiary},causeDiffContainer:{gap:8,marginBottom:12},causeDiffRow:{flexDirection:"row",alignItems:"center",gap:8},causeDiffLabel:{fontSize:11,fontWeight:"600",color:A.color.textSecondary,minWidth:80},causeDiffValue:{fontSize:12,color:A.color.text,fontFamily:Ue,fontWeight:"500"},diffChangesTitle:{fontSize:11,fontWeight:"600",color:A.color.textSecondary,marginBottom:6},treeDiffContainer:{backgroundColor:A.color.surface,borderRadius:8,borderWidth:1,borderColor:A.color.border,overflow:"hidden",minHeight:150},noDiffData:{padding:24,alignItems:"center",gap:8},noDiffDataTitle:{fontSize:13,fontWeight:"600",color:A.color.text},noDiffDataText:{fontSize:12,color:A.color.textTertiary,textAlign:"center",lineHeight:18},lockedBanner:{flexDirection:"row",alignItems:"center",justifyContent:"center",paddingVertical:10,paddingHorizontal:16,marginHorizontal:12,marginTop:8,backgroundColor:A.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:A.color.warning+"30",gap:8},lockedBannerText:{color:A.color.warning,fontSize:13,fontWeight:"500"},lockedBannerSubtext:{color:A.color.textTertiary,fontSize:12}});P();import{useCallback as Lt,useEffect as Bd,useMemo as On,useState as Fa}from"react";import{DynamicFilterView as $d,macOSColors as ur,night as pr,FileText as Ba,FileCode as $a,Zap as Wa,Settings as Wd,Eye as Ud,Layers as Gd,ToolbarCopyButton as Kd,ExportPreview as jd,monoFont as qd}from"@buoy-gg/shared-ui/web";P();var tn={format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:!0,aggregateCauses:!0,sortBy:"renderCount",includeHistory:!1},cr={llm:{format:"summary",topN:25,minRenders:2,filterCauses:[],groupByName:!0,aggregateCauses:!0,sortBy:"renderCount",includeHistory:!1},table:{format:"markdown-table",topN:50,minRenders:2,filterCauses:[],groupByName:!0,aggregateCauses:!0,sortBy:"renderCount",includeHistory:!1},json:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:!1,aggregateCauses:!0,sortBy:"renderCount",includeHistory:!1},full:{format:"json",topN:-1,minRenders:1,filterCauses:[],groupByName:!1,aggregateCauses:!1,sortBy:"renderCount",includeHistory:!0}};function Aa(e){for(let[t,n]of Object.entries(cr))if(Object.keys(n).every(r=>{let i=e[r],s=n[r];return Array.isArray(i)&&Array.isArray(s)?i.length===s.length&&i.every((a,l)=>a===s[l]):i===s}))return t;return null}var Se={llm:{label:"LLM",description:"Compact summary for AI",color:"#10B981"},table:{label:"Table",description:"Markdown table",color:"#3B82F6"},json:{label:"JSON",description:"Structured data",color:"#F59E0B"},full:{label:"Full",description:"Everything incl. history",color:"#6B7280"}};P();import{definePersistedSetting as _d,devToolsStorageKeys as Fd}from"@buoy-gg/shared-ui/web";var Oa=_d(Fd.highlightUpdates.copySettings(),tn,{sanitize:(e,t)=>({...e,filterCauses:t?.filterCauses??tn.filterCauses})});async function Ma(e){await Oa.save(e)}async function _a(){return Oa.loadOrNull()}import{Fragment as ep,jsx as Et,jsxs as tp}from"react/jsx-runtime";var Xd=50*1024,Yd=200*1024,Jd=[{value:"mount",label:"Mount"},{value:"props",label:"Props"},{value:"hooks",label:"Hooks"},{value:"state",label:"State"},{value:"parent",label:"Parent"},{value:"context",label:"Context"},{value:"unknown",label:"Unknown"}];function Qd(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Zd(){let e=Date.now();return[{id:"1",nativeTag:1,viewType:"RCTView",displayName:"View",componentName:"PokemonListItem",renderCount:30,firstRenderTime:e-5e3,lastRenderTime:e,color:"#10B981",lastRenderCause:{type:"parent",timestamp:e,componentCause:"parent"}},{id:"2",nativeTag:2,viewType:"RCTView",displayName:"View",componentName:"CartHeader",renderCount:12,firstRenderTime:e-4e3,lastRenderTime:e,color:"#3B82F6",lastRenderCause:{type:"hooks",timestamp:e,componentCause:"state",hookChanges:[{type:"useState",index:2,previousValue:4,currentValue:5}]}},{id:"3",nativeTag:3,viewType:"RCTView",displayName:"View",componentName:"SearchBar",renderCount:8,firstRenderTime:e-3e3,lastRenderTime:e,color:"#F59E0B",lastRenderCause:{type:"props",timestamp:e,componentCause:"props",changedKeys:["query","onChange"]}}]}function Ua({renders:e}){let[t,n]=Fa(tn),[o,r]=Fa(!1);Bd(()=>{let f=!0;return _a().then(m=>{f&&m&&n(m)}),()=>{f=!1}},[]);let i=Lt(f=>{n(f),Ma(f)},[]),s=e.length>0,a=s?e:Zd(),l=On(()=>Aa(t),[t]),c=On(()=>ra(a,t),[a,t]),u=On(()=>c>=Yd?"danger":c>=Xd?"warning":"none",[c]),y=Lt(()=>Ln(a,t),[a,t]),v=Lt(f=>{let m=cr[f];m&&i({...m,filterCauses:[...m.filterCauses]})},[i]),S=Lt((f,m)=>{let[R,L]=f.split("::");if(R==="preset"){v(L);return}if(R==="format"){i({...t,format:m});return}if(R==="sort"){i({...t,sortBy:m});return}if(R==="topN"){i({...t,topN:m});return}if(R==="minRenders"){i({...t,minRenders:m});return}if(R==="cause"){let D=m,k=t.filterCauses.includes(D);i({...t,filterCauses:k?t.filterCauses.filter(U=>U!==D):[...t.filterCauses,D]});return}if(R==="signal"){let D=L;i({...t,[D]:!t[D]});return}},[t,i,v]),C=Lt(()=>{let{totalComponents:f,totalRenders:m}=Wo(a);return Et(jd,{expanded:o,onExpandedChange:r,summary:`${f} component${f!==1?"s":""} \xB7 ${m} renders \xB7 ~${Qd(c)}${s?"":" (mock data)"}`,warningLevel:u,warningText:{warning:"Large payload \u2014 preview may be slow",danger:"Very large payload \u2014 try a smaller topN or turn off history"},testIDs:{expand:"buoy-highlight-copy-preview-show",collapse:"buoy-highlight-copy-preview-hide",summary:"buoy-highlight-copy-preview-summary",warning:"buoy-highlight-copy-size-warning"},renderBody:()=>{let R=y();return Et(Re,{testID:"buoy-highlight-copy-preview-scroll",style:dr.previewScroll,nestedScrollEnabled:!0,children:Et(p,{testID:"buoy-highlight-copy-preview-text",style:dr.previewText,selectable:!0,children:R})})}})},[o,a,c,u,s,y]),T=Lt(()=>{let{totalComponents:f}=Wo(a),m=s?`${f} components`:"Mock data (no renders captured)";return tp(ep,{children:[Et(p,{testID:"buoy-highlight-copy-status",style:dr.statusLabel,children:m}),Et(Kd,{value:y})]})},[s,a,y]),h=On(()=>({sections:[{id:"presets",title:"Presets",type:"custom",data:[{id:"preset::llm",label:Se.llm.label,icon:Wa,color:Se.llm.color,value:"llm",isActive:l==="llm",description:Se.llm.description},{id:"preset::table",label:Se.table.label,icon:Ba,color:Se.table.color,value:"table",isActive:l==="table",description:Se.table.description},{id:"preset::json",label:Se.json.label,icon:$a,color:Se.json.color,value:"json",isActive:l==="json",description:Se.json.description},{id:"preset::full",label:Se.full.label,icon:Gd,color:Se.full.color,value:"full",isActive:l==="full",description:Se.full.description},{id:"preset::custom",label:"Custom",icon:Wd,color:pr.color.textSecondary,value:"custom",isActive:l===null,description:"User-configured"}]},{id:"format",title:"Format",type:"custom",data:[{id:"format::summary",label:"Summary",icon:Wa,color:ur.semantic.success,value:"summary",isActive:t.format==="summary",description:"Compact, LLM-ready"},{id:"format::markdown-table",label:"Table",icon:Ba,color:ur.semantic.info,value:"markdown-table",isActive:t.format==="markdown-table",description:"Markdown table"},{id:"format::json",label:"JSON",icon:$a,color:ur.semantic.warning,value:"json",isActive:t.format==="json",description:"Structured data"}]},{id:"sort",title:"Sort By",type:"custom",data:[{id:"sort::renderCount",label:"Count",value:"renderCount",isActive:t.sortBy==="renderCount",description:"Total renders"},{id:"sort::rate",label:"Rate",value:"rate",isActive:t.sortBy==="rate",description:"Renders / sec"},{id:"sort::name",label:"Name",value:"name",isActive:t.sortBy==="name",description:"Alphabetical"}]},{id:"topN",title:"Top N",type:"custom",data:[{id:"topN::10",label:"10",value:10,isActive:t.topN===10},{id:"topN::25",label:"25",value:25,isActive:t.topN===25},{id:"topN::50",label:"50",value:50,isActive:t.topN===50},{id:"topN::100",label:"100",value:100,isActive:t.topN===100},{id:"topN::-1",label:"All",value:-1,isActive:t.topN===-1}]},{id:"minRenders",title:"Min Renders",type:"custom",data:[{id:"minRenders::1",label:"1",value:1,isActive:t.minRenders===1},{id:"minRenders::2",label:"2",value:2,isActive:t.minRenders===2},{id:"minRenders::3",label:"3",value:3,isActive:t.minRenders===3},{id:"minRenders::5",label:"5",value:5,isActive:t.minRenders===5},{id:"minRenders::10",label:"10",value:10,isActive:t.minRenders===10}]},{id:"causes",title:"Filter Causes",type:"custom",description:t.filterCauses.length===0?"All causes shown":"Only the selected causes shown",data:Jd.map(f=>({id:`cause::${f.value}`,label:f.label,value:f.value,isActive:t.filterCauses.includes(f.value)}))},{id:"signal",title:"Signal Extraction",type:"custom",data:[{id:"signal::groupByName",label:"Group by name",value:"groupByName",isActive:t.groupByName,description:"Collapse list items"},{id:"signal::aggregateCauses",label:"Aggregate causes",value:"aggregateCauses",isActive:t.aggregateCauses,description:"Hook x N"},{id:"signal::includeHistory",label:"Include history",value:"includeHistory",isActive:t.includeHistory,description:"JSON only \u2014 large"}]}],previewSection:{enabled:!0,title:"PREVIEW",icon:Ud,content:C,headerActions:T},onFilterChange:S}),[t,l,S,C,T]);return Et($d,{...h})}var dr=oe.create({previewScroll:{maxHeight:360},previewText:{fontFamily:qd,fontSize:11,color:pr.color.text,lineHeight:18},statusLabel:{fontSize:11,fontWeight:"600",color:pr.color.textTertiary,marginRight:8}});import{Fragment as up,jsx as ce,jsxs as gr}from"react/jsx-runtime";var lp=np.memo(function(){return gr(d,{testID:"buoy-highlight-disabled-banner",style:on.disabledBanner,children:[ce(op,{size:14,color:nn.color.warning}),ce(p,{testID:"buoy-highlight-disabled-text",style:on.disabledText,children:"Render tracking is disabled"})]})});function _n({visible:e,onClose:t,onBack:n,onMinimize:o,enableSharedModalDimensions:r=!1,initialNativeTag:i,onInitialNativeTagHandled:s,onRenderSelect:a,inline:l=!1}){let c=ap(),[u,y]=he(!1),[v,S]=he(()=>N.getFrozen()),[C,T]=he(()=>E.getStats().totalComponents>0),[h,f]=he(null),[m,R]=he(0),[L,D]=he(!1),[k,U]=he(!1),[ee,G]=he([]),[M,ne]=he("filters"),[w,H]=he("details"),[pe,ye]=he(0),[Ve,je]=he(""),[pt,sn]=he(!1),ln=st(null),Ot=st([]),Ir=st(E.getFilters()),[Yn,kr]=he(()=>{let W=E.getFilters();return W.includePatterns.length+W.excludePatterns.length}),[Ce,Dr]=he(()=>E.getFilters()),[Jn,Pr]=he(()=>E.getSettings()),Vr=st(!1),Qn=st(!1),cn=st(!1);ke(()=>{!e||Vr.current||(Vr.current=!0)},[e]),ke(()=>{if(!e||Qn.current)return;(async()=>{try{let j=await Mn.getItem(Nt.highlightUpdates.filters());if(j){let Q=JSON.parse(j),He={includeTestID:new Set(Q.includeTestID||[]),includeNativeID:new Set(Q.includeNativeID||[]),includeViewType:new Set(Q.includeViewType||[]),includeComponent:new Set(Q.includeComponent||[]),excludeTestID:new Set(Q.excludeTestID||[]),excludeNativeID:new Set(Q.excludeNativeID||[]),excludeViewType:new Set(Q.excludeViewType||[]),excludeComponent:new Set(Q.excludeComponent||[]),includePatterns:Q.includePatterns||[],excludePatterns:Q.excludePatterns||[]};E.setFilters(He);let qe=E.getFilters();Ir.current=qe,Dr(qe),kr(qe.includePatterns.length+qe.excludePatterns.length)}Qn.current=!0}catch{}})()},[e]),ke(()=>{if(!Qn.current)return;(async()=>{try{let j={includeTestID:Array.from(Ce.includeTestID),includeNativeID:Array.from(Ce.includeNativeID),includeViewType:Array.from(Ce.includeViewType),includeComponent:Array.from(Ce.includeComponent),excludeTestID:Array.from(Ce.excludeTestID),excludeNativeID:Array.from(Ce.excludeNativeID),excludeViewType:Array.from(Ce.excludeViewType),excludeComponent:Array.from(Ce.excludeComponent),includePatterns:Ce.includePatterns,excludePatterns:Ce.excludePatterns};await Mn.setItem(Nt.highlightUpdates.filters(),JSON.stringify(j))}catch{}})()},[Ce]),ke(()=>{if(!e||cn.current)return;(async()=>{try{let j=await Mn.getItem(Nt.highlightUpdates.settings());if(j){let Q=JSON.parse(j),{performanceLogging:He,excludeDevTools:qe,...Xe}=Q;E.setSettings(Xe),Pr(E.getSettings())}cn.current=!0}catch{cn.current=!0}})()},[e]),ke(()=>{if(!cn.current)return;(async()=>{try{let{performanceLogging:j,excludeDevTools:Q,...He}=Jn;await Mn.setItem(Nt.highlightUpdates.settings(),JSON.stringify(He))}catch{}})()},[Jn]),ke(()=>{let W=E.subscribeToState(j=>{y(j.isTracking)});return()=>{W()}},[]),ke(()=>{let W=N.subscribeToFreeze(j=>{S(j)});return()=>{W()}},[]),ke(()=>{pt&&requestAnimationFrame(()=>{ln.current?.focus()})},[pt]),ke(()=>{e||N.setSpotlight(null)},[e]),ke(()=>{if(e&&i!=null){let W=E.getRender(String(i));W&&(f(W),R(0),D(!1),N.setSpotlight(W.nativeTag)),s?.()}},[e,i,s]);let Lr=le(()=>{N.isInitialized()||N.initialize(),N.toggle()},[]),Er=le(()=>{N.toggleFreeze()},[]),Nr=le(()=>{N.clearRenderCounts(),T(!1)},[]),Hr=le(()=>{G(E.getFilteredRenders(Ve)),U(!0)},[Ve]),zr=le(()=>{U(!1)},[]),Ar=le(W=>{je(W)},[]),Cs=le((W,j,Q)=>{f(W),R(j),H("details"),ye(0),Ot.current=Q,N.setSpotlight(W.nativeTag)},[]);ke(()=>{if(!h)return;let W=String(h.nativeTag);return E.subscribe(()=>{let j=E.getRender(W);j&&f({...j})})},[h?.nativeTag]);let Or=st(null);ke(()=>{!a||!h||Or.current!==h.nativeTag&&(Or.current=h.nativeTag,a(h))},[h,a]);let vs=le(W=>{Ot.current=W},[]),Mr=le(()=>{f(null),R(0),N.setSpotlight(null)},[]),ws=le(()=>{let W=Ot.current;if(m>0){let j=m-1,Q=W[j];Q&&(f(Q),R(j),N.setSpotlight(Q.nativeTag))}},[m]),Ss=le(()=>{let W=Ot.current;if(m<W.length-1){let j=m+1,Q=W[j];Q&&(f(Q),R(j),N.setSpotlight(Q.nativeTag))}},[m]),_r=le(()=>{D(!1)},[]),Fr=le(()=>{D(!0)},[]),Br=le(()=>{sn(!0)},[]),$r=le(()=>{sn(!1)},[]),Zn=le(W=>{E.setFilters(W);let j=E.getFilters();Ir.current=j,Dr(j),kr(j.includePatterns.length+j.excludePatterns.length)},[]),xs=le((W,j)=>{let Q=E.getFilters(),He={};j==="include"?Q.includePatterns.some(Xe=>Xe.type===W.type&&Xe.value===W.value)||(He.includePatterns=[...Q.includePatterns,W]):Q.excludePatterns.some(Xe=>Xe.type===W.type&&Xe.value===W.value)||(He.excludePatterns=[...Q.excludePatterns,W]),Object.keys(He).length>0&&(Zn(He),f(null),R(0),N.setSpotlight(null))},[Zn]),Rs=le(W=>{E.setSettings(W),Pr(E.getSettings())},[]),Is=le(W=>{T(W.totalComponents>0)},[]),Wr=le(()=>k?ce(Pa,{onBack:zr}):L?ce(ka,{onBack:_r,activeTab:M,onTabChange:ne,activeFilterCount:Yn}):h?ce(Da,{onBack:Mr,activeTab:w,onTabChange:H,hasHistory:(h.renderHistory?.length??0)>0}):ce(Ia,{onBack:n,isSearchActive:pt,searchText:Ve,onSearchChange:Ar,onSearchToggle:Br,onSearchClose:$r,onFilterToggle:Fr,onToggleTracking:Lr,onToggleFreeze:Er,onClear:Nr,onOpenCopySettings:Hr,isTracking:u,isFrozen:v,activeFilterCount:Yn,hasRenders:C,searchInputRef:ln}),[k,L,h,n,pt,Ve,u,v,Yn,C,M,w,_r,Mr,zr,Ar,Br,$r,Fr,Lr,Er,Nr,Hr]),ks=r?Nt.modal.root():Nt.highlightUpdates.modal();if(!e)return null;let Ds=Ot.current.length,Ur=h?w==="details"?ce(sp,{currentIndex:m,totalItems:Ds,onPrevious:ws,onNext:Ss,itemLabel:"Component",subtitle:h.componentName||h.displayName||h.viewType}):ce(lr,{render:h,selectedEventIndex:pe,onEventIndexChange:ye,isPro:c}):null,Gr=ce(d,{nativeID:"__rn_buoy__highlight-modal",testID:"buoy-highlight-body",style:on.container,children:k?ce(Ua,{renders:ee}):h?w==="details"?ce(Go,{render:h,disableInternalFooter:!0,onAddFilter:xs,isPro:c}):ce(sr,{render:h,disableInternalFooter:!0,selectedEventIndex:pe,onEventIndexChange:ye,isPro:c}):L?ce(tr,{filters:Ce,onFilterChange:Zn,settings:Jn,onSettingsChange:Rs,availableProps:E.getAvailableProps(),activeTab:M}):gr(up,{children:[!u&&ce(lp,{}),ce(va,{searchText:Ve,filters:Ce,onSelectRender:Cs,onStatsChange:Is,onRendersChange:vs,isTracking:u,isPro:c})]})});return l?ce(Ga,{children:gr(d,{style:on.inlineRoot,children:[ce(d,{style:on.inlineHeader,...ip,children:Wr()}),Gr,Ur]})}):ce(Ga,{children:ce(rp,{visible:e,onClose:t,onMinimize:o,persistenceKey:ks,header:{showToggleButton:!0,customContent:Wr()},enablePersistence:!0,initialMode:"bottomSheet",enableGlitchEffects:!0,styles:{},footer:Ur,footerHeight:h&&(w==="details"||(h.renderHistory?.length??0)>1)?68:0,children:Gr})})}function cp(e={}){return ce(_n,{...e,inline:!0,visible:!0,onClose:()=>{}})}var on=oe.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:nn.color.border,backgroundColor:"transparent"},container:{flex:1,backgroundColor:"transparent"},disabledBanner:{flexDirection:"row",alignItems:"center",gap:8,padding:10,marginHorizontal:12,marginTop:8,backgroundColor:nn.color.warningSoft,borderRadius:8,borderWidth:1,borderColor:nn.color.warning+"20"},disabledText:{color:nn.color.warning,fontSize:11,flex:1}});import{jsx as rn}from"react/jsx-runtime";function pp({size:e}){let[t,n]=fr(()=>N.isEnabled());return mr(()=>N.subscribe(r=>{n(r)}),[]),rn(ja,{size:e,color:t?"#10b981":"#6b7280"})}function qa(){return null}function Xa(e){let[t,n]=fr(null);mr(()=>(e.visible&&N.setBadgePressCallback(r=>{n(r)}),()=>{e.visible||N.setBadgePressCallback(null)}),[e.visible]);let o=dp(()=>{n(null)},[]);return rn(_n,{...e,initialNativeTag:t,onInitialNativeTagHandled:o})}var gp={id:"highlight-updates",name:"TOGGLE HIGHLIGHT",description:"Toggle component render highlights",slot:"row",icon:pp,component:qa,props:{},launchMode:"toggle-only",onPress:()=>{N.isInitialized()||N.initialize(),N.toggle()}};function fp(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";e?.autoInitialize&&setTimeout(()=>{N.initialize()},1e3);let o=({size:r})=>{let[i,s]=fr(()=>N.isEnabled());return mr(()=>N.subscribe(l=>{s(l)}),[]),rn(ja,{size:r,color:i?t:n})};return{id:e?.id||"highlight-updates",name:e?.name||"TOGGLE HIGHLIGHT",description:e?.description||"Toggle component render highlights",slot:"row",icon:o,component:qa,props:{},launchMode:"toggle-only",onPress:()=>{N.isInitialized()||N.initialize(),N.toggle()}}}var mp={id:"highlight-updates-modal",name:"HIGHLIGHT",description:"View component render tracking modal",slot:"both",icon:({size:e})=>rn(Ka,{size:e}),component:Xa,props:{enableSharedModalDimensions:!1}};function hp(e){let t=e?.enabledColor||"#10b981",n=e?.disabledColor||"#6b7280";return e?.autoInitialize&&setTimeout(()=>{N.initialize()},1e3),{id:e?.id||"highlight-updates-modal",name:e?.name||"HIGHLIGHT",description:e?.description||"View component render tracking modal",slot:"both",icon:({size:o})=>rn(Ka,{size:o,color:t}),component:Xa,props:{enableSharedModalDimensions:!1}}}P();Le();P();P();import{resolveDOMEventEmitter as Ya}from"@buoy-gg/shared-ui/web/utils";var yp=14,bp=550,Tp=4e3,Cp=8e3,Ja=600,hr=null,Qa=!1,br=null,Fn=[],Ge="idle",Ke=[],Tr=0,Pe=null;function vp(){if(Qa)return hr;Qa=!0;let e=Ya();return hr=e.emitter,br=e.reason,hr}function Ht(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Za(e){let t=e?.nativeEvent;return t?Ht(t.target)??Ht(t.tag):null}function Cr(e){let t=e?.nativeEvent;if(!t)return null;let n={x:Ht(t.pageX),y:Ht(t.pageY)};if(n.x!==null&&n.y!==null)return{x:n.x,y:n.y};for(let o of["changedTouches","touches"]){let r=t[o];if(Array.isArray(r)&&r.length){let i=r[0],s=Ht(i?.pageX),a=Ht(i?.pageY);if(s!==null&&a!==null)return{x:s,y:a}}}return null}function es(e){Ke.push({...e,seq:++Tr}),Ke.length>Ja&&(Ke=Ke.slice(-Ja))}function wp(e){let t=Za(e);if(t===null)return;let n=Cr(e),o=null;try{o=mo(t)}catch{}Pe={tag:t,x:n?.x??0,y:n?.y??0,t:Date.now(),drift:0,target:o}}function Sp(e){if(!Pe)return;let t=Cr(e);if(!t)return;let n=t.x-Pe.x,o=t.y-Pe.y;Pe.drift=Math.max(Pe.drift,Math.sqrt(n*n+o*o))}function xp(e){let t=Pe;if(Pe=null,!t||!t.target)return;let n=Cr(e);if(n){let r=n.x-t.x,i=n.y-t.y;t.drift=Math.max(t.drift,Math.sqrt(r*r+i*i))}if(t.drift>yp)return;let o=Date.now()-t.t;o>Tp||t.target.control!=="text"&&(t.target.control==="toggle"||t.target.control==="slider"||es({t:Date.now(),kind:o>=bp?"longPress":"press",target:t.target}))}function Rp(){Pe=null}function yr(e){let t=Za(e);if(t===null)return;let n=e.nativeEvent,o,r;if(typeof n.text=="string")o="text",r=n.text;else if(typeof n.value=="boolean")o="toggle",r=n.value;else if(typeof n.value=="number")o="slider",r=n.value;else return;let i=Ke[Ke.length-1];if(i&&i.kind===o&&i.target.nativeTag===t&&Date.now()-i.t<Cp){i.value=r,i.t=Date.now();return}let s=null;try{s=mo(t)}catch{}s&&es({t:Date.now(),kind:o,target:s,value:r})}function ts(){if(Ge==="capturing")return zt();let e=vp();if(!e)return Ge="unavailable",zt();try{Fn=[e.addListener("topTouchStart",wp),e.addListener("topTouchMove",Sp),e.addListener("topTouchEnd",xp),e.addListener("topTouchCancel",Rp),e.addListener("topChange",yr),e.addListener("topValueChange",yr),e.addListener("topSlidingComplete",yr)],Pe=null,Ge="capturing"}catch(t){Fn=[],Ge="unavailable",br=t?.message??"addListener failed"}return zt()}function ns(){Fn.forEach(e=>{try{e.remove()}catch{}}),Fn=[],Pe=null,Ge==="capturing"&&(Ge="idle")}function os(){Ke=[],Tr=0}function zt(){return{status:Ge,reason:Ge==="unavailable"?br:null}}function rs(e=0){return{...zt(),records:Ke.filter(t=>t.seq>e),seq:Tr}}P();var cs=0,us=1,ds=11,ps=14,gs=15,$n=1,Ip=1e4,kp=300,Dp=20,is=!1,an=!1,wr=!1,Wn=!1,Un=0,ct=0,Gn=0,lt={},ut=new Map;function fs(){return typeof globalThis>"u"?null:globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__??null}function vr(e){let t=e.flags??e.effectTag;return typeof t=="number"?t:0}function ms(e){return e===cs||e===us||e===ds||e===ps||e===gs}function Sr(e){let t=e.type;try{switch(e.tag){case cs:case us:return t?.displayName||t?.name||"Anonymous";case ds:return t?.displayName||t?.render?.displayName||t?.render?.name||"ForwardRef";case ps:case gs:{let n=t?.type??e.elementType?.type;return t?.displayName||n?.displayName||n?.name||"Memo"}default:return"Anonymous"}}catch{return"Anonymous"}}function Pp(e){let t=e.actualDuration;if(typeof t!="number")return null;let n=t;for(let o=e.child;o!=null;o=o.sibling)typeof o.actualDuration=="number"&&(n-=o.actualDuration);return n>0?n:0}var Vp=new Set(["View","Text","Image","ImageBackground","ScrollView","FlatList","SectionList","SafeAreaView","KeyboardAvoidingView","StatusBar","ActivityIndicator","RefreshControl","Modal","Switch","Pressable","PlatformPressable","TouchableOpacity","TouchableHighlight","TouchableWithoutFeedback","TouchableNativeFeedback","PressabilityDebugView","AnimatedComponent","Wrapper"]),as=["Animated(","Pressability","Virtualized","CellRenderer"];function hs(e){if(Vp.has(e))return!0;for(let t=0;t<as.length;t++)if(e.startsWith(as[t]))return!0;return!1}var ss=40,ys=5;function Lp(e,t){if(Object.is(e,t))return!0;let n=typeof e;if(n!==typeof t)return!1;if(n==="function")return!0;if(e===null||t===null||n!=="object")return!1;let o=Array.isArray(e);if(o!==Array.isArray(t))return!1;if(o){if(e.length!==t.length)return!1;for(let s=0;s<e.length;s++)if(!Object.is(e[s],t[s]))return!1;return!0}let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let s=0;s<r.length;s++){let a=r[s];if(!Object.prototype.hasOwnProperty.call(t,a)||!Object.is(e[a],t[a]))return!1}return!0}function Ep(e,t){let n=e.alternate;if(!n)return{cause:"mount"};let o=e.memoizedProps,r=n.memoizedProps;if(o!==r&&o&&r){let i=!1,s=!1,a,l=Object.keys(o),c=l.length<ss?l.length:ss;for(let u=0;u<c;u++){let y=l[u],v=r[y],S=o[y];if(!Object.is(v,S)&&(i=!0,t&&(a||(a=[]),a.length<ys&&a.push(y)),!Lp(v,S)&&(s=!0,!t)))break}if(!s&&Object.keys(r).length!==l.length&&(i=!0,s=!0),i)return{cause:s?"props":"propsUnstable",changedKeys:a}}return bi(n,e)?{cause:"hooks"}:{cause:"parent"}}function Np(e){for(let t=e.return;t!=null;t=t.return){if(!ms(t.tag)||(vr(t)&$n)===0)continue;let n=Sr(t);if(!hs(n))return n}}function Hp(e,t){let n=Sr(e),o=Pp(e);o!==null&&(wr=!0);let r=o??0;ct+=1,Gn+=r;let{cause:i,changedKeys:s}=Ep(e,Wn);if(lt[i]=(lt[i]??0)+1,hs(n))return;let a=ut.get(n);if(!a){if(ut.size>=kp)return;a={renders:0,totalSelfMs:0,maxSelfMs:0,causes:{}},ut.set(n,a)}if(a.renders+=1,a.totalSelfMs+=r,r>a.maxSelfMs&&(a.maxSelfMs=r),a.causes[i]=(a.causes[i]??0)+1,Wn){if(s){a.changedProps||(a.changedProps=new Set);for(let l=0;l<s.length&&!(a.changedProps.size>=ys);l++)a.changedProps.add(s[l])}t&&!a.parentName&&(a.parentName=t)}}function zp(e){let t=e?.current;if(!t)return;let n=ct,o=0,r=t;for(;r!=null&&(o+=1,!(o>Ip));){let i=!1,s=ms(r.tag);if(r.memoizedProps?.__buoyDevToolsRoot)i=!0;else if(s){let a=Sr(r);Vi(a)?i=!0:Pi(a)||(vr(r)&$n)!==0&&Hp(r,Wn?Np(r):void 0)}if(!i){let a=r.subtreeFlags;if(!(typeof a=="number"&&(a&$n)===0&&(vr(r)&$n)===0)&&r.child!=null){r=r.child;continue}}for(;r!=null;){if(r===t)return ls(n);if(r.sibling!=null){r=r.sibling;break}r=r.return}}ls(n)}function ls(e){ct>e&&(Un+=1)}function Ap(){if(is)return!0;let e=fs();if(!e)return!1;let t=e.onCommitFiberRoot;return e.onCommitFiberRoot=function(n,o,...r){if(an)try{zp(o)}catch{}return typeof t=="function"?t.call(e,n,o,...r):void 0},is=!0,!0}function Op(){if(typeof _<"u"&&!_)return!1;let e=fs();return!!(e&&e.renderers&&e.renderers.size>0)}function Mp(){return an}function _p(e){Ap()&&(ut=new Map,wr=!1,Wn=e?.detail===!0,Un=0,ct=0,Gn=0,lt={},an=!0)}function Fp(){if(!an&&ct===0&&ut.size===0)return null;an=!1;let e=Array.from(ut.entries()).sort((n,o)=>{let r=o[1].totalSelfMs-n[1].totalSelfMs;return r!==0?r:o[1].renders-n[1].renders}).slice(0,Dp).map(([n,o])=>({name:n,renders:o.renders,totalMs:Bn(o.totalSelfMs),maxMs:Bn(o.maxSelfMs),avgMs:o.renders>0?Bn(o.totalSelfMs/o.renders):0,causes:o.causes,...o.changedProps&&o.changedProps.size>0?{changedProps:Array.from(o.changedProps)}:null,...o.parentName?{parentName:o.parentName}:null})),t={totalCommits:Un,totalRenders:ct,capturedDurations:wr,totalRenderMs:Bn(Gn),wastedRenders:(lt.parent??0)+(lt.propsUnstable??0),causes:lt,topComponents:e};return ut=new Map,Un=0,ct=0,Gn=0,lt={},t}function Bn(e){return Math.round(e*100)/100}var Me={isSupported:Op,isCapturing:Mp,startCapture:_p,stopCapture:Fp};function Kn(){N.isInitialized()||N.initialize()}function xr(e){if(!e)return;let{hookChanges:t,...n}=e;return n}function Bp(e){let{renderHistory:t,lastRenderCause:n,...o}=e;return{...o,lastRenderCause:xr(n),historyCount:t?.length??0}}function $p(e){try{return JSON.stringify(e),e}catch{return{...e,lastRenderCause:xr(e.lastRenderCause),renderHistory:e.renderHistory?.map(t=>({...t,capturedProps:void 0,capturedState:void 0,cause:xr(t.cause)??t.cause}))}}}function Wp(){return Me.isSupported()?(Me.startCapture({detail:!0}),{ok:!0}):{ok:!1,reason:"render capture needs a dev build with the React DevTools hook available"}}function Up(){return{summary:Me.stopCapture()}}var Gp={version:3,getSnapshot:()=>({enabled:N.isEnabled(),frozen:N.getFrozen(),highlightsSuppressed:N.getHighlightsSuppressed(),renders:E.getRenders().map(Bp),trackerState:E.getState()}),subscribe:e=>{let t=N.subscribe(e),n=N.subscribeToFreeze(e),o=E.subscribe(e),r=E.subscribeToState(e);return()=>{t(),n(),o(),r()}},actions:{beginMeasurement:()=>Wp(),endMeasurement:()=>Up(),getRenderDetail:e=>{let{nativeTag:t}=e??{};if(t==null)return{found:!1,reason:"missing nativeTag"};let n=E.getRender(String(t));return n?{found:!0,nativeTag:t,render:$p(n)}:{found:!1,reason:"unknown nativeTag"}},toggle:()=>{Kn(),N.toggle()},setEnabled:e=>{Kn(),N.setEnabled(e.enabled)},toggleFreeze:()=>{N.toggleFreeze()},clearRenderCounts:()=>{N.clearRenderCounts()},setSpotlight:e=>{N.setSpotlight(e.nativeTag)},locateComponent:e=>(Kn(),N.locateComponent(e??{})),setSilentTracking:e=>{Kn(),N.setSilentTracking(e.enabled??!1)},describeScreen:e=>hn(e??{}),tapElement:e=>hi(e??{}),waitFor:e=>yi(e??{}),startTouchCapture:()=>ts(),stopTouchCapture:()=>(ns(),zt()),clearTouchCapture:()=>(os(),{ok:!0}),readTouchCapture:e=>rs(e?.sinceSeq??0)}};P();import{useEffect as jn,useState as Rr,useRef as qn,useCallback as bs,useLayoutEffect as Kp}from"react";import{night as Xn,monoFont as jp}from"@buoy-gg/shared-ui/web";Wt();Le();import{Fragment as Yp,jsx as At,jsxs as Ts}from"react/jsx-runtime";var qp=1e3;function Xp({onBadgePress:e}={}){let[t,n]=Rr([]),[o,r]=Rr(()=>N.getFrozen()),[i,s]=Rr(null),a=qn(null),l=qn(0),c=qn(0),u=qn(o);u.current=o,ze.isEnabled()&&(l.current=performance.now(),c.current=t.length),Kp(()=>{if(ze.isEnabled()&&l.current>0&&c.current>0){let T=performance.now()-l.current;Xr(c.current,T)}}),jn(()=>N.subscribeToFreeze(h=>{r(h)}),[]),jn(()=>E.subscribeToFilters(()=>{n(h=>h.filter(f=>{let m=E.getRender(String(f.id));return m?E.shouldShowRender(m):!0}))}),[]),jn(()=>(N.setSpotlightCallback(T=>{s(T)}),()=>{N.setSpotlightCallback(null)}),[]);let y=bs(T=>{let h=Date.now(),f=T.map(m=>({...m,timestamp:h}));n(m=>{let R=[...m];for(let L of f){let D=R.findIndex(k=>k.id===L.id);D>=0?R[D]=L:R.push(L)}return R})},[]);jn(()=>(N.setHighlightCallback(y),a.current=setInterval(()=>{if(u.current)return;let T=Date.now();n(h=>h.filter(f=>T-f.timestamp<qp))},50),()=>{N.setHighlightCallback(null),a.current&&clearInterval(a.current)}),[y]);let v=e||N.getBadgePressCallback(),S=bs(T=>{e?e(T):N.handleBadgePress(T)},[e]),C=i?E.getRender(String(i)):null;return t.length===0&&!C?.measurements?null:Ts(d,{style:dt.overlay,pointerEvents:"box-none",nativeID:"highlight-updates-overlay",children:[C?.measurements&&Ts(Yp,{children:[At(d,{pointerEvents:"none",nativeID:"__spotlight_highlight__",style:[dt.spotlightHighlight,{left:C.measurements.x-3,top:C.measurements.y-3,width:C.measurements.width+6,height:C.measurements.height+6}]}),At(d,{pointerEvents:"none",style:[dt.spotlightLabel,{left:C.measurements.x,top:C.measurements.y+C.measurements.height+4}],children:At(p,{style:dt.spotlightLabelText,children:C.componentName||C.displayName||C.viewType})})]}),t.map(T=>At(d,{pointerEvents:"box-none",nativeID:`__highlight_rect_${T.id}__`,style:[dt.highlight,{left:T.x,top:T.y,width:T.width,height:T.height,borderColor:T.color}],children:T.count>0&&At(d,{style:[dt.badge,{backgroundColor:T.color}],nativeID:`__highlight_badge_${T.id}__`,pointerEvents:v?"auto":"none",hitSlop:{top:8,bottom:8,left:8,right:8},onStartShouldSetResponder:()=>!!v,onResponderGrant:()=>S(T.id),children:At(p,{style:dt.badgeText,nativeID:`__highlight_text_${T.id}__`,children:T.count})})},`highlight-${T.id}`))]})}var dt=oe.create({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:999999,elevation:999999,borderWidth:0},highlight:{position:"absolute",borderWidth:2,borderStyle:"solid",backgroundColor:"transparent"},badge:{position:"absolute",top:0,right:0,height:14,borderRadius:0,justifyContent:"center",alignItems:"center",paddingHorizontal:2},badgeText:{color:"#000",fontSize:9,fontWeight:"bold"},spotlightHighlight:{position:"absolute",borderWidth:2,borderStyle:"dashed",borderColor:Xn.color.accent,backgroundColor:"transparent"},spotlightLabel:{position:"absolute",backgroundColor:Xn.color.surface,borderWidth:1,borderColor:Xn.color.accent,paddingHorizontal:8,paddingVertical:3,borderRadius:4},spotlightLabelText:{color:Xn.color.accent,fontSize:11,fontWeight:"600",fontFamily:jp}});import{setRenderCaptureProvider as Qp}from"@buoy-gg/shared-ui/web";Le();Wt();lo();P();function Jp(e){let t={exportedAt:new Date().toISOString(),totalComponents:e.length,totalRenders:e.reduce((n,o)=>n+o.renderCount,0),components:e.map(n=>({componentName:n.componentName||n.displayName,viewType:n.viewType,nativeTag:n.nativeTag,testID:n.testID,nativeID:n.nativeID,accessibilityLabel:n.accessibilityLabel,renderCount:n.renderCount,firstRenderTime:n.firstRenderTime,lastRenderTime:n.lastRenderTime,lastRenderCause:n.lastRenderCause?{type:n.lastRenderCause.type,componentCause:n.lastRenderCause.componentCause,changedKeys:n.lastRenderCause.changedKeys,hookChanges:n.lastRenderCause.hookChanges?.map(o=>({type:o.type,index:o.index,description:o.description}))}:null,renderHistory:n.renderHistory?.map(o=>({renderNumber:o.renderNumber,timestamp:o.timestamp,cause:{type:o.cause.type,componentCause:o.cause.componentCause,changedKeys:o.cause.changedKeys}}))}))};return JSON.stringify(t,null,2)}try{Qp({isSupported:Me.isSupported,start:Me.startCapture,stop:Me.stopCapture,startLiveHighlights:()=>{try{let e=N.isEnabled(),t=N.getHighlightsSuppressed();return N.enable(),()=>{try{e?t&&N.setHighlightsSuppressed(!0):N.disable()}catch{}}}catch{return null}}})}catch{}var Xh=e=>{let{RenderTracker:t}=(Le(),Es(ei));return t.onRenderEvent(e)};export{Ee as CAUSE_CONFIG,wt as COMPONENT_CAUSE_CONFIG,Me as CommitProfiler,tr as HighlightFilterView,cp as HighlightToolView,N as HighlightUpdatesController,_n as HighlightUpdatesModal,Xp as HighlightUpdatesOverlay,ze as PerformanceLogger,Fo as RenderCauseBadge,Go as RenderDetailView,lr as RenderHistoryFooter,sr as RenderHistoryViewer,nr as RenderListItem,E as RenderTracker,Su as TwoLevelCauseBadge,mt as VIEW_TYPE_MAP,Vc as capturePropsSnapshot,Lc as captureStateSnapshot,wo as clearRenderCauseState,hp as createHighlightUpdatesModalTool,fp as createHighlightUpdatesTool,wn as detectRenderCause,Yo as detectedItemTestID,Ms as disableProfilerLogging,Os as enableProfilerLogging,Jp as generateRendersJson,zl as getAllComponentNames,Hl as getAllNativeViewTypes,pn as getComponentDisplayName,El as getNativeViewType,Dc as getRenderCauseStats,mp as highlightUpdatesModalPreset,gp as highlightUpdatesPreset,Gp as highlightUpdatesSyncAdapter,Rt as identifierSlug,oo as installProfilerInterceptor,Io as isCapturingBuoyToolRenders,As as isInterceptorInstalled,Nl as isKnownViewType,_s as isLoggingEnabled,Xh as onRenderEvent,Jo as patternChipTestID,kc as removeRenderCauseState,Xo as renderRowTestID,Be as safeCloneForHistory,Ec as setCaptureBuoyToolRenders,no as setComparisonCallback,ot as settingTestID,ro as uninstallProfilerInterceptor};