@browserless.io/browserless 2.2.0-beta-8 → 2.2.0

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 (1316) hide show
  1. package/CHANGELOG.md +21 -2
  2. package/bin/browserless.js +1 -1
  3. package/bin/scaffold/README.md +8 -7
  4. package/build/browserless.js +7 -6
  5. package/build/browsers/chrome.cdp.d.ts +6 -0
  6. package/build/browsers/chrome.cdp.js +6 -0
  7. package/build/browsers/chrome.playwright.d.ts +6 -0
  8. package/build/browsers/chrome.playwright.js +6 -0
  9. package/build/browsers/{cdp-chromium.d.ts → chromium.cdp.d.ts} +3 -2
  10. package/build/browsers/{cdp-chromium.js → chromium.cdp.js} +16 -10
  11. package/build/browsers/{playwright-chromium.d.ts → chromium.playwright.d.ts} +3 -2
  12. package/build/browsers/{playwright-chromium.js → chromium.playwright.js} +6 -5
  13. package/build/browsers/{playwright-firefox.d.ts → firefox.playwright.d.ts} +2 -2
  14. package/build/browsers/{playwright-firefox.js → firefox.playwright.js} +4 -4
  15. package/build/browsers/index.d.ts +20 -10
  16. package/build/browsers/index.js +110 -11
  17. package/build/browsers/{playwright-webkit.d.ts → webkit.playwright.d.ts} +2 -2
  18. package/build/browsers/{playwright-webkit.js → webkit.playwright.js} +4 -4
  19. package/build/data/selectors.json +1 -1
  20. package/build/exports.d.ts +6 -4
  21. package/build/exports.js +6 -4
  22. package/build/hooks.d.ts +4 -5
  23. package/build/hooks.js +4 -6
  24. package/build/http.d.ts +22 -1
  25. package/build/http.js +21 -0
  26. package/build/router.js +19 -3
  27. package/build/routes/{chromium/http/content-post.body.json → chrome/http/content.post.body.json} +8 -8
  28. package/build/routes/chrome/http/content.post.d.ts +7 -0
  29. package/build/routes/chrome/http/content.post.js +6 -0
  30. package/build/routes/chrome/http/download.post.d.ts +7 -0
  31. package/build/routes/chrome/http/download.post.js +6 -0
  32. package/build/routes/chrome/http/function.post.d.ts +7 -0
  33. package/build/routes/chrome/http/function.post.js +6 -0
  34. package/build/routes/chrome/http/json-list.get.d.ts +1 -0
  35. package/build/routes/chrome/http/json-list.get.js +1 -0
  36. package/build/routes/chrome/http/json-new.put.d.ts +1 -0
  37. package/build/routes/chrome/http/json-new.put.js +1 -0
  38. package/build/routes/chrome/http/json-protocol.get.d.ts +1 -0
  39. package/build/routes/chrome/http/json-protocol.get.js +1 -0
  40. package/build/routes/chrome/http/json-version.get.d.ts +1 -0
  41. package/build/routes/chrome/http/json-version.get.js +1 -0
  42. package/build/routes/chrome/http/json-version.get.response.json +44 -0
  43. package/build/routes/{chromium/http/pdf-post.body.json → chrome/http/pdf.post.body.json} +8 -8
  44. package/build/routes/chrome/http/pdf.post.d.ts +7 -0
  45. package/build/routes/chrome/http/pdf.post.js +6 -0
  46. package/build/routes/chrome/http/performance.post.d.ts +7 -0
  47. package/build/routes/chrome/http/performance.post.js +6 -0
  48. package/build/routes/{chromium/http/scrape-post.body.json → chrome/http/scrape.post.body.json} +8 -8
  49. package/build/routes/chrome/http/scrape.post.d.ts +7 -0
  50. package/build/routes/chrome/http/scrape.post.js +6 -0
  51. package/build/routes/{chromium/http/screenshot-post.body.json → chrome/http/screenshot.post.body.json} +8 -8
  52. package/build/routes/chrome/http/screenshot.post.d.ts +7 -0
  53. package/build/routes/chrome/http/screenshot.post.js +6 -0
  54. package/build/routes/chrome/tests/content.spec.js +311 -0
  55. package/build/routes/chrome/tests/download.spec.js +67 -0
  56. package/build/routes/chrome/tests/function.spec.d.ts +1 -0
  57. package/build/routes/chrome/tests/function.spec.js +245 -0
  58. package/build/routes/chrome/tests/json-version.spec.d.ts +1 -0
  59. package/build/routes/chrome/tests/json-version.spec.js +37 -0
  60. package/build/routes/chrome/tests/page-websocket.spec.d.ts +1 -0
  61. package/build/routes/chrome/tests/page-websocket.spec.js +97 -0
  62. package/build/routes/chrome/tests/pdf.spec.d.ts +1 -0
  63. package/build/routes/chrome/tests/pdf.spec.js +333 -0
  64. package/build/routes/chrome/tests/performance.spec.d.ts +1 -0
  65. package/build/routes/chrome/tests/performance.spec.js +124 -0
  66. package/build/routes/chrome/tests/scrape.spec.d.ts +1 -0
  67. package/build/routes/chrome/tests/scrape.spec.js +354 -0
  68. package/build/routes/chrome/tests/screenshot.spec.d.ts +1 -0
  69. package/build/routes/chrome/tests/screenshot.spec.js +339 -0
  70. package/build/routes/chrome/tests/websocket.spec.d.ts +1 -0
  71. package/build/routes/chrome/tests/websocket.spec.js +371 -0
  72. package/build/routes/chrome/ws/browser.d.ts +6 -0
  73. package/build/routes/chrome/ws/browser.js +5 -0
  74. package/build/routes/chrome/ws/cdp.d.ts +7 -0
  75. package/build/routes/chrome/ws/cdp.js +6 -0
  76. package/build/routes/chrome/ws/cdp.query.json +120 -0
  77. package/build/routes/chrome/ws/page.d.ts +6 -0
  78. package/build/routes/chrome/ws/page.js +5 -0
  79. package/build/routes/chrome/ws/page.query.json +120 -0
  80. package/build/routes/chrome/ws/playwright.d.ts +7 -0
  81. package/build/routes/chrome/ws/playwright.js +6 -0
  82. package/build/routes/chromium/http/content.post.body.json +510 -0
  83. package/build/routes/chromium/http/content.post.d.ts +1 -0
  84. package/build/routes/chromium/http/content.post.js +1 -0
  85. package/build/routes/chromium/http/content.post.query.json +183 -0
  86. package/build/routes/chromium/http/content.post.response.json +5 -0
  87. package/build/routes/chromium/http/download.post.body.json +32 -0
  88. package/build/routes/chromium/http/download.post.d.ts +1 -0
  89. package/build/routes/chromium/http/download.post.js +1 -0
  90. package/build/routes/chromium/http/download.post.query.json +120 -0
  91. package/build/routes/chromium/http/download.post.response.json +4 -0
  92. package/build/routes/chromium/http/function.post.body.json +32 -0
  93. package/build/routes/chromium/http/function.post.d.ts +1 -0
  94. package/build/routes/chromium/http/function.post.js +1 -0
  95. package/build/routes/chromium/http/function.post.query.json +120 -0
  96. package/build/routes/chromium/http/function.post.response.json +4 -0
  97. package/build/routes/chromium/http/json-list.get.d.ts +1 -0
  98. package/build/routes/chromium/http/json-list.get.js +1 -0
  99. package/build/routes/chromium/http/json-list.get.response.json +52 -0
  100. package/build/routes/chromium/http/json-new.put.d.ts +1 -0
  101. package/build/routes/chromium/http/json-new.put.js +1 -0
  102. package/build/routes/chromium/http/json-new.put.response.json +44 -0
  103. package/build/routes/chromium/http/json-protocol.get.d.ts +1 -0
  104. package/build/routes/chromium/http/json-protocol.get.js +1 -0
  105. package/build/routes/chromium/http/json-protocol.get.response.json +6 -0
  106. package/build/routes/chromium/http/json-version.get.d.ts +1 -0
  107. package/build/routes/chromium/http/json-version.get.js +1 -0
  108. package/build/routes/chromium/http/json-version.get.response.json +44 -0
  109. package/build/routes/chromium/http/pdf.post.body.json +654 -0
  110. package/build/routes/chromium/http/pdf.post.d.ts +1 -0
  111. package/build/routes/chromium/http/pdf.post.js +1 -0
  112. package/build/routes/chromium/http/pdf.post.query.json +120 -0
  113. package/build/routes/chromium/http/pdf.post.response.json +5 -0
  114. package/build/routes/chromium/http/performance.post.body.json +26 -0
  115. package/build/routes/chromium/http/performance.post.d.ts +1 -0
  116. package/build/routes/chromium/http/performance.post.js +1 -0
  117. package/build/routes/chromium/http/performance.post.query.json +120 -0
  118. package/build/routes/chromium/http/performance.post.response.json +7 -0
  119. package/build/routes/chromium/http/scrape.post.body.json +557 -0
  120. package/build/routes/chromium/http/scrape.post.d.ts +1 -0
  121. package/build/routes/chromium/http/scrape.post.js +1 -0
  122. package/build/routes/chromium/http/scrape.post.query.json +183 -0
  123. package/build/routes/chromium/http/scrape.post.response.json +309 -0
  124. package/build/routes/chromium/http/screenshot.post.body.json +600 -0
  125. package/build/routes/chromium/http/screenshot.post.d.ts +1 -0
  126. package/build/routes/chromium/http/screenshot.post.js +1 -0
  127. package/build/routes/chromium/http/screenshot.post.query.json +120 -0
  128. package/build/routes/chromium/http/screenshot.post.response.json +5 -0
  129. package/build/routes/chromium/tests/content.spec.js +16 -16
  130. package/build/routes/chromium/tests/download.spec.js +3 -3
  131. package/build/routes/chromium/tests/function.spec.js +10 -10
  132. package/build/routes/chromium/tests/page-websocket.spec.d.ts +1 -0
  133. package/build/routes/chromium/tests/page-websocket.spec.js +97 -0
  134. package/build/routes/chromium/tests/pdf.spec.js +16 -16
  135. package/build/routes/chromium/tests/performance.spec.js +7 -7
  136. package/build/routes/chromium/tests/scrape.spec.js +15 -15
  137. package/build/routes/chromium/tests/screenshot.spec.js +17 -17
  138. package/build/routes/chromium/tests/websocket.spec.js +31 -37
  139. package/build/routes/chromium/ws/browser.d.ts +1 -16
  140. package/build/routes/chromium/ws/browser.js +1 -10
  141. package/build/routes/chromium/ws/cdp.d.ts +1 -0
  142. package/build/routes/chromium/ws/cdp.js +1 -0
  143. package/build/routes/chromium/ws/cdp.query.json +120 -0
  144. package/build/routes/chromium/ws/page.d.ts +1 -16
  145. package/build/routes/chromium/ws/page.js +1 -10
  146. package/build/routes/chromium/ws/playwright.d.ts +1 -0
  147. package/build/routes/chromium/ws/playwright.js +1 -0
  148. package/build/routes/firefox/ws/{playwright-firefox.d.ts → playwright.d.ts} +5 -5
  149. package/build/routes/firefox/ws/{playwright-firefox.js → playwright.js} +4 -4
  150. package/build/routes/management/http/{sessions-get.response.json → sessions.get.response.json} +11 -1
  151. package/build/routes/management/http/{static-get.js → static.get.js} +2 -2
  152. package/build/routes/webkit/ws/{playwright-webkit.d.ts → playwright.d.ts} +5 -5
  153. package/build/routes/webkit/ws/{playwright-webkit.js → playwright.js} +4 -4
  154. package/build/routes/webkit/ws/playwright.query.json +100 -0
  155. package/build/{routes/chromium/ws/cdp-chromium.d.ts → shared/browser.ws.d.ts} +4 -4
  156. package/build/shared/browser.ws.js +12 -0
  157. package/build/{routes/chromium/ws/playwright-chromium.d.ts → shared/chromium.playwright.ws.d.ts} +4 -4
  158. package/build/{routes/chromium/ws/playwright-chromium.js → shared/chromium.playwright.ws.js} +6 -3
  159. package/build/shared/chromium.ws.d.ts +16 -0
  160. package/build/shared/chromium.ws.js +10 -0
  161. package/build/{routes/chromium/http/content-post.d.ts → shared/content.http.d.ts} +3 -3
  162. package/build/{routes/chromium/http/content-post.js → shared/content.http.js} +3 -3
  163. package/build/{routes/chromium/http/download-post.d.ts → shared/download.http.d.ts} +3 -3
  164. package/build/{routes/chromium/http/download-post.js → shared/download.http.js} +4 -4
  165. package/build/{routes/chromium/http/function-post.d.ts → shared/function.http.d.ts} +3 -3
  166. package/build/{routes/chromium/http/function-post.js → shared/function.http.js} +4 -4
  167. package/build/{routes/chromium/http/json-new.d.ts → shared/json-list.http.d.ts} +2 -3
  168. package/build/{routes/chromium/http/json-list.js → shared/json-list.http.js} +5 -8
  169. package/build/{routes/chromium/http/json-list.d.ts → shared/json-new.http.d.ts} +2 -3
  170. package/build/shared/json-new.http.js +34 -0
  171. package/build/{routes/chromium/http/json-protocol-get.js → shared/json-protocol.http.js} +2 -2
  172. package/build/{routes/chromium/http/json-version-get.js → shared/json-version.http.js} +3 -3
  173. package/build/shared/page.ws.d.ts +16 -0
  174. package/build/shared/page.ws.js +13 -0
  175. package/build/{routes/chromium/http/pdf-post.d.ts → shared/pdf.http.d.ts} +3 -3
  176. package/build/{routes/chromium/http/pdf-post.js → shared/pdf.http.js} +3 -3
  177. package/build/{routes/chromium/http/performance.d.ts → shared/performance.http.d.ts} +3 -3
  178. package/build/{routes/chromium/http/performance.js → shared/performance.http.js} +4 -4
  179. package/build/{routes/chromium/http/scrape-post.d.ts → shared/scrape.http.d.ts} +3 -3
  180. package/build/{routes/chromium/http/scrape-post.js → shared/scrape.http.js} +3 -3
  181. package/build/{routes/chromium/http/screenshot-post.d.ts → shared/screenshot.http.d.ts} +3 -3
  182. package/build/{routes/chromium/http/screenshot-post.js → shared/screenshot.http.js} +3 -3
  183. package/build/shared/utils/performance/child.d.ts +1 -0
  184. package/build/{routes/chromium → shared}/utils/performance/main.js +1 -1
  185. package/build/shared/utils/performance/types.js +1 -0
  186. package/build/shim.js +2 -1
  187. package/build/types.d.ts +10 -8
  188. package/build/utils.d.ts +8 -3
  189. package/build/utils.js +24 -11
  190. package/docker/base/Dockerfile +1 -1
  191. package/docker/chrome/Dockerfile +4 -4
  192. package/docker/chromium/.dockerignore +16 -0
  193. package/docker/chromium/Dockerfile +40 -0
  194. package/docker/firefox/Dockerfile +1 -1
  195. package/docker/multi/Dockerfile +13 -1
  196. package/docker/webkit/Dockerfile +1 -1
  197. package/extensions/ublock/3p-filters.html +1 -1
  198. package/extensions/ublock/_locales/ar/messages.json +4 -0
  199. package/extensions/ublock/_locales/az/messages.json +4 -0
  200. package/extensions/ublock/_locales/be/messages.json +4 -0
  201. package/extensions/ublock/_locales/bg/messages.json +5 -1
  202. package/extensions/ublock/_locales/bn/messages.json +4 -0
  203. package/extensions/ublock/_locales/br_FR/messages.json +6 -2
  204. package/extensions/ublock/_locales/bs/messages.json +4 -0
  205. package/extensions/ublock/_locales/ca/messages.json +4 -0
  206. package/extensions/ublock/_locales/cs/messages.json +4 -0
  207. package/extensions/ublock/_locales/cv/messages.json +4 -0
  208. package/extensions/ublock/_locales/cy/messages.json +1294 -0
  209. package/extensions/ublock/_locales/da/messages.json +4 -0
  210. package/extensions/ublock/_locales/de/messages.json +5 -1
  211. package/extensions/ublock/_locales/el/messages.json +4 -0
  212. package/extensions/ublock/_locales/en/messages.json +4 -0
  213. package/extensions/ublock/_locales/en_GB/messages.json +4 -0
  214. package/extensions/ublock/_locales/eo/messages.json +9 -5
  215. package/extensions/ublock/_locales/es/messages.json +4 -0
  216. package/extensions/ublock/_locales/et/messages.json +4 -0
  217. package/extensions/ublock/_locales/eu/messages.json +8 -4
  218. package/extensions/ublock/_locales/fa/messages.json +4 -0
  219. package/extensions/ublock/_locales/fi/messages.json +4 -0
  220. package/extensions/ublock/_locales/fil/messages.json +4 -0
  221. package/extensions/ublock/_locales/fr/messages.json +4 -0
  222. package/extensions/ublock/_locales/fy/messages.json +4 -0
  223. package/extensions/ublock/_locales/gl/messages.json +4 -0
  224. package/extensions/ublock/_locales/gu/messages.json +4 -0
  225. package/extensions/ublock/_locales/he/messages.json +4 -0
  226. package/extensions/ublock/_locales/hi/messages.json +4 -0
  227. package/extensions/ublock/_locales/hr/messages.json +4 -0
  228. package/extensions/ublock/_locales/hu/messages.json +4 -0
  229. package/extensions/ublock/_locales/hy/messages.json +4 -0
  230. package/extensions/ublock/_locales/id/messages.json +5 -1
  231. package/extensions/ublock/_locales/it/messages.json +4 -0
  232. package/extensions/ublock/_locales/ja/messages.json +4 -0
  233. package/extensions/ublock/_locales/ka/messages.json +34 -30
  234. package/extensions/ublock/_locales/kk/messages.json +4 -0
  235. package/extensions/ublock/_locales/kn/messages.json +4 -0
  236. package/extensions/ublock/_locales/ko/messages.json +4 -0
  237. package/extensions/ublock/_locales/ku/messages.json +4 -0
  238. package/extensions/ublock/_locales/lt/messages.json +4 -0
  239. package/extensions/ublock/_locales/lv/messages.json +4 -0
  240. package/extensions/ublock/_locales/mk/messages.json +4 -0
  241. package/extensions/ublock/_locales/ml/messages.json +4 -0
  242. package/extensions/ublock/_locales/mr/messages.json +4 -0
  243. package/extensions/ublock/_locales/ms/messages.json +13 -9
  244. package/extensions/ublock/_locales/nb/messages.json +4 -0
  245. package/extensions/ublock/_locales/nl/messages.json +4 -0
  246. package/extensions/ublock/_locales/no/messages.json +4 -0
  247. package/extensions/ublock/_locales/oc/messages.json +4 -0
  248. package/extensions/ublock/_locales/pa/messages.json +4 -0
  249. package/extensions/ublock/_locales/pl/messages.json +5 -1
  250. package/extensions/ublock/_locales/pt_BR/messages.json +4 -0
  251. package/extensions/ublock/_locales/pt_PT/messages.json +4 -0
  252. package/extensions/ublock/_locales/ro/messages.json +5 -1
  253. package/extensions/ublock/_locales/ru/messages.json +4 -0
  254. package/extensions/ublock/_locales/si/messages.json +4 -0
  255. package/extensions/ublock/_locales/sk/messages.json +4 -0
  256. package/extensions/ublock/_locales/sl/messages.json +4 -0
  257. package/extensions/ublock/_locales/so/messages.json +4 -0
  258. package/extensions/ublock/_locales/sq/messages.json +4 -0
  259. package/extensions/ublock/_locales/sr/messages.json +4 -0
  260. package/extensions/ublock/_locales/sv/messages.json +4 -0
  261. package/extensions/ublock/_locales/sw/messages.json +4 -0
  262. package/extensions/ublock/_locales/ta/messages.json +4 -0
  263. package/extensions/ublock/_locales/te/messages.json +4 -0
  264. package/extensions/ublock/_locales/th/messages.json +12 -8
  265. package/extensions/ublock/_locales/tr/messages.json +4 -0
  266. package/extensions/ublock/_locales/uk/messages.json +4 -0
  267. package/extensions/ublock/_locales/ur/messages.json +4 -0
  268. package/extensions/ublock/_locales/vi/messages.json +4 -0
  269. package/extensions/ublock/_locales/zh_CN/messages.json +6 -2
  270. package/extensions/ublock/_locales/zh_TW/messages.json +6 -2
  271. package/extensions/ublock/assets/assets.json +11 -11
  272. package/extensions/ublock/assets/resources/scriptlets.js +660 -378
  273. package/extensions/ublock/assets/thirdparties/easylist/easylist.txt +7173 -3455
  274. package/extensions/ublock/assets/thirdparties/easylist/easyprivacy.txt +18829 -1918
  275. package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/serverlist +21 -26
  276. package/extensions/ublock/assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat +118 -46
  277. package/extensions/ublock/assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt +710 -1117
  278. package/extensions/ublock/assets/ublock/badlists.txt +0 -4
  279. package/extensions/ublock/assets/ublock/badware.min.txt +116 -105
  280. package/extensions/ublock/assets/ublock/filters.min.txt +1443 -1097
  281. package/extensions/ublock/assets/ublock/privacy.min.txt +50 -31
  282. package/extensions/ublock/assets/ublock/quick-fixes.min.txt +97 -108
  283. package/extensions/ublock/assets/ublock/unbreak.min.txt +64 -21
  284. package/extensions/ublock/css/1p-filters.css +4 -0
  285. package/extensions/ublock/css/3p-filters.css +6 -4
  286. package/extensions/ublock/css/common.css +1 -1
  287. package/extensions/ublock/css/fa-icons.css +1 -0
  288. package/extensions/ublock/css/logger-ui.css +72 -52
  289. package/extensions/ublock/css/popup-fenix.css +1 -1
  290. package/extensions/ublock/img/fontawesome/fontawesome-defs.svg +1 -0
  291. package/extensions/ublock/js/3p-filters.js +3 -3
  292. package/extensions/ublock/js/assets.js +7 -4
  293. package/extensions/ublock/js/background.js +1 -3
  294. package/extensions/ublock/js/benchmarks.js +1 -0
  295. package/extensions/ublock/js/broadcast.js +12 -0
  296. package/extensions/ublock/js/click2load.js +2 -3
  297. package/extensions/ublock/js/codemirror/ubo-static-filtering.js +1 -0
  298. package/extensions/ublock/js/commands.js +10 -0
  299. package/extensions/ublock/js/contentscript-extra.js +13 -11
  300. package/extensions/ublock/js/contentscript.js +0 -31
  301. package/extensions/ublock/js/contextmenu.js +5 -1
  302. package/extensions/ublock/js/dyna-rules.js +83 -52
  303. package/extensions/ublock/js/fa-icons.js +1 -0
  304. package/extensions/ublock/js/filtering-context.js +0 -2
  305. package/extensions/ublock/js/i18n.js +1 -5
  306. package/extensions/ublock/js/logger-ui.js +71 -38
  307. package/extensions/ublock/js/logger.js +18 -14
  308. package/extensions/ublock/js/messaging.js +17 -5
  309. package/extensions/ublock/js/popup-fenix.js +6 -6
  310. package/extensions/ublock/js/scriptlet-filtering-core.js +14 -12
  311. package/extensions/ublock/js/scriptlet-filtering.js +149 -53
  312. package/extensions/ublock/js/scriptlets/scriptlet-loglevel-1.js +49 -0
  313. package/extensions/ublock/js/scriptlets/scriptlet-loglevel-2.js +49 -0
  314. package/extensions/ublock/js/scriptlets/should-inject-contentscript.js +1 -1
  315. package/extensions/ublock/js/static-dnr-filtering.js +4 -2
  316. package/extensions/ublock/js/static-filtering-parser.js +14 -8
  317. package/extensions/ublock/js/static-net-filtering.js +32 -30
  318. package/extensions/ublock/js/storage.js +18 -4
  319. package/extensions/ublock/js/traffic.js +3 -3
  320. package/extensions/ublock/js/ublock.js +1 -1
  321. package/extensions/ublock/js/vapi-background.js +15 -7
  322. package/extensions/ublock/logger-ui.html +18 -10
  323. package/extensions/ublock/manifest.json +4 -1
  324. package/extensions/ublock/web_accessible_resources/chartbeat.js +3 -0
  325. package/package.json +12 -11
  326. package/scripts/build-function.js +1 -1
  327. package/scripts/build-open-api.js +3 -2
  328. package/scripts/clean.js +6 -1
  329. package/scripts/install-debugger.js +20 -0
  330. package/scripts/install-devtools.js +40 -0
  331. package/src/browserless.ts +11 -9
  332. package/src/browsers/chrome.cdp.ts +10 -0
  333. package/src/browsers/chrome.playwright.ts +10 -0
  334. package/src/browsers/{cdp-chromium.ts → chromium.cdp.ts} +20 -13
  335. package/src/browsers/{playwright-chromium.ts → chromium.playwright.ts} +7 -6
  336. package/src/browsers/{playwright-firefox.ts → firefox.playwright.ts} +5 -5
  337. package/src/browsers/index.ts +160 -23
  338. package/src/browsers/{playwright-webkit.ts → webkit.playwright.ts} +5 -5
  339. package/src/exports.ts +6 -4
  340. package/src/hooks.ts +4 -12
  341. package/src/http.ts +21 -0
  342. package/src/router.ts +21 -5
  343. package/src/routes/chrome/http/content.post.ts +14 -0
  344. package/src/routes/chrome/http/download.post.ts +14 -0
  345. package/src/routes/chrome/http/function.post.ts +14 -0
  346. package/src/routes/chrome/http/json-list.get.ts +1 -0
  347. package/src/routes/chrome/http/json-new.put.ts +1 -0
  348. package/src/routes/chrome/http/json-protocol.get.ts +1 -0
  349. package/src/routes/chrome/http/json-version.get.ts +1 -0
  350. package/src/routes/chrome/http/pdf.post.ts +14 -0
  351. package/src/routes/chrome/http/performance.post.ts +14 -0
  352. package/src/routes/chrome/http/scrape.post.ts +14 -0
  353. package/src/routes/chrome/http/screenshot.post.ts +14 -0
  354. package/src/routes/chrome/tests/content.spec.ts +375 -0
  355. package/src/routes/chrome/tests/download.spec.ts +77 -0
  356. package/src/routes/chrome/tests/function.spec.ts +282 -0
  357. package/src/routes/chrome/tests/json-version.spec.ts +52 -0
  358. package/src/routes/chrome/tests/page-websocket.spec.ts +129 -0
  359. package/src/routes/chrome/tests/pdf.spec.ts +380 -0
  360. package/src/routes/chrome/tests/performance.spec.ts +155 -0
  361. package/src/routes/chrome/tests/scrape.spec.ts +417 -0
  362. package/src/routes/chrome/tests/screenshot.spec.ts +387 -0
  363. package/src/routes/chrome/tests/websocket.spec.ts +491 -0
  364. package/src/routes/chrome/ws/browser.ts +8 -0
  365. package/src/routes/chrome/ws/cdp.ts +12 -0
  366. package/src/routes/chrome/ws/page.ts +8 -0
  367. package/src/routes/chrome/ws/playwright.ts +12 -0
  368. package/src/routes/chromium/http/content.post.ts +6 -0
  369. package/src/routes/chromium/http/download.post.ts +6 -0
  370. package/src/routes/chromium/http/function.post.ts +6 -0
  371. package/src/routes/chromium/http/json-list.get.ts +1 -0
  372. package/src/routes/chromium/http/json-new.put.ts +1 -0
  373. package/src/routes/chromium/http/json-protocol.get.ts +1 -0
  374. package/src/routes/chromium/http/json-version.get.ts +1 -0
  375. package/src/routes/chromium/http/pdf.post.ts +6 -0
  376. package/src/routes/chromium/http/performance.post.ts +6 -0
  377. package/src/routes/chromium/http/scrape.post.ts +6 -0
  378. package/src/routes/chromium/http/screenshot.post.ts +6 -0
  379. package/src/routes/chromium/tests/content.spec.ts +36 -28
  380. package/src/routes/chromium/tests/download.spec.ts +3 -3
  381. package/src/routes/chromium/tests/function.spec.ts +18 -15
  382. package/src/routes/chromium/tests/page-websocket.spec.ts +129 -0
  383. package/src/routes/chromium/tests/pdf.spec.ts +31 -26
  384. package/src/routes/chromium/tests/performance.spec.ts +46 -34
  385. package/src/routes/chromium/tests/scrape.spec.ts +23 -20
  386. package/src/routes/chromium/tests/screenshot.spec.ts +24 -24
  387. package/src/routes/chromium/tests/websocket.spec.ts +31 -40
  388. package/src/routes/chromium/ws/browser.ts +1 -29
  389. package/src/routes/chromium/ws/cdp.ts +1 -0
  390. package/src/routes/chromium/ws/page.ts +1 -29
  391. package/src/routes/chromium/ws/playwright.ts +4 -0
  392. package/src/routes/firefox/ws/{playwright-firefox.ts → playwright.ts} +5 -5
  393. package/src/routes/management/http/{static-get.ts → static.get.ts} +2 -2
  394. package/src/routes/webkit/ws/{playwright-webkit.ts → playwright.ts} +5 -5
  395. package/src/shared/browser.ws.ts +34 -0
  396. package/src/{routes/chromium/ws/playwright-chromium.ts → shared/chromium.playwright.ws.ts} +7 -4
  397. package/src/{routes/chromium/ws/cdp-chromium.ts → shared/chromium.ws.ts} +6 -6
  398. package/src/{routes/chromium/http/content-post.ts → shared/content.http.ts} +4 -4
  399. package/src/{routes/chromium/http/download-post.ts → shared/download.http.ts} +4 -4
  400. package/src/{routes/chromium/http/function-post.ts → shared/function.http.ts} +4 -4
  401. package/src/shared/json-list.http.ts +35 -0
  402. package/src/{routes/chromium/http/json-new.ts → shared/json-new.http.ts} +23 -7
  403. package/src/{routes/chromium/http/json-protocol-get.ts → shared/json-protocol.http.ts} +3 -5
  404. package/src/{routes/chromium/http/json-version-get.ts → shared/json-version.http.ts} +4 -5
  405. package/src/shared/page.ws.ts +35 -0
  406. package/src/{routes/chromium/http/pdf-post.ts → shared/pdf.http.ts} +4 -4
  407. package/src/{routes/chromium/http/performance.ts → shared/performance.http.ts} +4 -4
  408. package/src/{routes/chromium/http/scrape-post.ts → shared/scrape.http.ts} +4 -4
  409. package/src/{routes/chromium/http/screenshot-post.ts → shared/screenshot.http.ts} +4 -4
  410. package/src/{routes/chromium → shared}/utils/function/handler.ts +2 -2
  411. package/src/{routes/chromium → shared}/utils/performance/main.ts +1 -2
  412. package/src/shim.ts +2 -1
  413. package/src/types.ts +27 -20
  414. package/src/utils.ts +32 -14
  415. package/static/devtools/Images/accelerometer-back.svg +1 -0
  416. package/static/devtools/Images/accelerometer-bottom.png +0 -0
  417. package/static/devtools/Images/accelerometer-front.svg +1 -0
  418. package/static/devtools/Images/accelerometer-left.png +0 -0
  419. package/static/devtools/Images/accelerometer-right.png +0 -0
  420. package/static/devtools/Images/accelerometer-top.png +0 -0
  421. package/static/devtools/Images/baseline-icon.svg +1 -0
  422. package/static/devtools/Images/breaking_change_icon.svg +1 -0
  423. package/static/devtools/Images/checkboxCheckmark.svg +1 -0
  424. package/static/devtools/Images/checker.png +0 -0
  425. package/static/devtools/Images/chevrons.svg +1 -0
  426. package/static/devtools/Images/chromeDisabledSelect.png +0 -0
  427. package/static/devtools/Images/chromeDisabledSelect_2x.png +0 -0
  428. package/static/devtools/Images/chromeLeft.avif +0 -0
  429. package/static/devtools/Images/chromeMiddle.avif +0 -0
  430. package/static/devtools/Images/chromeRight.avif +0 -0
  431. package/static/devtools/Images/chromeSelect.svg +1 -0
  432. package/static/devtools/Images/chromeSelectDark.svg +1 -0
  433. package/static/devtools/Images/cssoverview_icons_2x.avif +0 -0
  434. package/static/devtools/Images/dropdown_7x6_icon.svg +1 -0
  435. package/static/devtools/Images/elements_panel_icon.svg +1 -0
  436. package/static/devtools/Images/errorWave.svg +1 -0
  437. package/static/devtools/Images/error_icon.svg +1 -0
  438. package/static/devtools/Images/feedback_thin_16x16_icon.svg +1 -0
  439. package/static/devtools/Images/flex-align-content-center-icon.svg +1 -0
  440. package/static/devtools/Images/flex-align-content-end-icon.svg +1 -0
  441. package/static/devtools/Images/flex-align-content-space-around-icon.svg +1 -0
  442. package/static/devtools/Images/flex-align-content-space-between-icon.svg +1 -0
  443. package/static/devtools/Images/flex-align-content-space-evenly-icon.svg +1 -0
  444. package/static/devtools/Images/flex-align-content-start-icon.svg +1 -0
  445. package/static/devtools/Images/flex-align-content-stretch-icon.svg +1 -0
  446. package/static/devtools/Images/flex-align-items-center-icon.svg +1 -0
  447. package/static/devtools/Images/flex-align-items-flex-end-icon.svg +1 -0
  448. package/static/devtools/Images/flex-align-items-flex-start-icon.svg +1 -0
  449. package/static/devtools/Images/flex-align-items-stretch-icon.svg +1 -0
  450. package/static/devtools/Images/flex-align-self-center-icon.svg +1 -0
  451. package/static/devtools/Images/flex-align-self-flex-end-icon.svg +1 -0
  452. package/static/devtools/Images/flex-align-self-flex-start-icon.svg +1 -0
  453. package/static/devtools/Images/flex-align-self-stretch-icon.svg +1 -0
  454. package/static/devtools/Images/flex-direction-icon.svg +1 -0
  455. package/static/devtools/Images/flex-justify-content-center-icon.svg +1 -0
  456. package/static/devtools/Images/flex-justify-content-flex-end-icon.svg +1 -0
  457. package/static/devtools/Images/flex-justify-content-flex-start-icon.svg +1 -0
  458. package/static/devtools/Images/flex-justify-content-space-around-icon.svg +1 -0
  459. package/static/devtools/Images/flex-justify-content-space-between-icon.svg +1 -0
  460. package/static/devtools/Images/flex-justify-content-space-evenly-icon.svg +1 -0
  461. package/static/devtools/Images/ic_checkmark_16x16.svg +3 -0
  462. package/static/devtools/Images/ic_delete_filter.svg +1 -0
  463. package/static/devtools/Images/ic_delete_list.svg +1 -0
  464. package/static/devtools/Images/ic_info_black_18dp.svg +1 -0
  465. package/static/devtools/Images/ic_page_next_16x16_icon.svg +1 -0
  466. package/static/devtools/Images/ic_page_prev_16x16_icon.svg +1 -0
  467. package/static/devtools/Images/ic_redo_16x16_icon.svg +1 -0
  468. package/static/devtools/Images/ic_show_node_16x16.svg +4 -0
  469. package/static/devtools/Images/ic_suggest_color.svg +6 -0
  470. package/static/devtools/Images/ic_undo_16x16_icon.svg +1 -0
  471. package/static/devtools/Images/ic_warning_black_18dp.svg +1 -0
  472. package/static/devtools/Images/issue-text-icon.svg +1 -0
  473. package/static/devtools/Images/largeIcons.svg +1 -0
  474. package/static/devtools/Images/lighthouse_logo.svg +1 -0
  475. package/static/devtools/Images/link_icon.svg +1 -0
  476. package/static/devtools/Images/mediumIcons.svg +1 -0
  477. package/static/devtools/Images/navigationControls.png +0 -0
  478. package/static/devtools/Images/navigationControls_2x.png +0 -0
  479. package/static/devtools/Images/network_panel_icon.svg +1 -0
  480. package/static/devtools/Images/nodeIcon.avif +0 -0
  481. package/static/devtools/Images/node_search_icon.svg +1 -0
  482. package/static/devtools/Images/popoverArrows.png +0 -0
  483. package/static/devtools/Images/profileGroupIcon.png +0 -0
  484. package/static/devtools/Images/profileIcon.png +0 -0
  485. package/static/devtools/Images/profileSmallIcon.png +0 -0
  486. package/static/devtools/Images/radioDot-dark-theme.png +0 -0
  487. package/static/devtools/Images/radioDot.png +0 -0
  488. package/static/devtools/Images/refresh_12x12_icon.svg +1 -0
  489. package/static/devtools/Images/resizeDiagonal.svg +1 -0
  490. package/static/devtools/Images/resizeHorizontal.svg +1 -0
  491. package/static/devtools/Images/resizeVertical.svg +1 -0
  492. package/static/devtools/Images/resourceCSSIcon.png +0 -0
  493. package/static/devtools/Images/resourceDocumentIcon.png +0 -0
  494. package/static/devtools/Images/resourceDocumentIconSmall.png +0 -0
  495. package/static/devtools/Images/resourceJSIcon.png +0 -0
  496. package/static/devtools/Images/resourcePlainIcon.png +0 -0
  497. package/static/devtools/Images/resourcePlainIconSmall.png +0 -0
  498. package/static/devtools/Images/resourcesTimeGraphIcon.avif +0 -0
  499. package/static/devtools/Images/searchNext.png +0 -0
  500. package/static/devtools/Images/searchPrev.png +0 -0
  501. package/static/devtools/Images/securityIcons.svg +1 -0
  502. package/static/devtools/Images/settings_14x14_icon.svg +1 -0
  503. package/static/devtools/Images/smallIcons.svg +1 -0
  504. package/static/devtools/Images/sources_panel_icon.svg +1 -0
  505. package/static/devtools/Images/speech.png +0 -0
  506. package/static/devtools/Images/toolbarResizerVertical.png +0 -0
  507. package/static/devtools/Images/touchCursor.png +0 -0
  508. package/static/devtools/Images/touchCursor_2x.png +0 -0
  509. package/static/devtools/Images/treeoutlineTriangles.svg +1 -0
  510. package/static/devtools/Images/warning_icon.svg +1 -0
  511. package/static/devtools/Images/whatsnew.avif +0 -0
  512. package/static/devtools/Tests.js +1654 -0
  513. package/static/devtools/accessibility/accessibility-legacy.js +1 -0
  514. package/static/devtools/accessibility/accessibility-meta.js +1 -0
  515. package/static/devtools/accessibility/accessibility.js +1 -0
  516. package/static/devtools/accessibility/accessibility_module.js +1 -0
  517. package/static/devtools/accessibility_test_runner/accessibility_test_runner.js +77 -0
  518. package/static/devtools/accessibility_test_runner/accessibility_test_runner_module.js +0 -0
  519. package/static/devtools/animation/animation-legacy.js +1 -0
  520. package/static/devtools/animation/animation-meta.js +1 -0
  521. package/static/devtools/animation/animation.js +1 -0
  522. package/static/devtools/animation/animation_module.js +1 -0
  523. package/static/devtools/application_test_runner/AppcacheTestRunner.js +220 -0
  524. package/static/devtools/application_test_runner/CacheStorageTestRunner.js +286 -0
  525. package/static/devtools/application_test_runner/IndexedDBTestRunner.js +476 -0
  526. package/static/devtools/application_test_runner/ResourceTreeTestRunner.js +99 -0
  527. package/static/devtools/application_test_runner/ResourcesTestRunner.js +167 -0
  528. package/static/devtools/application_test_runner/ServiceWorkersTestRunner.js +131 -0
  529. package/static/devtools/application_test_runner/application_test_runner.js +10 -0
  530. package/static/devtools/application_test_runner/application_test_runner_module.js +0 -0
  531. package/static/devtools/axe_core_test_runner/axe_core_test_runner.js +174 -0
  532. package/static/devtools/axe_core_test_runner/axe_core_test_runner_module.js +0 -0
  533. package/static/devtools/bindings/bindings-legacy.js +1 -0
  534. package/static/devtools/bindings/bindings.js +1 -0
  535. package/static/devtools/bindings_test_runner/AutomappingTestRunner.js +130 -0
  536. package/static/devtools/bindings_test_runner/BindingsTestRunner.js +238 -0
  537. package/static/devtools/bindings_test_runner/IsolatedFilesystemTestRunner.js +287 -0
  538. package/static/devtools/bindings_test_runner/OverridesTestRunner.js +26 -0
  539. package/static/devtools/bindings_test_runner/PersistenceTestRunner.js +109 -0
  540. package/static/devtools/bindings_test_runner/bindings_test_runner.js +9 -0
  541. package/static/devtools/bindings_test_runner/bindings_test_runner_module.js +0 -0
  542. package/static/devtools/browser_debugger/browser_debugger-legacy.js +1 -0
  543. package/static/devtools/browser_debugger/browser_debugger-meta.js +1 -0
  544. package/static/devtools/browser_debugger/browser_debugger.js +1 -0
  545. package/static/devtools/browser_debugger/browser_debugger_module.js +1 -0
  546. package/static/devtools/browser_sdk/browser_sdk-meta.js +1 -0
  547. package/static/devtools/browser_sdk/browser_sdk.js +1 -0
  548. package/static/devtools/changes/changes-legacy.js +1 -0
  549. package/static/devtools/changes/changes-meta.js +1 -0
  550. package/static/devtools/changes/changes.js +1 -0
  551. package/static/devtools/changes/changes_module.js +1 -0
  552. package/static/devtools/client_variations/client_variations.js +1 -0
  553. package/static/devtools/client_variations/client_variations_module.js +0 -0
  554. package/static/devtools/cm/cm.js +1 -0
  555. package/static/devtools/cm/cm_module.js +1 -0
  556. package/static/devtools/cm_headless/cm_headless.js +1 -0
  557. package/static/devtools/color_picker/color_picker-legacy.js +1 -0
  558. package/static/devtools/color_picker/color_picker.js +1 -0
  559. package/static/devtools/color_picker/color_picker_module.js +1 -0
  560. package/static/devtools/common/common-legacy.js +1 -0
  561. package/static/devtools/common/common.js +1 -0
  562. package/static/devtools/component_helpers/component_helpers.js +1 -0
  563. package/static/devtools/components/components-legacy.js +1 -0
  564. package/static/devtools/components/components.js +1 -0
  565. package/static/devtools/console/console-legacy.js +1 -0
  566. package/static/devtools/console/console-meta.js +1 -0
  567. package/static/devtools/console/console.js +6 -0
  568. package/static/devtools/console/console_module.js +1 -0
  569. package/static/devtools/console_counters/console_counters-legacy.js +1 -0
  570. package/static/devtools/console_counters/console_counters.js +1 -0
  571. package/static/devtools/console_test_runner/console_test_runner.js +696 -0
  572. package/static/devtools/console_test_runner/console_test_runner_module.js +0 -0
  573. package/static/devtools/cookie_table/cookie_table-legacy.js +1 -0
  574. package/static/devtools/cookie_table/cookie_table.js +1 -0
  575. package/static/devtools/cookie_table/cookie_table_module.js +1 -0
  576. package/static/devtools/coverage/coverage-legacy.js +1 -0
  577. package/static/devtools/coverage/coverage-meta.js +1 -0
  578. package/static/devtools/coverage/coverage.js +1 -0
  579. package/static/devtools/coverage/coverage_module.js +1 -0
  580. package/static/devtools/coverage_test_runner/coverage_test_runner.js +151 -0
  581. package/static/devtools/coverage_test_runner/coverage_test_runner_module.js +0 -0
  582. package/static/devtools/cpu_profiler_test_runner/cpu_profiler_test_runner.js +72 -0
  583. package/static/devtools/cpu_profiler_test_runner/cpu_profiler_test_runner_module.js +0 -0
  584. package/static/devtools/css_overview/css_overview-meta.js +1 -0
  585. package/static/devtools/css_overview/css_overview.js +146 -0
  586. package/static/devtools/css_overview/css_overview_module.js +1 -0
  587. package/static/devtools/data_grid/data_grid-legacy.js +1 -0
  588. package/static/devtools/data_grid/data_grid.js +1 -0
  589. package/static/devtools/data_grid/data_grid_module.js +1 -0
  590. package/static/devtools/data_grid_test_runner/data_grid_test_runner.js +78 -0
  591. package/static/devtools/data_grid_test_runner/data_grid_test_runner_module.js +0 -0
  592. package/static/devtools/developer_resources/developer_resources-legacy.js +1 -0
  593. package/static/devtools/developer_resources/developer_resources-meta.js +1 -0
  594. package/static/devtools/developer_resources/developer_resources.js +1 -0
  595. package/static/devtools/developer_resources/developer_resources_module.js +1 -0
  596. package/static/devtools/device_mode_test_runner/device_mode_test_runner.js +45 -0
  597. package/static/devtools/device_mode_test_runner/device_mode_test_runner_module.js +0 -0
  598. package/static/devtools/devtools_app.html +20 -0
  599. package/static/devtools/devtools_app.js +1 -0
  600. package/static/devtools/devtools_compatibility.js +1546 -0
  601. package/static/devtools/diff/diff-legacy.js +1 -0
  602. package/static/devtools/diff/diff.js +1 -0
  603. package/static/devtools/diff/diff_module.js +0 -0
  604. package/static/devtools/dom_extension/dom_extension.js +1 -0
  605. package/static/devtools/elements/elements-legacy.js +1 -0
  606. package/static/devtools/elements/elements-meta.js +1 -0
  607. package/static/devtools/elements/elements.js +469 -0
  608. package/static/devtools/elements/elements_module.js +1 -0
  609. package/static/devtools/elements_test_runner/EditDOMTestRunner.js +78 -0
  610. package/static/devtools/elements_test_runner/ElementsPanelShadowSelectionOnRefreshTestRunner.js +39 -0
  611. package/static/devtools/elements_test_runner/ElementsTestRunner.js +1280 -0
  612. package/static/devtools/elements_test_runner/SetOuterHTMLTestRunner.js +115 -0
  613. package/static/devtools/elements_test_runner/StylesUpdateLinksTestRunner.js +134 -0
  614. package/static/devtools/elements_test_runner/elements_test_runner.js +9 -0
  615. package/static/devtools/elements_test_runner/elements_test_runner_module.js +0 -0
  616. package/static/devtools/emulated_devices/emulated_devices_module.js +0 -0
  617. package/static/devtools/emulated_devices/optimized/MotoG4-landscape.avif +0 -0
  618. package/static/devtools/emulated_devices/optimized/MotoG4-portrait.avif +0 -0
  619. package/static/devtools/emulated_devices/optimized/Nexus5X-landscape.avif +0 -0
  620. package/static/devtools/emulated_devices/optimized/Nexus5X-portrait.avif +0 -0
  621. package/static/devtools/emulated_devices/optimized/Nexus6P-landscape.avif +0 -0
  622. package/static/devtools/emulated_devices/optimized/Nexus6P-portrait.avif +0 -0
  623. package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-1x.avif +0 -0
  624. package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-default-2x.avif +0 -0
  625. package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-1x.avif +0 -0
  626. package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-keyboard-2x.avif +0 -0
  627. package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-1x.avif +0 -0
  628. package/static/devtools/emulated_devices/optimized/google-nexus-5-horizontal-navigation-2x.avif +0 -0
  629. package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-1x.avif +0 -0
  630. package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-default-2x.avif +0 -0
  631. package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-1x.avif +0 -0
  632. package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-keyboard-2x.avif +0 -0
  633. package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-1x.avif +0 -0
  634. package/static/devtools/emulated_devices/optimized/google-nexus-5-vertical-navigation-2x.avif +0 -0
  635. package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-1x.avif +0 -0
  636. package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-default-2x.avif +0 -0
  637. package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-1x.avif +0 -0
  638. package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-keyboard-2x.avif +0 -0
  639. package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-1x.avif +0 -0
  640. package/static/devtools/emulated_devices/optimized/google-nexus-5x-horizontal-navigation-2x.avif +0 -0
  641. package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-1x.avif +0 -0
  642. package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-default-2x.avif +0 -0
  643. package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-1x.avif +0 -0
  644. package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-keyboard-2x.avif +0 -0
  645. package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-1x.avif +0 -0
  646. package/static/devtools/emulated_devices/optimized/google-nexus-5x-vertical-navigation-2x.avif +0 -0
  647. package/static/devtools/emulated_devices/optimized/iPad-landscape.avif +0 -0
  648. package/static/devtools/emulated_devices/optimized/iPad-portrait.avif +0 -0
  649. package/static/devtools/emulated_devices/optimized/iPhone5-landscape.avif +0 -0
  650. package/static/devtools/emulated_devices/optimized/iPhone5-portrait.avif +0 -0
  651. package/static/devtools/emulated_devices/optimized/iPhone6-landscape.avif +0 -0
  652. package/static/devtools/emulated_devices/optimized/iPhone6-portrait.avif +0 -0
  653. package/static/devtools/emulated_devices/optimized/iPhone6Plus-landscape.avif +0 -0
  654. package/static/devtools/emulated_devices/optimized/iPhone6Plus-portrait.avif +0 -0
  655. package/static/devtools/emulation/emulation-legacy.js +1 -0
  656. package/static/devtools/emulation/emulation-meta.js +1 -0
  657. package/static/devtools/emulation/emulation.js +1 -0
  658. package/static/devtools/event_listeners/event_listeners-legacy.js +1 -0
  659. package/static/devtools/event_listeners/event_listeners.js +1 -0
  660. package/static/devtools/event_listeners/event_listeners_module.js +1 -0
  661. package/static/devtools/extensions/extensions-legacy.js +1 -0
  662. package/static/devtools/extensions/extensions.js +1 -0
  663. package/static/devtools/extensions_test_runner/ExtensionsNetworkTestRunner.js +27 -0
  664. package/static/devtools/extensions_test_runner/ExtensionsTestRunner.js +68 -0
  665. package/static/devtools/extensions_test_runner/extensions_test_runner.js +6 -0
  666. package/static/devtools/extensions_test_runner/extensions_test_runner_module.js +0 -0
  667. package/static/devtools/formatter/formatter-legacy.js +1 -0
  668. package/static/devtools/formatter/formatter.js +1 -0
  669. package/static/devtools/formatter/formatter_module.js +0 -0
  670. package/static/devtools/formatter_worker/FormatterActions.js +1 -0
  671. package/static/devtools/formatter_worker/formatter_worker-entrypoint.js +1 -0
  672. package/static/devtools/formatter_worker/formatter_worker.js +1 -0
  673. package/static/devtools/har_importer/har_importer-legacy.js +1 -0
  674. package/static/devtools/har_importer/har_importer.js +1 -0
  675. package/static/devtools/har_importer/har_importer_module.js +0 -0
  676. package/static/devtools/heap_profiler_test_runner/heap_profiler_test_runner.js +740 -0
  677. package/static/devtools/heap_profiler_test_runner/heap_profiler_test_runner_module.js +0 -0
  678. package/static/devtools/heap_snapshot_model/heap_snapshot_model-legacy.js +1 -0
  679. package/static/devtools/heap_snapshot_model/heap_snapshot_model.js +1 -0
  680. package/static/devtools/heap_snapshot_model/heap_snapshot_model_module.js +0 -0
  681. package/static/devtools/heap_snapshot_worker/heap_snapshot_worker-entrypoint.js +1 -0
  682. package/static/devtools/heap_snapshot_worker/heap_snapshot_worker-legacy.js +1 -0
  683. package/static/devtools/heap_snapshot_worker/heap_snapshot_worker.js +1 -0
  684. package/static/devtools/heap_snapshot_worker/heap_snapshot_worker_module.js +0 -0
  685. package/static/devtools/help/help-legacy.js +1 -0
  686. package/static/devtools/help/help-meta.js +1 -0
  687. package/static/devtools/help/help.js +1 -0
  688. package/static/devtools/help/help_module.js +1 -0
  689. package/static/devtools/host/host-legacy.js +1 -0
  690. package/static/devtools/host/host.js +1 -0
  691. package/static/devtools/i18n/i18n.js +1 -0
  692. package/static/devtools/i18n/i18n_locales-tsconfig.json +8 -0
  693. package/static/devtools/i18n/locales/en-US.json +3566 -0
  694. package/static/devtools/inline_editor/inline_editor-legacy.js +1 -0
  695. package/static/devtools/inline_editor/inline_editor.js +203 -0
  696. package/static/devtools/inline_editor/inline_editor_module.js +1 -0
  697. package/static/devtools/input/input-legacy.js +1 -0
  698. package/static/devtools/input/input-meta.js +1 -0
  699. package/static/devtools/input/input.js +1 -0
  700. package/static/devtools/input/input_module.js +1 -0
  701. package/static/devtools/inspector.html +20 -0
  702. package/static/devtools/inspector.js +1 -0
  703. package/static/devtools/inspector_main/inspector_main-legacy.js +1 -0
  704. package/static/devtools/inspector_main/inspector_main-meta.js +1 -0
  705. package/static/devtools/inspector_main/inspector_main.js +1 -0
  706. package/static/devtools/integration_test_runner.html +14 -0
  707. package/static/devtools/integration_test_runner.js +2 -0
  708. package/static/devtools/issues/issues-legacy.js +1 -0
  709. package/static/devtools/issues/issues-meta.js +1 -0
  710. package/static/devtools/issues/issues.js +67 -0
  711. package/static/devtools/issues/issues_module.js +1 -0
  712. package/static/devtools/javascript_metadata/javascript_metadata-legacy.js +1 -0
  713. package/static/devtools/javascript_metadata/javascript_metadata.js +1 -0
  714. package/static/devtools/javascript_metadata/javascript_metadata_module.js +0 -0
  715. package/static/devtools/js_app.html +20 -0
  716. package/static/devtools/js_app.js +1 -0
  717. package/static/devtools/js_main/js_main-legacy.js +1 -0
  718. package/static/devtools/js_main/js_main.js +1 -0
  719. package/static/devtools/js_profiler/js_profiler-meta.js +1 -0
  720. package/static/devtools/js_profiler/js_profiler.js +1 -0
  721. package/static/devtools/js_profiler/js_profiler_module.js +0 -0
  722. package/static/devtools/layer_viewer/layer_viewer-legacy.js +1 -0
  723. package/static/devtools/layer_viewer/layer_viewer.js +1 -0
  724. package/static/devtools/layer_viewer/layer_viewer_module.js +1 -0
  725. package/static/devtools/layers/layers-legacy.js +1 -0
  726. package/static/devtools/layers/layers-meta.js +1 -0
  727. package/static/devtools/layers/layers.js +1 -0
  728. package/static/devtools/layers/layers_module.js +0 -0
  729. package/static/devtools/layers_test_runner/layers_test_runner.js +156 -0
  730. package/static/devtools/layers_test_runner/layers_test_runner_module.js +0 -0
  731. package/static/devtools/lighthouse/lighthouse-legacy.js +1 -0
  732. package/static/devtools/lighthouse/lighthouse-meta.js +1 -0
  733. package/static/devtools/lighthouse/lighthouse.js +70 -0
  734. package/static/devtools/lighthouse/lighthouse_module.js +1 -0
  735. package/static/devtools/lighthouse_test_runner/lighthouse_test_runner.js +136 -0
  736. package/static/devtools/lighthouse_test_runner/lighthouse_test_runner_module.js +0 -0
  737. package/static/devtools/lighthouse_worker/LighthouseService.js +195 -0
  738. package/static/devtools/lighthouse_worker/lighthouse_worker.js +6 -0
  739. package/static/devtools/lighthouse_worker.js +1 -0
  740. package/static/devtools/linear_memory_inspector/linear_memory_inspector-legacy.js +1 -0
  741. package/static/devtools/linear_memory_inspector/linear_memory_inspector-meta.js +1 -0
  742. package/static/devtools/linear_memory_inspector/linear_memory_inspector.js +399 -0
  743. package/static/devtools/linear_memory_inspector/linear_memory_inspector_module.js +0 -0
  744. package/static/devtools/main/main-legacy.js +1 -0
  745. package/static/devtools/main/main.js +1 -0
  746. package/static/devtools/media/media-legacy.js +1 -0
  747. package/static/devtools/media/media-meta.js +1 -0
  748. package/static/devtools/media/media.js +1 -0
  749. package/static/devtools/media/media_module.js +1 -0
  750. package/static/devtools/mobile_throttling/mobile_throttling-legacy.js +1 -0
  751. package/static/devtools/mobile_throttling/mobile_throttling-meta.js +1 -0
  752. package/static/devtools/mobile_throttling/mobile_throttling.js +1 -0
  753. package/static/devtools/ndb_app.html +20 -0
  754. package/static/devtools/ndb_app.js +1 -0
  755. package/static/devtools/network/network-legacy.js +1 -0
  756. package/static/devtools/network/network-meta.js +1 -0
  757. package/static/devtools/network/network.js +72 -0
  758. package/static/devtools/network/network_module.js +1 -0
  759. package/static/devtools/network_test_runner/network_test_runner.js +280 -0
  760. package/static/devtools/network_test_runner/network_test_runner_module.js +0 -0
  761. package/static/devtools/node_app.html +20 -0
  762. package/static/devtools/node_app.js +1 -0
  763. package/static/devtools/node_debugger/node_debugger-meta.js +1 -0
  764. package/static/devtools/node_debugger/node_debugger.js +1 -0
  765. package/static/devtools/node_debugger/node_debugger_module.js +0 -0
  766. package/static/devtools/node_main/node_main-legacy.js +1 -0
  767. package/static/devtools/node_main/node_main-meta.js +1 -0
  768. package/static/devtools/node_main/node_main.js +1 -0
  769. package/static/devtools/object_ui/object_ui-legacy.js +1 -0
  770. package/static/devtools/object_ui/object_ui.js +3 -0
  771. package/static/devtools/object_ui/object_ui_module.js +1 -0
  772. package/static/devtools/perf_ui/perf_ui-legacy.js +1 -0
  773. package/static/devtools/perf_ui/perf_ui.js +152 -0
  774. package/static/devtools/perf_ui/perf_ui_module.js +1 -0
  775. package/static/devtools/performance_monitor/performance_monitor-legacy.js +1 -0
  776. package/static/devtools/performance_monitor/performance_monitor-meta.js +1 -0
  777. package/static/devtools/performance_monitor/performance_monitor.js +1 -0
  778. package/static/devtools/performance_monitor/performance_monitor_module.js +1 -0
  779. package/static/devtools/performance_test_runner/TimelineDataTestRunner.js +5375 -0
  780. package/static/devtools/performance_test_runner/TimelineTestRunner.js +446 -0
  781. package/static/devtools/performance_test_runner/performance_test_runner.js +6 -0
  782. package/static/devtools/performance_test_runner/performance_test_runner_module.js +0 -0
  783. package/static/devtools/persistence/persistence-legacy.js +1 -0
  784. package/static/devtools/persistence/persistence-meta.js +1 -0
  785. package/static/devtools/persistence/persistence.js +1 -0
  786. package/static/devtools/platform/platform.js +1 -0
  787. package/static/devtools/profiler/profiler-legacy.js +1 -0
  788. package/static/devtools/profiler/profiler-meta.js +1 -0
  789. package/static/devtools/profiler/profiler.js +8 -0
  790. package/static/devtools/profiler/profiler_module.js +1 -0
  791. package/static/devtools/protocol_client/protocol_client-legacy.js +1 -0
  792. package/static/devtools/protocol_client/protocol_client.js +1 -0
  793. package/static/devtools/protocol_monitor/protocol_monitor-legacy.js +1 -0
  794. package/static/devtools/protocol_monitor/protocol_monitor-meta.js +1 -0
  795. package/static/devtools/protocol_monitor/protocol_monitor.js +1 -0
  796. package/static/devtools/protocol_monitor/protocol_monitor_module.js +1 -0
  797. package/static/devtools/quick_open/quick_open-legacy.js +1 -0
  798. package/static/devtools/quick_open/quick_open.js +1 -0
  799. package/static/devtools/quick_open/quick_open_module.js +1 -0
  800. package/static/devtools/recorder/recorder.js +1 -0
  801. package/static/devtools/resources/resources-legacy.js +1 -0
  802. package/static/devtools/resources/resources-meta.js +1 -0
  803. package/static/devtools/resources/resources.js +28 -0
  804. package/static/devtools/resources/resources_module.js +1 -0
  805. package/static/devtools/root/root-legacy.js +1 -0
  806. package/static/devtools/root/root.js +1 -0
  807. package/static/devtools/screencast/screencast-legacy.js +1 -0
  808. package/static/devtools/screencast/screencast.js +1 -0
  809. package/static/devtools/sdk/sdk-legacy.js +1 -0
  810. package/static/devtools/sdk/sdk.js +2 -0
  811. package/static/devtools/sdk_test_runner/sdk_test_runner.js +297 -0
  812. package/static/devtools/sdk_test_runner/sdk_test_runner_module.js +0 -0
  813. package/static/devtools/search/search-legacy.js +1 -0
  814. package/static/devtools/search/search.js +1 -0
  815. package/static/devtools/search/search_module.js +1 -0
  816. package/static/devtools/security/security-legacy.js +1 -0
  817. package/static/devtools/security/security-meta.js +1 -0
  818. package/static/devtools/security/security.js +1 -0
  819. package/static/devtools/security/security_module.js +1 -0
  820. package/static/devtools/security_test_runner/security_test_runner.js +32 -0
  821. package/static/devtools/security_test_runner/security_test_runner_module.js +0 -0
  822. package/static/devtools/services/services-legacy.js +1 -0
  823. package/static/devtools/services/services.js +1 -0
  824. package/static/devtools/settings/settings-legacy.js +1 -0
  825. package/static/devtools/settings/settings-meta.js +1 -0
  826. package/static/devtools/settings/settings.js +1 -0
  827. package/static/devtools/settings/settings_module.js +1 -0
  828. package/static/devtools/shell.js +1 -0
  829. package/static/devtools/snippets/snippets-legacy.js +1 -0
  830. package/static/devtools/snippets/snippets.js +1 -0
  831. package/static/devtools/snippets/snippets_module.js +0 -0
  832. package/static/devtools/source_frame/source_frame-legacy.js +1 -0
  833. package/static/devtools/source_frame/source_frame.js +1 -0
  834. package/static/devtools/source_frame/source_frame_module.js +1 -0
  835. package/static/devtools/sources/sources-legacy.js +1 -0
  836. package/static/devtools/sources/sources-meta.js +1 -0
  837. package/static/devtools/sources/sources.js +13 -0
  838. package/static/devtools/sources/sources_module.js +1 -0
  839. package/static/devtools/sources_test_runner/AutocompleteTestRunner.js +46 -0
  840. package/static/devtools/sources_test_runner/DebuggerTestRunner.js +895 -0
  841. package/static/devtools/sources_test_runner/EditorTestRunner.js +237 -0
  842. package/static/devtools/sources_test_runner/LiveEditTestRunner.js +33 -0
  843. package/static/devtools/sources_test_runner/SearchTestRunner.js +158 -0
  844. package/static/devtools/sources_test_runner/SourcesTestRunner.js +173 -0
  845. package/static/devtools/sources_test_runner/sources_test_runner.js +10 -0
  846. package/static/devtools/sources_test_runner/sources_test_runner_module.js +0 -0
  847. package/static/devtools/startup/startup.js +1 -0
  848. package/static/devtools/test_runner/test_runner.js +1 -0
  849. package/static/devtools/text_editor/text_editor-legacy.js +1 -0
  850. package/static/devtools/text_editor/text_editor.js +1 -0
  851. package/static/devtools/text_editor/text_editor_module.js +1 -0
  852. package/static/devtools/text_utils/text_utils-legacy.js +1 -0
  853. package/static/devtools/text_utils/text_utils.js +1 -0
  854. package/static/devtools/theme_support/theme_support.js +1 -0
  855. package/static/devtools/third_party/acorn/acorn-tsconfig.json +8 -0
  856. package/static/devtools/third_party/acorn/acorn.js +1 -0
  857. package/static/devtools/third_party/acorn/package/dist/acorn.d.ts +209 -0
  858. package/static/devtools/third_party/acorn/package/dist/acorn.mjs +5261 -0
  859. package/static/devtools/third_party/acorn/package/dist/acorn.mjs.d.ts +2 -0
  860. package/static/devtools/third_party/acorn/package/dist/acorn.mjs.map +1 -0
  861. package/static/devtools/third_party/acorn-loose/acorn-loose-tsconfig.json +8 -0
  862. package/static/devtools/third_party/acorn-loose/package/dist/acorn-loose.d.ts +16 -0
  863. package/static/devtools/third_party/acorn-loose/package/dist/acorn-loose.mjs +1418 -0
  864. package/static/devtools/third_party/axe-core/axe.js +16423 -0
  865. package/static/devtools/third_party/chromium/chromium-tsconfig.json +8 -0
  866. package/static/devtools/third_party/chromium/client-variations/ClientVariations.d.ts +13 -0
  867. package/static/devtools/third_party/chromium/client-variations/ClientVariations.js +27 -0
  868. package/static/devtools/third_party/codemirror/codemirror-tsconfig.json +72 -0
  869. package/static/devtools/third_party/codemirror/package/addon/comment/comment.d.ts +4 -0
  870. package/static/devtools/third_party/codemirror/package/addon/comment/comment.js +211 -0
  871. package/static/devtools/third_party/codemirror/package/addon/edit/closebrackets.d.ts +1 -0
  872. package/static/devtools/third_party/codemirror/package/addon/edit/closebrackets.js +201 -0
  873. package/static/devtools/third_party/codemirror/package/addon/edit/matchbrackets.d.ts +1 -0
  874. package/static/devtools/third_party/codemirror/package/addon/edit/matchbrackets.js +158 -0
  875. package/static/devtools/third_party/codemirror/package/addon/fold/brace-fold.d.ts +1 -0
  876. package/static/devtools/third_party/codemirror/package/addon/fold/brace-fold.js +105 -0
  877. package/static/devtools/third_party/codemirror/package/addon/fold/foldcode.d.ts +1 -0
  878. package/static/devtools/third_party/codemirror/package/addon/fold/foldcode.js +157 -0
  879. package/static/devtools/third_party/codemirror/package/addon/fold/foldgutter.d.ts +1 -0
  880. package/static/devtools/third_party/codemirror/package/addon/fold/foldgutter.js +163 -0
  881. package/static/devtools/third_party/codemirror/package/addon/mode/multiplex.d.ts +1 -0
  882. package/static/devtools/third_party/codemirror/package/addon/mode/multiplex.js +131 -0
  883. package/static/devtools/third_party/codemirror/package/addon/mode/overlay.d.ts +1 -0
  884. package/static/devtools/third_party/codemirror/package/addon/mode/overlay.js +90 -0
  885. package/static/devtools/third_party/codemirror/package/addon/mode/simple.d.ts +1 -0
  886. package/static/devtools/third_party/codemirror/package/addon/mode/simple.js +216 -0
  887. package/static/devtools/third_party/codemirror/package/addon/runmode/runmode-standalone.d.ts +1 -0
  888. package/static/devtools/third_party/codemirror/package/addon/runmode/runmode-standalone.js +333 -0
  889. package/static/devtools/third_party/codemirror/package/addon/selection/active-line.d.ts +1 -0
  890. package/static/devtools/third_party/codemirror/package/addon/selection/active-line.js +72 -0
  891. package/static/devtools/third_party/codemirror/package/addon/selection/mark-selection.d.ts +1 -0
  892. package/static/devtools/third_party/codemirror/package/addon/selection/mark-selection.js +119 -0
  893. package/static/devtools/third_party/codemirror/package/lib/codemirror.d.ts +1 -0
  894. package/static/devtools/third_party/codemirror/package/lib/codemirror.js +9800 -0
  895. package/static/devtools/third_party/codemirror/package/mode/clike/clike.d.ts +4 -0
  896. package/static/devtools/third_party/codemirror/package/mode/clike/clike.js +935 -0
  897. package/static/devtools/third_party/codemirror/package/mode/clojure/clojure.d.ts +4 -0
  898. package/static/devtools/third_party/codemirror/package/mode/clojure/clojure.js +292 -0
  899. package/static/devtools/third_party/codemirror/package/mode/coffeescript/coffeescript.d.ts +4 -0
  900. package/static/devtools/third_party/codemirror/package/mode/coffeescript/coffeescript.js +359 -0
  901. package/static/devtools/third_party/codemirror/package/mode/css/css.d.ts +1 -0
  902. package/static/devtools/third_party/codemirror/package/mode/css/css.js +864 -0
  903. package/static/devtools/third_party/codemirror/package/mode/htmlembedded/htmlembedded.d.ts +1 -0
  904. package/static/devtools/third_party/codemirror/package/mode/htmlembedded/htmlembedded.js +37 -0
  905. package/static/devtools/third_party/codemirror/package/mode/htmlmixed/htmlmixed.d.ts +1 -0
  906. package/static/devtools/third_party/codemirror/package/mode/htmlmixed/htmlmixed.js +153 -0
  907. package/static/devtools/third_party/codemirror/package/mode/javascript/javascript.d.ts +1 -0
  908. package/static/devtools/third_party/codemirror/package/mode/javascript/javascript.js +942 -0
  909. package/static/devtools/third_party/codemirror/package/mode/jsx/jsx.d.ts +4 -0
  910. package/static/devtools/third_party/codemirror/package/mode/jsx/jsx.js +148 -0
  911. package/static/devtools/third_party/codemirror/package/mode/livescript/livescript.d.ts +4 -0
  912. package/static/devtools/third_party/codemirror/package/mode/livescript/livescript.js +280 -0
  913. package/static/devtools/third_party/codemirror/package/mode/markdown/markdown.d.ts +1 -0
  914. package/static/devtools/third_party/codemirror/package/mode/markdown/markdown.js +886 -0
  915. package/static/devtools/third_party/codemirror/package/mode/php/php.d.ts +1 -0
  916. package/static/devtools/third_party/codemirror/package/mode/php/php.js +234 -0
  917. package/static/devtools/third_party/codemirror/package/mode/python/python.d.ts +1 -0
  918. package/static/devtools/third_party/codemirror/package/mode/python/python.js +399 -0
  919. package/static/devtools/third_party/codemirror/package/mode/shell/shell.d.ts +1 -0
  920. package/static/devtools/third_party/codemirror/package/mode/shell/shell.js +168 -0
  921. package/static/devtools/third_party/codemirror/package/mode/wast/wast.d.ts +1 -0
  922. package/static/devtools/third_party/codemirror/package/mode/wast/wast.js +41 -0
  923. package/static/devtools/third_party/codemirror/package/mode/xml/xml.d.ts +1 -0
  924. package/static/devtools/third_party/codemirror/package/mode/xml/xml.js +413 -0
  925. package/static/devtools/third_party/i18n/bundle-tsconfig.json +8 -0
  926. package/static/devtools/third_party/i18n/i18n.d.ts +108 -0
  927. package/static/devtools/third_party/i18n/i18n.js +4336 -0
  928. package/static/devtools/third_party/lighthouse/lighthouse-dt-bundle.d.ts +1 -0
  929. package/static/devtools/third_party/lighthouse/lighthouse-dt-bundle.js +1140 -0
  930. package/static/devtools/third_party/lighthouse/lighthouse-tsconfig.json +10 -0
  931. package/static/devtools/third_party/lighthouse/locales/ar-XB.json +2066 -0
  932. package/static/devtools/third_party/lighthouse/locales/ar.json +2066 -0
  933. package/static/devtools/third_party/lighthouse/locales/bg.json +2066 -0
  934. package/static/devtools/third_party/lighthouse/locales/ca.json +2066 -0
  935. package/static/devtools/third_party/lighthouse/locales/cs.json +2066 -0
  936. package/static/devtools/third_party/lighthouse/locales/da.json +2066 -0
  937. package/static/devtools/third_party/lighthouse/locales/de.json +2066 -0
  938. package/static/devtools/third_party/lighthouse/locales/el.json +2066 -0
  939. package/static/devtools/third_party/lighthouse/locales/en-GB.json +2066 -0
  940. package/static/devtools/third_party/lighthouse/locales/en-US.json +2297 -0
  941. package/static/devtools/third_party/lighthouse/locales/en-XA.json +2066 -0
  942. package/static/devtools/third_party/lighthouse/locales/en-XL.json +2297 -0
  943. package/static/devtools/third_party/lighthouse/locales/es-419.json +2066 -0
  944. package/static/devtools/third_party/lighthouse/locales/es.json +2066 -0
  945. package/static/devtools/third_party/lighthouse/locales/fi.json +2066 -0
  946. package/static/devtools/third_party/lighthouse/locales/fil.json +2066 -0
  947. package/static/devtools/third_party/lighthouse/locales/fr.json +2066 -0
  948. package/static/devtools/third_party/lighthouse/locales/he.json +2066 -0
  949. package/static/devtools/third_party/lighthouse/locales/hi.json +2066 -0
  950. package/static/devtools/third_party/lighthouse/locales/hr.json +2066 -0
  951. package/static/devtools/third_party/lighthouse/locales/hu.json +2066 -0
  952. package/static/devtools/third_party/lighthouse/locales/id.json +2066 -0
  953. package/static/devtools/third_party/lighthouse/locales/it.json +2066 -0
  954. package/static/devtools/third_party/lighthouse/locales/ja.json +2066 -0
  955. package/static/devtools/third_party/lighthouse/locales/ko.json +2066 -0
  956. package/static/devtools/third_party/lighthouse/locales/lt.json +2066 -0
  957. package/static/devtools/third_party/lighthouse/locales/lv.json +2066 -0
  958. package/static/devtools/third_party/lighthouse/locales/nl.json +2066 -0
  959. package/static/devtools/third_party/lighthouse/locales/no.json +2066 -0
  960. package/static/devtools/third_party/lighthouse/locales/pl.json +2066 -0
  961. package/static/devtools/third_party/lighthouse/locales/pt-PT.json +2066 -0
  962. package/static/devtools/third_party/lighthouse/locales/pt.json +2066 -0
  963. package/static/devtools/third_party/lighthouse/locales/ro.json +2066 -0
  964. package/static/devtools/third_party/lighthouse/locales/ru.json +2066 -0
  965. package/static/devtools/third_party/lighthouse/locales/sk.json +2066 -0
  966. package/static/devtools/third_party/lighthouse/locales/sl.json +2066 -0
  967. package/static/devtools/third_party/lighthouse/locales/sr-Latn.json +2066 -0
  968. package/static/devtools/third_party/lighthouse/locales/sr.json +2066 -0
  969. package/static/devtools/third_party/lighthouse/locales/sv.json +2066 -0
  970. package/static/devtools/third_party/lighthouse/locales/ta.json +2066 -0
  971. package/static/devtools/third_party/lighthouse/locales/te.json +2066 -0
  972. package/static/devtools/third_party/lighthouse/locales/th.json +2066 -0
  973. package/static/devtools/third_party/lighthouse/locales/tr.json +2066 -0
  974. package/static/devtools/third_party/lighthouse/locales/uk.json +2066 -0
  975. package/static/devtools/third_party/lighthouse/locales/vi.json +2066 -0
  976. package/static/devtools/third_party/lighthouse/locales/zh-HK.json +2066 -0
  977. package/static/devtools/third_party/lighthouse/locales/zh-TW.json +2066 -0
  978. package/static/devtools/third_party/lighthouse/locales/zh.json +2066 -0
  979. package/static/devtools/third_party/lighthouse/report-assets/report-generator.d.ts +1 -0
  980. package/static/devtools/third_party/lighthouse/report-assets/report-generator.js +167 -0
  981. package/static/devtools/third_party/lighthouse/report-assets/report.d.ts +1 -0
  982. package/static/devtools/third_party/lighthouse/report-assets/report.js +5032 -0
  983. package/static/devtools/third_party/lit-html/lit-html-tsconfig.json +22 -0
  984. package/static/devtools/third_party/lit-html/lit-html.js +120 -0
  985. package/static/devtools/third_party/lit-html/package/directives/class-map.d.ts +28 -0
  986. package/static/devtools/third_party/lit-html/package/directives/class-map.js +101 -0
  987. package/static/devtools/third_party/lit-html/package/directives/class-map.js.map +1 -0
  988. package/static/devtools/third_party/lit-html/package/directives/if-defined.d.ts +22 -0
  989. package/static/devtools/third_party/lit-html/package/directives/if-defined.js +37 -0
  990. package/static/devtools/third_party/lit-html/package/directives/if-defined.js.map +1 -0
  991. package/static/devtools/third_party/lit-html/package/directives/live.d.ts +38 -0
  992. package/static/devtools/third_party/lit-html/package/directives/live.js +73 -0
  993. package/static/devtools/third_party/lit-html/package/directives/live.js.map +1 -0
  994. package/static/devtools/third_party/lit-html/package/directives/repeat.d.ts +37 -0
  995. package/static/devtools/third_party/lit-html/package/directives/repeat.js +415 -0
  996. package/static/devtools/third_party/lit-html/package/directives/repeat.js.map +1 -0
  997. package/static/devtools/third_party/lit-html/package/directives/style-map.d.ts +36 -0
  998. package/static/devtools/third_party/lit-html/package/directives/style-map.js +78 -0
  999. package/static/devtools/third_party/lit-html/package/directives/style-map.js.map +1 -0
  1000. package/static/devtools/third_party/lit-html/package/lib/default-template-processor.d.ts +39 -0
  1001. package/static/devtools/third_party/lit-html/package/lib/default-template-processor.js +52 -0
  1002. package/static/devtools/third_party/lit-html/package/lib/default-template-processor.js.map +1 -0
  1003. package/static/devtools/third_party/lit-html/package/lib/directive.d.ts +59 -0
  1004. package/static/devtools/third_party/lit-html/package/lib/directive.js +63 -0
  1005. package/static/devtools/third_party/lit-html/package/lib/directive.js.map +1 -0
  1006. package/static/devtools/third_party/lit-html/package/lib/dom.d.ts +29 -0
  1007. package/static/devtools/third_party/lit-html/package/lib/dom.js +44 -0
  1008. package/static/devtools/third_party/lit-html/package/lib/dom.js.map +1 -0
  1009. package/static/devtools/third_party/lit-html/package/lib/part.d.ts +46 -0
  1010. package/static/devtools/third_party/lit-html/package/lib/part.js +23 -0
  1011. package/static/devtools/third_party/lit-html/package/lib/part.js.map +1 -0
  1012. package/static/devtools/third_party/lit-html/package/lib/parts.d.ts +148 -0
  1013. package/static/devtools/third_party/lit-html/package/lib/parts.js +476 -0
  1014. package/static/devtools/third_party/lit-html/package/lib/parts.js.map +1 -0
  1015. package/static/devtools/third_party/lit-html/package/lib/render.d.ts +33 -0
  1016. package/static/devtools/third_party/lit-html/package/lib/render.js +43 -0
  1017. package/static/devtools/third_party/lit-html/package/lib/render.js.map +1 -0
  1018. package/static/devtools/third_party/lit-html/package/lib/template-factory.d.ts +57 -0
  1019. package/static/devtools/third_party/lit-html/package/lib/template-factory.js +48 -0
  1020. package/static/devtools/third_party/lit-html/package/lib/template-factory.js.map +1 -0
  1021. package/static/devtools/third_party/lit-html/package/lib/template-instance.d.ts +30 -0
  1022. package/static/devtools/third_party/lit-html/package/lib/template-instance.js +134 -0
  1023. package/static/devtools/third_party/lit-html/package/lib/template-instance.js.map +1 -0
  1024. package/static/devtools/third_party/lit-html/package/lib/template-result.d.ts +42 -0
  1025. package/static/devtools/third_party/lit-html/package/lib/template-result.js +131 -0
  1026. package/static/devtools/third_party/lit-html/package/lib/template-result.js.map +1 -0
  1027. package/static/devtools/third_party/lit-html/package/lib/template.d.ts +92 -0
  1028. package/static/devtools/third_party/lit-html/package/lib/template.js +215 -0
  1029. package/static/devtools/third_party/lit-html/package/lib/template.js.map +1 -0
  1030. package/static/devtools/third_party/lit-html/package/lit-html.d.ts +42 -0
  1031. package/static/devtools/third_party/lit-html/package/lit-html.js +59 -0
  1032. package/static/devtools/third_party/lit-html/package/lit-html.js.map +1 -0
  1033. package/static/devtools/third_party/marked/marked-tsconfig.json +8 -0
  1034. package/static/devtools/third_party/marked/marked.js +1 -0
  1035. package/static/devtools/third_party/marked/package/lib/marked.esm.d.ts +1 -0
  1036. package/static/devtools/third_party/marked/package/lib/marked.esm.js +2584 -0
  1037. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts +53 -0
  1038. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts.map +1 -0
  1039. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.js +64 -0
  1040. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts +176 -0
  1041. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.d.ts.map +1 -0
  1042. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Accessibility.js +356 -0
  1043. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts +21 -0
  1044. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.d.ts.map +1 -0
  1045. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +81 -0
  1046. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +423 -0
  1047. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts.map +1 -0
  1048. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +516 -0
  1049. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +39 -0
  1050. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -0
  1051. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +76 -0
  1052. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts +26 -0
  1053. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.d.ts.map +1 -0
  1054. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserWebSocketTransport.js +30 -0
  1055. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +120 -0
  1056. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts.map +1 -0
  1057. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.js +266 -0
  1058. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts +22 -0
  1059. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.d.ts.map +1 -0
  1060. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectionTransport.js +15 -0
  1061. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +72 -0
  1062. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -0
  1063. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +60 -0
  1064. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +181 -0
  1065. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts.map +1 -0
  1066. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +316 -0
  1067. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +174 -0
  1068. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -0
  1069. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +647 -0
  1070. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts +53 -0
  1071. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.d.ts.map +1 -0
  1072. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Debug.js +77 -0
  1073. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts +33 -0
  1074. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.d.ts.map +1 -0
  1075. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/DeviceDescriptors.js +873 -0
  1076. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +76 -0
  1077. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts.map +1 -0
  1078. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.js +92 -0
  1079. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.d.ts +25 -0
  1080. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.d.ts.map +1 -0
  1081. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EmulationManager.js +33 -0
  1082. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts +34 -0
  1083. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.d.ts.map +1 -0
  1084. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Errors.js +37 -0
  1085. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts +59 -0
  1086. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts.map +1 -0
  1087. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.js +15 -0
  1088. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts +89 -0
  1089. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.d.ts.map +1 -0
  1090. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/EventEmitter.js +109 -0
  1091. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.d.ts +82 -0
  1092. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.d.ts.map +1 -0
  1093. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Events.js +83 -0
  1094. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +189 -0
  1095. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts.map +1 -0
  1096. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.js +313 -0
  1097. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +60 -0
  1098. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts.map +1 -0
  1099. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.js +66 -0
  1100. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +735 -0
  1101. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts.map +1 -0
  1102. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +962 -0
  1103. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +276 -0
  1104. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -0
  1105. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +421 -0
  1106. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +128 -0
  1107. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -0
  1108. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +150 -0
  1109. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +322 -0
  1110. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts.map +1 -0
  1111. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.js +463 -0
  1112. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +439 -0
  1113. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -0
  1114. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +724 -0
  1115. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +62 -0
  1116. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -0
  1117. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +145 -0
  1118. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +80 -0
  1119. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -0
  1120. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +262 -0
  1121. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts +152 -0
  1122. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.d.ts.map +1 -0
  1123. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PDFOptions.js +31 -0
  1124. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts +910 -0
  1125. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.d.ts.map +1 -0
  1126. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +1343 -0
  1127. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.d.ts +21 -0
  1128. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.d.ts.map +1 -0
  1129. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Product.js +15 -0
  1130. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +135 -0
  1131. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts.map +1 -0
  1132. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +133 -0
  1133. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.d.ts +24 -0
  1134. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.d.ts.map +1 -0
  1135. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/PuppeteerViewport.js +0 -0
  1136. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +66 -0
  1137. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts.map +1 -0
  1138. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.js +157 -0
  1139. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.d.ts +61 -0
  1140. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.d.ts.map +1 -0
  1141. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/SecurityDetails.js +72 -0
  1142. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +98 -0
  1143. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts.map +1 -0
  1144. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.js +137 -0
  1145. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.d.ts +28 -0
  1146. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.d.ts.map +1 -0
  1147. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/TimeoutSettings.js +43 -0
  1148. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts +47 -0
  1149. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.d.ts.map +1 -0
  1150. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/Tracing.js +94 -0
  1151. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.d.ts +40 -0
  1152. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.d.ts.map +1 -0
  1153. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/USKeyboardLayout.js +403 -0
  1154. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +102 -0
  1155. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts.map +1 -0
  1156. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +109 -0
  1157. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts +22 -0
  1158. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.d.ts.map +1 -0
  1159. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/assert.js +24 -0
  1160. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.d.ts +17 -0
  1161. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.d.ts.map +1 -0
  1162. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/fetch.js +20 -0
  1163. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts +66 -0
  1164. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.d.ts.map +1 -0
  1165. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +288 -0
  1166. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts +17 -0
  1167. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.d.ts.map +1 -0
  1168. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/environment.js +16 -0
  1169. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts +18 -0
  1170. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.d.ts.map +1 -0
  1171. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +39 -0
  1172. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.d.ts +18 -0
  1173. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.d.ts.map +1 -0
  1174. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/initialize-web.js +22 -0
  1175. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts +132 -0
  1176. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.d.ts.map +1 -0
  1177. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +468 -0
  1178. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts +40 -0
  1179. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -0
  1180. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +197 -0
  1181. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +42 -0
  1182. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -0
  1183. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js +0 -0
  1184. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +16 -0
  1185. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -0
  1186. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +469 -0
  1187. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +29 -0
  1188. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts.map +1 -0
  1189. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.js +34 -0
  1190. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts +31 -0
  1191. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts.map +1 -0
  1192. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +61 -0
  1193. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +156 -0
  1194. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts.map +1 -0
  1195. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +183 -0
  1196. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts +18 -0
  1197. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.d.ts.map +1 -0
  1198. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +151 -0
  1199. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.d.ts +18 -0
  1200. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.d.ts.map +1 -0
  1201. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.js +23 -0
  1202. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.d.ts +18 -0
  1203. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.d.ts.map +1 -0
  1204. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/node.js +22 -0
  1205. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +22 -0
  1206. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts.map +1 -0
  1207. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +19 -0
  1208. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.d.ts +18 -0
  1209. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.d.ts.map +1 -0
  1210. package/static/devtools/third_party/puppeteer/package/lib/esm/puppeteer/web.js +22 -0
  1211. package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.d.ts +22 -0
  1212. package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.d.ts.map +1 -0
  1213. package/static/devtools/third_party/puppeteer/package/lib/esm/vendor/mitt/src/index.js +53 -0
  1214. package/static/devtools/third_party/puppeteer/puppeteer-tsconfig.json +58 -0
  1215. package/static/devtools/third_party/puppeteer/puppeteer.js +1 -0
  1216. package/static/devtools/third_party/wasmparser/package/dist/esm/WasmDis.js +1595 -0
  1217. package/static/devtools/third_party/wasmparser/package/dist/esm/WasmParser.js +3120 -0
  1218. package/static/devtools/third_party/wasmparser/wasmparser-tsconfig.json +9 -0
  1219. package/static/devtools/timeline/timeline-legacy.js +1 -0
  1220. package/static/devtools/timeline/timeline-meta.js +1 -0
  1221. package/static/devtools/timeline/timeline.js +1 -0
  1222. package/static/devtools/timeline/timeline_module.js +1 -0
  1223. package/static/devtools/timeline_model/timeline_model-legacy.js +1 -0
  1224. package/static/devtools/timeline_model/timeline_model.js +1 -0
  1225. package/static/devtools/timeline_model/timeline_model_module.js +0 -0
  1226. package/static/devtools/toolbox.html +20 -0
  1227. package/static/devtools/toolbox.js +1 -0
  1228. package/static/devtools/toolbox_bootstrap/toolbox_bootstrap.js +1 -0
  1229. package/static/devtools/ui/components/components.js +378 -0
  1230. package/static/devtools/ui/ui-legacy.js +1 -0
  1231. package/static/devtools/ui/ui.js +3 -0
  1232. package/static/devtools/ui/utils/utils.js +1 -0
  1233. package/static/devtools/wasmparser_worker/wasmparser_worker-entrypoint.js +1 -0
  1234. package/static/devtools/wasmparser_worker/wasmparser_worker.js +1 -0
  1235. package/static/devtools/web_audio/graph_visualizer/graph_visualizer.js +1 -0
  1236. package/static/devtools/web_audio/web_audio-legacy.js +1 -0
  1237. package/static/devtools/web_audio/web_audio-meta.js +1 -0
  1238. package/static/devtools/web_audio/web_audio.js +23 -0
  1239. package/static/devtools/web_audio/web_audio_module.js +1 -0
  1240. package/static/devtools/webauthn/webauthn-legacy.js +1 -0
  1241. package/static/devtools/webauthn/webauthn-meta.js +1 -0
  1242. package/static/devtools/webauthn/webauthn.js +6 -0
  1243. package/static/devtools/webauthn/webauthn_module.js +1 -0
  1244. package/static/devtools/worker_app.html +20 -0
  1245. package/static/devtools/worker_app.js +1 -0
  1246. package/static/devtools/worker_main/worker_main-legacy.js +1 -0
  1247. package/static/devtools/worker_main/worker_main.js +1 -0
  1248. package/static/devtools/worker_service/worker_service.js +1 -0
  1249. package/static/devtools/workspace/workspace-legacy.js +1 -0
  1250. package/static/devtools/workspace/workspace.js +1 -0
  1251. package/static/devtools/workspace_diff/workspace_diff-legacy.js +1 -0
  1252. package/static/devtools/workspace_diff/workspace_diff.js +1 -0
  1253. package/static/devtools/workspace_diff/workspace_diff_module.js +0 -0
  1254. package/static/docs/swagger.json +2337 -279
  1255. package/static/function/client.js +1037 -992
  1256. package/build/routes/chromium/http/json-new.js +0 -23
  1257. package/build/routes/chromium/http/json-version-get.response.json +0 -37
  1258. package/build/routes/chromium/utils/cdp.d.ts +0 -2
  1259. package/build/routes/chromium/utils/cdp.js +0 -14
  1260. package/build/routes/chromium/ws/cdp-chromium.js +0 -10
  1261. package/src/routes/chromium/http/json-list.ts +0 -50
  1262. package/src/routes/chromium/utils/cdp.ts +0 -19
  1263. package/build/routes/{chromium/http/content-post.query.json → chrome/http/content.post.query.json} +0 -0
  1264. package/build/routes/{chromium/http/content-post.response.json → chrome/http/content.post.response.json} +0 -0
  1265. package/build/routes/{chromium/http/download-post.body.json → chrome/http/download.post.body.json} +0 -0
  1266. package/build/routes/{chromium/http/download-post.query.json → chrome/http/download.post.query.json} +0 -0
  1267. package/build/routes/{chromium/http/download-post.response.json → chrome/http/download.post.response.json} +0 -0
  1268. package/build/routes/{chromium/http/function-post.body.json → chrome/http/function.post.body.json} +0 -0
  1269. package/build/routes/{chromium/http/function-post.query.json → chrome/http/function.post.query.json} +0 -0
  1270. package/build/routes/{chromium/http/function-post.response.json → chrome/http/function.post.response.json} +0 -0
  1271. package/build/routes/{chromium/http/json-list.response.json → chrome/http/json-list.get.response.json} +0 -0
  1272. package/build/routes/{chromium/http/json-new.response.json → chrome/http/json-new.put.response.json} +0 -0
  1273. package/build/routes/{chromium/http/json-protocol-get.response.json → chrome/http/json-protocol.get.response.json} +0 -0
  1274. package/build/routes/{chromium/http/pdf-post.query.json → chrome/http/pdf.post.query.json} +0 -0
  1275. package/build/routes/{chromium/http/pdf-post.response.json → chrome/http/pdf.post.response.json} +0 -0
  1276. package/build/routes/{chromium/http/performance.body.json → chrome/http/performance.post.body.json} +0 -0
  1277. package/build/routes/{chromium/http/performance.query.json → chrome/http/performance.post.query.json} +0 -0
  1278. package/build/routes/{chromium/http/performance.response.json → chrome/http/performance.post.response.json} +0 -0
  1279. package/build/routes/{chromium/http/scrape-post.query.json → chrome/http/scrape.post.query.json} +0 -0
  1280. package/build/routes/{chromium/http/scrape-post.response.json → chrome/http/scrape.post.response.json} +0 -0
  1281. package/build/routes/{chromium/http/screenshot-post.query.json → chrome/http/screenshot.post.query.json} +0 -0
  1282. package/build/routes/{chromium/http/screenshot-post.response.json → chrome/http/screenshot.post.response.json} +0 -0
  1283. package/build/routes/{chromium/utils/performance/child.d.ts → chrome/tests/content.spec.d.ts} +0 -0
  1284. package/build/routes/{chromium/utils/performance/types.js → chrome/tests/download.spec.d.ts} +0 -0
  1285. package/build/routes/{chromium/ws/cdp-chromium.query.json → chrome/ws/browser.query.json} +0 -0
  1286. package/build/routes/{chromium/ws/playwright-chromium.query.json → chrome/ws/playwright.query.json} +0 -0
  1287. package/build/routes/{firefox/ws/playwright-firefox.query.json → chromium/ws/playwright.query.json} +0 -0
  1288. package/build/routes/{webkit/ws/playwright-webkit.query.json → firefox/ws/playwright.query.json} +0 -0
  1289. package/build/routes/management/http/{config-get.d.ts → config.get.d.ts} +0 -0
  1290. package/build/routes/management/http/{config-get.js → config.get.js} +0 -0
  1291. package/build/routes/management/http/{config-get.response.json → config.get.response.json} +0 -0
  1292. package/build/routes/management/http/{metrics-total-get.d.ts → metrics-total.get.d.ts} +0 -0
  1293. package/build/routes/management/http/{metrics-total-get.js → metrics-total.get.js} +0 -0
  1294. package/build/routes/management/http/{metrics-total-get.response.json → metrics-total.get.response.json} +0 -0
  1295. package/build/routes/management/http/{metrics-get.d.ts → metrics.get.d.ts} +0 -0
  1296. package/build/routes/management/http/{metrics-get.js → metrics.get.js} +0 -0
  1297. package/build/routes/management/http/{metrics-get.response.json → metrics.get.response.json} +0 -0
  1298. package/build/routes/management/http/{sessions-get.d.ts → sessions.get.d.ts} +0 -0
  1299. package/build/routes/management/http/{sessions-get.js → sessions.get.js} +0 -0
  1300. package/build/routes/management/http/{static-get.d.ts → static.get.d.ts} +0 -0
  1301. package/build/{routes/chromium/http/json-protocol-get.d.ts → shared/json-protocol.http.d.ts} +1 -1
  1302. package/build/{routes/chromium/http/json-version-get.d.ts → shared/json-version.http.d.ts} +1 -1
  1303. /package/build/{routes/chromium → shared}/utils/function/client.d.ts +0 -0
  1304. /package/build/{routes/chromium → shared}/utils/function/client.js +0 -0
  1305. /package/build/{routes/chromium → shared}/utils/function/handler.d.ts +0 -0
  1306. /package/build/{routes/chromium → shared}/utils/function/handler.js +0 -0
  1307. /package/build/{routes/chromium → shared}/utils/performance/child.js +0 -0
  1308. /package/build/{routes/chromium → shared}/utils/performance/main.d.ts +0 -0
  1309. /package/build/{routes/chromium → shared}/utils/performance/types.d.ts +0 -0
  1310. /package/src/routes/management/http/{config-get.ts → config.get.ts} +0 -0
  1311. /package/src/routes/management/http/{metrics-total-get.ts → metrics-total.get.ts} +0 -0
  1312. /package/src/routes/management/http/{metrics-get.ts → metrics.get.ts} +0 -0
  1313. /package/src/routes/management/http/{sessions-get.ts → sessions.get.ts} +0 -0
  1314. /package/src/{routes/chromium → shared}/utils/function/client.ts +0 -0
  1315. /package/src/{routes/chromium → shared}/utils/performance/child.ts +0 -0
  1316. /package/src/{routes/chromium → shared}/utils/performance/types.ts +0 -0
@@ -0,0 +1,8 @@
1
+ import{ArrayUtilities as e,NumberUtilities as t,DateUtilities as i,StringUtilities as s}from"../platform/platform.js";import{DataGrid as r,ShowMoreDataGridNode as o,SortableDataGrid as n}from"../data_grid/data_grid.js";import{i18n as a}from"../i18n/i18n.js";import{UIUtils as l,Icon as d,Tooltip as h,Widget as c,TreeOutline as p,InplaceEditor as u,ARIAUtils as _,ContextMenu as m,View as f,SearchableView as g,Toolbar as v,Context as S,ListModel as w,ListControl as b,InspectorView as C,Fragment as P,SplitWidget as T,TabbedPane as y,PopoverHelper as x,SettingsUI as E,Panel as I,ActionRegistry as N,ViewManager as R}from"../ui/ui.js";import{Color as D,ObjectWrapper as F,Settings as L,Revealer as H,UIString as k,ParsedURL as M,Console as O,Worker as z,Throttler as B}from"../common/common.js";import{Platform as j,userMetrics as V,UserMetrics as G}from"../host/host.js";import{FlameChart as A,OverviewGrid as W,LineLevelProfile as U,PieChart as J}from"../perf_ui/perf_ui.js";import{Linkifier as q}from"../components/components.js";import{SDKModel as $,CPUProfilerModel as Q,CPUProfileDataModel as K,IsolateManager as X,RuntimeModel as Y,HeapProfilerModel as Z,ProfileTreeModel as ee,ConsoleModel as te,RemoteObject as ie,ResourceTreeModel as se}from"../sdk/sdk.js";import{DebuggerWorkspaceBinding as re,FileUtils as oe,TempFile as ne}from"../bindings/bindings.js";import{Runtime as ae}from"../root/root.js";import{HeapSnapshotModel as le}from"../heap_snapshot_model/heap_snapshot_model.js";import{ObjectPopoverHelper as de}from"../object_ui/object_ui.js";import{Workspace as he}from"../workspace/workspace.js";const ce={notOptimizedS:"Not optimized: {PH1}",genericTextTwoPlaceholders:"{PH1}, {PH2}"},pe=a.registerUIStrings("profiler/ProfileDataGrid.js",ce),ue=a.getLocalizedString.bind(void 0,pe);class _e extends r.DataGridNode{constructor(e,t,i){super(null,i),this._searchMatchedSelfColumn=!1,this._searchMatchedTotalColumn=!1,this._searchMatchedFunctionColumn=!1,this.profileNode=e,this.tree=t,this.childrenByCallUID=new Map,this.lastComparator=null,this.callUID=e.callUID,this.self=e.self,this.total=e.total,this.functionName=l.beautifyFunctionName(e.functionName),this._deoptReason=e.deoptReason||"",this.url=e.url,this.linkElement=null,this._populated=!1}static sort(e,t,i){for(let s=0;s<e.length;++s){const r=e[s],o=r.length;for(let s=0;s<o;++s){const o=r[s];if(!(i||o.expanded&&o.lastComparator!==t)){o.children.length&&(o.shouldRefreshChildren=!0);continue}o.lastComparator=t;const n=o.children,a=n.length;if(a){n.sort(t);for(let e=0;e<a;++e)n[e].recalculateSiblings(e);e.push(n)}}}}static merge(e,t,i){e.self+=t.self,i||(e.total+=t.total);let s=e.children.slice();e.removeChildren();let r=s.length;for(let o=0;o<r;++o)i&&s[o]===t||e.appendChild(s[o]);s=t.children.slice(),r=s.length;for(let t=0;t<r;++t){const i=s[t],r=e.childrenByCallUID.get(i.callUID);r?r.merge(i,!1):e.appendChild(i)}}static populate(e){if(e._populated)return;e._populated=!0,e.populateChildren();const t=e.tree.lastComparator;t&&e.sort(t,!0)}createCell(e){switch(e){case"self":{const t=this._createValueCell(this.self,this.selfPercent,e);return t.classList.toggle("highlight",this._searchMatchedSelfColumn),t}case"total":{const t=this._createValueCell(this.total,this.totalPercent,e);return t.classList.toggle("highlight",this._searchMatchedTotalColumn),t}case"function":{const t=this.createTD(e);if(t.classList.toggle("highlight",this._searchMatchedFunctionColumn),this._deoptReason){t.classList.add("not-optimized");const e=d.Icon.create("smallicon-warning","profile-warn-marker");h.Tooltip.install(e,ue(ce.notOptimizedS,{PH1:this._deoptReason})),t.appendChild(e)}if(l.createTextChild(t,this.functionName),"0"===this.profileNode.scriptId)return t;const i=this.tree._formatter.linkifyNode(this);return i?(i.style.maxWidth="75%",t.appendChild(i),this.linkElement=i,t):t}}return super.createCell(e)}_createValueCell(e,t,i){const s=document.createElement("td");s.classList.add("numeric-column");const r=s.createChild("div","profile-multiple-values"),o=r.createChild("span"),n=this.tree._formatter.formatValue(e,this);o.textContent=n;const a=r.createChild("span","percent-column"),l=this.tree._formatter.formatPercent(t,this);a.textContent=l;const d=this.tree._formatter.formatValueAccessibleText(e,this);return this.setCellAccessibleName(ue(ce.genericTextTwoPlaceholders,{PH1:d,PH2:l}),s,i),s}sort(e,t){const i=e;return _e.sort([[this]],i,t)}insertChild(e,t){const i=e;super.insertChild(i,t),this.childrenByCallUID.set(i.callUID,i)}removeChild(e){super.removeChild(e),this.childrenByCallUID.delete(e.callUID)}removeChildren(){super.removeChildren(),this.childrenByCallUID.clear()}findChild(e){return e&&this.childrenByCallUID.get(e.callUID)||null}get selfPercent(){return this.self/this.tree.total*100}get totalPercent(){return this.total/this.tree.total*100}populate(){_e.populate(this)}populateChildren(){}save(){this._savedChildren||(this._savedSelf=this.self,this._savedTotal=this.total,this._savedChildren=this.children.slice())}restore(){if(!this._savedChildren)return;this._savedSelf&&this._savedTotal&&(this.self=this._savedSelf,this.total=this._savedTotal),this.removeChildren();const e=this._savedChildren,t=e.length;for(let i=0;i<t;++i)e[i].restore(),this.appendChild(e[i])}merge(e,t){_e.merge(this,e,t)}}class me{constructor(e,t,i){this.tree=this,this.self=0,this.children=[],this._formatter=e,this._searchableView=t,this.total=i,this.lastComparator=null,this.childrenByCallUID=new Map,this.deepSearch=!0,this._populated=!1,this._searchResults}static propertyComparator(e,t){let i=me.propertyComparators[t?1:0][e];return i||(i=t?function(t,i){return t[e]<i[e]?-1:t[e]>i[e]?1:0}:function(t,i){return t[e]>i[e]?-1:t[e]<i[e]?1:0},me.propertyComparators[t?1:0][e]=i),i}get expanded(){return!0}appendChild(e){this.insertChild(e,this.children.length)}focus(e){}exclude(e){}insertChild(e,t){const i=e;this.children.splice(t,0,i),this.childrenByCallUID.set(i.callUID,e)}removeChildren(){this.children=[],this.childrenByCallUID.clear()}populateChildren(){}findChild(e){return e?this.childrenByCallUID.get(e.callUID):null}sort(e,t){return _e.sort([[this]],e,t)}save(){this._savedChildren||(this._savedTotal=this.total,this._savedChildren=this.children.slice())}restore(){if(!this._savedChildren)return;this.children=this._savedChildren,this._savedTotal&&(this.total=this._savedTotal);const e=this.children,t=e.length;for(let i=0;i<t;++i)e[i].restore();this._savedChildren=null}_matchFunction(e){const t=e.query.trim();if(!t.length)return null;const i=t.startsWith(">"),s=t.startsWith("<");let r=t.startsWith("=")||(i||s)&&1===t.indexOf("=");const o=t.endsWith("%"),n=t.length>2&&t.endsWith("ms"),a=!n&&t.endsWith("s");let l=parseFloat(t);(i||s||r)&&(l=r&&(i||s)?parseFloat(t.substring(2)):parseFloat(t.substring(1)));const d=a?1e3*l:l;isNaN(l)||i||s||(r=!0);const h=createPlainTextSearchRegex(t,"i");return function(e){return e._searchMatchedSelfColumn=!1,e._searchMatchedTotalColumn=!1,e._searchMatchedFunctionColumn=!1,o?(s?(e.selfPercent<l&&(e._searchMatchedSelfColumn=!0),e.totalPercent<l&&(e._searchMatchedTotalColumn=!0)):i&&(e.selfPercent>l&&(e._searchMatchedSelfColumn=!0),e.totalPercent>l&&(e._searchMatchedTotalColumn=!0)),r&&(e.selfPercent===l&&(e._searchMatchedSelfColumn=!0),e.totalPercent===l&&(e._searchMatchedTotalColumn=!0))):(n||a)&&(s?(e.self<d&&(e._searchMatchedSelfColumn=!0),e.total<d&&(e._searchMatchedTotalColumn=!0)):i&&(e.self>d&&(e._searchMatchedSelfColumn=!0),e.total>d&&(e._searchMatchedTotalColumn=!0)),r&&(e.self===d&&(e._searchMatchedSelfColumn=!0),e.total===d&&(e._searchMatchedTotalColumn=!0))),(e.functionName.match(h)||e.url&&e.url.match(h))&&(e._searchMatchedFunctionColumn=!0),!!(e._searchMatchedSelfColumn||e._searchMatchedTotalColumn||e._searchMatchedFunctionColumn)&&(e.refresh(),!0)}}performSearch(e,t,i){this.searchCanceled();const s=this._matchFunction(e);if(!s)return;this._searchResults=[];const r=this.deepSearch;let o;for(o=this.children[0];o;o=o.traverseNextNode(!r,null,!r)){const e=o;if(!e)break;s(e)&&this._searchResults.push({profileNode:e})}this._searchResultIndex=i?0:this._searchResults.length-1,this._searchableView.updateSearchMatchesCount(this._searchResults.length),this._searchableView.updateCurrentMatchIndex(this._searchResultIndex)}searchCanceled(){if(this._searchResults)for(let e=0;e<this._searchResults.length;++e){const t=this._searchResults[e].profileNode;t._searchMatchedSelfColumn=!1,t._searchMatchedTotalColumn=!1,t._searchMatchedFunctionColumn=!1,t.refresh()}this._searchResults=[],this._searchResultIndex=-1}jumpToNextSearchResult(){this._searchResults&&this._searchResults.length&&(this._searchResultIndex=(this._searchResultIndex+1)%this._searchResults.length,this._jumpToSearchResult(this._searchResultIndex))}jumpToPreviousSearchResult(){this._searchResults&&this._searchResults.length&&(this._searchResultIndex=(this._searchResultIndex-1+this._searchResults.length)%this._searchResults.length,this._jumpToSearchResult(this._searchResultIndex))}supportsCaseSensitiveSearch(){return!0}supportsRegexSearch(){return!1}_jumpToSearchResult(e){const t=this._searchResults[e];if(!t)return;t.profileNode.revealAndSelect(),this._searchableView.updateCurrentMatchIndex(e)}}me.propertyComparators=[{},{}];var fe=Object.freeze({__proto__:null,UIStrings:ce,ProfileDataGridNode:_e,ProfileDataGridTree:me,Formatter:class{formatValue(e,t){throw new Error("Not implemented")}formatValueAccessibleText(e,t){throw new Error("Not implemented")}formatPercent(e,t){throw new Error("Not implemented")}linkifyNode(e){throw new Error("Not implemented")}}});class ge extends _e{constructor(e,t){super(e,t,null!==e.parent&&Boolean(e.parent.parent)),this._remainingNodeInfos=[]}static _sharedPopulate(e){if(void 0===e._remainingNodeInfos)return;const t=e._remainingNodeInfos,i=t.length;for(let s=0;s<i;++s){const i=t[s],r=i.ancestor,o=i.focusNode;let n=e.findChild(r);if(n){const e=i.totalAccountedFor;n.self+=o.self,e||(n.total+=o.total)}else n=new ge(r,e.tree),r!==o&&(n.self=o.self,n.total=o.total),e.appendChild(n);const a=r.parent;a&&a.parent&&(i.ancestor=a,n._remainingNodeInfos||(n._remainingNodeInfos=[]),n._remainingNodeInfos.push(i))}delete e._remainingNodeInfos}_takePropertiesFromProfileDataGridNode(e){this.save(),this.self=e.self,this.total=e.total}_keepOnlyChild(e){this.save(),this.removeChildren(),this.appendChild(e)}_exclude(e){this._remainingNodeInfos&&this.populate(),this.save();const t=this.children;let i=this.children.length;for(;i--;)t[i]._exclude(e);const s=this.childrenByCallUID.get(e);s&&this.merge(s,!0)}restore(){super.restore(),this.children.length||this.setHasChildren(this._willHaveChildren(this.profileNode))}merge(e,t){this.self-=e.self,super.merge(e,t)}populateChildren(){ge._sharedPopulate(this)}_willHaveChildren(e){return Boolean(e.parent&&e.parent.parent)}}class ve extends me{constructor(e,t,i,s){super(e,t,s),this.deepSearch=!1;let r=0;const o=[[],[i]],n=new Map;this._remainingNodeInfos=[];for(let e=0;e<o.length;++e){const t=o[e],i=o[++e],s=i.length,a=new WeakMap;for(let e=0;e<s;++e){const s=i[e];if(a.get(s)||a.set(s,++r),s.parent){let e=n.get(s.callUID),i=!1;if(e){const s=t.length;for(let r=0;r<s;++r){const s=a.get(t[r]);if(s&&e.has(s)){i=!0;break}}}else e=new Set,n.set(s.callUID,e);const r=a.get(s);r&&e.add(r),this._remainingNodeInfos.push({ancestor:s,focusNode:s,totalAccountedFor:i})}const l=s.children;l.length&&(o.push(t.concat([s])),o.push(l))}}return _e.populate(this),this}focus(e){if(!e)return;this.save();let t=e,i=e;for(;t.parent&&t instanceof ge;)t._takePropertiesFromProfileDataGridNode(e),i=t,t=t.parent,t instanceof ge&&t._keepOnlyChild(i);this.children=[i],this.total=e.total}exclude(t){if(!t)return;this.save();const i=t.callUID,s=this.childrenByCallUID.get(i);s&&e.removeElement(this.children,s);const r=this.children,o=r.length;for(let e=0;e<o;++e)r[e]._exclude(i);this.lastComparator&&this.sort(this.lastComparator,!0)}populateChildren(){ge._sharedPopulate(this)}}var Se=Object.freeze({__proto__:null,NodeInfo:undefined,BottomUpProfileDataGridNode:ge,BottomUpProfileDataGridTree:ve});var we=Object.freeze({__proto__:null,ChildrenProvider:class{dispose(){}nodePosition(e){throw new Error("Not implemented yet")}isEmpty(){throw new Error("Not implemented yet")}serializeItemsRange(e,t){throw new Error("Not implemented yet")}sortAndRewind(e){throw new Error("Not implemented yet")}}});let be=null;class Ce{constructor(){this._colorGenerator=Ce.colorGenerator(),this._maxStackDepth=0,this.timelineData_=null,this.entryNodes=[]}static colorGenerator(){return be||(be=new D.Generator({min:30,max:330,count:void 0},{min:50,max:80,count:5},{min:80,max:90,count:3}),be.setColorForID("(idle)","hsl(0, 0%, 94%)"),be.setColorForID("(program)","hsl(0, 0%, 80%)"),be.setColorForID("(garbage collector)","hsl(0, 0%, 80%)")),be}minimumBoundary(){throw"Not implemented."}totalTime(){throw"Not implemented."}formatValue(e,t){return Number.preciseMillisToString(e,t)}maxStackDepth(){return this._maxStackDepth}timelineData(){return this.timelineData_||this._calculateTimelineData()}_calculateTimelineData(){throw"Not implemented."}prepareHighlightedEntryInfo(e){throw"Not implemented."}canJumpToEntry(e){return"0"!==this.entryNodes[e].scriptId}entryTitle(e){const t=this.entryNodes[e];return l.beautifyFunctionName(t.functionName)}entryFont(e){return this._font||(this._font="11px "+j.fontFamily(),this._boldFont="bold "+this._font),this.entryHasDeoptReason(e)?this._boldFont:this._font}entryHasDeoptReason(e){throw"Not implemented."}entryColor(e){const t=this.entryNodes[e];return this._colorGenerator.colorForID(t.url||("0"!==t.scriptId?t.scriptId:t.functionName))}decorateEntry(e,t,i,s,r,o,n){return!1}forceDecoration(e){return!1}textColor(e){return"#333"}navStartTimes(){return new Map}entryNodesLength(){return this.entryNodes.length}}class Pe extends c.VBox{constructor(e,t){super(),this.element.id="cpu-flame-chart",this._searchableView=e,this._overviewPane=new ye(t),this._overviewPane.show(this.element),this._mainPane=new A.FlameChart(t,this._overviewPane),this._mainPane.setBarHeight(15),this._mainPane.setTextBaseline(4),this._mainPane.setTextPadding(2),this._mainPane.show(this.element),this._mainPane.addEventListener(A.Events.EntrySelected,this._onEntrySelected,this),this._mainPane.addEventListener(A.Events.EntryInvoked,this._onEntryInvoked,this),this._entrySelected=!1,this._mainPane.addEventListener(A.Events.CanvasFocused,this._onEntrySelected,this),this._overviewPane.addEventListener(W.Events.WindowChanged,this._onWindowChanged,this),this._dataProvider=t,this._searchResults=[]}focus(){this._mainPane.focus()}_onWindowChanged(e){const t=e.data.windowTimeLeft,i=e.data.windowTimeRight;this._mainPane.setWindowTimes(t,i,!0)}selectRange(e,t){this._overviewPane._selectRange(e,t)}_onEntrySelected(e){if(e.data){const t=Number(e.data);this._mainPane.setSelectedEntry(t),this._entrySelected=-1!==t}else this._entrySelected||(this._mainPane.setSelectedEntry(0),this._entrySelected=!0)}_onEntryInvoked(e){this._onEntrySelected(e),this.dispatchEventToListeners(A.Events.EntryInvoked,e.data)}update(){this._overviewPane.update(),this._mainPane.update()}performSearch(e,t,i){const s=createPlainTextSearchRegex(e.query,e.caseSensitive?"":"i"),r=-1!==this._searchResultIndex?this._searchResults[this._searchResultIndex]:-1;this._searchResults=[];const o=this._dataProvider.entryNodesLength();for(let e=0;e<o;++e)this._dataProvider.entryTitle(e).match(s)&&this._searchResults.push(e);this._searchResults.length?(this._searchResultIndex=this._searchResults.indexOf(r),-1===this._searchResultIndex&&(this._searchResultIndex=i?this._searchResults.length-1:0),this._mainPane.setSelectedEntry(this._searchResults[this._searchResultIndex])):this.searchCanceled(),this._searchableView.updateSearchMatchesCount(this._searchResults.length),this._searchableView.updateCurrentMatchIndex(this._searchResultIndex)}searchCanceled(){this._mainPane.setSelectedEntry(-1),this._searchResults=[],this._searchResultIndex=-1}jumpToNextSearchResult(){this._searchResultIndex=(this._searchResultIndex+1)%this._searchResults.length,this._mainPane.setSelectedEntry(this._searchResults[this._searchResultIndex]),this._searchableView.updateCurrentMatchIndex(this._searchResultIndex)}jumpToPreviousSearchResult(){this._searchResultIndex=(this._searchResultIndex-1+this._searchResults.length)%this._searchResults.length,this._mainPane.setSelectedEntry(this._searchResults[this._searchResultIndex]),this._searchableView.updateCurrentMatchIndex(this._searchResultIndex)}supportsCaseSensitiveSearch(){return!0}supportsRegexSearch(){return!1}}class Te{constructor(e){this._formatter=e,this._minimumBoundaries,this._maximumBoundaries,this._xScaleFactor}_updateBoundaries(e){this._minimumBoundaries=e._dataProvider.minimumBoundary();const t=e._dataProvider.totalTime();this._maximumBoundaries=this._minimumBoundaries+t,this._xScaleFactor=e._overviewContainer.clientWidth/t}computePosition(e){return(e-this._minimumBoundaries)*this._xScaleFactor}formatValue(e,t){return this._formatter(e-this._minimumBoundaries,t)}maximumBoundary(){return this._maximumBoundaries}minimumBoundary(){return this._minimumBoundaries}zeroTime(){return this._minimumBoundaries}boundarySpan(){return this._maximumBoundaries-this._minimumBoundaries}}class ye extends c.VBox{constructor(e){super(),this.element.classList.add("cpu-profile-flame-chart-overview-pane"),this._overviewContainer=this.element.createChild("div","cpu-profile-flame-chart-overview-container"),this._overviewCalculator=new Te(e.formatValue),this._overviewGrid=new W.OverviewGrid("cpu-profile-flame-chart",this._overviewCalculator),this._overviewGrid.element.classList.add("fill"),this._overviewCanvas=this._overviewContainer.createChild("canvas","cpu-profile-flame-chart-overview-canvas"),this._overviewContainer.appendChild(this._overviewGrid.element),this._dataProvider=e,this._overviewGrid.addEventListener(W.Events.WindowChanged,this._onWindowChanged,this)}windowChanged(e,t){this._selectRange(e,t)}updateRangeSelection(e,t){}updateSelectedGroup(e,t){}_selectRange(e,t){const i=this._dataProvider.minimumBoundary(),s=this._dataProvider.totalTime();this._overviewGrid.setWindow((e-i)/s,(t-i)/s)}_onWindowChanged(e){const t={windowTimeLeft:e.data.rawStartValue,windowTimeRight:e.data.rawEndValue};this._windowTimeLeft=t.windowTimeLeft,this._windowTimeRight=t.windowTimeRight,this.dispatchEventToListeners(W.Events.WindowChanged,t)}_timelineData(){return this._dataProvider.timelineData()}onResize(){this._scheduleUpdate()}_scheduleUpdate(){this._updateTimerId||(this._updateTimerId=this.element.window().requestAnimationFrame(this.update.bind(this)))}update(){this._updateTimerId=0;this._timelineData()&&(this._resetCanvas(this._overviewContainer.clientWidth,this._overviewContainer.clientHeight-A.HeaderHeight),this._overviewCalculator._updateBoundaries(this),this._overviewGrid.updateDividers(this._overviewCalculator),this._drawOverviewCanvas())}_drawOverviewCanvas(){const e=this._overviewCanvas.width,t=this._overviewCanvas.height,i=this._calculateDrawData(e),s=this._overviewCanvas.getContext("2d");if(!s)throw new Error("Failed to get canvas context");const r=window.devicePixelRatio,o=t/(1.1*this._dataProvider.maxStackDepth());s.lineWidth=1,s.translate(.5,.5),s.strokeStyle="rgba(20,0,0,0.4)",s.fillStyle="rgba(214,225,254,0.8)",s.moveTo(-1,t+1),s.lineTo(-1,Math.round(t-i[0]*o-r));let n=0;for(let a=0;a<e;++a)n=Math.round(t-i[a]*o-r),s.lineTo(a,n);s.lineTo(e+1,n),s.lineTo(e+1,t+1),s.fill(),s.stroke(),s.closePath()}_calculateDrawData(e){const t=this._dataProvider,i=this._timelineData(),s=i.entryStartTimes,r=i.entryTotalTimes,o=i.entryLevels,n=s.length,a=this._dataProvider.minimumBoundary(),l=new Uint8Array(e),d=e/t.totalTime();for(let e=0;e<n;++e){const t=Math.floor((s[e]-a)*d),i=Math.floor((s[e]-a+r[e])*d);for(let s=t;s<=i;++s)l[s]=Math.max(l[s],o[e]+1)}return l}_resetCanvas(e,t){const i=window.devicePixelRatio;this._overviewCanvas.width=e*i,this._overviewCanvas.height=t*i,this._overviewCanvas.style.width=e+"px",this._overviewCanvas.style.height=t+"px"}}var xe=Object.freeze({__proto__:null,ProfileFlameChartDataProvider:Ce,CPUProfileFlameChart:Pe,OverviewCalculator:Te,OverviewPane:ye});class Ee extends F.ObjectWrapper{constructor(e,t){super(),this._profileType=e,this.title=t,this.uid=e.incrementProfileUid(),this._fromFile=!1,this.tempFile=null}setTitle(e){this.title=e,this.dispatchEventToListeners(Ne.ProfileTitleChanged,this)}profileType(){return this._profileType}updateStatus(e,t){this.dispatchEventToListeners(Ne.UpdateStatus,new Ie(e,t))}createSidebarTreeElement(e){throw new Error("Not implemented.")}createView(e){throw new Error("Not implemented.")}removeTempFile(){this.tempFile&&this.tempFile.remove()}dispose(){}canSaveToFile(){return!1}saveToFile(){throw new Error("Not implemented")}loadFromFile(e){throw new Error("Not implemented")}fromFile(){return this._fromFile}setFromFile(){this._fromFile=!0}setProfile(e){}}class Ie{constructor(e,t){this.subtitle=e,this.wait=t}}const Ne={UpdateStatus:Symbol("UpdateStatus"),ProfileReceived:Symbol("ProfileReceived"),ProfileTitleChanged:Symbol("ProfileTitleChanged")};class Re extends F.ObjectWrapper{constructor(e,t){super(),this._id=e,this._name=t,this._profiles=[],this._profileBeingRecorded=null,this._nextProfileUid=1,window.opener||window.addEventListener("unload",this._clearTempStorage.bind(this),!1)}typeName(){return""}nextProfileUid(){return this._nextProfileUid}incrementProfileUid(){return this._nextProfileUid++}hasTemporaryView(){return!1}fileExtension(){return null}get buttonTooltip(){return""}get id(){return this._id}get treeItemTitle(){return this._name}get name(){return this._name}buttonClicked(){return!1}get description(){return""}isInstantProfile(){return!1}isEnabled(){return!0}getProfiles(){return this._profiles.filter(function(e){return this._profileBeingRecorded!==e}.bind(this))}customContent(){return null}setCustomContentEnabled(e){}getProfile(e){for(let t=0;t<this._profiles.length;++t)if(this._profiles[t].uid===e)return this._profiles[t];return null}loadFromFile(e){let t=e.name;const i=this.fileExtension();i&&t.endsWith(i)&&(t=t.substr(0,t.length-i.length));const s=this.createProfileLoadedFromFile(t);return s.setFromFile(),this.setProfileBeingRecorded(s),this.addProfile(s),s.loadFromFile(e)}createProfileLoadedFromFile(e){throw new Error("Needs implemented.")}addProfile(e){this._profiles.push(e),this.dispatchEventToListeners(De.AddProfileHeader,e)}removeProfile(e){const t=this._profiles.indexOf(e);-1!==t&&(this._profiles.splice(t,1),this._disposeProfile(e))}_clearTempStorage(){for(let e=0;e<this._profiles.length;++e)this._profiles[e].removeTempFile()}profileBeingRecorded(){return this._profileBeingRecorded}setProfileBeingRecorded(e){this._profileBeingRecorded=e}profileBeingRecordedRemoved(){}reset(){for(const e of this._profiles.slice())this._disposeProfile(e);this._profiles=[],this._nextProfileUid=1}_disposeProfile(e){this.dispatchEventToListeners(De.RemoveProfileHeader,e),e.dispose(),this._profileBeingRecorded===e&&(this.profileBeingRecordedRemoved(),this.setProfileBeingRecorded(null))}}const De={AddProfileHeader:Symbol("add-profile-header"),ProfileComplete:Symbol("profile-complete"),RemoveProfileHeader:Symbol("remove-profile-header"),ViewUpdated:Symbol("view-updated")};var Fe=Object.freeze({__proto__:null,ProfileHeader:Ee,StatusUpdate:Ie,Events:Ne,ProfileType:Re,ProfileEvents:De,DataDisplayDelegate:class{showProfile(e){throw new Error("not implemented")}showObject(e,t){}async linkifyObject(e){throw new Error("not implemented")}}});const Le={save:"Save",saveWithEllipsis:"Save…",singlePlaceholder:"{PH1}",load:"Load…",delete:"Delete"},He=a.registerUIStrings("profiler/ProfileSidebarTreeElement.js",Le),ke=a.getLocalizedString.bind(void 0,He);let Me=null;function Oe(){return Me}function ze(e){Me=e}class Be extends p.TreeElement{constructor(e,t,i){super("",!1),this._iconElement=document.createElement("div"),this._iconElement.classList.add("icon"),this._titlesElement=document.createElement("div"),this._titlesElement.classList.add("titles"),this._titlesElement.classList.add("no-subtitle"),this._titleContainer=this._titlesElement.createChild("span","title-container"),this.titleElement=this._titleContainer.createChild("span","title"),this._subtitleElement=this._titlesElement.createChild("span","subtitle"),this.titleElement.textContent=t.title,this._className=i,this._small=!1,this._dataDisplayDelegate=e,this.profile=t,t.addEventListener(Ne.UpdateStatus,this._updateStatus,this),t.canSaveToFile()?this._createSaveLink():t.addEventListener(Ne.ProfileReceived,this._onProfileReceived,this)}_createSaveLink(){this._saveLinkElement=this._titleContainer.createChild("span","save-link"),this._saveLinkElement.textContent=ke(Le.save),this._saveLinkElement.addEventListener("click",this._saveProfile.bind(this),!1)}_onProfileReceived(e){this._createSaveLink()}_updateStatus(e){const t=e.data;null!==t.subtitle&&(this._subtitleElement.textContent=t.subtitle||"",this._titlesElement.classList.toggle("no-subtitle",!t.subtitle)),"boolean"==typeof t.wait&&this.listItemElement&&(this._iconElement.classList.toggle("spinner",t.wait),this.listItemElement.classList.toggle("wait",t.wait))}ondblclick(e){return this._editing||this._startEditing(e.target),!1}_startEditing(e){const t=e.enclosingNodeOrSelfWithClass("title");if(!t)return;const i=new u.Config(this._editingCommitted.bind(this),this._editingCancelled.bind(this));this._editing=u.InplaceEditor.startEditing(t,i)}_editingCommitted(e,t){delete this._editing,this.profile.setTitle(t)}_editingCancelled(){delete this._editing}dispose(){this.profile.removeEventListener(Ne.UpdateStatus,this._updateStatus,this),this.profile.removeEventListener(Ne.ProfileReceived,this._onProfileReceived,this)}onselect(){return this._dataDisplayDelegate.showProfile(this.profile),!0}ondelete(){return this.profile.profileType().removeProfile(this.profile),!0}onattach(){this._className&&this.listItemElement.classList.add(this._className),this._small&&this.listItemElement.classList.add("small"),this.listItemElement.append(this._iconElement,this._titlesElement),this.listItemElement.addEventListener("contextmenu",this._handleContextMenuEvent.bind(this),!0),_.setDescription(this.listItemElement,ke(Le.singlePlaceholder,{PH1:this.profile.profileType().name}))}_handleContextMenuEvent(e){const t=this.profile,i=new m.ContextMenu(e),s=Oe();if(!s)throw new Error("File selector element shared by ProfilePanel instances is missing");i.headerSection().appendItem(ke(Le.load),s.click.bind(s)),t.canSaveToFile()&&i.saveSection().appendItem(ke(Le.saveWithEllipsis),t.saveToFile.bind(t)),i.footerSection().appendItem(ke(Le.delete),this.ondelete.bind(this)),i.show()}_saveProfile(e){this.profile.saveToFile()}setSmall(e){this._small=e,this.listItemElement&&this.listItemElement.classList.toggle("small",this._small)}setMainTitle(e){this.titleElement.textContent=e}}var je=Object.freeze({__proto__:null,UIStrings:Le,setSharedFileSelectorElement:ze,ProfileSidebarTreeElement:Be});class Ve extends _e{constructor(e,t){super(e,t,Boolean(e.children&&e.children.length)),this._remainingChildren=e.children}static _sharedPopulate(e){const t=e._remainingChildren,i=t.length;for(let s=0;s<i;++s)e.appendChild(new Ve(t[s],e.tree));e._remainingChildren=[]}static _excludeRecursively(e,t){e._remainingChildren.length>0&&e.populate(),e.save();const i=e.children;let s=e.children.length;for(;s--;)Ve._excludeRecursively(i[s],t);const r=e.childrenByCallUID.get(t);r&&_e.merge(e,r,!0)}populateChildren(){Ve._sharedPopulate(this)}}class Ge extends me{constructor(e,t,i,s){super(e,t,s),this._remainingChildren=i.children,_e.populate(this)}focus(e){e&&(this.save(),e.savePosition(),this.children=[e],this.total=e.total)}exclude(e){e&&(this.save(),Ve._excludeRecursively(this,e.callUID),this.lastComparator&&this.sort(this.lastComparator,!0))}restore(){this._savedChildren&&(this.children[0].restorePosition(),super.restore())}populateChildren(){Ve._sharedPopulate(this)}}var Ae=Object.freeze({__proto__:null,TopDownProfileDataGridNode:Ve,TopDownProfileDataGridTree:Ge});const We={profile:"Profile",findByCostMsNameOrFile:"Find by cost (>50ms), name or file",function:"Function",profiler:"Profiler",profileViewMode:"Profile view mode",focusSelectedFunction:"Focus selected function",excludeSelectedFunction:"Exclude selected function",restoreAllFunctions:"Restore all functions",chart:"Chart",heavyBottomUp:"Heavy (Bottom Up)",treeTopDown:"Tree (Top Down)",profileD:"Profile {PH1}",loadingD:"Loading… {PH1}%",fileSReadErrorS:"File '{PH1}' read error: {PH2}",loading:"Loading…",failedToReadFile:"Failed to read file",parsing:"Parsing…",loaded:"Loaded"},Ue=a.registerUIStrings("profiler/ProfileView.js",We),Je=a.getLocalizedString.bind(void 0,Ue);class qe extends f.SimpleView{constructor(){super(Je(We.profile)),this._profile=null,this._searchableView=new g.SearchableView(this,null),this._searchableView.setPlaceholder(Je(We.findByCostMsNameOrFile)),this._searchableView.show(this.element);const e=[];e.push({id:"self",title:this.columnHeader("self"),width:"120px",fixedWidth:!0,sortable:!0,sort:r.Order.Descending,titleDOMFragment:void 0,align:void 0,editable:void 0,nonSelectable:void 0,longText:void 0,disclosure:void 0,weight:void 0,allowInSortByEvenWhenHidden:void 0,dataType:void 0,defaultWeight:void 0}),e.push({id:"total",title:this.columnHeader("total"),width:"120px",fixedWidth:!0,sortable:!0,sort:void 0,titleDOMFragment:void 0,align:void 0,editable:void 0,nonSelectable:void 0,longText:void 0,disclosure:void 0,weight:void 0,allowInSortByEvenWhenHidden:void 0,dataType:void 0,defaultWeight:void 0}),e.push({id:"function",title:Je(We.function),disclosure:!0,sortable:!0,sort:void 0,titleDOMFragment:void 0,align:void 0,editable:void 0,nonSelectable:void 0,longText:void 0,weight:void 0,allowInSortByEvenWhenHidden:void 0,dataType:void 0,defaultWeight:void 0,width:void 0,fixedWidth:void 0}),this.dataGrid=new r.DataGridImpl({displayName:Je(We.profiler),columns:e,editCallback:void 0,deleteCallback:void 0,refreshCallback:void 0}),this.dataGrid.addEventListener(r.Events.SortingChanged,this._sortProfile,this),this.dataGrid.addEventListener(r.Events.SelectedNode,this._nodeSelected.bind(this,!0)),this.dataGrid.addEventListener(r.Events.DeselectedNode,this._nodeSelected.bind(this,!1)),this.dataGrid.setRowContextMenuCallback(this._populateContextMenu.bind(this)),this.viewSelectComboBox=new v.ToolbarComboBox(this._changeView.bind(this),Je(We.profileViewMode)),this.focusButton=new v.ToolbarButton(Je(We.focusSelectedFunction),"largeicon-visibility"),this.focusButton.setEnabled(!1),this.focusButton.addEventListener(v.ToolbarButton.Events.Click,this._focusClicked,this),this.excludeButton=new v.ToolbarButton(Je(We.excludeSelectedFunction),"largeicon-delete"),this.excludeButton.setEnabled(!1),this.excludeButton.addEventListener(v.ToolbarButton.Events.Click,this._excludeClicked,this),this.resetButton=new v.ToolbarButton(Je(We.restoreAllFunctions),"largeicon-refresh"),this.resetButton.setEnabled(!1),this.resetButton.addEventListener(v.ToolbarButton.Events.Click,this._resetClicked,this),this._linkifier=new q.Linkifier($e),this._nodeFormatter,this._viewType,this.adjustedTotal,this.profileHeader}static buildPopoverTable(e){const t=document.createElement("table");for(const i of e){const e=t.createChild("tr");e.createChild("td").textContent=i.title,e.createChild("td").textContent=i.value}return t}setProfile(e){this._profile=e,this._bottomUpProfileDataGridTree=null,this._topDownProfileDataGridTree=null,this._changeView(),this.refresh()}profile(){return this._profile}initialize(e){this._nodeFormatter=e,this._viewType=L.Settings.instance().createSetting("profileView",Qe.Heavy);const t=[Qe.Flame,Qe.Heavy,Qe.Tree],i=new Map([[Qe.Flame,Je(We.chart)],[Qe.Heavy,Je(We.heavyBottomUp)],[Qe.Tree,Je(We.treeTopDown)]]),s=new Map(t.map((e=>[e,this.viewSelectComboBox.createOption(i.get(e),e)]))),r=this._viewType.get()||t[0],o=s.get(r)||s.get(t[0]);this.viewSelectComboBox.select(o),this._changeView(),this._flameChart&&this._flameChart.update()}focus(){this._flameChart?this._flameChart.focus():super.focus()}columnHeader(e){throw"Not implemented"}selectRange(e,t){this._flameChart&&this._flameChart.selectRange(e,t)}async toolbarItems(){return[this.viewSelectComboBox,this.focusButton,this.excludeButton,this.resetButton]}_getBottomUpProfileDataGridTree(){return this._bottomUpProfileDataGridTree||(this._bottomUpProfileDataGridTree=new ve(this._nodeFormatter,this._searchableView,this._profile.root,this.adjustedTotal)),this._bottomUpProfileDataGridTree}_getTopDownProfileDataGridTree(){return this._topDownProfileDataGridTree||(this._topDownProfileDataGridTree=new Ge(this._nodeFormatter,this._searchableView,this._profile.root,this.adjustedTotal)),this._topDownProfileDataGridTree}_populateContextMenu(e,t){const i=t;i.linkElement&&!e.containsTarget(i.linkElement)&&e.appendApplicableItems(i.linkElement)}willHide(){this._currentSearchResultIndex=-1}refresh(){if(!this.profileDataGridTree)return;const e=this.dataGrid.selectedNode?this.dataGrid.selectedNode.profileNode:null;this.dataGrid.rootNode().removeChildren();const t=this.profileDataGridTree.children,i=t.length;for(let e=0;e<i;++e)this.dataGrid.rootNode().appendChild(t[e]);e&&(e.selected=!0)}refreshVisibleData(){let e=this.dataGrid.rootNode().children[0];for(;e;)e.refresh(),e=e.traverseNextNode(!1,null,!0)}searchableView(){return this._searchableView}supportsCaseSensitiveSearch(){return!0}supportsRegexSearch(){return!1}searchCanceled(){this._searchableElement&&this._searchableElement.searchCanceled()}performSearch(e,t,i){this._searchableElement&&this._searchableElement.performSearch(e,t,i)}jumpToNextSearchResult(){this._searchableElement&&this._searchableElement.jumpToNextSearchResult()}jumpToPreviousSearchResult(){this._searchableElement&&this._searchableElement.jumpToPreviousSearchResult()}linkifier(){return this._linkifier}createFlameChartDataProvider(){throw"Not implemented"}_ensureFlameChartCreated(){this._flameChart||(this._dataProvider=this.createFlameChartDataProvider(),this._flameChart=new Pe(this._searchableView,this._dataProvider),this._flameChart.addEventListener(A.Events.EntryInvoked,(e=>{this._onEntryInvoked(e)})))}async _onEntryInvoked(e){if(!this._dataProvider)return;const t=e.data,i=this._dataProvider._entryNodes[t],s=this.profileHeader._debuggerModel;if(!i||!i.scriptId||!s)return;const r=s.scriptForId(i.scriptId);if(!r)return;const o=s.createRawLocation(r,i.lineNumber,i.columnNumber),n=await re.DebuggerWorkspaceBinding.instance().rawLocationToUILocation(o);H.reveal(n)}_changeView(){if(!this._profile)return;switch(this._searchableView.closeSearch(),this._visibleView&&this._visibleView.detach(),this._viewType.set(this.viewSelectComboBox.selectedOption().value),this._viewType.get()){case Qe.Flame:this._ensureFlameChartCreated(),this._visibleView=this._flameChart,this._searchableElement=this._flameChart;break;case Qe.Tree:this.profileDataGridTree=this._getTopDownProfileDataGridTree(),this._sortProfile(),this._visibleView=this.dataGrid.asWidget(),this._searchableElement=this.profileDataGridTree;break;case Qe.Heavy:this.profileDataGridTree=this._getBottomUpProfileDataGridTree(),this._sortProfile(),this._visibleView=this.dataGrid.asWidget(),this._searchableElement=this.profileDataGridTree}const e=this._viewType.get()===Qe.Flame;this.focusButton.setVisible(!e),this.excludeButton.setVisible(!e),this.resetButton.setVisible(!e),this._visibleView&&this._visibleView.show(this._searchableView.element)}_nodeSelected(e){this.focusButton.setEnabled(e),this.excludeButton.setEnabled(e)}_focusClicked(e){this.dataGrid.selectedNode&&(this.resetButton.setEnabled(!0),this.resetButton.element.focus(),this.profileDataGridTree&&this.profileDataGridTree.focus(this.dataGrid.selectedNode),this.refresh(),this.refreshVisibleData(),V.actionTaken(G.Action.CpuProfileNodeFocused))}_excludeClicked(e){const t=this.dataGrid.selectedNode;t&&(this.resetButton.setEnabled(!0),this.resetButton.element.focus(),t.deselect(),this.profileDataGridTree&&this.profileDataGridTree.exclude(t),this.refresh(),this.refreshVisibleData(),V.actionTaken(G.Action.CpuProfileNodeExcluded))}_resetClicked(e){this.viewSelectComboBox.selectElement().focus(),this.resetButton.setEnabled(!1),this.profileDataGridTree&&this.profileDataGridTree.restore(),this._linkifier.reset(),this.refresh(),this.refreshVisibleData()}_sortProfile(){if(!this.profileDataGridTree)return;const e=this.dataGrid.isSortOrderAscending(),t=this.dataGrid.sortColumnId(),i="function"===t?"functionName":t||"";this.profileDataGridTree.sort(me.propertyComparator(i,e),!1),this.refresh()}}const $e=30,Qe={Flame:"Flame",Tree:"Tree",Heavy:"Heavy"};class Ke extends Ee{constructor(e,t,i){super(t,i||Je(We.profileD,{PH1:t.nextProfileUid()})),this._debuggerModel=e}_onChunkTransferred(e){this._jsonifiedProfile&&this.updateStatus(Je(We.loadingD,{PH1:t.bytesToString(this._jsonifiedProfile.length)}))}_onError(e){const t=e.error();t&&this.updateStatus(Je(We.fileSReadErrorS,{PH1:e.fileName(),PH2:t.message}))}async write(e){this._jsonifiedProfile+=e}async close(){}dispose(){this.removeTempFile()}createSidebarTreeElement(e){return new Be(e,this,"profile-sidebar-tree-item")}canSaveToFile(){return!this.fromFile()&&Boolean(this._protocolProfile)}async saveToFile(){const e=new oe.FileOutputStream;if(!this._fileName){const e=i.toISO8601Compact(new Date),t=this.profileType().fileExtension();this._fileName=`${this.profileType().typeName()}-${e}${t}`}if(!await e.open(this._fileName)||!this.tempFile)return;const t=await this.tempFile.read();t&&await e.write(t),e.close()}async loadFromFile(e){this.updateStatus(Je(We.loading),!0);const t=new oe.ChunkedFileReader(e,1e7,this._onChunkTransferred.bind(this));this._jsonifiedProfile="";if(!await t.read(this))return this._onError(t),new Error(Je(We.failedToReadFile));this.updateStatus(Je(We.parsing),!0);let i=null;try{this._profile=JSON.parse(this._jsonifiedProfile),this.setProfile(this._profile),this.updateStatus(Je(We.loaded),!1)}catch(e){i=e,this.profileType().removeProfile(this)}return this._jsonifiedProfile=null,this.profileType().profileBeingRecorded()===this&&this.profileType().setProfileBeingRecorded(null),i}setProtocolProfile(e){this.setProfile(e),this._protocolProfile=e,this.tempFile=new ne.TempFile,this.tempFile.write([JSON.stringify(e)]),this.canSaveToFile()&&this.dispatchEventToListeners(Ne.ProfileReceived)}}var Xe=Object.freeze({__proto__:null,UIStrings:We,ProfileView:qe,maxLinkLength:$e,ViewTypes:Qe,WritableProfileHeader:Ke});const Ye={selfTime:"Self Time",totalTime:"Total Time",recordJavascriptCpuProfile:"Record JavaScript CPU Profile",stopCpuProfiling:"Stop CPU profiling",startCpuProfiling:"Start CPU profiling",cpuProfiles:"CPU PROFILES",cpuProfilesShow:"CPU profiles show where the execution time is spent in your page's JavaScript functions.",recording:"Recording…",fms:"{PH1} ms",formatPercent:"{PH1} %",name:"Name",url:"URL",aggregatedSelfTime:"Aggregated self time",aggregatedTotalTime:"Aggregated total time",notOptimized:"Not optimized"},Ze=a.registerUIStrings("profiler/CPUProfileView.js",Ye),et=a.getLocalizedString.bind(void 0,Ze);class tt extends qe{constructor(e){super(),this.profileHeader=e,this.initialize(new rt(this));const t=e.profileModel();this.adjustedTotal=t.profileHead.total,this.adjustedTotal-=t.idleNode?t.idleNode.total:0,this.setProfile(t)}wasShown(){super.wasShown(),U.Performance.instance().reset(),U.Performance.instance().appendCPUProfile(this.profileHeader.profileModel())}columnHeader(e){switch(e){case"self":return et(Ye.selfTime);case"total":return et(Ye.totalTime)}return k.LocalizedEmptyString}createFlameChartDataProvider(){return new ot(this.profileHeader.profileModel(),this.profileHeader._cpuProfilerModel)}}class it extends Re{constructor(){super(it.TypeId,et(Ye.recordJavascriptCpuProfile)),this._recording=!1,$.TargetManager.instance().addModelListener(Q.CPUProfilerModel,Q.Events.ConsoleProfileFinished,this._consoleProfileFinished,this)}profileBeingRecorded(){return super.profileBeingRecorded()}typeName(){return"CPU"}fileExtension(){return".cpuprofile"}get buttonTooltip(){return this._recording?et(Ye.stopCpuProfiling):et(Ye.startCpuProfiling)}buttonClicked(){return this._recording?(this._stopRecordingProfile(),!1):(this._startRecordingProfile(),!0)}get treeItemTitle(){return et(Ye.cpuProfiles)}get description(){return et(Ye.cpuProfilesShow)}_consoleProfileFinished(e){const t=e.data,i=t.cpuProfile,s=new st(t.cpuProfilerModel,this,t.title);s.setProtocolProfile(i),this.addProfile(s)}_startRecordingProfile(){const e=S.Context.instance().flavor(Q.CPUProfilerModel);if(this.profileBeingRecorded()||!e)return;const t=new st(e,this);this.setProfileBeingRecorded(t),$.TargetManager.instance().suspendAllTargets(),this.addProfile(t),t.updateStatus(et(Ye.recording)),this._recording=!0,e.startRecording(),V.actionTaken(G.Action.ProfilesCPUProfileTaken)}async _stopRecordingProfile(){this._recording=!1;const e=this.profileBeingRecorded();if(!e||!e._cpuProfilerModel)return;const t=await e._cpuProfilerModel.stopRecording(),i=this.profileBeingRecorded();if(i){if(!t)throw new Error("Expected profile to be non-null");i.setProtocolProfile(t),i.updateStatus(""),this.setProfileBeingRecorded(null)}await $.TargetManager.instance().resumeAllTargets(),this.dispatchEventToListeners(De.ProfileComplete,i)}createProfileLoadedFromFile(e){return new st(null,this,e)}profileBeingRecordedRemoved(){this._stopRecordingProfile()}}it.TypeId="CPU";class st extends Ke{constructor(e,t,i){super(e&&e.debuggerModel(),t,i),this._cpuProfilerModel=e}createView(){return new tt(this)}protocolProfile(){if(!this._protocolProfile)throw new Error("Expected _protocolProfile to be available");return this._protocolProfile}profileModel(){if(!this._profileModel)throw new Error("Expected _profileModel to be available");return this._profileModel}setProfile(e){const t=this._cpuProfilerModel&&this._cpuProfilerModel.target()||null;this._profileModel=new K.CPUProfileDataModel(e,t)}}class rt{constructor(e){this._profileView=e}formatValue(e){return et(Ye.fms,{PH1:e.toFixed(1)})}formatValueAccessibleText(e){return this.formatValue(e)}formatPercent(e,t){if(this._profileView){const i=this._profileView.profile();if(i&&t.profileNode!==i.idleNode)return et(Ye.formatPercent,{PH1:e.toFixed(2)})}return""}linkifyNode(e){const t=this._profileView.profileHeader._cpuProfilerModel,i=t?t.target():null,s={className:"profile-node-file",columnNumber:void 0,tabStop:void 0};return this._profileView.linkifier().maybeLinkifyConsoleCallFrame(i,e.profileNode.callFrame,s)}}class ot extends Ce{constructor(e,t){super(),this._cpuProfile=e,this._cpuProfilerModel=t}minimumBoundary(){return this._cpuProfile.profileStartTime}totalTime(){return this._cpuProfile.profileHead.total}entryHasDeoptReason(e){const t=this.entryNodes[e];return Boolean(t.deoptReason)}_calculateTimelineData(){const e=[],t=[];let i=5;this._cpuProfile.forEachFrame((function(){t.push(e.length),e.push(null)}),(function(s,r,o,n,a){const l=t.pop();e[l]=new ot.ChartEntry(s,n,o,a,r),i=Math.max(i,s)}));const s=new Array(e.length),r=new Uint16Array(e.length),o=new Float32Array(e.length),n=new Float32Array(e.length),a=new Float64Array(e.length);for(let t=0;t<e.length;++t){const i=e[t];i&&(s[t]=i.node,r[t]=i.depth,o[t]=i.duration,a[t]=i.startTime,n[t]=i.selfTime)}return this._maxStackDepth=i+1,this.entryNodes=s,this.timelineData_=new A.TimelineData(r,o,a,null),this._entrySelfTimes=n,this.timelineData_}prepareHighlightedEntryInfo(e){const t=this.timelineData_,i=this.entryNodes[e];if(!i)return null;const s=[];function r(e,t){s.push({title:e,value:t})}function o(e){return 0===e?"0":e<1e3?et(Ye.fms,{PH1:e.toFixed(1)}):Number.secondsToString(e/1e3,!0)}const n=l.beautifyFunctionName(i.functionName);r(et(Ye.name),n);const a=o(this._entrySelfTimes[e]),d=o(t.entryTotalTimes[e]);r(et(Ye.selfTime),a),r(et(Ye.totalTime),d);const h=new q.Linkifier,c=h.maybeLinkifyConsoleCallFrame(this._cpuProfilerModel&&this._cpuProfilerModel.target(),i.callFrame);c&&r(et(Ye.url),c.textContent||""),h.dispose(),r(et(Ye.aggregatedSelfTime),Number.secondsToString(i.self/1e3,!0)),r(et(Ye.aggregatedTotalTime),Number.secondsToString(i.total/1e3,!0));const p=i.deoptReason;return p&&r(et(Ye.notOptimized),p),qe.buildPopoverTable(s)}}ot.ChartEntry=class{constructor(e,t,i,s,r){this.depth=e,this.duration=t,this.startTime=i,this.selfTime=s,this.node=r}};var nt=Object.freeze({__proto__:null,UIStrings:Ye,CPUProfileView:tt,CPUProfileType:it,CPUProfileHeader:st,NodeFormatter:rt,CPUFlameChartDataProvider:ot});const at={javascriptVmInstances:"JavaScript VM instances",totalJsHeapSize:"Total JS heap size",totalPageJsHeapSizeChangeTrend:"Total page JS heap size change trend over the last {PH1} minutes.",totalPageJsHeapSizeAcrossAllVm:"Total page JS heap size across all VM instances.",changeRate:"{PH1}/s",increasingBySPerSecond:"increasing by {PH1} per second",decreasingBySPerSecond:"decreasing by {PH1} per second",heapSizeInUseByLiveJsObjects:"Heap size in use by live JS objects.",heapSizeChangeTrendOverTheLastS:"Heap size change trend over the last {PH1} minutes.",empty:"(empty)"},lt=a.registerUIStrings("profiler/IsolateSelector.js",at),dt=a.getLocalizedString.bind(void 0,lt);class ht extends c.VBox{constructor(){super(!1),this._items=new w.ListModel,this._list=new b.ListControl(this._items,this,b.ListMode.NonViewport),this._list.element.classList.add("javascript-vm-instances-list"),_.setAccessibleName(this._list.element,dt(at.javascriptVmInstances)),this.contentElement.appendChild(this._list.element),this._itemByIsolate=new Map,this._totalElement=document.createElement("div"),this._totalElement.classList.add("profile-memory-usage-item"),this._totalElement.classList.add("hbox"),this._totalValueDiv=this._totalElement.createChild("div","profile-memory-usage-item-size"),this._totalTrendDiv=this._totalElement.createChild("div","profile-memory-usage-item-trend"),this._totalElement.createChild("div").textContent=dt(at.totalJsHeapSize);const e=Math.round(X.MemoryTrendWindowMs/6e4);h.Tooltip.install(this._totalTrendDiv,dt(at.totalPageJsHeapSizeChangeTrend,{PH1:e})),h.Tooltip.install(this._totalValueDiv,dt(at.totalPageJsHeapSizeAcrossAllVm)),X.IsolateManager.instance().observeIsolates(this),$.TargetManager.instance().addEventListener($.Events.NameChanged,this._targetChanged,this),$.TargetManager.instance().addEventListener($.Events.InspectedURLChanged,this._targetChanged,this)}wasShown(){X.IsolateManager.instance().addEventListener(X.Events.MemoryChanged,this._heapStatsChanged,this)}willHide(){X.IsolateManager.instance().removeEventListener(X.Events.MemoryChanged,this._heapStatsChanged,this)}isolateAdded(e){this._list.element.tabIndex=0;const t=new ct(e),i=t.model().target()===$.TargetManager.instance().mainTarget()?0:this._items.length;this._items.insert(i,t),this._itemByIsolate.set(e,t),(1===this._items.length||e.isMainThread())&&this._list.selectItem(t),this._update()}isolateChanged(e){const t=this._itemByIsolate.get(e);t&&t.updateTitle(),this._update()}isolateRemoved(e){const t=this._itemByIsolate.get(e);t&&this._items.remove(this._items.indexOf(t)),this._itemByIsolate.delete(e),0===this._items.length&&(this._list.element.tabIndex=-1),this._update()}_targetChanged(e){const t=e.data.model(Y.RuntimeModel);if(!t)return;const i=X.IsolateManager.instance().isolateByModel(t),s=i&&this._itemByIsolate.get(i);s&&s.updateTitle()}_heapStatsChanged(e){const t=e.data,i=this._itemByIsolate.get(t);i&&i.updateStats(),this._updateTotal()}_updateTotal(){let e=0,i=0;for(const t of X.IsolateManager.instance().isolates())e+=t.usedHeapSize(),i+=t.usedHeapSizeGrowRate();this._totalValueDiv.textContent=t.bytesToString(e),ht._formatTrendElement(i,this._totalTrendDiv)}static _formatTrendElement(e,i){const s=1e3*e;if(Math.abs(s)<1e3)return;const r=t.bytesToString(Math.abs(s));let o,n;s>0?(o="⬆"+dt(at.changeRate,{PH1:r}),i.classList.toggle("increasing",!0),n=dt(at.increasingBySPerSecond,{PH1:r})):(o="⬇"+dt(at.changeRate,{PH1:r}),i.classList.toggle("increasing",!1),n=dt(at.decreasingBySPerSecond,{PH1:r})),i.textContent=o,_.setAccessibleName(i,n)}totalMemoryElement(){return this._totalElement}createElementForItem(e){return e.element}heightForItem(e){return console.assert(!1,"should not be called"),0}updateSelectedItemARIA(e,t){return!1}isItemSelectable(e){return!0}selectedItemChanged(e,t,i,s){i&&i.classList.remove("selected"),s&&s.classList.add("selected");const r=t&&t.model();S.Context.instance().setFlavor(Z.HeapProfilerModel,r&&r.heapProfilerModel()),S.Context.instance().setFlavor(Q.CPUProfilerModel,r&&r.target().model(Q.CPUProfilerModel))}_update(){this._updateTotal(),this._list.invalidateRange(0,this._items.length)}}class ct{constructor(e){this._isolate=e;const t=Math.round(X.MemoryTrendWindowMs/6e4);this.element=document.createElement("div"),this.element.classList.add("profile-memory-usage-item"),this.element.classList.add("hbox"),_.markAsOption(this.element),this._heapDiv=this.element.createChild("div","profile-memory-usage-item-size"),h.Tooltip.install(this._heapDiv,dt(at.heapSizeInUseByLiveJsObjects)),this._trendDiv=this.element.createChild("div","profile-memory-usage-item-trend"),h.Tooltip.install(this._trendDiv,dt(at.heapSizeChangeTrendOverTheLastS,{PH1:t})),this._nameDiv=this.element.createChild("div","profile-memory-usage-item-name"),this.updateTitle()}model(){return this._isolate.runtimeModel()}updateStats(){this._heapDiv.textContent=t.bytesToString(this._isolate.usedHeapSize()),ht._formatTrendElement(this._isolate.usedHeapSizeGrowRate(),this._trendDiv)}updateTitle(){const e=new Map;for(const t of this._isolate.models()){const i=t.target(),s=$.TargetManager.instance().mainTarget()!==i?i.name():"",r=new M.ParsedURL(i.inspectedURL()),o=r.isValid?r.domain():"",n=i.decorateLabel(o&&s?`${o}: ${s}`:s||o||dt(at.empty));e.set(n,(e.get(n)||0)+1)}this._nameDiv.removeChildren();const t=[];for(const[i,s]of e){const e=s>1?`${i} (${s})`:i;t.push(e);const r=this._nameDiv.createChild("div");r.textContent=e,h.Tooltip.install(r,String(e))}}}var pt=Object.freeze({__proto__:null,UIStrings:at,IsolateSelector:ht,ListItem:ct});const ut={selectJavascriptVmInstance:"Select JavaScript VM instance",load:"Load",takeSnapshot:"Take snapshot",stop:"Stop",start:"Start",selectProfilingType:"Select profiling type"},_t=a.registerUIStrings("profiler/ProfileLauncherView.js",ut),mt=a.getLocalizedString.bind(void 0,_t);class ft extends c.VBox{constructor(e){super(),this.registerRequiredCSS("profiler/profileLauncherView.css",{enableLegacyPatching:!0}),this._panel=e,this.element.classList.add("profile-launcher-view"),this._contentElement=this.element.createChild("div","profile-launcher-view-content vbox");const t=this._contentElement.createChild("div","vbox");this._selectedProfileTypeSetting=L.Settings.instance().createSetting("selectedProfileType","CPU"),this._profileTypeHeaderElement=t.createChild("h1"),this._profileTypeSelectorForm=t.createChild("form"),_.markAsRadioGroup(this._profileTypeSelectorForm);const i=this._contentElement.createChild("div","vbox profile-isolate-selector-block");i.createChild("h1").textContent=mt(ut.selectJavascriptVmInstance);const s=new ht;s.show(i.createChild("div","vbox profile-launcher-target-list")),i.appendChild(s.totalMemoryElement());const r=this._contentElement.createChild("div","hbox profile-launcher-buttons");this._controlButton=l.createTextButton("",this._controlButtonClicked.bind(this),"",!0),this._loadButton=l.createTextButton(mt(ut.load),this._loadButtonClicked.bind(this),""),r.appendChild(this._controlButton),r.appendChild(this._loadButton),this._recordButtonEnabled=!0,this._typeIdToOptionElementAndProfileType=new Map}_loadButtonClicked(){this._panel.showLoadFromFileDialog()}_updateControls(){this._isEnabled&&this._recordButtonEnabled?this._controlButton.removeAttribute("disabled"):this._controlButton.setAttribute("disabled",""),h.Tooltip.install(this._controlButton,this._recordButtonEnabled?"":l.anotherProfilerActiveLabel()),this._isInstantProfile?(this._controlButton.classList.remove("running"),this._controlButton.classList.add("primary-button"),this._controlButton.textContent=mt(ut.takeSnapshot)):this._isProfiling?(this._controlButton.classList.add("running"),this._controlButton.classList.remove("primary-button"),this._controlButton.textContent=mt(ut.stop)):(this._controlButton.classList.remove("running"),this._controlButton.classList.add("primary-button"),this._controlButton.textContent=mt(ut.start));for(const{optionElement:e}of this._typeIdToOptionElementAndProfileType.values())e.disabled=Boolean(this._isProfiling)}profileStarted(){this._isProfiling=!0,this._updateControls()}profileFinished(){this._isProfiling=!1,this._updateControls()}updateProfileType(e,t){this._isInstantProfile=e.isInstantProfile(),this._recordButtonEnabled=t,this._isEnabled=e.isEnabled(),this._updateControls()}addProfileType(e){const t=l.createRadioLabel("profile-type",e.name);this._profileTypeSelectorForm.appendChild(t);const i=t.radioElement;this._typeIdToOptionElementAndProfileType.set(e.id,{optionElement:i,profileType:e}),i.addEventListener("change",this._profileTypeChanged.bind(this,e),!1);this._profileTypeSelectorForm.createChild("p").textContent=e.description,_.setDescription(i,e.description);const s=e.customContent();s&&(this._profileTypeSelectorForm.createChild("p").appendChild(s),e.setCustomContentEnabled(!1));const r=this._typeIdToOptionElementAndProfileType.size>1?mt(ut.selectProfilingType):e.name;this._profileTypeHeaderElement.textContent=r,_.setAccessibleName(this._profileTypeSelectorForm,r)}restoreSelectedProfileType(){let e=this._selectedProfileTypeSetting.get();this._typeIdToOptionElementAndProfileType.has(e)||(e=this._typeIdToOptionElementAndProfileType.keys().next().value,this._selectedProfileTypeSetting.set(e));const t=this._typeIdToOptionElementAndProfileType.get(e);t.optionElement.checked=!0;const i=t.profileType;for(const[t,{profileType:i}]of this._typeIdToOptionElementAndProfileType){const s=t===e;i.setCustomContentEnabled(s)}this.dispatchEventToListeners(gt.ProfileTypeSelected,i)}_controlButtonClicked(){this._panel.toggleRecord()}_profileTypeChanged(e){const t=this._selectedProfileTypeSetting.get();this._typeIdToOptionElementAndProfileType.get(t).profileType.setCustomContentEnabled(!1),e.setCustomContentEnabled(!0),this.dispatchEventToListeners(gt.ProfileTypeSelected,e),this._isInstantProfile=e.isInstantProfile(),this._isEnabled=e.isEnabled(),this._updateControls(),this._selectedProfileTypeSetting.set(e.id)}}const gt={ProfileTypeSelected:Symbol("ProfileTypeSelected")};var vt=Object.freeze({__proto__:null,UIStrings:ut,ProfileLauncherView:ft,Events:gt});class St extends c.VBox{constructor(){super(),this.element.id="heap-recording-view",this.element.classList.add("heap-tracking-overview"),this._overviewCalculator=new Pt,this._overviewContainer=this.element.createChild("div","heap-overview-container"),this._overviewGrid=new W.OverviewGrid("heap-recording",this._overviewCalculator),this._overviewGrid.element.classList.add("fill"),this._overviewCanvas=this._overviewContainer.createChild("canvas","heap-recording-overview-canvas"),this._overviewContainer.appendChild(this._overviewGrid.element),this._overviewGrid.addEventListener(W.Events.WindowChanged,this._onWindowChanged,this),this._windowLeft=0,this._windowRight=1,this._overviewGrid.setWindow(this._windowLeft,this._windowRight),this._yScale=new bt,this._xScale=new bt,this._profileSamples=new Ct}start(){this._running=!0;const e=()=>{this.update(),this._running&&this.element.window().requestAnimationFrame(e)};e()}stop(){this._running=!1}setSamples(e){this._profileSamples=e,this._running||this.update()}_drawOverviewCanvas(e,i){if(!this._profileSamples)return;const s=this._profileSamples,r=s.sizes,o=s.max,n=s.timestamps,a=n[0],l=this._xScale.nextScale(e/s.totalTime);let d=0;function h(e,t){let i=0,s=0;for(let r=1;r<n.length;++r){const o=Math.floor((n[r]-a)*l);o!==s&&(i&&t(s,i),i=0,s=o),i+=e[r]}t(s,i)}h(r,(function(e,t){d=Math.max(d,t)}));const c=this._yScale.nextScale(d?i/(1.1*d):0);this._overviewCanvas.width=e*window.devicePixelRatio,this._overviewCanvas.height=i*window.devicePixelRatio,this._overviewCanvas.style.width=e+"px",this._overviewCanvas.style.height=i+"px";const p=this._overviewCanvas.getContext("2d");if(!p)throw new Error("Failed to get canvas context");const u=p;if(u.scale(window.devicePixelRatio,window.devicePixelRatio),this._running){u.beginPath(),u.lineWidth=2,u.strokeStyle="rgba(192, 192, 192, 0.6)";const e=(Date.now()-a)*l;u.moveTo(e,i-1),u.lineTo(e,0),u.stroke(),u.closePath()}let _,m=0;if(c){const t=(i-14)/c;_=Math.pow(1024,Math.floor(Math.log(t)/Math.log(1024))),_*=Math.pow(10,Math.floor(Math.log(t/_)/Math.LN10)),5*_<=t&&(_*=5),m=Math.round(i-_*c-.5)+.5,u.beginPath(),u.lineWidth=1,u.strokeStyle="rgba(0, 0, 0, 0.2)",u.moveTo(0,m),u.lineTo(e,m),u.stroke(),u.closePath()}function f(e,t){u.moveTo(e,i-1),u.lineTo(e,Math.round(i-t*c-1))}if(u.beginPath(),u.lineWidth=2,u.strokeStyle="rgba(192, 192, 192, 0.6)",h(o,f),u.stroke(),u.closePath(),u.beginPath(),u.lineWidth=2,u.strokeStyle="rgba(0, 0, 192, 0.8)",h(r,f),u.stroke(),u.closePath(),_){const e=t.bytesToString(_),i=4,s=0,r=m-.5,o=2*i+u.measureText(e).width;u.beginPath(),u.textBaseline="bottom",u.font="10px "+window.getComputedStyle(this.element,null).getPropertyValue("font-family"),u.fillStyle="rgba(255, 255, 255, 0.75)",u.fillRect(s,r-14,o,14),u.fillStyle="rgb(64, 64, 64)",u.fillText(e,s+i,r),u.fill(),u.closePath()}}onResize(){this._updateOverviewCanvas=!0,this._scheduleUpdate()}_onWindowChanged(){this._updateGridTimerId||(this._updateGridTimerId=setTimeout(this.updateGrid.bind(this),10))}_scheduleUpdate(){this._updateTimerId||(this._updateTimerId=setTimeout(this.update.bind(this),10))}_updateBoundaries(){this._windowLeft=this._overviewGrid.windowLeft(),this._windowRight=this._overviewGrid.windowRight(),this._windowWidth=this._windowRight-this._windowLeft}update(){this._updateTimerId=null,this.isShowing()&&(this._updateBoundaries(),this._overviewCalculator._updateBoundaries(this),this._overviewGrid.updateDividers(this._overviewCalculator),this._drawOverviewCanvas(this._overviewContainer.clientWidth,this._overviewContainer.clientHeight-20))}updateGrid(){this._updateGridTimerId=0,this._updateBoundaries();const t=this._profileSamples.ids;if(!t.length)return;const i=this._profileSamples.timestamps,s=this._profileSamples.sizes,r=i[0],o=this._profileSamples.totalTime,n=r+o*this._windowLeft,a=r+o*this._windowRight,l=e.lowerBound(i,n,e.DEFAULT_COMPARATOR),d=e.upperBound(i,a,e.DEFAULT_COMPARATOR);let h=0;for(let e=l;e<=d;++e)h+=s[e];const c=l>0?t[l-1]:0,p=d<t.length?t[d]:1/0;this.dispatchEventToListeners(wt,{minId:c,maxId:p,size:h})}}const wt=Symbol("IdsRangeChanged");class bt{constructor(){this._lastUpdate=0,this._currentScale=0}nextScale(e){if(e=e||this._currentScale,this._currentScale){const i=Date.now(),s=i-this._lastUpdate;this._lastUpdate=i;const r=20,o=Math.pow(r,s/1e3),n=e/this._currentScale;this._currentScale*=t.clamp(n,1/o,o)}else this._currentScale=e;return this._currentScale}}class Ct{constructor(){this.sizes=[],this.ids=[],this.timestamps=[],this.max=[],this.totalTime=3e4}}class Pt{constructor(){this._maximumBoundaries=0,this._minimumBoundaries=0,this._xScaleFactor=0}_updateBoundaries(e){this._minimumBoundaries=0,this._maximumBoundaries=e._profileSamples.totalTime,this._xScaleFactor=e._overviewContainer.clientWidth/this._maximumBoundaries}computePosition(e){return(e-this._minimumBoundaries)*this._xScaleFactor}formatValue(e,t){return Number.secondsToString(e/1e3,Boolean(t))}maximumBoundary(){return this._maximumBoundaries}minimumBoundary(){return this._minimumBoundaries}zeroTime(){return this._minimumBoundaries}boundarySpan(){return this._maximumBoundaries-this._minimumBoundaries}}var Tt=Object.freeze({__proto__:null,HeapTimelineOverview:St,IdsRangeChanged:wt,SmoothScale:bt,Samples:Ct,OverviewCalculator:Pt});const yt={selectedSizeS:"Selected size: {PH1}",selfSizeBytes:"Self Size (bytes)",totalSizeBytes:"Total Size (bytes)",stopHeapProfiling:"Stop heap profiling",startHeapProfiling:"Start heap profiling",recording:"Recording…",heapProfilerIsRecording:"Heap profiler is recording",stopping:"Stopping…",allocationSampling:"Allocation sampling",samplingProfiles:"SAMPLING PROFILES",recordMemoryAllocationsUsing:"Record memory allocations using sampling method.\n This profile type has minimal performance overhead and can be used for long running operations.\n It provides good approximation of allocations broken down by JavaScript execution stack.",profileD:"Profile {PH1}",sBytes:"{PH1} bytes",formatPercent:"{PH1} %",skb:"{PH1} kB",name:"Name",selfSize:"Self size",totalSize:"Total size",url:"URL"},xt=a.registerUIStrings("profiler/HeapProfileView.js",yt),Et=a.getLocalizedString.bind(void 0,xt);function It(e){return e._profile||e.protocolProfile()}class Nt extends qe{constructor(e){super(),this.profileHeader=e,this._profileType=e.profileType(),this.initialize(new Mt(this));const t=new kt(It(e));this.adjustedTotal=t.total,this.setProfile(t),this._selectedSizeText=new v.ToolbarText,this._timestamps=[],this._sizes=[],this._max=[],this._ordinals=[],this._totalTime=0,this._lastOrdinal=0,this._timelineOverview=new St,ae.experiments.isEnabled("samplingHeapProfilerTimeline")&&(this._timelineOverview.addEventListener(wt,this._onIdsRangeChanged.bind(this)),this._timelineOverview.show(this.element,this.element.firstChild),this._timelineOverview.start(),this._profileType.addEventListener(Ft.Events.StatsUpdate,this._onStatsUpdate,this),this._profileType.once(De.ProfileComplete).then((()=>{this._profileType.removeEventListener(Ft.Events.StatsUpdate,this._onStatsUpdate,this),this._timelineOverview.stop(),this._timelineOverview.updateGrid()})))}async toolbarItems(){return[...await super.toolbarItems(),this._selectedSizeText]}_onIdsRangeChanged(e){const i=e.data.minId,s=e.data.maxId;this._selectedSizeText.setText(Et(yt.selectedSizeS,{PH1:t.bytesToString(e.data.size)})),this._setSelectionRange(i,s)}_setSelectionRange(e,t){const i=It(this.profileHeader),s=new kt(i,e,t);this.adjustedTotal=s.total,this.setProfile(s)}_onStatsUpdate(t){const i=t.data;this._totalTime||(this._timestamps=[],this._sizes=[],this._max=[],this._ordinals=[],this._totalTime=3e4,this._lastOrdinal=0),this._sizes.fill(0),this._sizes.push(0),this._timestamps.push(Date.now()),this._ordinals.push(this._lastOrdinal+1);for(const t of i.samples){this._lastOrdinal=Math.max(this._lastOrdinal,t.ordinal);const i=e.upperBound(this._ordinals,t.ordinal,e.DEFAULT_COMPARATOR)-1;this._sizes[i]+=t.size}this._max.push(this._sizes[this._sizes.length-1]);this._timestamps[this._timestamps.length-1]-this._timestamps[0]>this._totalTime&&(this._totalTime*=2);const s={sizes:this._sizes,max:this._max,ids:this._ordinals,timestamps:this._timestamps,totalTime:this._totalTime};this._timelineOverview.setSamples(s)}columnHeader(e){switch(e){case"self":return Et(yt.selfSizeBytes);case"total":return Et(yt.totalSizeBytes)}return k.LocalizedEmptyString}createFlameChartDataProvider(){return new Ot(this.profile(),this.profileHeader.heapProfilerModel())}}class Rt extends Re{constructor(e,t){super(e,t),this._recording=!1}profileBeingRecorded(){return super.profileBeingRecorded()}typeName(){return"Heap"}fileExtension(){return".heapprofile"}get buttonTooltip(){return this._recording?Et(yt.stopHeapProfiling):Et(yt.startHeapProfiling)}buttonClicked(){return this._recording?this._stopRecordingProfile():this._startRecordingProfile(),this._recording}_startRecordingProfile(){const e=S.Context.instance().flavor(Z.HeapProfilerModel);if(this.profileBeingRecorded()||!e)return;const t=new Lt(e,this);this.setProfileBeingRecorded(t),this.addProfile(t),t.updateStatus(Et(yt.recording));const i=d.Icon.create("smallicon-warning");h.Tooltip.install(i,Et(yt.heapProfilerIsRecording)),C.InspectorView.instance().setPanelIcon("heap_profiler",i),this._recording=!0,this._startSampling()}async _stopRecordingProfile(){this._recording=!1;const e=this.profileBeingRecorded();if(!e||!e.heapProfilerModel())return;e.updateStatus(Et(yt.stopping));const t=await this._stopSampling();e&&(console.assert(void 0!==t),e.setProtocolProfile(t),e.updateStatus(""),this.setProfileBeingRecorded(null)),C.InspectorView.instance().setPanelIcon("heap_profiler",null),this.dispatchEventToListeners(De.ProfileComplete,e)}createProfileLoadedFromFile(e){return new Lt(null,this,e)}profileBeingRecordedRemoved(){this._stopRecordingProfile()}_startSampling(){throw"Not implemented"}_stopSampling(){throw"Not implemented"}}let Dt;class Ft extends Rt{constructor(){super(Ft.TypeId,Et(yt.allocationSampling)),Dt||(Dt=this),this._updateTimer=0,this._updateIntervalMs=200}static get instance(){return Dt}get treeItemTitle(){return Et(yt.samplingProfiles)}get description(){return Et(yt.recordMemoryAllocationsUsing)}hasTemporaryView(){return ae.experiments.isEnabled("samplingHeapProfilerTimeline")}_startSampling(){const e=this._obtainRecordingProfile();e&&(e.startSampling(),ae.experiments.isEnabled("samplingHeapProfilerTimeline")&&(this._updateTimer=window.setTimeout((()=>{this._updateStats()}),this._updateIntervalMs)))}_obtainRecordingProfile(){const e=this.profileBeingRecorded();if(e){return e.heapProfilerModel()}return null}async _stopSampling(){window.clearTimeout(this._updateTimer),this._updateTimer=0,this.dispatchEventToListeners(Ft.Events.RecordingStopped);const e=this._obtainRecordingProfile();if(!e)throw new Error("No heap profiler model");const t=await e.stopSampling();if(!t)throw new Error("No sampling profile found");return t}async _updateStats(){const e=this._obtainRecordingProfile();if(!e)return;const t=await e.getSamplingProfile();this._updateTimer&&(this.dispatchEventToListeners(Ft.Events.StatsUpdate,t),this._updateTimer=window.setTimeout((()=>{this._updateStats()}),this._updateIntervalMs))}}Ft.TypeId="SamplingHeap",Ft.Events={RecordingStopped:Symbol("RecordingStopped"),StatsUpdate:Symbol("StatsUpdate")};class Lt extends Ke{constructor(e,t,i){super(e&&e.debuggerModel(),t,i||Et(yt.profileD,{PH1:t.nextProfileUid()})),this._heapProfilerModel=e,this._protocolProfile={head:{callFrame:{functionName:"",scriptId:"",url:"",lineNumber:0,columnNumber:0},children:[],selfSize:0,id:0},samples:[],startTime:0,endTime:0,nodes:[]}}createView(){return new Nt(this)}protocolProfile(){return this._protocolProfile}heapProfilerModel(){return this._heapProfilerModel}}class Ht extends ee.ProfileNode{constructor(e){super(e.callFrame||{functionName:e.functionName,scriptId:e.scriptId,url:e.url,lineNumber:e.lineNumber-1,columnNumber:e.columnNumber-1}),this.self=e.selfSize}}class kt extends ee.ProfileTreeModel{constructor(e,t,i){super(),this.modules=e.modules||[];let s=null;if(t||i){s=new Map,t=t||0,i=i||1/0;for(const r of e.samples){if(r.ordinal<t||r.ordinal>i)continue;const e=s.get(r.nodeId)||0;s.set(r.nodeId,e+r.size)}}function r(e){return e.children=e.children.filter(r),Boolean(e.children.length||e.self)}this.initialize(function(e){const t=new Ht(e),i=[e],o=[t];for(;i.length;){const e=i.pop(),t=o.pop();t.children=e.children.map((e=>{const t=new Ht(e);return s&&(t.self=s.get(e.id)||0),t})),i.push(...e.children),o.push(...t.children)}return r(t),t}(e.head))}}class Mt{constructor(e){this._profileView=e}formatValue(e){return Number.withThousandsSeparator(e)}formatValueAccessibleText(e){return Et(yt.sBytes,{PH1:e})}formatPercent(e,t){return Et(yt.formatPercent,{PH1:e.toFixed(2)})}linkifyNode(e){const t=this._profileView.profileHeader.heapProfilerModel(),i=t?t.target():null,s={className:"profile-node-file",columnNumber:void 0,tabStop:void 0};return this._profileView.linkifier().maybeLinkifyConsoleCallFrame(i,e.profileNode.callFrame,s)}}class Ot extends Ce{constructor(e,t){super(),this._profile=e,this._heapProfilerModel=t,this._entryNodes=[]}minimumBoundary(){return 0}totalTime(){return this._profile.root.total}entryHasDeoptReason(e){return!1}formatValue(e,t){return Et(yt.skb,{PH1:Number.withThousandsSeparator(e/1e3)})}_calculateTimelineData(){const e=function e(t){return t.children.reduce(((t,i)=>t+e(i)),1)}(this._profile.root),t=new Array(e),i=new Uint16Array(e),s=new Float32Array(e),r=new Float64Array(e);let o=0,n=0,a=0,l=0;return function e(d){const h=a;t[l]=d,i[l]=o,s[l]=d.total,r[l]=a,++l,++o,d.children.forEach(e),--o,n=Math.max(n,o),a=h+d.total}(this._profile.root),this._maxStackDepth=n+1,this._entryNodes=t,this._timelineData=new A.TimelineData(i,s,r,null),this._timelineData}prepareHighlightedEntryInfo(e){const i=this._entryNodes[e];if(!i)return null;const s=[];function r(e,t){s.push({title:e,value:t})}r(Et(yt.name),l.beautifyFunctionName(i.functionName)),r(Et(yt.selfSize),t.bytesToString(i.self)),r(Et(yt.totalSize),t.bytesToString(i.total));const o=new q.Linkifier,n=o.maybeLinkifyConsoleCallFrame(this._heapProfilerModel?this._heapProfilerModel.target():null,i.callFrame);return n&&r(Et(yt.url),n.textContent),o.dispose(),qe.buildPopoverTable(s)}}var zt=Object.freeze({__proto__:null,UIStrings:yt,HeapProfileView:Nt,SamplingHeapProfileTypeBase:Rt,SamplingHeapProfileType:Ft,SamplingHeapProfileHeader:Lt,SamplingHeapProfileNode:Ht,SamplingHeapProfileModel:kt,NodeFormatter:Mt,HeapFlameChartDataProvider:Ot});const Bt={emptyPlaceholder:"{PH1}",genericStringsTwoPlaceholders:"{PH1}, {PH2}",internalArray:"(internal array)[]",userObjectReachableFromWindow:"User object reachable from window",detachedFromDomTree:"Detached from DOM tree",previewIsNotAvailable:"Preview is not available",revealInSummaryView:"Reveal in Summary view",summary:"Summary",revealObjectSWithIdSInSummary:"Reveal object '{PH1}' with id @{PH2} in Summary view",storeAsGlobalVariable:"Store as global variable",inElement:"in"},jt=a.registerUIStrings("profiler/HeapSnapshotGridNodes.js",Bt),Vt=a.getLocalizedString.bind(void 0,jt);class Gt extends r.DataGridNode{constructor(e,t){super(null,t),this._dataGrid=e,this._instanceCount=0,this._savedChildren=new Map,this._retrievedChildrenRanges=[],this._providerObject=null,this._reachableFromWindow=!1}get name(){}heapSnapshotDataGrid(){return this._dataGrid}createProvider(){throw new Error("Not implemented.")}comparator(){throw new Error("Not implemented.")}_getHash(){throw new Error("Not implemented.")}_createChildNode(e){throw new Error("Not implemented.")}retainersDataSource(){return null}_provider(){return this._providerObject||(this._providerObject=this.createProvider()),this._providerObject}createCell(e){return super.createCell(e)}collapse(){super.collapse(),this._dataGrid.updateVisibleNodes(!0)}expand(){super.expand(),this._dataGrid.updateVisibleNodes(!0)}dispose(){this._providerObject&&this._providerObject.dispose();for(let e=this.children[0];e;e=e.traverseNextNode(!0,this,!0))e.dispose()}queryObjectContent(e,t){throw new Error("Not implemented")}tryQueryObjectContent(e,t){throw new Error("Not implemented")}populateContextMenu(e,t,i){}_toPercentString(e){return e.toFixed(0)+" %"}_toUIDistance(e){const t=le.baseSystemDistance;return e>=0&&e<t?Vt(Bt.emptyPlaceholder,{PH1:e}):"−"}allChildren(){return this._dataGrid.allChildren(this)}removeChildByIndex(e){this._dataGrid.removeChildByIndex(this,e)}childForPosition(e){let t=0;for(let i=0;i<this._retrievedChildrenRanges.length;i++){const s=this._retrievedChildrenRanges[i];if(s.from<=e&&e<s.to){const i=t+e-s.from;return this.allChildren()[i]}t+=s.to-s.from+1}return null}_createValueCell(e){const t=P.html`<td class="numeric-column" />`,i=this.dataGrid;if(i.snapshot&&0!==i.snapshot.totalSize){const i=document.createElement("div"),s=P.html`<span>${this.data[e]}</span>`;i.appendChild(s);const r=e+"-percent";if(r in this.data){const o=P.html`<span class="percent-column">${this.data[r]}</span>`;i.appendChild(o),i.classList.add("profile-multiple-values"),_.markAsHidden(s),_.markAsHidden(o),this.setCellAccessibleName(Vt(Bt.genericStringsTwoPlaceholders,{PH1:this.data[e],PH2:this.data[r]}),t,e)}t.appendChild(i)}return t}populate(){this._populated||(this._populated=!0,this._provider().sortAndRewind(this.comparator()).then((()=>this._populateChildren())))}expandWithoutPopulate(){return this._populated=!0,this.expand(),this._provider().sortAndRewind(this.comparator())}_childHashForEntity(e){return"edgeIndex"in e?e.edgeIndex:e.id}_populateChildren(e,t){return new Promise((i=>{e=e||0,t=t||e+this._dataGrid.defaultPopulateCount();let s=e;function r(e){if(s>=e)return;const t=Math.min(s+this._dataGrid.defaultPopulateCount(),e);this._provider().serializeItemsRange(s,t).then((t=>l.call(this,t,e))),s=t}function n(e,t){if(this._savedChildren){const i=this._childHashForEntity(e),s=this._savedChildren.get(i);if(s)return void this._dataGrid.insertChild(this,s,t)}this._dataGrid.insertChild(this,this._createChildNode(e),t)}function a(e,t,i){const s=new o.ShowMoreDataGridNode(this._populateChildren.bind(this),e,t,this._dataGrid.defaultPopulateCount());this._dataGrid.insertChild(this,s,i)}function l(e,t){let o=0,l=e.startPosition;const d=e.items;let h=0;if(this._retrievedChildrenRanges.length){let t=0,i=!1,s={from:0,to:0};for(;t<this._retrievedChildrenRanges.length;){if(s=this._retrievedChildrenRanges[t],s.to>=l){i=!0;break}h+=s.to-s.from,s.to<e.totalLength&&(h+=1),++t}if(!i||e.startPosition<s.from){this.allChildren()[h-1].setEndPosition(e.startPosition),a.call(this,e.startPosition,i?s.from:e.totalLength,h),s={from:e.startPosition,to:e.startPosition},i||(t=this._retrievedChildrenRanges.length),this._retrievedChildrenRanges.splice(t,0,s)}else h+=l-s.from;for(;s.to<e.endPosition;){const i=s.to-l;h+=i,o+=i,l=s.to;const r=this._retrievedChildrenRanges[t+1];let a=r?r.from:e.totalLength;for(a>e.endPosition&&(a=e.endPosition);l<a;)n.call(this,d[o++],h++),++l;r&&a===r.from?(s.to=r.to,this.removeChildByIndex(h),this._retrievedChildrenRanges.splice(t+1,1)):(s.to=a,a===e.totalLength?this.removeChildByIndex(h):this.allChildren()[h].setStartPosition(e.endPosition))}}else{e.startPosition>0&&(this._retrievedChildrenRanges.push({from:0,to:0}),a.call(this,0,e.startPosition,h++)),this._retrievedChildrenRanges.push({from:e.startPosition,to:e.endPosition});for(let e=0,t=d.length;e<t;++e)n.call(this,d[e],h++);e.endPosition<e.totalLength&&a.call(this,e.endPosition,e.totalLength,h++)}this._instanceCount+=d.length,s<t?r.call(this,t):(this.expanded&&this._dataGrid.updateVisibleNodes(!0),i(),this.dispatchEventToListeners(Gt.Events.PopulateComplete))}r.call(this,t)}))}_saveChildren(){this._savedChildren.clear();const e=this.allChildren();for(let t=0,i=e.length;t<i;++t){const i=e[t];i.expanded&&this._savedChildren.set(i._getHash(),i)}}async sort(){this._dataGrid.recursiveSortingEnter(),await this._provider().sortAndRewind(this.comparator()),this._saveChildren(),this._dataGrid.removeAllChildren(this),this._retrievedChildrenRanges=[];const e=this._instanceCount;this._instanceCount=0,await this._populateChildren(0,e);for(const e of this.allChildren())e.expanded&&e.sort();this._dataGrid.recursiveSortingLeave()}}Gt.Events={PopulateComplete:Symbol("PopulateComplete")};class At extends Gt{constructor(e,t){if(super(e,!1),!t)return;this._referenceName=null,this._name=t.name,this._type=t.type,this._distance=t.distance,this._shallowSize=t.selfSize,this._retainedSize=t.retainedSize,this.snapshotNodeId=t.id,this.snapshotNodeIndex=t.nodeIndex,"string"===this._type?this._reachableFromWindow=!0:"object"===this._type&&this._name.startsWith("Window")?(this._name=this.shortenWindowURL(this._name,!1),this._reachableFromWindow=!0):t.canBeQueried&&(this._reachableFromWindow=!0),t.detachedDOMTreeNode&&(this.detachedDOMTreeNode=!0);const i=e.snapshot,s=this._shallowSize/i.totalSize*100,r=this._retainedSize/i.totalSize*100;this.data={distance:this._toUIDistance(this._distance),shallowSize:Number.withThousandsSeparator(this._shallowSize),retainedSize:Number.withThousandsSeparator(this._retainedSize),"shallowSize-percent":this._toPercentString(s),"retainedSize-percent":this._toPercentString(r)}}get name(){return this._name}retainersDataSource(){return void 0===this.snapshotNodeIndex?null:{snapshot:this._dataGrid.snapshot,snapshotNodeIndex:this.snapshotNodeIndex}}createCell(e){return"object"!==e?this._createValueCell(e):this._createObjectCell()}_createObjectCell(){let e=this._name,t="object";switch(this._type){case"concatenated string":case"string":e=`"${e}"`,t="string";break;case"regexp":e=`/${e}/`,t="string";break;case"closure":e+="()",t="function";break;case"bigint":t="bigint";break;case"number":t="number";break;case"hidden":t="null";break;case"array":e=e?e+"[]":Vt(Bt.internalArray)}return this._createObjectCellWithValue(t,e||"")}_createObjectCellWithValue(e,t){const i=P.Fragment.build`
2
+ <td class="object-column disclosure">
3
+ <div class="source-code event-properties" style="overflow: visible" $="container">
4
+ <span class="value object-value-${e}">${t}</span>
5
+ <span class="object-value-id">@${this.snapshotNodeId}</span>
6
+ </div>
7
+ </td>`,s=i.$("container");this._prefixObjectCell(s),this._reachableFromWindow&&s.appendChild(P.html`<span class="heap-object-tag" title="${Vt(Bt.userObjectReachableFromWindow)}">🗖</span>`),this.detachedDOMTreeNode&&s.appendChild(P.html`<span class="heap-object-tag" title="${Vt(Bt.detachedFromDomTree)}">✀</span>`),this._appendSourceLocation(s);const r=i.element();return this.depth&&r.style.setProperty("padding-left",this.depth*this.dataGrid.indentWidth+"px"),r}_prefixObjectCell(e){}async _appendSourceLocation(e){const t=P.html`<span class="heap-object-source-link" />`;e.appendChild(t);const i=await this._dataGrid.dataDisplayDelegate().linkifyObject(this.snapshotNodeIndex);i?(t.appendChild(i),this.linkElement=i):t.remove()}async queryObjectContent(e,t){return await this.tryQueryObjectContent(e,t)||e.runtimeModel().createRemoteObjectFromPrimitiveValue(Vt(Bt.previewIsNotAvailable))}async tryQueryObjectContent(e,t){return"string"===this._type?e.runtimeModel().createRemoteObjectFromPrimitiveValue(this._name):await e.objectForSnapshotObjectId(String(this.snapshotNodeId),t)}async updateHasChildren(){const e=await this._provider().isEmpty();this.setHasChildren(!e)}shortenWindowURL(e,t){const i=e.indexOf("/"),r=t?e.indexOf("@"):e.length;if(-1===i||-1===r)return e;const o=e.substring(i+1,r).trimLeft();let n=s.trimURL(o);return n.length>40&&(n=s.trimMiddle(n,40)),e.substr(0,i+2)+n+e.substr(r)}populateContextMenu(e,t,i){if(e.revealSection().appendItem(Vt(Bt.revealInSummaryView),(()=>{t.showObject(String(this.snapshotNodeId),Vt(Bt.summary))})),this._referenceName)for(const i of this._referenceName.matchAll(/\((?<objectName>[^@)]*) @(?<snapshotNodeId>\d+)\)/g)){const{objectName:s,snapshotNodeId:r}=i.groups;e.revealSection().appendItem(Vt(Bt.revealObjectSWithIdSInSummary,{PH1:s,PH2:r}),(()=>{t.showObject(r,Vt(Bt.summary))}))}i&&e.revealSection().appendItem(Vt(Bt.storeAsGlobalVariable),(async()=>{const e=await this.tryQueryObjectContent(i,"");e?await te.ConsoleModel.instance().saveToTempVariable(S.Context.instance().flavor(Y.ExecutionContext),e):O.Console.instance().error(Vt(Bt.previewIsNotAvailable))}))}}class Wt extends At{constructor(e,t,i,s){super(e,i.node),this._referenceName=i.name,this._referenceType=i.type,this._edgeIndex=i.edgeIndex,this._snapshot=t,this._parentObjectNode=s,this._cycledWithAncestorGridNode=this._findAncestorWithSameSnapshotNodeId(),this._cycledWithAncestorGridNode||this.updateHasChildren();const r=this.data;r.count="",r.addedCount="",r.removedCount="",r.countDelta="",r.addedSize="",r.removedSize="",r.sizeDelta=""}retainersDataSource(){return void 0===this.snapshotNodeIndex?null:{snapshot:this._snapshot,snapshotNodeIndex:this.snapshotNodeIndex}}createProvider(){if(void 0===this.snapshotNodeIndex)throw new Error("Cannot create a provider on a root node");return this._snapshot.createEdgesProvider(this.snapshotNodeIndex)}_findAncestorWithSameSnapshotNodeId(){let e=this._parentObjectNode;for(;e;){if(e.snapshotNodeId===this.snapshotNodeId)return e;e=e._parentObjectNode}return null}_createChildNode(e){return new Wt(this._dataGrid,this._snapshot,e,this)}_getHash(){return this._edgeIndex}comparator(){const e=this._dataGrid.isSortOrderAscending();switch(this._dataGrid.sortColumnId()){case"object":return new le.ComparatorConfig("!edgeName",e,"retainedSize",!1);case"count":return new le.ComparatorConfig("!edgeName",!0,"retainedSize",!1);case"shallowSize":return new le.ComparatorConfig("selfSize",e,"!edgeName",!0);case"retainedSize":return new le.ComparatorConfig("retainedSize",e,"!edgeName",!0);case"distance":return new le.ComparatorConfig("distance",e,"_name",!0);default:return new le.ComparatorConfig("!edgeName",!0,"retainedSize",!1)}}_prefixObjectCell(e){let t=this._referenceName||"(empty)",i="name";switch(this._referenceType){case"context":i="object-value-number";break;case"internal":case"hidden":case"weak":i="object-value-null";break;case"element":t=`[${t}]`}this._cycledWithAncestorGridNode&&e.classList.add("cycled-ancessor-node"),e.prepend(P.html`<span class="property-name ${i}">${t}</span>
8
+ <span class="grayed">${this._edgeNodeSeparator()}</span>`)}_edgeNodeSeparator(){return"::"}}class Ut extends Wt{constructor(e,t,i,s){super(e,t,i,s)}createProvider(){if(void 0===this.snapshotNodeIndex)throw new Error("Cannot create providers on root nodes");return this._snapshot.createRetainingEdgesProvider(this.snapshotNodeIndex)}_createChildNode(e){return new Ut(this._dataGrid,this._snapshot,e,this)}_edgeNodeSeparator(){return Vt(Bt.inElement)}expand(){this._expandRetainersChain(20)}_expandRetainersChain(e){if(!this._populated)return this.once(Gt.Events.PopulateComplete).then((()=>this._expandRetainersChain(e))),void this.populate();if(super.expand(),--e>0&&this.children.length>0){const t=this.children[0];if((t._distance||0)>1)return void t._expandRetainersChain(e)}this._dataGrid.dispatchEventToListeners(ai.ExpandRetainersComplete)}}class Jt extends At{constructor(e,t,i,s){super(e,i),this._baseSnapshotOrSnapshot=t,this._isDeletedNode=s,this.updateHasChildren();const r=this.data;r.count="",r.countDelta="",r.sizeDelta="",this._isDeletedNode?(r.addedCount="",r.addedSize="",r.removedCount="•",r.removedSize=Number.withThousandsSeparator(this._shallowSize||0)):(r.addedCount="•",r.addedSize=Number.withThousandsSeparator(this._shallowSize||0),r.removedCount="",r.removedSize="")}retainersDataSource(){return void 0===this.snapshotNodeIndex?null:{snapshot:this._baseSnapshotOrSnapshot,snapshotNodeIndex:this.snapshotNodeIndex}}createProvider(){if(void 0===this.snapshotNodeIndex)throw new Error("Cannot create providers on root nodes");return this._baseSnapshotOrSnapshot.createEdgesProvider(this.snapshotNodeIndex)}_createChildNode(e){return new Wt(this._dataGrid,this._baseSnapshotOrSnapshot,e,null)}_getHash(){if(void 0===this.snapshotNodeId)throw new Error("Cannot hash root nodes");return this.snapshotNodeId}comparator(){const e=this._dataGrid.isSortOrderAscending();switch(this._dataGrid.sortColumnId()){case"object":return new le.ComparatorConfig("!edgeName",e,"retainedSize",!1);case"distance":return new le.ComparatorConfig("distance",e,"retainedSize",!1);case"count":return new le.ComparatorConfig("!edgeName",!0,"retainedSize",!1);case"addedSize":case"removedSize":case"shallowSize":return new le.ComparatorConfig("selfSize",e,"!edgeName",!0);case"retainedSize":return new le.ComparatorConfig("retainedSize",e,"!edgeName",!0);default:return new le.ComparatorConfig("!edgeName",!0,"retainedSize",!1)}}}class qt extends Gt{constructor(e,t,i,s){super(e,i.count>0),this._name=t,this._nodeFilter=s,this._distance=i.distance,this._count=i.count,this._shallowSize=i.self,this._retainedSize=i.maxRet;const r=e.snapshot,o=this._retainedSize/r.totalSize*100,n=this._shallowSize/r.totalSize*100;this.data={object:t,count:Number.withThousandsSeparator(this._count),distance:this._toUIDistance(this._distance),shallowSize:Number.withThousandsSeparator(this._shallowSize),retainedSize:Number.withThousandsSeparator(this._retainedSize),"shallowSize-percent":this._toPercentString(n),"retainedSize-percent":this._toPercentString(o)}}get name(){return this._name}createProvider(){return this._dataGrid.snapshot.createNodesProviderForClass(this._name,this._nodeFilter)}async populateNodeBySnapshotObjectId(e){this._dataGrid.resetNameFilter(),await this.expandWithoutPopulate();const t=await this._provider().nodePosition(e);if(-1===t)return this.collapse(),[];await this._populateChildren(t,null);const i=this.childForPosition(t);return i?[this,i]:[]}filteredOut(e){return-1===this._name.toLowerCase().indexOf(e)}createCell(e){const t="object"===e?super.createCell(e):this._createValueCell(e);return"object"===e&&this._count>1&&t.appendChild(P.html`<span class="objects-count">×${this._count}</span>`),t}_createChildNode(e){return new Jt(this._dataGrid,this._dataGrid.snapshot,e,!1)}comparator(){const e=this._dataGrid.isSortOrderAscending(),t=this._dataGrid.sortColumnId();switch(t){case"object":return new le.ComparatorConfig("name",e,"id",!0);case"distance":return new le.ComparatorConfig("distance",e,"retainedSize",!1);case"shallowSize":return new le.ComparatorConfig("selfSize",e,"id",!0);case"retainedSize":return new le.ComparatorConfig("retainedSize",e,"id",!0);default:throw new Error("Invalid sort column id "+t)}}}class $t{constructor(e,t,i,s){this._addedNodesProvider=e,this._deletedNodesProvider=t,this._addedCount=i,this._removedCount=s}dispose(){this._addedNodesProvider.dispose(),this._deletedNodesProvider.dispose()}nodePosition(e){throw new Error("Unreachable")}isEmpty(){return Promise.resolve(!1)}async serializeItemsRange(e,t){let i,s;if(e<this._addedCount){i=await this._addedNodesProvider.serializeItemsRange(e,t);for(const e of i.items)e.isAddedNotRemoved=!0;if(i.endPosition>=t)return i.totalLength=this._addedCount+this._removedCount,i;s=i,i=await this._deletedNodesProvider.serializeItemsRange(0,t-i.endPosition)}else s=new le.ItemsRange(0,0,0,[]),i=await this._deletedNodesProvider.serializeItemsRange(e-this._addedCount,t-this._addedCount);s.items.length||(s.startPosition=this._addedCount+i.startPosition);for(const e of i.items)e.isAddedNotRemoved=!1;return s.items.push(...i.items),s.endPosition=this._addedCount+i.endPosition,s.totalLength=this._addedCount+this._removedCount,s}async sortAndRewind(e){await this._addedNodesProvider.sortAndRewind(e),await this._deletedNodesProvider.sortAndRewind(e)}}class Qt extends Gt{constructor(e,t,i){super(e,!0),this._name=t,this._addedCount=i.addedCount,this._removedCount=i.removedCount,this._countDelta=i.countDelta,this._addedSize=i.addedSize,this._removedSize=i.removedSize,this._sizeDelta=i.sizeDelta,this._deletedIndexes=i.deletedIndexes,this.data={object:t,addedCount:Number.withThousandsSeparator(this._addedCount),removedCount:Number.withThousandsSeparator(this._removedCount),countDelta:this._signForDelta(this._countDelta)+Number.withThousandsSeparator(Math.abs(this._countDelta)),addedSize:Number.withThousandsSeparator(this._addedSize),removedSize:Number.withThousandsSeparator(this._removedSize),sizeDelta:this._signForDelta(this._sizeDelta)+Number.withThousandsSeparator(Math.abs(this._sizeDelta))}}get name(){return this._name}createProvider(){const e=this._dataGrid;if(null===e.snapshot||void 0===e.baseSnapshot||void 0===e.baseSnapshot.uid)throw new Error("Data sources have not been set correctly");const t=e.snapshot.createAddedNodesProvider(e.baseSnapshot.uid,this._name),i=e.baseSnapshot.createDeletedNodesProvider(this._deletedIndexes);if(!t||!i)throw new Error("Failed to create node providers");return new $t(t,i,this._addedCount,this._removedCount)}createCell(e){const t=super.createCell(e);return"object"!==e&&t.classList.add("numeric-column"),t}_createChildNode(e){const t=this._dataGrid;if(e.isAddedNotRemoved){if(null===t.snapshot)throw new Error("Data sources have not been set correctly");return new Jt(this._dataGrid,t.snapshot,e,!1)}if(void 0===t.baseSnapshot)throw new Error("Data sources have not been set correctly");return new Jt(this._dataGrid,t.baseSnapshot,e,!0)}comparator(){const e=this._dataGrid.isSortOrderAscending(),t=this._dataGrid.sortColumnId();switch(t){case"object":return new le.ComparatorConfig("name",e,"id",!0);case"addedCount":case"removedCount":case"countDelta":return new le.ComparatorConfig("name",!0,"id",!0);case"addedSize":case"removedSize":case"sizeDelta":return new le.ComparatorConfig("selfSize",e,"id",!0);default:throw new Error("Invalid sort column "+t)}}filteredOut(e){return-1===this._name.toLowerCase().indexOf(e)}_signForDelta(e){return 0===e?"":e>0?"+":"−"}}class Kt extends Gt{constructor(e,t){super(e,t.hasChildren),this._populated=!1,this._allocationNode=t,this.data={liveCount:Number.withThousandsSeparator(t.liveCount),count:Number.withThousandsSeparator(t.count),liveSize:Number.withThousandsSeparator(t.liveSize),size:Number.withThousandsSeparator(t.size),name:t.name}}populate(){this._populated||this._doPopulate()}async _doPopulate(){this._populated=!0;const e=await this._dataGrid.snapshot.allocationNodeCallers(this._allocationNode.id),t=e.nodesWithSingleCaller;let i=this;const s=this._dataGrid;for(const e of t){const t=new Kt(s,e);s.appendNode(i,t),i=t,i._populated=!0,this.expanded&&i.expand()}const r=e.branchingCallers;r.sort(this._dataGrid.createComparator());for(const e of r)s.appendNode(i,new Kt(s,e));s.updateVisibleNodes(!0)}expand(){super.expand(),1===this.children.length&&this.children[0].expand()}createCell(e){if("name"!==e)return this._createValueCell(e);const t=super.createCell(e),i=this._allocationNode,s=this._dataGrid.heapProfilerModel();if(i.scriptId){const e=this._dataGrid.linkifier.linkifyScriptLocation(s?s.target():null,String(i.scriptId),i.scriptName,i.line-1,{columnNumber:i.column-1,className:"profile-node-file",tabStop:void 0});e.style.maxWidth="75%",t.insertBefore(e,t.firstChild)}return t}allocationNodeId(){return this._allocationNode.id}}var Xt=Object.freeze({__proto__:null,UIStrings:Bt,HeapSnapshotGridNode:Gt,HeapSnapshotGenericObjectNode:At,HeapSnapshotObjectNode:Wt,HeapSnapshotRetainingObjectNode:Ut,HeapSnapshotInstanceNode:Jt,HeapSnapshotConstructorNode:qt,HeapSnapshotDiffNodesProvider:$t,HeapSnapshotDiffNode:Qt,AllocationGridNode:Kt});const Yt={distanceFromWindowObject:"Distance from window object",sizeOfTheObjectItselfInBytes:"Size of the object itself in bytes",sizeOfTheObjectPlusTheGraphIt:"Size of the object plus the graph it retains in bytes",object:"Object",distance:"Distance",shallowSize:"Shallow Size",retainedSize:"Retained Size",heapSnapshotRetainment:"Heap Snapshot Retainment",constructorString:"Constructor",heapSnapshotConstructors:"Heap Snapshot Constructors",New:"# New",Deleted:"# Deleted",Delta:"# Delta",allocSize:"Alloc. Size",freedSize:"Freed Size",sizeDelta:"Size Delta",heapSnapshotDiff:"Heap Snapshot Diff",liveCount:"Live Count",count:"Count",liveSize:"Live Size",size:"Size",function:"Function",allocation:"Allocation"},Zt=a.registerUIStrings("profiler/HeapSnapshotDataGrids.js",Yt),ei=a.getLocalizedString.bind(void 0,Zt),ti=new WeakMap;class ii extends r.DataGridImpl{constructor(e,t,i){super(i),this.snapshot=null,this.selectedNode=null,this._heapProfilerModel=e,this._dataDisplayDelegate=t;const s=[["distance",ei(Yt.distanceFromWindowObject)],["shallowSize",ei(Yt.sizeOfTheObjectItselfInBytes)],["retainedSize",ei(Yt.sizeOfTheObjectPlusTheGraphIt)]];for(const e of s){const t=this.headerTableHeader(e[0]);t&&t.setAttribute("title",e[1])}this._recursiveSortingDepth=0,this._highlightedNode=null,this._populatedAndSorted=!1,this._nameFilter=null,this._nodeFilter=new le.NodeFilter,this.addEventListener(si.SortingComplete,this._sortingComplete,this),this.addEventListener(r.Events.SortingChanged,this.sortingChanged,this),this.setRowContextMenuCallback(this._populateContextMenu.bind(this))}async setDataSource(e,t){}_isFilteredOut(e){const t=this._nameFilter?this._nameFilter.value().toLowerCase():"";return!!(t&&(e instanceof Qt||e instanceof qt)&&e.filteredOut(t))}heapProfilerModel(){return this._heapProfilerModel}dataDisplayDelegate(){return this._dataDisplayDelegate}nodeFilter(){return this._nodeFilter}setNameFilter(e){this._nameFilter=e}defaultPopulateCount(){return 100}_disposeAllNodes(){const e=this.topLevelNodes();for(let t=0,i=e.length;t<i;++t)e[t].dispose()}wasShown(){this._nameFilter&&(this._nameFilter.addEventListener(v.ToolbarInput.Event.TextChanged,this._onNameFilterChanged,this),this.updateVisibleNodes(!0)),this._populatedAndSorted&&this.dispatchEventToListeners(si.ContentShown,this)}_sortingComplete(){this.removeEventListener(si.SortingComplete,this._sortingComplete,this),this._populatedAndSorted=!0,this.dispatchEventToListeners(si.ContentShown,this)}willHide(){this._nameFilter&&this._nameFilter.removeEventListener(v.ToolbarInput.Event.TextChanged,this._onNameFilterChanged,this),this._clearCurrentHighlight()}_populateContextMenu(e,t){const i=t;i.populateContextMenu(e,this._dataDisplayDelegate,this.heapProfilerModel()),i instanceof At&&i.linkElement&&!e.containsTarget(i.linkElement)&&e.appendApplicableItems(i.linkElement)}resetSortingCache(){delete this._lastSortColumnId,delete this._lastSortAscending}topLevelNodes(){return this.rootNode().children}revealObjectByHeapSnapshotId(e){return Promise.resolve(null)}highlightNode(e){this._clearCurrentHighlight(),this._highlightedNode=e,l.runCSSAnimationOnce(this._highlightedNode.element(),"highlighted-row")}_clearCurrentHighlight(){this._highlightedNode&&(this._highlightedNode.element().classList.remove("highlighted-row"),this._highlightedNode=null)}resetNameFilter(){this._nameFilter&&this._nameFilter.setValue("")}_onNameFilterChanged(){this.updateVisibleNodes(!0),this._deselectFilteredNodes()}_deselectFilteredNodes(){let e=this.selectedNode;for(;e;){if(this.selectedNode&&this._isFilteredOut(e))return this.selectedNode.deselect(),void(this.selectedNode=null);e=e.parent}}_sortFields(e,t){throw new Error("Not implemented")}sortingChanged(){const e=this.isSortOrderAscending(),t=this.sortColumnId();if(this._lastSortColumnId===t&&this._lastSortAscending===e)return;this._lastSortColumnId=t,this._lastSortAscending=e;const i=this._sortFields(t||"",e);this._performSorting((function(e,t){let s=e[i.fieldName1],r=t[i.fieldName1],o=s<r?-1:s>r?1:0;return i.ascending1||(o=-o),0!==o||(s=e[i.fieldName2],r=t[i.fieldName2],o=s<r?-1:s>r?1:0,i.ascending2||(o=-o)),o}))}_performSorting(e){this.recursiveSortingEnter();const t=this.allChildren(this.rootNode());this.rootNode().removeChildren(),t.sort(e);for(let e=0,i=t.length;e<i;++e){const i=t[e];this.appendChildAfterSorting(i),i.expanded&&i.sort()}this.recursiveSortingLeave()}appendChildAfterSorting(e){const t=e.revealed;this.rootNode().appendChild(e),e.revealed=t}recursiveSortingEnter(){++this._recursiveSortingDepth}recursiveSortingLeave(){this._recursiveSortingDepth&&(--this._recursiveSortingDepth||(this.updateVisibleNodes(!0),this.dispatchEventToListeners(si.SortingComplete)))}updateVisibleNodes(e){}allChildren(e){return e.children}insertChild(e,t,i){e.insertChild(t,i)}removeChildByIndex(e,t){e.removeChild(e.children[t])}removeAllChildren(e){e.removeChildren()}}const si={ContentShown:Symbol("ContentShown"),SortingComplete:Symbol("SortingComplete")};class ri extends ii{constructor(e,t,i){super(e,t,i),this.scrollContainer.addEventListener("scroll",this._onScroll.bind(this),!0),this._topPaddingHeight=0,this._bottomPaddingHeight=0,this.selectedNode=null}topLevelNodes(){return this.allChildren(this.rootNode())}appendChildAfterSorting(e){}updateVisibleNodes(e){const t=this.scrollContainer.scrollHeight;let i=this.scrollContainer.scrollTop,s=t-i-this.scrollContainer.offsetHeight;i=Math.max(0,i-40),s=Math.max(0,s-40);let r=t-i-s;if(!e&&i>=this._topPaddingHeight&&s>=this._bottomPaddingHeight)return;i-=500,r+=1e3;const o=this.selectedNode;this.rootNode().removeChildren(),this._topPaddingHeight=0,this._bottomPaddingHeight=0,this._addVisibleNodes(this.rootNode(),i,i+r),this.setVerticalPadding(this._topPaddingHeight,this._bottomPaddingHeight),o&&(o.parent?o.select(!0):this.selectedNode=o)}_addVisibleNodes(e,t,i){if(!e.expanded)return 0;const s=this.allChildren(e);let r=0,o=0;for(;o<s.length;++o){const e=s[o];if(this._isFilteredOut(e))continue;const i=r+this._nodeHeight(e);if(i>t)break;r=i}let n=r;for(;o<s.length&&n<i;++o){const r=s[o];if(this._isFilteredOut(r))continue;const a=r.hasChildren();r.removeChildren(),r.setHasChildren(a),e.appendChild(r),n+=r.nodeSelfHeight(),n+=this._addVisibleNodes(r,t-n,i-n)}let a=0;for(;o<s.length;++o){const e=s[o];this._isFilteredOut(e)||(a+=this._nodeHeight(e))}return this._topPaddingHeight+=r,this._bottomPaddingHeight+=a,n+a}_nodeHeight(e){let t=e.nodeSelfHeight();if(!e.expanded)return t;const i=this.allChildren(e);for(let e=0;e<i.length;e++)t+=this._nodeHeight(i[e]);return t}revealTreeNode(e){const t=this._calculateOffset(e),i=e[e.length-1],s=this.scrollContainer.scrollTop,r=s+this.scrollContainer.offsetHeight;if(t>=s&&t<r)return Promise.resolve(i);return this.scrollContainer.scrollTop=Math.max(0,t-40),new Promise((e=>{console.assert(!this._scrollToResolveCallback),this._scrollToResolveCallback=e.bind(null,i),this.scrollContainer.window().requestAnimationFrame((()=>{this._scrollToResolveCallback&&(this._scrollToResolveCallback(),this._scrollToResolveCallback=null)}))}))}_calculateOffset(e){let t=this.rootNode(),i=0;if(0===e.length)return 0;for(let s=0;s<e.length;++s){const r=e[s],o=this.allChildren(t);for(let e=0;e<o.length;++e){const t=o[e];if(r===t){i+=r.nodeSelfHeight();break}i+=this._nodeHeight(t)}t=r}return i-e[e.length-1].nodeSelfHeight()}allChildren(e){const t=ti.get(e)||[];return ti.has(e)||ti.set(e,t),t}appendNode(e,t){this.allChildren(e).push(t)}insertChild(e,t,i){this.allChildren(e).splice(i,0,t)}removeChildByIndex(e,t){this.allChildren(e).splice(t,1)}removeAllChildren(e){ti.delete(e)}removeTopLevelNodes(){this._disposeAllNodes(),this.rootNode().removeChildren(),this.removeAllChildren(this.rootNode())}_isScrolledIntoView(e){const t=this.scrollContainer.scrollTop,i=t+this.scrollContainer.clientHeight,s=e.offsetTop;return s+e.offsetHeight<=i&&s>=t}onResize(){super.onResize(),this.updateVisibleNodes(!1)}_onScroll(e){this.updateVisibleNodes(!1),this._scrollToResolveCallback&&(this._scrollToResolveCallback(),this._scrollToResolveCallback=null)}}class oi extends ii{constructor(e,t,i,s){super(e,t,{displayName:i,columns:s=s||[{id:"object",title:ei(Yt.object),disclosure:!0,sortable:!0},{id:"distance",title:ei(Yt.distance),width:"70px",sortable:!0,fixedWidth:!0},{id:"shallowSize",title:ei(Yt.shallowSize),width:"110px",sortable:!0,fixedWidth:!0},{id:"retainedSize",title:ei(Yt.retainedSize),width:"110px",sortable:!0,fixedWidth:!0,sort:r.Order.Descending}]})}async setDataSource(e,t){this.snapshot=e;const i=new le.Node(-1,"root",0,t||e.rootNodeIndex,0,0,"");this.setRootNode(this._createRootNode(e,i)),this.rootNode().sort()}_createRootNode(e,t){const i=new le.Edge("",t,"",-1);return new Wt(this,e,i,null)}sortingChanged(){const e=this.rootNode();e.hasChildren()&&e.sort()}}class ni extends oi{constructor(e,t){const i=[{id:"object",title:ei(Yt.object),disclosure:!0,sortable:!0},{id:"distance",title:ei(Yt.distance),width:"70px",sortable:!0,fixedWidth:!0,sort:r.Order.Ascending},{id:"shallowSize",title:ei(Yt.shallowSize),width:"110px",sortable:!0,fixedWidth:!0},{id:"retainedSize",title:ei(Yt.retainedSize),width:"110px",sortable:!0,fixedWidth:!0}];super(e,t,ei(Yt.heapSnapshotRetainment),i)}_createRootNode(e,t){const i=new le.Edge("",t,"",-1);return new Ut(this,e,i,null)}_sortFields(e,t){switch(e){case"object":return new le.ComparatorConfig("_name",t,"_count",!1);case"count":return new le.ComparatorConfig("_count",t,"_name",!0);case"shallowSize":return new le.ComparatorConfig("_shallowSize",t,"_name",!0);case"retainedSize":return new le.ComparatorConfig("_retainedSize",t,"_name",!0);case"distance":return new le.ComparatorConfig("_distance",t,"_name",!0);default:throw new Error("Unknown column "+e)}}reset(){this.rootNode().removeChildren(),this.resetSortingCache()}async setDataSource(e,t){await super.setDataSource(e,t),this.rootNode().expand()}}const ai={ExpandRetainersComplete:Symbol("ExpandRetainersComplete")};class li extends ri{constructor(e,t){const i=[{id:"object",title:ei(Yt.constructorString),disclosure:!0,sortable:!0},{id:"distance",title:ei(Yt.distance),width:"70px",sortable:!0,fixedWidth:!0},{id:"shallowSize",title:ei(Yt.shallowSize),width:"110px",sortable:!0,fixedWidth:!0},{id:"retainedSize",title:ei(Yt.retainedSize),width:"110px",sort:r.Order.Descending,sortable:!0,fixedWidth:!0}];super(e,t,{displayName:ei(Yt.heapSnapshotConstructors).toString(),columns:i}),this._profileIndex=-1,this._objectIdToSelect=null,this._nextRequestedFilter=null}_sortFields(e,t){switch(e){case"object":return new le.ComparatorConfig("_name",t,"_retainedSize",!1);case"distance":return new le.ComparatorConfig("_distance",t,"_retainedSize",!1);case"shallowSize":return new le.ComparatorConfig("_shallowSize",t,"_name",!0);case"retainedSize":return new le.ComparatorConfig("_retainedSize",t,"_name",!0);default:throw new Error("Unknown column "+e)}}async revealObjectByHeapSnapshotId(e){if(!this.snapshot)return this._objectIdToSelect=e,null;const t=await this.snapshot.nodeClassName(parseInt(e,10));if(!t)return null;const i=this.topLevelNodes().find((e=>e.name===t));if(!i)return null;const s=await i.populateNodeBySnapshotObjectId(parseInt(e,10));return s.length?this.revealTreeNode(s):null}clear(){this._nextRequestedFilter=null,this._lastFilter=null,this.removeTopLevelNodes()}async setDataSource(e,t){this.snapshot=e,-1===this._profileIndex&&this._populateChildren(),this._objectIdToSelect&&(this.revealObjectByHeapSnapshotId(this._objectIdToSelect),this._objectIdToSelect=null)}setSelectionRange(e,t){this._nodeFilter=new le.NodeFilter(e,t),this._populateChildren(this._nodeFilter)}setAllocationNodeId(e){this._nodeFilter=new le.NodeFilter,this._nodeFilter.allocationNodeId=e,this._populateChildren(this._nodeFilter)}_aggregatesReceived(e,t){this._filterInProgress=null,this._nextRequestedFilter&&this.snapshot&&(this.snapshot.aggregatesWithFilter(this._nextRequestedFilter).then(this._aggregatesReceived.bind(this,this._nextRequestedFilter)),this._filterInProgress=this._nextRequestedFilter,this._nextRequestedFilter=null),this.removeTopLevelNodes(),this.resetSortingCache();for(const i in t)this.appendNode(this.rootNode(),new qt(this,i,t[i],e));this.sortingChanged(),this._lastFilter=e}async _populateChildren(e){const t=e||new le.NodeFilter;if(this._filterInProgress)this._nextRequestedFilter=this._filterInProgress.equals(t)?null:t;else if((!this._lastFilter||!this._lastFilter.equals(t))&&(this._filterInProgress=t,this.snapshot)){const e=await this.snapshot.aggregatesWithFilter(t);this._aggregatesReceived(t,e)}}filterSelectIndexChanged(e,t){if(this._profileIndex=t,this._nodeFilter=void 0,-1!==t){const i=t>0?e[t-1].maxJSObjectId:0,s=e[t].maxJSObjectId;this._nodeFilter=new le.NodeFilter(i,s)}this._populateChildren(this._nodeFilter)}}class di extends ri{constructor(e,t){const i=[{id:"object",title:ei(Yt.constructorString),disclosure:!0,sortable:!0},{id:"addedCount",title:ei(Yt.New),width:"75px",sortable:!0,fixedWidth:!0},{id:"removedCount",title:ei(Yt.Deleted),width:"75px",sortable:!0,fixedWidth:!0},{id:"countDelta",title:ei(Yt.Delta),width:"65px",sortable:!0,fixedWidth:!0},{id:"addedSize",title:ei(Yt.allocSize),width:"75px",sortable:!0,fixedWidth:!0,sort:r.Order.Descending},{id:"removedSize",title:ei(Yt.freedSize),width:"75px",sortable:!0,fixedWidth:!0},{id:"sizeDelta",title:ei(Yt.sizeDelta),width:"75px",sortable:!0,fixedWidth:!0}];super(e,t,{displayName:ei(Yt.heapSnapshotDiff).toString(),columns:i})}defaultPopulateCount(){return 50}_sortFields(e,t){switch(e){case"object":return new le.ComparatorConfig("_name",t,"_count",!1);case"addedCount":return new le.ComparatorConfig("_addedCount",t,"_name",!0);case"removedCount":return new le.ComparatorConfig("_removedCount",t,"_name",!0);case"countDelta":return new le.ComparatorConfig("_countDelta",t,"_name",!0);case"addedSize":return new le.ComparatorConfig("_addedSize",t,"_name",!0);case"removedSize":return new le.ComparatorConfig("_removedSize",t,"_name",!0);case"sizeDelta":return new le.ComparatorConfig("_sizeDelta",t,"_name",!0);default:throw new Error("Unknown column "+e)}}async setDataSource(e,t){this.snapshot=e}setBaseDataSource(e){this.baseSnapshot=e,this.removeTopLevelNodes(),this.resetSortingCache(),this.baseSnapshot!==this.snapshot?this._populateChildren():this.dispatchEventToListeners(si.SortingComplete)}async _populateChildren(){if(null===this.snapshot||void 0===this.baseSnapshot||void 0===this.baseSnapshot.uid)throw new Error("Data sources have not been set correctly");const e=await this.baseSnapshot.aggregatesForDiff(),t=await this.snapshot.calculateSnapshotDiff(this.baseSnapshot.uid,e);for(const e in t){const i=t[e];this.appendNode(this.rootNode(),new Qt(this,e,i))}this.sortingChanged()}}class hi extends ri{constructor(e,t){const i=[{id:"liveCount",title:ei(Yt.liveCount),width:"75px",sortable:!0,fixedWidth:!0},{id:"count",title:ei(Yt.count),width:"65px",sortable:!0,fixedWidth:!0},{id:"liveSize",title:ei(Yt.liveSize),width:"75px",sortable:!0,fixedWidth:!0},{id:"size",title:ei(Yt.size),width:"75px",sortable:!0,fixedWidth:!0,sort:r.Order.Descending},{id:"name",title:ei(Yt.function),disclosure:!0,sortable:!0}];super(e,t,{displayName:ei(Yt.allocation).toString(),columns:i}),this._linkifier=new q.Linkifier}get linkifier(){return this._linkifier}dispose(){this._linkifier.reset()}async setDataSource(e,t){this.snapshot=e,this._topNodes=await this.snapshot.allocationTracesTops(),this._populateChildren()}_populateChildren(){this.removeTopLevelNodes();const e=this.rootNode(),t=this._topNodes||[];for(const i of t)this.appendNode(e,new Kt(this,i));this.updateVisibleNodes(!0)}sortingChanged(){void 0!==this._topNodes&&(this._topNodes.sort(this.createComparator()),this.rootNode().removeChildren(),this._populateChildren())}createComparator(){const e=this.sortColumnId(),t=this.sortOrder()===r.Order.Ascending?1:-1;return function(i,s){return i[e]>s[e]?t:i[e]<s[e]?-t:0}}}var ci=Object.freeze({__proto__:null,UIStrings:Yt,HeapSnapshotSortableDataGrid:ii,HeapSnapshotSortableDataGridEvents:si,HeapSnapshotViewportDataGrid:ri,HeapSnapshotContainmentDataGrid:oi,HeapSnapshotRetainmentDataGrid:ni,HeapSnapshotRetainmentDataGridEvents:ai,HeapSnapshotConstructorsDataGrid:li,HeapSnapshotDiffDataGrid:di,AllocationDataGrid:hi});const pi={anErrorOccurredWhenACallToMethod:"An error occurred when a call to method '{PH1}' was requested"},ui=a.registerUIStrings("profiler/HeapSnapshotProxy.js",pi),_i=a.getLocalizedString.bind(void 0,ui);class mi extends F.ObjectWrapper{constructor(e){super(),this._eventHandler=e,this._nextObjectId=1,this._nextCallId=1,this._callbacks=new Map,this._previousCallbacks=new Set,this._worker=z.WorkerWrapper.fromURL(new URL("../heap_snapshot_worker/heap_snapshot_worker-legacy.js",import.meta.url)),this._worker.onmessage=this._messageReceived.bind(this)}createLoader(e,t){const i=this._nextObjectId++,s=new gi(this,i,e,t);return this._postMessage({callId:this._nextCallId++,disposition:"create",objectId:i,methodName:"HeapSnapshotWorker.HeapSnapshotLoader"}),s}dispose(){this._worker.terminate(),this._interval&&clearInterval(this._interval)}disposeObject(e){this._postMessage({callId:this._nextCallId++,disposition:"dispose",objectId:e})}evaluateForTest(e,t){const i=this._nextCallId++;this._callbacks.set(i,t),this._postMessage({callId:i,disposition:"evaluateForTest",source:e})}callFactoryMethod(e,t,i,s){const r=this._nextCallId++,o=Array.prototype.slice.call(arguments,4),n=this._nextObjectId++;return e?(this._callbacks.set(r,(t=>{e(t?new s(this,n):null)})),this._postMessage({callId:r,disposition:"factory",objectId:t,methodName:i,methodArguments:o,newObjectId:n}),null):(this._postMessage({callId:r,disposition:"factory",objectId:t,methodName:i,methodArguments:o,newObjectId:n}),new s(this,n))}callMethod(e,t,i){const s=this._nextCallId++,r=Array.prototype.slice.call(arguments,3);e&&this._callbacks.set(s,e),this._postMessage({callId:s,disposition:"method",objectId:t,methodName:i,methodArguments:r})}startCheckingForLongRunningCalls(){this._interval||(this._checkLongRunningCalls(),this._interval=setInterval(this._checkLongRunningCalls.bind(this),300))}_checkLongRunningCalls(){for(const e of this._previousCallbacks)this._callbacks.has(e)||this._previousCallbacks.delete(e);const e=Boolean(this._previousCallbacks.size);this.dispatchEventToListeners(mi.Events.Wait,e);for(const e of this._callbacks.keys())this._previousCallbacks.add(e)}_messageReceived(e){const t=e.data;if(t.eventName)return void(this._eventHandler&&this._eventHandler(t.eventName,t.data));if(t.error)return t.errorMethodName&&O.Console.instance().error(_i(pi.anErrorOccurredWhenACallToMethod,{PH1:t.errorMethodName})),O.Console.instance().error(t.errorCallStack),void this._callbacks.delete(t.callId);const i=this._callbacks.get(t.callId);i&&(this._callbacks.delete(t.callId),i(t.result))}_postMessage(e){this._worker.postMessage(e)}}mi.Events={Wait:Symbol("Wait")};class fi{constructor(e,t){this._worker=e,this._objectId=t}_callWorker(e,t){t.splice(1,0,this._objectId);const i=this._worker[e];if(!i)throw new Error(`Could not find worker with name ${e}.`);return i.apply(this._worker,t)}dispose(){this._worker.disposeObject(this._objectId)}disposeWorker(){this._worker.dispose()}callFactoryMethod(e,t,i,...s){return this._callWorker("callFactoryMethod",Array.prototype.slice.call(arguments,0))}_callMethodPromise(e,...t){const i=Array.prototype.slice.call(arguments);return new Promise((e=>this._callWorker("callMethod",[e,...i])))}}class gi extends fi{constructor(e,t,i,s){super(e,t),this._profileUid=i,this._snapshotReceivedCallback=s}async write(e){await this._callMethodPromise("write",e)}async close(){await this._callMethodPromise("close");const e=await new Promise((e=>this.callFactoryMethod(e,"buildSnapshot",vi)));this.dispose(),e.setProfileUid(this._profileUid),await e.updateStaticData(),this._snapshotReceivedCallback(e)}}class vi extends fi{constructor(e,t){super(e,t),this._staticData=null}search(e,t){return this._callMethodPromise("search",e,t)}aggregatesWithFilter(e){return this._callMethodPromise("aggregatesWithFilter",e)}aggregatesForDiff(){return this._callMethodPromise("aggregatesForDiff")}calculateSnapshotDiff(e,t){return this._callMethodPromise("calculateSnapshotDiff",e,t)}nodeClassName(e){return this._callMethodPromise("nodeClassName",e)}createEdgesProvider(e){return this.callFactoryMethod(null,"createEdgesProvider",Si,e)}createRetainingEdgesProvider(e){return this.callFactoryMethod(null,"createRetainingEdgesProvider",Si,e)}createAddedNodesProvider(e,t){return this.callFactoryMethod(null,"createAddedNodesProvider",Si,e,t)}createDeletedNodesProvider(e){return this.callFactoryMethod(null,"createDeletedNodesProvider",Si,e)}createNodesProvider(e){return this.callFactoryMethod(null,"createNodesProvider",Si,e)}createNodesProviderForClass(e,t){return this.callFactoryMethod(null,"createNodesProviderForClass",Si,e,t)}allocationTracesTops(){return this._callMethodPromise("allocationTracesTops")}allocationNodeCallers(e){return this._callMethodPromise("allocationNodeCallers",e)}allocationStack(e){return this._callMethodPromise("allocationStack",e)}dispose(){throw new Error("Should never be called")}get nodeCount(){return this._staticData?this._staticData.nodeCount:0}get rootNodeIndex(){return this._staticData?this._staticData.rootNodeIndex:0}async updateStaticData(){this._staticData=await this._callMethodPromise("updateStaticData")}getStatistics(){return this._callMethodPromise("getStatistics")}getLocation(e){return this._callMethodPromise("getLocation",e)}getSamples(){return this._callMethodPromise("getSamples")}get totalSize(){return this._staticData?this._staticData.totalSize:0}get uid(){return this._profileUid}setProfileUid(e){this._profileUid=e}maxJSObjectId(){return this._staticData?this._staticData.maxJSObjectId:0}}class Si extends fi{constructor(e,t){super(e,t)}nodePosition(e){return this._callMethodPromise("nodePosition",e)}isEmpty(){return this._callMethodPromise("isEmpty")}serializeItemsRange(e,t){return this._callMethodPromise("serializeItemsRange",e,t)}async sortAndRewind(e){await this._callMethodPromise("sortAndRewind",e)}}var wi=Object.freeze({__proto__:null,UIStrings:pi,HeapSnapshotWorkerProxy:mi,HeapSnapshotProxyObject:fi,HeapSnapshotLoaderProxy:gi,HeapSnapshotProxy:vi,HeapSnapshotProviderProxy:Si});const bi={find:"Find",containment:"Containment",retainers:"Retainers",allocationStack:"Allocation stack",perspective:"Perspective",baseSnapshot:"Base snapshot",filter:"Filter",classFilter:"Class filter",code:"Code",strings:"Strings",jsArrays:"JS arrays",typedArrays:"Typed arrays",systemObjects:"System objects",selectedSizeS:"Selected size: {PH1}",allObjects:"All objects",objectsAllocatedBeforeS:"Objects allocated before {PH1}",objectsAllocatedBetweenSAndS:"Objects allocated between {PH1} and {PH2}",summary:"Summary",comparison:"Comparison",allocation:"Allocation",liveObjects:"Live objects",statistics:"Statistics",heapSnapshot:"Heap snapshot",takeHeapSnapshot:"Take heap snapshot",heapSnapshots:"HEAP SNAPSHOTS",heapSnapshotProfilesShowMemory:"Heap snapshot profiles show memory distribution among your page's JavaScript objects and related DOM nodes.",treatGlobalObjectsAsRoots:"Treat global objects as roots (recommended, unchecking this exposes internal nodes and introduces excessive detail, but might help debugging cycles in retaining paths)",snapshotting:"Snapshotting…",snapshotD:"Snapshot {PH1}",percentagePlaceholder:"{PH1}%",allocationInstrumentationOn:"Allocation instrumentation on timeline",stopRecordingHeapProfile:"Stop recording heap profile",startRecordingHeapProfile:"Start recording heap profile",recordAllocationStacksExtra:"Record allocation stacks (extra performance overhead)",recording:"Recording…",allocationTimelines:"ALLOCATION TIMELINES",AllocationTimelinesShow:"\n Allocation timelines show instrumented JavaScript memory allocations over time.\n Once profile is recorded you can select a time interval to see objects that\n were allocated within it and still alive by the end of recording.\n Use this profile type to isolate memory leaks.",loading:"Loading…",savingD:"Saving… {PH1}%",sKb:"{PH1} kB",heapMemoryUsage:"Heap memory usage",stackWasNotRecordedForThisObject:"Stack was not recorded for this object because it had been allocated before this profile recording started."},Ci=a.registerUIStrings("profiler/HeapSnapshotView.js",bi),Pi=a.getLocalizedString.bind(void 0,Ci),Ti=a.registerUIStrings("profiler/ModuleUIStrings.js",{buildingEdgeIndexes:"Building edge indexes…",buildingRetainers:"Building retainers…",propagatingDomState:"Propagating DOM state…",calculatingNodeFlags:"Calculating node flags…",calculatingDistances:"Calculating distances…",buildingPostorderIndex:"Building postorder index…",buildingDominatorTree:"Building dominator tree…",calculatingRetainedSizes:"Calculating retained sizes…",buildingDominatedNodes:"Building dominated nodes…",calculatingStatistics:"Calculating statistics…",calculatingSamples:"Calculating samples…",buildingLocations:"Building locations…",finishedProcessing:"Finished processing.",buildingAllocationStatistics:"Building allocation statistics…",done:"Done",processingSnapshot:"Processing snapshot…",parsingStrings:"Parsing strings…",loadingSnapshotInfo:"Loading snapshot info…",loadingNodesD:"Loading nodes… {PH1}%",loadingEdgesD:"Loading edges… {PH1}%",loadingAllocationTracesD:"Loading allocation traces… {PH1}%",loadingSamples:"Loading samples…",loadingLocations:"Loading locations…",loadingStrings:"Loading strings…"}),yi=a.getLocalizedString.bind(void 0,Ti);class xi extends f.SimpleView{constructor(e,t){super(Pi(bi.heapSnapshot)),this._searchResults=[],this.element.classList.add("heap-snapshot-view"),this._profile=t,this._linkifier=new q.Linkifier;const i=t.profileType();i.addEventListener(Li.SnapshotReceived,this._onReceiveSnapshot,this),i.addEventListener(De.RemoveProfileHeader,this._onProfileHeaderRemoved,this);const s=i.id===Hi.TypeId;s&&this._createOverview(),this._parentDataDisplayDelegate=e,this._searchableView=new g.SearchableView(this,null),this._searchableView.setPlaceholder(Pi(bi.find),Pi(bi.find)),this._searchableView.show(this.element),this._splitWidget=new T.SplitWidget(!1,!0,"heapSnapshotSplitViewState",200,200),this._splitWidget.show(this._searchableView.element);const o=t.heapProfilerModel();let n;if(this._containmentDataGrid=new oi(o,this,Pi(bi.containment)),this._containmentDataGrid.addEventListener(r.Events.SelectedNode,this._selectionChanged,this),this._containmentWidget=this._containmentDataGrid.asWidget(),this._containmentWidget.setMinimumSize(50,25),this._statisticsView=new Mi,this._constructorsDataGrid=new li(o,this),this._constructorsDataGrid.addEventListener(r.Events.SelectedNode,this._selectionChanged,this),this._constructorsWidget=this._constructorsDataGrid.asWidget(),this._constructorsWidget.setMinimumSize(50,25),this._diffDataGrid=new di(o,this),this._diffDataGrid.addEventListener(r.Events.SelectedNode,this._selectionChanged,this),this._diffWidget=this._diffDataGrid.asWidget(),this._diffWidget.setMinimumSize(50,25),this._allocationDataGrid=null,s&&(this._allocationDataGrid=new hi(o,this),this._allocationDataGrid.addEventListener(r.Events.SelectedNode,this._onSelectAllocationNode,this),this._allocationWidget=this._allocationDataGrid.asWidget(),this._allocationWidget.setMinimumSize(50,25),this._allocationStackView=new Oi(o),this._allocationStackView.setMinimumSize(50,25),this._tabbedPane=new y.TabbedPane),this._retainmentDataGrid=new ni(o,this),this._retainmentWidget=this._retainmentDataGrid.asWidget(),this._retainmentWidget.setMinimumSize(50,21),this._retainmentWidget.element.classList.add("retaining-paths-view"),this._allocationStackView)this._tabbedPane=new y.TabbedPane,this._tabbedPane.appendTab("retainers",Pi(bi.retainers),this._retainmentWidget),this._tabbedPane.appendTab("allocation-stack",Pi(bi.allocationStack),this._allocationStackView),n=this._tabbedPane.headerElement(),this._objectDetailsView=this._tabbedPane;else{const e=document.createElement("div");e.classList.add("heap-snapshot-view-resizer");e.createChild("div","title").createChild("span").textContent=Pi(bi.retainers),n=e,this._objectDetailsView=new c.VBox,this._objectDetailsView.element.appendChild(e),this._retainmentWidget.show(this._objectDetailsView.element)}this._splitWidget.hideDefaultResizer(),this._splitWidget.installResizer(n),this._retainmentDataGrid.addEventListener(r.Events.SelectedNode,this._inspectedObjectChanged,this),this._retainmentDataGrid.reset(),this._perspectives=[],this._comparisonPerspective=new Ni,this._perspectives.push(new Ii),t.profileType()!==Vi.trackingHeapSnapshotProfileType&&this._perspectives.push(this._comparisonPerspective),this._perspectives.push(new Ri),this._allocationWidget&&this._perspectives.push(new Di),this._perspectives.push(new Fi),this._perspectiveSelect=new v.ToolbarComboBox(this._onSelectedPerspectiveChanged.bind(this),Pi(bi.perspective)),this._updatePerspectiveOptions(),this._baseSelect=new v.ToolbarComboBox(this._changeBase.bind(this),Pi(bi.baseSnapshot)),this._baseSelect.setVisible(!1),this._updateBaseOptions(),this._filterSelect=new v.ToolbarComboBox(this._changeFilter.bind(this),Pi(bi.filter)),this._filterSelect.setVisible(!1),this._updateFilterOptions(),this._classNameFilter=new v.ToolbarInput(Pi(bi.classFilter)),this._classNameFilter.setVisible(!1),this._constructorsDataGrid.setNameFilter(this._classNameFilter),this._diffDataGrid.setNameFilter(this._classNameFilter),this._selectedSizeText=new v.ToolbarText,this._popoverHelper=new x.PopoverHelper(this.element,this._getPopoverRequest.bind(this)),this._popoverHelper.setDisableOnClick(!0),this._popoverHelper.setHasPadding(!0),this.element.addEventListener("scroll",this._popoverHelper.hidePopover.bind(this._popoverHelper),!0),this._currentPerspectiveIndex=0,this._currentPerspective=this._perspectives[0],this._currentPerspective.activate(this),this._dataGrid=this._currentPerspective.masterGrid(this),this._populate(),this._searchThrottler=new B.Throttler(0);for(const e of this._profiles())e.addEventListener(Ne.ProfileTitleChanged,this._updateControls,this);this._baseProfile}_createOverview(){const e=this._profile.profileType();this._trackingOverviewGrid=new St,this._trackingOverviewGrid.addEventListener(wt,this._onIdsRangeChanged.bind(this)),this._profile.fromFile()||e.profileBeingRecorded()!==this._profile||(e.addEventListener(Hi.HeapStatsUpdate,this._onHeapStatsUpdate,this),e.addEventListener(Hi.TrackingStopped,this._onStopTracking,this),this._trackingOverviewGrid.start())}_onStopTracking(){this._profile.profileType().removeEventListener(Hi.HeapStatsUpdate,this._onHeapStatsUpdate,this),this._profile.profileType().removeEventListener(Hi.TrackingStopped,this._onStopTracking,this),this._trackingOverviewGrid&&this._trackingOverviewGrid.stop()}_onHeapStatsUpdate(e){e.data&&this._trackingOverviewGrid&&this._trackingOverviewGrid.setSamples(e.data)}searchableView(){return this._searchableView}showProfile(e){return this._parentDataDisplayDelegate.showProfile(e)}showObject(e,t){Number(e)<=this._profile.maxJSObjectId?this.selectLiveObject(t,e):this._parentDataDisplayDelegate.showObject(e,t)}async linkifyObject(e){const t=this._profile.heapProfilerModel();if(!t)return null;const i=await this._profile.getLocation(e);if(!i)return null;const s=t.runtimeModel().debuggerModel().createRawLocationByScriptId(String(i.scriptId),i.lineNumber,i.columnNumber);if(!s)return null;const r=s.script(),o=r&&r.sourceURL;return o&&this._linkifier?this._linkifier.linkifyRawLocation(s,o):null}async _populate(){const e=await this._profile._loadPromise;if(this._retrieveStatistics(e),this._dataGrid&&this._dataGrid.setDataSource(e,0),this._profile.profileType().id===Hi.TypeId&&this._profile.fromFile()){const t=await e.getSamples();if(t){console.assert(Boolean(t.timestamps.length));const e=new Ct;e.sizes=t.sizes,e.ids=t.lastAssignedIds,e.timestamps=t.timestamps,e.max=t.sizes,e.totalTime=Math.max(t.timestamps[t.timestamps.length-1]||0,1e4),this._trackingOverviewGrid&&this._trackingOverviewGrid.setSamples(e)}}const t=this._profiles().indexOf(this._profile);this._baseSelect.setSelectedIndex(Math.max(0,t-1)),this._trackingOverviewGrid&&this._trackingOverviewGrid.updateGrid()}async _retrieveStatistics(e){const t=await e.getStatistics(),i=[{value:t.code,color:"#f77",title:Pi(bi.code)},{value:t.strings,color:"#5e5",title:Pi(bi.strings)},{value:t.jsArrays,color:"#7af",title:Pi(bi.jsArrays)},{value:t.native,color:"#fc5",title:Pi(bi.typedArrays)},{value:t.system,color:"#98f",title:Pi(bi.systemObjects)}];return this._statisticsView.setTotalAndRecords(t.total,i),t}_onIdsRangeChanged(e){const i=e.data.minId,s=e.data.maxId;this._selectedSizeText.setText(Pi(bi.selectedSizeS,{PH1:t.bytesToString(e.data.size)})),this._constructorsDataGrid.snapshot&&this._constructorsDataGrid.setSelectionRange(i,s)}async toolbarItems(){const e=[this._perspectiveSelect,this._classNameFilter];return this._profile.profileType()!==Vi.trackingHeapSnapshotProfileType&&e.push(this._baseSelect,this._filterSelect),e.push(this._selectedSizeText),e}willHide(){this._currentSearchResultIndex=-1,this._popoverHelper.hidePopover()}supportsCaseSensitiveSearch(){return!0}supportsRegexSearch(){return!1}searchCanceled(){this._currentSearchResultIndex=-1,this._searchResults=[]}_selectRevealedNode(e){e&&e.select()}performSearch(e,t,i){const s=new le.SearchConfig(e.query.trim(),e.caseSensitive,e.isRegex,t,i||!1);this._searchThrottler.schedule(this._performSearch.bind(this,s))}async _performSearch(e){if(this.searchCanceled(),!this._currentPerspective.supportsSearch())return;this.currentQuery=e;const t=e.query.trim();if(!t)return;if("@"===t.charAt(0)){const e=parseInt(t.substring(1),10);if(isNaN(e))return;if(!this._dataGrid)return;const i=await this._dataGrid.revealObjectByHeapSnapshotId(String(e));return void this._selectRevealedNode(i)}if(!this._profile._snapshotProxy||!this._dataGrid)return;const i=this._dataGrid.nodeFilter();this._searchResults=i?await this._profile._snapshotProxy.search(this.currentQuery,i):[],this._searchableView.updateSearchMatchesCount(this._searchResults.length),this._searchResults.length&&(this._currentSearchResultIndex=e.jumpBackward?this._searchResults.length-1:0),await this._jumpToSearchResult(this._currentSearchResultIndex)}jumpToNextSearchResult(){this._searchResults.length&&(this._currentSearchResultIndex=(this._currentSearchResultIndex+1)%this._searchResults.length,this._searchThrottler.schedule(this._jumpToSearchResult.bind(this,this._currentSearchResultIndex)))}jumpToPreviousSearchResult(){this._searchResults.length&&(this._currentSearchResultIndex=(this._currentSearchResultIndex+this._searchResults.length-1)%this._searchResults.length,this._searchThrottler.schedule(this._jumpToSearchResult.bind(this,this._currentSearchResultIndex)))}async _jumpToSearchResult(e){if(this._searchableView.updateCurrentMatchIndex(e),-1===e)return;if(!this._dataGrid)return;const t=await this._dataGrid.revealObjectByHeapSnapshotId(String(this._searchResults[e]));this._selectRevealedNode(t)}refreshVisibleData(){if(!this._dataGrid)return;let e=this._dataGrid.rootNode().children[0];for(;e;)e.refresh(),e=e.traverseNextNode(!1,null,!0)}_changeBase(){if(this._baseProfile===this._profiles()[this._baseSelect.selectedIndex()])return;this._baseProfile=this._profiles()[this._baseSelect.selectedIndex()];const e=this._dataGrid;e.snapshot&&this._baseProfile._loadPromise.then(e.setBaseDataSource.bind(e)),this.currentQuery&&this._searchResults&&this.performSearch(this.currentQuery,!1)}_changeFilter(){const e=this._filterSelect.selectedIndex()-1;this._dataGrid&&(this._dataGrid.filterSelectIndexChanged(this._profiles(),e),this.currentQuery&&this._searchResults&&this.performSearch(this.currentQuery,!1))}_profiles(){return this._profile.profileType().getProfiles()}_selectionChanged(e){const t=e.data;this._setSelectedNodeForDetailsView(t),this._inspectedObjectChanged(e)}_onSelectAllocationNode(e){const t=e.data;this._constructorsDataGrid.setAllocationNodeId(t.allocationNodeId()),this._setSelectedNodeForDetailsView(null)}_inspectedObjectChanged(e){const t=e.data,i=this._profile.heapProfilerModel();i&&t instanceof At&&i.addInspectedHeapObject(String(t.snapshotNodeId))}_setSelectedNodeForDetailsView(e){const t=e&&e.retainersDataSource();t?(this._retainmentDataGrid.setDataSource(t.snapshot,t.snapshotNodeIndex),this._allocationStackView&&this._allocationStackView.setAllocatedObject(t.snapshot,t.snapshotNodeIndex)):(this._allocationStackView&&this._allocationStackView.clear(),this._retainmentDataGrid.reset())}async _changePerspectiveAndWait(e){const t=this._perspectives.findIndex((t=>t.title()===e));if(-1===t||this._currentPerspectiveIndex===t)return;const i=this._perspectives[t].masterGrid(this);if(!i)return;const s=i.once(si.ContentShown),r=this._perspectiveSelect.options().find((e=>e.value===String(t)));return this._perspectiveSelect.select(r),this._changePerspective(t),s}async _updateDataSourceAndView(){const e=this._dataGrid;if(!e||e.snapshot)return;const t=await this._profile._loadPromise;if(this._dataGrid!==e)return;if(e.snapshot!==t&&e.setDataSource(t,0),e!==this._diffDataGrid)return;this._baseProfile||(this._baseProfile=this._profiles()[this._baseSelect.selectedIndex()]);const i=await this._baseProfile._loadPromise;this._diffDataGrid.baseSnapshot!==i&&this._diffDataGrid.setBaseDataSource(i)}_onSelectedPerspectiveChanged(e){this._changePerspective(Number(e.target.selectedOptions[0].value))}_changePerspective(e){if(e===this._currentPerspectiveIndex)return;this._currentPerspectiveIndex=e,this._currentPerspective.deactivate(this);const t=this._perspectives[e];this._currentPerspective=t,this._dataGrid=t.masterGrid(this),t.activate(this),this.refreshVisibleData(),this._dataGrid&&this._dataGrid.updateWidths(),this._updateDataSourceAndView(),this.currentQuery&&this._searchResults&&this.performSearch(this.currentQuery,!1)}async selectLiveObject(e,t){if(await this._changePerspectiveAndWait(e),!this._dataGrid)return;const i=await this._dataGrid.revealObjectByHeapSnapshotId(t);i?i.select():O.Console.instance().error("Cannot find corresponding heap snapshot node")}_getPopoverRequest(e){const t=l.enclosingNodeOrSelfWithNodeName(e.target,"span"),i=l.enclosingNodeOrSelfWithNodeName(e.target,"row");if(!i)return null;if(!this._dataGrid)return null;const s=this._dataGrid.dataGridNodeFromNode(i)||this._containmentDataGrid.dataGridNodeFromNode(i)||this._constructorsDataGrid.dataGridNodeFromNode(i)||this._diffDataGrid.dataGridNodeFromNode(i)||this._allocationDataGrid&&this._allocationDataGrid.dataGridNodeFromNode(i)||this._retainmentDataGrid.dataGridNodeFromNode(i),r=this._profile.heapProfilerModel();if(!s||!t||!r)return null;let o;return{box:t.boxInWindow(),show:async e=>{if(!r)return!1;const t=await s.queryObjectContent(r,"popover");return!!t&&(o=await de.ObjectPopoverHelper.buildObjectPopover(t,e),!!o||(r.runtimeModel().releaseObjectGroup("popover"),!1))},hide:()=>{r.runtimeModel().releaseObjectGroup("popover"),o&&o.dispose()}}}_updatePerspectiveOptions(){const e=this._profiles().length>1;this._perspectiveSelect.removeOptions(),this._perspectives.forEach(((t,i)=>{(e||t!==this._comparisonPerspective)&&this._perspectiveSelect.createOption(t.title(),String(i))}))}_updateBaseOptions(){const e=this._profiles(),t=this._baseSelect.selectedIndex();this._baseSelect.removeOptions();for(const t of e)this._baseSelect.createOption(t.title);t>-1&&this._baseSelect.setSelectedIndex(t)}_updateFilterOptions(){const e=this._profiles(),t=this._filterSelect.selectedIndex();this._filterSelect.removeOptions(),this._filterSelect.createOption(Pi(bi.allObjects));for(let t=0;t<e.length;++t){let i;i=t?Pi(bi.objectsAllocatedBetweenSAndS,{PH1:e[t-1].title,PH2:e[t].title}):Pi(bi.objectsAllocatedBeforeS,{PH1:e[t].title}),this._filterSelect.createOption(i)}t>-1&&this._filterSelect.setSelectedIndex(t)}_updateControls(){this._updatePerspectiveOptions(),this._updateBaseOptions(),this._updateFilterOptions()}_onReceiveSnapshot(e){this._updateControls();e.data.addEventListener(Ne.ProfileTitleChanged,this._updateControls,this)}_onProfileHeaderRemoved(e){const t=e.data;t.removeEventListener(Ne.ProfileTitleChanged,this._updateControls,this),this._profile===t?(this.detach(),this._profile.profileType().removeEventListener(Li.SnapshotReceived,this._onReceiveSnapshot,this),this._profile.profileType().removeEventListener(De.RemoveProfileHeader,this._onProfileHeaderRemoved,this),this.dispose()):this._updateControls()}dispose(){this._linkifier.dispose(),this._popoverHelper.dispose(),this._allocationStackView&&(this._allocationStackView.clear(),this._allocationDataGrid&&this._allocationDataGrid.dispose()),this._onStopTracking(),this._trackingOverviewGrid&&this._trackingOverviewGrid.removeEventListener(wt,this._onIdsRangeChanged.bind(this))}}class Ei{constructor(e){this._title=e}activate(e){}deactivate(e){e._baseSelect.setVisible(!1),e._filterSelect.setVisible(!1),e._classNameFilter.setVisible(!1),e._trackingOverviewGrid&&e._trackingOverviewGrid.detach(),e._allocationWidget&&e._allocationWidget.detach(),e._statisticsView&&e._statisticsView.detach(),e._splitWidget.detach(),e._splitWidget.detachChildWidgets()}masterGrid(e){return null}title(){return this._title}supportsSearch(){return!1}}class Ii extends Ei{constructor(){super(Pi(bi.summary))}activate(e){e._splitWidget.setMainWidget(e._constructorsWidget),e._splitWidget.setSidebarWidget(e._objectDetailsView),e._splitWidget.show(e._searchableView.element),e._filterSelect.setVisible(!0),e._classNameFilter.setVisible(!0),e._trackingOverviewGrid&&(e._trackingOverviewGrid.show(e._searchableView.element,e._splitWidget.element),e._trackingOverviewGrid.update(),e._trackingOverviewGrid.updateGrid())}masterGrid(e){return e._constructorsDataGrid}supportsSearch(){return!0}}class Ni extends Ei{constructor(){super(Pi(bi.comparison))}activate(e){e._splitWidget.setMainWidget(e._diffWidget),e._splitWidget.setSidebarWidget(e._objectDetailsView),e._splitWidget.show(e._searchableView.element),e._baseSelect.setVisible(!0),e._classNameFilter.setVisible(!0)}masterGrid(e){return e._diffDataGrid}supportsSearch(){return!0}}class Ri extends Ei{constructor(){super(Pi(bi.containment))}activate(e){e._splitWidget.setMainWidget(e._containmentWidget),e._splitWidget.setSidebarWidget(e._objectDetailsView),e._splitWidget.show(e._searchableView.element)}masterGrid(e){return e._containmentDataGrid}}class Di extends Ei{constructor(){super(Pi(bi.allocation)),this._allocationSplitWidget=new T.SplitWidget(!1,!0,"heapSnapshotAllocationSplitViewState",200,200),this._allocationSplitWidget.setSidebarWidget(new c.VBox)}activate(e){e._allocationWidget&&this._allocationSplitWidget.setMainWidget(e._allocationWidget),e._splitWidget.setMainWidget(e._constructorsWidget),e._splitWidget.setSidebarWidget(e._objectDetailsView);const t=new c.VBox,i=document.createElement("div");i.classList.add("heap-snapshot-view-resizer");if(i.createChild("div","title").createChild("span").textContent=Pi(bi.liveObjects),this._allocationSplitWidget.hideDefaultResizer(),this._allocationSplitWidget.installResizer(i),t.element.appendChild(i),e._splitWidget.show(t.element),this._allocationSplitWidget.setSidebarWidget(t),this._allocationSplitWidget.show(e._searchableView.element),e._constructorsDataGrid.clear(),e._allocationDataGrid){const t=e._allocationDataGrid.selectedNode;t&&e._constructorsDataGrid.setAllocationNodeId(t.allocationNodeId())}}deactivate(e){this._allocationSplitWidget.detach(),super.deactivate(e)}masterGrid(e){return e._allocationDataGrid}}class Fi extends Ei{constructor(){super(Pi(bi.statistics))}activate(e){e._statisticsView.show(e._searchableView.element)}masterGrid(e){return null}}class Li extends Re{constructor(e,t){super(e||Li.TypeId,t||Pi(bi.heapSnapshot)),$.TargetManager.instance().observeModels(Z.HeapProfilerModel,this),$.TargetManager.instance().addModelListener(Z.HeapProfilerModel,Z.Events.ResetProfiles,this._resetProfiles,this),$.TargetManager.instance().addModelListener(Z.HeapProfilerModel,Z.Events.AddHeapSnapshotChunk,this._addHeapSnapshotChunk,this),$.TargetManager.instance().addModelListener(Z.HeapProfilerModel,Z.Events.ReportHeapSnapshotProgress,this._reportHeapSnapshotProgress,this),this._treatGlobalObjectsAsRoots=L.Settings.instance().createSetting("treatGlobalObjectsAsRoots",!0),this._customContent=null}modelAdded(e){e.enable()}modelRemoved(e){}getProfiles(){return super.getProfiles()}fileExtension(){return".heapsnapshot"}get buttonTooltip(){return Pi(bi.takeHeapSnapshot)}isInstantProfile(){return!0}buttonClicked(){return this._takeHeapSnapshot(),V.actionTaken(G.Action.ProfilesHeapProfileTaken),!1}get treeItemTitle(){return Pi(bi.heapSnapshots)}get description(){return Pi(bi.heapSnapshotProfilesShowMemory)}customContent(){const e=E.createSettingCheckbox(Pi(bi.treatGlobalObjectsAsRoots),this._treatGlobalObjectsAsRoots,!0);this._customContent=e;return ae.experiments.isEnabled("showOptionToNotTreatGlobalObjectsAsRoots")?e:null}setCustomContentEnabled(e){this._customContent&&(this._customContent.checkboxElement.disabled=!e)}createProfileLoadedFromFile(e){return new ki(null,this,e)}async _takeHeapSnapshot(){if(this.profileBeingRecorded())return;const e=S.Context.instance().flavor(Z.HeapProfilerModel);if(!e)return;let t=new ki(e,this);this.setProfileBeingRecorded(t),this.addProfile(t),t.updateStatus(Pi(bi.snapshotting)),await e.takeHeapSnapshot(!0,this._treatGlobalObjectsAsRoots.get()),t=this.profileBeingRecorded(),t.title=Pi(bi.snapshotD,{PH1:t.uid}),t._finishLoad(),this.setProfileBeingRecorded(null),this.dispatchEventToListeners(De.ProfileComplete,t)}_addHeapSnapshotChunk(e){const t=this.profileBeingRecorded();if(!t)return;const i=e.data;t.transferChunk(i)}_reportHeapSnapshotProgress(e){const t=this.profileBeingRecorded();if(!t)return;const i=e.data;t.updateStatus(Pi(bi.percentagePlaceholder,{PH1:(i.done/i.total*100).toFixed(0)}),!0),i.finished&&t._prepareToLoad()}_resetProfiles(e){const t=e.data;for(const e of this.getProfiles())e.heapProfilerModel()===t&&this.removeProfile(e)}_snapshotReceived(e){this.profileBeingRecorded()===e&&this.setProfileBeingRecorded(null),this.dispatchEventToListeners(Li.SnapshotReceived,e)}}Li.TypeId="HEAP",Li.SnapshotReceived="SnapshotReceived";class Hi extends Li{constructor(){super(Hi.TypeId,Pi(bi.allocationInstrumentationOn)),this._recordAllocationStacksSetting=L.Settings.instance().createSetting("recordAllocationStacks",!1),this._customContent=null,this._recording=!1}modelAdded(e){super.modelAdded(e),e.addEventListener(Z.Events.HeapStatsUpdate,this._heapStatsUpdate,this),e.addEventListener(Z.Events.LastSeenObjectId,this._lastSeenObjectId,this)}modelRemoved(e){super.modelRemoved(e),e.removeEventListener(Z.Events.HeapStatsUpdate,this._heapStatsUpdate,this),e.removeEventListener(Z.Events.LastSeenObjectId,this._lastSeenObjectId,this)}_heapStatsUpdate(e){if(!this._profileSamples)return;const t=e.data;let i;for(let e=0;e<t.length;e+=3){i=t[e];const s=t[e+2];this._profileSamples.sizes[i]=s,this._profileSamples.max[i]||(this._profileSamples.max[i]=s)}}_lastSeenObjectId(e){const t=this._profileSamples;if(!t)return;const i=e.data,s=Math.max(t.ids.length,t.max.length-1);t.ids[s]=i.lastSeenObjectId,t.max[s]||(t.max[s]=0,t.sizes[s]=0),t.timestamps[s]=i.timestamp,t.totalTime<i.timestamp-t.timestamps[0]&&(t.totalTime*=2),this.dispatchEventToListeners(Hi.HeapStatsUpdate,this._profileSamples);const r=this.profileBeingRecorded();r&&r.updateStatus(null,!0)}hasTemporaryView(){return!0}get buttonTooltip(){return this._recording?Pi(bi.stopRecordingHeapProfile):Pi(bi.startRecordingHeapProfile)}isInstantProfile(){return!1}buttonClicked(){return this._toggleRecording()}_startRecordingProfile(){if(this.profileBeingRecorded())return;const e=this._addNewProfile();e&&e.startTrackingHeapObjects(this._recordAllocationStacksSetting.get())}customContent(){const e=E.createSettingCheckbox(Pi(bi.recordAllocationStacksExtra),this._recordAllocationStacksSetting,!0);return this._customContent=e,e}setCustomContentEnabled(e){this._customContent&&(this._customContent.checkboxElement.disabled=!e)}_addNewProfile(){const e=S.Context.instance().flavor(Z.HeapProfilerModel);return e?(this.setProfileBeingRecorded(new ki(e,this,void 0)),this._profileSamples=new Ct,this.profileBeingRecorded()._profileSamples=this._profileSamples,this._recording=!0,this.addProfile(this.profileBeingRecorded()),this.profileBeingRecorded().updateStatus(Pi(bi.recording)),this.dispatchEventToListeners(Hi.TrackingStarted),e):null}async _stopRecordingProfile(){let e=this.profileBeingRecorded();e.updateStatus(Pi(bi.snapshotting));const t=e.heapProfilerModel().stopTrackingHeapObjects(!0);this._recording=!1,this.dispatchEventToListeners(Hi.TrackingStopped),await t,e=this.profileBeingRecorded(),e&&(e._finishLoad(),this._profileSamples=null,this.setProfileBeingRecorded(null),this.dispatchEventToListeners(De.ProfileComplete,e))}_toggleRecording(){return this._recording?this._stopRecordingProfile():this._startRecordingProfile(),this._recording}fileExtension(){return".heaptimeline"}get treeItemTitle(){return Pi(bi.allocationTimelines)}get description(){return Pi(bi.AllocationTimelinesShow)}_resetProfiles(e){const t=this._recording;this.setProfileBeingRecorded(null),super._resetProfiles(e),this._profileSamples=null,t&&this._addNewProfile()}profileBeingRecordedRemoved(){this._stopRecordingProfile(),this._profileSamples=null}}Hi.TypeId="HEAP-RECORD",Hi.HeapStatsUpdate="HeapStatsUpdate",Hi.TrackingStarted="TrackingStarted",Hi.TrackingStopped="TrackingStopped";class ki extends Ee{constructor(e,t,i){super(t,i||Pi(bi.snapshotD,{PH1:t.nextProfileUid()})),this._heapProfilerModel=e,this.maxJSObjectId=-1,this._workerProxy=null,this._receiver=null,this._snapshotProxy=null,this._loadPromise=new Promise((e=>{this._fulfillLoad=e})),this._totalNumberOfChunks=0,this._bufferedWriter=null,this._onTempFileReady=null}heapProfilerModel(){return this._heapProfilerModel}async getLocation(e){return this._snapshotProxy?this._snapshotProxy.getLocation(e):null}createSidebarTreeElement(e){return new Be(e,this,"heap-snapshot-sidebar-tree-item")}createView(e){return new xi(e,this)}_prepareToLoad(){console.assert(!this._receiver,"Already loading"),this._setupWorker(),this.updateStatus(Pi(bi.loading),!0)}_finishLoad(){!this._wasDisposed&&this._receiver&&this._receiver.close(),this._bufferedWriter&&this._didWriteToTempFile(this._bufferedWriter)}_didWriteToTempFile(e){this._wasDisposed?e&&e.remove():(this.tempFile=e,e||(this._failedToCreateTempFile=!0),this._onTempFileReady&&(this._onTempFileReady(),this._onTempFileReady=null))}_setupWorker(){console.assert(!this._workerProxy,"HeapSnapshotWorkerProxy already exists"),this._workerProxy=new mi(this._handleWorkerEvent.bind(this)),this._workerProxy.addEventListener(mi.Events.Wait,(e=>{this.updateStatus(null,e.data)}),this),this._receiver=this._workerProxy.createLoader(this.uid,this._snapshotReceived.bind(this))}_handleWorkerEvent(e,t){if(le.HeapSnapshotProgressEvent.BrokenSnapshot===e){const e=t;return void O.Console.instance().error(e)}if(le.HeapSnapshotProgressEvent.Update!==e)return;const i=t,s=a.deserializeUIString(i);this.updateStatus(yi(s.messageParts,s.values))}dispose(){this._workerProxy&&this._workerProxy.dispose(),this.removeTempFile(),this._wasDisposed=!0}_didCompleteSnapshotTransfer(){this._snapshotProxy&&this.updateStatus(t.bytesToString(this._snapshotProxy.totalSize),!1)}transferChunk(e){this._bufferedWriter||(this._bufferedWriter=new ne.TempFile),this._bufferedWriter.write([e]),++this._totalNumberOfChunks,this._receiver&&this._receiver.write(e)}_snapshotReceived(e){this._wasDisposed||(this._receiver=null,this._snapshotProxy=e,this.maxJSObjectId=e.maxJSObjectId(),this._didCompleteSnapshotTransfer(),this._workerProxy&&this._workerProxy.startCheckingForLongRunningCalls(),this.notifySnapshotReceived())}notifySnapshotReceived(){this._snapshotProxy&&this._fulfillLoad(this._snapshotProxy),this.profileType()._snapshotReceived(this),this.canSaveToFile()&&this.dispatchEventToListeners(Ne.ProfileReceived)}canSaveToFile(){return!this.fromFile()&&Boolean(this._snapshotProxy)}saveToFile(){const e=new oe.FileOutputStream;this._fileName=this._fileName||"Heap-"+i.toISO8601Compact(new Date)+this.profileType().fileExtension();const t=async i=>{if(i){if(this._failedToCreateTempFile)return O.Console.instance().error("Failed to open temp file with heap snapshot"),void e.close();if(this.tempFile){const t=await this.tempFile.copyToOutputStream(e,this._onChunkTransferred.bind(this));return t&&O.Console.instance().error("Failed to read heap snapshot from temp file: "+t.message),void this._didCompleteSnapshotTransfer()}this._onTempFileReady=()=>{t(i)},this._updateSaveProgress(0,1)}};e.open(this._fileName).then(t.bind(this))}_onChunkTransferred(e){this._updateSaveProgress(e.loadedSize(),e.fileSize())}_updateSaveProgress(e,t){const i=(100*(t&&e/t)).toFixed(0);this.updateStatus(Pi(bi.savingD,{PH1:i}))}async loadFromFile(e){this.updateStatus(Pi(bi.loading),!0),this._setupWorker();const t=new oe.ChunkedFileReader(e,1e7),i=await t.read(this._receiver);if(!i){const e=t.error();e&&this.updateStatus(e.message)}return i?null:t.error()}}class Mi extends c.VBox{constructor(){super(),this.element.classList.add("heap-snapshot-statistics-view"),this._pieChart=new J.PieChart,this.setTotalAndRecords(0,[]),this._pieChart.classList.add("heap-snapshot-stats-pie-chart"),this.element.appendChild(this._pieChart)}static _valueFormatter(e){return Pi(bi.sKb,{PH1:Number.withThousandsSeparator(Math.round(e/1e3))})}setTotalAndRecords(e,t){this._pieChart.data={chartName:Pi(bi.heapMemoryUsage),size:150,formatter:Mi._valueFormatter,showLegend:!0,total:e,slices:t}}}class Oi extends c.Widget{constructor(e){super(),this._heapProfilerModel=e,this._linkifier=new q.Linkifier,this._frameElements=[]}_onContextMenu(e,t){const i=new m.ContextMenu(t);i.containsTarget(e)||i.appendApplicableItems(e),i.show(),t.consume(!0)}_onStackViewKeydown(e){const t=e.target;if(!t)return;if("Enter"===e.key){const i=zi.get(t);if(!i)return;const s=q.Linkifier.linkInfo(i);if(!s)return;return void(q.Linkifier.invokeFirstAction(s)&&e.consume(!0))}let i;const s=e;if("ArrowUp"===s.key)i=!1;else{if("ArrowDown"!==s.key)return;i=!0}const r=this._frameElements.indexOf(t);if(-1===r)return;const o=i?r+1:r-1;if(o<0||o>=this._frameElements.length)return;const n=this._frameElements[o];n.tabIndex=0,t.tabIndex=-1,n.focus(),e.consume(!0)}async setAllocatedObject(e,t){this.clear();const i=await e.allocationStack(t);if(!i){const e=this.element.createChild("div","no-heap-allocation-stack");return void l.createTextChild(e,Pi(bi.stackWasNotRecordedForThisObject))}const s=this.element.createChild("div","heap-allocation-stack");s.addEventListener("keydown",this._onStackViewKeydown.bind(this),!1);for(const e of i){const t=s.createChild("div","stack-frame");this._frameElements.push(t),t.tabIndex=-1;if(t.createChild("div").textContent=l.beautifyFunctionName(e.functionName),!e.scriptId)continue;const i=this._heapProfilerModel?this._heapProfilerModel.target():null,r={columnNumber:e.column-1},o=this._linkifier.linkifyScriptLocation(i,String(e.scriptId),e.scriptName,e.line-1,r);t.appendChild(o),zi.set(t,o),t.addEventListener("contextmenu",this._onContextMenu.bind(this,o))}this._frameElements[0].tabIndex=0}clear(){this.element.removeChildren(),this._frameElements=[],this._linkifier.reset()}}const zi=new WeakMap;var Bi=Object.freeze({__proto__:null,UIStrings:bi,HeapSnapshotView:xi,Perspective:Ei,SummaryPerspective:Ii,ComparisonPerspective:Ni,ContainmentPerspective:Ri,AllocationPerspective:Di,StatisticsPerspective:Fi,HeapSnapshotProfileType:Li,TrackingHeapSnapshotProfileType:Hi,HeapProfileHeader:ki,HeapSnapshotStatisticsView:Mi,HeapAllocationStackView:Oi});class ji{constructor(){this.cpuProfileType=new it,this.heapSnapshotProfileType=new Li,this.samplingHeapProfileType=new Ft,this.trackingHeapSnapshotProfileType=new Hi}}const Vi=new ji;var Gi=Object.freeze({__proto__:null,ProfileTypeRegistry:ji,instance:Vi});const Ai={clearAllProfiles:"Clear all profiles",cantLoadFileSupportedFile:"Can’t load file. Supported file extensions: '{PH1}.'",cantLoadProfileWhileAnother:"Can’t load profile while another profile is being recorded.",profileLoadingFailedS:"Profile loading failed: {PH1}.",load:"Load…",runD:"Run {PH1}",profiles:"Profiles"},Wi=a.registerUIStrings("profiler/ProfilesPanel.js",Ai),Ui=a.getLocalizedString.bind(void 0,Wi);class Ji extends I.PanelWithSidebar{constructor(e,t,i){super(e),this._profileTypes=t,this.registerRequiredCSS("profiler/heapProfiler.css",{enableLegacyPatching:!0}),this.registerRequiredCSS("profiler/profilesPanel.css",{enableLegacyPatching:!0}),this.registerRequiredCSS("object_ui/objectValue.css",{enableLegacyPatching:!0});const s=new c.VBox;this.splitWidget().setMainWidget(s),this.profilesItemTreeElement=new Ki(this),this._sidebarTree=new p.TreeOutlineInShadow,this._sidebarTree.registerRequiredCSS("profiler/profilesSidebarTree.css",{enableLegacyPatching:!0}),this._sidebarTree.element.classList.add("profiles-sidebar-tree-box"),this.panelSidebarElement().appendChild(this._sidebarTree.element),this._sidebarTree.appendChild(this.profilesItemTreeElement),this._sidebarTree.element.addEventListener("keydown",this._onKeyDown.bind(this),!1),this.profileViews=document.createElement("div"),this.profileViews.id="profile-views",this.profileViews.classList.add("vbox"),s.element.appendChild(this.profileViews),this._toolbarElement=document.createElement("div"),this._toolbarElement.classList.add("profiles-toolbar"),s.element.insertBefore(this._toolbarElement,s.element.firstChild),this.panelSidebarElement().classList.add("profiles-tree-sidebar");const r=document.createElement("div");r.classList.add("profiles-toolbar"),this.panelSidebarElement().insertBefore(r,this.panelSidebarElement().firstChild);const o=new v.Toolbar("",r);this._toggleRecordAction=N.ActionRegistry.instance().action(i),this._toggleRecordButton=v.Toolbar.createActionButton(this._toggleRecordAction),o.appendToolbarItem(this._toggleRecordButton),this.clearResultsButton=new v.ToolbarButton(Ui(Ai.clearAllProfiles),"largeicon-clear"),this.clearResultsButton.addEventListener(v.ToolbarButton.Events.Click,this._reset,this),o.appendToolbarItem(this.clearResultsButton),o.appendSeparator(),o.appendToolbarItem(v.Toolbar.createActionButtonForId("components.collect-garbage")),this._profileViewToolbar=new v.Toolbar("",this._toolbarElement),this._profileGroups={},this._launcherView=new ft(this),this._launcherView.addEventListener(gt.ProfileTypeSelected,this._onProfileTypeSelected,this),this.visibleView,this._profileToView=[],this._typeIdToSidebarSection={};const n=this._profileTypes;for(let e=0;e<n.length;e++)this._registerProfileType(n[e]);this._launcherView.restoreSelectedProfileType(),this.profilesItemTreeElement.select(),this._showLauncherView(),this._fileSelectorElement,this._createFileSelectorElement(),this.element.addEventListener("contextmenu",this._handleContextMenuEvent.bind(this),!1),$.TargetManager.instance().addEventListener($.Events.SuspendStateChanged,this._onSuspendStateChanged,this),S.Context.instance().addFlavorChangeListener(Q.CPUProfilerModel,this._updateProfileTypeSpecificUI,this),S.Context.instance().addFlavorChangeListener(Z.HeapProfilerModel,this._updateProfileTypeSpecificUI,this)}_onKeyDown(e){const t=e;let i=!1;"ArrowDown"!==t.key||t.altKey?"ArrowUp"!==t.key||t.altKey||(i=this._sidebarTree.selectPrevious()):i=this._sidebarTree.selectNext(),i&&t.consume(!0)}searchableView(){const e=this.visibleView;return e&&e.searchableView?e.searchableView():null}_createFileSelectorElement(){this._fileSelectorElement&&this.element.removeChild(this._fileSelectorElement),this._fileSelectorElement=l.createFileSelectorElement(this._loadFromFile.bind(this)),ze(this._fileSelectorElement),this.element.appendChild(this._fileSelectorElement)}_findProfileTypeByExtension(e){return this._profileTypes.find((t=>Boolean(t.fileExtension())&&e.endsWith(t.fileExtension()||"")))||null}async _loadFromFile(e){this._createFileSelectorElement();const t=this._findProfileTypeByExtension(e.name);if(!t){const e=new Set(this._profileTypes.map((e=>e.fileExtension())).filter((e=>e)));return void O.Console.instance().error(Ui(Ai.cantLoadFileSupportedFile,{PH1:Array.from(e).join("', '")}))}if(Boolean(t.profileBeingRecorded()))return void O.Console.instance().error(Ui(Ai.cantLoadProfileWhileAnother));const i=await t.loadFromFile(e);i&&"message"in i&&l.MessageDialog.show(Ui(Ai.profileLoadingFailedS,{PH1:i.message}))}toggleRecord(){if(!this._toggleRecordAction.enabled())return!0;const e=this.element.ownerDocument.deepActiveElement(),t=this._selectedProfileType;if(!t)return!0;const i=t.buttonClicked();return this._updateToggleRecordAction(i),i?(this._launcherView.profileStarted(),t.hasTemporaryView()&&this.showProfile(t.profileBeingRecorded())):this._launcherView.profileFinished(),e&&e.focus(),!0}_onSuspendStateChanged(){this._updateToggleRecordAction(this._toggleRecordAction.toggled())}_updateToggleRecordAction(e){const t=Boolean(S.Context.instance().flavor(Q.CPUProfilerModel)||S.Context.instance().flavor(Z.HeapProfilerModel)),i=e||!$.TargetManager.instance().allTargetsSuspended()&&t;this._toggleRecordAction.setEnabled(i),this._toggleRecordAction.setToggled(e),i?this._toggleRecordButton.setTitle(this._selectedProfileType?this._selectedProfileType.buttonTooltip:""):this._toggleRecordButton.setTitle(l.anotherProfilerActiveLabel()),this._selectedProfileType&&this._launcherView.updateProfileType(this._selectedProfileType,i)}_profileBeingRecordedRemoved(){this._updateToggleRecordAction(!1),this._launcherView.profileFinished()}_onProfileTypeSelected(e){this._selectedProfileType=e.data,this._updateProfileTypeSpecificUI()}_updateProfileTypeSpecificUI(){this._updateToggleRecordAction(this._toggleRecordAction.toggled())}_reset(){this._profileTypes.forEach((e=>e.reset())),delete this.visibleView,this._profileGroups={},this._updateToggleRecordAction(!1),this._launcherView.profileFinished(),this._sidebarTree.element.classList.remove("some-expandable"),this._launcherView.detach(),this.profileViews.removeChildren(),this._profileViewToolbar.removeToolbarItems(),this.clearResultsButton.element.classList.remove("hidden"),this.profilesItemTreeElement.select(),this._showLauncherView()}_showLauncherView(){this.closeVisibleView(),this._profileViewToolbar.removeToolbarItems(),this._launcherView.show(this.profileViews),this.visibleView=this._launcherView,this._toolbarElement.classList.add("hidden")}_registerProfileType(e){this._launcherView.addProfileType(e);const t=new qi(this,e);this._typeIdToSidebarSection[e.id]=t,this._sidebarTree.appendChild(t),t.childrenListElement.addEventListener("contextmenu",this._handleContextMenuEvent.bind(this),!1),e.addEventListener(De.ViewUpdated,this._updateProfileTypeSpecificUI,this),e.addEventListener(De.AddProfileHeader,(function(e){this._addProfileHeader(e.data)}),this),e.addEventListener(De.RemoveProfileHeader,(function(e){this._removeProfileHeader(e.data)}),this),e.addEventListener(De.ProfileComplete,(function(e){this.showProfile(e.data)}),this);const i=e.getProfiles();for(let e=0;e<i.length;e++)this._addProfileHeader(i[e])}_handleContextMenuEvent(e){const t=new m.ContextMenu(e);this.panelSidebarElement().isSelfOrAncestor(e.target)&&t.defaultSection().appendItem(Ui(Ai.load),this._fileSelectorElement.click.bind(this._fileSelectorElement)),t.show()}showLoadFromFileDialog(){this._fileSelectorElement.click()}_addProfileHeader(e){const t=e.profileType().id;this._typeIdToSidebarSection[t].addProfileHeader(e),this.visibleView&&this.visibleView!==this._launcherView||this.showProfile(e)}_removeProfileHeader(e){e.profileType().profileBeingRecorded()===e&&this._profileBeingRecordedRemoved();const t=this._indexOfViewForProfile(e);-1!==t&&this._profileToView.splice(t,1);const i=e.profileType().id;this._typeIdToSidebarSection[i].removeProfileHeader(e)&&(this.profilesItemTreeElement.select(),this._showLauncherView())}showProfile(e){if(!e||e.profileType().profileBeingRecorded()===e&&!e.profileType().hasTemporaryView())return null;const t=this.viewForProfile(e);if(t===this.visibleView)return t;this.closeVisibleView(),t.show(this.profileViews),this._toolbarElement.classList.remove("hidden"),this.visibleView=t;const i=this._typeIdToSidebarSection[e.profileType().id].sidebarElementForProfile(e);return i&&i.revealAndSelect(),this._profileViewToolbar.removeToolbarItems(),t.toolbarItems().then((e=>{e.map((e=>this._profileViewToolbar.appendToolbarItem(e)))})),t}showObject(e,t){}async linkifyObject(e){return null}viewForProfile(e){const t=this._indexOfViewForProfile(e);if(-1!==t)return this._profileToView[t].view;const i=e.createView(this);return i.element.classList.add("profile-view"),this._profileToView.push({profile:e,view:i}),i}_indexOfViewForProfile(e){return this._profileToView.findIndex((t=>t.profile===e))}closeVisibleView(){this.visibleView&&this.visibleView.detach(),delete this.visibleView}focus(){this._sidebarTree.focus()}}class qi extends p.TreeElement{constructor(e,t){super(t.treeItemTitle,!0),this.selectable=!1,this._dataDisplayDelegate=e,this._profileTreeElements=[],this._profileGroups={},this.expand(),this.hidden=!0,this.setCollapsible(!1)}addProfileHeader(e){this.hidden=!1;const t=e.profileType();let i=this;const s=e.createSidebarTreeElement(this._dataDisplayDelegate);if(this._profileTreeElements.push(s),!e.fromFile()&&t.profileBeingRecorded()!==e){const t=e.title;let r=this._profileGroups[t];r||(r=new $i,this._profileGroups[t]=r),r.profileSidebarTreeElements.push(s);const o=r.profileSidebarTreeElements.length;if(2===o){r.sidebarTreeElement=new Qi(this._dataDisplayDelegate,e.title);const t=r.profileSidebarTreeElements[0],i=this.children().indexOf(t);this.insertChild(r.sidebarTreeElement,i);const s=t.selected;this.removeChild(t),r.sidebarTreeElement.appendChild(t),s&&t.revealAndSelect(),t.setSmall(!0),t.setMainTitle(Ui(Ai.runD,{PH1:1})),this.treeOutline&&this.treeOutline.element.classList.add("some-expandable")}o>=2&&(i=r.sidebarTreeElement,s.setSmall(!0),s.setMainTitle(Ui(Ai.runD,{PH1:o})))}i&&i.appendChild(s)}removeProfileHeader(e){const t=this._sidebarElementIndex(e);if(-1===t)return!1;const i=this._profileTreeElements[t];this._profileTreeElements.splice(t,1);let s=this;const r=this._profileGroups[e.title];if(r){const t=r.profileSidebarTreeElements;if(t.splice(t.indexOf(i),1),1===t.length){const i=s.children().indexOf(r.sidebarTreeElement);r.sidebarTreeElement&&r.sidebarTreeElement.removeChild(t[0]),this.insertChild(t[0],i),t[0].setSmall(!1),t[0].setMainTitle(e.title),r.sidebarTreeElement&&this.removeChild(r.sidebarTreeElement)}0!==t.length&&(s=r.sidebarTreeElement)}return s&&s.removeChild(i),i.dispose(),!this.childCount()&&(this.hidden=!0,!0)}sidebarElementForProfile(e){const t=this._sidebarElementIndex(e);return-1===t?null:this._profileTreeElements[t]}_sidebarElementIndex(e){const t=this._profileTreeElements;for(let i=0;i<t.length;i++)if(t[i].profile===e)return i;return-1}onattach(){this.listItemElement.classList.add("profiles-tree-section")}}class $i{constructor(){this.profileSidebarTreeElements=[],this.sidebarTreeElement=null}}class Qi extends p.TreeElement{constructor(e,t){super("",!0),this.selectable=!1,this._dataDisplayDelegate=e,this._profileTitle=t,this.expand(),this.toggleOnClick=!0}onselect(){const e=this.childCount()>0;if(e){const e=this.lastChild();e instanceof Be&&this._dataDisplayDelegate.showProfile(e.profile)}return e}onattach(){this.listItemElement.classList.add("profile-group-sidebar-tree-item"),this.listItemElement.createChild("div","icon"),this.listItemElement.createChild("div","titles no-subtitle").createChild("span","title-container").createChild("span","title").textContent=this._profileTitle}}class Ki extends p.TreeElement{constructor(e){super("",!1),this.selectable=!0,this._panel=e}onselect(){return this._panel._showLauncherView(),!0}onattach(){this.listItemElement.classList.add("profile-launcher-view-tree-item"),this.listItemElement.createChild("div","icon"),this.listItemElement.createChild("div","titles no-subtitle").createChild("span","title-container").createChild("span","title").textContent=Ui(Ai.profiles)}}let Xi;class Yi extends Ji{constructor(){super("js_profiler",[Vi.cpuProfileType],"profiler.js-toggle-recording")}static instance(e={forceNew:null}){const{forceNew:t}=e;return Xi&&!t||(Xi=new Yi),Xi}wasShown(){S.Context.instance().setFlavor(Yi,this)}willHide(){S.Context.instance().setFlavor(Yi,null)}handleAction(e,t){const i=S.Context.instance().flavor(Yi);if(!(i instanceof Yi))throw new Error("non-null JSProfilerPanel expected!");return i.toggleRecord(),!0}}var Zi=Object.freeze({__proto__:null,UIStrings:Ai,ProfilesPanel:Ji,ProfileTypeSidebarSection:qi,ProfileGroup:$i,ProfileGroupSidebarTreeElement:Qi,ProfilesSidebarTreeElement:Ki,JSProfilerPanel:Yi});const es={revealInSummaryView:"Reveal in Summary view"},ts=a.registerUIStrings("profiler/HeapProfilerPanel.js",es),is=a.getLocalizedString.bind(void 0,ts);let ss;class rs extends Ji{constructor(){const e=Vi;super("heap_profiler",[e.heapSnapshotProfileType,e.trackingHeapSnapshotProfileType,e.samplingHeapProfileType],"profiler.heap-toggle-recording")}static instance(){return ss||(ss=new rs),ss}appendApplicableItems(e,t,i){if(!(i instanceof ie.RemoteObject))return;if(!this.isShowing())return;const s=i;if(!s.objectId)return;const r=s.objectId;if(!Vi.heapSnapshotProfileType.getProfiles().length)return;const o=s.runtimeModel().heapProfilerModel();o&&t.revealSection().appendItem(is(es.revealInSummaryView),function(e){o.snapshotObjectIdForObjectId(r).then((t=>{this.isShowing()&&t&&this.showObject(t,e)}))}.bind(this,"Summary"))}handleAction(e,t){const i=S.Context.instance().flavor(rs);return console.assert(Boolean(i)&&i instanceof rs),i&&i.toggleRecord(),!0}wasShown(){S.Context.instance().setFlavor(rs,this),V.panelLoaded("heap_profiler","DevTools.Launch.HeapProfiler")}willHide(){S.Context.instance().setFlavor(rs,null)}showObject(e,t){const i=Vi.heapSnapshotProfileType.getProfiles();for(let s=0;s<i.length;s++){const r=i[s];if(r.maxJSObjectId>=parseInt(e,10)){this.showProfile(r);this.viewForProfile(r).selectLiveObject(t,e);break}}}}var os=Object.freeze({__proto__:null,UIStrings:es,HeapProfilerPanel:rs});const ns={jsHeap:"JS Heap",allocatedJsHeapSizeCurrentlyIn:"Allocated JS heap size currently in use",vms:"VMs",numberOfVmsSharingTheSameScript:"Number of VMs sharing the same script source",scriptUrl:"Script URL",urlOfTheScriptSource:"URL of the script source",heapProfile:"Heap Profile",anonymousScriptS:"(Anonymous Script {PH1})",kb:"kB"},as=a.registerUIStrings("profiler/LiveHeapProfileView.js",ns),ls=a.getLocalizedString.bind(void 0,as);let ds,hs;class cs extends c.VBox{constructor(){super(!0),this._gridNodeByUrl=new Map,this.registerRequiredCSS("profiler/liveHeapProfile.css",{enableLegacyPatching:!0}),this._setting=L.Settings.instance().moduleSetting("memoryLiveHeapProfile");const e=new v.Toolbar("live-heap-profile-toolbar",this.contentElement);this._toggleRecordAction=N.ActionRegistry.instance().action("live-heap-profile.toggle-recording"),this._toggleRecordButton=v.Toolbar.createActionButton(this._toggleRecordAction),this._toggleRecordButton.setToggled(this._setting.get()),e.appendToolbarItem(this._toggleRecordButton);const t=$.TargetManager.instance().mainTarget();if(t&&t.model(se.ResourceTreeModel)){const t=N.ActionRegistry.instance().action("live-heap-profile.start-with-reload");this._startWithReloadButton=v.Toolbar.createActionButton(t),e.appendToolbarItem(this._startWithReloadButton)}this._dataGrid=this._createDataGrid(),this._dataGrid.asWidget().show(this.contentElement),this._currentPollId=0}static instance(){return ds||(ds=new cs),ds}_createDataGrid(){const e={id:"",title:k.LocalizedEmptyString,width:void 0,fixedWidth:!0,sortable:!0,align:r.Align.Right,sort:r.Order.Descending,titleDOMFragment:void 0,editable:void 0,nonSelectable:void 0,longText:void 0,disclosure:void 0,weight:void 0,allowInSortByEvenWhenHidden:void 0,dataType:void 0,defaultWeight:void 0},t=[{...e,id:"size",title:ls(ns.jsHeap),width:"72px",fixedWidth:!0,sortable:!0,align:r.Align.Right,sort:r.Order.Descending,tooltip:ls(ns.allocatedJsHeapSizeCurrentlyIn)},{...e,id:"isolates",title:ls(ns.vms),width:"40px",fixedWidth:!0,align:r.Align.Right,tooltip:ls(ns.numberOfVmsSharingTheSameScript)},{...e,id:"url",title:ls(ns.scriptUrl),fixedWidth:!1,sortable:!0,tooltip:ls(ns.urlOfTheScriptSource)}],i=new n.SortableDataGrid({displayName:ls(ns.heapProfile),columns:t,editCallback:void 0,deleteCallback:void 0,refreshCallback:void 0});i.setResizeMethod(r.ResizeMethod.Last),i.element.classList.add("flex-auto"),i.element.addEventListener("keydown",this._onKeyDown.bind(this),!1),i.addEventListener(r.Events.OpenedNode,this._revealSourceForSelectedNode,this),i.addEventListener(r.Events.SortingChanged,this._sortingChanged,this);for(const e of t){const t=i.headerTableHeader(e.id);t&&t.setAttribute("title",e.tooltip)}return i}wasShown(){this._poll(),this._setting.addChangeListener(this._settingChanged,this)}willHide(){++this._currentPollId,this._setting.removeChangeListener(this._settingChanged,this)}_settingChanged(e){this._toggleRecordButton.setToggled(e.data)}async _poll(){const e=this._currentPollId;do{const t=Array.from(X.IsolateManager.instance().isolates()),i=await Promise.all(t.map((e=>{const t=e.heapProfilerModel();return t?t.getSamplingProfile():null})));if(this._currentPollId!==e)return;this._update(t,i),await new Promise((e=>setTimeout(e,3e3)))}while(this._currentPollId===e)}_update(e,t){const i=new Map;t.forEach(((t,i)=>{t&&o(e[i],"",t.head)}));const s=this._dataGrid.rootNode(),r=new Set;for(const e of i){const t=e[0],i=e[1].size,o=e[1].isolates.size;if(!t){console.info(`Node with empty URL: ${i} bytes`);continue}let n=this._gridNodeByUrl.get(t);n?n.updateNode(i,o):(n=new ps(t,i,o),this._gridNodeByUrl.set(t,n),s.appendChild(n)),r.add(n)}for(const e of s.children.slice()){r.has(e)||e.remove();const t=e;this._gridNodeByUrl.delete(t._url)}function o(e,t,s){const r=s.callFrame.url||t||function(e){const t=e.callFrame.functionName;return t.startsWith("(")&&"(root)"!==t?t:""}(s)||function(e){return Number(e.callFrame.scriptId)?ls(ns.anonymousScriptS,{PH1:e.callFrame.scriptId}):""}(s);if(s.children.forEach(o.bind(null,e,r)),!s.selfSize)return;let n=i.get(r);n||(n={size:0,isolates:new Set},i.set(r,n)),n.size+=s.selfSize,n.isolates.add(e)}this._sortingChanged()}_onKeyDown(e){"Enter"===e.key&&(e.consume(!0),this._revealSourceForSelectedNode())}_revealSourceForSelectedNode(){const e=this._dataGrid.selectedNode;if(!e||!e._url)return;const t=he.WorkspaceImpl.instance().uiSourceCodeForURL(e._url);t&&H.reveal(t)}_sortingChanged(){const e=this._dataGrid.sortColumnId();if(!e)return;const t="url"===e?function(e,t){return t._url.localeCompare(e._url)}:function(e,t){return t._size-e._size};this._dataGrid.sortNodes(t,this._dataGrid.isSortOrderAscending())}_toggleRecording(){!this._setting.get()?this._startRecording(!1):this._stopRecording()}_startRecording(e){if(this._setting.set(!0),!e)return;const t=$.TargetManager.instance().mainTarget();if(!t)return;const i=t.model(se.ResourceTreeModel);i&&i.reloadPage()}async _stopRecording(){this._setting.set(!1)}}class ps extends n.SortableDataGridNode{constructor(e,t,i){super(),this._url=e,this._size=t,this._isolateCount=i}updateNode(e,t){this._size===e&&this._isolateCount===t||(this._size=e,this._isolateCount=t,this.refresh())}createCell(e){const t=this.createTD(e);switch(e){case"url":t.textContent=this._url;break;case"size":t.textContent=Number.withThousandsSeparator(Math.round(this._size/1e3)),t.createChild("span","size-units").textContent=ls(ns.kb);break;case"isolates":t.textContent=""+this._isolateCount}return t}}class us{static instance(e={forceNew:null}){const{forceNew:t}=e;return hs&&!t||(hs=new us),hs}handleAction(e,t){return(async()=>{const e="live_heap_profile";await R.ViewManager.instance().showView(e);const i=R.ViewManager.instance().view(e);if(i){const e=await i.widget();this._innerHandleAction(e,t)}})(),!0}_innerHandleAction(e,t){switch(t){case"live-heap-profile.toggle-recording":e._toggleRecording();break;case"live-heap-profile.start-with-reload":e._startRecording(!0);break;default:console.assert(!1,"Unknown action: "+t)}}}var _s=Object.freeze({__proto__:null,UIStrings:ns,LiveHeapProfileView:cs,GridNode:ps,ActionDelegate:us});export{Se as BottomUpProfileDataGrid,xe as CPUProfileFlameChart,nt as CPUProfileView,we as ChildrenProvider,zt as HeapProfileView,os as HeapProfilerPanel,ci as HeapSnapshotDataGrids,Xt as HeapSnapshotGridNodes,wi as HeapSnapshotProxy,Bi as HeapSnapshotView,Tt as HeapTimelineOverview,pt as IsolateSelector,_s as LiveHeapProfileView,fe as ProfileDataGrid,Fe as ProfileHeader,vt as ProfileLauncherView,je as ProfileSidebarTreeElement,Gi as ProfileTypeRegistry,Xe as ProfileView,Zi as ProfilesPanel,Ae as TopDownProfileDataGrid};
@@ -0,0 +1 @@
1
+ import*as RootModule from'../root/root.js';RootModule.Runtime.cachedResources.set("profiler/heapProfiler.css","/*\n * Copyright (C) 2009 Google Inc. All rights reserved.\n * Copyright (C) 2010 Apple Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n.heap-snapshot-view {\n overflow: hidden;\n}\n\n.heap-snapshot-view .data-grid {\n border: none;\n flex: auto;\n}\n\n.heap-snapshot-view .data-grid tr:empty {\n height: 16px;\n visibility: hidden;\n}\n\n.heap-snapshot-view .data-grid span.percent-column {\n width: 35px !important;\n}\n\n.heap-snapshot-view .object-value-object,\n.object-value-node {\n display: inline;\n position: static;\n}\n\n.heap-snapshot-view .object-value-string {\n white-space: nowrap;\n}\n\n.heap-snapshot-view td.object-column .objects-count {\n margin-left: 10px;\n font-size: 11px;\n color: grey;\n}\n\n.heap-snapshot-view tr:not(.selected) .object-value-id {\n color: grey;\n}\n\n.profile-view .heap-tracking-overview {\n flex: 0 0 80px;\n height: 80px;\n}\n\n.heap-snapshot-view .retaining-paths-view {\n overflow: hidden;\n}\n\n.heap-snapshot-view .heap-snapshot-view-resizer {\n background-image: url(Images/toolbarResizerVertical.png);\n background-color: #eee;\n border-bottom: 1px solid rgb(179 179 179);\n background-repeat: no-repeat;\n background-position: right center, center;\n flex: 0 0 21px;\n}\n\n.heap-snapshot-view td.object-column > div > span {\n margin-right: 6px;\n}\n\n.heap-snapshot-view .heap-snapshot-view-resizer .title > span {\n display: inline-block;\n padding-top: 3px;\n vertical-align: middle;\n margin-left: 4px;\n margin-right: 8px;\n}\n\n.heap-snapshot-view .heap-snapshot-view-resizer * {\n pointer-events: none;\n}\n\n.heap-snapshot-view tr:not(.selected) td.object-column span.highlight {\n background-color: inherit;\n}\n\n.heap-snapshot-view td.object-column span.heap-object-source-link {\n float: right;\n}\n\n.heap-snapshot-view td.object-column span.heap-object-source-link:empty {\n animation: fadeInOut 2s infinite;\n}\n\n.heap-snapshot-view td.object-column span.heap-object-source-link:empty::before {\n content: \"\\b7\\b7\";\n font-weight: bold;\n}\n\n@keyframes fadeInOut {\n 0% {\n transform: rotate(0);\n }\n\n 50% {\n transform: rotate(0.5turn);\n }\n\n 100% {\n transform: rotate(1turn);\n }\n}\n\n.heap-snapshot-view tr:not(.selected) td.object-column span.heap-object-tag {\n color: #888;\n}\n\n.heap-snapshot-view td.object-column span.grayed {\n color: gray;\n}\n\n.cycled-ancessor-node {\n opacity: 60%;\n}\n\n#heap-recording-view .profile-view {\n top: 80px;\n}\n\n.heap-overview-container {\n overflow: hidden;\n position: absolute;\n top: 0;\n width: 100%;\n height: 80px;\n}\n\n#heap-recording-overview-grid .resources-dividers-label-bar {\n pointer-events: auto;\n}\n\n#heap-recording-overview-container {\n border-bottom: 1px solid rgb(0 0 0 / 30%);\n overflow: hidden;\n}\n\n.heap-recording-overview-canvas {\n position: absolute;\n top: 20px;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.heap-snapshot-statistics-view {\n overflow: auto;\n}\n\n.heap-snapshot-stats-pie-chart {\n margin: 12px 30px;\n flex-shrink: 0;\n}\n\n.heap-allocation-stack .stack-frame {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid rgb(240 240 240);\n padding: 2px;\n}\n\n.heap-allocation-stack .stack-frame:focus {\n background-color: var(--selection-bg-color);\n color: var(--selection-fg-color);\n}\n\n.heap-allocation-stack .stack-frame:focus:hover {\n background-color: var(--accent-color-hover);\n}\n\n.heap-allocation-stack .stack-frame:hover:not(:focus) {\n background-color: rgb(0 0 0 / 10%);\n}\n\n.heap-allocation-stack .stack-frame .devtools-link {\n color: rgb(33% 33% 33%);\n}\n\n.heap-allocation-stack .stack-frame:focus .devtools-link {\n color: var(--selection-fg-color);\n}\n\n.no-heap-allocation-stack {\n padding: 5px;\n}\n\n@media (forced-colors: active) {\n .cycled-ancessor-node {\n opacity: 100%;\n }\n\n .heap-snapshot-view td.object-column .objects-count,\n .heap-snapshot-view tr:not(.selected) td.object-column span.heap-object-tag,\n .heap-snapshot-view tr:not(.selected) .object-value-id {\n color: ButtonText;\n }\n}\n\n/*# sourceURL=profiler/heapProfiler.css */");RootModule.Runtime.cachedResources.set("profiler/liveHeapProfile.css","/*\n * Copyright 2019 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.data-grid {\n border: none;\n}\n\n.data-grid td .size-units {\n margin-left: 4px;\n font-size: 75%;\n}\n\n.data-grid tr:not(.selected) td .size-units {\n color: #999;\n}\n\n.toolbar {\n border-bottom: 1px solid #ccc;\n}\n\n/*# sourceURL=profiler/liveHeapProfile.css */");RootModule.Runtime.cachedResources.set("profiler/profileLauncherView.css","/*\n * Copyright 2018 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.profile-launcher-view {\n overflow: auto;\n}\n\n.profile-launcher-view-content {\n margin: 10px 16px;\n flex: auto 1 0;\n}\n\n.profile-launcher-view-content h1 {\n font-size: 15px;\n font-weight: normal;\n margin: 6px 0 10px 0;\n}\n\n.profile-launcher-view-content [is=dt-radio] {\n font-size: 13px;\n}\n\n.profile-launcher-view-content p {\n color: hsl(0deg 0% 45%);\n margin-top: 1px;\n margin-left: 22px;\n}\n\n.profile-launcher-view-content p [is=dt-checkbox] {\n display: flex;\n}\n\n.profile-launcher-view-content button.running {\n color: hsl(0deg 100% 58%);\n}\n\n.profile-launcher-view-content button.running:hover {\n color: hsl(0deg 100% 42%);\n}\n\n.profile-launcher-view-content button:not(:disabled):hover.running {\n color: HighlightText;\n}\n\nbody.inactive .profile-launcher-view-content button.running:not(.toolbar-item) {\n color: rgb(220 130 130);\n}\n\n.profile-launcher-view-content > div {\n flex: auto 0 0;\n}\n\n.profile-launcher-view-content > .profile-isolate-selector-block {\n flex: auto 1 0;\n}\n\n.profile-isolate-selector-block button {\n min-width: 110px;\n}\n\n.profile-launcher-target-list {\n margin-bottom: 6px;\n border: 1px solid #ddd;\n flex: 150px 1 0;\n}\n\n.profile-memory-usage-item {\n padding: 4px;\n line-height: 16px;\n border-left: 3px solid transparent;\n overflow-x: hidden;\n}\n\n.profile-isolate-selector-block > .profile-memory-usage-item {\n margin-left: 1px;\n margin-bottom: 4px;\n font-weight: bolder;\n}\n\n.profile-launcher-target-list .profile-memory-usage-item:hover:not(.selected) {\n background-color: var(--item-hover-color);\n}\n\n.profile-memory-usage-item.selected {\n background-color: var(--item-selection-inactive-bg-color);\n}\n\n.javascript-vm-instances-list:focus .profile-memory-usage-item.selected {\n border-color: var(--selection-bg-color);\n background-color: var(--item-selection-bg-color);\n}\n\n.profile-memory-usage-item > div {\n flex-shrink: 0;\n margin-right: 12px;\n}\n\n.profile-memory-usage-item-size {\n width: 60px;\n text-align: right;\n}\n\n.profile-memory-usage-item-trend {\n min-width: 5em;\n color: green;\n}\n\n.profile-memory-usage-item-trend.increasing {\n color: red;\n}\n\n.profile-launcher-buttons {\n flex-wrap: wrap;\n}\n\n.profile-launcher-buttons button {\n min-width: 120px;\n height: 28px;\n margin: 4px 16px 4px 0;\n}\n\n@media (forced-colors: active) {\n .profile-memory-usage-item {\n forced-color-adjust: none;\n border-left-color: transparent;\n }\n\n .profile-memory-usage-item-trend,\n .profile-memory-usage-item-trend.increasing,\n .profile-launcher-view-content button.running,\n body.inactive .profile-launcher-view-content button.running:not(.toolbar-item) {\n color: ButtonText;\n }\n\n .javascript-vm-instances-list .profile-memory-usage-item:hover:not(.selected) {\n background-color: Highlight;\n color: HighlightText;\n }\n\n .javascript-vm-instances-list .profile-memory-usage-item.selected .profile-memory-usage-item-trend,\n .javascript-vm-instances-list .profile-memory-usage-item.selected .profile-memory-usage-item-trend.increasing {\n color: ButtonFace;\n }\n\n .javascript-vm-instances-list .profile-memory-usage-item:hover:not(.selected) .profile-memory-usage-item-trend,\n .javascript-vm-instances-list .profile-memory-usage-item:hover:not(.selected) .profile-memory-usage-item-trend.increasing {\n background-color: Highlight;\n color: HighlightText;\n }\n\n .javascript-vm-instances-list .profile-memory-usage-item.selected {\n background-color: ButtonText;\n border-color: Highlight;\n color: ButtonFace;\n }\n\n .javascript-vm-instances-list:focus .profile-memory-usage-item.selected,\n .javascript-vm-instances-list:focus-visible .profile-memory-usage-item.selected {\n background-color: Highlight;\n border-color: ButtonText;\n color: HighlightText;\n }\n}\n\n/*# sourceURL=profiler/profileLauncherView.css */");RootModule.Runtime.cachedResources.set("profiler/profilesPanel.css","/*\n * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.\n * Copyright (C) 2009 Anthony Ricaud <rik@webkit.org>\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/* Profiler Style */\n\n#profile-views {\n flex: auto;\n position: relative;\n}\n\n.profile-view .data-grid table.data {\n background: var(--color-background);\n}\n\n.profile-view .data-grid tr:not(.selected) .highlight {\n background-color: rgb(255 230 179);\n}\n\n.profile-view .data-grid tr:hover td:not(.bottom-filler-td) {\n background-color: rgb(0 0 0 / 10%);\n}\n\n.profile-view .data-grid td.numeric-column {\n text-align: right;\n}\n\n.profile-view .data-grid div.profile-multiple-values {\n float: right;\n}\n\n.profile-view .data-grid span.percent-column {\n color: #999;\n width: 50px;\n display: inline-block;\n}\n\n.profile-view .data-grid tr.selected span {\n color: inherit;\n}\n\n.profiles-toolbar {\n background-color: var(--toolbar-bg-color);\n border-bottom: 1px solid #ccc;\n flex-shrink: 0;\n}\n\n.profiles-tree-sidebar {\n flex: auto;\n overflow: hidden;\n}\n\n.profiles-sidebar-tree-box {\n overflow-y: auto;\n}\n\n.profile-view {\n display: flex;\n overflow: hidden;\n}\n\n.profile-view .data-grid {\n border: none;\n flex: auto;\n}\n\n.profile-view .data-grid th.self-column,\n.profile-view .data-grid th.total-column {\n text-align: center;\n}\n\n.profile-node-file {\n float: right;\n color: gray;\n}\n\n.profile-warn-marker {\n vertical-align: -1px;\n margin-right: 2px;\n}\n\n.data-grid tr.selected .profile-node-file {\n color: rgb(33% 33% 33%);\n}\n\n.data-grid:focus tr.selected .profile-node-file {\n color: white;\n}\n\n.highlighted-row {\n animation: row_highlight 2s 0s;\n}\n\n@keyframes row_highlight {\n from { background-color: rgb(255 255 120 / 100%); }\n to { background-color: rgb(255 255 120 / 0%); }\n}\n\n.cpu-profile-flame-chart-overview-container {\n overflow: hidden;\n position: absolute;\n top: 0;\n width: 100%;\n height: 80px;\n}\n\n#cpu-profile-flame-chart-overview-container {\n border-bottom: 1px solid rgb(0 0 0 / 30%);\n overflow: hidden;\n}\n\n.cpu-profile-flame-chart-overview-canvas {\n position: absolute;\n top: 20px;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n#cpu-profile-flame-chart-overview-grid .resources-dividers-label-bar {\n pointer-events: auto;\n}\n\n.cpu-profile-flame-chart-overview-pane {\n flex: 0 0 80px !important;\n}\n\n.profile-text-view {\n padding: 10px;\n overflow: auto;\n margin: 0;\n user-select: text;\n cursor: text;\n}\n\n@media (forced-colors: active) {\n .profile-view .data-grid tr:hover td:not(.bottom-filler-td) {\n background: Highlight;\n }\n\n .profile-view .data-grid table.data {\n background: transparent;\n }\n}\n\n/*# sourceURL=profiler/profilesPanel.css */");RootModule.Runtime.cachedResources.set("profiler/profilesSidebarTree.css","/*\n * Copyright 2016 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n/* Tree outline overrides */\n\n:host {\n padding: 0;\n}\n\nol.tree-outline {\n overflow: auto;\n flex: auto;\n padding: 0;\n margin: 0;\n}\n\n.tree-outline li {\n height: 36px;\n padding-right: 5px;\n margin-top: 1px;\n line-height: 34px;\n border-top: 1px solid transparent;\n}\n\n.tree-outline li:not(.parent)::before {\n display: none;\n}\n\n:host-context(.some-expandable) .tree-outline li:not(.parent) {\n margin-left: 10px;\n}\n\n.tree-outline li.profiles-tree-section {\n height: 18px;\n padding: 0 10px;\n white-space: nowrap;\n margin-top: 1px;\n color: rgb(92 110 129);\n text-shadow: rgb(255 255 255 / 75%) 0 1px 0;\n line-height: 18px;\n}\n\n.tree-outline li.profiles-tree-section::before {\n display: none;\n}\n\n.tree-outline ol {\n overflow: hidden;\n}\n\n/* Generic items styling */\n\n.title-container > .save-link {\n text-decoration: underline;\n margin-left: auto;\n display: none;\n}\n\nli.selected .title-container > .save-link {\n display: block;\n cursor: pointer;\n}\n\nli .icon {\n width: 32px;\n height: 32px;\n margin-top: 1px;\n margin-right: 3px;\n flex: none;\n}\n\n.tree-outline > .icon {\n margin-left: 16px;\n}\n\nli.wait .spinner::before {\n margin: 4px;\n}\n\nli.wait.small .spinner::before {\n --dimension: 14px;\n --clip-size: 9px;\n --spinner-size: 2px;\n\n margin: 1px;\n}\n\nli.wait.selected .spinner::before {\n --spinner-color: white;\n}\n\n@keyframes spinner-animation {\n from { transform: rotate(0); }\n to { transform: rotate(360deg); }\n}\n\nli.small {\n height: 20px;\n}\n\nli .titles {\n display: flex;\n flex-direction: column;\n top: 5px;\n line-height: 12px;\n padding-bottom: 1px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n flex: auto;\n}\n\nli .titles > .title-container {\n display: flex;\n}\n\nli.small .titles {\n top: 2px;\n line-height: normal;\n}\n\nli:not(.small) .title::after {\n content: \"\\A\";\n white-space: pre;\n}\n\nli .subtitle {\n font-size: 80%;\n}\n\nli.small .subtitle {\n display: none;\n}\n\n/* Launcher */\n\n.profile-launcher-view-tree-item {\n margin-left: 0 !important;\n}\n\n.profile-launcher-view-tree-item > .icon {\n width: 8px !important;\n visibility: hidden;\n}\n\n/* Heap profiles and CPU profiles */\n\n.heap-snapshot-sidebar-tree-item .icon {\n content: url(Images/profileIcon.png);\n}\n\n.profile-sidebar-tree-item .icon {\n content: url(Images/profileIcon.png);\n}\n\n.profile-group-sidebar-tree-item .icon {\n content: url(Images/profileGroupIcon.png);\n}\n\nli.small .icon {\n width: 16px;\n height: 16px;\n}\n\nli.wait .icon {\n content: none;\n}\n\n.heap-snapshot-sidebar-tree-item.small .icon {\n content: url(Images/profileSmallIcon.png);\n}\n\n.profile-sidebar-tree-item.small .icon {\n content: url(Images/profileSmallIcon.png);\n}\n\n@media (forced-colors: active) {\n .tree-outline li,\n .tree-outline li.profiles-tree-section,\n .tree-outline li:hover .tree-element-title {\n forced-color-adjust: none;\n color: ButtonText;\n text-shadow: unset;\n }\n\n .tree-outline:not(.hide-selection-when-blurred) li.selected {\n color: HighlightText;\n }\n}\n\n/*# sourceURL=profiler/profilesSidebarTree.css */");
@@ -0,0 +1 @@
1
+ import{InspectorBackend as o,NodeURL as t}from"./protocol_client.js";self.ProtocolClient=self.ProtocolClient||{},ProtocolClient=ProtocolClient||{},ProtocolClient.DevToolsStubErrorCode=o.DevToolsStubErrorCode,ProtocolClient.SessionRouter=o.SessionRouter,ProtocolClient.InspectorBackend=o.InspectorBackend,ProtocolClient.InspectorBackend.ProtocolError=o.ProtocolError,ProtocolClient.Connection=o.Connection,ProtocolClient.inspectorBackend=o.inspectorBackend,ProtocolClient.test=o.test,ProtocolClient.TargetBase=o.TargetBase,ProtocolClient.NodeURL=t.NodeURL;