@buoy-gg/network 7.0.40 → 7.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (275) hide show
  1. package/README.md +11 -79
  2. package/lib/commonjs/index.js +1 -325
  3. package/lib/commonjs/index.web.js +1 -420
  4. package/lib/commonjs/network/components/DataViewer.web.js +1 -879
  5. package/lib/commonjs/network/components/NetworkCopyScreen.web.js +1 -48
  6. package/lib/commonjs/network/components/NetworkCopySettingsView.js +27 -755
  7. package/lib/commonjs/network/components/NetworkCopySettingsView.web.js +14 -1242
  8. package/lib/commonjs/network/components/NetworkDetailScreen.web.js +1 -101
  9. package/lib/commonjs/network/components/NetworkDetailStepper.js +1 -108
  10. package/lib/commonjs/network/components/NetworkDetailStepper.web.js +1 -298
  11. package/lib/commonjs/network/components/NetworkEventDetailView.js +15 -1130
  12. package/lib/commonjs/network/components/NetworkEventDetailView.web.js +15 -1484
  13. package/lib/commonjs/network/components/NetworkEventItemCompact.js +2 -401
  14. package/lib/commonjs/network/components/NetworkEventItemCompact.web.js +2 -820
  15. package/lib/commonjs/network/components/NetworkFilterScreen.web.js +1 -55
  16. package/lib/commonjs/network/components/NetworkFilterViewV3.js +1 -442
  17. package/lib/commonjs/network/components/NetworkFilterViewV3.web.js +1 -1310
  18. package/lib/commonjs/network/components/NetworkHeaderLive.js +1 -375
  19. package/lib/commonjs/network/components/NetworkHeaderLive.web.js +1 -623
  20. package/lib/commonjs/network/components/NetworkHeaderMenu.js +1 -190
  21. package/lib/commonjs/network/components/NetworkListScreen.js +1 -404
  22. package/lib/commonjs/network/components/NetworkListScreen.web.js +1 -625
  23. package/lib/commonjs/network/components/NetworkModal.js +1 -786
  24. package/lib/commonjs/network/components/NetworkNumberPrompt.js +1 -178
  25. package/lib/commonjs/network/components/NetworkNumberPrompt.web.js +1 -232
  26. package/lib/commonjs/network/components/NetworkOverrideEditor.js +1 -814
  27. package/lib/commonjs/network/components/NetworkOverrideEditor.web.js +1 -942
  28. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.js +1 -107
  29. package/lib/commonjs/network/components/NetworkOverrideHeaderButton.web.js +1 -133
  30. package/lib/commonjs/network/components/NetworkOverridesButton.js +1 -90
  31. package/lib/commonjs/network/components/NetworkOverridesButton.web.js +1 -143
  32. package/lib/commonjs/network/components/NetworkOverridesScreen.js +1 -543
  33. package/lib/commonjs/network/components/NetworkOverridesScreen.web.js +1 -830
  34. package/lib/commonjs/network/components/NetworkSavedScreen.js +1 -226
  35. package/lib/commonjs/network/components/NetworkSavedScreen.web.js +1 -463
  36. package/lib/commonjs/network/components/NetworkUpgradeBanner.js +1 -76
  37. package/lib/commonjs/network/components/response-editor/Explorer.js +1 -973
  38. package/lib/commonjs/network/components/response-editor/Explorer.web.js +1 -1136
  39. package/lib/commonjs/network/components/response-editor/deleteNestedDataByPath.js +1 -56
  40. package/lib/commonjs/network/components/response-editor/editorContext.js +1 -33
  41. package/lib/commonjs/network/components/response-editor/updateNestedDataByPath.js +1 -61
  42. package/lib/commonjs/network/conditions/NetworkConditionsControl.js +1 -235
  43. package/lib/commonjs/network/conditions/NetworkConditionsControl.test.js +1 -136
  44. package/lib/commonjs/network/conditions/NetworkConditionsIcon.js +1 -33
  45. package/lib/commonjs/network/conditions/NetworkFloatingTool.js +1 -310
  46. package/lib/commonjs/network/conditions/NetworkFloatingTool.test.js +1 -219
  47. package/lib/commonjs/network/conditions/store.js +1 -75
  48. package/lib/commonjs/network/conditions/wait.js +1 -43
  49. package/lib/commonjs/network/conditions/xhr.js +1 -110
  50. package/lib/commonjs/network/hooks/useLiveNetworkEvent.js +1 -62
  51. package/lib/commonjs/network/hooks/useNetworkBadgeCounts.js +1 -83
  52. package/lib/commonjs/network/hooks/useNetworkEventList.js +1 -108
  53. package/lib/commonjs/network/hooks/useNetworkEvents.js +1 -318
  54. package/lib/commonjs/network/hooks/useNetworkHasMatches.js +1 -56
  55. package/lib/commonjs/network/hooks/useNetworkSaved.js +1 -38
  56. package/lib/commonjs/network/hooks/useNetworkSelection.js +1 -53
  57. package/lib/commonjs/network/hooks/useOverrideRules.js +1 -36
  58. package/lib/commonjs/network/hooks/useTickEveryMinute.js +1 -21
  59. package/lib/commonjs/network/overrides/applyToFetch.js +1 -80
  60. package/lib/commonjs/network/overrides/applyToXhr.js +2 -453
  61. package/lib/commonjs/network/overrides/engine.js +1 -93
  62. package/lib/commonjs/network/overrides/matchRule.js +1 -81
  63. package/lib/commonjs/network/overrides/overriddenRows.js +1 -0
  64. package/lib/commonjs/network/overrides/overrideRulesStore.js +1 -550
  65. package/lib/commonjs/network/overrides/presets.js +1 -70
  66. package/lib/commonjs/network/overrides/resolveOverride.js +1 -158
  67. package/lib/commonjs/network/overrides/types.js +1 -90
  68. package/lib/commonjs/network/sync/networkBodyResolver.js +1 -39
  69. package/lib/commonjs/network/sync/networkSyncAdapter.js +1 -882
  70. package/lib/commonjs/network/sync/overrideHonesty.release.test.js +1 -36
  71. package/lib/commonjs/network/types/index.js +1 -5
  72. package/lib/commonjs/network/utils/extractOperationName.js +1 -80
  73. package/lib/commonjs/network/utils/filterNetworkEvents.js +1 -96
  74. package/lib/commonjs/network/utils/formatGraphQLVariables.js +1 -219
  75. package/lib/commonjs/network/utils/formatting.js +1 -30
  76. package/lib/commonjs/network/utils/generateCurl.js +2 -71
  77. package/lib/commonjs/network/utils/generateNetworkCopyText.js +37 -166
  78. package/lib/commonjs/network/utils/httpCompletion.js +1 -37
  79. package/lib/commonjs/network/utils/networkEventStore.js +1 -393
  80. package/lib/commonjs/network/utils/networkListener.js +4 -1259
  81. package/lib/commonjs/network/utils/networkSavedStore.js +3 -577
  82. package/lib/commonjs/network/utils/networkSelectionStore.js +1 -193
  83. package/lib/commonjs/network/utils/realNow.js +1 -0
  84. package/lib/commonjs/network/utils/requestId.js +1 -0
  85. package/lib/commonjs/network/utils/resolveRequestUrl.js +1 -0
  86. package/lib/commonjs/network/utils/selectSavedEvents.js +1 -39
  87. package/lib/commonjs/network/utils/startNetworkCapture.js +1 -0
  88. package/lib/commonjs/network/utils/withPinnedFirst.js +1 -32
  89. package/lib/commonjs/preset.js +1 -102
  90. package/lib/module/index.js +1 -103
  91. package/lib/module/index.web.js +1 -82
  92. package/lib/module/network/components/DataViewer.web.js +1 -875
  93. package/lib/module/network/components/NetworkCopyScreen.web.js +1 -44
  94. package/lib/module/network/components/NetworkCopySettingsView.js +27 -750
  95. package/lib/module/network/components/NetworkCopySettingsView.web.js +14 -1237
  96. package/lib/module/network/components/NetworkDetailScreen.web.js +1 -97
  97. package/lib/module/network/components/NetworkDetailStepper.js +1 -104
  98. package/lib/module/network/components/NetworkDetailStepper.web.js +1 -296
  99. package/lib/module/network/components/NetworkEventDetailView.js +15 -1129
  100. package/lib/module/network/components/NetworkEventDetailView.web.js +15 -1482
  101. package/lib/module/network/components/NetworkEventItemCompact.js +2 -398
  102. package/lib/module/network/components/NetworkEventItemCompact.web.js +2 -818
  103. package/lib/module/network/components/NetworkFilterScreen.web.js +1 -51
  104. package/lib/module/network/components/NetworkFilterViewV3.js +1 -438
  105. package/lib/module/network/components/NetworkFilterViewV3.web.js +1 -1306
  106. package/lib/module/network/components/NetworkHeaderLive.js +1 -366
  107. package/lib/module/network/components/NetworkHeaderLive.web.js +1 -617
  108. package/lib/module/network/components/NetworkHeaderMenu.js +1 -184
  109. package/lib/module/network/components/NetworkListScreen.js +1 -400
  110. package/lib/module/network/components/NetworkListScreen.web.js +1 -623
  111. package/lib/module/network/components/NetworkModal.js +1 -781
  112. package/lib/module/network/components/NetworkNumberPrompt.js +1 -174
  113. package/lib/module/network/components/NetworkNumberPrompt.web.js +1 -230
  114. package/lib/module/network/components/NetworkOverrideEditor.js +1 -811
  115. package/lib/module/network/components/NetworkOverrideEditor.web.js +1 -939
  116. package/lib/module/network/components/NetworkOverrideHeaderButton.js +1 -104
  117. package/lib/module/network/components/NetworkOverrideHeaderButton.web.js +1 -131
  118. package/lib/module/network/components/NetworkOverridesButton.js +1 -87
  119. package/lib/module/network/components/NetworkOverridesButton.web.js +1 -141
  120. package/lib/module/network/components/NetworkOverridesScreen.js +1 -539
  121. package/lib/module/network/components/NetworkOverridesScreen.web.js +1 -826
  122. package/lib/module/network/components/NetworkSavedScreen.js +1 -222
  123. package/lib/module/network/components/NetworkSavedScreen.web.js +1 -461
  124. package/lib/module/network/components/NetworkUpgradeBanner.js +1 -72
  125. package/lib/module/network/components/response-editor/Explorer.js +1 -972
  126. package/lib/module/network/components/response-editor/Explorer.web.js +1 -1133
  127. package/lib/module/network/components/response-editor/deleteNestedDataByPath.js +1 -51
  128. package/lib/module/network/components/response-editor/editorContext.js +1 -29
  129. package/lib/module/network/components/response-editor/updateNestedDataByPath.js +1 -56
  130. package/lib/module/network/conditions/NetworkConditionsControl.js +1 -231
  131. package/lib/module/network/conditions/NetworkConditionsControl.test.js +1 -135
  132. package/lib/module/network/conditions/NetworkConditionsIcon.js +1 -29
  133. package/lib/module/network/conditions/NetworkFloatingTool.js +1 -304
  134. package/lib/module/network/conditions/NetworkFloatingTool.test.js +1 -218
  135. package/lib/module/network/conditions/store.js +1 -65
  136. package/lib/module/network/conditions/wait.js +1 -38
  137. package/lib/module/network/conditions/xhr.js +1 -106
  138. package/lib/module/network/hooks/useLiveNetworkEvent.js +1 -58
  139. package/lib/module/network/hooks/useNetworkBadgeCounts.js +1 -79
  140. package/lib/module/network/hooks/useNetworkEventList.js +1 -104
  141. package/lib/module/network/hooks/useNetworkEvents.js +1 -314
  142. package/lib/module/network/hooks/useNetworkHasMatches.js +1 -52
  143. package/lib/module/network/hooks/useNetworkSaved.js +1 -34
  144. package/lib/module/network/hooks/useNetworkSelection.js +1 -46
  145. package/lib/module/network/hooks/useOverrideRules.js +1 -32
  146. package/lib/module/network/hooks/useTickEveryMinute.js +1 -11
  147. package/lib/module/network/overrides/applyToFetch.js +1 -72
  148. package/lib/module/network/overrides/applyToXhr.js +2 -446
  149. package/lib/module/network/overrides/engine.js +1 -85
  150. package/lib/module/network/overrides/matchRule.js +1 -75
  151. package/lib/module/network/overrides/overriddenRows.js +1 -0
  152. package/lib/module/network/overrides/overrideRulesStore.js +1 -547
  153. package/lib/module/network/overrides/presets.js +1 -65
  154. package/lib/module/network/overrides/resolveOverride.js +1 -152
  155. package/lib/module/network/overrides/types.js +1 -86
  156. package/lib/module/network/sync/networkBodyResolver.js +1 -34
  157. package/lib/module/network/sync/networkSyncAdapter.js +1 -880
  158. package/lib/module/network/sync/overrideHonesty.release.test.js +1 -35
  159. package/lib/module/network/types/index.js +1 -3
  160. package/lib/module/network/utils/extractOperationName.js +1 -76
  161. package/lib/module/network/utils/filterNetworkEvents.js +1 -92
  162. package/lib/module/network/utils/formatGraphQLVariables.js +1 -213
  163. package/lib/module/network/utils/formatting.js +1 -9
  164. package/lib/module/network/utils/generateCurl.js +2 -67
  165. package/lib/module/network/utils/generateNetworkCopyText.js +37 -162
  166. package/lib/module/network/utils/httpCompletion.js +1 -32
  167. package/lib/module/network/utils/networkEventStore.js +1 -391
  168. package/lib/module/network/utils/networkListener.js +4 -1249
  169. package/lib/module/network/utils/networkSavedStore.js +3 -572
  170. package/lib/module/network/utils/networkSelectionStore.js +1 -188
  171. package/lib/module/network/utils/realNow.js +1 -0
  172. package/lib/module/network/utils/requestId.js +1 -0
  173. package/lib/module/network/utils/resolveRequestUrl.js +1 -0
  174. package/lib/module/network/utils/selectSavedEvents.js +1 -35
  175. package/lib/module/network/utils/startNetworkCapture.js +1 -0
  176. package/lib/module/network/utils/withPinnedFirst.js +1 -28
  177. package/lib/module/preset.js +1 -100
  178. package/lib/typescript/index.d.ts +1 -0
  179. package/lib/typescript/network/overrides/applyToXhr.d.ts +1 -0
  180. package/lib/typescript/network/overrides/engine.d.ts +1 -1
  181. package/lib/typescript/network/overrides/matchRule.d.ts +1 -1
  182. package/lib/typescript/network/overrides/overriddenRows.d.ts +16 -0
  183. package/lib/typescript/network/overrides/resolveOverride.d.ts +2 -2
  184. package/lib/typescript/network/overrides/types.d.ts +9 -0
  185. package/lib/typescript/network/utils/networkListener.d.ts +14 -4
  186. package/lib/typescript/network/utils/networkSavedStore.d.ts +4 -4
  187. package/lib/typescript/network/utils/realNow.d.ts +18 -0
  188. package/lib/typescript/network/utils/requestId.d.ts +2 -0
  189. package/lib/typescript/network/utils/resolveRequestUrl.d.ts +3 -0
  190. package/lib/typescript/network/utils/startNetworkCapture.d.ts +6 -0
  191. package/lib/web/index.mjs +145 -0
  192. package/package.json +32 -10
  193. package/lib/typescript/index.d.ts.map +0 -1
  194. package/lib/typescript/index.web.d.ts.map +0 -1
  195. package/lib/typescript/network/components/DataViewer.web.d.ts.map +0 -1
  196. package/lib/typescript/network/components/NetworkCopyScreen.web.d.ts.map +0 -1
  197. package/lib/typescript/network/components/NetworkCopySettingsView.d.ts.map +0 -1
  198. package/lib/typescript/network/components/NetworkCopySettingsView.web.d.ts.map +0 -1
  199. package/lib/typescript/network/components/NetworkDetailScreen.web.d.ts.map +0 -1
  200. package/lib/typescript/network/components/NetworkDetailStepper.d.ts.map +0 -1
  201. package/lib/typescript/network/components/NetworkDetailStepper.web.d.ts.map +0 -1
  202. package/lib/typescript/network/components/NetworkEventDetailView.d.ts.map +0 -1
  203. package/lib/typescript/network/components/NetworkEventDetailView.web.d.ts.map +0 -1
  204. package/lib/typescript/network/components/NetworkEventItemCompact.d.ts.map +0 -1
  205. package/lib/typescript/network/components/NetworkEventItemCompact.web.d.ts.map +0 -1
  206. package/lib/typescript/network/components/NetworkFilterScreen.web.d.ts.map +0 -1
  207. package/lib/typescript/network/components/NetworkFilterViewV3.d.ts.map +0 -1
  208. package/lib/typescript/network/components/NetworkFilterViewV3.web.d.ts.map +0 -1
  209. package/lib/typescript/network/components/NetworkHeaderLive.d.ts.map +0 -1
  210. package/lib/typescript/network/components/NetworkHeaderLive.web.d.ts.map +0 -1
  211. package/lib/typescript/network/components/NetworkHeaderMenu.d.ts.map +0 -1
  212. package/lib/typescript/network/components/NetworkListScreen.d.ts.map +0 -1
  213. package/lib/typescript/network/components/NetworkListScreen.web.d.ts.map +0 -1
  214. package/lib/typescript/network/components/NetworkModal.d.ts.map +0 -1
  215. package/lib/typescript/network/components/NetworkNumberPrompt.d.ts.map +0 -1
  216. package/lib/typescript/network/components/NetworkNumberPrompt.web.d.ts.map +0 -1
  217. package/lib/typescript/network/components/NetworkOverrideEditor.d.ts.map +0 -1
  218. package/lib/typescript/network/components/NetworkOverrideEditor.web.d.ts.map +0 -1
  219. package/lib/typescript/network/components/NetworkOverrideHeaderButton.d.ts.map +0 -1
  220. package/lib/typescript/network/components/NetworkOverrideHeaderButton.web.d.ts.map +0 -1
  221. package/lib/typescript/network/components/NetworkOverridesButton.d.ts.map +0 -1
  222. package/lib/typescript/network/components/NetworkOverridesButton.web.d.ts.map +0 -1
  223. package/lib/typescript/network/components/NetworkOverridesScreen.d.ts.map +0 -1
  224. package/lib/typescript/network/components/NetworkOverridesScreen.web.d.ts.map +0 -1
  225. package/lib/typescript/network/components/NetworkSavedScreen.d.ts.map +0 -1
  226. package/lib/typescript/network/components/NetworkSavedScreen.web.d.ts.map +0 -1
  227. package/lib/typescript/network/components/NetworkUpgradeBanner.d.ts.map +0 -1
  228. package/lib/typescript/network/components/response-editor/Explorer.d.ts.map +0 -1
  229. package/lib/typescript/network/components/response-editor/Explorer.web.d.ts.map +0 -1
  230. package/lib/typescript/network/components/response-editor/deleteNestedDataByPath.d.ts.map +0 -1
  231. package/lib/typescript/network/components/response-editor/editorContext.d.ts.map +0 -1
  232. package/lib/typescript/network/components/response-editor/updateNestedDataByPath.d.ts.map +0 -1
  233. package/lib/typescript/network/conditions/NetworkConditionsControl.d.ts.map +0 -1
  234. package/lib/typescript/network/conditions/NetworkConditionsControl.test.d.ts.map +0 -1
  235. package/lib/typescript/network/conditions/NetworkConditionsIcon.d.ts.map +0 -1
  236. package/lib/typescript/network/conditions/NetworkFloatingTool.d.ts.map +0 -1
  237. package/lib/typescript/network/conditions/NetworkFloatingTool.test.d.ts.map +0 -1
  238. package/lib/typescript/network/conditions/store.d.ts.map +0 -1
  239. package/lib/typescript/network/conditions/wait.d.ts.map +0 -1
  240. package/lib/typescript/network/conditions/xhr.d.ts.map +0 -1
  241. package/lib/typescript/network/hooks/useLiveNetworkEvent.d.ts.map +0 -1
  242. package/lib/typescript/network/hooks/useNetworkBadgeCounts.d.ts.map +0 -1
  243. package/lib/typescript/network/hooks/useNetworkEventList.d.ts.map +0 -1
  244. package/lib/typescript/network/hooks/useNetworkEvents.d.ts.map +0 -1
  245. package/lib/typescript/network/hooks/useNetworkHasMatches.d.ts.map +0 -1
  246. package/lib/typescript/network/hooks/useNetworkSaved.d.ts.map +0 -1
  247. package/lib/typescript/network/hooks/useNetworkSelection.d.ts.map +0 -1
  248. package/lib/typescript/network/hooks/useOverrideRules.d.ts.map +0 -1
  249. package/lib/typescript/network/hooks/useTickEveryMinute.d.ts.map +0 -1
  250. package/lib/typescript/network/overrides/applyToFetch.d.ts.map +0 -1
  251. package/lib/typescript/network/overrides/applyToXhr.d.ts.map +0 -1
  252. package/lib/typescript/network/overrides/engine.d.ts.map +0 -1
  253. package/lib/typescript/network/overrides/matchRule.d.ts.map +0 -1
  254. package/lib/typescript/network/overrides/overrideRulesStore.d.ts.map +0 -1
  255. package/lib/typescript/network/overrides/presets.d.ts.map +0 -1
  256. package/lib/typescript/network/overrides/resolveOverride.d.ts.map +0 -1
  257. package/lib/typescript/network/overrides/types.d.ts.map +0 -1
  258. package/lib/typescript/network/sync/networkBodyResolver.d.ts.map +0 -1
  259. package/lib/typescript/network/sync/networkSyncAdapter.d.ts.map +0 -1
  260. package/lib/typescript/network/sync/overrideHonesty.release.test.d.ts.map +0 -1
  261. package/lib/typescript/network/types/index.d.ts.map +0 -1
  262. package/lib/typescript/network/utils/extractOperationName.d.ts.map +0 -1
  263. package/lib/typescript/network/utils/filterNetworkEvents.d.ts.map +0 -1
  264. package/lib/typescript/network/utils/formatGraphQLVariables.d.ts.map +0 -1
  265. package/lib/typescript/network/utils/formatting.d.ts.map +0 -1
  266. package/lib/typescript/network/utils/generateCurl.d.ts.map +0 -1
  267. package/lib/typescript/network/utils/generateNetworkCopyText.d.ts.map +0 -1
  268. package/lib/typescript/network/utils/httpCompletion.d.ts.map +0 -1
  269. package/lib/typescript/network/utils/networkEventStore.d.ts.map +0 -1
  270. package/lib/typescript/network/utils/networkListener.d.ts.map +0 -1
  271. package/lib/typescript/network/utils/networkSavedStore.d.ts.map +0 -1
  272. package/lib/typescript/network/utils/networkSelectionStore.d.ts.map +0 -1
  273. package/lib/typescript/network/utils/selectSavedEvents.d.ts.map +0 -1
  274. package/lib/typescript/network/utils/withPinnedFirst.d.ts.map +0 -1
  275. package/lib/typescript/preset.d.ts.map +0 -1
@@ -1,1306 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * NetworkFilterViewV3.web — DOM twin of NetworkFilterViewV3.tsx.
5
- *
6
- * Same props, same filter semantics, same screen inventory. Natively the
7
- * screen is a thin config over shared-ui's `DynamicFilterView`; the web shim
8
- * doesn't ship that component, so this twin renders the exact subtree
9
- * DynamicFilterView produces FOR THIS CONFIG (no tabs, no filter-summary, no
10
- * include-only, no preview — those config branches are disabled natively and
11
- * are not ported):
12
- *
13
- * 1. Facet card sections — Status (All/Success/Error/Pending, icon + count),
14
- * Method (colored method badge + count, no label — native's
15
- * `showLabel = type !== "method"`), Content Type (icon + count + label).
16
- * Same single-select method/content-type replace behavior
17
- * (`handleDynamicFilterChange` is native's handler, verbatim).
18
- * 2. ACTIVE FILTERS — add-pattern button → input (with the Match:
19
- * Contains/Exact mode toggle rendered above it, native `renderExtra`),
20
- * and the pattern list where each row removes on click and carries the
21
- * CONTAINS/EXACT mode badge (native `renderPatternMeta`) that toggles the
22
- * pattern's match mode.
23
- * 3. AVAILABLE DOMAINS & URLS — host + origin+pathname suggestions from the
24
- * visible events (30 per group), click-to-add with the currently selected
25
- * mode; suggestions already covered by an active pattern are hidden
26
- * (native's `item.includes(pattern)` filter).
27
- * 4. HOW NETWORK FILTERS WORK — description + examples.
28
- *
29
- * shared-ui RN chrome replicated as DOM with provenance:
30
- * - `buoyColors` — inlined verbatim subset from
31
- * shared/src/ui/gameUI/constants/gameUIColors.ts (DynamicFilterView /
32
- * SectionHeader / FilterComponents palette).
33
- * - `macOSColors` — inlined verbatim subset from
34
- * shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts (the mode
35
- * toggle/badge palette the native screen uses directly).
36
- * - Icons — inline lucide SVGs (shared-ui's icons are lucide re-exports).
37
- * - Native card glow (`shadowColor` primary, opacity 0.3, radius 8) → an
38
- * equivalent CSS box-shadow; native text shadows → CSS text-shadow.
39
- *
40
- * Intentional deviations (all logged):
41
- * - Pattern rows nest a pressable mode badge inside a pressable row; RN's
42
- * inner Touchable swallows the press, DOM needs `stopPropagation()` on the
43
- * badge so toggling a mode doesn't also remove the pattern.
44
- * - Native's `adjustsFontSizeToFit` on the method badge has no DOM
45
- * equivalent — long method names ellipsize at the same max width instead.
46
- * - The add-pattern input autofocuses via the `autoFocus` attribute rather
47
- * than RN's imperative focus.
48
- *
49
- * @platform React DOM Web
50
- */
51
-
52
- import { useCallback, useMemo, useState } from "react";
53
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
54
- // =============================
55
- // Native palettes (provenance)
56
- // =============================
57
-
58
- /** buoyColors subset — shared/src/ui/gameUI/constants/gameUIColors.ts, verbatim. */
59
- const buoyColors = {
60
- base: "#121212",
61
- card: "#1A1A1A",
62
- hover: "#242424",
63
- input: "#2A2A2A",
64
- border: "#333333",
65
- text: "#E0E0E0",
66
- textSecondary: "#A0A0A0",
67
- textMuted: "#888888",
68
- primary: "#20C997"
69
- };
70
-
71
- /** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */
72
- const macOSColors = {
73
- background: {
74
- hover: "#1D1D1F"
75
- },
76
- border: {
77
- default: "#2D2D2F"
78
- },
79
- text: {
80
- secondary: "#A1A1A6",
81
- muted: "#8E8E93"
82
- },
83
- semantic: {
84
- success: "#34C759",
85
- error: "#FF453A",
86
- warning: "#FFEB3B",
87
- info: "#00B8E6",
88
- debug: "#BF5AF2"
89
- }
90
- };
91
-
92
- // =============================
93
- // Inline lucide icons (shared-ui icons are lucide re-exports)
94
- // =============================
95
-
96
- function Svg({
97
- size = 14,
98
- color = "currentColor",
99
- children
100
- }) {
101
- return /*#__PURE__*/_jsx("svg", {
102
- width: size,
103
- height: size,
104
- viewBox: "0 0 24 24",
105
- fill: "none",
106
- stroke: color,
107
- strokeWidth: 2,
108
- strokeLinecap: "round",
109
- strokeLinejoin: "round",
110
- style: {
111
- flexShrink: 0,
112
- display: "block"
113
- },
114
- children: children
115
- });
116
- }
117
- const CheckCircle = p => /*#__PURE__*/_jsxs(Svg, {
118
- ...p,
119
- children: [/*#__PURE__*/_jsx("path", {
120
- d: "M21.801 10A10 10 0 1 1 17 3.335"
121
- }), /*#__PURE__*/_jsx("path", {
122
- d: "m9 11 3 3L22 4"
123
- })]
124
- });
125
- const XCircle = p => /*#__PURE__*/_jsxs(Svg, {
126
- ...p,
127
- children: [/*#__PURE__*/_jsx("circle", {
128
- cx: "12",
129
- cy: "12",
130
- r: "10"
131
- }), /*#__PURE__*/_jsx("path", {
132
- d: "m15 9-6 6"
133
- }), /*#__PURE__*/_jsx("path", {
134
- d: "m9 9 6 6"
135
- })]
136
- });
137
- const Clock = p => /*#__PURE__*/_jsxs(Svg, {
138
- ...p,
139
- children: [/*#__PURE__*/_jsx("circle", {
140
- cx: "12",
141
- cy: "12",
142
- r: "10"
143
- }), /*#__PURE__*/_jsx("polyline", {
144
- points: "12 6 12 12 16 14"
145
- })]
146
- });
147
- const Globe = p => /*#__PURE__*/_jsxs(Svg, {
148
- ...p,
149
- children: [/*#__PURE__*/_jsx("circle", {
150
- cx: "12",
151
- cy: "12",
152
- r: "10"
153
- }), /*#__PURE__*/_jsx("path", {
154
- d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"
155
- }), /*#__PURE__*/_jsx("path", {
156
- d: "M2 12h20"
157
- })]
158
- });
159
- const FileJson = p => /*#__PURE__*/_jsxs(Svg, {
160
- ...p,
161
- children: [/*#__PURE__*/_jsx("path", {
162
- d: "M14 2v4a2 2 0 0 0 2 2h4"
163
- }), /*#__PURE__*/_jsx("path", {
164
- d: "M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4"
165
- }), /*#__PURE__*/_jsx("path", {
166
- d: "M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"
167
- }), /*#__PURE__*/_jsx("path", {
168
- d: "M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"
169
- })]
170
- });
171
- const FileText = p => /*#__PURE__*/_jsxs(Svg, {
172
- ...p,
173
- children: [/*#__PURE__*/_jsx("path", {
174
- d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"
175
- }), /*#__PURE__*/_jsx("path", {
176
- d: "M14 2v4a2 2 0 0 0 2 2h4"
177
- }), /*#__PURE__*/_jsx("path", {
178
- d: "M10 9H8"
179
- }), /*#__PURE__*/_jsx("path", {
180
- d: "M16 13H8"
181
- }), /*#__PURE__*/_jsx("path", {
182
- d: "M16 17H8"
183
- })]
184
- });
185
- const ImageIcon = p => /*#__PURE__*/_jsxs(Svg, {
186
- ...p,
187
- children: [/*#__PURE__*/_jsx("rect", {
188
- width: "18",
189
- height: "18",
190
- x: "3",
191
- y: "3",
192
- rx: "2",
193
- ry: "2"
194
- }), /*#__PURE__*/_jsx("circle", {
195
- cx: "9",
196
- cy: "9",
197
- r: "2"
198
- }), /*#__PURE__*/_jsx("path", {
199
- d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"
200
- })]
201
- });
202
- const Film = p => /*#__PURE__*/_jsxs(Svg, {
203
- ...p,
204
- children: [/*#__PURE__*/_jsx("rect", {
205
- width: "18",
206
- height: "18",
207
- x: "3",
208
- y: "3",
209
- rx: "2"
210
- }), /*#__PURE__*/_jsx("path", {
211
- d: "M7 3v18"
212
- }), /*#__PURE__*/_jsx("path", {
213
- d: "M3 7.5h4"
214
- }), /*#__PURE__*/_jsx("path", {
215
- d: "M3 12h18"
216
- }), /*#__PURE__*/_jsx("path", {
217
- d: "M3 16.5h4"
218
- }), /*#__PURE__*/_jsx("path", {
219
- d: "M17 3v18"
220
- }), /*#__PURE__*/_jsx("path", {
221
- d: "M17 7.5h4"
222
- }), /*#__PURE__*/_jsx("path", {
223
- d: "M17 16.5h4"
224
- })]
225
- });
226
- const Music = p => /*#__PURE__*/_jsxs(Svg, {
227
- ...p,
228
- children: [/*#__PURE__*/_jsx("path", {
229
- d: "M9 18V5l12-2v13"
230
- }), /*#__PURE__*/_jsx("circle", {
231
- cx: "6",
232
- cy: "18",
233
- r: "3"
234
- }), /*#__PURE__*/_jsx("circle", {
235
- cx: "18",
236
- cy: "16",
237
- r: "3"
238
- })]
239
- });
240
- const Filter = p => /*#__PURE__*/_jsx(Svg, {
241
- ...p,
242
- children: /*#__PURE__*/_jsx("polygon", {
243
- points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"
244
- })
245
- });
246
- const Plus = p => /*#__PURE__*/_jsxs(Svg, {
247
- ...p,
248
- children: [/*#__PURE__*/_jsx("path", {
249
- d: "M5 12h14"
250
- }), /*#__PURE__*/_jsx("path", {
251
- d: "M12 5v14"
252
- })]
253
- });
254
- const X = p => /*#__PURE__*/_jsxs(Svg, {
255
- ...p,
256
- children: [/*#__PURE__*/_jsx("path", {
257
- d: "M18 6 6 18"
258
- }), /*#__PURE__*/_jsx("path", {
259
- d: "m6 6 12 12"
260
- })]
261
- });
262
-
263
- // =============================
264
- // Native helpers (verbatim from NetworkFilterViewV3.tsx)
265
- // =============================
266
-
267
- function getContentType(event) {
268
- const headers = event.responseHeaders || event.requestHeaders;
269
- const contentType = headers?.["content-type"] || headers?.["Content-Type"] || "";
270
- if (contentType.includes("json")) return {
271
- type: "JSON",
272
- color: macOSColors.semantic.info
273
- };
274
- if (contentType.includes("xml")) return {
275
- type: "XML",
276
- color: macOSColors.semantic.success
277
- };
278
- if (contentType.includes("html")) return {
279
- type: "HTML",
280
- color: macOSColors.semantic.warning
281
- };
282
- if (contentType.includes("text")) return {
283
- type: "TEXT",
284
- color: macOSColors.semantic.success
285
- };
286
- if (contentType.includes("image")) return {
287
- type: "IMAGE",
288
- color: macOSColors.semantic.error
289
- };
290
- if (contentType.includes("video")) return {
291
- type: "VIDEO",
292
- color: macOSColors.semantic.error
293
- };
294
- if (contentType.includes("audio")) return {
295
- type: "AUDIO",
296
- color: macOSColors.semantic.debug
297
- };
298
- if (contentType.includes("form")) return {
299
- type: "FORM",
300
- color: macOSColors.semantic.info
301
- };
302
- return {
303
- type: "OTHER",
304
- color: macOSColors.text.muted
305
- };
306
- }
307
- function getContentTypeIcon(type) {
308
- switch (type) {
309
- case "JSON":
310
- return FileJson;
311
- case "HTML":
312
- case "XML":
313
- case "TEXT":
314
- return FileText;
315
- case "IMAGE":
316
- return ImageIcon;
317
- case "VIDEO":
318
- return Film;
319
- case "AUDIO":
320
- return Music;
321
- default:
322
- return Globe;
323
- }
324
- }
325
- function getMethodColor(method) {
326
- switch (method) {
327
- case "GET":
328
- return macOSColors.semantic.success;
329
- case "POST":
330
- return macOSColors.semantic.info;
331
- case "PUT":
332
- return macOSColors.semantic.warning;
333
- case "DELETE":
334
- return macOSColors.semantic.error;
335
- case "PATCH":
336
- return macOSColors.semantic.success;
337
- default:
338
- return macOSColors.text.muted;
339
- }
340
- }
341
-
342
- // =============================
343
- // DOM twins of the shared-ui pieces DynamicFilterView composes
344
- // =============================
345
-
346
- /** SectionHeader twin — shared/src/ui/components/SectionHeader.tsx. */
347
- function SectionHeader({
348
- icon: Icon,
349
- iconColor,
350
- title,
351
- badgeCount,
352
- badgeColor
353
- }) {
354
- return /*#__PURE__*/_jsxs("div", {
355
- style: styles.sectionHeader,
356
- children: [Icon ? /*#__PURE__*/_jsx("span", {
357
- style: styles.sectionHeaderIcon,
358
- children: /*#__PURE__*/_jsx(Icon, {
359
- size: 12,
360
- color: iconColor ?? buoyColors.primary
361
- })
362
- }) : null, /*#__PURE__*/_jsx("span", {
363
- style: styles.sectionHeaderTitle,
364
- children: title
365
- }), badgeCount !== undefined ? /*#__PURE__*/_jsx("span", {
366
- style: {
367
- ...styles.sectionHeaderBadge,
368
- backgroundColor: `${badgeColor ?? buoyColors.primary}15`,
369
- border: `1px solid ${badgeColor ?? buoyColors.primary}33`
370
- },
371
- children: /*#__PURE__*/_jsx("span", {
372
- style: {
373
- ...styles.sectionHeaderBadgeText,
374
- color: badgeColor ?? buoyColors.primary
375
- },
376
- children: badgeCount
377
- })
378
- }) : null]
379
- });
380
- }
381
-
382
- /** AddFilterButton twin — shared/src/ui/components/FilterComponents.tsx. */
383
- function AddFilterButton({
384
- onPress,
385
- color,
386
- label
387
- }) {
388
- return /*#__PURE__*/_jsxs("button", {
389
- type: "button",
390
- onClick: onPress,
391
- style: {
392
- ...styles.addButton,
393
- borderColor: `${color}40`
394
- },
395
- children: [/*#__PURE__*/_jsx(Plus, {
396
- size: 14,
397
- color: color
398
- }), /*#__PURE__*/_jsx("span", {
399
- style: {
400
- ...styles.addButtonText,
401
- color
402
- },
403
- children: label
404
- })]
405
- });
406
- }
407
-
408
- /** AddFilterInput twin — shared/src/ui/components/FilterComponents.tsx. */
409
- function AddFilterInput({
410
- value,
411
- onChange,
412
- onSubmit,
413
- onCancel,
414
- placeholder,
415
- color
416
- }) {
417
- return /*#__PURE__*/_jsxs("div", {
418
- style: {
419
- ...styles.inputContainer,
420
- borderColor: `${color}40`
421
- },
422
- children: [/*#__PURE__*/_jsx("input", {
423
- value: value,
424
- onChange: e => onChange(e.target.value),
425
- onKeyDown: e => {
426
- if (e.key === "Enter") onSubmit();
427
- },
428
- placeholder: placeholder,
429
- style: {
430
- ...styles.input,
431
- color
432
- },
433
- autoFocus: true,
434
- autoCorrect: "off",
435
- autoCapitalize: "none",
436
- autoComplete: "off",
437
- spellCheck: false
438
- }), /*#__PURE__*/_jsxs("div", {
439
- style: styles.inputButtons,
440
- children: [value.trim() ? /*#__PURE__*/_jsx("button", {
441
- type: "button",
442
- onClick: onSubmit,
443
- style: {
444
- ...styles.inlineAddButton,
445
- backgroundColor: `${color}15`,
446
- borderColor: `${color}40`
447
- },
448
- children: /*#__PURE__*/_jsx("span", {
449
- style: {
450
- ...styles.inlineAddButtonText,
451
- color
452
- },
453
- children: "Add"
454
- })
455
- }) : null, /*#__PURE__*/_jsx("button", {
456
- type: "button",
457
- onClick: onCancel,
458
- style: styles.cancelButton,
459
- children: /*#__PURE__*/_jsx(X, {
460
- size: 16,
461
- color: `${color}60`
462
- })
463
- })]
464
- })]
465
- });
466
- }
467
-
468
- /**
469
- * Control panel for filtering captured network events by status, method, and
470
- * content type, plus ignored-pattern management — same surface as native.
471
- */
472
- export function NetworkFilterViewV3({
473
- events,
474
- filter,
475
- onFilterChange,
476
- ignoredPatterns = [],
477
- onRemovePattern = () => {},
478
- onAddPattern = () => {},
479
- onTogglePatternMode = () => {}
480
- }) {
481
- // Mode applied when the user submits the "Add pattern" input. Defaults to
482
- // `contains` so behavior matches the previous implementation until the user
483
- // opts into `exact`. (Native state, verbatim.)
484
- const [nextPatternMode, setNextPatternMode] = useState("contains");
485
-
486
- // DynamicFilterView's `useFilterManager` input UI state — the subset this
487
- // config exercises (show/hide the add input + the draft value).
488
- const [showAddInput, setShowAddInput] = useState(false);
489
- const [newFilter, setNewFilter] = useState("");
490
- const patternModes = useMemo(() => {
491
- const map = new Map();
492
- for (const p of ignoredPatterns) map.set(p.value, p.mode);
493
- return map;
494
- }, [ignoredPatterns]);
495
- const activePatterns = useMemo(() => ignoredPatterns.map(p => p.value), [ignoredPatterns]);
496
- const handlePatternAdd = useCallback(pattern => {
497
- onAddPattern({
498
- value: pattern,
499
- mode: nextPatternMode
500
- });
501
- }, [onAddPattern, nextPatternMode]);
502
-
503
- // DynamicFilterView.handleAddPattern: forward the trimmed draft, then reset
504
- // the input UI (its filterManager.addFilter side effect).
505
- const submitDraftPattern = useCallback(() => {
506
- const trimmed = newFilter.trim();
507
- if (!trimmed) return;
508
- handlePatternAdd(trimmed);
509
- setNewFilter("");
510
- setShowAddInput(false);
511
- }, [newFilter, handlePatternAdd]);
512
- const statusCounts = useMemo(() => {
513
- const counts = {
514
- all: events.length,
515
- success: 0,
516
- error: 0,
517
- pending: 0
518
- };
519
- events.forEach(event => {
520
- if (event.error || event.status && event.status >= 400) {
521
- counts.error += 1;
522
- return;
523
- }
524
- if (event.status && event.status >= 200 && event.status < 300) {
525
- counts.success += 1;
526
- return;
527
- }
528
- if (!event.status && !event.error) {
529
- counts.pending += 1;
530
- }
531
- });
532
- return counts;
533
- }, [events]);
534
- const methodCounts = useMemo(() => {
535
- return events.reduce((acc, event) => {
536
- if (!event.method) return acc;
537
- acc[event.method] = (acc[event.method] || 0) + 1;
538
- return acc;
539
- }, {});
540
- }, [events]);
541
- const contentTypeCounts = useMemo(() => {
542
- return events.reduce((acc, event) => {
543
- const {
544
- type
545
- } = getContentType(event);
546
- acc[type] = (acc[type] || 0) + 1;
547
- return acc;
548
- }, {});
549
- }, [events]);
550
- const availableDomains = useMemo(() => {
551
- const domains = new Set();
552
- events.forEach(event => {
553
- if (event.host) {
554
- domains.add(event.host);
555
- return;
556
- }
557
- try {
558
- if (event.url) {
559
- const parsed = new URL(event.url);
560
- const host = String(parsed.host || "");
561
- if (host) domains.add(host);
562
- }
563
- } catch {
564
- // Ignore relative URLs
565
- }
566
- });
567
- return Array.from(domains).filter(domain => domain && domain !== "").sort((a, b) => a.localeCompare(b));
568
- }, [events]);
569
- const availableUrls = useMemo(() => {
570
- const urls = new Set();
571
- events.forEach(event => {
572
- if (!event.url) return;
573
- try {
574
- const parsed = new URL(event.url);
575
- const origin = String(parsed.origin || "");
576
- const pathname = String(parsed.pathname || "");
577
- const normalized = `${origin}${pathname}`;
578
- urls.add(normalized);
579
- } catch {
580
- // URL constructor fails for relative paths - fall back to raw value
581
- urls.add(event.url);
582
- }
583
- });
584
- return Array.from(urls).filter(url => url && url !== "").sort((a, b) => a.localeCompare(b));
585
- }, [events]);
586
- const suggestionItems = useMemo(() => {
587
- const maxItemsPerGroup = 30;
588
- const domainSuggestions = availableDomains.slice(0, maxItemsPerGroup);
589
- const urlSuggestions = availableUrls.slice(0, maxItemsPerGroup);
590
- return [...domainSuggestions, ...urlSuggestions];
591
- }, [availableDomains, availableUrls]);
592
-
593
- // DynamicFilterView.suggestedItems: hide suggestions any active pattern
594
- // already covers (substring test, native verbatim).
595
- const suggestedItems = useMemo(() => suggestionItems.filter(item => !activePatterns.some(pattern => item.includes(pattern))), [suggestionItems, activePatterns]);
596
- const handleDynamicFilterChange = useCallback((optionId, value) => {
597
- const [group] = optionId.split("::");
598
- if (group === "status") {
599
- const nextStatus = value === "all" ? undefined : value;
600
- onFilterChange({
601
- ...filter,
602
- status: nextStatus
603
- });
604
- return;
605
- }
606
- if (group === "method") {
607
- const methodValue = String(value);
608
- const currentMethods = filter.method || [];
609
- const hasMethod = currentMethods.includes(methodValue);
610
- const updatedMethods = hasMethod ? currentMethods.filter(method => method !== methodValue) : [methodValue];
611
- onFilterChange({
612
- ...filter,
613
- method: updatedMethods.length > 0 ? updatedMethods : undefined
614
- });
615
- return;
616
- }
617
- if (group === "contentType") {
618
- const typeValue = String(value);
619
- const currentTypes = filter.contentType || [];
620
- const hasType = currentTypes.includes(typeValue);
621
- const updatedTypes = hasType ? currentTypes.filter(type => type !== typeValue) : [typeValue];
622
- onFilterChange({
623
- ...filter,
624
- contentType: updatedTypes.length > 0 ? updatedTypes : undefined
625
- });
626
- }
627
- }, [filter, onFilterChange]);
628
-
629
- // =============================
630
- // Renderers (DynamicFilterView subtree for this config)
631
- // =============================
632
-
633
- const renderFilterCard = option => {
634
- const countIsZero = option.count === 0;
635
- // Native: showLabel = section.type !== "method" || option.icon
636
- const showLabel = !option.isMethod || option.icon;
637
- return /*#__PURE__*/_jsxs("button", {
638
- type: "button",
639
- onClick: () => handleDynamicFilterChange(option.id, option.value),
640
- style: {
641
- ...styles.filterCard,
642
- ...(option.isActive ? styles.activeFilterCard : null)
643
- },
644
- children: [option.icon ? /*#__PURE__*/_jsx(option.icon, {
645
- size: 24,
646
- color: option.color
647
- }) : option.isMethod ? /*#__PURE__*/_jsx("span", {
648
- style: {
649
- ...styles.methodBadgeCompact,
650
- backgroundColor: `${option.color}20`
651
- },
652
- children: /*#__PURE__*/_jsx("span", {
653
- style: {
654
- ...styles.methodTextCompact,
655
- color: option.color
656
- },
657
- children: option.label
658
- })
659
- }) : null, /*#__PURE__*/_jsx("span", {
660
- style: countIsZero ? styles.filterCountZero : styles.filterCountActive,
661
- children: option.count
662
- }), showLabel ? /*#__PURE__*/_jsx("span", {
663
- style: styles.filterLabelCompact,
664
- children: option.label
665
- }) : null]
666
- }, option.id);
667
- };
668
- const statusOptions = ["all", "success", "error", "pending"].map(status => ({
669
- id: `status::${status}`,
670
- label: status.charAt(0).toUpperCase() + status.slice(1),
671
- count: statusCounts[status],
672
- icon: status === "success" ? CheckCircle : status === "error" ? XCircle : status === "pending" ? Clock : Globe,
673
- color: status === "success" ? macOSColors.semantic.success : status === "error" ? macOSColors.semantic.error : status === "pending" ? macOSColors.semantic.warning : macOSColors.semantic.info,
674
- isActive: filter.status === status || !filter.status && status === "all",
675
- value: status
676
- }));
677
- const methodEntries = Object.entries(methodCounts);
678
- const contentTypeEntries = Object.entries(contentTypeCounts);
679
-
680
- // Native renderAddFilterExtra — the Match: Contains/Exact toggle shown
681
- // above the pattern input.
682
- const renderAddFilterExtra = () => {
683
- const options = [{
684
- label: "Contains",
685
- value: "contains",
686
- hint: "substring"
687
- }, {
688
- label: "Exact",
689
- value: "exact",
690
- hint: "whole path/host/url"
691
- }];
692
- return /*#__PURE__*/_jsxs("div", {
693
- style: styles.modeToggleRow,
694
- children: [/*#__PURE__*/_jsx("span", {
695
- style: styles.modeToggleLabel,
696
- children: "Match:"
697
- }), /*#__PURE__*/_jsx("div", {
698
- style: styles.modeToggleGroup,
699
- children: options.map(opt => {
700
- const isActive = nextPatternMode === opt.value;
701
- return /*#__PURE__*/_jsxs("button", {
702
- type: "button",
703
- onClick: () => setNextPatternMode(opt.value),
704
- "aria-pressed": isActive,
705
- style: {
706
- ...styles.modeToggleButton,
707
- ...(isActive ? styles.modeToggleButtonActive : null)
708
- },
709
- children: [/*#__PURE__*/_jsx("span", {
710
- style: {
711
- ...styles.modeToggleButtonText,
712
- ...(isActive ? styles.modeToggleButtonTextActive : null)
713
- },
714
- children: opt.label
715
- }), /*#__PURE__*/_jsx("span", {
716
- style: styles.modeToggleButtonHint,
717
- children: opt.hint
718
- })]
719
- }, opt.value);
720
- })
721
- })]
722
- });
723
- };
724
-
725
- // Native renderPatternMeta — the CONTAINS/EXACT badge on each pattern row.
726
- const renderPatternMeta = pattern => {
727
- const mode = patternModes.get(pattern) ?? "contains";
728
- const isExact = mode === "exact";
729
- const color = isExact ? macOSColors.semantic.warning : macOSColors.semantic.info;
730
- return /*#__PURE__*/_jsx("button", {
731
- type: "button",
732
- "aria-label": `Match mode: ${mode}. Tap to toggle.`,
733
- onClick: e => {
734
- // DEVIATION (logged): RN's nested Touchable swallows the press; DOM
735
- // must stop it reaching the row's remove handler.
736
- e.stopPropagation();
737
- onTogglePatternMode(pattern);
738
- },
739
- style: {
740
- ...styles.modeBadge,
741
- borderColor: `${color}60`,
742
- backgroundColor: `${color}15`
743
- },
744
- children: /*#__PURE__*/_jsx("span", {
745
- style: {
746
- ...styles.modeBadgeText,
747
- color
748
- },
749
- children: isExact ? "EXACT" : "CONTAINS"
750
- })
751
- });
752
- };
753
- return /*#__PURE__*/_jsx("div", {
754
- style: styles.container,
755
- children: /*#__PURE__*/_jsxs("div", {
756
- style: styles.content,
757
- children: [/*#__PURE__*/_jsxs("div", {
758
- style: styles.section,
759
- children: [/*#__PURE__*/_jsx(SectionHeader, {
760
- title: "Status"
761
- }), /*#__PURE__*/_jsx("div", {
762
- style: styles.filterGrid,
763
- children: statusOptions.map(renderFilterCard)
764
- })]
765
- }), methodEntries.length > 0 ? /*#__PURE__*/_jsxs("div", {
766
- style: styles.section,
767
- children: [/*#__PURE__*/_jsx(SectionHeader, {
768
- title: "Method"
769
- }), /*#__PURE__*/_jsx("div", {
770
- style: styles.filterGrid,
771
- children: methodEntries.map(([method, count]) => renderFilterCard({
772
- id: `method::${method}`,
773
- label: method,
774
- count,
775
- color: getMethodColor(method),
776
- isActive: filter.method?.includes(method) ?? false,
777
- value: method,
778
- isMethod: true
779
- }))
780
- })]
781
- }) : null, contentTypeEntries.length > 0 ? /*#__PURE__*/_jsxs("div", {
782
- style: styles.section,
783
- children: [/*#__PURE__*/_jsx(SectionHeader, {
784
- title: "Content Type"
785
- }), /*#__PURE__*/_jsx("div", {
786
- style: styles.filterGrid,
787
- children: contentTypeEntries.map(([type, count]) => {
788
- const representativeEvent = events.find(event => getContentType(event).type === type);
789
- const {
790
- color
791
- } = representativeEvent ? getContentType(representativeEvent) : {
792
- color: macOSColors.text.muted
793
- };
794
- return renderFilterCard({
795
- id: `contentType::${type}`,
796
- label: type,
797
- count,
798
- icon: getContentTypeIcon(type),
799
- color,
800
- isActive: filter.contentType?.includes(type) ?? false,
801
- value: type
802
- });
803
- })
804
- })]
805
- }) : null, /*#__PURE__*/_jsxs("div", {
806
- style: styles.excludeFiltersSection,
807
- children: [/*#__PURE__*/_jsx(SectionHeader, {
808
- icon: Filter,
809
- iconColor: buoyColors.primary,
810
- title: "ACTIVE FILTERS",
811
- badgeCount: activePatterns.length > 0 ? activePatterns.length : undefined,
812
- badgeColor: buoyColors.primary
813
- }), /*#__PURE__*/_jsx("div", {
814
- style: styles.excludeFiltersDescription,
815
- children: "Hide queries matching these patterns from the list."
816
- }), /*#__PURE__*/_jsx("div", {
817
- style: styles.excludeFiltersInputWrapper,
818
- children: !showAddInput ? /*#__PURE__*/_jsx(AddFilterButton, {
819
- onPress: () => setShowAddInput(true),
820
- color: buoyColors.primary,
821
- label: "Add exclude pattern"
822
- }) : /*#__PURE__*/_jsxs(_Fragment, {
823
- children: [renderAddFilterExtra(), /*#__PURE__*/_jsx(AddFilterInput, {
824
- value: newFilter,
825
- onChange: setNewFilter,
826
- onSubmit: submitDraftPattern,
827
- onCancel: () => {
828
- setShowAddInput(false);
829
- setNewFilter("");
830
- },
831
- placeholder: "Enter domain or URL pattern...",
832
- color: buoyColors.primary
833
- })]
834
- })
835
- }), activePatterns.length > 0 ? /*#__PURE__*/_jsx("div", {
836
- style: styles.excludeFiltersContent,
837
- children: /*#__PURE__*/_jsx("div", {
838
- style: styles.filterListColumn,
839
- children: activePatterns.map(pattern => /*#__PURE__*/_jsxs("button", {
840
- type: "button",
841
- onClick: () => onRemovePattern(pattern),
842
- style: styles.filterItemRow,
843
- children: [/*#__PURE__*/_jsx("span", {
844
- style: {
845
- ...styles.filterItemText,
846
- color: buoyColors.primary
847
- },
848
- children: pattern
849
- }), /*#__PURE__*/_jsx("span", {
850
- style: styles.filterItemMeta,
851
- children: renderPatternMeta(pattern)
852
- }), /*#__PURE__*/_jsx(X, {
853
- size: 12,
854
- color: `${buoyColors.primary}80`
855
- })]
856
- }, pattern))
857
- })
858
- }) : null]
859
- }), /*#__PURE__*/_jsxs("div", {
860
- style: styles.availableKeysSection,
861
- children: [/*#__PURE__*/_jsx(SectionHeader, {
862
- icon: Plus,
863
- iconColor: buoyColors.primary,
864
- title: "AVAILABLE DOMAINS & URLS",
865
- badgeCount: suggestedItems.length,
866
- badgeColor: buoyColors.primary
867
- }), /*#__PURE__*/_jsx("div", {
868
- style: styles.availableKeysScroll,
869
- children: suggestedItems.length > 0 ? suggestedItems.map(item => /*#__PURE__*/_jsxs("button", {
870
- type: "button",
871
- onClick: () => handlePatternAdd(item),
872
- style: styles.availableKeyItem,
873
- children: [/*#__PURE__*/_jsx("span", {
874
- style: styles.availableKeyText,
875
- children: item
876
- }), /*#__PURE__*/_jsx(Plus, {
877
- size: 12,
878
- color: buoyColors.primary
879
- })]
880
- }, item)) : /*#__PURE__*/_jsx("div", {
881
- style: styles.emptyStateText,
882
- children: "No network events captured yet. Domains and URLs will appear here."
883
- })
884
- })]
885
- }), /*#__PURE__*/_jsxs("div", {
886
- style: styles.howItWorksSection,
887
- children: [/*#__PURE__*/_jsx(SectionHeader, {
888
- icon: Filter,
889
- iconColor: buoyColors.textSecondary,
890
- title: "HOW NETWORK FILTERS WORK"
891
- }), /*#__PURE__*/_jsx("div", {
892
- style: styles.howItWorksText,
893
- children: "Patterns hide matching requests from the network event list. Each pattern has a match mode you can toggle on its badge: CONTAINS hides any URL containing the text; EXACT hides only an exact path/host/url match."
894
- }), /*#__PURE__*/_jsxs("div", {
895
- style: styles.examplesContainer,
896
- children: [/*#__PURE__*/_jsx("div", {
897
- style: styles.examplesTitle,
898
- children: "EXAMPLES:"
899
- }), ["• example.com (CONTAINS) → any request whose URL contains example.com", "• example.com (EXACT) → only requests served by that exact host", "• /v1 (CONTAINS) → any URL containing /v1 (e.g. /v1, /v1/users)", "• /v1 (EXACT) → only requests whose pathname is exactly /v1"].map(example => /*#__PURE__*/_jsx("div", {
900
- style: styles.exampleItem,
901
- children: example
902
- }, example))]
903
- })]
904
- })]
905
- })
906
- });
907
- }
908
-
909
- // Values mirror the native StyleSheet blocks 1:1 (DynamicFilterView.tsx,
910
- // SectionHeader.tsx, FilterComponents.tsx, NetworkFilterViewV3.tsx).
911
- const styles = {
912
- container: {
913
- display: "flex",
914
- flexDirection: "column",
915
- flex: 1,
916
- minHeight: 0,
917
- backgroundColor: buoyColors.base
918
- },
919
- content: {
920
- flex: 1,
921
- minHeight: 0,
922
- overflowY: "auto",
923
- padding: "16px 16px 24px 16px"
924
- },
925
- section: {
926
- marginBottom: 8
927
- },
928
- // SectionHeader.tsx container/title/badge
929
- sectionHeader: {
930
- display: "flex",
931
- flexDirection: "row",
932
- alignItems: "center",
933
- padding: "8px 16px",
934
- backgroundColor: buoyColors.base,
935
- minHeight: 40,
936
- boxSizing: "border-box"
937
- },
938
- sectionHeaderIcon: {
939
- display: "inline-flex",
940
- marginRight: 8
941
- },
942
- sectionHeaderTitle: {
943
- flex: 1,
944
- fontSize: 14,
945
- fontWeight: 600,
946
- color: buoyColors.text,
947
- whiteSpace: "nowrap",
948
- overflow: "hidden",
949
- textOverflow: "ellipsis"
950
- },
951
- sectionHeaderBadge: {
952
- display: "inline-flex",
953
- alignItems: "center",
954
- padding: "3px 8px",
955
- borderRadius: 12,
956
- marginLeft: 8
957
- },
958
- sectionHeaderBadgeText: {
959
- fontSize: 12,
960
- fontWeight: 600
961
- },
962
- filterGrid: {
963
- display: "flex",
964
- flexDirection: "row",
965
- flexWrap: "wrap",
966
- gap: 8,
967
- marginTop: 8
968
- },
969
- filterCard: {
970
- display: "flex",
971
- backgroundColor: buoyColors.card,
972
- borderRadius: 12,
973
- padding: "10px 8px",
974
- flexDirection: "column",
975
- alignItems: "center",
976
- justifyContent: "center",
977
- border: `1px solid ${buoyColors.border}`,
978
- width: 72,
979
- minHeight: 68,
980
- boxSizing: "border-box",
981
- cursor: "pointer",
982
- margin: 0
983
- },
984
- activeFilterCard: {
985
- backgroundColor: `${buoyColors.primary}33`,
986
- border: `2px solid ${buoyColors.primary}`,
987
- // Native: shadowColor primary, offset 0/0, opacity 0.3, radius 8.
988
- boxShadow: `0 0 8px ${buoyColors.primary}4D`
989
- },
990
- filterCountActive: {
991
- fontSize: 14,
992
- fontWeight: 700,
993
- color: buoyColors.text,
994
- fontFamily: "ui-monospace, Menlo, monospace",
995
- marginTop: 3,
996
- marginBottom: 1,
997
- textShadow: "0 0.5px 1px rgba(0, 0, 0, 0.2)"
998
- },
999
- filterCountZero: {
1000
- fontSize: 11,
1001
- fontWeight: 500,
1002
- color: buoyColors.textMuted,
1003
- fontFamily: "ui-monospace, Menlo, monospace",
1004
- marginTop: 3,
1005
- marginBottom: 1
1006
- },
1007
- filterLabelCompact: {
1008
- fontSize: 10,
1009
- color: buoyColors.text,
1010
- fontWeight: 600,
1011
- textAlign: "center",
1012
- textTransform: "capitalize",
1013
- textShadow: "0 0.5px 1px rgba(0, 0, 0, 0.3)"
1014
- },
1015
- methodBadgeCompact: {
1016
- display: "inline-flex",
1017
- padding: "4px 8px",
1018
- borderRadius: 5,
1019
- minWidth: 48,
1020
- maxWidth: 60,
1021
- boxSizing: "border-box",
1022
- alignItems: "center",
1023
- justifyContent: "center"
1024
- },
1025
- methodTextCompact: {
1026
- fontSize: 13,
1027
- fontWeight: 700,
1028
- letterSpacing: 0.3,
1029
- fontFamily: "ui-monospace, Menlo, monospace",
1030
- whiteSpace: "nowrap",
1031
- overflow: "hidden",
1032
- textOverflow: "ellipsis"
1033
- },
1034
- excludeFiltersSection: {
1035
- backgroundColor: buoyColors.card,
1036
- borderRadius: 16,
1037
- border: `1px solid ${buoyColors.border}`,
1038
- marginTop: 16,
1039
- overflow: "hidden"
1040
- },
1041
- excludeFiltersDescription: {
1042
- fontSize: 10,
1043
- color: buoyColors.textSecondary,
1044
- padding: "8px 16px 0 16px",
1045
- lineHeight: "14px"
1046
- },
1047
- excludeFiltersInputWrapper: {
1048
- padding: "8px 16px"
1049
- },
1050
- excludeFiltersContent: {
1051
- padding: "0 16px 16px 16px",
1052
- maxHeight: 150,
1053
- overflowY: "auto"
1054
- },
1055
- filterListColumn: {
1056
- display: "flex",
1057
- flexDirection: "column",
1058
- gap: 8
1059
- },
1060
- filterItemRow: {
1061
- display: "flex",
1062
- flexDirection: "row",
1063
- alignItems: "center",
1064
- justifyContent: "space-between",
1065
- padding: "10px 12px",
1066
- backgroundColor: buoyColors.hover,
1067
- borderRadius: 8,
1068
- border: `1px solid ${buoyColors.border}`,
1069
- cursor: "pointer",
1070
- margin: 0,
1071
- width: "100%",
1072
- boxSizing: "border-box",
1073
- textAlign: "left"
1074
- },
1075
- filterItemText: {
1076
- flex: 1,
1077
- fontSize: 12,
1078
- fontFamily: "ui-monospace, Menlo, monospace",
1079
- marginRight: 8,
1080
- whiteSpace: "nowrap",
1081
- overflow: "hidden",
1082
- textOverflow: "ellipsis",
1083
- minWidth: 0
1084
- },
1085
- filterItemMeta: {
1086
- display: "inline-flex",
1087
- marginRight: 8
1088
- },
1089
- // NetworkFilterViewV3.tsx modeBadge / modeToggle styles
1090
- modeBadge: {
1091
- display: "inline-flex",
1092
- padding: "3px 8px",
1093
- borderRadius: 6,
1094
- borderWidth: 1,
1095
- borderStyle: "solid",
1096
- background: "none",
1097
- cursor: "pointer",
1098
- margin: 0
1099
- },
1100
- modeBadgeText: {
1101
- fontSize: 9,
1102
- fontFamily: "ui-monospace, Menlo, monospace",
1103
- fontWeight: 700,
1104
- letterSpacing: 0.5
1105
- },
1106
- modeToggleRow: {
1107
- display: "flex",
1108
- flexDirection: "row",
1109
- alignItems: "center",
1110
- gap: 8,
1111
- marginBottom: 8
1112
- },
1113
- modeToggleLabel: {
1114
- fontSize: 11,
1115
- fontWeight: 600,
1116
- color: macOSColors.text.secondary,
1117
- fontFamily: "ui-monospace, Menlo, monospace",
1118
- letterSpacing: 0.3
1119
- },
1120
- modeToggleGroup: {
1121
- display: "flex",
1122
- flexDirection: "row",
1123
- gap: 6,
1124
- flex: 1
1125
- },
1126
- modeToggleButton: {
1127
- flex: 1,
1128
- display: "flex",
1129
- flexDirection: "column",
1130
- padding: "6px 10px",
1131
- borderRadius: 8,
1132
- border: `1px solid ${macOSColors.border.default}`,
1133
- backgroundColor: macOSColors.background.hover,
1134
- alignItems: "center",
1135
- cursor: "pointer",
1136
- margin: 0
1137
- },
1138
- modeToggleButtonActive: {
1139
- border: `1px solid ${macOSColors.semantic.info}`,
1140
- backgroundColor: `${macOSColors.semantic.info}22`
1141
- },
1142
- modeToggleButtonText: {
1143
- fontSize: 11,
1144
- fontWeight: 700,
1145
- color: macOSColors.text.secondary,
1146
- fontFamily: "ui-monospace, Menlo, monospace",
1147
- letterSpacing: 0.3
1148
- },
1149
- modeToggleButtonTextActive: {
1150
- color: macOSColors.semantic.info
1151
- },
1152
- modeToggleButtonHint: {
1153
- fontSize: 9,
1154
- color: macOSColors.text.muted,
1155
- marginTop: 1
1156
- },
1157
- // FilterComponents.tsx add button/input
1158
- addButton: {
1159
- display: "flex",
1160
- flexDirection: "row",
1161
- alignItems: "center",
1162
- justifyContent: "center",
1163
- padding: "10px 14px",
1164
- borderRadius: 10,
1165
- borderWidth: 1,
1166
- borderStyle: "dashed",
1167
- backgroundColor: buoyColors.input,
1168
- cursor: "pointer",
1169
- margin: 0,
1170
- width: "100%",
1171
- boxSizing: "border-box"
1172
- },
1173
- addButtonText: {
1174
- fontSize: 13,
1175
- fontWeight: 500,
1176
- marginLeft: 6
1177
- },
1178
- inputContainer: {
1179
- display: "flex",
1180
- flexDirection: "row",
1181
- alignItems: "center",
1182
- backgroundColor: buoyColors.input,
1183
- borderRadius: 10,
1184
- borderWidth: 1,
1185
- borderStyle: "solid",
1186
- padding: "10px 14px",
1187
- marginBottom: 8,
1188
- boxSizing: "border-box"
1189
- },
1190
- input: {
1191
- flex: 1,
1192
- fontSize: 13,
1193
- padding: 0,
1194
- border: "none",
1195
- outline: "none",
1196
- background: "transparent",
1197
- fontFamily: "inherit",
1198
- minWidth: 0
1199
- },
1200
- inputButtons: {
1201
- display: "flex",
1202
- flexDirection: "row",
1203
- alignItems: "center",
1204
- gap: 8
1205
- },
1206
- cancelButton: {
1207
- display: "inline-flex",
1208
- padding: 4,
1209
- borderRadius: 6,
1210
- backgroundColor: buoyColors.hover,
1211
- border: "none",
1212
- cursor: "pointer",
1213
- margin: 0
1214
- },
1215
- inlineAddButton: {
1216
- display: "inline-flex",
1217
- padding: "6px 12px",
1218
- borderRadius: 6,
1219
- borderWidth: 1,
1220
- borderStyle: "solid",
1221
- cursor: "pointer",
1222
- margin: 0
1223
- },
1224
- inlineAddButtonText: {
1225
- fontSize: 12,
1226
- fontWeight: 600
1227
- },
1228
- availableKeysSection: {
1229
- backgroundColor: buoyColors.card,
1230
- borderRadius: 16,
1231
- border: `1px solid ${buoyColors.border}`,
1232
- marginTop: 16,
1233
- overflow: "hidden"
1234
- },
1235
- availableKeysScroll: {
1236
- maxHeight: 150,
1237
- overflowY: "auto",
1238
- padding: "8px 16px 16px 16px"
1239
- },
1240
- availableKeyItem: {
1241
- display: "flex",
1242
- flexDirection: "row",
1243
- alignItems: "center",
1244
- justifyContent: "space-between",
1245
- padding: "10px 12px",
1246
- backgroundColor: buoyColors.hover,
1247
- borderRadius: 8,
1248
- border: `1px solid ${buoyColors.border}`,
1249
- marginBottom: 8,
1250
- cursor: "pointer",
1251
- width: "100%",
1252
- boxSizing: "border-box",
1253
- textAlign: "left"
1254
- },
1255
- availableKeyText: {
1256
- flex: 1,
1257
- fontSize: 11,
1258
- color: buoyColors.text,
1259
- fontFamily: "ui-monospace, Menlo, monospace",
1260
- marginRight: 8,
1261
- whiteSpace: "nowrap",
1262
- overflow: "hidden",
1263
- textOverflow: "ellipsis",
1264
- minWidth: 0
1265
- },
1266
- emptyStateText: {
1267
- fontSize: 11,
1268
- color: buoyColors.textMuted,
1269
- fontStyle: "italic",
1270
- textAlign: "center",
1271
- padding: "12px 0"
1272
- },
1273
- howItWorksSection: {
1274
- backgroundColor: buoyColors.card,
1275
- borderRadius: 16,
1276
- border: `1px solid ${buoyColors.border}`,
1277
- marginTop: 16,
1278
- overflow: "hidden"
1279
- },
1280
- howItWorksText: {
1281
- fontSize: 11,
1282
- color: buoyColors.textSecondary,
1283
- lineHeight: "16px",
1284
- margin: "8px 0 12px 0",
1285
- padding: "0 16px",
1286
- fontFamily: "ui-monospace, Menlo, monospace"
1287
- },
1288
- examplesContainer: {
1289
- padding: "8px 16px 16px 16px",
1290
- borderTop: `1px solid ${buoyColors.border}`
1291
- },
1292
- examplesTitle: {
1293
- fontSize: 10,
1294
- fontWeight: 600,
1295
- color: buoyColors.textMuted,
1296
- fontFamily: "ui-monospace, Menlo, monospace",
1297
- letterSpacing: 0.5,
1298
- marginBottom: 6
1299
- },
1300
- exampleItem: {
1301
- fontSize: 10,
1302
- color: buoyColors.textMuted,
1303
- fontFamily: "ui-monospace, Menlo, monospace",
1304
- lineHeight: "16px"
1305
- }
1306
- };
1
+ "use strict";import{useCallback as E,useMemo as x,useState as R}from"react";import{jsx as t,jsxs as d,Fragment as ee}from"react/jsx-runtime";const i={base:"#121212",card:"#1A1A1A",hover:"#242424",input:"#2A2A2A",border:"#333333",text:"#E0E0E0",textSecondary:"#A0A0A0",textMuted:"#888888",primary:"#20C997"};const l={background:{hover:"#1D1D1F"},border:{default:"#2D2D2F"},text:{secondary:"#A1A1A6",muted:"#8E8E93"},semantic:{success:"#34C759",error:"#FF453A",warning:"#FFEB3B",info:"#00B8E6",debug:"#BF5AF2"}};function u({size:r=14,color:c="currentColor",children:s}){return t("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:s})}const te=r=>d(u,{...r,children:[t("path",{d:"M21.801 10A10 10 0 1 1 17 3.335"}),t("path",{d:"m9 11 3 3L22 4"})]});const oe=r=>d(u,{...r,children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"m15 9-6 6"}),t("path",{d:"m9 9 6 6"})]});const ne=r=>d(u,{...r,children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("polyline",{points:"12 6 12 12 16 14"})]});const N=r=>d(u,{...r,children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),t("path",{d:"M2 12h20"})]});const re=r=>d(u,{...r,children:[t("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),t("path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4"}),t("path",{d:"M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"}),t("path",{d:"M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"})]});const ie=r=>d(u,{...r,children:[t("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),t("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),t("path",{d:"M10 9H8"}),t("path",{d:"M16 13H8"}),t("path",{d:"M16 17H8"})]});const le=r=>d(u,{...r,children:[t("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),t("circle",{cx:"9",cy:"9",r:"2"}),t("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]});const ae=r=>d(u,{...r,children:[t("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),t("path",{d:"M7 3v18"}),t("path",{d:"M3 7.5h4"}),t("path",{d:"M3 12h18"}),t("path",{d:"M3 16.5h4"}),t("path",{d:"M17 3v18"}),t("path",{d:"M17 7.5h4"}),t("path",{d:"M17 16.5h4"})]});const de=r=>d(u,{...r,children:[t("path",{d:"M9 18V5l12-2v13"}),t("circle",{cx:"6",cy:"18",r:"3"}),t("circle",{cx:"18",cy:"16",r:"3"})]});const j=r=>t(u,{...r,children:t("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})});const z=r=>d(u,{...r,children:[t("path",{d:"M5 12h14"}),t("path",{d:"M12 5v14"})]});const U=r=>d(u,{...r,children:[t("path",{d:"M18 6 6 18"}),t("path",{d:"m6 6 12 12"})]});function H(r){const c=r.responseHeaders||r.requestHeaders;const s=c?.["content-type"]||c?.["Content-Type"]||"";if(s.includes("json"))return{type:"JSON",color:l.semantic.info};if(s.includes("xml"))return{type:"XML",color:l.semantic.success};if(s.includes("html"))return{type:"HTML",color:l.semantic.warning};if(s.includes("text"))return{type:"TEXT",color:l.semantic.success};if(s.includes("image"))return{type:"IMAGE",color:l.semantic.error};if(s.includes("video"))return{type:"VIDEO",color:l.semantic.error};if(s.includes("audio"))return{type:"AUDIO",color:l.semantic.debug};if(s.includes("form"))return{type:"FORM",color:l.semantic.info};return{type:"OTHER",color:l.text.muted}}function ce(r){switch(r){case"JSON":return re;case"HTML":case"XML":case"TEXT":return ie;case"IMAGE":return le;case"VIDEO":return ae;case"AUDIO":return de;default:return N}}function se(r){switch(r){case"GET":return l.semantic.success;case"POST":return l.semantic.info;case"PUT":return l.semantic.warning;case"DELETE":return l.semantic.error;case"PATCH":return l.semantic.success;default:return l.text.muted}}function b({icon:r,iconColor:c,title:s,badgeCount:h,badgeColor:f}){return d("div",{style:n.sectionHeader,children:[r?t("span",{style:n.sectionHeaderIcon,children:t(r,{size:12,color:c??i.primary})}):null,t("span",{style:n.sectionHeaderTitle,children:s}),h!==void 0?t("span",{style:{...n.sectionHeaderBadge,backgroundColor:`${f??i.primary}15`,border:`1px solid ${f??i.primary}33`},children:t("span",{style:{...n.sectionHeaderBadgeText,color:f??i.primary},children:h})}):null]})}function pe({onPress:r,color:c,label:s}){return d("button",{type:"button",onClick:r,style:{...n.addButton,borderColor:`${c}40`},children:[t(z,{size:14,color:c}),t("span",{style:{...n.addButtonText,color:c},children:s})]})}function ue({value:r,onChange:c,onSubmit:s,onCancel:h,placeholder:f,color:g}){return d("div",{style:{...n.inputContainer,borderColor:`${g}40`},children:[t("input",{value:r,onChange:C=>c(C.target.value),onKeyDown:C=>{if(C.key==="Enter")s()},placeholder:f,style:{...n.input,color:g},autoFocus:true,autoCorrect:"off",autoCapitalize:"none",autoComplete:"off",spellCheck:false}),d("div",{style:n.inputButtons,children:[r.trim()?t("button",{type:"button",onClick:s,style:{...n.inlineAddButton,backgroundColor:`${g}15`,borderColor:`${g}40`},children:t("span",{style:{...n.inlineAddButtonText,color:g},children:"Add"})}):null,t("button",{type:"button",onClick:h,style:n.cancelButton,children:t(U,{size:16,color:`${g}60`})})]})]})}export function NetworkFilterViewV3({events:r,filter:c,onFilterChange:s,ignoredPatterns:h=[],onRemovePattern:f=()=>{},onAddPattern:g=()=>{},onTogglePatternMode:C=()=>{}}){const[v,G]=R("contains");const[K,w]=R(false);const[M,A]=R("");const P=x(()=>{const e=new Map;for(const o of h)e.set(o.value,o.mode);return e},[h]);const y=x(()=>h.map(e=>e.value),[h]);const I=E(e=>{g({value:e,mode:v})},[g,v]);const V=E(()=>{const e=M.trim();if(!e)return;I(e);A("");w(false)},[M,I]);const X=x(()=>{const e={all:r.length,success:0,error:0,pending:0};r.forEach(o=>{if(o.error||o.status&&o.status>=400){e.error+=1;return}if(o.status&&o.status>=200&&o.status<300){e.success+=1;return}if(!o.status&&!o.error){e.pending+=1}});return e},[r]);const q=x(()=>{return r.reduce((e,o)=>{if(!o.method)return e;e[o.method]=(e[o.method]||0)+1;return e},{})},[r]);const Z=x(()=>{return r.reduce((e,o)=>{const{type:a}=H(o);e[a]=(e[a]||0)+1;return e},{})},[r]);const W=x(()=>{const e=new Set;r.forEach(o=>{if(o.host){e.add(o.host);return}try{if(o.url){const a=new URL(o.url);const p=String(a.host||"");if(p)e.add(p)}}catch{}});return Array.from(e).filter(o=>o&&o!=="").sort((o,a)=>o.localeCompare(a))},[r]);const D=x(()=>{const e=new Set;r.forEach(o=>{if(!o.url)return;try{const a=new URL(o.url);const p=String(a.origin||"");const m=String(a.pathname||"");const T=`${p}${m}`;e.add(T)}catch{e.add(o.url)}});return Array.from(e).filter(o=>o&&o!=="").sort((o,a)=>o.localeCompare(a))},[r]);const L=x(()=>{const e=30;const o=W.slice(0,e);const a=D.slice(0,e);return[...o,...a]},[W,D]);const k=x(()=>L.filter(e=>!y.some(o=>e.includes(o))),[L,y]);const J=E((e,o)=>{const[a]=e.split("::");if(a==="status"){const p=o==="all"?void 0:o;s({...c,status:p});return}if(a==="method"){const p=String(o);const m=c.method||[];const T=m.includes(p);const S=T?m.filter(F=>F!==p):[p];s({...c,method:S.length>0?S:void 0});return}if(a==="contentType"){const p=String(o);const m=c.contentType||[];const T=m.includes(p);const S=T?m.filter(F=>F!==p):[p];s({...c,contentType:S.length>0?S:void 0})}},[c,s]);const B=e=>{const o=e.count===0;const a=!e.isMethod||e.icon;return d("button",{type:"button",onClick:()=>J(e.id,e.value),style:{...n.filterCard,...e.isActive?n.activeFilterCard:null},children:[e.icon?t(e.icon,{size:24,color:e.color}):e.isMethod?t("span",{style:{...n.methodBadgeCompact,backgroundColor:`${e.color}20`},children:t("span",{style:{...n.methodTextCompact,color:e.color},children:e.label})}):null,t("span",{style:o?n.filterCountZero:n.filterCountActive,children:e.count}),a?t("span",{style:n.filterLabelCompact,children:e.label}):null]},e.id)};const Y=["all","success","error","pending"].map(e=>({id:`status::${e}`,label:e.charAt(0).toUpperCase()+e.slice(1),count:X[e],icon:e==="success"?te:e==="error"?oe:e==="pending"?ne:N,color:e==="success"?l.semantic.success:e==="error"?l.semantic.error:e==="pending"?l.semantic.warning:l.semantic.info,isActive:c.status===e||!c.status&&e==="all",value:e}));const $=Object.entries(q);const O=Object.entries(Z);const _=()=>{const e=[{label:"Contains",value:"contains",hint:"substring"},{label:"Exact",value:"exact",hint:"whole path/host/url"}];return d("div",{style:n.modeToggleRow,children:[t("span",{style:n.modeToggleLabel,children:"Match:"}),t("div",{style:n.modeToggleGroup,children:e.map(o=>{const a=v===o.value;return d("button",{type:"button",onClick:()=>G(o.value),"aria-pressed":a,style:{...n.modeToggleButton,...a?n.modeToggleButtonActive:null},children:[t("span",{style:{...n.modeToggleButtonText,...a?n.modeToggleButtonTextActive:null},children:o.label}),t("span",{style:n.modeToggleButtonHint,children:o.hint})]},o.value)})})]})};const Q=e=>{const o=P.get(e)??"contains";const a=o==="exact";const p=a?l.semantic.warning:l.semantic.info;return t("button",{type:"button","aria-label":`Match mode: ${o}. Tap to toggle.`,onClick:m=>{m.stopPropagation();C(e)},style:{...n.modeBadge,borderColor:`${p}60`,backgroundColor:`${p}15`},children:t("span",{style:{...n.modeBadgeText,color:p},children:a?"EXACT":"CONTAINS"})})};return t("div",{style:n.container,children:d("div",{style:n.content,children:[d("div",{style:n.section,children:[t(b,{title:"Status"}),t("div",{style:n.filterGrid,children:Y.map(B)})]}),$.length>0?d("div",{style:n.section,children:[t(b,{title:"Method"}),t("div",{style:n.filterGrid,children:$.map(([e,o])=>B({id:`method::${e}`,label:e,count:o,color:se(e),isActive:c.method?.includes(e)??false,value:e,isMethod:true}))})]}):null,O.length>0?d("div",{style:n.section,children:[t(b,{title:"Content Type"}),t("div",{style:n.filterGrid,children:O.map(([e,o])=>{const a=r.find(m=>H(m).type===e);const{color:p}=a?H(a):{color:l.text.muted};return B({id:`contentType::${e}`,label:e,count:o,icon:ce(e),color:p,isActive:c.contentType?.includes(e)??false,value:e})})})]}):null,d("div",{style:n.excludeFiltersSection,children:[t(b,{icon:j,iconColor:i.primary,title:"ACTIVE FILTERS",badgeCount:y.length>0?y.length:void 0,badgeColor:i.primary}),t("div",{style:n.excludeFiltersDescription,children:"Hide queries matching these patterns from the list."}),t("div",{style:n.excludeFiltersInputWrapper,children:!K?t(pe,{onPress:()=>w(true),color:i.primary,label:"Add exclude pattern"}):d(ee,{children:[_(),t(ue,{value:M,onChange:A,onSubmit:V,onCancel:()=>{w(false);A("")},placeholder:"Enter domain or URL pattern...",color:i.primary})]})}),y.length>0?t("div",{style:n.excludeFiltersContent,children:t("div",{style:n.filterListColumn,children:y.map(e=>d("button",{type:"button",onClick:()=>f(e),style:n.filterItemRow,children:[t("span",{style:{...n.filterItemText,color:i.primary},children:e}),t("span",{style:n.filterItemMeta,children:Q(e)}),t(U,{size:12,color:`${i.primary}80`})]},e))})}):null]}),d("div",{style:n.availableKeysSection,children:[t(b,{icon:z,iconColor:i.primary,title:"AVAILABLE DOMAINS & URLS",badgeCount:k.length,badgeColor:i.primary}),t("div",{style:n.availableKeysScroll,children:k.length>0?k.map(e=>d("button",{type:"button",onClick:()=>I(e),style:n.availableKeyItem,children:[t("span",{style:n.availableKeyText,children:e}),t(z,{size:12,color:i.primary})]},e)):t("div",{style:n.emptyStateText,children:"No network events captured yet. Domains and URLs will appear here."})})]}),d("div",{style:n.howItWorksSection,children:[t(b,{icon:j,iconColor:i.textSecondary,title:"HOW NETWORK FILTERS WORK"}),t("div",{style:n.howItWorksText,children:"Patterns hide matching requests from the network event list. Each pattern has a match mode you can toggle on its badge: CONTAINS hides any URL containing the text; EXACT hides only an exact path/host/url match."}),d("div",{style:n.examplesContainer,children:[t("div",{style:n.examplesTitle,children:"EXAMPLES:"}),["\u2022 example.com (CONTAINS) \u2192 any request whose URL contains example.com","\u2022 example.com (EXACT) \u2192 only requests served by that exact host","\u2022 /v1 (CONTAINS) \u2192 any URL containing /v1 (e.g. /v1, /v1/users)","\u2022 /v1 (EXACT) \u2192 only requests whose pathname is exactly /v1"].map(e=>t("div",{style:n.exampleItem,children:e},e))]})]})]})})}const n={container:{display:"flex",flexDirection:"column",flex:1,minHeight:0,backgroundColor:i.base},content:{flex:1,minHeight:0,overflowY:"auto",padding:"16px 16px 24px 16px"},section:{marginBottom:8},sectionHeader:{display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 16px",backgroundColor:i.base,minHeight:40,boxSizing:"border-box"},sectionHeaderIcon:{display:"inline-flex",marginRight:8},sectionHeaderTitle:{flex:1,fontSize:14,fontWeight:600,color:i.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},sectionHeaderBadge:{display:"inline-flex",alignItems:"center",padding:"3px 8px",borderRadius:12,marginLeft:8},sectionHeaderBadgeText:{fontSize:12,fontWeight:600},filterGrid:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:8},filterCard:{display:"flex",backgroundColor:i.card,borderRadius:12,padding:"10px 8px",flexDirection:"column",alignItems:"center",justifyContent:"center",border:`1px solid ${i.border}`,width:72,minHeight:68,boxSizing:"border-box",cursor:"pointer",margin:0},activeFilterCard:{backgroundColor:`${i.primary}33`,border:`2px solid ${i.primary}`,boxShadow:`0 0 8px ${i.primary}4D`},filterCountActive:{fontSize:14,fontWeight:700,color:i.text,fontFamily:"ui-monospace, Menlo, monospace",marginTop:3,marginBottom:1,textShadow:"0 0.5px 1px rgba(0, 0, 0, 0.2)"},filterCountZero:{fontSize:11,fontWeight:500,color:i.textMuted,fontFamily:"ui-monospace, Menlo, monospace",marginTop:3,marginBottom:1},filterLabelCompact:{fontSize:10,color:i.text,fontWeight:600,textAlign:"center",textTransform:"capitalize",textShadow:"0 0.5px 1px rgba(0, 0, 0, 0.3)"},methodBadgeCompact:{display:"inline-flex",padding:"4px 8px",borderRadius:5,minWidth:48,maxWidth:60,boxSizing:"border-box",alignItems:"center",justifyContent:"center"},methodTextCompact:{fontSize:13,fontWeight:700,letterSpacing:.3,fontFamily:"ui-monospace, Menlo, monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},excludeFiltersSection:{backgroundColor:i.card,borderRadius:16,border:`1px solid ${i.border}`,marginTop:16,overflow:"hidden"},excludeFiltersDescription:{fontSize:10,color:i.textSecondary,padding:"8px 16px 0 16px",lineHeight:"14px"},excludeFiltersInputWrapper:{padding:"8px 16px"},excludeFiltersContent:{padding:"0 16px 16px 16px",maxHeight:150,overflowY:"auto"},filterListColumn:{display:"flex",flexDirection:"column",gap:8},filterItemRow:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",backgroundColor:i.hover,borderRadius:8,border:`1px solid ${i.border}`,cursor:"pointer",margin:0,width:"100%",boxSizing:"border-box",textAlign:"left"},filterItemText:{flex:1,fontSize:12,fontFamily:"ui-monospace, Menlo, monospace",marginRight:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},filterItemMeta:{display:"inline-flex",marginRight:8},modeBadge:{display:"inline-flex",padding:"3px 8px",borderRadius:6,borderWidth:1,borderStyle:"solid",background:"none",cursor:"pointer",margin:0},modeBadgeText:{fontSize:9,fontFamily:"ui-monospace, Menlo, monospace",fontWeight:700,letterSpacing:.5},modeToggleRow:{display:"flex",flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},modeToggleLabel:{fontSize:11,fontWeight:600,color:l.text.secondary,fontFamily:"ui-monospace, Menlo, monospace",letterSpacing:.3},modeToggleGroup:{display:"flex",flexDirection:"row",gap:6,flex:1},modeToggleButton:{flex:1,display:"flex",flexDirection:"column",padding:"6px 10px",borderRadius:8,border:`1px solid ${l.border.default}`,backgroundColor:l.background.hover,alignItems:"center",cursor:"pointer",margin:0},modeToggleButtonActive:{border:`1px solid ${l.semantic.info}`,backgroundColor:`${l.semantic.info}22`},modeToggleButtonText:{fontSize:11,fontWeight:700,color:l.text.secondary,fontFamily:"ui-monospace, Menlo, monospace",letterSpacing:.3},modeToggleButtonTextActive:{color:l.semantic.info},modeToggleButtonHint:{fontSize:9,color:l.text.muted,marginTop:1},addButton:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",padding:"10px 14px",borderRadius:10,borderWidth:1,borderStyle:"dashed",backgroundColor:i.input,cursor:"pointer",margin:0,width:"100%",boxSizing:"border-box"},addButtonText:{fontSize:13,fontWeight:500,marginLeft:6},inputContainer:{display:"flex",flexDirection:"row",alignItems:"center",backgroundColor:i.input,borderRadius:10,borderWidth:1,borderStyle:"solid",padding:"10px 14px",marginBottom:8,boxSizing:"border-box"},input:{flex:1,fontSize:13,padding:0,border:"none",outline:"none",background:"transparent",fontFamily:"inherit",minWidth:0},inputButtons:{display:"flex",flexDirection:"row",alignItems:"center",gap:8},cancelButton:{display:"inline-flex",padding:4,borderRadius:6,backgroundColor:i.hover,border:"none",cursor:"pointer",margin:0},inlineAddButton:{display:"inline-flex",padding:"6px 12px",borderRadius:6,borderWidth:1,borderStyle:"solid",cursor:"pointer",margin:0},inlineAddButtonText:{fontSize:12,fontWeight:600},availableKeysSection:{backgroundColor:i.card,borderRadius:16,border:`1px solid ${i.border}`,marginTop:16,overflow:"hidden"},availableKeysScroll:{maxHeight:150,overflowY:"auto",padding:"8px 16px 16px 16px"},availableKeyItem:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",backgroundColor:i.hover,borderRadius:8,border:`1px solid ${i.border}`,marginBottom:8,cursor:"pointer",width:"100%",boxSizing:"border-box",textAlign:"left"},availableKeyText:{flex:1,fontSize:11,color:i.text,fontFamily:"ui-monospace, Menlo, monospace",marginRight:8,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},emptyStateText:{fontSize:11,color:i.textMuted,fontStyle:"italic",textAlign:"center",padding:"12px 0"},howItWorksSection:{backgroundColor:i.card,borderRadius:16,border:`1px solid ${i.border}`,marginTop:16,overflow:"hidden"},howItWorksText:{fontSize:11,color:i.textSecondary,lineHeight:"16px",margin:"8px 0 12px 0",padding:"0 16px",fontFamily:"ui-monospace, Menlo, monospace"},examplesContainer:{padding:"8px 16px 16px 16px",borderTop:`1px solid ${i.border}`},examplesTitle:{fontSize:10,fontWeight:600,color:i.textMuted,fontFamily:"ui-monospace, Menlo, monospace",letterSpacing:.5,marginBottom:6},exampleItem:{fontSize:10,color:i.textMuted,fontFamily:"ui-monospace, Menlo, monospace",lineHeight:"16px"}};