@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,107 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NetworkOverrideHeaderButton = NetworkOverrideHeaderButton;
7
- var _reactNative = require("react-native");
8
- var _sharedUi = require("@buoy-gg/shared-ui");
9
- var _useOverrideRules = require("../hooks/useOverrideRules");
10
- var _useNetworkSelection = require("../hooks/useNetworkSelection");
11
- var _matchRule = require("../overrides/matchRule");
12
- var _presets = require("../overrides/presets");
13
- var _networkEventStore = require("../utils/networkEventStore");
14
- var _networkSavedStore = require("../utils/networkSavedStore");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- /**
17
- * The Override action, in the request-detail header.
18
- *
19
- * A labelled word rather than an icon: every other control here is a glyph
20
- * (back, pin, bookmark) and glyphs are fine for things you already know. This
21
- * one is the least familiar action in the tool, and "Override" spelled out is
22
- * the entire explanation.
23
- *
24
- * A self-subscribing leaf, for the same two reasons `NetworkDetailPinActions`
25
- * is one: the modal root stays free of subscriptions, and the selected id is
26
- * subscribed here so stepping between requests doesn't rebuild the header
27
- * around a new prop.
28
- *
29
- * It lights up while a rule covers the request you're looking at — the same
30
- * warning tint the OVERRIDDEN strip and the toolbar flask use, because "you are
31
- * not seeing the truth" is one idea and should look like one.
32
- *
33
- * Tapping it goes straight to the Overrides screen with the rule open: a new
34
- * one prefilled from this request, or the existing one if something already
35
- * covers it. One destination, so there's never a question of where the thing
36
- * you just made went.
37
- */
38
- function NetworkOverrideHeaderButton({
39
- onOpen
40
- }) {
41
- const eventId = (0, _useNetworkSelection.useSelectedNetworkEventId)();
42
- const {
43
- rules,
44
- isRuleSpent
45
- } = (0, _useOverrideRules.useOverrideRules)();
46
-
47
- // Resolved here rather than held as a prop: the live store has the fresh copy
48
- // while a request is in flight, and the saved store is the only copy once it
49
- // has been cleared or aged out.
50
- const event = eventId ? _networkEventStore.networkEventStore.getEvents().find(e => e.id === eventId) ?? _networkSavedStore.networkSavedStore.getEventById(eventId) : null;
51
- const existing = event ? rules.find(rule => rule.enabled && !isRuleSpent(rule) && (0, _matchRule.ruleMatches)(rule, event.url, String(event.method || "GET"))) ?? null : null;
52
- const active = existing !== null;
53
- const handlePress = () => {
54
- if (!event) return;
55
- if (existing) {
56
- // Editing what's already there, rather than stacking a second rule the
57
- // first would shadow — first enabled match wins.
58
- const {
59
- id,
60
- hits: _h,
61
- seen: _s,
62
- createdAt: _c,
63
- ...draft
64
- } = existing;
65
- onOpen(draft, id);
66
- return;
67
- }
68
- onOpen((0, _presets.draftFromEvent)(event));
69
- };
70
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
71
- onPress: handlePress,
72
- "sentry-label": "ignore open overrides",
73
- testID: "buoy-network-override-request",
74
- accessibilityRole: "button",
75
- accessibilityLabel: active ? "Edit the override on this request" : "Override this request",
76
- style: [styles.button, active && styles.buttonActive],
77
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
78
- style: [styles.label, active && styles.labelActive],
79
- children: "Override"
80
- })
81
- });
82
- }
83
- const styles = _reactNative.StyleSheet.create({
84
- // Night: the header's dark-glass chip, with the accent label the night
85
- // language gives labelled actions (plate + accent ink). Active keeps the
86
- // warning tint — same "you are not seeing the truth" signal as the flask.
87
- button: {
88
- paddingHorizontal: 10,
89
- paddingVertical: 6,
90
- borderRadius: 8,
91
- borderWidth: 1,
92
- borderColor: _sharedUi.night.color.border,
93
- backgroundColor: _sharedUi.night.color.buttonSurface
94
- },
95
- buttonActive: {
96
- borderColor: _sharedUi.night.color.warning + "77",
97
- backgroundColor: _sharedUi.night.color.warningSoft
98
- },
99
- label: {
100
- fontSize: 11,
101
- fontWeight: "700",
102
- color: _sharedUi.night.color.accent
103
- },
104
- labelActive: {
105
- color: _sharedUi.night.color.warning
106
- }
107
- });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkOverrideHeaderButton=NetworkOverrideHeaderButton;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _useOverrideRules=require("../hooks/useOverrideRules");var _useNetworkSelection=require("../hooks/useNetworkSelection");var _matchRule=require("../overrides/matchRule");var _presets=require("../overrides/presets");var _networkEventStore=require("../utils/networkEventStore");var _networkSavedStore=require("../utils/networkSavedStore");var _jsxRuntime=require("react/jsx-runtime");function NetworkOverrideHeaderButton({onOpen:n}){const t=(0,_useNetworkSelection.useSelectedNetworkEventId)();const{rules:s,isRuleSpent:l}=(0,_useOverrideRules.useOverrideRules)();const r=t?_networkEventStore.networkEventStore.getEvents().find(e=>e.id===t)??_networkSavedStore.networkSavedStore.getEventById(t):null;const o=r?s.find(e=>e.enabled&&!l(e)&&(0,_matchRule.ruleMatches)(e,r.url,String(r.method||"GET")))??null:null;const i=o!==null;const u=()=>{if(!r)return;if(o){const{id:e,hits:d,seen:c,createdAt:v,...a}=o;n(a,e);return}n((0,_presets.draftFromEvent)(r))};return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{onPress:u,"sentry-label":"ignore open overrides",testID:"buoy-network-override-request",accessibilityRole:"button",accessibilityLabel:i?"Edit the override on this request":"Override this request",style:[styles.button,i&&styles.buttonActive],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.label,i&&styles.labelActive],children:"Override"})})}const styles=_reactNative.StyleSheet.create({button:{paddingHorizontal:10,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:_sharedUi.night.color.border,backgroundColor:_sharedUi.night.color.buttonSurface},buttonActive:{borderColor:_sharedUi.night.color.warning+"77",backgroundColor:_sharedUi.night.color.warningSoft},label:{fontSize:11,fontWeight:"700",color:_sharedUi.night.color.accent},labelActive:{color:_sharedUi.night.color.warning}});
@@ -1,133 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NetworkOverrideHeaderButton = NetworkOverrideHeaderButton;
7
- var _useOverrideRules = require("../hooks/useOverrideRules");
8
- var _useNetworkSelection = require("../hooks/useNetworkSelection");
9
- var _matchRule = require("../overrides/matchRule");
10
- var _presets = require("../overrides/presets");
11
- var _networkEventStore = require("../utils/networkEventStore");
12
- var _networkSavedStore = require("../utils/networkSavedStore");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * NetworkOverrideHeaderButton.web — DOM twin of
16
- * NetworkOverrideHeaderButton.tsx.
17
- *
18
- * The Override action, in the request-detail header. A labelled word rather
19
- * than an icon — it's the least familiar action in the tool, and "Override"
20
- * spelled out is the entire explanation. A self-subscribing leaf: the
21
- * selected id and the rule list are subscribed HERE so stepping between
22
- * requests doesn't rebuild the header around a new prop.
23
- *
24
- * It lights up while a rule covers the request you're looking at — the same
25
- * warning tint the OVERRIDDEN strip and the toolbar flask use. Tapping it
26
- * goes straight to the Overrides screen with the rule open: a new one
27
- * prefilled from this request (`draftFromEvent`), or the existing one if
28
- * something already covers it (first enabled match wins, so stacking a
29
- * second rule the first would shadow is never offered). (Native comments.)
30
- *
31
- * REUSED, not forked (all platform-free): `useOverrideRules`,
32
- * `useSelectedNetworkEventId`, `ruleMatches`, `draftFromEvent`,
33
- * `networkEventStore`, `networkSavedStore`.
34
- *
35
- * shared-ui RN chrome is replicated as DOM with provenance:
36
- * - `macOSColors` — inlined verbatim subset from
37
- * shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts.
38
- *
39
- * @platform React DOM Web
40
- */
41
-
42
- /** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */const macOSColors = {
43
- background: {
44
- input: "#26262A"
45
- },
46
- border: {
47
- input: "#3D3D42"
48
- },
49
- text: {
50
- primary: "#F5F5F7"
51
- },
52
- semantic: {
53
- warning: "#FFEB3B",
54
- warningBackground: "rgba(255, 235, 59, 0.15)"
55
- }
56
- };
57
- function NetworkOverrideHeaderButton({
58
- onOpen
59
- }) {
60
- const eventId = (0, _useNetworkSelection.useSelectedNetworkEventId)();
61
- const {
62
- rules,
63
- isRuleSpent
64
- } = (0, _useOverrideRules.useOverrideRules)();
65
-
66
- // Resolved here rather than held as a prop: the live store has the fresh
67
- // copy while a request is in flight, and the saved store is the only copy
68
- // once it has been cleared or aged out. (Native comment.)
69
- const event = eventId ? _networkEventStore.networkEventStore.getEvents().find(e => e.id === eventId) ?? _networkSavedStore.networkSavedStore.getEventById(eventId) : null;
70
- const existing = event ? rules.find(rule => rule.enabled && !isRuleSpent(rule) && (0, _matchRule.ruleMatches)(rule, event.url, String(event.method || "GET"))) ?? null : null;
71
- const active = existing !== null;
72
- const handlePress = () => {
73
- if (!event) return;
74
- if (existing) {
75
- // Editing what's already there, rather than stacking a second rule the
76
- // first would shadow — first enabled match wins.
77
- const {
78
- id,
79
- hits: _h,
80
- seen: _s,
81
- createdAt: _c,
82
- ...draft
83
- } = existing;
84
- onOpen(draft, id);
85
- return;
86
- }
87
- onOpen((0, _presets.draftFromEvent)(event));
88
- };
89
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
90
- type: "button",
91
- onClick: handlePress,
92
- "aria-label": active ? "Edit the override on this request" : "Override this request",
93
- style: {
94
- ...styles.button,
95
- ...(active ? styles.buttonActive : null)
96
- },
97
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
98
- style: {
99
- ...styles.label,
100
- ...(active ? styles.labelActive : null)
101
- },
102
- children: "Override"
103
- })
104
- });
105
- }
106
-
107
- // Values mirror the native StyleSheet block 1:1.
108
- const styles = {
109
- button: {
110
- display: "inline-flex",
111
- alignItems: "center",
112
- padding: "6px 10px",
113
- borderRadius: 6,
114
- border: `1px solid ${macOSColors.border.input}`,
115
- backgroundColor: macOSColors.background.input,
116
- cursor: "pointer",
117
- margin: 0,
118
- boxSizing: "border-box"
119
- },
120
- buttonActive: {
121
- border: `1px solid ${macOSColors.semantic.warning}77`,
122
- backgroundColor: macOSColors.semantic.warningBackground
123
- },
124
- label: {
125
- fontSize: 11,
126
- fontWeight: 700,
127
- color: macOSColors.text.primary,
128
- fontFamily: "inherit"
129
- },
130
- labelActive: {
131
- color: macOSColors.semantic.warning
132
- }
133
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkOverrideHeaderButton=NetworkOverrideHeaderButton;var _useOverrideRules=require("../hooks/useOverrideRules");var _useNetworkSelection=require("../hooks/useNetworkSelection");var _matchRule=require("../overrides/matchRule");var _presets=require("../overrides/presets");var _networkEventStore=require("../utils/networkEventStore");var _networkSavedStore=require("../utils/networkSavedStore");var _jsxRuntime=require("react/jsx-runtime");const macOSColors={background:{input:"#26262A"},border:{input:"#3D3D42"},text:{primary:"#F5F5F7"},semantic:{warning:"#FFEB3B",warningBackground:"rgba(255, 235, 59, 0.15)"}};function NetworkOverrideHeaderButton({onOpen:i}){const t=(0,_useNetworkSelection.useSelectedNetworkEventId)();const{rules:s,isRuleSpent:u}=(0,_useOverrideRules.useOverrideRules)();const r=t?_networkEventStore.networkEventStore.getEvents().find(e=>e.id===t)??_networkSavedStore.networkSavedStore.getEventById(t):null;const n=r?s.find(e=>e.enabled&&!u(e)&&(0,_matchRule.ruleMatches)(e,r.url,String(r.method||"GET")))??null:null;const o=n!==null;const a=()=>{if(!r)return;if(n){const{id:e,hits:d,seen:c,createdAt:v,...l}=n;i(l,e);return}i((0,_presets.draftFromEvent)(r))};return(0,_jsxRuntime.jsx)("button",{type:"button",onClick:a,"aria-label":o?"Edit the override on this request":"Override this request",style:{...styles.button,...o?styles.buttonActive:null},children:(0,_jsxRuntime.jsx)("span",{style:{...styles.label,...o?styles.labelActive:null},children:"Override"})})}const styles={button:{display:"inline-flex",alignItems:"center",padding:"6px 10px",borderRadius:6,border:`1px solid ${macOSColors.border.input}`,backgroundColor:macOSColors.background.input,cursor:"pointer",margin:0,boxSizing:"border-box"},buttonActive:{border:`1px solid ${macOSColors.semantic.warning}77`,backgroundColor:macOSColors.semantic.warningBackground},label:{fontSize:11,fontWeight:700,color:macOSColors.text.primary,fontFamily:"inherit"},labelActive:{color:macOSColors.semantic.warning}};
@@ -1,90 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NetworkOverridesButton = NetworkOverridesButton;
7
- var _reactNative = require("react-native");
8
- var _sharedUi = require("@buoy-gg/shared-ui");
9
- var _useOverrideRules = require("../hooks/useOverrideRules");
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- /**
12
- * Header button for the Overrides screen, and the always-visible "overrides
13
- * are active" indicator.
14
- *
15
- * A self-subscribing LEAF, like the other live header pieces: the rule list
16
- * changes on its own schedule (every hit bumps a counter) and the modal shell
17
- * has no business re-rendering for it.
18
- *
19
- * The active tint is not decoration. A rule left enabled from yesterday makes
20
- * the app behave wrongly in a way that looks exactly like a real bug, so the
21
- * tool has to keep saying so from the top level — Chrome shows the same
22
- * warning in its Overrides pane for the same reason.
23
- */
24
- function NetworkOverridesButton({
25
- onPress
26
- }) {
27
- const {
28
- activeCount
29
- } = (0, _useOverrideRules.useOverrideRules)();
30
- const active = activeCount > 0;
31
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
32
- onPress: onPress,
33
- "sentry-label": "ignore open overrides",
34
- testID: "buoy-network-overrides",
35
- accessibilityRole: "button",
36
- style: [styles.button, active && styles.buttonActive],
37
- accessibilityLabel: active ? `Response overrides — ${activeCount} active` : "Response overrides",
38
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.FlaskConical, {
39
- size: 14,
40
- color: active ? _sharedUi.night.color.warning : _sharedUi.night.color.textSecondary
41
- }), active ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
42
- style: styles.badge,
43
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
44
- style: styles.badgeText,
45
- children: activeCount
46
- })
47
- }) : null]
48
- });
49
- }
50
- const styles = _reactNative.StyleSheet.create({
51
- // The header's standard 32×32 action box — same shape, fill, border and
52
- // radius as search/power/clear. It was a bare padded glyph, which read as a
53
- // different CLASS of control than its neighbours when it is exactly the same
54
- // kind of thing.
55
- button: {
56
- width: 32,
57
- height: 32,
58
- borderRadius: 8,
59
- alignItems: "center",
60
- justifyContent: "center",
61
- backgroundColor: _sharedUi.night.color.buttonSurface,
62
- borderWidth: 1,
63
- borderColor: _sharedUi.night.color.border
64
- },
65
- // Active fills the whole box, the way the power toggle goes green — the
66
- // warning now reads at a glance instead of as a tinted glyph.
67
- buttonActive: {
68
- backgroundColor: _sharedUi.night.color.warningSoft,
69
- borderColor: _sharedUi.night.color.warning + "77"
70
- },
71
- badge: {
72
- position: "absolute",
73
- // Inside the box now that there is one; a corner-hung badge would clip
74
- // against the neighbouring buttons' 8pt gap.
75
- top: 1,
76
- right: 1,
77
- minWidth: 12,
78
- height: 12,
79
- borderRadius: 6,
80
- paddingHorizontal: 3,
81
- alignItems: "center",
82
- justifyContent: "center",
83
- backgroundColor: _sharedUi.night.color.warning
84
- },
85
- badgeText: {
86
- fontSize: 8,
87
- fontWeight: "800",
88
- color: "#000000"
89
- }
90
- });
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkOverridesButton=NetworkOverridesButton;var _reactNative=require("react-native");var _sharedUi=require("@buoy-gg/shared-ui");var _useOverrideRules=require("../hooks/useOverrideRules");var _jsxRuntime=require("react/jsx-runtime");function NetworkOverridesButton({onPress:t}){const{activeCount:r}=(0,_useOverrideRules.useOverrideRules)();const e=r>0;return(0,_jsxRuntime.jsxs)(_reactNative.TouchableOpacity,{onPress:t,"sentry-label":"ignore open overrides",testID:"buoy-network-overrides",accessibilityRole:"button",style:[styles.button,e&&styles.buttonActive],accessibilityLabel:e?`Response overrides \u2014 ${r} active`:"Response overrides",children:[(0,_jsxRuntime.jsx)(_sharedUi.FlaskConical,{size:14,color:e?_sharedUi.night.color.warning:_sharedUi.night.color.textSecondary}),e?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.badge,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.badgeText,children:r})}):null]})}const styles=_reactNative.StyleSheet.create({button:{width:32,height:32,borderRadius:8,alignItems:"center",justifyContent:"center",backgroundColor:_sharedUi.night.color.buttonSurface,borderWidth:1,borderColor:_sharedUi.night.color.border},buttonActive:{backgroundColor:_sharedUi.night.color.warningSoft,borderColor:_sharedUi.night.color.warning+"77"},badge:{position:"absolute",top:1,right:1,minWidth:12,height:12,borderRadius:6,paddingHorizontal:3,alignItems:"center",justifyContent:"center",backgroundColor:_sharedUi.night.color.warning},badgeText:{fontSize:8,fontWeight:"800",color:"#000000"}});
@@ -1,143 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NetworkOverridesButton = NetworkOverridesButton;
7
- var _useOverrideRules = require("../hooks/useOverrideRules");
8
- var _jsxRuntime = require("react/jsx-runtime");
9
- /**
10
- * NetworkOverridesButton.web — DOM twin of NetworkOverridesButton.tsx.
11
- *
12
- * Header button for the Overrides screen, and the always-visible "overrides
13
- * are active" indicator. A self-subscribing LEAF, like the other live header
14
- * pieces — the rule list changes on its own schedule (every hit bumps a
15
- * counter) and the modal shell has no business re-rendering for it.
16
- *
17
- * The active tint is not decoration: a rule left enabled from yesterday makes
18
- * the app behave wrongly in a way that looks exactly like a real bug, so the
19
- * tool keeps saying so from the top level. (Native comment.)
20
- *
21
- * REUSED, not forked: `useOverrideRules` (platform-free).
22
- *
23
- * shared-ui RN chrome is replicated as DOM with provenance:
24
- * - `macOSColors` — inlined verbatim subset from
25
- * shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts.
26
- * - `FlaskConical` — inline lucide SVG (shared-ui icons are lucide
27
- * re-exports).
28
- *
29
- * @platform React DOM Web
30
- */
31
-
32
- /** macOSColors subset — shared/src/ui/gameUI/constants/macOSDesignSystemColors.ts, verbatim. */const macOSColors = {
33
- background: {
34
- base: "#0A0A0C",
35
- hover: "#1D1D1F"
36
- },
37
- border: {
38
- default: "#2D2D2F"
39
- },
40
- text: {
41
- secondary: "#A1A1A6"
42
- },
43
- semantic: {
44
- warning: "#FFEB3B",
45
- warningBackground: "rgba(255, 235, 59, 0.15)"
46
- }
47
- };
48
- const FlaskConical = ({
49
- size = 14,
50
- color
51
- }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
52
- width: size,
53
- height: size,
54
- viewBox: "0 0 24 24",
55
- fill: "none",
56
- stroke: color,
57
- strokeWidth: 2,
58
- strokeLinecap: "round",
59
- strokeLinejoin: "round",
60
- style: {
61
- flexShrink: 0,
62
- display: "block"
63
- },
64
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
65
- d: "M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"
66
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
67
- d: "M8.5 2h7"
68
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
69
- d: "M7 16h10"
70
- })]
71
- });
72
- function NetworkOverridesButton({
73
- onPress
74
- }) {
75
- const {
76
- activeCount
77
- } = (0, _useOverrideRules.useOverrideRules)();
78
- const active = activeCount > 0;
79
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
80
- type: "button",
81
- onClick: onPress,
82
- style: {
83
- ...styles.button,
84
- ...(active ? styles.buttonActive : null)
85
- },
86
- "aria-label": active ? `Response overrides — ${activeCount} active` : "Response overrides",
87
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(FlaskConical, {
88
- size: 14,
89
- color: active ? macOSColors.semantic.warning : macOSColors.text.secondary
90
- }), active ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
91
- style: styles.badge,
92
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
93
- style: styles.badgeText,
94
- children: activeCount
95
- })
96
- }) : null]
97
- });
98
- }
99
-
100
- // Values mirror the native StyleSheet block 1:1: the header's standard 32×32
101
- // action box; active fills the whole box the way the power toggle goes green,
102
- // with the count badge INSIDE the box.
103
- const styles = {
104
- button: {
105
- position: "relative",
106
- display: "inline-flex",
107
- width: 32,
108
- height: 32,
109
- boxSizing: "border-box",
110
- borderRadius: 8,
111
- alignItems: "center",
112
- justifyContent: "center",
113
- backgroundColor: macOSColors.background.hover,
114
- border: `1px solid ${macOSColors.border.default}`,
115
- cursor: "pointer",
116
- padding: 0,
117
- margin: 0
118
- },
119
- buttonActive: {
120
- backgroundColor: macOSColors.semantic.warningBackground,
121
- border: `1px solid ${macOSColors.semantic.warning}77`
122
- },
123
- badge: {
124
- position: "absolute",
125
- top: 1,
126
- right: 1,
127
- minWidth: 12,
128
- height: 12,
129
- borderRadius: 6,
130
- padding: "0 3px",
131
- boxSizing: "border-box",
132
- display: "inline-flex",
133
- alignItems: "center",
134
- justifyContent: "center",
135
- backgroundColor: macOSColors.semantic.warning
136
- },
137
- badgeText: {
138
- fontSize: 8,
139
- fontWeight: 800,
140
- color: macOSColors.background.base,
141
- lineHeight: 1
142
- }
143
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.NetworkOverridesButton=NetworkOverridesButton;var _useOverrideRules=require("../hooks/useOverrideRules");var _jsxRuntime=require("react/jsx-runtime");const macOSColors={background:{base:"#0A0A0C",hover:"#1D1D1F"},border:{default:"#2D2D2F"},text:{secondary:"#A1A1A6"},semantic:{warning:"#FFEB3B",warningBackground:"rgba(255, 235, 59, 0.15)"}};const FlaskConical=({size:t=14,color:e})=>(0,_jsxRuntime.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0,display:"block"},children:[(0,_jsxRuntime.jsx)("path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"}),(0,_jsxRuntime.jsx)("path",{d:"M8.5 2h7"}),(0,_jsxRuntime.jsx)("path",{d:"M7 16h10"})]});function NetworkOverridesButton({onPress:t}){const{activeCount:e}=(0,_useOverrideRules.useOverrideRules)();const r=e>0;return(0,_jsxRuntime.jsxs)("button",{type:"button",onClick:t,style:{...styles.button,...r?styles.buttonActive:null},"aria-label":r?`Response overrides \u2014 ${e} active`:"Response overrides",children:[(0,_jsxRuntime.jsx)(FlaskConical,{size:14,color:r?macOSColors.semantic.warning:macOSColors.text.secondary}),r?(0,_jsxRuntime.jsx)("span",{style:styles.badge,children:(0,_jsxRuntime.jsx)("span",{style:styles.badgeText,children:e})}):null]})}const styles={button:{position:"relative",display:"inline-flex",width:32,height:32,boxSizing:"border-box",borderRadius:8,alignItems:"center",justifyContent:"center",backgroundColor:macOSColors.background.hover,border:`1px solid ${macOSColors.border.default}`,cursor:"pointer",padding:0,margin:0},buttonActive:{backgroundColor:macOSColors.semantic.warningBackground,border:`1px solid ${macOSColors.semantic.warning}77`},badge:{position:"absolute",top:1,right:1,minWidth:12,height:12,borderRadius:6,padding:"0 3px",boxSizing:"border-box",display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:macOSColors.semantic.warning},badgeText:{fontSize:8,fontWeight:800,color:macOSColors.background.base,lineHeight:1}};