chrome-devtools-frontend 1.0.1512147 → 1.0.1513662

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 (337) hide show
  1. package/docs/cookbook/release_management.md +15 -13
  2. package/docs/get_the_code.md +114 -35
  3. package/front_end/Images/src/ai-explorer-badge.svg +114 -0
  4. package/front_end/Images/src/code-whisperer-badge.svg +166 -0
  5. package/front_end/Images/src/devtools-user-badge.svg +129 -0
  6. package/front_end/Images/src/dom-detective-badge.svg +136 -0
  7. package/front_end/Images/src/speedster-badge.svg +166 -0
  8. package/front_end/core/common/Color.ts +40 -44
  9. package/front_end/core/common/Console.ts +4 -4
  10. package/front_end/core/common/ParsedURL.ts +14 -14
  11. package/front_end/core/common/ResourceType.ts +20 -20
  12. package/front_end/core/common/SegmentedRange.ts +13 -14
  13. package/front_end/core/common/Settings.ts +4 -4
  14. package/front_end/core/common/StringOutputStream.ts +4 -4
  15. package/front_end/core/host/GdpClient.ts +76 -2
  16. package/front_end/core/host/InspectorFrontendHost.ts +4 -1
  17. package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
  18. package/front_end/core/host/ResourceLoader.ts +2 -2
  19. package/front_end/core/host/UserMetrics.ts +0 -2
  20. package/front_end/core/i18n/NumberFormatter.ts +7 -0
  21. package/front_end/core/protocol_client/InspectorBackend.ts +9 -9
  22. package/front_end/core/root/Runtime.ts +5 -2
  23. package/front_end/core/sdk/AccessibilityModel.ts +48 -48
  24. package/front_end/core/sdk/AnimationModel.ts +78 -79
  25. package/front_end/core/sdk/CPUProfilerModel.ts +5 -5
  26. package/front_end/core/sdk/CPUThrottlingManager.ts +17 -17
  27. package/front_end/core/sdk/CSSMatchedStyles.ts +44 -44
  28. package/front_end/core/sdk/CSSMedia.ts +22 -22
  29. package/front_end/core/sdk/CSSModel.ts +4 -4
  30. package/front_end/core/sdk/CSSProperty.ts +9 -9
  31. package/front_end/core/sdk/CSSPropertyParser.ts +1 -2
  32. package/front_end/core/sdk/CSSRule.ts +3 -3
  33. package/front_end/core/sdk/CSSStyleDeclaration.ts +27 -28
  34. package/front_end/core/sdk/CSSStyleSheetHeader.ts +13 -13
  35. package/front_end/core/sdk/CategorizedBreakpoint.ts +4 -4
  36. package/front_end/core/sdk/ChildTargetManager.ts +6 -6
  37. package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +4 -4
  38. package/front_end/core/sdk/ConsoleModel.ts +24 -24
  39. package/front_end/core/sdk/Cookie.ts +16 -16
  40. package/front_end/core/sdk/CookieParser.ts +6 -6
  41. package/front_end/core/sdk/DOMDebuggerModel.ts +88 -89
  42. package/front_end/core/sdk/DOMModel.ts +113 -113
  43. package/front_end/core/sdk/DebuggerModel.ts +102 -103
  44. package/front_end/core/sdk/EmulationModel.ts +6 -6
  45. package/front_end/core/sdk/EventBreakpointsModel.ts +5 -5
  46. package/front_end/core/sdk/HeapProfilerModel.ts +5 -5
  47. package/front_end/core/sdk/IsolateManager.ts +26 -26
  48. package/front_end/core/sdk/LayerTreeBase.ts +29 -30
  49. package/front_end/core/sdk/OverlayModel.ts +6 -6
  50. package/front_end/core/sdk/Resource.ts +43 -43
  51. package/front_end/core/sdk/ResourceTreeModel.ts +58 -61
  52. package/front_end/core/sdk/RuntimeModel.ts +12 -13
  53. package/front_end/core/sdk/SDKModel.ts +3 -3
  54. package/front_end/core/sdk/Script.ts +17 -17
  55. package/front_end/core/sdk/SecurityOriginManager.ts +14 -14
  56. package/front_end/core/sdk/ServerTiming.ts +2 -2
  57. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +15 -15
  58. package/front_end/core/sdk/ServiceWorkerManager.ts +19 -24
  59. package/front_end/core/sdk/SourceMap.ts +10 -10
  60. package/front_end/core/sdk/StorageKeyManager.ts +12 -12
  61. package/front_end/core/sdk/Target.ts +33 -34
  62. package/front_end/core/sdk/TargetManager.ts +20 -20
  63. package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +8 -8
  64. package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +7 -7
  65. package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +7 -7
  66. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +24 -24
  67. package/front_end/entrypoints/main/GlobalAiButton.ts +3 -3
  68. package/front_end/entrypoints/main/MainImpl.ts +16 -14
  69. package/front_end/entrypoints/main/main-meta.ts +1 -2
  70. package/front_end/generated/InspectorBackendCommands.js +3 -2
  71. package/front_end/generated/SupportedCSSProperties.js +20 -0
  72. package/front_end/generated/protocol-mapping.d.ts +4 -0
  73. package/front_end/generated/protocol-proxy-api.d.ts +5 -0
  74. package/front_end/generated/protocol.ts +20 -0
  75. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +18 -35
  76. package/front_end/models/ai_assistance/ai_assistance.ts +1 -1
  77. package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +7 -6
  78. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +246 -119
  79. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +187 -73
  80. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +106 -100
  81. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +20 -27
  82. package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +151 -0
  83. package/front_end/models/badges/AiExplorerBadge.ts +21 -0
  84. package/front_end/models/badges/Badge.ts +10 -9
  85. package/front_end/models/badges/CodeWhispererBadge.ts +21 -0
  86. package/front_end/models/badges/DOMDetectiveBadge.ts +21 -0
  87. package/front_end/models/badges/SpeedsterBadge.ts +7 -2
  88. package/front_end/models/badges/StarterBadge.ts +6 -1
  89. package/front_end/models/badges/UserBadges.ts +61 -9
  90. package/front_end/models/bindings/CSSWorkspaceBinding.ts +6 -6
  91. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +18 -18
  92. package/front_end/models/bindings/FileUtils.ts +15 -15
  93. package/front_end/models/bindings/ResourceScriptMapping.ts +14 -14
  94. package/front_end/models/elements/ElementUpdateRecord.ts +11 -11
  95. package/front_end/models/emulation/DeviceModeModel.ts +123 -131
  96. package/front_end/models/emulation/EmulatedDevices.ts +22 -22
  97. package/front_end/models/extensions/ExtensionPanel.ts +24 -24
  98. package/front_end/models/extensions/ExtensionServer.ts +4 -4
  99. package/front_end/models/javascript_metadata/NativeFunctions.js +14 -2
  100. package/front_end/models/persistence/IsolatedFileSystem.ts +18 -19
  101. package/front_end/models/persistence/IsolatedFileSystemManager.ts +13 -13
  102. package/front_end/models/trace/EventsSerializer.ts +5 -5
  103. package/front_end/models/trace/LanternComputationData.ts +10 -10
  104. package/front_end/models/trace/ModelImpl.ts +32 -54
  105. package/front_end/models/trace/Processor.ts +28 -30
  106. package/front_end/models/trace/extras/FilmStrip.ts +6 -6
  107. package/front_end/models/trace/extras/StackTraceForEvent.ts +22 -25
  108. package/front_end/models/trace/extras/ThirdParties.ts +16 -17
  109. package/front_end/models/trace/extras/TraceFilter.ts +1 -1
  110. package/front_end/models/trace/handlers/Threads.ts +10 -10
  111. package/front_end/models/trace/handlers/helpers.ts +9 -9
  112. package/front_end/models/trace/handlers/types.ts +3 -3
  113. package/front_end/models/trace/insights/CLSCulprits.ts +12 -14
  114. package/front_end/models/trace/insights/Cache.ts +8 -4
  115. package/front_end/models/trace/insights/DOMSize.ts +8 -5
  116. package/front_end/models/trace/insights/DocumentLatency.ts +2 -2
  117. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +3 -3
  118. package/front_end/models/trace/insights/FontDisplay.ts +3 -4
  119. package/front_end/models/trace/insights/ForcedReflow.ts +3 -3
  120. package/front_end/models/trace/insights/INPBreakdown.ts +2 -2
  121. package/front_end/models/trace/insights/ImageDelivery.ts +11 -11
  122. package/front_end/models/trace/insights/LCPBreakdown.ts +4 -4
  123. package/front_end/models/trace/insights/LCPDiscovery.ts +4 -4
  124. package/front_end/models/trace/insights/LegacyJavaScript.ts +2 -2
  125. package/front_end/models/trace/insights/ModernHTTP.ts +4 -5
  126. package/front_end/models/trace/insights/NetworkDependencyTree.ts +12 -12
  127. package/front_end/models/trace/insights/RenderBlocking.ts +9 -10
  128. package/front_end/models/trace/insights/SlowCSSSelector.ts +2 -2
  129. package/front_end/models/trace/insights/ThirdParties.ts +4 -5
  130. package/front_end/models/trace/insights/Viewport.ts +8 -5
  131. package/front_end/models/trace/insights/types.ts +1 -0
  132. package/front_end/models/trace/lantern/testing/MetricTestUtils.ts +10 -10
  133. package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +52 -52
  134. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +8 -8
  135. package/front_end/panels/animation/AnimationTimeline.ts +5 -5
  136. package/front_end/panels/animation/AnimationUI.ts +22 -23
  137. package/front_end/panels/application/ApplicationPanelSidebar.ts +12 -12
  138. package/front_end/panels/application/DOMStorageModel.ts +23 -23
  139. package/front_end/panels/application/ExtensionStorageModel.ts +31 -31
  140. package/front_end/panels/application/IndexedDBModel.ts +1 -0
  141. package/front_end/panels/application/PreloadingTreeElement.ts +8 -8
  142. package/front_end/panels/application/ServiceWorkersView.ts +0 -53
  143. package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +2 -2
  144. package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +2 -2
  145. package/front_end/panels/common/BadgeNotification.ts +140 -10
  146. package/front_end/panels/common/GdpSignUpDialog.ts +5 -0
  147. package/front_end/panels/common/badgeNotification.css +30 -9
  148. package/front_end/panels/console/ConsoleContextSelector.ts +9 -9
  149. package/front_end/panels/console/ConsolePrompt.ts +8 -5
  150. package/front_end/panels/console/ConsoleView.ts +13 -13
  151. package/front_end/panels/console/ConsoleViewport.ts +29 -29
  152. package/front_end/panels/coverage/CoverageModel.ts +22 -22
  153. package/front_end/panels/elements/ClassesPaneWidget.ts +1 -1
  154. package/front_end/panels/elements/ComputedStyleModel.ts +17 -18
  155. package/front_end/panels/elements/DOMPath.ts +2 -2
  156. package/front_end/panels/elements/ElementsPanel.ts +13 -13
  157. package/front_end/panels/elements/ElementsTreeElement.ts +30 -18
  158. package/front_end/panels/elements/ElementsTreeOutline.ts +44 -48
  159. package/front_end/panels/elements/ShortcutTreeElement.ts +4 -4
  160. package/front_end/panels/elements/StylePropertiesSection.ts +7 -4
  161. package/front_end/panels/elements/StylePropertyTreeElement.ts +54 -50
  162. package/front_end/panels/elements/StylesSidebarPane.ts +19 -19
  163. package/front_end/panels/emulation/DeviceModeToolbar.ts +7 -7
  164. package/front_end/panels/emulation/DeviceModeView.ts +6 -6
  165. package/front_end/panels/emulation/MediaQueryInspector.ts +18 -18
  166. package/front_end/panels/event_listeners/EventListenersView.ts +13 -14
  167. package/front_end/panels/layer_viewer/LayerTreeOutline.ts +3 -3
  168. package/front_end/panels/layer_viewer/LayerViewHost.ts +13 -13
  169. package/front_end/panels/layer_viewer/PaintProfilerView.ts +9 -10
  170. package/front_end/panels/layer_viewer/TransformController.ts +34 -36
  171. package/front_end/panels/layers/LayerTreeModel.ts +41 -40
  172. package/front_end/panels/lighthouse/LighthouseReportSelector.ts +13 -13
  173. package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -7
  174. package/front_end/panels/media/PlayerMessagesView.ts +5 -5
  175. package/front_end/panels/media/TickingFlameChart.ts +24 -24
  176. package/front_end/panels/media/TickingFlameChartHelpers.ts +32 -32
  177. package/front_end/panels/network/NetworkItemView.ts +4 -4
  178. package/front_end/panels/network/NetworkLogViewColumns.ts +29 -29
  179. package/front_end/panels/network/NetworkPanel.ts +8 -5
  180. package/front_end/panels/network/ResourceWebSocketFrameView.ts +10 -10
  181. package/front_end/panels/profiler/HeapDetachedElementsView.ts +3 -3
  182. package/front_end/panels/profiler/HeapProfileView.ts +1 -1
  183. package/front_end/panels/profiler/ProfileFlameChartDataProvider.ts +3 -4
  184. package/front_end/panels/profiler/ProfileHeader.ts +25 -25
  185. package/front_end/panels/profiler/ProfileLauncherView.ts +5 -6
  186. package/front_end/panels/recorder/components/ReplaySection.ts +3 -1
  187. package/front_end/panels/security/OriginTreeElement.ts +8 -8
  188. package/front_end/panels/security/SecurityPanel.ts +5 -5
  189. package/front_end/panels/settings/SettingsScreen.ts +18 -18
  190. package/front_end/panels/settings/components/SyncSection.ts +26 -8
  191. package/front_end/panels/sources/AiCodeCompletionPlugin.ts +3 -0
  192. package/front_end/panels/sources/DebuggerPausedMessage.ts +8 -9
  193. package/front_end/panels/sources/NavigatorView.ts +43 -46
  194. package/front_end/panels/sources/SourcesPanel.ts +35 -35
  195. package/front_end/panels/sources/SourcesView.ts +13 -13
  196. package/front_end/panels/sources/TabbedEditorContainer.ts +19 -22
  197. package/front_end/panels/sources/UISourceCodeFrame.ts +4 -4
  198. package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +34 -36
  199. package/front_end/panels/timeline/AnimationsTrackAppender.ts +3 -3
  200. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +8 -8
  201. package/front_end/panels/timeline/CountersGraph.ts +16 -16
  202. package/front_end/panels/timeline/EntriesFilter.ts +4 -3
  203. package/front_end/panels/timeline/EventsTimelineTreeView.ts +3 -3
  204. package/front_end/panels/timeline/GPUTrackAppender.ts +3 -3
  205. package/front_end/panels/timeline/Initiators.ts +10 -10
  206. package/front_end/panels/timeline/InteractionsTrackAppender.ts +5 -5
  207. package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +7 -7
  208. package/front_end/panels/timeline/ModificationsManager.ts +8 -15
  209. package/front_end/panels/timeline/TargetForEvent.ts +2 -2
  210. package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -1
  211. package/front_end/panels/timeline/ThreadAppender.ts +13 -13
  212. package/front_end/panels/timeline/TimelineDetailsView.ts +6 -14
  213. package/front_end/panels/timeline/TimelineEventOverview.ts +27 -26
  214. package/front_end/panels/timeline/TimelineFilters.ts +5 -5
  215. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +54 -53
  216. package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +34 -34
  217. package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -31
  218. package/front_end/panels/timeline/TimelineHistoryManager.ts +17 -18
  219. package/front_end/panels/timeline/TimelineMiniMap.ts +6 -6
  220. package/front_end/panels/timeline/TimelinePaintProfilerView.ts +6 -6
  221. package/front_end/panels/timeline/TimelinePanel.ts +73 -68
  222. package/front_end/panels/timeline/TimelineSelectorStatsView.ts +7 -5
  223. package/front_end/panels/timeline/TimelineTreeView.ts +10 -10
  224. package/front_end/panels/timeline/TimelineUIUtils.ts +47 -46
  225. package/front_end/panels/timeline/TimingsTrackAppender.ts +12 -12
  226. package/front_end/panels/timeline/TracingLayerTree.ts +43 -43
  227. package/front_end/panels/timeline/TrackConfigBanner.ts +6 -6
  228. package/front_end/panels/timeline/TrackConfiguration.ts +1 -1
  229. package/front_end/panels/timeline/components/DetailsView.ts +4 -4
  230. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +12 -21
  231. package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -1
  232. package/front_end/panels/timeline/components/NetworkRequestDetails.ts +5 -5
  233. package/front_end/panels/timeline/components/Sidebar.ts +4 -14
  234. package/front_end/panels/timeline/components/SidebarInsightsTab.ts +13 -36
  235. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +21 -19
  236. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
  237. package/front_end/panels/timeline/components/insights/Cache.ts +4 -0
  238. package/front_end/panels/timeline/components/insights/DOMSize.ts +5 -1
  239. package/front_end/panels/timeline/components/insights/Helpers.ts +19 -0
  240. package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +1 -1
  241. package/front_end/panels/timeline/components/insights/Viewport.ts +4 -0
  242. package/front_end/panels/timeline/overlays/OverlaysImpl.ts +1 -1
  243. package/front_end/panels/timeline/utils/AICallTree.ts +11 -11
  244. package/front_end/panels/timeline/utils/AIContext.ts +17 -19
  245. package/front_end/panels/timeline/utils/EntityMapper.ts +6 -5
  246. package/front_end/panels/timeline/utils/EntryName.ts +2 -2
  247. package/front_end/panels/timeline/utils/EntryNodes.ts +5 -5
  248. package/front_end/panels/timeline/utils/EntryStyles.ts +4 -4
  249. package/front_end/panels/timeline/utils/FreshRecording.ts +3 -3
  250. package/front_end/panels/timeline/utils/Helpers.ts +0 -18
  251. package/front_end/panels/timeline/utils/InsightAIContext.ts +6 -6
  252. package/front_end/panels/timeline/utils/SourceMapsResolver.ts +7 -7
  253. package/front_end/panels/webauthn/WebauthnPane.ts +1 -0
  254. package/front_end/third_party/chromium/README.chromium +1 -1
  255. package/front_end/third_party/codemirror.next/chunk/angular.js +1 -1
  256. package/front_end/third_party/codemirror.next/chunk/angular.js.map +1 -1
  257. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  258. package/front_end/third_party/codemirror.next/chunk/codemirror.js.map +1 -1
  259. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -1
  260. package/front_end/third_party/codemirror.next/chunk/cpp.js.map +1 -1
  261. package/front_end/third_party/codemirror.next/chunk/java.js +1 -1
  262. package/front_end/third_party/codemirror.next/chunk/java.js.map +1 -1
  263. package/front_end/third_party/codemirror.next/chunk/legacy.js +1 -1
  264. package/front_end/third_party/codemirror.next/chunk/legacy.js.map +1 -1
  265. package/front_end/third_party/codemirror.next/chunk/less.js +1 -1
  266. package/front_end/third_party/codemirror.next/chunk/less.js.map +1 -1
  267. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -1
  268. package/front_end/third_party/codemirror.next/chunk/markdown.js.map +1 -1
  269. package/front_end/third_party/codemirror.next/chunk/php.js +1 -1
  270. package/front_end/third_party/codemirror.next/chunk/php.js.map +1 -1
  271. package/front_end/third_party/codemirror.next/chunk/python.js +1 -1
  272. package/front_end/third_party/codemirror.next/chunk/python.js.map +1 -1
  273. package/front_end/third_party/codemirror.next/chunk/sass.js +1 -1
  274. package/front_end/third_party/codemirror.next/chunk/sass.js.map +1 -1
  275. package/front_end/third_party/codemirror.next/chunk/svelte.js +1 -1
  276. package/front_end/third_party/codemirror.next/chunk/svelte.js.map +1 -1
  277. package/front_end/third_party/codemirror.next/chunk/vue.js +1 -1
  278. package/front_end/third_party/codemirror.next/chunk/vue.js.map +1 -1
  279. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -1
  280. package/front_end/third_party/codemirror.next/chunk/wast.js.map +1 -1
  281. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -1
  282. package/front_end/third_party/codemirror.next/chunk/xml.js.map +1 -1
  283. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -1
  284. package/front_end/third_party/codemirror.next/package.json +1 -1
  285. package/front_end/third_party/codemirror.next/rebuild.sh +1 -1
  286. package/front_end/third_party/json5/rebuild.sh +1 -1
  287. package/front_end/third_party/legacy-javascript/{update.sh → rebuild.sh} +1 -1
  288. package/front_end/third_party/lit/lib/decorators.d.ts +26 -9
  289. package/front_end/third_party/lit/lib/decorators.js +5 -5
  290. package/front_end/third_party/lit/lib/decorators.js.map +1 -1
  291. package/front_end/third_party/lit/lib/directive.js.map +1 -1
  292. package/front_end/third_party/lit/lib/directives.js +8 -13
  293. package/front_end/third_party/lit/lib/directives.js.map +1 -1
  294. package/front_end/third_party/lit/lib/lit.d.ts +26 -9
  295. package/front_end/third_party/lit/lib/lit.js +5 -5
  296. package/front_end/third_party/lit/lib/lit.js.map +1 -1
  297. package/front_end/third_party/lit/lib/static-html.js +2 -2
  298. package/front_end/third_party/lit/lib/static-html.js.map +1 -1
  299. package/front_end/third_party/lit/rebuild.sh +1 -1
  300. package/front_end/third_party/third-party-web/rebuild.sh +1 -1
  301. package/front_end/ui/components/dialogs/Dialog.ts +6 -7
  302. package/front_end/ui/legacy/ActionRegistration.ts +9 -9
  303. package/front_end/ui/legacy/DockController.ts +18 -18
  304. package/front_end/ui/legacy/FilterBar.ts +7 -7
  305. package/front_end/ui/legacy/Fragment.ts +4 -4
  306. package/front_end/ui/legacy/GlassPane.ts +12 -12
  307. package/front_end/ui/legacy/InspectorView.ts +5 -15
  308. package/front_end/ui/legacy/ListControl.ts +27 -27
  309. package/front_end/ui/legacy/ListWidget.ts +4 -4
  310. package/front_end/ui/legacy/PopoverHelper.ts +4 -4
  311. package/front_end/ui/legacy/ShortcutRegistry.ts +17 -17
  312. package/front_end/ui/legacy/TabbedPane.ts +74 -75
  313. package/front_end/ui/legacy/TextPrompt.ts +31 -31
  314. package/front_end/ui/legacy/Toolbar.ts +13 -14
  315. package/front_end/ui/legacy/ViewManager.ts +30 -31
  316. package/front_end/ui/legacy/Widget.ts +6 -6
  317. package/front_end/ui/legacy/XLink.ts +9 -9
  318. package/front_end/ui/legacy/ZoomManager.ts +9 -9
  319. package/front_end/ui/legacy/components/color_picker/ContrastDetails.ts +27 -27
  320. package/front_end/ui/legacy/components/color_picker/ContrastInfo.ts +30 -32
  321. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +15 -15
  322. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +64 -64
  323. package/front_end/ui/legacy/components/data_grid/ShowMoreDataGridNode.ts +2 -2
  324. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +10 -11
  325. package/front_end/ui/legacy/components/perf_ui/ChartViewport.ts +12 -12
  326. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -3
  327. package/front_end/ui/legacy/components/perf_ui/TimelineGrid.ts +14 -14
  328. package/front_end/ui/legacy/components/perf_ui/TimelineOverviewPane.ts +8 -8
  329. package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +5 -5
  330. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +4 -4
  331. package/front_end/ui/legacy/filter.css +1 -1
  332. package/front_end/ui/legacy/inspectorCommon.css +1 -1
  333. package/front_end/ui/legacy/softDropDownButton.css +1 -1
  334. package/front_end/ui/legacy/theme_support/ThemeSupport.ts +4 -4
  335. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -2
  336. package/package.json +1 -1
  337. package/front_end/models/ai_assistance/data_formatters/Types.ts +0 -9
@@ -1952,25 +1952,21 @@ export class Nickname extends ShortFormatColorBase {
1952
1952
 
1953
1953
  export class Legacy implements Color {
1954
1954
  readonly #rawParams: Color3D;
1955
- #rgbaInternal: Color4D;
1955
+ #rgba: Color4D;
1956
1956
  readonly #authoredText: string|null;
1957
- #formatInternal: LegacyColor;
1957
+ #format: LegacyColor;
1958
1958
  readonly channels: [ColorChannel, ColorChannel, ColorChannel, ColorChannel] =
1959
1959
  [ColorChannel.R, ColorChannel.G, ColorChannel.B, ColorChannel.ALPHA];
1960
1960
 
1961
1961
  static readonly #conversions: ColorConversions<Legacy> = {
1962
- [Format.HEX]: (self: Legacy) => new Legacy(self.#rgbaInternal, Format.HEX),
1963
- [Format.HEXA]: (self: Legacy) => new Legacy(self.#rgbaInternal, Format.HEXA),
1964
- [Format.RGB]: (self: Legacy) => new Legacy(self.#rgbaInternal, Format.RGB),
1965
- [Format.RGBA]: (self: Legacy) => new Legacy(self.#rgbaInternal, Format.RGBA),
1966
- [Format.HSL]: (self: Legacy) =>
1967
- new HSL(...rgbToHsl([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
1968
- [Format.HSLA]: (self: Legacy) =>
1969
- new HSL(...rgbToHsl([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
1970
- [Format.HWB]: (self: Legacy) =>
1971
- new HWB(...rgbToHwb([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
1972
- [Format.HWBA]: (self: Legacy) =>
1973
- new HWB(...rgbToHwb([self.#rgbaInternal[0], self.#rgbaInternal[1], self.#rgbaInternal[2]]), self.alpha),
1962
+ [Format.HEX]: (self: Legacy) => new Legacy(self.#rgba, Format.HEX),
1963
+ [Format.HEXA]: (self: Legacy) => new Legacy(self.#rgba, Format.HEXA),
1964
+ [Format.RGB]: (self: Legacy) => new Legacy(self.#rgba, Format.RGB),
1965
+ [Format.RGBA]: (self: Legacy) => new Legacy(self.#rgba, Format.RGBA),
1966
+ [Format.HSL]: (self: Legacy) => new HSL(...rgbToHsl([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
1967
+ [Format.HSLA]: (self: Legacy) => new HSL(...rgbToHsl([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
1968
+ [Format.HWB]: (self: Legacy) => new HWB(...rgbToHwb([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
1969
+ [Format.HWBA]: (self: Legacy) => new HWB(...rgbToHwb([self.#rgba[0], self.#rgba[1], self.#rgba[2]]), self.alpha),
1974
1970
  [Format.LCH]: (self: Legacy) =>
1975
1971
  new LCH(...ColorConverter.labToLch(...ColorConverter.xyzd50ToLab(...self.#toXyzd50())), self.alpha),
1976
1972
  [Format.OKLCH]: (self: Legacy) => new Oklch(...ColorConverter.xyzd50ToOklch(...self.#toXyzd50()), self.alpha),
@@ -1997,7 +1993,7 @@ export class Legacy implements Color {
1997
1993
  };
1998
1994
 
1999
1995
  #toXyzd50(): Color3D {
2000
- const [r, g, b] = this.#rgbaInternal;
1996
+ const [r, g, b] = this.#rgba;
2001
1997
  return ColorConverter.srgbToXyzd50(r, g, b);
2002
1998
  }
2003
1999
 
@@ -2005,7 +2001,7 @@ export class Legacy implements Color {
2005
2001
  switch (this.format()) {
2006
2002
  case Format.HEXA:
2007
2003
  case Format.RGBA:
2008
- return this.#rgbaInternal[3];
2004
+ return this.#rgba[3];
2009
2005
  default:
2010
2006
  return null;
2011
2007
  }
@@ -2022,7 +2018,7 @@ export class Legacy implements Color {
2022
2018
 
2023
2019
  shortHex(): ShortHex|null {
2024
2020
  for (let i = 0; i < 4; ++i) {
2025
- const c = Math.round(this.#rgbaInternal[i] * 255);
2021
+ const c = Math.round(this.#rgba[i] * 255);
2026
2022
  // Check if the two digits of each are identical: #aabbcc => #abc
2027
2023
  if (c % 0x11) {
2028
2024
  return null;
@@ -2033,10 +2029,10 @@ export class Legacy implements Color {
2033
2029
 
2034
2030
  constructor(rgba: Color3D|Color4DOr3D, format: LegacyColor, authoredText?: string) {
2035
2031
  this.#authoredText = authoredText || null;
2036
- this.#formatInternal = format;
2032
+ this.#format = format;
2037
2033
  this.#rawParams = [rgba[0], rgba[1], rgba[2]];
2038
2034
 
2039
- this.#rgbaInternal = [
2035
+ this.#rgba = [
2040
2036
  clamp(rgba[0], {min: 0, max: 1}),
2041
2037
  clamp(rgba[1], {min: 0, max: 1}),
2042
2038
  clamp(rgba[2], {min: 0, max: 1}),
@@ -2099,11 +2095,11 @@ export class Legacy implements Color {
2099
2095
  }
2100
2096
 
2101
2097
  format(): LegacyColor {
2102
- return this.#formatInternal;
2098
+ return this.#format;
2103
2099
  }
2104
2100
 
2105
2101
  hasAlpha(): boolean {
2106
- return this.#rgbaInternal[3] !== 1;
2102
+ return this.#rgba[3] !== 1;
2107
2103
  }
2108
2104
 
2109
2105
  detectHEXFormat(): Format {
@@ -2115,11 +2111,11 @@ export class Legacy implements Color {
2115
2111
  if (format) {
2116
2112
  return this.as(format).asString();
2117
2113
  }
2118
- return this.#stringify(format, this.#rgbaInternal[0], this.#rgbaInternal[1], this.#rgbaInternal[2]);
2114
+ return this.#stringify(format, this.#rgba[0], this.#rgba[1], this.#rgba[2]);
2119
2115
  }
2120
2116
  #stringify(format: LegacyColor|undefined, r: number, g: number, b: number): string {
2121
2117
  if (!format) {
2122
- format = this.#formatInternal;
2118
+ format = this.#format;
2123
2119
  }
2124
2120
 
2125
2121
  function toHexValue(value: number): string {
@@ -2132,7 +2128,7 @@ export class Legacy implements Color {
2132
2128
  case Format.RGBA: {
2133
2129
  const start = Platform.StringUtilities.sprintf('rgb(%d %d %d', toRgbValue(r), toRgbValue(g), toRgbValue(b));
2134
2130
  if (this.hasAlpha()) {
2135
- return start + Platform.StringUtilities.sprintf(' / %d%)', Math.round(this.#rgbaInternal[3] * 100));
2131
+ return start + Platform.StringUtilities.sprintf(' / %d%)', Math.round(this.#rgba[3] * 100));
2136
2132
  }
2137
2133
  return start + ')';
2138
2134
  }
@@ -2140,7 +2136,7 @@ export class Legacy implements Color {
2140
2136
  case Format.HEXA: {
2141
2137
  if (this.hasAlpha()) {
2142
2138
  return Platform.StringUtilities
2143
- .sprintf('#%s%s%s%s', toHexValue(r), toHexValue(g), toHexValue(b), toHexValue(this.#rgbaInternal[3]))
2139
+ .sprintf('#%s%s%s%s', toHexValue(r), toHexValue(g), toHexValue(b), toHexValue(this.#rgba[3]))
2144
2140
  .toLowerCase();
2145
2141
  }
2146
2142
  return Platform.StringUtilities.sprintf('#%s%s%s', toHexValue(r), toHexValue(g), toHexValue(b)).toLowerCase();
@@ -2162,20 +2158,20 @@ export class Legacy implements Color {
2162
2158
  }
2163
2159
  isGamutClipped(): boolean {
2164
2160
  return !equals(
2165
- this.#rawParams.map(toRgbValue),
2166
- [this.#rgbaInternal[0], this.#rgbaInternal[1], this.#rgbaInternal[2]].map(toRgbValue), WIDE_RANGE_EPSILON);
2161
+ this.#rawParams.map(toRgbValue), [this.#rgba[0], this.#rgba[1], this.#rgba[2]].map(toRgbValue),
2162
+ WIDE_RANGE_EPSILON);
2167
2163
  }
2168
2164
 
2169
2165
  rgba(): Color4D {
2170
- return [...this.#rgbaInternal];
2166
+ return [...this.#rgba];
2171
2167
  }
2172
2168
 
2173
2169
  canonicalRGBA(): Color4D {
2174
2170
  const rgba = new Array(4);
2175
2171
  for (let i = 0; i < 3; ++i) {
2176
- rgba[i] = Math.round(this.#rgbaInternal[i] * 255);
2172
+ rgba[i] = Math.round(this.#rgba[i] * 255);
2177
2173
  }
2178
- rgba[3] = this.#rgbaInternal[3];
2174
+ rgba[3] = this.#rgba[3];
2179
2175
  return rgba as Color4D;
2180
2176
  }
2181
2177
 
@@ -2200,10 +2196,10 @@ export class Legacy implements Color {
2200
2196
 
2201
2197
  invert(): Legacy {
2202
2198
  const rgba: Color4D = [0, 0, 0, 0];
2203
- rgba[0] = 1 - this.#rgbaInternal[0];
2204
- rgba[1] = 1 - this.#rgbaInternal[1];
2205
- rgba[2] = 1 - this.#rgbaInternal[2];
2206
- rgba[3] = this.#rgbaInternal[3];
2199
+ rgba[0] = 1 - this.#rgba[0];
2200
+ rgba[1] = 1 - this.#rgba[1];
2201
+ rgba[2] = 1 - this.#rgba[2];
2202
+ rgba[3] = this.#rgba[3];
2207
2203
  return new Legacy(rgba, Format.RGBA);
2208
2204
  }
2209
2205
 
@@ -2212,38 +2208,38 @@ export class Legacy implements Color {
2212
2208
  * Note: We override with an alpha of 50% to enhance the dimming effect.
2213
2209
  */
2214
2210
  grayscale(): Legacy {
2215
- const [r, g, b] = this.#rgbaInternal;
2211
+ const [r, g, b] = this.#rgba;
2216
2212
  const gray = r * 0.299 + g * 0.587 + b * 0.114;
2217
2213
  return new Legacy([gray, gray, gray, 0.5], Format.RGBA);
2218
2214
  }
2219
2215
 
2220
2216
  setAlpha(alpha: number): Legacy {
2221
- const rgba: Color4D = [...this.#rgbaInternal];
2217
+ const rgba: Color4D = [...this.#rgba];
2222
2218
  rgba[3] = alpha;
2223
2219
  return new Legacy(rgba, Format.RGBA);
2224
2220
  }
2225
2221
 
2226
2222
  blendWith(fgColor: Legacy): Legacy {
2227
- const rgba: Color4D = blendColors(fgColor.#rgbaInternal, this.#rgbaInternal);
2223
+ const rgba: Color4D = blendColors(fgColor.#rgba, this.#rgba);
2228
2224
  return new Legacy(rgba, Format.RGBA);
2229
2225
  }
2230
2226
 
2231
2227
  blendWithAlpha(alpha: number): Legacy {
2232
- const rgba: Color4D = [...this.#rgbaInternal];
2228
+ const rgba: Color4D = [...this.#rgba];
2233
2229
  rgba[3] *= alpha;
2234
2230
  return new Legacy(rgba, Format.RGBA);
2235
2231
  }
2236
2232
 
2237
2233
  setFormat(format: LegacyColor): void {
2238
- this.#formatInternal = format;
2234
+ this.#format = format;
2239
2235
  }
2240
2236
 
2241
2237
  equal(other: Color): boolean {
2242
- const legacy = other.as(this.#formatInternal);
2243
- return equals(toRgbValue(this.#rgbaInternal[0]), toRgbValue(legacy.#rgbaInternal[0]), WIDE_RANGE_EPSILON) &&
2244
- equals(toRgbValue(this.#rgbaInternal[1]), toRgbValue(legacy.#rgbaInternal[1]), WIDE_RANGE_EPSILON) &&
2245
- equals(toRgbValue(this.#rgbaInternal[2]), toRgbValue(legacy.#rgbaInternal[2]), WIDE_RANGE_EPSILON) &&
2246
- equals(this.#rgbaInternal[3], legacy.#rgbaInternal[3]);
2238
+ const legacy = other.as(this.#format);
2239
+ return equals(toRgbValue(this.#rgba[0]), toRgbValue(legacy.#rgba[0]), WIDE_RANGE_EPSILON) &&
2240
+ equals(toRgbValue(this.#rgba[1]), toRgbValue(legacy.#rgba[1]), WIDE_RANGE_EPSILON) &&
2241
+ equals(toRgbValue(this.#rgba[2]), toRgbValue(legacy.#rgba[2]), WIDE_RANGE_EPSILON) &&
2242
+ equals(this.#rgba[3], legacy.#rgba[3]);
2247
2243
  }
2248
2244
  }
2249
2245
 
@@ -8,13 +8,13 @@ import {reveal} from './Revealer.js';
8
8
  let consoleInstance: Console|undefined;
9
9
 
10
10
  export class Console extends ObjectWrapper<EventTypes> {
11
- readonly #messagesInternal: Message[];
11
+ readonly #messages: Message[];
12
12
  /**
13
13
  * Instantiable via the instance() factory below.
14
14
  */
15
15
  constructor() {
16
16
  super();
17
- this.#messagesInternal = [];
17
+ this.#messages = [];
18
18
  }
19
19
 
20
20
  static instance(opts?: {forceNew: boolean}): Console {
@@ -39,7 +39,7 @@ export class Console extends ObjectWrapper<EventTypes> {
39
39
  */
40
40
  addMessage(text: string, level = MessageLevel.INFO, show = false, source?: FrontendMessageSource): void {
41
41
  const message = new Message(text, level, Date.now(), show, source);
42
- this.#messagesInternal.push(message);
42
+ this.#messages.push(message);
43
43
  this.dispatchEventToListeners(Events.MESSAGE_ADDED, message);
44
44
  }
45
45
 
@@ -62,7 +62,7 @@ export class Console extends ObjectWrapper<EventTypes> {
62
62
  }
63
63
 
64
64
  messages(): Message[] {
65
- return this.#messagesInternal;
65
+ return this.#messages;
66
66
  }
67
67
 
68
68
  show(): void {
@@ -95,8 +95,8 @@ export class ParsedURL {
95
95
  folderPathComponents: string;
96
96
  lastPathComponent: string;
97
97
  readonly blobInnerScheme: string|undefined;
98
- #displayNameInternal?: string;
99
- #dataURLDisplayNameInternal?: string;
98
+ #displayName?: string;
99
+ #dataURLDisplayName?: string;
100
100
 
101
101
  constructor(url: string) {
102
102
  this.isValid = false;
@@ -494,8 +494,8 @@ export class ParsedURL {
494
494
  }
495
495
 
496
496
  get displayName(): string {
497
- if (this.#displayNameInternal) {
498
- return this.#displayNameInternal;
497
+ if (this.#displayName) {
498
+ return this.#displayName;
499
499
  }
500
500
 
501
501
  if (this.isDataURL()) {
@@ -508,25 +508,25 @@ export class ParsedURL {
508
508
  return this.url;
509
509
  }
510
510
 
511
- this.#displayNameInternal = this.lastPathComponent;
512
- if (!this.#displayNameInternal) {
513
- this.#displayNameInternal = (this.host || '') + '/';
511
+ this.#displayName = this.lastPathComponent;
512
+ if (!this.#displayName) {
513
+ this.#displayName = (this.host || '') + '/';
514
514
  }
515
- if (this.#displayNameInternal === '/') {
516
- this.#displayNameInternal = this.url;
515
+ if (this.#displayName === '/') {
516
+ this.#displayName = this.url;
517
517
  }
518
- return this.#displayNameInternal;
518
+ return this.#displayName;
519
519
  }
520
520
 
521
521
  dataURLDisplayName(): string {
522
- if (this.#dataURLDisplayNameInternal) {
523
- return this.#dataURLDisplayNameInternal;
522
+ if (this.#dataURLDisplayName) {
523
+ return this.#dataURLDisplayName;
524
524
  }
525
525
  if (!this.isDataURL()) {
526
526
  return '';
527
527
  }
528
- this.#dataURLDisplayNameInternal = Platform.StringUtilities.trimEndWithMaxLength(this.url, 20);
529
- return this.#dataURLDisplayNameInternal;
528
+ this.#dataURLDisplayName = Platform.StringUtilities.trimEndWithMaxLength(this.url, 20);
529
+ return this.#dataURLDisplayName;
530
530
  }
531
531
 
532
532
  isAboutBlank(): boolean {
@@ -159,17 +159,17 @@ const str_ = i18n.i18n.registerUIStrings('core/common/ResourceType.ts', UIString
159
159
  const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
160
160
 
161
161
  export class ResourceType {
162
- readonly #nameInternal: string;
163
- readonly #titleInternal: () => Platform.UIString.LocalizedString;
164
- readonly #categoryInternal: ResourceCategory;
165
- readonly #isTextTypeInternal: boolean;
162
+ readonly #name: string;
163
+ readonly #title: () => Platform.UIString.LocalizedString;
164
+ readonly #category: ResourceCategory;
165
+ readonly #isTextType: boolean;
166
166
 
167
167
  constructor(
168
168
  name: string, title: () => Platform.UIString.LocalizedString, category: ResourceCategory, isTextType: boolean) {
169
- this.#nameInternal = name;
170
- this.#titleInternal = title;
171
- this.#categoryInternal = category;
172
- this.#isTextTypeInternal = isTextType;
169
+ this.#name = name;
170
+ this.#title = title;
171
+ this.#category = category;
172
+ this.#isTextType = isTextType;
173
173
  }
174
174
 
175
175
  static fromMimeType(mimeType: string|null): ResourceType {
@@ -286,23 +286,23 @@ export class ResourceType {
286
286
  }
287
287
 
288
288
  name(): string {
289
- return this.#nameInternal;
289
+ return this.#name;
290
290
  }
291
291
 
292
292
  title(): string {
293
- return this.#titleInternal();
293
+ return this.#title();
294
294
  }
295
295
 
296
296
  category(): ResourceCategory {
297
- return this.#categoryInternal;
297
+ return this.#category;
298
298
  }
299
299
 
300
300
  isTextType(): boolean {
301
- return this.#isTextTypeInternal;
301
+ return this.#isTextType;
302
302
  }
303
303
 
304
304
  isScript(): boolean {
305
- return this.#nameInternal === 'script' || this.#nameInternal === 'sm-script';
305
+ return this.#name === 'script' || this.#name === 'sm-script';
306
306
  }
307
307
 
308
308
  hasScripts(): boolean {
@@ -310,7 +310,7 @@ export class ResourceType {
310
310
  }
311
311
 
312
312
  isStyleSheet(): boolean {
313
- return this.#nameInternal === 'stylesheet' || this.#nameInternal === 'sm-stylesheet';
313
+ return this.#name === 'stylesheet' || this.#name === 'sm-stylesheet';
314
314
  }
315
315
 
316
316
  hasStyleSheets(): boolean {
@@ -318,7 +318,7 @@ export class ResourceType {
318
318
  }
319
319
 
320
320
  isDocument(): boolean {
321
- return this.#nameInternal === 'document';
321
+ return this.#name === 'document';
322
322
  }
323
323
 
324
324
  isDocumentOrScriptOrStyleSheet(): boolean {
@@ -326,23 +326,23 @@ export class ResourceType {
326
326
  }
327
327
 
328
328
  isFont(): boolean {
329
- return this.#nameInternal === 'font';
329
+ return this.#name === 'font';
330
330
  }
331
331
 
332
332
  isImage(): boolean {
333
- return this.#nameInternal === 'image';
333
+ return this.#name === 'image';
334
334
  }
335
335
 
336
336
  isFromSourceMap(): boolean {
337
- return this.#nameInternal.startsWith('sm-');
337
+ return this.#name.startsWith('sm-');
338
338
  }
339
339
 
340
340
  isWebbundle(): boolean {
341
- return this.#nameInternal === 'webbundle';
341
+ return this.#name === 'webbundle';
342
342
  }
343
343
 
344
344
  toString(): string {
345
- return this.#nameInternal;
345
+ return this.#name;
346
346
  }
347
347
 
348
348
  canonicalMimeType(): string {
@@ -24,56 +24,55 @@ export class Segment<T> {
24
24
  }
25
25
 
26
26
  export class SegmentedRange<T> {
27
- #segmentsInternal: Array<Segment<T>>;
27
+ #segments: Array<Segment<T>>;
28
28
  readonly #mergeCallback: ((arg0: Segment<T>, arg1: Segment<T>) => Segment<T>| null)|undefined;
29
29
 
30
30
  constructor(mergeCallback?: ((arg0: Segment<T>, arg1: Segment<T>) => Segment<T>| null)) {
31
- this.#segmentsInternal = [];
31
+ this.#segments = [];
32
32
  this.#mergeCallback = mergeCallback;
33
33
  }
34
34
 
35
35
  append(newSegment: Segment<T>): void {
36
36
  // 1. Find the proper insertion point for new segment
37
- let startIndex =
38
- Platform.ArrayUtilities.lowerBound(this.#segmentsInternal, newSegment, (a, b) => a.begin - b.begin);
37
+ let startIndex = Platform.ArrayUtilities.lowerBound(this.#segments, newSegment, (a, b) => a.begin - b.begin);
39
38
  let endIndex = startIndex;
40
39
  let merged: (Segment<T>|null)|null = null;
41
40
  if (startIndex > 0) {
42
41
  // 2. Try mering the preceding segment
43
- const precedingSegment = this.#segmentsInternal[startIndex - 1];
42
+ const precedingSegment = this.#segments[startIndex - 1];
44
43
  merged = this.tryMerge(precedingSegment, newSegment);
45
44
  if (merged) {
46
45
  --startIndex;
47
46
  newSegment = merged;
48
- } else if (this.#segmentsInternal[startIndex - 1].end >= newSegment.begin) {
47
+ } else if (this.#segments[startIndex - 1].end >= newSegment.begin) {
49
48
  // 2a. If merge failed and segments overlap, adjust preceding segment.
50
49
  // If an old segment entirely contains new one, split it in two.
51
50
  if (newSegment.end < precedingSegment.end) {
52
- this.#segmentsInternal.splice(
51
+ this.#segments.splice(
53
52
  startIndex, 0, new Segment<T>(newSegment.end, precedingSegment.end, precedingSegment.data));
54
53
  }
55
54
  precedingSegment.end = newSegment.begin;
56
55
  }
57
56
  }
58
57
  // 3. Consume all segments that are entirely covered by the new one.
59
- while (endIndex < this.#segmentsInternal.length && this.#segmentsInternal[endIndex].end <= newSegment.end) {
58
+ while (endIndex < this.#segments.length && this.#segments[endIndex].end <= newSegment.end) {
60
59
  ++endIndex;
61
60
  }
62
61
  // 4. Merge or adjust the succeeding segment if it overlaps.
63
- if (endIndex < this.#segmentsInternal.length) {
64
- merged = this.tryMerge(newSegment, this.#segmentsInternal[endIndex]);
62
+ if (endIndex < this.#segments.length) {
63
+ merged = this.tryMerge(newSegment, this.#segments[endIndex]);
65
64
  if (merged) {
66
65
  endIndex++;
67
66
  newSegment = merged;
68
- } else if (newSegment.intersects(this.#segmentsInternal[endIndex])) {
69
- this.#segmentsInternal[endIndex].begin = newSegment.end;
67
+ } else if (newSegment.intersects(this.#segments[endIndex])) {
68
+ this.#segments[endIndex].begin = newSegment.end;
70
69
  }
71
70
  }
72
- this.#segmentsInternal.splice(startIndex, endIndex - startIndex, newSegment);
71
+ this.#segments.splice(startIndex, endIndex - startIndex, newSegment);
73
72
  }
74
73
 
75
74
  segments(): Array<Segment<T>> {
76
- return this.#segmentsInternal;
75
+ return this.#segments;
77
76
  }
78
77
 
79
78
  private tryMerge(first: Segment<T>, second: Segment<T>): Segment<T>|null {
@@ -354,7 +354,7 @@ export class Deprecation {
354
354
 
355
355
  export class Setting<V> {
356
356
  #titleFunction?: () => Platform.UIString.LocalizedString;
357
- #titleInternal!: Platform.UIString.LocalizedString;
357
+ #title!: Platform.UIString.LocalizedString;
358
358
  #registration: SettingRegistration|null = null;
359
359
  #requiresUserAction?: boolean;
360
360
  #value?: V;
@@ -387,8 +387,8 @@ export class Setting<V> {
387
387
  }
388
388
 
389
389
  title(): Platform.UIString.LocalizedString {
390
- if (this.#titleInternal) {
391
- return this.#titleInternal;
390
+ if (this.#title) {
391
+ return this.#title;
392
392
  }
393
393
  if (this.#titleFunction) {
394
394
  return this.#titleFunction();
@@ -403,7 +403,7 @@ export class Setting<V> {
403
403
  }
404
404
 
405
405
  setTitle(title: Platform.UIString.LocalizedString): void {
406
- this.#titleInternal = title;
406
+ this.#title = title;
407
407
  }
408
408
 
409
409
  setRequiresUserAction(requiresUserAction: boolean): void {
@@ -8,19 +8,19 @@ export interface OutputStream {
8
8
  }
9
9
 
10
10
  export class StringOutputStream implements OutputStream {
11
- #dataInternal: string;
11
+ #data: string;
12
12
  constructor() {
13
- this.#dataInternal = '';
13
+ this.#data = '';
14
14
  }
15
15
 
16
16
  async write(chunk: string): Promise<void> {
17
- this.#dataInternal += chunk;
17
+ this.#data += chunk;
18
18
  }
19
19
 
20
20
  async close(): Promise<void> {
21
21
  }
22
22
 
23
23
  data(): string {
24
- return this.#dataInternal;
24
+ return this.#data;
25
25
  }
26
26
  }
@@ -37,6 +37,25 @@ interface CheckElibigilityResponse {
37
37
  createProfile: EligibilityStatus;
38
38
  }
39
39
 
40
+ interface BatchGetAwardsResponse {
41
+ awards?: Award[];
42
+ }
43
+
44
+ export interface Award {
45
+ name: string;
46
+ badge: {
47
+ title: string,
48
+ description: string,
49
+ imageUri: string,
50
+ deletableByUser: boolean,
51
+ };
52
+ title: string;
53
+ description: string;
54
+ imageUri: string;
55
+ createTime: string;
56
+ awardingUri: string;
57
+ }
58
+
40
59
  export interface Profile {
41
60
  // Resource name of the profile.
42
61
  // Format: profiles/{obfuscated_profile_id}
@@ -49,6 +68,18 @@ export interface Profile {
49
68
  };
50
69
  }
51
70
 
71
+ // The `batchGet` awards endpoint returns badge names with an
72
+ // obfuscated user ID (e.g., `profiles/12345/awards/badge-name`).
73
+ // This function normalizes them to use `me` instead of the ID
74
+ // (e.g., `profiles/me/awards/badge-path`) to match the format
75
+ // used for client-side requests.
76
+ function normalizeBadgeName(name: string): string {
77
+ return name.replace(/profiles\/[^/]+\/awards\//, 'profiles/me/awards/');
78
+ }
79
+
80
+ // TODO(crbug.com/441679275): Update once the API is enabled for prod.
81
+ export const GOOGLE_DEVELOPER_PROGRAM_PROFILE_LINK = 'https://developers.devsite.corp.google.com/profile/u/me';
82
+
52
83
  async function makeHttpRequest<R extends object>(request: DispatchHttpRequestRequest): Promise<R|null> {
53
84
  if (!Root.Runtime.hostConfig.devToolsGdpProfiles?.enabled) {
54
85
  return null;
@@ -113,18 +144,61 @@ export class GdpClient {
113
144
  return await this.#cachedEligibilityPromise;
114
145
  }
115
146
 
147
+ /**
148
+ * @returns null if the request fails, the awarded badge names otherwise.
149
+ */
150
+ async getAwardedBadgeNames({names}: {names: string[]}): Promise<Set<string>|null> {
151
+ const result = await makeHttpRequest<BatchGetAwardsResponse>({
152
+ service: SERVICE_NAME,
153
+ path: '/v1beta1/profiles/me/awards:batchGet',
154
+ method: 'GET',
155
+ queryParams: {
156
+ allowMissing: 'true',
157
+ names,
158
+ }
159
+ });
160
+
161
+ if (!result) {
162
+ return null;
163
+ }
164
+
165
+ return new Set(result.awards?.map(award => normalizeBadgeName(award.name)) ?? []);
166
+ }
167
+
116
168
  async isEligibleToCreateProfile(): Promise<boolean> {
117
169
  return (await this.checkEligibility())?.createProfile === EligibilityStatus.ELIGIBLE;
118
170
  }
119
171
 
120
- createProfile({user, emailPreference}: {user: string, emailPreference: EmailPreference}): Promise<Profile|null> {
121
- return makeHttpRequest({
172
+ async createProfile({user, emailPreference}: {user: string, emailPreference: EmailPreference}):
173
+ Promise<Profile|null> {
174
+ const result = await makeHttpRequest<Profile>({
122
175
  service: SERVICE_NAME,
123
176
  path: '/v1beta1/profiles',
124
177
  method: 'POST',
125
178
  body: JSON.stringify({
126
179
  user,
127
180
  newsletter_email: emailPreference,
181
+ }),
182
+ });
183
+ if (result) {
184
+ this.#clearCache();
185
+ }
186
+ return result;
187
+ }
188
+
189
+ #clearCache(): void {
190
+ this.#cachedProfilePromise = undefined;
191
+ this.#cachedEligibilityPromise = undefined;
192
+ }
193
+
194
+ createAward({name}: {name: string}): Promise<Award|null> {
195
+ return makeHttpRequest({
196
+ service: SERVICE_NAME,
197
+ path: '/v1beta1/profiles/me/awards',
198
+ method: 'POST',
199
+ body: JSON.stringify({
200
+ awardingUri: 'devtools://devtools',
201
+ name,
128
202
  })
129
203
  });
130
204
  }
@@ -423,7 +423,10 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
423
423
  },
424
424
  devToolsIpProtectionPanelInDevTools: {
425
425
  enabled: false,
426
- }
426
+ },
427
+ devToolsFlexibleLayout: {
428
+ verticalDrawerEnabled: true,
429
+ },
427
430
  };
428
431
  if ('hostConfigForTesting' in globalThis) {
429
432
  const {hostConfigForTesting} = (globalThis as unknown as {hostConfigForTesting: Root.Runtime.HostConfig});
@@ -257,11 +257,13 @@ export type DispatchHttpRequestRequest = {
257
257
  service: string,
258
258
  path: string,
259
259
  method: 'GET',
260
+ queryParams?: Record<string, string|string[]>,
260
261
  body?: never,
261
262
  }|{
262
263
  service: string,
263
264
  path: string,
264
265
  method: 'POST',
266
+ queryParams?: Record<string, string|string[]>,
265
267
  // A JSON string containing the request body.
266
268
  body?: string,
267
269
  };