diff --git a/packages/debugger-frontend/BUILD_INFO b/packages/debugger-frontend/BUILD_INFO index d9f552896e3971..d454fef2ab8f96 100644 --- a/packages/debugger-frontend/BUILD_INFO +++ b/packages/debugger-frontend/BUILD_INFO @@ -1,5 +1,5 @@ -@generated SignedSource<<80b609f93e8535a704728e4ec9472a94>> -Git revision: 9ceb0ade8033ec165bbfbd41c08ac1fcd9f89a46 +@generated SignedSource<<320b0ebfb6eb4eeb9982e95d726f08be>> +Git revision: 622246a3aeff4b1b47e55153a7c89be37fd14e59 Built with --nohooks: false Is local checkout: false Remote URL: https://github.com/facebookexperimental/rn-chrome-devtools-frontend diff --git a/packages/debugger-frontend/dist/third-party/front_end/core/host/host.js b/packages/debugger-frontend/dist/third-party/front_end/core/host/host.js index 37f131c3a0ee97..673f790cb8e31c 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/core/host/host.js +++ b/packages/debugger-frontend/dist/third-party/front_end/core/host/host.js @@ -1 +1 @@ -import*as e from"../common/common.js";import*as o from"../i18n/i18n.js";import*as r from"../platform/platform.js";import*as t from"../root/root.js";var n;!function(e){e.AppendedToURL="appendedToURL",e.CanceledSaveURL="canceledSaveURL",e.ContextMenuCleared="contextMenuCleared",e.ContextMenuItemSelected="contextMenuItemSelected",e.DeviceCountUpdated="deviceCountUpdated",e.DevicesDiscoveryConfigChanged="devicesDiscoveryConfigChanged",e.DevicesPortForwardingStatusChanged="devicesPortForwardingStatusChanged",e.DevicesUpdated="devicesUpdated",e.DispatchMessage="dispatchMessage",e.DispatchMessageChunk="dispatchMessageChunk",e.EnterInspectElementMode="enterInspectElementMode",e.EyeDropperPickedColor="eyeDropperPickedColor",e.FileSystemsLoaded="fileSystemsLoaded",e.FileSystemRemoved="fileSystemRemoved",e.FileSystemAdded="fileSystemAdded",e.FileSystemFilesChangedAddedRemoved="FileSystemFilesChangedAddedRemoved",e.IndexingTotalWorkCalculated="indexingTotalWorkCalculated",e.IndexingWorked="indexingWorked",e.IndexingDone="indexingDone",e.KeyEventUnhandled="keyEventUnhandled",e.ReattachRootTarget="reattachMainTarget",e.ReloadInspectedPage="reloadInspectedPage",e.RevealSourceLine="revealSourceLine",e.SavedURL="savedURL",e.SearchCompleted="searchCompleted",e.SetInspectedTabId="setInspectedTabId",e.SetUseSoftMenu="setUseSoftMenu",e.ShowPanel="showPanel"}(n||(n={}));const i=[[n.AppendedToURL,"appendedToURL",["url"]],[n.CanceledSaveURL,"canceledSaveURL",["url"]],[n.ContextMenuCleared,"contextMenuCleared",[]],[n.ContextMenuItemSelected,"contextMenuItemSelected",["id"]],[n.DeviceCountUpdated,"deviceCountUpdated",["count"]],[n.DevicesDiscoveryConfigChanged,"devicesDiscoveryConfigChanged",["config"]],[n.DevicesPortForwardingStatusChanged,"devicesPortForwardingStatusChanged",["status"]],[n.DevicesUpdated,"devicesUpdated",["devices"]],[n.DispatchMessage,"dispatchMessage",["messageObject"]],[n.DispatchMessageChunk,"dispatchMessageChunk",["messageChunk","messageSize"]],[n.EnterInspectElementMode,"enterInspectElementMode",[]],[n.EyeDropperPickedColor,"eyeDropperPickedColor",["color"]],[n.FileSystemsLoaded,"fileSystemsLoaded",["fileSystems"]],[n.FileSystemRemoved,"fileSystemRemoved",["fileSystemPath"]],[n.FileSystemAdded,"fileSystemAdded",["errorMessage","fileSystem"]],[n.FileSystemFilesChangedAddedRemoved,"fileSystemFilesChangedAddedRemoved",["changed","added","removed"]],[n.IndexingTotalWorkCalculated,"indexingTotalWorkCalculated",["requestId","fileSystemPath","totalWork"]],[n.IndexingWorked,"indexingWorked",["requestId","fileSystemPath","worked"]],[n.IndexingDone,"indexingDone",["requestId","fileSystemPath"]],[n.KeyEventUnhandled,"keyEventUnhandled",["event"]],[n.ReattachRootTarget,"reattachMainTarget",[]],[n.ReloadInspectedPage,"reloadInspectedPage",["hard"]],[n.RevealSourceLine,"revealSourceLine",["url","lineNumber","columnNumber"]],[n.SavedURL,"savedURL",["url","fileSystemPath"]],[n.SearchCompleted,"searchCompleted",["requestId","fileSystemPath","files"]],[n.SetInspectedTabId,"setInspectedTabId",["tabId"]],[n.SetUseSoftMenu,"setUseSoftMenu",["useSoftMenu"]],[n.ShowPanel,"showPanel",["panelName"]]];var s;!function(e){e.ActionTaken="DevTools.ActionTaken",e.BreakpointWithConditionAdded="DevTools.BreakpointWithConditionAdded",e.BreakpointEditDialogRevealedFrom="DevTools.BreakpointEditDialogRevealedFrom",e.PanelClosed="DevTools.PanelClosed",e.PanelShown="DevTools.PanelShown",e.SidebarPaneShown="DevTools.SidebarPaneShown",e.KeyboardShortcutFired="DevTools.KeyboardShortcutFired",e.IssueCreated="DevTools.IssueCreated",e.IssuesPanelIssueExpanded="DevTools.IssuesPanelIssueExpanded",e.IssuesPanelOpenedFrom="DevTools.IssuesPanelOpenedFrom",e.IssuesPanelResourceOpened="DevTools.IssuesPanelResourceOpened",e.KeybindSetSettingChanged="DevTools.KeybindSetSettingChanged",e.ElementsSidebarTabShown="DevTools.Elements.SidebarTabShown",e.ExperimentEnabledAtLaunch="DevTools.ExperimentEnabledAtLaunch",e.ExperimentEnabled="DevTools.ExperimentEnabled",e.ExperimentDisabled="DevTools.ExperimentDisabled",e.DeveloperResourceLoaded="DevTools.DeveloperResourceLoaded",e.DeveloperResourceScheme="DevTools.DeveloperResourceScheme",e.LinearMemoryInspectorRevealedFrom="DevTools.LinearMemoryInspector.RevealedFrom",e.LinearMemoryInspectorTarget="DevTools.LinearMemoryInspector.Target",e.Language="DevTools.Language",e.SyncSetting="DevTools.SyncSetting",e.RecordingAssertion="DevTools.RecordingAssertion",e.RecordingCodeToggled="DevTools.RecordingCodeToggled",e.RecordingCopiedToClipboard="DevTools.RecordingCopiedToClipboard",e.RecordingEdited="DevTools.RecordingEdited",e.RecordingExported="DevTools.RecordingExported",e.RecordingReplayFinished="DevTools.RecordingReplayFinished",e.RecordingReplaySpeed="DevTools.RecordingReplaySpeed",e.RecordingReplayStarted="DevTools.RecordingReplayStarted",e.RecordingToggled="DevTools.RecordingToggled",e.SourcesSidebarTabShown="DevTools.Sources.SidebarTabShown",e.SourcesPanelFileDebugged="DevTools.SourcesPanelFileDebugged",e.SourcesPanelFileOpened="DevTools.SourcesPanelFileOpened",e.NetworkPanelResponsePreviewOpened="DevTools.NetworkPanelResponsePreviewOpened",e.StyleTextCopied="DevTools.StyleTextCopied",e.ManifestSectionSelected="DevTools.ManifestSectionSelected",e.CSSHintShown="DevTools.CSSHintShown",e.LighthouseModeRun="DevTools.LighthouseModeRun",e.ColorConvertedFrom="DevTools.ColorConvertedFrom",e.ColorPickerOpenedFrom="DevTools.ColorPickerOpenedFrom",e.CSSPropertyDocumentation="DevTools.CSSPropertyDocumentation",e.InlineScriptParsed="DevTools.InlineScriptParsed",e.VMInlineScriptTypeShown="DevTools.VMInlineScriptShown",e.BreakpointsRestoredFromStorageCount="DevTools.BreakpointsRestoredFromStorageCount",e.SwatchActivated="DevTools.SwatchActivated",e.BadgeActivated="DevTools.BadgeActivated"}(s||(s={}));var a=Object.freeze({__proto__:null,get Events(){return n},EventDescriptors:i,get EnumeratedHistogram(){return s}});const d={systemError:"System error",connectionError:"Connection error",certificateError:"Certificate error",httpError:"HTTP error",cacheError:"Cache error",signedExchangeError:"Signed Exchange error",ftpError:"FTP error",certificateManagerError:"Certificate manager error",dnsResolverError:"DNS resolver error",unknownError:"Unknown error",httpErrorStatusCodeSS:"HTTP error: status code {PH1}, {PH2}",invalidUrl:"Invalid URL",decodingDataUrlFailed:"Decoding Data URL failed"},l=o.i18n.registerUIStrings("core/host/ResourceLoader.ts",d),c=o.i18n.getLocalizedString.bind(void 0,l);let u=0;const m={},g=function(e,o){m[e].write(o)};let p=function(o,r,t,n){const i=new e.StringOutputStream.StringOutputStream;h(o,r,i,(function(e,o,r){t(e,o,i.data(),r)}),n)};function S(e,o,r){if(void 0===e||void 0===r)return null;if(0!==e){if(function(e){return e<=-300&&e>-400}(e))return c(d.httpErrorStatusCodeSS,{PH1:String(o),PH2:r});const t=function(e){return c(e>-100?d.systemError:e>-200?d.connectionError:e>-300?d.certificateError:e>-400?d.httpError:e>-500?d.cacheError:e>-600?d.signedExchangeError:e>-700?d.ftpError:e>-800?d.certificateManagerError:e>-900?d.dnsResolverError:d.unknownError)}(e);return`${t}: ${r}`}return null}const h=function(o,r,t,n,i){const s=function(e){return m[++u]=e,u}(t);if(new e.ParsedURL.ParsedURL(o).isDataURL())return void(e=>new Promise(((o,r)=>{const t=new XMLHttpRequest;t.withCredentials=!1,t.open("GET",e,!0),t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE){if(200!==t.status)return t.onreadystatechange=null,void r(new Error(String(t.status)));t.onreadystatechange=null,o(t.responseText)}},t.send(null)})))(o).then((function(e){g(s,e),l({statusCode:200})})).catch((function(e){l({statusCode:404,messageOverride:c(d.decodingDataUrlFailed)})}));if(!i&&function(e){try{const o=new URL(e);return"file:"===o.protocol&&""!==o.host}catch(e){return!1}}(o))return void(n&&n(!1,{},{statusCode:400,netError:-20,netErrorName:"net::BLOCKED_BY_CLIENT",message:"Loading from a remote file path is prohibited for security reasons."}));const a=[];if(r)for(const e in r)a.push(e+": "+r[e]);function l(e){if(n){const{success:o,description:r}=function(e){const{statusCode:o,netError:r,netErrorName:t,urlValid:n,messageOverride:i}=e;let s="";const a=o>=200&&o<300;if("string"==typeof i)s=i;else if(!a)if(void 0===r)s=c(!1===n?d.invalidUrl:d.unknownError);else{const e=S(r,o,t);e&&(s=e)}return console.assert(a===(0===s.length)),{success:a,description:{statusCode:o,netError:r,netErrorName:t,urlValid:n,message:s}}}(e);n(o,e.headers||{},r)}var o;m[o=s].close(),delete m[o]}f.loadNetworkResource(o,a.join("\r\n"),s,l)};var C=Object.freeze({__proto__:null,ResourceLoader:{},streamWrite:g,get load(){return p},setLoadForTest:function(e){p=e},netErrorToMessage:S,loadAsStream:h});const v={devtoolsS:"DevTools - {PH1}"},y=o.i18n.registerUIStrings("core/host/InspectorFrontendHost.ts",v),k=o.i18n.getLocalizedString.bind(void 0,y);class x{#e;events;#o=null;recordedCountHistograms=[];recordedEnumeratedHistograms=[];recordedPerformanceHistograms=[];constructor(){function e(e){!("mac"===this.platform()?e.metaKey:e.ctrlKey)||"+"!==e.key&&"-"!==e.key||e.stopPropagation()}this.#e=new Map,"undefined"!=typeof document&&document.addEventListener("keydown",(o=>{e.call(this,o)}),!0)}platform(){const e=navigator.userAgent;return e.includes("Windows NT")?"windows":e.includes("Mac OS X")?"mac":"linux"}loadCompleted(){}bringToFront(){}closeWindow(){}setIsDocked(e,o){window.setTimeout(o,0)}showSurvey(e,o){window.setTimeout((()=>o({surveyShown:!1})),0)}canShowSurvey(e,o){window.setTimeout((()=>o({canShowSurvey:!1})),0)}setInspectedPageBounds(e){}inspectElementCompleted(){}setInjectedScriptForOrigin(e,o){}inspectedURLChanged(e){document.title=k(v.devtoolsS,{PH1:e.replace(/^https?:\/\//,"")})}copyText(e){null!=e&&navigator.clipboard.writeText(e)}openInNewTab(e){window.open(e,"_blank")}showItemInFolder(o){e.Console.Console.instance().error("Show item in folder is not enabled in hosted mode. Please inspect using chrome://inspect")}save(e,o,r){let t=this.#e.get(e);t||(t=[],this.#e.set(e,t)),t.push(o),this.events.dispatchEventToListeners(n.SavedURL,{url:e,fileSystemPath:e})}append(e,o){const r=this.#e.get(e);r&&(r.push(o),this.events.dispatchEventToListeners(n.AppendedToURL,e))}close(e){const o=this.#e.get(e)||[];this.#e.delete(e);let t="";if(e)try{const o=r.StringUtilities.trimURL(e);t=r.StringUtilities.removeURLFragment(o)}catch(o){t=e}const n=document.createElement("a");n.download=t;const i=new Blob([o.join("")],{type:"text/plain"}),s=URL.createObjectURL(i);n.href=s,n.click(),URL.revokeObjectURL(s)}sendMessageToBackend(e){}recordCountHistogram(e,o,r,t,n){this.recordedCountHistograms.length>=100&&this.recordedCountHistograms.shift(),this.recordedCountHistograms.push({histogramName:e,sample:o,min:r,exclusiveMax:t,bucketSize:n})}recordEnumeratedHistogram(e,o,r){this.recordedEnumeratedHistograms.length>=100&&this.recordedEnumeratedHistograms.shift(),this.recordedEnumeratedHistograms.push({actionName:e,actionCode:o})}recordPerformanceHistogram(e,o){this.recordedPerformanceHistograms.length>=100&&this.recordedPerformanceHistograms.shift(),this.recordedPerformanceHistograms.push({histogramName:e,duration:o})}recordUserMetricsAction(e){}requestFileSystems(){this.events.dispatchEventToListeners(n.FileSystemsLoaded,[])}addFileSystem(e){window.webkitRequestFileSystem(window.TEMPORARY,1048576,(e=>{this.#o=e;const o={fileSystemName:"sandboxedRequestedFileSystem",fileSystemPath:"/overrides",rootURL:"filesystem:devtools://devtools/isolated/",type:"overrides"};this.events.dispatchEventToListeners(n.FileSystemAdded,{fileSystem:o})}))}removeFileSystem(e){const o=e=>{e.forEach((e=>{e.isDirectory?e.removeRecursively((()=>{})):e.isFile&&e.remove((()=>{}))}))};this.#o&&this.#o.root.createReader().readEntries(o),this.#o=null,this.events.dispatchEventToListeners(n.FileSystemRemoved,"/overrides")}isolatedFileSystem(e,o){return this.#o}loadNetworkResource(e,o,r,t){fetch(e).then((async e=>{const o=await e.arrayBuffer();let r=o;if(function(e){const o=new Uint8Array(e);return!(!o||o.length<3)&&31===o[0]&&139===o[1]&&8===o[2]}(o)){const e=new DecompressionStream("gzip"),t=e.writable.getWriter();t.write(o),t.close(),r=e.readable}return await new Response(r).text()})).then((function(e){g(r,e),t({statusCode:200,headers:void 0,messageOverride:void 0,netError:void 0,netErrorName:void 0,urlValid:void 0})})).catch((function(){t({statusCode:404,headers:void 0,messageOverride:void 0,netError:void 0,netErrorName:void 0,urlValid:void 0})}))}registerPreference(e,o){}getPreferences(e){const o={};for(const e in window.localStorage)o[e]=window.localStorage[e];e(o)}getPreference(e,o){o(window.localStorage[e])}setPreference(e,o){window.localStorage[e]=o}removePreference(e){delete window.localStorage[e]}clearPreferences(){window.localStorage.clear()}getSyncInformation(e){e({isSyncActive:!1,arePreferencesSynced:!1})}upgradeDraggedFileSystemPermissions(e){}indexPath(e,o,r){}stopIndexing(e){}searchInPath(e,o,r){}zoomFactor(){return 1}zoomIn(){}zoomOut(){}resetZoom(){}setWhitelistedShortcuts(e){}setEyeDropperActive(e){}showCertificateViewer(e){}reattach(e){e()}readyForTest(){}connectionReady(){}setOpenNewWindowForPopups(e){}setDevicesDiscoveryConfig(e){}setDevicesUpdatesEnabled(e){}performActionOnRemotePage(e,o){}openRemotePage(e,o){}openNodeFrontend(){}showContextMenuAtPoint(e,o,r,t){throw"Soft context menu should be used"}isHostedMode(){return!0}setAddExtensionCallback(e){}async initialTargetId(){return null}}let f=globalThis.InspectorFrontendHost;class I{constructor(){for(const e of i)this[e[1]]=this.dispatch.bind(this,e[0],e[2],e[3])}dispatch(e,o,r,...t){if(o.length<2){try{f.events.dispatchEventToListeners(e,t[0])}catch(e){console.error(e+" "+e.stack)}return}const n={};for(let e=0;e=2||f.recordEnumeratedHistogram(s.BreakpointWithConditionAdded,e,2)}breakpointEditDialogRevealedFrom(e){e>=7||f.recordEnumeratedHistogram(s.BreakpointEditDialogRevealedFrom,e,7)}panelShown(e){const o=D[e]||0;f.recordEnumeratedHistogram(s.PanelShown,o,D.MaxValue),f.recordUserMetricsAction("DevTools_PanelShown_"+e),this.#r=!0}panelClosed(e){const o=D[e]||0;f.recordEnumeratedHistogram(s.PanelClosed,o,D.MaxValue),this.#r=!0}elementsSidebarTabShown(e){const o=L[e]||0;f.recordEnumeratedHistogram(s.ElementsSidebarTabShown,o,L.MaxValue)}sourcesSidebarTabShown(e){const o=A[e]||0;f.recordEnumeratedHistogram(s.SourcesSidebarTabShown,o,A.MaxValue)}settingsPanelShown(e){this.panelShown("settings-"+e)}sourcesPanelFileDebugged(e){const o=e&&V[e]||V.Unknown;f.recordEnumeratedHistogram(s.SourcesPanelFileDebugged,o,V.MaxValue)}sourcesPanelFileOpened(e){const o=e&&V[e]||V.Unknown;f.recordEnumeratedHistogram(s.SourcesPanelFileOpened,o,V.MaxValue)}networkPanelResponsePreviewOpened(e){const o=e&&V[e]||V.Unknown;f.recordEnumeratedHistogram(s.NetworkPanelResponsePreviewOpened,o,V.MaxValue)}actionTaken(e){f.recordEnumeratedHistogram(s.ActionTaken,e,F.MaxValue)}panelLoaded(e,o){this.#t||e!==this.#n||(this.#t=!0,requestAnimationFrame((()=>{window.setTimeout((()=>{performance.mark(o),this.#r||f.recordPerformanceHistogram(o,performance.now())}),0)})))}setLaunchPanel(e){this.#n=e}keybindSetSettingChanged(e){const o=O[e]||0;f.recordEnumeratedHistogram(s.KeybindSetSettingChanged,o,O.MaxValue)}keyboardShortcutFired(e){const o=H[e]||H.OtherShortcut;f.recordEnumeratedHistogram(s.KeyboardShortcutFired,o,H.MaxValue)}issuesPanelOpenedFrom(e){f.recordEnumeratedHistogram(s.IssuesPanelOpenedFrom,e,N.MaxValue)}issuesPanelIssueExpanded(e){if(void 0===e)return;const o=_[e];void 0!==o&&f.recordEnumeratedHistogram(s.IssuesPanelIssueExpanded,o,_.MaxValue)}issuesPanelResourceOpened(e,o){const r=U[e+o];void 0!==r&&f.recordEnumeratedHistogram(s.IssuesPanelResourceOpened,r,U.MaxValue)}issueCreated(e){const o=B[e];void 0!==o&&f.recordEnumeratedHistogram(s.IssueCreated,o,B.MaxValue)}experimentEnabledAtLaunch(e){const o=W[e];void 0!==o&&f.recordEnumeratedHistogram(s.ExperimentEnabledAtLaunch,o,W.MaxValue)}experimentChanged(e,o){const r=W[e];if(void 0===r)return;const t=o?s.ExperimentEnabled:s.ExperimentDisabled;f.recordEnumeratedHistogram(t,r,W.MaxValue)}developerResourceLoaded(e){e>=j.MaxValue||f.recordEnumeratedHistogram(s.DeveloperResourceLoaded,e,j.MaxValue)}developerResourceScheme(e){e>=G.MaxValue||f.recordEnumeratedHistogram(s.DeveloperResourceScheme,e,G.MaxValue)}inlineScriptParsed(e){e>=2||f.recordEnumeratedHistogram(s.InlineScriptParsed,e,2)}vmInlineScriptContentShown(e){e>=2||f.recordEnumeratedHistogram(s.VMInlineScriptTypeShown,e,2)}linearMemoryInspectorRevealedFrom(e){e>=z.MaxValue||f.recordEnumeratedHistogram(s.LinearMemoryInspectorRevealedFrom,e,z.MaxValue)}linearMemoryInspectorTarget(e){e>=q.MaxValue||f.recordEnumeratedHistogram(s.LinearMemoryInspectorTarget,e,q.MaxValue)}language(e){const o=J[e];void 0!==o&&f.recordEnumeratedHistogram(s.Language,o,J.MaxValue)}syncSetting(e){f.getSyncInformation((o=>{let r=K.ChromeSyncDisabled;o.isSyncActive&&!o.arePreferencesSynced?r=K.ChromeSyncSettingsDisabled:o.isSyncActive&&o.arePreferencesSynced&&(r=e?K.DevToolsSyncSettingEnabled:K.DevToolsSyncSettingDisabled),f.recordEnumeratedHistogram(s.SyncSetting,r,K.MaxValue)}))}recordingAssertion(e){f.recordEnumeratedHistogram(s.RecordingAssertion,e,X.MaxValue)}recordingToggled(e){f.recordEnumeratedHistogram(s.RecordingToggled,e,Q.MaxValue)}recordingReplayFinished(e){f.recordEnumeratedHistogram(s.RecordingReplayFinished,e,Z.MaxValue)}recordingReplaySpeed(e){f.recordEnumeratedHistogram(s.RecordingReplaySpeed,e,$.MaxValue)}recordingReplayStarted(e){f.recordEnumeratedHistogram(s.RecordingReplayStarted,e,Y.MaxValue)}recordingEdited(e){f.recordEnumeratedHistogram(s.RecordingEdited,e,ee.MaxValue)}recordingExported(e){f.recordEnumeratedHistogram(s.RecordingExported,e,oe.MaxValue)}recordingCodeToggled(e){f.recordEnumeratedHistogram(s.RecordingCodeToggled,e,re.MaxValue)}recordingCopiedToClipboard(e){f.recordEnumeratedHistogram(s.RecordingCopiedToClipboard,e,te.MaxValue)}styleTextCopied(e){f.recordEnumeratedHistogram(s.StyleTextCopied,e,ie.MaxValue)}manifestSectionSelected(e){const o=se[e]||se.OtherSection;f.recordEnumeratedHistogram(s.ManifestSectionSelected,o,se.MaxValue)}cssHintShown(e){f.recordEnumeratedHistogram(s.CSSHintShown,e,ae.MaxValue)}lighthouseModeRun(e){f.recordEnumeratedHistogram(s.LighthouseModeRun,e,de.MaxValue)}colorConvertedFrom(e){f.recordEnumeratedHistogram(s.ColorConvertedFrom,e,2)}colorPickerOpenedFrom(e){f.recordEnumeratedHistogram(s.ColorPickerOpenedFrom,e,2)}cssPropertyDocumentation(e){f.recordEnumeratedHistogram(s.CSSPropertyDocumentation,e,3)}swatchActivated(e){f.recordEnumeratedHistogram(s.SwatchActivated,e,10)}badgeActivated(e){f.recordEnumeratedHistogram(s.BadgeActivated,e,9)}breakpointsRestoredFromStorage(e){const o=this.#i(e);f.recordEnumeratedHistogram(s.BreakpointsRestoredFromStorageCount,o,10)}#i(e){return e<100?0:e<300?1:e<1e3?2:e<3e3?3:e<1e4?4:e<3e4?5:e<1e5?6:e<3e5?7:e<1e6?8:9}workspacesPopulated(e){f.recordPerformanceHistogram("DevTools.Workspaces.PopulateWallClocktime",e)}workspacesNumberOfFiles(e,o){f.recordCountHistogram("DevTools.Workspaces.NumberOfFilesLoaded",e,0,1e5,100),f.recordCountHistogram("DevTools.Workspaces.NumberOfDirectoriesTraversed",o,0,1e4,100)}}!function(e){e[e.WindowDocked=1]="WindowDocked",e[e.WindowUndocked=2]="WindowUndocked",e[e.ScriptsBreakpointSet=3]="ScriptsBreakpointSet",e[e.TimelineStarted=4]="TimelineStarted",e[e.ProfilesCPUProfileTaken=5]="ProfilesCPUProfileTaken",e[e.ProfilesHeapProfileTaken=6]="ProfilesHeapProfileTaken",e[e.ConsoleEvaluated=8]="ConsoleEvaluated",e[e.FileSavedInWorkspace=9]="FileSavedInWorkspace",e[e.DeviceModeEnabled=10]="DeviceModeEnabled",e[e.AnimationsPlaybackRateChanged=11]="AnimationsPlaybackRateChanged",e[e.RevisionApplied=12]="RevisionApplied",e[e.FileSystemDirectoryContentReceived=13]="FileSystemDirectoryContentReceived",e[e.StyleRuleEdited=14]="StyleRuleEdited",e[e.CommandEvaluatedInConsolePanel=15]="CommandEvaluatedInConsolePanel",e[e.DOMPropertiesExpanded=16]="DOMPropertiesExpanded",e[e.ResizedViewInResponsiveMode=17]="ResizedViewInResponsiveMode",e[e.TimelinePageReloadStarted=18]="TimelinePageReloadStarted",e[e.ConnectToNodeJSFromFrontend=19]="ConnectToNodeJSFromFrontend",e[e.ConnectToNodeJSDirectly=20]="ConnectToNodeJSDirectly",e[e.CpuThrottlingEnabled=21]="CpuThrottlingEnabled",e[e.CpuProfileNodeFocused=22]="CpuProfileNodeFocused",e[e.CpuProfileNodeExcluded=23]="CpuProfileNodeExcluded",e[e.SelectFileFromFilePicker=24]="SelectFileFromFilePicker",e[e.SelectCommandFromCommandMenu=25]="SelectCommandFromCommandMenu",e[e.ChangeInspectedNodeInElementsPanel=26]="ChangeInspectedNodeInElementsPanel",e[e.StyleRuleCopied=27]="StyleRuleCopied",e[e.CoverageStarted=28]="CoverageStarted",e[e.LighthouseStarted=29]="LighthouseStarted",e[e.LighthouseFinished=30]="LighthouseFinished",e[e.ShowedThirdPartyBadges=31]="ShowedThirdPartyBadges",e[e.LighthouseViewTrace=32]="LighthouseViewTrace",e[e.FilmStripStartedRecording=33]="FilmStripStartedRecording",e[e.CoverageReportFiltered=34]="CoverageReportFiltered",e[e.CoverageStartedPerBlock=35]="CoverageStartedPerBlock",e[e["SettingsOpenedFromGear-deprecated"]=36]="SettingsOpenedFromGear-deprecated",e[e["SettingsOpenedFromMenu-deprecated"]=37]="SettingsOpenedFromMenu-deprecated",e[e["SettingsOpenedFromCommandMenu-deprecated"]=38]="SettingsOpenedFromCommandMenu-deprecated",e[e.TabMovedToDrawer=39]="TabMovedToDrawer",e[e.TabMovedToMainPanel=40]="TabMovedToMainPanel",e[e.CaptureCssOverviewClicked=41]="CaptureCssOverviewClicked",e[e.VirtualAuthenticatorEnvironmentEnabled=42]="VirtualAuthenticatorEnvironmentEnabled",e[e.SourceOrderViewActivated=43]="SourceOrderViewActivated",e[e.UserShortcutAdded=44]="UserShortcutAdded",e[e.ShortcutRemoved=45]="ShortcutRemoved",e[e.ShortcutModified=46]="ShortcutModified",e[e.CustomPropertyLinkClicked=47]="CustomPropertyLinkClicked",e[e.CustomPropertyEdited=48]="CustomPropertyEdited",e[e.ServiceWorkerNetworkRequestClicked=49]="ServiceWorkerNetworkRequestClicked",e[e.ServiceWorkerNetworkRequestClosedQuickly=50]="ServiceWorkerNetworkRequestClosedQuickly",e[e.NetworkPanelServiceWorkerRespondWith=51]="NetworkPanelServiceWorkerRespondWith",e[e.NetworkPanelCopyValue=52]="NetworkPanelCopyValue",e[e.ConsoleSidebarOpened=53]="ConsoleSidebarOpened",e[e.PerfPanelTraceImported=54]="PerfPanelTraceImported",e[e.PerfPanelTraceExported=55]="PerfPanelTraceExported",e[e.StackFrameRestarted=56]="StackFrameRestarted",e[e.CaptureTestProtocolClicked=57]="CaptureTestProtocolClicked",e[e.BreakpointRemovedFromRemoveButton=58]="BreakpointRemovedFromRemoveButton",e[e.BreakpointGroupExpandedStateChanged=59]="BreakpointGroupExpandedStateChanged",e[e.HeaderOverrideFileCreated=60]="HeaderOverrideFileCreated",e[e.HeaderOverrideEnableEditingClicked=61]="HeaderOverrideEnableEditingClicked",e[e.HeaderOverrideHeaderAdded=62]="HeaderOverrideHeaderAdded",e[e.HeaderOverrideHeaderEdited=63]="HeaderOverrideHeaderEdited",e[e.HeaderOverrideHeaderRemoved=64]="HeaderOverrideHeaderRemoved",e[e.HeaderOverrideHeadersFileEdited=65]="HeaderOverrideHeadersFileEdited",e[e.PersistenceNetworkOverridesEnabled=66]="PersistenceNetworkOverridesEnabled",e[e.PersistenceNetworkOverridesDisabled=67]="PersistenceNetworkOverridesDisabled",e[e.BreakpointRemovedFromContextMenu=68]="BreakpointRemovedFromContextMenu",e[e.BreakpointsInFileRemovedFromRemoveButton=69]="BreakpointsInFileRemovedFromRemoveButton",e[e.BreakpointsInFileRemovedFromContextMenu=70]="BreakpointsInFileRemovedFromContextMenu",e[e.BreakpointsInFileCheckboxToggled=71]="BreakpointsInFileCheckboxToggled",e[e.BreakpointsInFileEnabledDisabledFromContextMenu=72]="BreakpointsInFileEnabledDisabledFromContextMenu",e[e.BreakpointConditionEditedFromSidebar=73]="BreakpointConditionEditedFromSidebar",e[e.AddFileSystemToWorkspace=74]="AddFileSystemToWorkspace",e[e.RemoveFileSystemFromWorkspace=75]="RemoveFileSystemFromWorkspace",e[e.AddFileSystemForOverrides=76]="AddFileSystemForOverrides",e[e.RemoveFileSystemForOverrides=77]="RemoveFileSystemForOverrides",e[e.FileSystemSourceSelected=78]="FileSystemSourceSelected",e[e.OverridesSourceSelected=79]="OverridesSourceSelected",e[e.StyleSheetInitiatorLinkClicked=80]="StyleSheetInitiatorLinkClicked",e[e.MaxValue=81]="MaxValue"}(F||(F={})),function(e){e[e.elements=1]="elements",e[e.resources=2]="resources",e[e.network=3]="network",e[e.sources=4]="sources",e[e.timeline=5]="timeline",e[e.heap_profiler=6]="heap_profiler",e[e.console=8]="console",e[e.layers=9]="layers",e[e["console-view"]=10]="console-view",e[e.animations=11]="animations",e[e["network.config"]=12]="network.config",e[e.rendering=13]="rendering",e[e.sensors=14]="sensors",e[e["sources.search"]=15]="sources.search",e[e.security=16]="security",e[e.js_profiler=17]="js_profiler",e[e.lighthouse=18]="lighthouse",e[e.coverage=19]="coverage",e[e["protocol-monitor"]=20]="protocol-monitor",e[e["remote-devices"]=21]="remote-devices",e[e["web-audio"]=22]="web-audio",e[e["changes.changes"]=23]="changes.changes",e[e["performance.monitor"]=24]="performance.monitor",e[e["release-note"]=25]="release-note",e[e.live_heap_profile=26]="live_heap_profile",e[e["sources.quick"]=27]="sources.quick",e[e["network.blocked-urls"]=28]="network.blocked-urls",e[e["settings-preferences"]=29]="settings-preferences",e[e["settings-workspace"]=30]="settings-workspace",e[e["settings-experiments"]=31]="settings-experiments",e[e["settings-blackbox"]=32]="settings-blackbox",e[e["settings-devices"]=33]="settings-devices",e[e["settings-throttling-conditions"]=34]="settings-throttling-conditions",e[e["settings-emulation-locations"]=35]="settings-emulation-locations",e[e["settings-shortcuts"]=36]="settings-shortcuts",e[e["issues-pane"]=37]="issues-pane",e[e["settings-keybinds"]=38]="settings-keybinds",e[e.cssoverview=39]="cssoverview",e[e.chrome_recorder=40]="chrome_recorder",e[e.trust_tokens=41]="trust_tokens",e[e.reporting_api=42]="reporting_api",e[e.interest_groups=43]="interest_groups",e[e.back_forward_cache=44]="back_forward_cache",e[e.service_worker_cache=45]="service_worker_cache",e[e.background_service_backgroundFetch=46]="background_service_backgroundFetch",e[e.background_service_backgroundSync=47]="background_service_backgroundSync",e[e.background_service_pushMessaging=48]="background_service_pushMessaging",e[e.background_service_notifications=49]="background_service_notifications",e[e.background_service_paymentHandler=50]="background_service_paymentHandler",e[e.background_service_periodicBackgroundSync=51]="background_service_periodicBackgroundSync",e[e.service_workers=52]="service_workers",e[e.app_manifest=53]="app_manifest",e[e.storage=54]="storage",e[e.cookies=55]="cookies",e[e.frame_details=56]="frame_details",e[e.frame_resource=57]="frame_resource",e[e.frame_window=58]="frame_window",e[e.frame_worker=59]="frame_worker",e[e.dom_storage=60]="dom_storage",e[e.indexed_db=61]="indexed_db",e[e.web_sql=62]="web_sql",e[e.performance_insights=63]="performance_insights",e[e.preloading=64]="preloading",e[e.bounce_tracking_mitigations=65]="bounce_tracking_mitigations",e[e.MaxValue=66]="MaxValue"}(D||(D={})),function(e){e[e.OtherSidebarPane=0]="OtherSidebarPane",e[e.Styles=1]="Styles",e[e.Computed=2]="Computed",e[e["elements.layout"]=3]="elements.layout",e[e["elements.eventListeners"]=4]="elements.eventListeners",e[e["elements.domBreakpoints"]=5]="elements.domBreakpoints",e[e["elements.domProperties"]=6]="elements.domProperties",e[e["accessibility.view"]=7]="accessibility.view",e[e.MaxValue=8]="MaxValue"}(L||(L={})),function(e){e[e.OtherSidebarPane=0]="OtherSidebarPane",e[e["navigator-network"]=1]="navigator-network",e[e["navigator-files"]=2]="navigator-files",e[e["navigator-overrides"]=3]="navigator-overrides",e[e["navigator-contentScripts"]=4]="navigator-contentScripts",e[e["navigator-snippets"]=5]="navigator-snippets",e[e.MaxValue=6]="MaxValue"}(A||(A={})),function(e){e[e.Unknown=0]="Unknown",e[e["text/css"]=2]="text/css",e[e["text/html"]=3]="text/html",e[e["application/xml"]=4]="application/xml",e[e["application/wasm"]=5]="application/wasm",e[e["application/manifest+json"]=6]="application/manifest+json",e[e["application/x-aspx"]=7]="application/x-aspx",e[e["application/jsp"]=8]="application/jsp",e[e["text/x-c++src"]=9]="text/x-c++src",e[e["text/x-coffeescript"]=10]="text/x-coffeescript",e[e["application/vnd.dart"]=11]="application/vnd.dart",e[e["text/typescript"]=12]="text/typescript",e[e["text/typescript-jsx"]=13]="text/typescript-jsx",e[e["application/json"]=14]="application/json",e[e["text/x-csharp"]=15]="text/x-csharp",e[e["text/x-java"]=16]="text/x-java",e[e["text/x-less"]=17]="text/x-less",e[e["application/x-httpd-php"]=18]="application/x-httpd-php",e[e["text/x-python"]=19]="text/x-python",e[e["text/x-sh"]=20]="text/x-sh",e[e["text/x-gss"]=21]="text/x-gss",e[e["text/x-sass"]=22]="text/x-sass",e[e["text/x-scss"]=23]="text/x-scss",e[e["text/markdown"]=24]="text/markdown",e[e["text/x-clojure"]=25]="text/x-clojure",e[e["text/jsx"]=26]="text/jsx",e[e["text/x-go"]=27]="text/x-go",e[e["text/x-kotlin"]=28]="text/x-kotlin",e[e["text/x-scala"]=29]="text/x-scala",e[e["text/x.svelte"]=30]="text/x.svelte",e[e["text/javascript+plain"]=31]="text/javascript+plain",e[e["text/javascript+minified"]=32]="text/javascript+minified",e[e["text/javascript+sourcemapped"]=33]="text/javascript+sourcemapped",e[e["text/x.angular"]=34]="text/x.angular",e[e["text/x.vue"]=35]="text/x.vue",e[e.MaxValue=36]="MaxValue"}(V||(V={})),function(e){e[e.devToolsDefault=0]="devToolsDefault",e[e.vsCode=1]="vsCode",e[e.MaxValue=2]="MaxValue"}(O||(O={})),function(e){e[e.OtherShortcut=0]="OtherShortcut",e[e["commandMenu.show"]=1]="commandMenu.show",e[e["console.clear"]=2]="console.clear",e[e["console.show"]=3]="console.show",e[e["debugger.step"]=4]="debugger.step",e[e["debugger.step-into"]=5]="debugger.step-into",e[e["debugger.step-out"]=6]="debugger.step-out",e[e["debugger.step-over"]=7]="debugger.step-over",e[e["debugger.toggle-breakpoint"]=8]="debugger.toggle-breakpoint",e[e["debugger.toggle-breakpoint-enabled"]=9]="debugger.toggle-breakpoint-enabled",e[e["debugger.toggle-pause"]=10]="debugger.toggle-pause",e[e["elements.edit-as-html"]=11]="elements.edit-as-html",e[e["elements.hide-element"]=12]="elements.hide-element",e[e["elements.redo"]=13]="elements.redo",e[e["elements.toggle-element-search"]=14]="elements.toggle-element-search",e[e["elements.undo"]=15]="elements.undo",e[e["main.search-in-panel.find"]=16]="main.search-in-panel.find",e[e["main.toggle-drawer"]=17]="main.toggle-drawer",e[e["network.hide-request-details"]=18]="network.hide-request-details",e[e["network.search"]=19]="network.search",e[e["network.toggle-recording"]=20]="network.toggle-recording",e[e["quickOpen.show"]=21]="quickOpen.show",e[e["settings.show"]=22]="settings.show",e[e["sources.search"]=23]="sources.search",e[e["background-service.toggle-recording"]=24]="background-service.toggle-recording",e[e["components.collect-garbage"]=25]="components.collect-garbage",e[e["console.clear.history"]=26]="console.clear.history",e[e["console.create-pin"]=27]="console.create-pin",e[e["coverage.start-with-reload"]=28]="coverage.start-with-reload",e[e["coverage.toggle-recording"]=29]="coverage.toggle-recording",e[e["debugger.breakpoint-input-window"]=30]="debugger.breakpoint-input-window",e[e["debugger.evaluate-selection"]=31]="debugger.evaluate-selection",e[e["debugger.next-call-frame"]=32]="debugger.next-call-frame",e[e["debugger.previous-call-frame"]=33]="debugger.previous-call-frame",e[e["debugger.run-snippet"]=34]="debugger.run-snippet",e[e["debugger.toggle-breakpoints-active"]=35]="debugger.toggle-breakpoints-active",e[e["elements.capture-area-screenshot"]=36]="elements.capture-area-screenshot",e[e["emulation.capture-full-height-screenshot"]=37]="emulation.capture-full-height-screenshot",e[e["emulation.capture-node-screenshot"]=38]="emulation.capture-node-screenshot",e[e["emulation.capture-screenshot"]=39]="emulation.capture-screenshot",e[e["emulation.show-sensors"]=40]="emulation.show-sensors",e[e["emulation.toggle-device-mode"]=41]="emulation.toggle-device-mode",e[e["help.release-notes"]=42]="help.release-notes",e[e["help.report-issue"]=43]="help.report-issue",e[e["input.start-replaying"]=44]="input.start-replaying",e[e["input.toggle-pause"]=45]="input.toggle-pause",e[e["input.toggle-recording"]=46]="input.toggle-recording",e[e["inspector_main.focus-debuggee"]=47]="inspector_main.focus-debuggee",e[e["inspector_main.hard-reload"]=48]="inspector_main.hard-reload",e[e["inspector_main.reload"]=49]="inspector_main.reload",e[e["live-heap-profile.start-with-reload"]=50]="live-heap-profile.start-with-reload",e[e["live-heap-profile.toggle-recording"]=51]="live-heap-profile.toggle-recording",e[e["main.debug-reload"]=52]="main.debug-reload",e[e["main.next-tab"]=53]="main.next-tab",e[e["main.previous-tab"]=54]="main.previous-tab",e[e["main.search-in-panel.cancel"]=55]="main.search-in-panel.cancel",e[e["main.search-in-panel.find-next"]=56]="main.search-in-panel.find-next",e[e["main.search-in-panel.find-previous"]=57]="main.search-in-panel.find-previous",e[e["main.toggle-dock"]=58]="main.toggle-dock",e[e["main.zoom-in"]=59]="main.zoom-in",e[e["main.zoom-out"]=60]="main.zoom-out",e[e["main.zoom-reset"]=61]="main.zoom-reset",e[e["network-conditions.network-low-end-mobile"]=62]="network-conditions.network-low-end-mobile",e[e["network-conditions.network-mid-tier-mobile"]=63]="network-conditions.network-mid-tier-mobile",e[e["network-conditions.network-offline"]=64]="network-conditions.network-offline",e[e["network-conditions.network-online"]=65]="network-conditions.network-online",e[e["profiler.heap-toggle-recording"]=66]="profiler.heap-toggle-recording",e[e["profiler.js-toggle-recording"]=67]="profiler.js-toggle-recording",e[e["resources.clear"]=68]="resources.clear",e[e["settings.documentation"]=69]="settings.documentation",e[e["settings.shortcuts"]=70]="settings.shortcuts",e[e["sources.add-folder-to-workspace"]=71]="sources.add-folder-to-workspace",e[e["sources.add-to-watch"]=72]="sources.add-to-watch",e[e["sources.close-all"]=73]="sources.close-all",e[e["sources.close-editor-tab"]=74]="sources.close-editor-tab",e[e["sources.create-snippet"]=75]="sources.create-snippet",e[e["sources.go-to-line"]=76]="sources.go-to-line",e[e["sources.go-to-member"]=77]="sources.go-to-member",e[e["sources.jump-to-next-location"]=78]="sources.jump-to-next-location",e[e["sources.jump-to-previous-location"]=79]="sources.jump-to-previous-location",e[e["sources.rename"]=80]="sources.rename",e[e["sources.save"]=81]="sources.save",e[e["sources.save-all"]=82]="sources.save-all",e[e["sources.switch-file"]=83]="sources.switch-file",e[e["timeline.jump-to-next-frame"]=84]="timeline.jump-to-next-frame",e[e["timeline.jump-to-previous-frame"]=85]="timeline.jump-to-previous-frame",e[e["timeline.load-from-file"]=86]="timeline.load-from-file",e[e["timeline.next-recording"]=87]="timeline.next-recording",e[e["timeline.previous-recording"]=88]="timeline.previous-recording",e[e["timeline.record-reload"]=89]="timeline.record-reload",e[e["timeline.save-to-file"]=90]="timeline.save-to-file",e[e["timeline.show-history"]=91]="timeline.show-history",e[e["timeline.toggle-recording"]=92]="timeline.toggle-recording",e[e["sources.increment-css"]=93]="sources.increment-css",e[e["sources.increment-css-by-ten"]=94]="sources.increment-css-by-ten",e[e["sources.decrement-css"]=95]="sources.decrement-css",e[e["sources.decrement-css-by-ten"]=96]="sources.decrement-css-by-ten",e[e["layers.reset-view"]=97]="layers.reset-view",e[e["layers.pan-mode"]=98]="layers.pan-mode",e[e["layers.rotate-mode"]=99]="layers.rotate-mode",e[e["layers.zoom-in"]=100]="layers.zoom-in",e[e["layers.zoom-out"]=101]="layers.zoom-out",e[e["layers.up"]=102]="layers.up",e[e["layers.down"]=103]="layers.down",e[e["layers.left"]=104]="layers.left",e[e["layers.right"]=105]="layers.right",e[e["help.report-translation-issue"]=106]="help.report-translation-issue",e[e["rendering.toggle-prefers-color-scheme"]=107]="rendering.toggle-prefers-color-scheme",e[e["chrome_recorder.start-recording"]=108]="chrome_recorder.start-recording",e[e["chrome_recorder.replay-recording"]=109]="chrome_recorder.replay-recording",e[e["chrome_recorder.toggle-code-view"]=110]="chrome_recorder.toggle-code-view",e[e["chrome_recorder.copy-recording-or-step"]=111]="chrome_recorder.copy-recording-or-step",e[e.MaxValue=112]="MaxValue"}(H||(H={})),function(e){e[e.ConsoleInfoBar=0]="ConsoleInfoBar",e[e.LearnMoreLinkCOEP=1]="LearnMoreLinkCOEP",e[e.StatusBarIssuesCounter=2]="StatusBarIssuesCounter",e[e.HamburgerMenu=3]="HamburgerMenu",e[e.Adorner=4]="Adorner",e[e.CommandMenu=5]="CommandMenu",e[e.MaxValue=6]="MaxValue"}(N||(N={})),function(e){e[e.applyCustomStylesheet=0]="applyCustomStylesheet",e[e.captureNodeCreationStacks=1]="captureNodeCreationStacks",e[e.sourcesPrettyPrint=2]="sourcesPrettyPrint",e[e.liveHeapProfile=11]="liveHeapProfile",e[e.protocolMonitor=13]="protocolMonitor",e[e.developerResourcesView=15]="developerResourcesView",e[e.samplingHeapProfilerTimeline=17]="samplingHeapProfilerTimeline",e[e.showOptionToExposeInternalsInHeapSnapshot=18]="showOptionToExposeInternalsInHeapSnapshot",e[e.sourceOrderViewer=20]="sourceOrderViewer",e[e.webauthnPane=22]="webauthnPane",e[e.timelineEventInitiators=24]="timelineEventInitiators",e[e.timelineInvalidationTracking=26]="timelineInvalidationTracking",e[e.timelineShowAllEvents=27]="timelineShowAllEvents",e[e.timelineV8RuntimeCallStats=28]="timelineV8RuntimeCallStats",e[e.wasmDWARFDebugging=31]="wasmDWARFDebugging",e[e.dualScreenSupport=32]="dualScreenSupport",e[e.keyboardShortcutEditor=35]="keyboardShortcutEditor",e[e.APCA=39]="APCA",e[e.cspViolationsView=40]="cspViolationsView",e[e.fontEditor=41]="fontEditor",e[e.fullAccessibilityTree=42]="fullAccessibilityTree",e[e.ignoreListJSFramesOnTimeline=43]="ignoreListJSFramesOnTimeline",e[e.contrastIssues=44]="contrastIssues",e[e.experimentalCookieFeatures=45]="experimentalCookieFeatures",e[e.cssTypeComponentLength=52]="cssTypeComponentLength",e[e.preciseChanges=53]="preciseChanges",e[e.bfcacheDisplayTree=54]="bfcacheDisplayTree",e[e.stylesPaneCSSChanges=55]="stylesPaneCSSChanges",e[e.headerOverrides=56]="headerOverrides",e[e.evaluateExpressionsWithSourceMaps=58]="evaluateExpressionsWithSourceMaps",e[e.eyedropperColorPicker=60]="eyedropperColorPicker",e[e.instrumentationBreakpoints=61]="instrumentationBreakpoints",e[e.authoredDeployedGrouping=63]="authoredDeployedGrouping",e[e.importantDOMProperties=64]="importantDOMProperties",e[e.justMyCode=65]="justMyCode",e[e.timelineAsConsoleProfileResultPanel=67]="timelineAsConsoleProfileResultPanel",e[e.preloadingStatusPanel=68]="preloadingStatusPanel",e[e.disableColorFormatSetting=69]="disableColorFormatSetting",e[e.outermostTargetSelector=71]="outermostTargetSelector",e[e.jsProfilerTemporarilyEnable=72]="jsProfilerTemporarilyEnable",e[e.highlightErrorsElementsPanel=73]="highlightErrorsElementsPanel",e[e.setAllBreakpointsEagerly=74]="setAllBreakpointsEagerly",e[e.MaxValue=75]="MaxValue"}(W||(W={})),function(e){e[e.CrossOriginEmbedderPolicy=0]="CrossOriginEmbedderPolicy",e[e.MixedContent=1]="MixedContent",e[e.Cookie=2]="Cookie",e[e.HeavyAd=3]="HeavyAd",e[e.ContentSecurityPolicy=4]="ContentSecurityPolicy",e[e.Other=5]="Other",e[e.Generic=6]="Generic",e[e.MaxValue=7]="MaxValue"}(_||(_={})),function(e){e[e.CrossOriginEmbedderPolicyRequest=0]="CrossOriginEmbedderPolicyRequest",e[e.CrossOriginEmbedderPolicyElement=1]="CrossOriginEmbedderPolicyElement",e[e.MixedContentRequest=2]="MixedContentRequest",e[e.SameSiteCookieCookie=3]="SameSiteCookieCookie",e[e.SameSiteCookieRequest=4]="SameSiteCookieRequest",e[e.HeavyAdElement=5]="HeavyAdElement",e[e.ContentSecurityPolicyDirective=6]="ContentSecurityPolicyDirective",e[e.ContentSecurityPolicyElement=7]="ContentSecurityPolicyElement",e[e.CrossOriginEmbedderPolicyLearnMore=8]="CrossOriginEmbedderPolicyLearnMore",e[e.MixedContentLearnMore=9]="MixedContentLearnMore",e[e.SameSiteCookieLearnMore=10]="SameSiteCookieLearnMore",e[e.HeavyAdLearnMore=11]="HeavyAdLearnMore",e[e.ContentSecurityPolicyLearnMore=12]="ContentSecurityPolicyLearnMore",e[e.MaxValue=13]="MaxValue"}(U||(U={})),function(e){e[e.MixedContentIssue=0]="MixedContentIssue",e[e["ContentSecurityPolicyIssue::kInlineViolation"]=1]="ContentSecurityPolicyIssue::kInlineViolation",e[e["ContentSecurityPolicyIssue::kEvalViolation"]=2]="ContentSecurityPolicyIssue::kEvalViolation",e[e["ContentSecurityPolicyIssue::kURLViolation"]=3]="ContentSecurityPolicyIssue::kURLViolation",e[e["ContentSecurityPolicyIssue::kTrustedTypesSinkViolation"]=4]="ContentSecurityPolicyIssue::kTrustedTypesSinkViolation",e[e["ContentSecurityPolicyIssue::kTrustedTypesPolicyViolation"]=5]="ContentSecurityPolicyIssue::kTrustedTypesPolicyViolation",e[e["HeavyAdIssue::NetworkTotalLimit"]=6]="HeavyAdIssue::NetworkTotalLimit",e[e["HeavyAdIssue::CpuTotalLimit"]=7]="HeavyAdIssue::CpuTotalLimit",e[e["HeavyAdIssue::CpuPeakLimit"]=8]="HeavyAdIssue::CpuPeakLimit",e[e["CrossOriginEmbedderPolicyIssue::CoepFrameResourceNeedsCoepHeader"]=9]="CrossOriginEmbedderPolicyIssue::CoepFrameResourceNeedsCoepHeader",e[e["CrossOriginEmbedderPolicyIssue::CoopSandboxedIFrameCannotNavigateToCoopPage"]=10]="CrossOriginEmbedderPolicyIssue::CoopSandboxedIFrameCannotNavigateToCoopPage",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameOrigin"]=11]="CrossOriginEmbedderPolicyIssue::CorpNotSameOrigin",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameOriginAfterDefaultedToSameOriginByCoep"]=12]="CrossOriginEmbedderPolicyIssue::CorpNotSameOriginAfterDefaultedToSameOriginByCoep",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameSite"]=13]="CrossOriginEmbedderPolicyIssue::CorpNotSameSite",e[e["CookieIssue::ExcludeSameSiteNoneInsecure::ReadCookie"]=14]="CookieIssue::ExcludeSameSiteNoneInsecure::ReadCookie",e[e["CookieIssue::ExcludeSameSiteNoneInsecure::SetCookie"]=15]="CookieIssue::ExcludeSameSiteNoneInsecure::SetCookie",e[e["CookieIssue::WarnSameSiteNoneInsecure::ReadCookie"]=16]="CookieIssue::WarnSameSiteNoneInsecure::ReadCookie",e[e["CookieIssue::WarnSameSiteNoneInsecure::SetCookie"]=17]="CookieIssue::WarnSameSiteNoneInsecure::SetCookie",e[e["CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Secure"]=18]="CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Secure",e[e["CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Insecure"]=19]="CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Insecure",e[e["CookieIssue::WarnCrossDowngrade::ReadCookie::Secure"]=20]="CookieIssue::WarnCrossDowngrade::ReadCookie::Secure",e[e["CookieIssue::WarnCrossDowngrade::ReadCookie::Insecure"]=21]="CookieIssue::WarnCrossDowngrade::ReadCookie::Insecure",e[e["CookieIssue::WarnCrossDowngrade::SetCookie::Secure"]=22]="CookieIssue::WarnCrossDowngrade::SetCookie::Secure",e[e["CookieIssue::WarnCrossDowngrade::SetCookie::Insecure"]=23]="CookieIssue::WarnCrossDowngrade::SetCookie::Insecure",e[e["CookieIssue::ExcludeNavigationContextDowngrade::Secure"]=24]="CookieIssue::ExcludeNavigationContextDowngrade::Secure",e[e["CookieIssue::ExcludeNavigationContextDowngrade::Insecure"]=25]="CookieIssue::ExcludeNavigationContextDowngrade::Insecure",e[e["CookieIssue::ExcludeContextDowngrade::ReadCookie::Secure"]=26]="CookieIssue::ExcludeContextDowngrade::ReadCookie::Secure",e[e["CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure"]=27]="CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure",e[e["CookieIssue::ExcludeContextDowngrade::SetCookie::Secure"]=28]="CookieIssue::ExcludeContextDowngrade::SetCookie::Secure",e[e["CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure"]=29]="CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure",e[e["CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::ReadCookie"]=30]="CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::ReadCookie",e[e["CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::SetCookie"]=31]="CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::SetCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie"]=32]="CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::SetCookie"]=33]="CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::SetCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::ReadCookie"]=34]="CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::ReadCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::SetCookie"]=35]="CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::SetCookie",e[e["SharedArrayBufferIssue::TransferIssue"]=36]="SharedArrayBufferIssue::TransferIssue",e[e["SharedArrayBufferIssue::CreationIssue"]=37]="SharedArrayBufferIssue::CreationIssue",e[e.LowTextContrastIssue=41]="LowTextContrastIssue",e[e["CorsIssue::InsecurePrivateNetwork"]=42]="CorsIssue::InsecurePrivateNetwork",e[e["CorsIssue::InvalidHeaders"]=44]="CorsIssue::InvalidHeaders",e[e["CorsIssue::WildcardOriginWithCredentials"]=45]="CorsIssue::WildcardOriginWithCredentials",e[e["CorsIssue::PreflightResponseInvalid"]=46]="CorsIssue::PreflightResponseInvalid",e[e["CorsIssue::OriginMismatch"]=47]="CorsIssue::OriginMismatch",e[e["CorsIssue::AllowCredentialsRequired"]=48]="CorsIssue::AllowCredentialsRequired",e[e["CorsIssue::MethodDisallowedByPreflightResponse"]=49]="CorsIssue::MethodDisallowedByPreflightResponse",e[e["CorsIssue::HeaderDisallowedByPreflightResponse"]=50]="CorsIssue::HeaderDisallowedByPreflightResponse",e[e["CorsIssue::RedirectContainsCredentials"]=51]="CorsIssue::RedirectContainsCredentials",e[e["CorsIssue::DisallowedByMode"]=52]="CorsIssue::DisallowedByMode",e[e["CorsIssue::CorsDisabledScheme"]=53]="CorsIssue::CorsDisabledScheme",e[e["CorsIssue::PreflightMissingAllowExternal"]=54]="CorsIssue::PreflightMissingAllowExternal",e[e["CorsIssue::PreflightInvalidAllowExternal"]=55]="CorsIssue::PreflightInvalidAllowExternal",e[e["CorsIssue::NoCorsRedirectModeNotFollow"]=57]="CorsIssue::NoCorsRedirectModeNotFollow",e[e["QuirksModeIssue::QuirksMode"]=58]="QuirksModeIssue::QuirksMode",e[e["QuirksModeIssue::LimitedQuirksMode"]=59]="QuirksModeIssue::LimitedQuirksMode",e[e.DeprecationIssue=60]="DeprecationIssue",e[e["ClientHintIssue::MetaTagAllowListInvalidOrigin"]=61]="ClientHintIssue::MetaTagAllowListInvalidOrigin",e[e["ClientHintIssue::MetaTagModifiedHTML"]=62]="ClientHintIssue::MetaTagModifiedHTML",e[e["CorsIssue::PreflightAllowPrivateNetworkError"]=63]="CorsIssue::PreflightAllowPrivateNetworkError",e[e["GenericIssue::CrossOriginPortalPostMessageError"]=64]="GenericIssue::CrossOriginPortalPostMessageError",e[e["GenericIssue::FormLabelForNameError"]=65]="GenericIssue::FormLabelForNameError",e[e["GenericIssue::FormDuplicateIdForInputError"]=66]="GenericIssue::FormDuplicateIdForInputError",e[e["GenericIssue::FormInputWithNoLabelError"]=67]="GenericIssue::FormInputWithNoLabelError",e[e["GenericIssue::FormAutocompleteAttributeEmptyError"]=68]="GenericIssue::FormAutocompleteAttributeEmptyError",e[e["GenericIssue::FormEmptyIdAndNameAttributesForInputError"]=69]="GenericIssue::FormEmptyIdAndNameAttributesForInputError",e[e["GenericIssue::FormAriaLabelledByToNonExistingId"]=70]="GenericIssue::FormAriaLabelledByToNonExistingId",e[e["GenericIssue::FormInputAssignedAutocompleteValueToIdOrNameAttributeError"]=71]="GenericIssue::FormInputAssignedAutocompleteValueToIdOrNameAttributeError",e[e["GenericIssue::FormLabelHasNeitherForNorNestedInput"]=72]="GenericIssue::FormLabelHasNeitherForNorNestedInput",e[e["GenericIssue::FormLabelForMatchesNonExistingIdError"]=73]="GenericIssue::FormLabelForMatchesNonExistingIdError",e[e["GenericIssue::FormHasPasswordFieldWithoutUsernameFieldError"]=74]="GenericIssue::FormHasPasswordFieldWithoutUsernameFieldError",e[e["GenericIssue::FormInputHasWrongButWellIntendedAutocompleteValueError"]=75]="GenericIssue::FormInputHasWrongButWellIntendedAutocompleteValueError",e[e["StylesheetLoadingIssue::LateImportRule"]=76]="StylesheetLoadingIssue::LateImportRule",e[e["StylesheetLoadingIssue::RequestFailed"]=77]="StylesheetLoadingIssue::RequestFailed",e[e.MaxValue=78]="MaxValue"}(B||(B={})),function(e){e[e.LoadThroughPageViaTarget=0]="LoadThroughPageViaTarget",e[e.LoadThroughPageViaFrame=1]="LoadThroughPageViaFrame",e[e.LoadThroughPageFailure=2]="LoadThroughPageFailure",e[e.LoadThroughPageFallback=3]="LoadThroughPageFallback",e[e.FallbackAfterFailure=4]="FallbackAfterFailure",e[e.FallbackPerOverride=5]="FallbackPerOverride",e[e.FallbackPerProtocol=6]="FallbackPerProtocol",e[e.FallbackFailure=7]="FallbackFailure",e[e.MaxValue=8]="MaxValue"}(j||(j={})),function(e){e[e.SchemeOther=0]="SchemeOther",e[e.SchemeUnknown=1]="SchemeUnknown",e[e.SchemeHttp=2]="SchemeHttp",e[e.SchemeHttps=3]="SchemeHttps",e[e.SchemeHttpLocalhost=4]="SchemeHttpLocalhost",e[e.SchemeHttpsLocalhost=5]="SchemeHttpsLocalhost",e[e.SchemeData=6]="SchemeData",e[e.SchemeFile=7]="SchemeFile",e[e.SchemeBlob=8]="SchemeBlob",e[e.MaxValue=9]="MaxValue"}(G||(G={})),function(e){e[e.ContextMenu=0]="ContextMenu",e[e.MemoryIcon=1]="MemoryIcon",e[e.MaxValue=2]="MaxValue"}(z||(z={})),function(e){e[e.DWARFInspectableAddress=0]="DWARFInspectableAddress",e[e.ArrayBuffer=1]="ArrayBuffer",e[e.DataView=2]="DataView",e[e.TypedArray=3]="TypedArray",e[e.WebAssemblyMemory=4]="WebAssemblyMemory",e[e.MaxValue=5]="MaxValue"}(q||(q={})),function(e){e[e.af=1]="af",e[e.am=2]="am",e[e.ar=3]="ar",e[e.as=4]="as",e[e.az=5]="az",e[e.be=6]="be",e[e.bg=7]="bg",e[e.bn=8]="bn",e[e.bs=9]="bs",e[e.ca=10]="ca",e[e.cs=11]="cs",e[e.cy=12]="cy",e[e.da=13]="da",e[e.de=14]="de",e[e.el=15]="el",e[e["en-GB"]=16]="en-GB",e[e["en-US"]=17]="en-US",e[e["es-419"]=18]="es-419",e[e.es=19]="es",e[e.et=20]="et",e[e.eu=21]="eu",e[e.fa=22]="fa",e[e.fi=23]="fi",e[e.fil=24]="fil",e[e["fr-CA"]=25]="fr-CA",e[e.fr=26]="fr",e[e.gl=27]="gl",e[e.gu=28]="gu",e[e.he=29]="he",e[e.hi=30]="hi",e[e.hr=31]="hr",e[e.hu=32]="hu",e[e.hy=33]="hy",e[e.id=34]="id",e[e.is=35]="is",e[e.it=36]="it",e[e.ja=37]="ja",e[e.ka=38]="ka",e[e.kk=39]="kk",e[e.km=40]="km",e[e.kn=41]="kn",e[e.ko=42]="ko",e[e.ky=43]="ky",e[e.lo=44]="lo",e[e.lt=45]="lt",e[e.lv=46]="lv",e[e.mk=47]="mk",e[e.ml=48]="ml",e[e.mn=49]="mn",e[e.mr=50]="mr",e[e.ms=51]="ms",e[e.my=52]="my",e[e.ne=53]="ne",e[e.nl=54]="nl",e[e.no=55]="no",e[e.or=56]="or",e[e.pa=57]="pa",e[e.pl=58]="pl",e[e["pt-PT"]=59]="pt-PT",e[e.pt=60]="pt",e[e.ro=61]="ro",e[e.ru=62]="ru",e[e.si=63]="si",e[e.sk=64]="sk",e[e.sl=65]="sl",e[e.sq=66]="sq",e[e["sr-Latn"]=67]="sr-Latn",e[e.sr=68]="sr",e[e.sv=69]="sv",e[e.sw=70]="sw",e[e.ta=71]="ta",e[e.te=72]="te",e[e.th=73]="th",e[e.tr=74]="tr",e[e.uk=75]="uk",e[e.ur=76]="ur",e[e.uz=77]="uz",e[e.vi=78]="vi",e[e.zh=79]="zh",e[e["zh-HK"]=80]="zh-HK",e[e["zh-TW"]=81]="zh-TW",e[e.zu=82]="zu",e[e.MaxValue=83]="MaxValue"}(J||(J={})),function(e){e[e.ChromeSyncDisabled=1]="ChromeSyncDisabled",e[e.ChromeSyncSettingsDisabled=2]="ChromeSyncSettingsDisabled",e[e.DevToolsSyncSettingDisabled=3]="DevToolsSyncSettingDisabled",e[e.DevToolsSyncSettingEnabled=4]="DevToolsSyncSettingEnabled",e[e.MaxValue=5]="MaxValue"}(K||(K={})),function(e){e[e.RecordingStarted=1]="RecordingStarted",e[e.RecordingFinished=2]="RecordingFinished",e[e.MaxValue=3]="MaxValue"}(Q||(Q={})),function(e){e[e.AssertionAdded=1]="AssertionAdded",e[e.PropertyAssertionEdited=2]="PropertyAssertionEdited",e[e.AttributeAssertionEdited=3]="AttributeAssertionEdited",e[e.MaxValue=4]="MaxValue"}(X||(X={})),function(e){e[e.Success=1]="Success",e[e.TimeoutErrorSelectors=2]="TimeoutErrorSelectors",e[e.TimeoutErrorTarget=3]="TimeoutErrorTarget",e[e.OtherError=4]="OtherError",e[e.MaxValue=5]="MaxValue"}(Z||(Z={})),function(e){e[e.Normal=1]="Normal",e[e.Slow=2]="Slow",e[e.VerySlow=3]="VerySlow",e[e.ExtremelySlow=4]="ExtremelySlow",e[e.MaxValue=5]="MaxValue"}($||($={})),function(e){e[e.ReplayOnly=1]="ReplayOnly",e[e.ReplayWithPerformanceTracing=2]="ReplayWithPerformanceTracing",e[e.ReplayViaExtension=3]="ReplayViaExtension",e[e.MaxValue=4]="MaxValue"}(Y||(Y={})),function(e){e[e.SelectorPickerUsed=1]="SelectorPickerUsed",e[e.StepAdded=2]="StepAdded",e[e.StepRemoved=3]="StepRemoved",e[e.SelectorAdded=4]="SelectorAdded",e[e.SelectorRemoved=5]="SelectorRemoved",e[e.SelectorPartAdded=6]="SelectorPartAdded",e[e.SelectorPartEdited=7]="SelectorPartEdited",e[e.SelectorPartRemoved=8]="SelectorPartRemoved",e[e.TypeChanged=9]="TypeChanged",e[e.OtherEditing=10]="OtherEditing",e[e.MaxValue=11]="MaxValue"}(ee||(ee={})),function(e){e[e.ToPuppeteer=1]="ToPuppeteer",e[e.ToJSON=2]="ToJSON",e[e.ToPuppeteerReplay=3]="ToPuppeteerReplay",e[e.ToExtension=4]="ToExtension",e[e.ToLighthouse=5]="ToLighthouse",e[e.MaxValue=6]="MaxValue"}(oe||(oe={})),function(e){e[e.CodeShown=1]="CodeShown",e[e.CodeHidden=2]="CodeHidden",e[e.MaxValue=3]="MaxValue"}(re||(re={})),function(e){e[e.CopiedRecordingWithPuppeteer=1]="CopiedRecordingWithPuppeteer",e[e.CopiedRecordingWithJSON=2]="CopiedRecordingWithJSON",e[e.CopiedRecordingWithReplay=3]="CopiedRecordingWithReplay",e[e.CopiedRecordingWithExtension=4]="CopiedRecordingWithExtension",e[e.CopiedStepWithPuppeteer=5]="CopiedStepWithPuppeteer",e[e.CopiedStepWithJSON=6]="CopiedStepWithJSON",e[e.CopiedStepWithReplay=7]="CopiedStepWithReplay",e[e.CopiedStepWithExtension=8]="CopiedStepWithExtension",e[e.MaxValue=9]="MaxValue"}(te||(te={})),function(e){e[e.false=0]="false",e[e.true=1]="true",e[e.MaxValue=2]="MaxValue"}(ne||(ne={})),function(e){e[e.DeclarationViaChangedLine=1]="DeclarationViaChangedLine",e[e.AllChangesViaStylesPane=2]="AllChangesViaStylesPane",e[e.DeclarationViaContextMenu=3]="DeclarationViaContextMenu",e[e.PropertyViaContextMenu=4]="PropertyViaContextMenu",e[e.ValueViaContextMenu=5]="ValueViaContextMenu",e[e.DeclarationAsJSViaContextMenu=6]="DeclarationAsJSViaContextMenu",e[e.RuleViaContextMenu=7]="RuleViaContextMenu",e[e.AllDeclarationsViaContextMenu=8]="AllDeclarationsViaContextMenu",e[e.AllDeclarationsAsJSViaContextMenu=9]="AllDeclarationsAsJSViaContextMenu",e[e.SelectorViaContextMenu=10]="SelectorViaContextMenu",e[e.MaxValue=11]="MaxValue"}(ie||(ie={})),function(e){e[e.OtherSection=0]="OtherSection",e[e.Identity=1]="Identity",e[e.Presentation=2]="Presentation",e[e["Protocol Handlers"]=3]="Protocol Handlers",e[e.Icons=4]="Icons",e[e["Window Controls Overlay"]=5]="Window Controls Overlay",e[e.MaxValue=6]="MaxValue"}(se||(se={})),function(e){e[e.Other=0]="Other",e[e.AlignContent=1]="AlignContent",e[e.FlexItem=2]="FlexItem",e[e.FlexContainer=3]="FlexContainer",e[e.GridContainer=4]="GridContainer",e[e.GridItem=5]="GridItem",e[e.FlexGrid=6]="FlexGrid",e[e.MulticolFlexGrid=7]="MulticolFlexGrid",e[e.Padding=8]="Padding",e[e.Position=9]="Position",e[e.ZIndex=10]="ZIndex",e[e.Sizing=11]="Sizing",e[e.FlexOrGridItem=12]="FlexOrGridItem",e[e.FontVariationSettings=13]="FontVariationSettings",e[e.MaxValue=14]="MaxValue"}(ae||(ae={})),function(e){e[e.Navigation=0]="Navigation",e[e.Timespan=1]="Timespan",e[e.Snapshot=2]="Snapshot",e[e.LegacyNavigation=3]="LegacyNavigation",e[e.MaxValue=4]="MaxValue"}(de||(de={}));var ue=Object.freeze({__proto__:null,UserMetrics:ce,get Action(){return F},get PanelCodes(){return D},get ElementsSidebarTabCodes(){return L},get SourcesSidebarTabCodes(){return A},get MediaTypes(){return V},get KeybindSetSettings(){return O},get KeyboardShortcutAction(){return H},get IssueOpener(){return N},get DevtoolsExperiments(){return W},get IssueExpanded(){return _},get IssueResourceOpened(){return U},get IssueCreated(){return B},get DeveloperResourceLoaded(){return j},get DeveloperResourceScheme(){return G},get LinearMemoryInspectorRevealedFrom(){return z},get LinearMemoryInspectorTarget(){return q},get Language(){return J},get SyncSetting(){return K},get RecordingToggled(){return Q},get RecordingAssertion(){return X},get RecordingReplayFinished(){return Z},get RecordingReplaySpeed(){return $},get RecordingReplayStarted(){return Y},get RecordingEdited(){return ee},get RecordingExported(){return oe},get RecordingCodeToggled(){return re},get RecordingCopiedToClipboard(){return te},get ConsoleShowsCorsErrors(){return ne},get StyleTextCopied(){return ie},get ManifestSectionCodes(){return se},get CSSHintType(){return ae},get LighthouseModeRun(){return de}});const me=new ce;export{w as InspectorFrontendHost,a as InspectorFrontendHostAPI,le as Platform,C as ResourceLoader,ue as UserMetrics,me as userMetrics}; +import*as e from"../common/common.js";import*as o from"../i18n/i18n.js";import*as r from"../platform/platform.js";import*as t from"../root/root.js";var n;!function(e){e.AppendedToURL="appendedToURL",e.CanceledSaveURL="canceledSaveURL",e.ContextMenuCleared="contextMenuCleared",e.ContextMenuItemSelected="contextMenuItemSelected",e.DeviceCountUpdated="deviceCountUpdated",e.DevicesDiscoveryConfigChanged="devicesDiscoveryConfigChanged",e.DevicesPortForwardingStatusChanged="devicesPortForwardingStatusChanged",e.DevicesUpdated="devicesUpdated",e.DispatchMessage="dispatchMessage",e.DispatchMessageChunk="dispatchMessageChunk",e.EnterInspectElementMode="enterInspectElementMode",e.EyeDropperPickedColor="eyeDropperPickedColor",e.FileSystemsLoaded="fileSystemsLoaded",e.FileSystemRemoved="fileSystemRemoved",e.FileSystemAdded="fileSystemAdded",e.FileSystemFilesChangedAddedRemoved="FileSystemFilesChangedAddedRemoved",e.IndexingTotalWorkCalculated="indexingTotalWorkCalculated",e.IndexingWorked="indexingWorked",e.IndexingDone="indexingDone",e.KeyEventUnhandled="keyEventUnhandled",e.ReattachRootTarget="reattachMainTarget",e.ReloadInspectedPage="reloadInspectedPage",e.RevealSourceLine="revealSourceLine",e.SavedURL="savedURL",e.SearchCompleted="searchCompleted",e.SetInspectedTabId="setInspectedTabId",e.SetUseSoftMenu="setUseSoftMenu",e.ShowPanel="showPanel"}(n||(n={}));const i=[[n.AppendedToURL,"appendedToURL",["url"]],[n.CanceledSaveURL,"canceledSaveURL",["url"]],[n.ContextMenuCleared,"contextMenuCleared",[]],[n.ContextMenuItemSelected,"contextMenuItemSelected",["id"]],[n.DeviceCountUpdated,"deviceCountUpdated",["count"]],[n.DevicesDiscoveryConfigChanged,"devicesDiscoveryConfigChanged",["config"]],[n.DevicesPortForwardingStatusChanged,"devicesPortForwardingStatusChanged",["status"]],[n.DevicesUpdated,"devicesUpdated",["devices"]],[n.DispatchMessage,"dispatchMessage",["messageObject"]],[n.DispatchMessageChunk,"dispatchMessageChunk",["messageChunk","messageSize"]],[n.EnterInspectElementMode,"enterInspectElementMode",[]],[n.EyeDropperPickedColor,"eyeDropperPickedColor",["color"]],[n.FileSystemsLoaded,"fileSystemsLoaded",["fileSystems"]],[n.FileSystemRemoved,"fileSystemRemoved",["fileSystemPath"]],[n.FileSystemAdded,"fileSystemAdded",["errorMessage","fileSystem"]],[n.FileSystemFilesChangedAddedRemoved,"fileSystemFilesChangedAddedRemoved",["changed","added","removed"]],[n.IndexingTotalWorkCalculated,"indexingTotalWorkCalculated",["requestId","fileSystemPath","totalWork"]],[n.IndexingWorked,"indexingWorked",["requestId","fileSystemPath","worked"]],[n.IndexingDone,"indexingDone",["requestId","fileSystemPath"]],[n.KeyEventUnhandled,"keyEventUnhandled",["event"]],[n.ReattachRootTarget,"reattachMainTarget",[]],[n.ReloadInspectedPage,"reloadInspectedPage",["hard"]],[n.RevealSourceLine,"revealSourceLine",["url","lineNumber","columnNumber"]],[n.SavedURL,"savedURL",["url","fileSystemPath"]],[n.SearchCompleted,"searchCompleted",["requestId","fileSystemPath","files"]],[n.SetInspectedTabId,"setInspectedTabId",["tabId"]],[n.SetUseSoftMenu,"setUseSoftMenu",["useSoftMenu"]],[n.ShowPanel,"showPanel",["panelName"]]];var s;!function(e){e.ActionTaken="DevTools.ActionTaken",e.BreakpointWithConditionAdded="DevTools.BreakpointWithConditionAdded",e.BreakpointEditDialogRevealedFrom="DevTools.BreakpointEditDialogRevealedFrom",e.PanelClosed="DevTools.PanelClosed",e.PanelShown="DevTools.PanelShown",e.SidebarPaneShown="DevTools.SidebarPaneShown",e.KeyboardShortcutFired="DevTools.KeyboardShortcutFired",e.IssueCreated="DevTools.IssueCreated",e.IssuesPanelIssueExpanded="DevTools.IssuesPanelIssueExpanded",e.IssuesPanelOpenedFrom="DevTools.IssuesPanelOpenedFrom",e.IssuesPanelResourceOpened="DevTools.IssuesPanelResourceOpened",e.KeybindSetSettingChanged="DevTools.KeybindSetSettingChanged",e.ElementsSidebarTabShown="DevTools.Elements.SidebarTabShown",e.ExperimentEnabledAtLaunch="DevTools.ExperimentEnabledAtLaunch",e.ExperimentEnabled="DevTools.ExperimentEnabled",e.ExperimentDisabled="DevTools.ExperimentDisabled",e.DeveloperResourceLoaded="DevTools.DeveloperResourceLoaded",e.DeveloperResourceScheme="DevTools.DeveloperResourceScheme",e.LinearMemoryInspectorRevealedFrom="DevTools.LinearMemoryInspector.RevealedFrom",e.LinearMemoryInspectorTarget="DevTools.LinearMemoryInspector.Target",e.Language="DevTools.Language",e.SyncSetting="DevTools.SyncSetting",e.RecordingAssertion="DevTools.RecordingAssertion",e.RecordingCodeToggled="DevTools.RecordingCodeToggled",e.RecordingCopiedToClipboard="DevTools.RecordingCopiedToClipboard",e.RecordingEdited="DevTools.RecordingEdited",e.RecordingExported="DevTools.RecordingExported",e.RecordingReplayFinished="DevTools.RecordingReplayFinished",e.RecordingReplaySpeed="DevTools.RecordingReplaySpeed",e.RecordingReplayStarted="DevTools.RecordingReplayStarted",e.RecordingToggled="DevTools.RecordingToggled",e.SourcesSidebarTabShown="DevTools.Sources.SidebarTabShown",e.SourcesPanelFileDebugged="DevTools.SourcesPanelFileDebugged",e.SourcesPanelFileOpened="DevTools.SourcesPanelFileOpened",e.NetworkPanelResponsePreviewOpened="DevTools.NetworkPanelResponsePreviewOpened",e.StyleTextCopied="DevTools.StyleTextCopied",e.ManifestSectionSelected="DevTools.ManifestSectionSelected",e.CSSHintShown="DevTools.CSSHintShown",e.LighthouseModeRun="DevTools.LighthouseModeRun",e.ColorConvertedFrom="DevTools.ColorConvertedFrom",e.ColorPickerOpenedFrom="DevTools.ColorPickerOpenedFrom",e.CSSPropertyDocumentation="DevTools.CSSPropertyDocumentation",e.InlineScriptParsed="DevTools.InlineScriptParsed",e.VMInlineScriptTypeShown="DevTools.VMInlineScriptShown",e.BreakpointsRestoredFromStorageCount="DevTools.BreakpointsRestoredFromStorageCount",e.SwatchActivated="DevTools.SwatchActivated",e.BadgeActivated="DevTools.BadgeActivated"}(s||(s={}));var a=Object.freeze({__proto__:null,get Events(){return n},EventDescriptors:i,get EnumeratedHistogram(){return s}});const d={systemError:"System error",connectionError:"Connection error",certificateError:"Certificate error",httpError:"HTTP error",cacheError:"Cache error",signedExchangeError:"Signed Exchange error",ftpError:"FTP error",certificateManagerError:"Certificate manager error",dnsResolverError:"DNS resolver error",unknownError:"Unknown error",httpErrorStatusCodeSS:"HTTP error: status code {PH1}, {PH2}",invalidUrl:"Invalid URL",decodingDataUrlFailed:"Decoding Data URL failed"},l=o.i18n.registerUIStrings("core/host/ResourceLoader.ts",d),c=o.i18n.getLocalizedString.bind(void 0,l);let u=0;const m={},g=function(e,o){m[e].write(o)};let p=function(o,r,t,n){const i=new e.StringOutputStream.StringOutputStream;h(o,r,i,(function(e,o,r){t(e,o,i.data(),r)}),n)};function S(e,o,r){if(void 0===e||void 0===r)return null;if(0!==e){if(function(e){return e<=-300&&e>-400}(e))return c(d.httpErrorStatusCodeSS,{PH1:String(o),PH2:r});const t=function(e){return c(e>-100?d.systemError:e>-200?d.connectionError:e>-300?d.certificateError:e>-400?d.httpError:e>-500?d.cacheError:e>-600?d.signedExchangeError:e>-700?d.ftpError:e>-800?d.certificateManagerError:e>-900?d.dnsResolverError:d.unknownError)}(e);return`${t}: ${r}`}return null}const h=function(o,r,t,n,i){const s=function(e){return m[++u]=e,u}(t);if(new e.ParsedURL.ParsedURL(o).isDataURL())return void(e=>new Promise(((o,r)=>{const t=new XMLHttpRequest;t.withCredentials=!1,t.open("GET",e,!0),t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE){if(200!==t.status)return t.onreadystatechange=null,void r(new Error(String(t.status)));t.onreadystatechange=null,o(t.responseText)}},t.send(null)})))(o).then((function(e){g(s,e),l({statusCode:200})})).catch((function(e){l({statusCode:404,messageOverride:c(d.decodingDataUrlFailed)})}));if(!i&&function(e){try{const o=new URL(e);return"file:"===o.protocol&&""!==o.host}catch(e){return!1}}(o))return void(n&&n(!1,{},{statusCode:400,netError:-20,netErrorName:"net::BLOCKED_BY_CLIENT",message:"Loading from a remote file path is prohibited for security reasons."}));const a=[];if(r)for(const e in r)a.push(e+": "+r[e]);function l(e){if(n){const{success:o,description:r}=function(e){const{statusCode:o,netError:r,netErrorName:t,urlValid:n,messageOverride:i}=e;let s="";const a=o>=200&&o<300;if("string"==typeof i)s=i;else if(!a)if(void 0===r)s=c(!1===n?d.invalidUrl:d.unknownError);else{const e=S(r,o,t);e&&(s=e)}return console.assert(a===(0===s.length)),{success:a,description:{statusCode:o,netError:r,netErrorName:t,urlValid:n,message:s}}}(e);n(o,e.headers||{},r)}var o;m[o=s].close(),delete m[o]}f.loadNetworkResource(o,a.join("\r\n"),s,l)};var C=Object.freeze({__proto__:null,ResourceLoader:{},streamWrite:g,get load(){return p},setLoadForTest:function(e){p=e},netErrorToMessage:S,loadAsStream:h});const v={devtoolsS:"DevTools - {PH1}"},y=o.i18n.registerUIStrings("core/host/InspectorFrontendHost.ts",v),k=o.i18n.getLocalizedString.bind(void 0,y);class x{#e;events;#o=null;recordedCountHistograms=[];recordedEnumeratedHistograms=[];recordedPerformanceHistograms=[];constructor(){function e(e){!("mac"===this.platform()?e.metaKey:e.ctrlKey)||"+"!==e.key&&"-"!==e.key||e.stopPropagation()}this.#e=new Map,"undefined"!=typeof document&&document.addEventListener("keydown",(o=>{e.call(this,o)}),!0)}platform(){const e=navigator.userAgent;return e.includes("Windows NT")?"windows":e.includes("Mac OS X")?"mac":"linux"}loadCompleted(){}bringToFront(){}closeWindow(){}setIsDocked(e,o){window.setTimeout(o,0)}showSurvey(e,o){window.setTimeout((()=>o({surveyShown:!1})),0)}canShowSurvey(e,o){window.setTimeout((()=>o({canShowSurvey:!1})),0)}setInspectedPageBounds(e){}inspectElementCompleted(){}setInjectedScriptForOrigin(e,o){}inspectedURLChanged(e){document.title=k(v.devtoolsS,{PH1:e.replace(/^https?:\/\//,"")})}copyText(e){null!=e&&navigator.clipboard.writeText(e)}openInNewTab(e){window.open(e,"_blank")}showItemInFolder(o){e.Console.Console.instance().error("Show item in folder is not enabled in hosted mode. Please inspect using chrome://inspect")}save(e,o,r){let t=this.#e.get(e);t||(t=[],this.#e.set(e,t)),t.push(o),this.events.dispatchEventToListeners(n.SavedURL,{url:e,fileSystemPath:e})}append(e,o){const r=this.#e.get(e);r&&(r.push(o),this.events.dispatchEventToListeners(n.AppendedToURL,e))}close(e){const o=this.#e.get(e)||[];this.#e.delete(e);let t="";if(e)try{const o=r.StringUtilities.trimURL(e);t=r.StringUtilities.removeURLFragment(o)}catch(o){t=e}const n=document.createElement("a");n.download=t;const i=new Blob([o.join("")],{type:"text/plain"}),s=URL.createObjectURL(i);n.href=s,n.click(),URL.revokeObjectURL(s)}sendMessageToBackend(e){}recordCountHistogram(e,o,r,t,n){this.recordedCountHistograms.length>=100&&this.recordedCountHistograms.shift(),this.recordedCountHistograms.push({histogramName:e,sample:o,min:r,exclusiveMax:t,bucketSize:n})}recordEnumeratedHistogram(e,o,r){this.recordedEnumeratedHistograms.length>=100&&this.recordedEnumeratedHistograms.shift(),this.recordedEnumeratedHistograms.push({actionName:e,actionCode:o})}recordPerformanceHistogram(e,o){this.recordedPerformanceHistograms.length>=100&&this.recordedPerformanceHistograms.shift(),this.recordedPerformanceHistograms.push({histogramName:e,duration:o})}recordUserMetricsAction(e){}requestFileSystems(){this.events.dispatchEventToListeners(n.FileSystemsLoaded,[])}addFileSystem(e){window.webkitRequestFileSystem(window.TEMPORARY,1048576,(e=>{this.#o=e;const o={fileSystemName:"sandboxedRequestedFileSystem",fileSystemPath:"/overrides",rootURL:"filesystem:devtools://devtools/isolated/",type:"overrides"};this.events.dispatchEventToListeners(n.FileSystemAdded,{fileSystem:o})}))}removeFileSystem(e){const o=e=>{e.forEach((e=>{e.isDirectory?e.removeRecursively((()=>{})):e.isFile&&e.remove((()=>{}))}))};this.#o&&this.#o.root.createReader().readEntries(o),this.#o=null,this.events.dispatchEventToListeners(n.FileSystemRemoved,"/overrides")}isolatedFileSystem(e,o){return this.#o}loadNetworkResource(e,o,r,t){fetch(e).then((async e=>{const o=await e.arrayBuffer();let r=o;if(function(e){const o=new Uint8Array(e);return!(!o||o.length<3)&&31===o[0]&&139===o[1]&&8===o[2]}(o)){const e=new DecompressionStream("gzip"),t=e.writable.getWriter();t.write(o),t.close(),r=e.readable}return await new Response(r).text()})).then((function(e){g(r,e),t({statusCode:200,headers:void 0,messageOverride:void 0,netError:void 0,netErrorName:void 0,urlValid:void 0})})).catch((function(){t({statusCode:404,headers:void 0,messageOverride:void 0,netError:void 0,netErrorName:void 0,urlValid:void 0})}))}registerPreference(e,o){}getPreferences(e){const o={};for(const e in window.localStorage)o[e]=window.localStorage[e];e(o)}getPreference(e,o){o(window.localStorage[e])}setPreference(e,o){window.localStorage[e]=o}removePreference(e){delete window.localStorage[e]}clearPreferences(){window.localStorage.clear()}getSyncInformation(e){e({isSyncActive:!1,arePreferencesSynced:!1})}upgradeDraggedFileSystemPermissions(e){}indexPath(e,o,r){}stopIndexing(e){}searchInPath(e,o,r){}zoomFactor(){return 1}zoomIn(){}zoomOut(){}resetZoom(){}setWhitelistedShortcuts(e){}setEyeDropperActive(e){}showCertificateViewer(e){}reattach(e){e()}readyForTest(){}connectionReady(){}setOpenNewWindowForPopups(e){}setDevicesDiscoveryConfig(e){}setDevicesUpdatesEnabled(e){}performActionOnRemotePage(e,o){}openRemotePage(e,o){}openNodeFrontend(){}showContextMenuAtPoint(e,o,r,t){throw"Soft context menu should be used"}isHostedMode(){return!0}setAddExtensionCallback(e){}async initialTargetId(){return null}}let f=globalThis.InspectorFrontendHost;class I{constructor(){for(const e of i)this[e[1]]=this.dispatch.bind(this,e[0],e[2],e[3])}dispatch(e,o,r,...t){if(o.length<2){try{f.events.dispatchEventToListeners(e,t[0])}catch(e){console.error(e+" "+e.stack)}return}const n={};for(let e=0;e{this.#r.delete(e)}}removeAllEventListeners(){this.#r.clear()}sendEvent(e){if(!0!==globalThis.enableReactNativePerfMetrics)return;const o=[];for(const r of this.#r)try{r(e)}catch(e){o.push(e)}if(o.length>0){const e=new AggregateError(o);console.error("Error occurred when calling event listeners",e)}}}var V,O,H,N,_,W,U,B,j,G,z,q,J,K,Q,X,Z,$,Y,ee,oe,re,te,ne,ie,se,ae,de,le,ce,ue,me,ge=Object.freeze({__proto__:null,getInstance:L,registerPerfMetricsGlobalPostMessageHandler:function(){!0===globalThis.enableReactNativePerfMetrics&&!0===globalThis.enableReactNativePerfMetricsGlobalPostMessage&&L().addEventListener((e=>{window.postMessage({event:e,tag:"react-native-chrome-devtools-perf-metrics"},window.location.origin)}))}});class pe{#t;#n;#i;constructor(){this.#t=!1,this.#n=!1,this.#i=""}breakpointWithConditionAdded(e){e>=2||f.recordEnumeratedHistogram(s.BreakpointWithConditionAdded,e,2)}breakpointEditDialogRevealedFrom(e){e>=7||f.recordEnumeratedHistogram(s.BreakpointEditDialogRevealedFrom,e,7)}panelShown(e){const o=O[e]||0;f.recordEnumeratedHistogram(s.PanelShown,o,O.MaxValue),f.recordUserMetricsAction("DevTools_PanelShown_"+e),this.#t=!0}panelClosed(e){const o=O[e]||0;f.recordEnumeratedHistogram(s.PanelClosed,o,O.MaxValue),this.#t=!0}elementsSidebarTabShown(e){const o=H[e]||0;f.recordEnumeratedHistogram(s.ElementsSidebarTabShown,o,H.MaxValue)}sourcesSidebarTabShown(e){const o=N[e]||0;f.recordEnumeratedHistogram(s.SourcesSidebarTabShown,o,N.MaxValue)}settingsPanelShown(e){this.panelShown("settings-"+e)}sourcesPanelFileDebugged(e){const o=e&&_[e]||_.Unknown;f.recordEnumeratedHistogram(s.SourcesPanelFileDebugged,o,_.MaxValue)}sourcesPanelFileOpened(e){const o=e&&_[e]||_.Unknown;f.recordEnumeratedHistogram(s.SourcesPanelFileOpened,o,_.MaxValue)}networkPanelResponsePreviewOpened(e){const o=e&&_[e]||_.Unknown;f.recordEnumeratedHistogram(s.NetworkPanelResponsePreviewOpened,o,_.MaxValue)}actionTaken(e){f.recordEnumeratedHistogram(s.ActionTaken,e,V.MaxValue)}panelLoaded(e,o){this.#n||e!==this.#i||(this.#n=!0,requestAnimationFrame((()=>{window.setTimeout((()=>{performance.mark(o),this.#t||f.recordPerformanceHistogram(o,performance.now())}),0)})))}setLaunchPanel(e){this.#i=e}keybindSetSettingChanged(e){const o=W[e]||0;f.recordEnumeratedHistogram(s.KeybindSetSettingChanged,o,W.MaxValue)}keyboardShortcutFired(e){const o=U[e]||U.OtherShortcut;f.recordEnumeratedHistogram(s.KeyboardShortcutFired,o,U.MaxValue)}issuesPanelOpenedFrom(e){f.recordEnumeratedHistogram(s.IssuesPanelOpenedFrom,e,B.MaxValue)}issuesPanelIssueExpanded(e){if(void 0===e)return;const o=G[e];void 0!==o&&f.recordEnumeratedHistogram(s.IssuesPanelIssueExpanded,o,G.MaxValue)}issuesPanelResourceOpened(e,o){const r=z[e+o];void 0!==r&&f.recordEnumeratedHistogram(s.IssuesPanelResourceOpened,r,z.MaxValue)}issueCreated(e){const o=q[e];void 0!==o&&f.recordEnumeratedHistogram(s.IssueCreated,o,q.MaxValue)}experimentEnabledAtLaunch(e){const o=j[e];void 0!==o&&f.recordEnumeratedHistogram(s.ExperimentEnabledAtLaunch,o,j.MaxValue)}experimentChanged(e,o){const r=j[e];if(void 0===r)return;const t=o?s.ExperimentEnabled:s.ExperimentDisabled;f.recordEnumeratedHistogram(t,r,j.MaxValue)}developerResourceLoaded(e){e>=J.MaxValue||f.recordEnumeratedHistogram(s.DeveloperResourceLoaded,e,J.MaxValue)}developerResourceScheme(e){e>=K.MaxValue||f.recordEnumeratedHistogram(s.DeveloperResourceScheme,e,K.MaxValue)}inlineScriptParsed(e){e>=2||f.recordEnumeratedHistogram(s.InlineScriptParsed,e,2)}vmInlineScriptContentShown(e){e>=2||f.recordEnumeratedHistogram(s.VMInlineScriptTypeShown,e,2)}linearMemoryInspectorRevealedFrom(e){e>=Q.MaxValue||f.recordEnumeratedHistogram(s.LinearMemoryInspectorRevealedFrom,e,Q.MaxValue)}linearMemoryInspectorTarget(e){e>=X.MaxValue||f.recordEnumeratedHistogram(s.LinearMemoryInspectorTarget,e,X.MaxValue)}language(e){const o=Z[e];void 0!==o&&f.recordEnumeratedHistogram(s.Language,o,Z.MaxValue)}syncSetting(e){f.getSyncInformation((o=>{let r=$.ChromeSyncDisabled;o.isSyncActive&&!o.arePreferencesSynced?r=$.ChromeSyncSettingsDisabled:o.isSyncActive&&o.arePreferencesSynced&&(r=e?$.DevToolsSyncSettingEnabled:$.DevToolsSyncSettingDisabled),f.recordEnumeratedHistogram(s.SyncSetting,r,$.MaxValue)}))}recordingAssertion(e){f.recordEnumeratedHistogram(s.RecordingAssertion,e,ee.MaxValue)}recordingToggled(e){f.recordEnumeratedHistogram(s.RecordingToggled,e,Y.MaxValue)}recordingReplayFinished(e){f.recordEnumeratedHistogram(s.RecordingReplayFinished,e,oe.MaxValue)}recordingReplaySpeed(e){f.recordEnumeratedHistogram(s.RecordingReplaySpeed,e,re.MaxValue)}recordingReplayStarted(e){f.recordEnumeratedHistogram(s.RecordingReplayStarted,e,te.MaxValue)}recordingEdited(e){f.recordEnumeratedHistogram(s.RecordingEdited,e,ne.MaxValue)}recordingExported(e){f.recordEnumeratedHistogram(s.RecordingExported,e,ie.MaxValue)}recordingCodeToggled(e){f.recordEnumeratedHistogram(s.RecordingCodeToggled,e,se.MaxValue)}recordingCopiedToClipboard(e){f.recordEnumeratedHistogram(s.RecordingCopiedToClipboard,e,ae.MaxValue)}styleTextCopied(e){f.recordEnumeratedHistogram(s.StyleTextCopied,e,le.MaxValue)}manifestSectionSelected(e){const o=ce[e]||ce.OtherSection;f.recordEnumeratedHistogram(s.ManifestSectionSelected,o,ce.MaxValue)}cssHintShown(e){f.recordEnumeratedHistogram(s.CSSHintShown,e,ue.MaxValue)}lighthouseModeRun(e){f.recordEnumeratedHistogram(s.LighthouseModeRun,e,me.MaxValue)}colorConvertedFrom(e){f.recordEnumeratedHistogram(s.ColorConvertedFrom,e,2)}colorPickerOpenedFrom(e){f.recordEnumeratedHistogram(s.ColorPickerOpenedFrom,e,2)}cssPropertyDocumentation(e){f.recordEnumeratedHistogram(s.CSSPropertyDocumentation,e,3)}swatchActivated(e){f.recordEnumeratedHistogram(s.SwatchActivated,e,10)}badgeActivated(e){f.recordEnumeratedHistogram(s.BadgeActivated,e,9)}breakpointsRestoredFromStorage(e){const o=this.#s(e);f.recordEnumeratedHistogram(s.BreakpointsRestoredFromStorageCount,o,10)}#s(e){return e<100?0:e<300?1:e<1e3?2:e<3e3?3:e<1e4?4:e<3e4?5:e<1e5?6:e<3e5?7:e<1e6?8:9}workspacesPopulated(e){f.recordPerformanceHistogram("DevTools.Workspaces.PopulateWallClocktime",e)}workspacesNumberOfFiles(e,o){f.recordCountHistogram("DevTools.Workspaces.NumberOfFilesLoaded",e,0,1e5,100),f.recordCountHistogram("DevTools.Workspaces.NumberOfDirectoriesTraversed",o,0,1e4,100)}}!function(e){e[e.WindowDocked=1]="WindowDocked",e[e.WindowUndocked=2]="WindowUndocked",e[e.ScriptsBreakpointSet=3]="ScriptsBreakpointSet",e[e.TimelineStarted=4]="TimelineStarted",e[e.ProfilesCPUProfileTaken=5]="ProfilesCPUProfileTaken",e[e.ProfilesHeapProfileTaken=6]="ProfilesHeapProfileTaken",e[e.ConsoleEvaluated=8]="ConsoleEvaluated",e[e.FileSavedInWorkspace=9]="FileSavedInWorkspace",e[e.DeviceModeEnabled=10]="DeviceModeEnabled",e[e.AnimationsPlaybackRateChanged=11]="AnimationsPlaybackRateChanged",e[e.RevisionApplied=12]="RevisionApplied",e[e.FileSystemDirectoryContentReceived=13]="FileSystemDirectoryContentReceived",e[e.StyleRuleEdited=14]="StyleRuleEdited",e[e.CommandEvaluatedInConsolePanel=15]="CommandEvaluatedInConsolePanel",e[e.DOMPropertiesExpanded=16]="DOMPropertiesExpanded",e[e.ResizedViewInResponsiveMode=17]="ResizedViewInResponsiveMode",e[e.TimelinePageReloadStarted=18]="TimelinePageReloadStarted",e[e.ConnectToNodeJSFromFrontend=19]="ConnectToNodeJSFromFrontend",e[e.ConnectToNodeJSDirectly=20]="ConnectToNodeJSDirectly",e[e.CpuThrottlingEnabled=21]="CpuThrottlingEnabled",e[e.CpuProfileNodeFocused=22]="CpuProfileNodeFocused",e[e.CpuProfileNodeExcluded=23]="CpuProfileNodeExcluded",e[e.SelectFileFromFilePicker=24]="SelectFileFromFilePicker",e[e.SelectCommandFromCommandMenu=25]="SelectCommandFromCommandMenu",e[e.ChangeInspectedNodeInElementsPanel=26]="ChangeInspectedNodeInElementsPanel",e[e.StyleRuleCopied=27]="StyleRuleCopied",e[e.CoverageStarted=28]="CoverageStarted",e[e.LighthouseStarted=29]="LighthouseStarted",e[e.LighthouseFinished=30]="LighthouseFinished",e[e.ShowedThirdPartyBadges=31]="ShowedThirdPartyBadges",e[e.LighthouseViewTrace=32]="LighthouseViewTrace",e[e.FilmStripStartedRecording=33]="FilmStripStartedRecording",e[e.CoverageReportFiltered=34]="CoverageReportFiltered",e[e.CoverageStartedPerBlock=35]="CoverageStartedPerBlock",e[e["SettingsOpenedFromGear-deprecated"]=36]="SettingsOpenedFromGear-deprecated",e[e["SettingsOpenedFromMenu-deprecated"]=37]="SettingsOpenedFromMenu-deprecated",e[e["SettingsOpenedFromCommandMenu-deprecated"]=38]="SettingsOpenedFromCommandMenu-deprecated",e[e.TabMovedToDrawer=39]="TabMovedToDrawer",e[e.TabMovedToMainPanel=40]="TabMovedToMainPanel",e[e.CaptureCssOverviewClicked=41]="CaptureCssOverviewClicked",e[e.VirtualAuthenticatorEnvironmentEnabled=42]="VirtualAuthenticatorEnvironmentEnabled",e[e.SourceOrderViewActivated=43]="SourceOrderViewActivated",e[e.UserShortcutAdded=44]="UserShortcutAdded",e[e.ShortcutRemoved=45]="ShortcutRemoved",e[e.ShortcutModified=46]="ShortcutModified",e[e.CustomPropertyLinkClicked=47]="CustomPropertyLinkClicked",e[e.CustomPropertyEdited=48]="CustomPropertyEdited",e[e.ServiceWorkerNetworkRequestClicked=49]="ServiceWorkerNetworkRequestClicked",e[e.ServiceWorkerNetworkRequestClosedQuickly=50]="ServiceWorkerNetworkRequestClosedQuickly",e[e.NetworkPanelServiceWorkerRespondWith=51]="NetworkPanelServiceWorkerRespondWith",e[e.NetworkPanelCopyValue=52]="NetworkPanelCopyValue",e[e.ConsoleSidebarOpened=53]="ConsoleSidebarOpened",e[e.PerfPanelTraceImported=54]="PerfPanelTraceImported",e[e.PerfPanelTraceExported=55]="PerfPanelTraceExported",e[e.StackFrameRestarted=56]="StackFrameRestarted",e[e.CaptureTestProtocolClicked=57]="CaptureTestProtocolClicked",e[e.BreakpointRemovedFromRemoveButton=58]="BreakpointRemovedFromRemoveButton",e[e.BreakpointGroupExpandedStateChanged=59]="BreakpointGroupExpandedStateChanged",e[e.HeaderOverrideFileCreated=60]="HeaderOverrideFileCreated",e[e.HeaderOverrideEnableEditingClicked=61]="HeaderOverrideEnableEditingClicked",e[e.HeaderOverrideHeaderAdded=62]="HeaderOverrideHeaderAdded",e[e.HeaderOverrideHeaderEdited=63]="HeaderOverrideHeaderEdited",e[e.HeaderOverrideHeaderRemoved=64]="HeaderOverrideHeaderRemoved",e[e.HeaderOverrideHeadersFileEdited=65]="HeaderOverrideHeadersFileEdited",e[e.PersistenceNetworkOverridesEnabled=66]="PersistenceNetworkOverridesEnabled",e[e.PersistenceNetworkOverridesDisabled=67]="PersistenceNetworkOverridesDisabled",e[e.BreakpointRemovedFromContextMenu=68]="BreakpointRemovedFromContextMenu",e[e.BreakpointsInFileRemovedFromRemoveButton=69]="BreakpointsInFileRemovedFromRemoveButton",e[e.BreakpointsInFileRemovedFromContextMenu=70]="BreakpointsInFileRemovedFromContextMenu",e[e.BreakpointsInFileCheckboxToggled=71]="BreakpointsInFileCheckboxToggled",e[e.BreakpointsInFileEnabledDisabledFromContextMenu=72]="BreakpointsInFileEnabledDisabledFromContextMenu",e[e.BreakpointConditionEditedFromSidebar=73]="BreakpointConditionEditedFromSidebar",e[e.AddFileSystemToWorkspace=74]="AddFileSystemToWorkspace",e[e.RemoveFileSystemFromWorkspace=75]="RemoveFileSystemFromWorkspace",e[e.AddFileSystemForOverrides=76]="AddFileSystemForOverrides",e[e.RemoveFileSystemForOverrides=77]="RemoveFileSystemForOverrides",e[e.FileSystemSourceSelected=78]="FileSystemSourceSelected",e[e.OverridesSourceSelected=79]="OverridesSourceSelected",e[e.StyleSheetInitiatorLinkClicked=80]="StyleSheetInitiatorLinkClicked",e[e.MaxValue=81]="MaxValue"}(V||(V={})),function(e){e[e.elements=1]="elements",e[e.resources=2]="resources",e[e.network=3]="network",e[e.sources=4]="sources",e[e.timeline=5]="timeline",e[e.heap_profiler=6]="heap_profiler",e[e.console=8]="console",e[e.layers=9]="layers",e[e["console-view"]=10]="console-view",e[e.animations=11]="animations",e[e["network.config"]=12]="network.config",e[e.rendering=13]="rendering",e[e.sensors=14]="sensors",e[e["sources.search"]=15]="sources.search",e[e.security=16]="security",e[e.js_profiler=17]="js_profiler",e[e.lighthouse=18]="lighthouse",e[e.coverage=19]="coverage",e[e["protocol-monitor"]=20]="protocol-monitor",e[e["remote-devices"]=21]="remote-devices",e[e["web-audio"]=22]="web-audio",e[e["changes.changes"]=23]="changes.changes",e[e["performance.monitor"]=24]="performance.monitor",e[e["release-note"]=25]="release-note",e[e.live_heap_profile=26]="live_heap_profile",e[e["sources.quick"]=27]="sources.quick",e[e["network.blocked-urls"]=28]="network.blocked-urls",e[e["settings-preferences"]=29]="settings-preferences",e[e["settings-workspace"]=30]="settings-workspace",e[e["settings-experiments"]=31]="settings-experiments",e[e["settings-blackbox"]=32]="settings-blackbox",e[e["settings-devices"]=33]="settings-devices",e[e["settings-throttling-conditions"]=34]="settings-throttling-conditions",e[e["settings-emulation-locations"]=35]="settings-emulation-locations",e[e["settings-shortcuts"]=36]="settings-shortcuts",e[e["issues-pane"]=37]="issues-pane",e[e["settings-keybinds"]=38]="settings-keybinds",e[e.cssoverview=39]="cssoverview",e[e.chrome_recorder=40]="chrome_recorder",e[e.trust_tokens=41]="trust_tokens",e[e.reporting_api=42]="reporting_api",e[e.interest_groups=43]="interest_groups",e[e.back_forward_cache=44]="back_forward_cache",e[e.service_worker_cache=45]="service_worker_cache",e[e.background_service_backgroundFetch=46]="background_service_backgroundFetch",e[e.background_service_backgroundSync=47]="background_service_backgroundSync",e[e.background_service_pushMessaging=48]="background_service_pushMessaging",e[e.background_service_notifications=49]="background_service_notifications",e[e.background_service_paymentHandler=50]="background_service_paymentHandler",e[e.background_service_periodicBackgroundSync=51]="background_service_periodicBackgroundSync",e[e.service_workers=52]="service_workers",e[e.app_manifest=53]="app_manifest",e[e.storage=54]="storage",e[e.cookies=55]="cookies",e[e.frame_details=56]="frame_details",e[e.frame_resource=57]="frame_resource",e[e.frame_window=58]="frame_window",e[e.frame_worker=59]="frame_worker",e[e.dom_storage=60]="dom_storage",e[e.indexed_db=61]="indexed_db",e[e.web_sql=62]="web_sql",e[e.performance_insights=63]="performance_insights",e[e.preloading=64]="preloading",e[e.bounce_tracking_mitigations=65]="bounce_tracking_mitigations",e[e.MaxValue=66]="MaxValue"}(O||(O={})),function(e){e[e.OtherSidebarPane=0]="OtherSidebarPane",e[e.Styles=1]="Styles",e[e.Computed=2]="Computed",e[e["elements.layout"]=3]="elements.layout",e[e["elements.eventListeners"]=4]="elements.eventListeners",e[e["elements.domBreakpoints"]=5]="elements.domBreakpoints",e[e["elements.domProperties"]=6]="elements.domProperties",e[e["accessibility.view"]=7]="accessibility.view",e[e.MaxValue=8]="MaxValue"}(H||(H={})),function(e){e[e.OtherSidebarPane=0]="OtherSidebarPane",e[e["navigator-network"]=1]="navigator-network",e[e["navigator-files"]=2]="navigator-files",e[e["navigator-overrides"]=3]="navigator-overrides",e[e["navigator-contentScripts"]=4]="navigator-contentScripts",e[e["navigator-snippets"]=5]="navigator-snippets",e[e.MaxValue=6]="MaxValue"}(N||(N={})),function(e){e[e.Unknown=0]="Unknown",e[e["text/css"]=2]="text/css",e[e["text/html"]=3]="text/html",e[e["application/xml"]=4]="application/xml",e[e["application/wasm"]=5]="application/wasm",e[e["application/manifest+json"]=6]="application/manifest+json",e[e["application/x-aspx"]=7]="application/x-aspx",e[e["application/jsp"]=8]="application/jsp",e[e["text/x-c++src"]=9]="text/x-c++src",e[e["text/x-coffeescript"]=10]="text/x-coffeescript",e[e["application/vnd.dart"]=11]="application/vnd.dart",e[e["text/typescript"]=12]="text/typescript",e[e["text/typescript-jsx"]=13]="text/typescript-jsx",e[e["application/json"]=14]="application/json",e[e["text/x-csharp"]=15]="text/x-csharp",e[e["text/x-java"]=16]="text/x-java",e[e["text/x-less"]=17]="text/x-less",e[e["application/x-httpd-php"]=18]="application/x-httpd-php",e[e["text/x-python"]=19]="text/x-python",e[e["text/x-sh"]=20]="text/x-sh",e[e["text/x-gss"]=21]="text/x-gss",e[e["text/x-sass"]=22]="text/x-sass",e[e["text/x-scss"]=23]="text/x-scss",e[e["text/markdown"]=24]="text/markdown",e[e["text/x-clojure"]=25]="text/x-clojure",e[e["text/jsx"]=26]="text/jsx",e[e["text/x-go"]=27]="text/x-go",e[e["text/x-kotlin"]=28]="text/x-kotlin",e[e["text/x-scala"]=29]="text/x-scala",e[e["text/x.svelte"]=30]="text/x.svelte",e[e["text/javascript+plain"]=31]="text/javascript+plain",e[e["text/javascript+minified"]=32]="text/javascript+minified",e[e["text/javascript+sourcemapped"]=33]="text/javascript+sourcemapped",e[e["text/x.angular"]=34]="text/x.angular",e[e["text/x.vue"]=35]="text/x.vue",e[e.MaxValue=36]="MaxValue"}(_||(_={})),function(e){e[e.devToolsDefault=0]="devToolsDefault",e[e.vsCode=1]="vsCode",e[e.MaxValue=2]="MaxValue"}(W||(W={})),function(e){e[e.OtherShortcut=0]="OtherShortcut",e[e["commandMenu.show"]=1]="commandMenu.show",e[e["console.clear"]=2]="console.clear",e[e["console.show"]=3]="console.show",e[e["debugger.step"]=4]="debugger.step",e[e["debugger.step-into"]=5]="debugger.step-into",e[e["debugger.step-out"]=6]="debugger.step-out",e[e["debugger.step-over"]=7]="debugger.step-over",e[e["debugger.toggle-breakpoint"]=8]="debugger.toggle-breakpoint",e[e["debugger.toggle-breakpoint-enabled"]=9]="debugger.toggle-breakpoint-enabled",e[e["debugger.toggle-pause"]=10]="debugger.toggle-pause",e[e["elements.edit-as-html"]=11]="elements.edit-as-html",e[e["elements.hide-element"]=12]="elements.hide-element",e[e["elements.redo"]=13]="elements.redo",e[e["elements.toggle-element-search"]=14]="elements.toggle-element-search",e[e["elements.undo"]=15]="elements.undo",e[e["main.search-in-panel.find"]=16]="main.search-in-panel.find",e[e["main.toggle-drawer"]=17]="main.toggle-drawer",e[e["network.hide-request-details"]=18]="network.hide-request-details",e[e["network.search"]=19]="network.search",e[e["network.toggle-recording"]=20]="network.toggle-recording",e[e["quickOpen.show"]=21]="quickOpen.show",e[e["settings.show"]=22]="settings.show",e[e["sources.search"]=23]="sources.search",e[e["background-service.toggle-recording"]=24]="background-service.toggle-recording",e[e["components.collect-garbage"]=25]="components.collect-garbage",e[e["console.clear.history"]=26]="console.clear.history",e[e["console.create-pin"]=27]="console.create-pin",e[e["coverage.start-with-reload"]=28]="coverage.start-with-reload",e[e["coverage.toggle-recording"]=29]="coverage.toggle-recording",e[e["debugger.breakpoint-input-window"]=30]="debugger.breakpoint-input-window",e[e["debugger.evaluate-selection"]=31]="debugger.evaluate-selection",e[e["debugger.next-call-frame"]=32]="debugger.next-call-frame",e[e["debugger.previous-call-frame"]=33]="debugger.previous-call-frame",e[e["debugger.run-snippet"]=34]="debugger.run-snippet",e[e["debugger.toggle-breakpoints-active"]=35]="debugger.toggle-breakpoints-active",e[e["elements.capture-area-screenshot"]=36]="elements.capture-area-screenshot",e[e["emulation.capture-full-height-screenshot"]=37]="emulation.capture-full-height-screenshot",e[e["emulation.capture-node-screenshot"]=38]="emulation.capture-node-screenshot",e[e["emulation.capture-screenshot"]=39]="emulation.capture-screenshot",e[e["emulation.show-sensors"]=40]="emulation.show-sensors",e[e["emulation.toggle-device-mode"]=41]="emulation.toggle-device-mode",e[e["help.release-notes"]=42]="help.release-notes",e[e["help.report-issue"]=43]="help.report-issue",e[e["input.start-replaying"]=44]="input.start-replaying",e[e["input.toggle-pause"]=45]="input.toggle-pause",e[e["input.toggle-recording"]=46]="input.toggle-recording",e[e["inspector_main.focus-debuggee"]=47]="inspector_main.focus-debuggee",e[e["inspector_main.hard-reload"]=48]="inspector_main.hard-reload",e[e["inspector_main.reload"]=49]="inspector_main.reload",e[e["live-heap-profile.start-with-reload"]=50]="live-heap-profile.start-with-reload",e[e["live-heap-profile.toggle-recording"]=51]="live-heap-profile.toggle-recording",e[e["main.debug-reload"]=52]="main.debug-reload",e[e["main.next-tab"]=53]="main.next-tab",e[e["main.previous-tab"]=54]="main.previous-tab",e[e["main.search-in-panel.cancel"]=55]="main.search-in-panel.cancel",e[e["main.search-in-panel.find-next"]=56]="main.search-in-panel.find-next",e[e["main.search-in-panel.find-previous"]=57]="main.search-in-panel.find-previous",e[e["main.toggle-dock"]=58]="main.toggle-dock",e[e["main.zoom-in"]=59]="main.zoom-in",e[e["main.zoom-out"]=60]="main.zoom-out",e[e["main.zoom-reset"]=61]="main.zoom-reset",e[e["network-conditions.network-low-end-mobile"]=62]="network-conditions.network-low-end-mobile",e[e["network-conditions.network-mid-tier-mobile"]=63]="network-conditions.network-mid-tier-mobile",e[e["network-conditions.network-offline"]=64]="network-conditions.network-offline",e[e["network-conditions.network-online"]=65]="network-conditions.network-online",e[e["profiler.heap-toggle-recording"]=66]="profiler.heap-toggle-recording",e[e["profiler.js-toggle-recording"]=67]="profiler.js-toggle-recording",e[e["resources.clear"]=68]="resources.clear",e[e["settings.documentation"]=69]="settings.documentation",e[e["settings.shortcuts"]=70]="settings.shortcuts",e[e["sources.add-folder-to-workspace"]=71]="sources.add-folder-to-workspace",e[e["sources.add-to-watch"]=72]="sources.add-to-watch",e[e["sources.close-all"]=73]="sources.close-all",e[e["sources.close-editor-tab"]=74]="sources.close-editor-tab",e[e["sources.create-snippet"]=75]="sources.create-snippet",e[e["sources.go-to-line"]=76]="sources.go-to-line",e[e["sources.go-to-member"]=77]="sources.go-to-member",e[e["sources.jump-to-next-location"]=78]="sources.jump-to-next-location",e[e["sources.jump-to-previous-location"]=79]="sources.jump-to-previous-location",e[e["sources.rename"]=80]="sources.rename",e[e["sources.save"]=81]="sources.save",e[e["sources.save-all"]=82]="sources.save-all",e[e["sources.switch-file"]=83]="sources.switch-file",e[e["timeline.jump-to-next-frame"]=84]="timeline.jump-to-next-frame",e[e["timeline.jump-to-previous-frame"]=85]="timeline.jump-to-previous-frame",e[e["timeline.load-from-file"]=86]="timeline.load-from-file",e[e["timeline.next-recording"]=87]="timeline.next-recording",e[e["timeline.previous-recording"]=88]="timeline.previous-recording",e[e["timeline.record-reload"]=89]="timeline.record-reload",e[e["timeline.save-to-file"]=90]="timeline.save-to-file",e[e["timeline.show-history"]=91]="timeline.show-history",e[e["timeline.toggle-recording"]=92]="timeline.toggle-recording",e[e["sources.increment-css"]=93]="sources.increment-css",e[e["sources.increment-css-by-ten"]=94]="sources.increment-css-by-ten",e[e["sources.decrement-css"]=95]="sources.decrement-css",e[e["sources.decrement-css-by-ten"]=96]="sources.decrement-css-by-ten",e[e["layers.reset-view"]=97]="layers.reset-view",e[e["layers.pan-mode"]=98]="layers.pan-mode",e[e["layers.rotate-mode"]=99]="layers.rotate-mode",e[e["layers.zoom-in"]=100]="layers.zoom-in",e[e["layers.zoom-out"]=101]="layers.zoom-out",e[e["layers.up"]=102]="layers.up",e[e["layers.down"]=103]="layers.down",e[e["layers.left"]=104]="layers.left",e[e["layers.right"]=105]="layers.right",e[e["help.report-translation-issue"]=106]="help.report-translation-issue",e[e["rendering.toggle-prefers-color-scheme"]=107]="rendering.toggle-prefers-color-scheme",e[e["chrome_recorder.start-recording"]=108]="chrome_recorder.start-recording",e[e["chrome_recorder.replay-recording"]=109]="chrome_recorder.replay-recording",e[e["chrome_recorder.toggle-code-view"]=110]="chrome_recorder.toggle-code-view",e[e["chrome_recorder.copy-recording-or-step"]=111]="chrome_recorder.copy-recording-or-step",e[e.MaxValue=112]="MaxValue"}(U||(U={})),function(e){e[e.ConsoleInfoBar=0]="ConsoleInfoBar",e[e.LearnMoreLinkCOEP=1]="LearnMoreLinkCOEP",e[e.StatusBarIssuesCounter=2]="StatusBarIssuesCounter",e[e.HamburgerMenu=3]="HamburgerMenu",e[e.Adorner=4]="Adorner",e[e.CommandMenu=5]="CommandMenu",e[e.MaxValue=6]="MaxValue"}(B||(B={})),function(e){e[e.applyCustomStylesheet=0]="applyCustomStylesheet",e[e.captureNodeCreationStacks=1]="captureNodeCreationStacks",e[e.sourcesPrettyPrint=2]="sourcesPrettyPrint",e[e.liveHeapProfile=11]="liveHeapProfile",e[e.protocolMonitor=13]="protocolMonitor",e[e.developerResourcesView=15]="developerResourcesView",e[e.samplingHeapProfilerTimeline=17]="samplingHeapProfilerTimeline",e[e.showOptionToExposeInternalsInHeapSnapshot=18]="showOptionToExposeInternalsInHeapSnapshot",e[e.sourceOrderViewer=20]="sourceOrderViewer",e[e.webauthnPane=22]="webauthnPane",e[e.timelineEventInitiators=24]="timelineEventInitiators",e[e.timelineInvalidationTracking=26]="timelineInvalidationTracking",e[e.timelineShowAllEvents=27]="timelineShowAllEvents",e[e.timelineV8RuntimeCallStats=28]="timelineV8RuntimeCallStats",e[e.wasmDWARFDebugging=31]="wasmDWARFDebugging",e[e.dualScreenSupport=32]="dualScreenSupport",e[e.keyboardShortcutEditor=35]="keyboardShortcutEditor",e[e.APCA=39]="APCA",e[e.cspViolationsView=40]="cspViolationsView",e[e.fontEditor=41]="fontEditor",e[e.fullAccessibilityTree=42]="fullAccessibilityTree",e[e.ignoreListJSFramesOnTimeline=43]="ignoreListJSFramesOnTimeline",e[e.contrastIssues=44]="contrastIssues",e[e.experimentalCookieFeatures=45]="experimentalCookieFeatures",e[e.cssTypeComponentLength=52]="cssTypeComponentLength",e[e.preciseChanges=53]="preciseChanges",e[e.bfcacheDisplayTree=54]="bfcacheDisplayTree",e[e.stylesPaneCSSChanges=55]="stylesPaneCSSChanges",e[e.headerOverrides=56]="headerOverrides",e[e.evaluateExpressionsWithSourceMaps=58]="evaluateExpressionsWithSourceMaps",e[e.eyedropperColorPicker=60]="eyedropperColorPicker",e[e.instrumentationBreakpoints=61]="instrumentationBreakpoints",e[e.authoredDeployedGrouping=63]="authoredDeployedGrouping",e[e.importantDOMProperties=64]="importantDOMProperties",e[e.justMyCode=65]="justMyCode",e[e.timelineAsConsoleProfileResultPanel=67]="timelineAsConsoleProfileResultPanel",e[e.preloadingStatusPanel=68]="preloadingStatusPanel",e[e.disableColorFormatSetting=69]="disableColorFormatSetting",e[e.outermostTargetSelector=71]="outermostTargetSelector",e[e.jsProfilerTemporarilyEnable=72]="jsProfilerTemporarilyEnable",e[e.highlightErrorsElementsPanel=73]="highlightErrorsElementsPanel",e[e.setAllBreakpointsEagerly=74]="setAllBreakpointsEagerly",e[e.MaxValue=75]="MaxValue"}(j||(j={})),function(e){e[e.CrossOriginEmbedderPolicy=0]="CrossOriginEmbedderPolicy",e[e.MixedContent=1]="MixedContent",e[e.Cookie=2]="Cookie",e[e.HeavyAd=3]="HeavyAd",e[e.ContentSecurityPolicy=4]="ContentSecurityPolicy",e[e.Other=5]="Other",e[e.Generic=6]="Generic",e[e.MaxValue=7]="MaxValue"}(G||(G={})),function(e){e[e.CrossOriginEmbedderPolicyRequest=0]="CrossOriginEmbedderPolicyRequest",e[e.CrossOriginEmbedderPolicyElement=1]="CrossOriginEmbedderPolicyElement",e[e.MixedContentRequest=2]="MixedContentRequest",e[e.SameSiteCookieCookie=3]="SameSiteCookieCookie",e[e.SameSiteCookieRequest=4]="SameSiteCookieRequest",e[e.HeavyAdElement=5]="HeavyAdElement",e[e.ContentSecurityPolicyDirective=6]="ContentSecurityPolicyDirective",e[e.ContentSecurityPolicyElement=7]="ContentSecurityPolicyElement",e[e.CrossOriginEmbedderPolicyLearnMore=8]="CrossOriginEmbedderPolicyLearnMore",e[e.MixedContentLearnMore=9]="MixedContentLearnMore",e[e.SameSiteCookieLearnMore=10]="SameSiteCookieLearnMore",e[e.HeavyAdLearnMore=11]="HeavyAdLearnMore",e[e.ContentSecurityPolicyLearnMore=12]="ContentSecurityPolicyLearnMore",e[e.MaxValue=13]="MaxValue"}(z||(z={})),function(e){e[e.MixedContentIssue=0]="MixedContentIssue",e[e["ContentSecurityPolicyIssue::kInlineViolation"]=1]="ContentSecurityPolicyIssue::kInlineViolation",e[e["ContentSecurityPolicyIssue::kEvalViolation"]=2]="ContentSecurityPolicyIssue::kEvalViolation",e[e["ContentSecurityPolicyIssue::kURLViolation"]=3]="ContentSecurityPolicyIssue::kURLViolation",e[e["ContentSecurityPolicyIssue::kTrustedTypesSinkViolation"]=4]="ContentSecurityPolicyIssue::kTrustedTypesSinkViolation",e[e["ContentSecurityPolicyIssue::kTrustedTypesPolicyViolation"]=5]="ContentSecurityPolicyIssue::kTrustedTypesPolicyViolation",e[e["HeavyAdIssue::NetworkTotalLimit"]=6]="HeavyAdIssue::NetworkTotalLimit",e[e["HeavyAdIssue::CpuTotalLimit"]=7]="HeavyAdIssue::CpuTotalLimit",e[e["HeavyAdIssue::CpuPeakLimit"]=8]="HeavyAdIssue::CpuPeakLimit",e[e["CrossOriginEmbedderPolicyIssue::CoepFrameResourceNeedsCoepHeader"]=9]="CrossOriginEmbedderPolicyIssue::CoepFrameResourceNeedsCoepHeader",e[e["CrossOriginEmbedderPolicyIssue::CoopSandboxedIFrameCannotNavigateToCoopPage"]=10]="CrossOriginEmbedderPolicyIssue::CoopSandboxedIFrameCannotNavigateToCoopPage",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameOrigin"]=11]="CrossOriginEmbedderPolicyIssue::CorpNotSameOrigin",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameOriginAfterDefaultedToSameOriginByCoep"]=12]="CrossOriginEmbedderPolicyIssue::CorpNotSameOriginAfterDefaultedToSameOriginByCoep",e[e["CrossOriginEmbedderPolicyIssue::CorpNotSameSite"]=13]="CrossOriginEmbedderPolicyIssue::CorpNotSameSite",e[e["CookieIssue::ExcludeSameSiteNoneInsecure::ReadCookie"]=14]="CookieIssue::ExcludeSameSiteNoneInsecure::ReadCookie",e[e["CookieIssue::ExcludeSameSiteNoneInsecure::SetCookie"]=15]="CookieIssue::ExcludeSameSiteNoneInsecure::SetCookie",e[e["CookieIssue::WarnSameSiteNoneInsecure::ReadCookie"]=16]="CookieIssue::WarnSameSiteNoneInsecure::ReadCookie",e[e["CookieIssue::WarnSameSiteNoneInsecure::SetCookie"]=17]="CookieIssue::WarnSameSiteNoneInsecure::SetCookie",e[e["CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Secure"]=18]="CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Secure",e[e["CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Insecure"]=19]="CookieIssue::WarnSameSiteStrictLaxDowngradeStrict::Insecure",e[e["CookieIssue::WarnCrossDowngrade::ReadCookie::Secure"]=20]="CookieIssue::WarnCrossDowngrade::ReadCookie::Secure",e[e["CookieIssue::WarnCrossDowngrade::ReadCookie::Insecure"]=21]="CookieIssue::WarnCrossDowngrade::ReadCookie::Insecure",e[e["CookieIssue::WarnCrossDowngrade::SetCookie::Secure"]=22]="CookieIssue::WarnCrossDowngrade::SetCookie::Secure",e[e["CookieIssue::WarnCrossDowngrade::SetCookie::Insecure"]=23]="CookieIssue::WarnCrossDowngrade::SetCookie::Insecure",e[e["CookieIssue::ExcludeNavigationContextDowngrade::Secure"]=24]="CookieIssue::ExcludeNavigationContextDowngrade::Secure",e[e["CookieIssue::ExcludeNavigationContextDowngrade::Insecure"]=25]="CookieIssue::ExcludeNavigationContextDowngrade::Insecure",e[e["CookieIssue::ExcludeContextDowngrade::ReadCookie::Secure"]=26]="CookieIssue::ExcludeContextDowngrade::ReadCookie::Secure",e[e["CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure"]=27]="CookieIssue::ExcludeContextDowngrade::ReadCookie::Insecure",e[e["CookieIssue::ExcludeContextDowngrade::SetCookie::Secure"]=28]="CookieIssue::ExcludeContextDowngrade::SetCookie::Secure",e[e["CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure"]=29]="CookieIssue::ExcludeContextDowngrade::SetCookie::Insecure",e[e["CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::ReadCookie"]=30]="CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::ReadCookie",e[e["CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::SetCookie"]=31]="CookieIssue::ExcludeSameSiteUnspecifiedTreatedAsLax::SetCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie"]=32]="CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::ReadCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::SetCookie"]=33]="CookieIssue::WarnSameSiteUnspecifiedLaxAllowUnsafe::SetCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::ReadCookie"]=34]="CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::ReadCookie",e[e["CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::SetCookie"]=35]="CookieIssue::WarnSameSiteUnspecifiedCrossSiteContext::SetCookie",e[e["SharedArrayBufferIssue::TransferIssue"]=36]="SharedArrayBufferIssue::TransferIssue",e[e["SharedArrayBufferIssue::CreationIssue"]=37]="SharedArrayBufferIssue::CreationIssue",e[e.LowTextContrastIssue=41]="LowTextContrastIssue",e[e["CorsIssue::InsecurePrivateNetwork"]=42]="CorsIssue::InsecurePrivateNetwork",e[e["CorsIssue::InvalidHeaders"]=44]="CorsIssue::InvalidHeaders",e[e["CorsIssue::WildcardOriginWithCredentials"]=45]="CorsIssue::WildcardOriginWithCredentials",e[e["CorsIssue::PreflightResponseInvalid"]=46]="CorsIssue::PreflightResponseInvalid",e[e["CorsIssue::OriginMismatch"]=47]="CorsIssue::OriginMismatch",e[e["CorsIssue::AllowCredentialsRequired"]=48]="CorsIssue::AllowCredentialsRequired",e[e["CorsIssue::MethodDisallowedByPreflightResponse"]=49]="CorsIssue::MethodDisallowedByPreflightResponse",e[e["CorsIssue::HeaderDisallowedByPreflightResponse"]=50]="CorsIssue::HeaderDisallowedByPreflightResponse",e[e["CorsIssue::RedirectContainsCredentials"]=51]="CorsIssue::RedirectContainsCredentials",e[e["CorsIssue::DisallowedByMode"]=52]="CorsIssue::DisallowedByMode",e[e["CorsIssue::CorsDisabledScheme"]=53]="CorsIssue::CorsDisabledScheme",e[e["CorsIssue::PreflightMissingAllowExternal"]=54]="CorsIssue::PreflightMissingAllowExternal",e[e["CorsIssue::PreflightInvalidAllowExternal"]=55]="CorsIssue::PreflightInvalidAllowExternal",e[e["CorsIssue::NoCorsRedirectModeNotFollow"]=57]="CorsIssue::NoCorsRedirectModeNotFollow",e[e["QuirksModeIssue::QuirksMode"]=58]="QuirksModeIssue::QuirksMode",e[e["QuirksModeIssue::LimitedQuirksMode"]=59]="QuirksModeIssue::LimitedQuirksMode",e[e.DeprecationIssue=60]="DeprecationIssue",e[e["ClientHintIssue::MetaTagAllowListInvalidOrigin"]=61]="ClientHintIssue::MetaTagAllowListInvalidOrigin",e[e["ClientHintIssue::MetaTagModifiedHTML"]=62]="ClientHintIssue::MetaTagModifiedHTML",e[e["CorsIssue::PreflightAllowPrivateNetworkError"]=63]="CorsIssue::PreflightAllowPrivateNetworkError",e[e["GenericIssue::CrossOriginPortalPostMessageError"]=64]="GenericIssue::CrossOriginPortalPostMessageError",e[e["GenericIssue::FormLabelForNameError"]=65]="GenericIssue::FormLabelForNameError",e[e["GenericIssue::FormDuplicateIdForInputError"]=66]="GenericIssue::FormDuplicateIdForInputError",e[e["GenericIssue::FormInputWithNoLabelError"]=67]="GenericIssue::FormInputWithNoLabelError",e[e["GenericIssue::FormAutocompleteAttributeEmptyError"]=68]="GenericIssue::FormAutocompleteAttributeEmptyError",e[e["GenericIssue::FormEmptyIdAndNameAttributesForInputError"]=69]="GenericIssue::FormEmptyIdAndNameAttributesForInputError",e[e["GenericIssue::FormAriaLabelledByToNonExistingId"]=70]="GenericIssue::FormAriaLabelledByToNonExistingId",e[e["GenericIssue::FormInputAssignedAutocompleteValueToIdOrNameAttributeError"]=71]="GenericIssue::FormInputAssignedAutocompleteValueToIdOrNameAttributeError",e[e["GenericIssue::FormLabelHasNeitherForNorNestedInput"]=72]="GenericIssue::FormLabelHasNeitherForNorNestedInput",e[e["GenericIssue::FormLabelForMatchesNonExistingIdError"]=73]="GenericIssue::FormLabelForMatchesNonExistingIdError",e[e["GenericIssue::FormHasPasswordFieldWithoutUsernameFieldError"]=74]="GenericIssue::FormHasPasswordFieldWithoutUsernameFieldError",e[e["GenericIssue::FormInputHasWrongButWellIntendedAutocompleteValueError"]=75]="GenericIssue::FormInputHasWrongButWellIntendedAutocompleteValueError",e[e["StylesheetLoadingIssue::LateImportRule"]=76]="StylesheetLoadingIssue::LateImportRule",e[e["StylesheetLoadingIssue::RequestFailed"]=77]="StylesheetLoadingIssue::RequestFailed",e[e.MaxValue=78]="MaxValue"}(q||(q={})),function(e){e[e.LoadThroughPageViaTarget=0]="LoadThroughPageViaTarget",e[e.LoadThroughPageViaFrame=1]="LoadThroughPageViaFrame",e[e.LoadThroughPageFailure=2]="LoadThroughPageFailure",e[e.LoadThroughPageFallback=3]="LoadThroughPageFallback",e[e.FallbackAfterFailure=4]="FallbackAfterFailure",e[e.FallbackPerOverride=5]="FallbackPerOverride",e[e.FallbackPerProtocol=6]="FallbackPerProtocol",e[e.FallbackFailure=7]="FallbackFailure",e[e.MaxValue=8]="MaxValue"}(J||(J={})),function(e){e[e.SchemeOther=0]="SchemeOther",e[e.SchemeUnknown=1]="SchemeUnknown",e[e.SchemeHttp=2]="SchemeHttp",e[e.SchemeHttps=3]="SchemeHttps",e[e.SchemeHttpLocalhost=4]="SchemeHttpLocalhost",e[e.SchemeHttpsLocalhost=5]="SchemeHttpsLocalhost",e[e.SchemeData=6]="SchemeData",e[e.SchemeFile=7]="SchemeFile",e[e.SchemeBlob=8]="SchemeBlob",e[e.MaxValue=9]="MaxValue"}(K||(K={})),function(e){e[e.ContextMenu=0]="ContextMenu",e[e.MemoryIcon=1]="MemoryIcon",e[e.MaxValue=2]="MaxValue"}(Q||(Q={})),function(e){e[e.DWARFInspectableAddress=0]="DWARFInspectableAddress",e[e.ArrayBuffer=1]="ArrayBuffer",e[e.DataView=2]="DataView",e[e.TypedArray=3]="TypedArray",e[e.WebAssemblyMemory=4]="WebAssemblyMemory",e[e.MaxValue=5]="MaxValue"}(X||(X={})),function(e){e[e.af=1]="af",e[e.am=2]="am",e[e.ar=3]="ar",e[e.as=4]="as",e[e.az=5]="az",e[e.be=6]="be",e[e.bg=7]="bg",e[e.bn=8]="bn",e[e.bs=9]="bs",e[e.ca=10]="ca",e[e.cs=11]="cs",e[e.cy=12]="cy",e[e.da=13]="da",e[e.de=14]="de",e[e.el=15]="el",e[e["en-GB"]=16]="en-GB",e[e["en-US"]=17]="en-US",e[e["es-419"]=18]="es-419",e[e.es=19]="es",e[e.et=20]="et",e[e.eu=21]="eu",e[e.fa=22]="fa",e[e.fi=23]="fi",e[e.fil=24]="fil",e[e["fr-CA"]=25]="fr-CA",e[e.fr=26]="fr",e[e.gl=27]="gl",e[e.gu=28]="gu",e[e.he=29]="he",e[e.hi=30]="hi",e[e.hr=31]="hr",e[e.hu=32]="hu",e[e.hy=33]="hy",e[e.id=34]="id",e[e.is=35]="is",e[e.it=36]="it",e[e.ja=37]="ja",e[e.ka=38]="ka",e[e.kk=39]="kk",e[e.km=40]="km",e[e.kn=41]="kn",e[e.ko=42]="ko",e[e.ky=43]="ky",e[e.lo=44]="lo",e[e.lt=45]="lt",e[e.lv=46]="lv",e[e.mk=47]="mk",e[e.ml=48]="ml",e[e.mn=49]="mn",e[e.mr=50]="mr",e[e.ms=51]="ms",e[e.my=52]="my",e[e.ne=53]="ne",e[e.nl=54]="nl",e[e.no=55]="no",e[e.or=56]="or",e[e.pa=57]="pa",e[e.pl=58]="pl",e[e["pt-PT"]=59]="pt-PT",e[e.pt=60]="pt",e[e.ro=61]="ro",e[e.ru=62]="ru",e[e.si=63]="si",e[e.sk=64]="sk",e[e.sl=65]="sl",e[e.sq=66]="sq",e[e["sr-Latn"]=67]="sr-Latn",e[e.sr=68]="sr",e[e.sv=69]="sv",e[e.sw=70]="sw",e[e.ta=71]="ta",e[e.te=72]="te",e[e.th=73]="th",e[e.tr=74]="tr",e[e.uk=75]="uk",e[e.ur=76]="ur",e[e.uz=77]="uz",e[e.vi=78]="vi",e[e.zh=79]="zh",e[e["zh-HK"]=80]="zh-HK",e[e["zh-TW"]=81]="zh-TW",e[e.zu=82]="zu",e[e.MaxValue=83]="MaxValue"}(Z||(Z={})),function(e){e[e.ChromeSyncDisabled=1]="ChromeSyncDisabled",e[e.ChromeSyncSettingsDisabled=2]="ChromeSyncSettingsDisabled",e[e.DevToolsSyncSettingDisabled=3]="DevToolsSyncSettingDisabled",e[e.DevToolsSyncSettingEnabled=4]="DevToolsSyncSettingEnabled",e[e.MaxValue=5]="MaxValue"}($||($={})),function(e){e[e.RecordingStarted=1]="RecordingStarted",e[e.RecordingFinished=2]="RecordingFinished",e[e.MaxValue=3]="MaxValue"}(Y||(Y={})),function(e){e[e.AssertionAdded=1]="AssertionAdded",e[e.PropertyAssertionEdited=2]="PropertyAssertionEdited",e[e.AttributeAssertionEdited=3]="AttributeAssertionEdited",e[e.MaxValue=4]="MaxValue"}(ee||(ee={})),function(e){e[e.Success=1]="Success",e[e.TimeoutErrorSelectors=2]="TimeoutErrorSelectors",e[e.TimeoutErrorTarget=3]="TimeoutErrorTarget",e[e.OtherError=4]="OtherError",e[e.MaxValue=5]="MaxValue"}(oe||(oe={})),function(e){e[e.Normal=1]="Normal",e[e.Slow=2]="Slow",e[e.VerySlow=3]="VerySlow",e[e.ExtremelySlow=4]="ExtremelySlow",e[e.MaxValue=5]="MaxValue"}(re||(re={})),function(e){e[e.ReplayOnly=1]="ReplayOnly",e[e.ReplayWithPerformanceTracing=2]="ReplayWithPerformanceTracing",e[e.ReplayViaExtension=3]="ReplayViaExtension",e[e.MaxValue=4]="MaxValue"}(te||(te={})),function(e){e[e.SelectorPickerUsed=1]="SelectorPickerUsed",e[e.StepAdded=2]="StepAdded",e[e.StepRemoved=3]="StepRemoved",e[e.SelectorAdded=4]="SelectorAdded",e[e.SelectorRemoved=5]="SelectorRemoved",e[e.SelectorPartAdded=6]="SelectorPartAdded",e[e.SelectorPartEdited=7]="SelectorPartEdited",e[e.SelectorPartRemoved=8]="SelectorPartRemoved",e[e.TypeChanged=9]="TypeChanged",e[e.OtherEditing=10]="OtherEditing",e[e.MaxValue=11]="MaxValue"}(ne||(ne={})),function(e){e[e.ToPuppeteer=1]="ToPuppeteer",e[e.ToJSON=2]="ToJSON",e[e.ToPuppeteerReplay=3]="ToPuppeteerReplay",e[e.ToExtension=4]="ToExtension",e[e.ToLighthouse=5]="ToLighthouse",e[e.MaxValue=6]="MaxValue"}(ie||(ie={})),function(e){e[e.CodeShown=1]="CodeShown",e[e.CodeHidden=2]="CodeHidden",e[e.MaxValue=3]="MaxValue"}(se||(se={})),function(e){e[e.CopiedRecordingWithPuppeteer=1]="CopiedRecordingWithPuppeteer",e[e.CopiedRecordingWithJSON=2]="CopiedRecordingWithJSON",e[e.CopiedRecordingWithReplay=3]="CopiedRecordingWithReplay",e[e.CopiedRecordingWithExtension=4]="CopiedRecordingWithExtension",e[e.CopiedStepWithPuppeteer=5]="CopiedStepWithPuppeteer",e[e.CopiedStepWithJSON=6]="CopiedStepWithJSON",e[e.CopiedStepWithReplay=7]="CopiedStepWithReplay",e[e.CopiedStepWithExtension=8]="CopiedStepWithExtension",e[e.MaxValue=9]="MaxValue"}(ae||(ae={})),function(e){e[e.false=0]="false",e[e.true=1]="true",e[e.MaxValue=2]="MaxValue"}(de||(de={})),function(e){e[e.DeclarationViaChangedLine=1]="DeclarationViaChangedLine",e[e.AllChangesViaStylesPane=2]="AllChangesViaStylesPane",e[e.DeclarationViaContextMenu=3]="DeclarationViaContextMenu",e[e.PropertyViaContextMenu=4]="PropertyViaContextMenu",e[e.ValueViaContextMenu=5]="ValueViaContextMenu",e[e.DeclarationAsJSViaContextMenu=6]="DeclarationAsJSViaContextMenu",e[e.RuleViaContextMenu=7]="RuleViaContextMenu",e[e.AllDeclarationsViaContextMenu=8]="AllDeclarationsViaContextMenu",e[e.AllDeclarationsAsJSViaContextMenu=9]="AllDeclarationsAsJSViaContextMenu",e[e.SelectorViaContextMenu=10]="SelectorViaContextMenu",e[e.MaxValue=11]="MaxValue"}(le||(le={})),function(e){e[e.OtherSection=0]="OtherSection",e[e.Identity=1]="Identity",e[e.Presentation=2]="Presentation",e[e["Protocol Handlers"]=3]="Protocol Handlers",e[e.Icons=4]="Icons",e[e["Window Controls Overlay"]=5]="Window Controls Overlay",e[e.MaxValue=6]="MaxValue"}(ce||(ce={})),function(e){e[e.Other=0]="Other",e[e.AlignContent=1]="AlignContent",e[e.FlexItem=2]="FlexItem",e[e.FlexContainer=3]="FlexContainer",e[e.GridContainer=4]="GridContainer",e[e.GridItem=5]="GridItem",e[e.FlexGrid=6]="FlexGrid",e[e.MulticolFlexGrid=7]="MulticolFlexGrid",e[e.Padding=8]="Padding",e[e.Position=9]="Position",e[e.ZIndex=10]="ZIndex",e[e.Sizing=11]="Sizing",e[e.FlexOrGridItem=12]="FlexOrGridItem",e[e.FontVariationSettings=13]="FontVariationSettings",e[e.MaxValue=14]="MaxValue"}(ue||(ue={})),function(e){e[e.Navigation=0]="Navigation",e[e.Timespan=1]="Timespan",e[e.Snapshot=2]="Snapshot",e[e.LegacyNavigation=3]="LegacyNavigation",e[e.MaxValue=4]="MaxValue"}(me||(me={}));var Se=Object.freeze({__proto__:null,UserMetrics:pe,get Action(){return V},get PanelCodes(){return O},get ElementsSidebarTabCodes(){return H},get SourcesSidebarTabCodes(){return N},get MediaTypes(){return _},get KeybindSetSettings(){return W},get KeyboardShortcutAction(){return U},get IssueOpener(){return B},get DevtoolsExperiments(){return j},get IssueExpanded(){return G},get IssueResourceOpened(){return z},get IssueCreated(){return q},get DeveloperResourceLoaded(){return J},get DeveloperResourceScheme(){return K},get LinearMemoryInspectorRevealedFrom(){return Q},get LinearMemoryInspectorTarget(){return X},get Language(){return Z},get SyncSetting(){return $},get RecordingToggled(){return Y},get RecordingAssertion(){return ee},get RecordingReplayFinished(){return oe},get RecordingReplaySpeed(){return re},get RecordingReplayStarted(){return te},get RecordingEdited(){return ne},get RecordingExported(){return ie},get RecordingCodeToggled(){return se},get RecordingCopiedToClipboard(){return ae},get ConsoleShowsCorsErrors(){return de},get StyleTextCopied(){return le},get ManifestSectionCodes(){return ce},get CSSHintType(){return ue},get LighthouseModeRun(){return me}});const he=new pe,Ce=L();export{w as InspectorFrontendHost,a as InspectorFrontendHostAPI,F as Platform,ge as RNPerfMetrics,C as ResourceLoader,Se as UserMetrics,Ce as rnPerfMetrics,he as userMetrics}; diff --git a/packages/debugger-frontend/dist/third-party/front_end/core/root/root.js b/packages/debugger-frontend/dist/third-party/front_end/core/root/root.js index 2e25b5694d59ea..68f99c59f512ee 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/core/root/root.js +++ b/packages/debugger-frontend/dist/third-party/front_end/core/root/root.js @@ -1 +1 @@ -import*as e from"../platform/platform.js";const t=new URLSearchParams(location.search);let n,s="";class r{constructor(){}static instance(e={forceNew:null}){const{forceNew:t}=e;return n&&!t||(n=new r),n}static removeInstance(){n=void 0}static queryParam(e){return t.get(e)}static setQueryParamForTesting(e,n){t.set(e,n)}static experimentsSetting(){try{return JSON.parse(self.localStorage&&self.localStorage.experiments?self.localStorage.experiments:"{}")}catch(e){return console.error("Failed to parse localStorage['experiments']"),{}}}static setPlatform(e){s=e}static platform(){return s}static isDescriptorEnabled(e){const t=e.experiment;if("*"===t)return!0;if(t&&t.startsWith("!")&&l.isEnabled(t.substring(1)))return!1;if(t&&!t.startsWith("!")&&!l.isEnabled(t))return!1;const n=e.condition;return!(n&&!n.startsWith("!")&&!r.queryParam(n))&&!(n&&n.startsWith("!")&&r.queryParam(n.substring(1)))}loadLegacyModule(e){return import(`../../${e}`)}}class i{#e;#t;#n;#s;#r;#i;constructor(){this.#e=[],this.#t=new Set,this.#n=new Set,this.#s=new Set,this.#r=new Set,this.#i=new Set}allConfigurableExperiments(){const e=[];for(const t of this.#e)this.#n.has(t.name)||this.#i.has(t.name)||e.push(t);return e}enabledExperiments(){return this.#e.filter((e=>e.isEnabled()))}setExperimentsSetting(e){self.localStorage&&(self.localStorage.experiments=JSON.stringify(e))}register(t,n,s,r,i){this.#t.add(t),this.#e.push(new a(this,t,n,Boolean(s),r??e.DevToolsPath.EmptyUrlString,i??e.DevToolsPath.EmptyUrlString))}isEnabled(e){return this.checkExperiment(e),!1!==r.experimentsSetting()[e]&&(!(!this.#n.has(e)&&!this.#s.has(e))||(!!this.#r.has(e)||Boolean(r.experimentsSetting()[e])))}setEnabled(e,t){this.checkExperiment(e);const n=r.experimentsSetting();n[e]=t,this.setExperimentsSetting(n)}enableExperimentsTransiently(e){for(const t of e)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(const t of e)this.checkExperiment(t),this.#s.add(t)}setServerEnabledExperiments(e){for(const t of e)this.checkExperiment(t),this.#r.add(t)}setNonConfigurableExperiments(e){for(const t of e)this.checkExperiment(t),this.#i.add(t)}enableForTest(e){this.checkExperiment(e),this.#n.add(e)}disableForTest(e){this.checkExperiment(e),this.#n.delete(e)}clearForTest(){this.#e=[],this.#t.clear(),this.#n.clear(),this.#s.clear(),this.#r.clear()}cleanUpStaleExperiments(){const e=r.experimentsSetting(),t={};for(const{name:n}of this.#e)if(e.hasOwnProperty(n)){const s=e[n];(s||this.#s.has(n))&&(t[n]=s)}this.setExperimentsSetting(t)}checkExperiment(e){}}class a{name;title;unstable;docLink;feedbackLink;#e;constructor(e,t,n,s,r,i){this.name=t,this.title=n,this.unstable=s,this.docLink=r,this.feedbackLink=i,this.#e=e}isEnabled(){return this.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}const l=new i;var o,E;!function(e){e.CAPTURE_NODE_CREATION_STACKS="captureNodeCreationStacks",e.CSS_OVERVIEW="cssOverview",e.LIVE_HEAP_PROFILE="liveHeapProfile",e.DEVELOPER_RESOURCES_VIEW="developerResourcesView",e.CSP_VIOLATIONS_VIEW="cspViolationsView",e.WASM_DWARF_DEBUGGING="wasmDWARFDebugging",e.ALL="*",e.PROTOCOL_MONITOR="protocolMonitor",e.WEBAUTHN_PANE="webauthnPane",e.FULL_ACCESSIBILITY_TREE="fullAccessibilityTree",e.PRECISE_CHANGES="preciseChanges",e.STYLES_PANE_CSS_CHANGES="stylesPaneCSSChanges",e.HEADER_OVERRIDES="headerOverrides",e.EYEDROPPER_COLOR_PICKER="eyedropperColorPicker",e.INSTRUMENTATION_BREAKPOINTS="instrumentationBreakpoints",e.AUTHORED_DEPLOYED_GROUPING="authoredDeployedGrouping",e.IMPORTANT_DOM_PROPERTIES="importantDOMProperties",e.JUST_MY_CODE="justMyCode",e.PRELOADING_STATUS_PANEL="preloadingStatusPanel",e.DISABLE_COLOR_FORMAT_SETTING="disableColorFormatSetting",e.TIMELINE_AS_CONSOLE_PROFILE_RESULT_PANEL="timelineAsConsoleProfileResultPanel",e.OUTERMOST_TARGET_SELECTOR="outermostTargetSelector",e.JS_PROFILER_TEMP_ENABLE="jsProfilerTemporarilyEnable",e.HIGHLIGHT_ERRORS_ELEMENTS_PANEL="highlightErrorsElementsPanel",e.SET_ALL_BREAKPOINTS_EAGERLY="setAllBreakpointsEagerly",e.REACT_NATIVE_SPECIFIC_UI="reactNativeSpecificUI"}(o||(o={})),function(e){e.CAN_DOCK="can_dock",e.NOT_SOURCES_HIDE_ADD_FOLDER="!sources.hide_add_folder",e.REACT_NATIVE_UNSTABLE_NETWORK_PANEL="unstable_enableNetworkPanel"}(E||(E={}));var c=Object.freeze({__proto__:null,getRemoteBase:function(e=self.location.toString()){const t=new URL(e).searchParams.get("remoteBase");if(!t)return null;const n=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);return n?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},Runtime:r,ExperimentsSupport:i,Experiment:a,experiments:l,get ExperimentName(){return o},get ConditionName(){return E}});export{c as Runtime}; +import*as e from"../platform/platform.js";const t=new URLSearchParams(location.search);let n,s="";class r{constructor(){}static instance(e={forceNew:null}){const{forceNew:t}=e;return n&&!t||(n=new r),n}static removeInstance(){n=void 0}static queryParam(e){return t.get(e)}static setQueryParamForTesting(e,n){t.set(e,n)}static experimentsSetting(){try{return JSON.parse(self.localStorage&&self.localStorage.experiments?self.localStorage.experiments:"{}")}catch(e){return console.error("Failed to parse localStorage['experiments']"),{}}}static setPlatform(e){s=e}static platform(){return s}static isDescriptorEnabled(e){const t=e.experiment;if("*"===t)return!0;if(t&&t.startsWith("!")&&l.isEnabled(t.substring(1)))return!1;if(t&&!t.startsWith("!")&&!l.isEnabled(t))return!1;const n=e.condition;return!(n&&!n.startsWith("!")&&!r.queryParam(n))&&!(n&&n.startsWith("!")&&r.queryParam(n.substring(1)))}loadLegacyModule(e){return import(`../../${e}`)}}class i{#e;#t;#n;#s;#r;#i;constructor(){this.#e=[],this.#t=new Set,this.#n=new Set,this.#s=new Set,this.#r=new Set,this.#i=new Set}allConfigurableExperiments(){const e=[];for(const t of this.#e)this.#n.has(t.name)||this.#i.has(t.name)||e.push(t);return e}enabledExperiments(){return this.#e.filter((e=>e.isEnabled()))}setExperimentsSetting(e){self.localStorage&&(self.localStorage.experiments=JSON.stringify(e))}register(t,n,s,r,i){this.#t.add(t),this.#e.push(new a(this,t,n,Boolean(s),r??e.DevToolsPath.EmptyUrlString,i??e.DevToolsPath.EmptyUrlString))}isEnabled(e){return this.checkExperiment(e),!1!==r.experimentsSetting()[e]&&(!(!this.#n.has(e)&&!this.#s.has(e))||(!!this.#r.has(e)||Boolean(r.experimentsSetting()[e])))}setEnabled(e,t){this.checkExperiment(e);const n=r.experimentsSetting();n[e]=t,this.setExperimentsSetting(n)}enableExperimentsTransiently(e){for(const t of e)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(const t of e)this.checkExperiment(t),this.#s.add(t)}setServerEnabledExperiments(e){for(const t of e)this.checkExperiment(t),this.#r.add(t)}setNonConfigurableExperiments(e){for(const t of e)this.checkExperiment(t),this.#i.add(t)}enableForTest(e){this.checkExperiment(e),this.#n.add(e)}disableForTest(e){this.checkExperiment(e),this.#n.delete(e)}clearForTest(){this.#e=[],this.#t.clear(),this.#n.clear(),this.#s.clear(),this.#r.clear()}cleanUpStaleExperiments(){const e=r.experimentsSetting(),t={};for(const{name:n}of this.#e)if(e.hasOwnProperty(n)){const s=e[n];(s||this.#s.has(n))&&(t[n]=s)}this.setExperimentsSetting(t)}checkExperiment(e){}}class a{name;title;unstable;docLink;feedbackLink;#e;constructor(e,t,n,s,r,i){this.name=t,this.title=n,this.unstable=s,this.docLink=r,this.feedbackLink=i,this.#e=e}isEnabled(){return this.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}const l=new i;var o,E;!function(e){e.CAPTURE_NODE_CREATION_STACKS="captureNodeCreationStacks",e.CSS_OVERVIEW="cssOverview",e.LIVE_HEAP_PROFILE="liveHeapProfile",e.DEVELOPER_RESOURCES_VIEW="developerResourcesView",e.CSP_VIOLATIONS_VIEW="cspViolationsView",e.WASM_DWARF_DEBUGGING="wasmDWARFDebugging",e.ALL="*",e.PROTOCOL_MONITOR="protocolMonitor",e.WEBAUTHN_PANE="webauthnPane",e.FULL_ACCESSIBILITY_TREE="fullAccessibilityTree",e.PRECISE_CHANGES="preciseChanges",e.STYLES_PANE_CSS_CHANGES="stylesPaneCSSChanges",e.HEADER_OVERRIDES="headerOverrides",e.EYEDROPPER_COLOR_PICKER="eyedropperColorPicker",e.INSTRUMENTATION_BREAKPOINTS="instrumentationBreakpoints",e.AUTHORED_DEPLOYED_GROUPING="authoredDeployedGrouping",e.IMPORTANT_DOM_PROPERTIES="importantDOMProperties",e.JUST_MY_CODE="justMyCode",e.PRELOADING_STATUS_PANEL="preloadingStatusPanel",e.DISABLE_COLOR_FORMAT_SETTING="disableColorFormatSetting",e.TIMELINE_AS_CONSOLE_PROFILE_RESULT_PANEL="timelineAsConsoleProfileResultPanel",e.OUTERMOST_TARGET_SELECTOR="outermostTargetSelector",e.JS_PROFILER_TEMP_ENABLE="jsProfilerTemporarilyEnable",e.HIGHLIGHT_ERRORS_ELEMENTS_PANEL="highlightErrorsElementsPanel",e.SET_ALL_BREAKPOINTS_EAGERLY="setAllBreakpointsEagerly",e.REACT_NATIVE_SPECIFIC_UI="reactNativeSpecificUI",e.ENABLE_REACT_DEVTOOLS_PANEL="enableReactDevToolsPanel"}(o||(o={})),function(e){e.CAN_DOCK="can_dock",e.NOT_SOURCES_HIDE_ADD_FOLDER="!sources.hide_add_folder",e.REACT_NATIVE_UNSTABLE_NETWORK_PANEL="unstable_enableNetworkPanel"}(E||(E={}));var c=Object.freeze({__proto__:null,getRemoteBase:function(e=self.location.toString()){const t=new URL(e).searchParams.get("remoteBase");if(!t)return null;const n=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);return n?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},Runtime:r,ExperimentsSupport:i,Experiment:a,experiments:l,get ExperimentName(){return o},get ConditionName(){return E}});export{c as Runtime}; diff --git a/packages/debugger-frontend/dist/third-party/front_end/device_mode_emulation_frame.html b/packages/debugger-frontend/dist/third-party/front_end/device_mode_emulation_frame.html index b601a1db893ff1..2ad09ca33641a6 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/device_mode_emulation_frame.html +++ b/packages/debugger-frontend/dist/third-party/front_end/device_mode_emulation_frame.html @@ -17,5 +17,6 @@ + diff --git a/packages/debugger-frontend/dist/third-party/front_end/devtools_app.html b/packages/debugger-frontend/dist/third-party/front_end/devtools_app.html index d7ba2348c55833..f950e88b81c60b 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/devtools_app.html +++ b/packages/debugger-frontend/dist/third-party/front_end/devtools_app.html @@ -17,5 +17,6 @@ + diff --git a/packages/debugger-frontend/dist/third-party/front_end/entrypoints/rn_inspector/rn_inspector.js b/packages/debugger-frontend/dist/third-party/front_end/entrypoints/rn_inspector/rn_inspector.js index bb0bb42f6f5e6a..c6a66ccf962570 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/entrypoints/rn_inspector/rn_inspector.js +++ b/packages/debugger-frontend/dist/third-party/front_end/entrypoints/rn_inspector/rn_inspector.js @@ -1 +1 @@ -import"../shell/shell.js";import*as e from"../../core/common/common.js";import*as t from"../../core/root/root.js";import*as o from"../../ui/legacy/legacy.js";import*as i from"../../core/i18n/i18n.js";import*as n from"../../models/issues_manager/issues_manager.js";import*as a from"../../core/sdk/sdk.js";import*as r from"../../models/workspace/workspace.js";import*as s from"../../panels/network/forward/forward.js";import*as l from"../main/main.js";const c={toggleDeviceToolbar:"Toggle device toolbar",captureScreenshot:"Capture screenshot",captureFullSizeScreenshot:"Capture full size screenshot",captureNodeScreenshot:"Capture node screenshot",showMediaQueries:"Show media queries",device:"device",hideMediaQueries:"Hide media queries",showRulers:"Show rulers in the Device Mode toolbar",hideRulers:"Hide rulers in the Device Mode toolbar",showDeviceFrame:"Show device frame",hideDeviceFrame:"Hide device frame"},g=i.i18n.registerUIStrings("panels/emulation/emulation-meta.ts",c),d=i.i18n.getLazilyComputedLocalizedString.bind(void 0,g);let u;async function m(){return u||(u=await import("../../panels/emulation/emulation.js")),u}o.ActionRegistration.registerActionExtension({category:o.ActionRegistration.ActionCategory.MOBILE,actionId:"emulation.toggle-device-mode",toggleable:!0,loadActionDelegate:async()=>(await m()).DeviceModeWrapper.ActionDelegate.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,title:d(c.toggleDeviceToolbar),iconClass:"devices",bindings:[{platform:"windows,linux",shortcut:"Shift+Ctrl+M"},{platform:"mac",shortcut:"Shift+Meta+M"}]}),o.ActionRegistration.registerActionExtension({actionId:"emulation.capture-screenshot",category:o.ActionRegistration.ActionCategory.SCREENSHOT,loadActionDelegate:async()=>(await m()).DeviceModeWrapper.ActionDelegate.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,title:d(c.captureScreenshot)}),o.ActionRegistration.registerActionExtension({actionId:"emulation.capture-full-height-screenshot",category:o.ActionRegistration.ActionCategory.SCREENSHOT,loadActionDelegate:async()=>(await m()).DeviceModeWrapper.ActionDelegate.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,title:d(c.captureFullSizeScreenshot)}),o.ActionRegistration.registerActionExtension({actionId:"emulation.capture-node-screenshot",category:o.ActionRegistration.ActionCategory.SCREENSHOT,loadActionDelegate:async()=>(await m()).DeviceModeWrapper.ActionDelegate.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,title:d(c.captureNodeScreenshot)}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.MOBILE,settingName:"showMediaQueryInspector",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:d(c.showMediaQueries)},{value:!1,title:d(c.hideMediaQueries)}],tags:[d(c.device)]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.MOBILE,settingName:"emulation.showRulers",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:d(c.showRulers)},{value:!1,title:d(c.hideRulers)}],tags:[d(c.device)]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.MOBILE,settingName:"emulation.showDeviceOutline",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:d(c.showDeviceFrame)},{value:!1,title:d(c.hideDeviceFrame)}],tags:[d(c.device)]}),o.Toolbar.registerToolbarItem({actionId:"emulation.toggle-device-mode",condition:t.Runtime.ConditionName.CAN_DOCK,location:o.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_LEFT,order:1,showLabel:void 0,loadItem:void 0,separator:void 0}),e.AppProvider.registerAppProvider({loadAppProvider:async()=>(await m()).AdvancedApp.AdvancedAppProvider.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,order:0}),o.ContextMenu.registerItem({location:o.ContextMenu.ItemLocation.DEVICE_MODE_MENU_SAVE,order:12,actionId:"emulation.capture-screenshot"}),o.ContextMenu.registerItem({location:o.ContextMenu.ItemLocation.DEVICE_MODE_MENU_SAVE,order:13,actionId:"emulation.capture-full-height-screenshot"});const p={sensors:"Sensors",geolocation:"geolocation",timezones:"timezones",locale:"locale",locales:"locales",accelerometer:"accelerometer",deviceOrientation:"device orientation",locations:"Locations",touch:"Touch",devicebased:"Device-based",forceEnabled:"Force enabled",emulateIdleDetectorState:"Emulate Idle Detector state",noIdleEmulation:"No idle emulation",userActiveScreenUnlocked:"User active, screen unlocked",userActiveScreenLocked:"User active, screen locked",userIdleScreenUnlocked:"User idle, screen unlocked",userIdleScreenLocked:"User idle, screen locked",showSensors:"Show Sensors",showLocations:"Show Locations"},w=i.i18n.registerUIStrings("panels/sensors/sensors-meta.ts",p),S=i.i18n.getLazilyComputedLocalizedString.bind(void 0,w);let y;async function R(){return y||(y=await import("../../panels/sensors/sensors.js")),y}o.ViewManager.registerViewExtension({location:"drawer-view",commandPrompt:S(p.showSensors),title:S(p.sensors),id:"sensors",persistence:"closeable",order:100,loadView:async()=>(await R()).SensorsView.SensorsView.instance(),tags:[S(p.geolocation),S(p.timezones),S(p.locale),S(p.locales),S(p.accelerometer),S(p.deviceOrientation)]}),o.ViewManager.registerViewExtension({location:"settings-view",id:"emulation-locations",commandPrompt:S(p.showLocations),title:S(p.locations),order:40,loadView:async()=>(await R()).LocationsSettingsTab.LocationsSettingsTab.instance(),settings:["emulation.locations"]}),e.Settings.registerSettingExtension({storageType:e.Settings.SettingStorageType.Synced,settingName:"emulation.locations",settingType:e.Settings.SettingType.ARRAY,defaultValue:[{title:"Berlin",lat:52.520007,long:13.404954,timezoneId:"Europe/Berlin",locale:"de-DE"},{title:"London",lat:51.507351,long:-.127758,timezoneId:"Europe/London",locale:"en-GB"},{title:"Moscow",lat:55.755826,long:37.6173,timezoneId:"Europe/Moscow",locale:"ru-RU"},{title:"Mountain View",lat:37.386052,long:-122.083851,timezoneId:"America/Los_Angeles",locale:"en-US"},{title:"Mumbai",lat:19.075984,long:72.877656,timezoneId:"Asia/Kolkata",locale:"mr-IN"},{title:"San Francisco",lat:37.774929,long:-122.419416,timezoneId:"America/Los_Angeles",locale:"en-US"},{title:"Shanghai",lat:31.230416,long:121.473701,timezoneId:"Asia/Shanghai",locale:"zh-Hans-CN"},{title:"São Paulo",lat:-23.55052,long:-46.633309,timezoneId:"America/Sao_Paulo",locale:"pt-BR"},{title:"Tokyo",lat:35.689487,long:139.691706,timezoneId:"Asia/Tokyo",locale:"ja-JP"}]}),e.Settings.registerSettingExtension({title:S(p.touch),reloadRequired:!0,settingName:"emulation.touch",settingType:e.Settings.SettingType.ENUM,defaultValue:"none",options:[{value:"none",title:S(p.devicebased),text:S(p.devicebased)},{value:"force",title:S(p.forceEnabled),text:S(p.forceEnabled)}]}),e.Settings.registerSettingExtension({title:S(p.emulateIdleDetectorState),settingName:"emulation.idleDetection",settingType:e.Settings.SettingType.ENUM,defaultValue:"none",options:[{value:"none",title:S(p.noIdleEmulation),text:S(p.noIdleEmulation)},{value:'{"isUserActive":true,"isScreenUnlocked":true}',title:S(p.userActiveScreenUnlocked),text:S(p.userActiveScreenUnlocked)},{value:'{"isUserActive":true,"isScreenUnlocked":false}',title:S(p.userActiveScreenLocked),text:S(p.userActiveScreenLocked)},{value:'{"isUserActive":false,"isScreenUnlocked":true}',title:S(p.userIdleScreenUnlocked),text:S(p.userIdleScreenUnlocked)},{value:'{"isUserActive":false,"isScreenUnlocked":false}',title:S(p.userIdleScreenLocked),text:S(p.userIdleScreenLocked)}]});const A={developerResources:"Developer Resources",showDeveloperResources:"Show Developer Resources"},h=i.i18n.registerUIStrings("panels/developer_resources/developer_resources-meta.ts",A),v=i.i18n.getLazilyComputedLocalizedString.bind(void 0,h);let E;o.ViewManager.registerViewExtension({location:"drawer-view",id:"resource-loading-pane",title:v(A.developerResources),commandPrompt:v(A.showDeveloperResources),order:100,persistence:"closeable",experiment:t.Runtime.ExperimentName.DEVELOPER_RESOURCES_VIEW,loadView:async()=>new((await async function(){return E||(E=await import("../../panels/developer_resources/developer_resources.js")),E}()).DeveloperResourcesView.DeveloperResourcesView)});const T={rendering:"Rendering",showRendering:"Show Rendering",paint:"paint",layout:"layout",fps:"fps",cssMediaType:"CSS media type",cssMediaFeature:"CSS media feature",visionDeficiency:"vision deficiency",colorVisionDeficiency:"color vision deficiency",reloadPage:"Reload page",hardReloadPage:"Hard reload page",forceAdBlocking:"Force ad blocking on this site",blockAds:"Block ads on this site",showAds:"Show ads on this site, if allowed",autoOpenDevTools:"Auto-open DevTools for popups",doNotAutoOpen:"Do not auto-open DevTools for popups",disablePaused:"Disable paused state overlay",toggleCssPrefersColorSchemeMedia:"Toggle CSS media feature prefers-color-scheme"},N=i.i18n.registerUIStrings("entrypoints/inspector_main/inspector_main-meta.ts",T),f=i.i18n.getLazilyComputedLocalizedString.bind(void 0,N);let C;async function k(){return C||(C=await import("../inspector_main/inspector_main.js")),C}o.ViewManager.registerViewExtension({location:"drawer-view",id:"rendering",title:f(T.rendering),commandPrompt:f(T.showRendering),persistence:"closeable",order:50,loadView:async()=>(await k()).RenderingOptions.RenderingOptionsView.instance(),tags:[f(T.paint),f(T.layout),f(T.fps),f(T.cssMediaType),f(T.cssMediaFeature),f(T.visionDeficiency),f(T.colorVisionDeficiency)]}),o.ActionRegistration.registerActionExtension({category:o.ActionRegistration.ActionCategory.NAVIGATION,actionId:"inspector_main.reload",loadActionDelegate:async()=>(await k()).InspectorMain.ReloadActionDelegate.instance(),iconClass:"refresh",title:f(T.reloadPage),bindings:[{platform:"windows,linux",shortcut:"Ctrl+R"},{platform:"windows,linux",shortcut:"F5"},{platform:"mac",shortcut:"Meta+R"}]}),o.ActionRegistration.registerActionExtension({category:o.ActionRegistration.ActionCategory.NAVIGATION,actionId:"inspector_main.hard-reload",loadActionDelegate:async()=>(await k()).InspectorMain.ReloadActionDelegate.instance(),title:f(T.hardReloadPage),bindings:[{platform:"windows,linux",shortcut:"Shift+Ctrl+R"},{platform:"windows,linux",shortcut:"Shift+F5"},{platform:"windows,linux",shortcut:"Ctrl+F5"},{platform:"windows,linux",shortcut:"Ctrl+Shift+F5"},{platform:"mac",shortcut:"Shift+Meta+R"}]}),o.ActionRegistration.registerActionExtension({actionId:"rendering.toggle-prefers-color-scheme",category:o.ActionRegistration.ActionCategory.RENDERING,title:f(T.toggleCssPrefersColorSchemeMedia),loadActionDelegate:async()=>(await k()).RenderingOptions.ReloadActionDelegate.instance()}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.NETWORK,title:f(T.forceAdBlocking),settingName:"network.adBlockingEnabled",settingType:e.Settings.SettingType.BOOLEAN,storageType:e.Settings.SettingStorageType.Session,defaultValue:!1,options:[{value:!0,title:f(T.blockAds)},{value:!1,title:f(T.showAds)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.GLOBAL,storageType:e.Settings.SettingStorageType.Synced,title:f(T.autoOpenDevTools),settingName:"autoAttachToCreatedPages",settingType:e.Settings.SettingType.BOOLEAN,order:2,defaultValue:!1,options:[{value:!0,title:f(T.autoOpenDevTools)},{value:!1,title:f(T.doNotAutoOpen)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.APPEARANCE,storageType:e.Settings.SettingStorageType.Synced,title:f(T.disablePaused),settingName:"disablePausedStateOverlay",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1}),o.Toolbar.registerToolbarItem({loadItem:async()=>(await k()).InspectorMain.NodeIndicator.instance(),order:2,location:o.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_LEFT,showLabel:void 0,condition:void 0,separator:void 0,actionId:void 0}),o.Toolbar.registerToolbarItem({loadItem:async()=>(await k()).OutermostTargetSelector.OutermostTargetSelector.instance(),order:98,location:o.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_RIGHT,showLabel:void 0,condition:void 0,separator:void 0,actionId:void 0,experiment:t.Runtime.ExperimentName.OUTERMOST_TARGET_SELECTOR});const I={issues:"Issues",showIssues:"Show Issues",cspViolations:"CSP Violations",showCspViolations:"Show CSP Violations"},P=i.i18n.registerUIStrings("panels/issues/issues-meta.ts",I),x=i.i18n.getLazilyComputedLocalizedString.bind(void 0,P);let b;async function L(){return b||(b=await import("../../panels/issues/issues.js")),b}o.ViewManager.registerViewExtension({location:"drawer-view",id:"issues-pane",title:x(I.issues),commandPrompt:x(I.showIssues),order:100,persistence:"closeable",loadView:async()=>(await L()).IssuesPane.IssuesPane.instance()}),o.ViewManager.registerViewExtension({location:"drawer-view",id:"csp-violations-pane",title:x(I.cspViolations),commandPrompt:x(I.showCspViolations),order:100,persistence:"closeable",loadView:async()=>(await L()).CSPViolationsView.CSPViolationsView.instance(),experiment:t.Runtime.ExperimentName.CSP_VIOLATIONS_VIEW}),e.Revealer.registerRevealer({contextTypes:()=>[n.Issue.Issue],destination:e.Revealer.RevealerDestination.ISSUES_VIEW,loadRevealer:async()=>(await L()).IssueRevealer.IssueRevealer.instance()});const D={throttling:"Throttling",showThrottling:"Show Throttling",goOffline:"Go offline",device:"device",throttlingTag:"throttling",enableSlowGThrottling:"Enable slow `3G` throttling",enableFastGThrottling:"Enable fast `3G` throttling",goOnline:"Go online"},V=i.i18n.registerUIStrings("panels/mobile_throttling/mobile_throttling-meta.ts",D),O=i.i18n.getLazilyComputedLocalizedString.bind(void 0,V);let M;async function _(){return M||(M=await import("../../panels/mobile_throttling/mobile_throttling.js")),M}o.ViewManager.registerViewExtension({location:"settings-view",id:"throttling-conditions",title:O(D.throttling),commandPrompt:O(D.showThrottling),order:35,loadView:async()=>(await _()).ThrottlingSettingsTab.ThrottlingSettingsTab.instance(),settings:["customNetworkConditions"]}),o.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-offline",category:o.ActionRegistration.ActionCategory.NETWORK,title:O(D.goOffline),loadActionDelegate:async()=>(await _()).ThrottlingManager.ActionDelegate.instance(),tags:[O(D.device),O(D.throttlingTag)]}),o.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-low-end-mobile",category:o.ActionRegistration.ActionCategory.NETWORK,title:O(D.enableSlowGThrottling),loadActionDelegate:async()=>(await _()).ThrottlingManager.ActionDelegate.instance(),tags:[O(D.device),O(D.throttlingTag)]}),o.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-mid-tier-mobile",category:o.ActionRegistration.ActionCategory.NETWORK,title:O(D.enableFastGThrottling),loadActionDelegate:async()=>(await _()).ThrottlingManager.ActionDelegate.instance(),tags:[O(D.device),O(D.throttlingTag)]}),o.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-online",category:o.ActionRegistration.ActionCategory.NETWORK,title:O(D.goOnline),loadActionDelegate:async()=>(await _()).ThrottlingManager.ActionDelegate.instance(),tags:[O(D.device),O(D.throttlingTag)]}),e.Settings.registerSettingExtension({storageType:e.Settings.SettingStorageType.Synced,settingName:"customNetworkConditions",settingType:e.Settings.SettingType.ARRAY,defaultValue:[]});const U={showNetwork:"Show Network",network:"Network",showNetworkRequestBlocking:"Show Network request blocking",networkRequestBlocking:"Network request blocking",showNetworkConditions:"Show Network conditions",networkConditions:"Network conditions",diskCache:"disk cache",networkThrottling:"network throttling",showSearch:"Show Search",search:"Search",recordNetworkLog:"Record network log",stopRecordingNetworkLog:"Stop recording network log",hideRequestDetails:"Hide request details",colorcodeResourceTypes:"Color-code resource types",colorCode:"color code",resourceType:"resource type",colorCodeByResourceType:"Color code by resource type",useDefaultColors:"Use default colors",groupNetworkLogByFrame:"Group network log by frame",netWork:"network",frame:"frame",group:"group",groupNetworkLogItemsByFrame:"Group network log items by frame",dontGroupNetworkLogItemsByFrame:"Don't group network log items by frame",clear:"Clear network log"},B=i.i18n.registerUIStrings("panels/network/network-meta.ts",U),F=i.i18n.getLazilyComputedLocalizedString.bind(void 0,B);let z;async function W(){return z||(z=await import("../../panels/network/network.js")),z}function j(e){return void 0===z?[]:e(z)}o.ViewManager.registerViewExtension({location:"panel",id:"network",commandPrompt:F(U.showNetwork),title:F(U.network),order:40,condition:t.Runtime.ConditionName.REACT_NATIVE_UNSTABLE_NETWORK_PANEL,loadView:async()=>(await W()).NetworkPanel.NetworkPanel.instance()}),o.ViewManager.registerViewExtension({location:"drawer-view",id:"network.blocked-urls",commandPrompt:F(U.showNetworkRequestBlocking),title:F(U.networkRequestBlocking),persistence:"closeable",order:60,loadView:async()=>(await W()).BlockedURLsPane.BlockedURLsPane.instance()}),o.ViewManager.registerViewExtension({location:"drawer-view",id:"network.config",commandPrompt:F(U.showNetworkConditions),title:F(U.networkConditions),persistence:"closeable",order:40,tags:[F(U.diskCache),F(U.networkThrottling),i.i18n.lockedLazyString("useragent"),i.i18n.lockedLazyString("user agent"),i.i18n.lockedLazyString("user-agent")],loadView:async()=>(await W()).NetworkConfigView.NetworkConfigView.instance()}),o.ViewManager.registerViewExtension({location:"network-sidebar",id:"network.search-network-tab",commandPrompt:F(U.showSearch),title:F(U.search),persistence:"permanent",loadView:async()=>(await W()).NetworkPanel.SearchNetworkView.instance()}),o.ActionRegistration.registerActionExtension({actionId:"network.toggle-recording",category:o.ActionRegistration.ActionCategory.NETWORK,iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>j((e=>[e.NetworkPanel.NetworkPanel])),loadActionDelegate:async()=>(await W()).NetworkPanel.ActionDelegate.instance(),options:[{value:!0,title:F(U.recordNetworkLog)},{value:!1,title:F(U.stopRecordingNetworkLog)}],bindings:[{shortcut:"Ctrl+E",platform:"windows,linux"},{shortcut:"Meta+E",platform:"mac"}]}),o.ActionRegistration.registerActionExtension({actionId:"network.clear",category:o.ActionRegistration.ActionCategory.NETWORK,title:F(U.clear),iconClass:"clear",loadActionDelegate:async()=>(await W()).NetworkPanel.ActionDelegate.instance(),contextTypes:()=>j((e=>[e.NetworkPanel.NetworkPanel])),bindings:[{shortcut:"Ctrl+L"},{shortcut:"Meta+K",platform:"mac"}]}),o.ActionRegistration.registerActionExtension({actionId:"network.hide-request-details",category:o.ActionRegistration.ActionCategory.NETWORK,title:F(U.hideRequestDetails),contextTypes:()=>j((e=>[e.NetworkPanel.NetworkPanel])),loadActionDelegate:async()=>(await W()).NetworkPanel.ActionDelegate.instance(),bindings:[{shortcut:"Esc"}]}),o.ActionRegistration.registerActionExtension({actionId:"network.search",category:o.ActionRegistration.ActionCategory.NETWORK,title:F(U.search),contextTypes:()=>j((e=>[e.NetworkPanel.NetworkPanel])),loadActionDelegate:async()=>(await W()).NetworkPanel.ActionDelegate.instance(),bindings:[{platform:"mac",shortcut:"Meta+F",keybindSets:["devToolsDefault","vsCode"]},{platform:"windows,linux",shortcut:"Ctrl+F",keybindSets:["devToolsDefault","vsCode"]}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.NETWORK,storageType:e.Settings.SettingStorageType.Synced,title:F(U.colorcodeResourceTypes),settingName:"networkColorCodeResourceTypes",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,tags:[F(U.colorCode),F(U.resourceType)],options:[{value:!0,title:F(U.colorCodeByResourceType)},{value:!1,title:F(U.useDefaultColors)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.NETWORK,storageType:e.Settings.SettingStorageType.Synced,title:F(U.groupNetworkLogByFrame),settingName:"network.group-by-frame",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,tags:[F(U.netWork),F(U.frame),F(U.group)],options:[{value:!0,title:F(U.groupNetworkLogItemsByFrame)},{value:!1,title:F(U.dontGroupNetworkLogItemsByFrame)}]}),o.ViewManager.registerLocationResolver({name:"network-sidebar",category:o.ViewManager.ViewLocationCategory.NETWORK,loadResolver:async()=>(await W()).NetworkPanel.NetworkPanel.instance()}),o.ContextMenu.registerProvider({contextTypes:()=>[a.NetworkRequest.NetworkRequest,a.Resource.Resource,r.UISourceCode.UISourceCode],loadProvider:async()=>(await W()).NetworkPanel.ContextMenuProvider.instance(),experiment:void 0}),e.Revealer.registerRevealer({contextTypes:()=>[a.NetworkRequest.NetworkRequest],destination:e.Revealer.RevealerDestination.NETWORK_PANEL,loadRevealer:async()=>(await W()).NetworkPanel.RequestRevealer.instance()}),e.Revealer.registerRevealer({contextTypes:()=>[s.UIRequestLocation.UIRequestLocation],loadRevealer:async()=>(await W()).NetworkPanel.RequestLocationRevealer.instance(),destination:void 0}),e.Revealer.registerRevealer({contextTypes:()=>[s.NetworkRequestId.NetworkRequestId],destination:e.Revealer.RevealerDestination.NETWORK_PANEL,loadRevealer:async()=>(await W()).NetworkPanel.RequestIdRevealer.instance()}),e.Revealer.registerRevealer({contextTypes:()=>[s.UIFilter.UIRequestFilter],destination:e.Revealer.RevealerDestination.NETWORK_PANEL,loadRevealer:async()=>(await W()).NetworkPanel.NetworkLogWithFilterRevealer.instance()});const q={profiler:"Profiler",showProfiler:"Show Profiler",performance:"Performance",showPerformance:"Show Performance",startStopRecording:"Start/stop recording",showRecentTimelineSessions:"Show recent timeline sessions",record:"Record",stop:"Stop",startProfilingAndReloadPage:"Start profiling and reload page"},K=i.i18n.registerUIStrings("panels/js_profiler/js_profiler-meta.ts",q),G=i.i18n.getLazilyComputedLocalizedString.bind(void 0,K);let H,J;async function Q(){return J||(J=await import("../../panels/profiler/profiler.js")),J}async function Y(){return H||(H=await import("../../panels/timeline/timeline.js")),H}function X(e){return void 0===H?[]:e(H)}o.ViewManager.registerViewExtension({location:"panel",id:"js_profiler",title:G(q.profiler),commandPrompt:G(q.showProfiler),order:65,persistence:"permanent",experiment:t.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,loadView:async()=>(await Q()).ProfilesPanel.JSProfilerPanel.instance()}),o.ActionRegistration.registerActionExtension({actionId:"profiler.js-toggle-recording",category:o.ActionRegistration.ActionCategory.JAVASCRIPT_PROFILER,title:G(q.startStopRecording),iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>void 0===J?[]:(e=>[e.ProfilesPanel.JSProfilerPanel])(J),loadActionDelegate:async()=>(await Q()).ProfilesPanel.JSProfilerPanel.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),o.ActionRegistration.registerActionExtension({actionId:"timeline.show-history",loadActionDelegate:async()=>(await Y()).TimelinePanel.ActionDelegate.instance(),category:o.ActionRegistration.ActionCategory.PERFORMANCE,title:G(q.showRecentTimelineSessions),contextTypes:()=>X((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Ctrl+H"},{platform:"mac",shortcut:"Meta+Y"}]}),o.ActionRegistration.registerActionExtension({actionId:"timeline.toggle-recording",category:o.ActionRegistration.ActionCategory.PERFORMANCE,iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>X((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>(await Y()).TimelinePanel.ActionDelegate.instance(),options:[{value:!0,title:G(q.record)},{value:!1,title:G(q.stop)}],bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),o.ActionRegistration.registerActionExtension({actionId:"timeline.record-reload",iconClass:"refresh",contextTypes:()=>X((e=>[e.TimelinePanel.TimelinePanel])),category:o.ActionRegistration.ActionCategory.PERFORMANCE,title:G(q.startProfilingAndReloadPage),loadActionDelegate:async()=>(await Y()).TimelinePanel.ActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+Shift+E"},{platform:"mac",shortcut:"Meta+Shift+E"}]});const Z={rnWelcome:"⚛️ Welcome",showRnWelcome:"Show React Native Welcome panel"},$=i.i18n.registerUIStrings("panels/rn_welcome/rn_welcome-meta.ts",Z),ee=i.i18n.getLazilyComputedLocalizedString.bind(void 0,$);let te;o.ViewManager.registerViewExtension({location:"panel",id:"rn-welcome",title:ee(Z.rnWelcome),commandPrompt:ee(Z.showRnWelcome),order:-10,persistence:"permanent",loadView:async()=>(await async function(){return te||(te=await import("../../panels/rn_welcome/rn_welcome.js")),te}()).RNWelcome.RNWelcomeImpl.instance(),experiment:t.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI}),t.Runtime.experiments.register(t.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,"Enable JavaScript Profiler (legacy)",!1),t.Runtime.experiments.register(t.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,"Show React Native-specific UI",!1),t.Runtime.experiments.enableExperimentsByDefault([t.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,t.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI]),self.runtime=t.Runtime.Runtime.instance({forceNew:!0}),new l.MainImpl.MainImpl; +import"../shell/shell.js";import*as e from"../../core/common/common.js";import*as t from"../../core/root/root.js";import*as o from"../../ui/legacy/legacy.js";import*as i from"../../core/i18n/i18n.js";import*as n from"../../models/issues_manager/issues_manager.js";import*as a from"../../core/sdk/sdk.js";import*as r from"../../models/workspace/workspace.js";import*as s from"../../panels/network/forward/forward.js";import*as l from"../../core/host/host.js";import*as c from"../main/main.js";const g={toggleDeviceToolbar:"Toggle device toolbar",captureScreenshot:"Capture screenshot",captureFullSizeScreenshot:"Capture full size screenshot",captureNodeScreenshot:"Capture node screenshot",showMediaQueries:"Show media queries",device:"device",hideMediaQueries:"Hide media queries",showRulers:"Show rulers in the Device Mode toolbar",hideRulers:"Hide rulers in the Device Mode toolbar",showDeviceFrame:"Show device frame",hideDeviceFrame:"Hide device frame"},d=i.i18n.registerUIStrings("panels/emulation/emulation-meta.ts",g),u=i.i18n.getLazilyComputedLocalizedString.bind(void 0,d);let m;async function p(){return m||(m=await import("../../panels/emulation/emulation.js")),m}o.ActionRegistration.registerActionExtension({category:o.ActionRegistration.ActionCategory.MOBILE,actionId:"emulation.toggle-device-mode",toggleable:!0,loadActionDelegate:async()=>(await p()).DeviceModeWrapper.ActionDelegate.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,title:u(g.toggleDeviceToolbar),iconClass:"devices",bindings:[{platform:"windows,linux",shortcut:"Shift+Ctrl+M"},{platform:"mac",shortcut:"Shift+Meta+M"}]}),o.ActionRegistration.registerActionExtension({actionId:"emulation.capture-screenshot",category:o.ActionRegistration.ActionCategory.SCREENSHOT,loadActionDelegate:async()=>(await p()).DeviceModeWrapper.ActionDelegate.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,title:u(g.captureScreenshot)}),o.ActionRegistration.registerActionExtension({actionId:"emulation.capture-full-height-screenshot",category:o.ActionRegistration.ActionCategory.SCREENSHOT,loadActionDelegate:async()=>(await p()).DeviceModeWrapper.ActionDelegate.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,title:u(g.captureFullSizeScreenshot)}),o.ActionRegistration.registerActionExtension({actionId:"emulation.capture-node-screenshot",category:o.ActionRegistration.ActionCategory.SCREENSHOT,loadActionDelegate:async()=>(await p()).DeviceModeWrapper.ActionDelegate.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,title:u(g.captureNodeScreenshot)}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.MOBILE,settingName:"showMediaQueryInspector",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:u(g.showMediaQueries)},{value:!1,title:u(g.hideMediaQueries)}],tags:[u(g.device)]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.MOBILE,settingName:"emulation.showRulers",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:u(g.showRulers)},{value:!1,title:u(g.hideRulers)}],tags:[u(g.device)]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.MOBILE,settingName:"emulation.showDeviceOutline",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:u(g.showDeviceFrame)},{value:!1,title:u(g.hideDeviceFrame)}],tags:[u(g.device)]}),o.Toolbar.registerToolbarItem({actionId:"emulation.toggle-device-mode",condition:t.Runtime.ConditionName.CAN_DOCK,location:o.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_LEFT,order:1,showLabel:void 0,loadItem:void 0,separator:void 0}),e.AppProvider.registerAppProvider({loadAppProvider:async()=>(await p()).AdvancedApp.AdvancedAppProvider.instance(),condition:t.Runtime.ConditionName.CAN_DOCK,order:0}),o.ContextMenu.registerItem({location:o.ContextMenu.ItemLocation.DEVICE_MODE_MENU_SAVE,order:12,actionId:"emulation.capture-screenshot"}),o.ContextMenu.registerItem({location:o.ContextMenu.ItemLocation.DEVICE_MODE_MENU_SAVE,order:13,actionId:"emulation.capture-full-height-screenshot"});const w={sensors:"Sensors",geolocation:"geolocation",timezones:"timezones",locale:"locale",locales:"locales",accelerometer:"accelerometer",deviceOrientation:"device orientation",locations:"Locations",touch:"Touch",devicebased:"Device-based",forceEnabled:"Force enabled",emulateIdleDetectorState:"Emulate Idle Detector state",noIdleEmulation:"No idle emulation",userActiveScreenUnlocked:"User active, screen unlocked",userActiveScreenLocked:"User active, screen locked",userIdleScreenUnlocked:"User idle, screen unlocked",userIdleScreenLocked:"User idle, screen locked",showSensors:"Show Sensors",showLocations:"Show Locations"},S=i.i18n.registerUIStrings("panels/sensors/sensors-meta.ts",w),R=i.i18n.getLazilyComputedLocalizedString.bind(void 0,S);let y;async function A(){return y||(y=await import("../../panels/sensors/sensors.js")),y}o.ViewManager.registerViewExtension({location:"drawer-view",commandPrompt:R(w.showSensors),title:R(w.sensors),id:"sensors",persistence:"closeable",order:100,loadView:async()=>(await A()).SensorsView.SensorsView.instance(),tags:[R(w.geolocation),R(w.timezones),R(w.locale),R(w.locales),R(w.accelerometer),R(w.deviceOrientation)]}),o.ViewManager.registerViewExtension({location:"settings-view",id:"emulation-locations",commandPrompt:R(w.showLocations),title:R(w.locations),order:40,loadView:async()=>(await A()).LocationsSettingsTab.LocationsSettingsTab.instance(),settings:["emulation.locations"]}),e.Settings.registerSettingExtension({storageType:e.Settings.SettingStorageType.Synced,settingName:"emulation.locations",settingType:e.Settings.SettingType.ARRAY,defaultValue:[{title:"Berlin",lat:52.520007,long:13.404954,timezoneId:"Europe/Berlin",locale:"de-DE"},{title:"London",lat:51.507351,long:-.127758,timezoneId:"Europe/London",locale:"en-GB"},{title:"Moscow",lat:55.755826,long:37.6173,timezoneId:"Europe/Moscow",locale:"ru-RU"},{title:"Mountain View",lat:37.386052,long:-122.083851,timezoneId:"America/Los_Angeles",locale:"en-US"},{title:"Mumbai",lat:19.075984,long:72.877656,timezoneId:"Asia/Kolkata",locale:"mr-IN"},{title:"San Francisco",lat:37.774929,long:-122.419416,timezoneId:"America/Los_Angeles",locale:"en-US"},{title:"Shanghai",lat:31.230416,long:121.473701,timezoneId:"Asia/Shanghai",locale:"zh-Hans-CN"},{title:"São Paulo",lat:-23.55052,long:-46.633309,timezoneId:"America/Sao_Paulo",locale:"pt-BR"},{title:"Tokyo",lat:35.689487,long:139.691706,timezoneId:"Asia/Tokyo",locale:"ja-JP"}]}),e.Settings.registerSettingExtension({title:R(w.touch),reloadRequired:!0,settingName:"emulation.touch",settingType:e.Settings.SettingType.ENUM,defaultValue:"none",options:[{value:"none",title:R(w.devicebased),text:R(w.devicebased)},{value:"force",title:R(w.forceEnabled),text:R(w.forceEnabled)}]}),e.Settings.registerSettingExtension({title:R(w.emulateIdleDetectorState),settingName:"emulation.idleDetection",settingType:e.Settings.SettingType.ENUM,defaultValue:"none",options:[{value:"none",title:R(w.noIdleEmulation),text:R(w.noIdleEmulation)},{value:'{"isUserActive":true,"isScreenUnlocked":true}',title:R(w.userActiveScreenUnlocked),text:R(w.userActiveScreenUnlocked)},{value:'{"isUserActive":true,"isScreenUnlocked":false}',title:R(w.userActiveScreenLocked),text:R(w.userActiveScreenLocked)},{value:'{"isUserActive":false,"isScreenUnlocked":true}',title:R(w.userIdleScreenUnlocked),text:R(w.userIdleScreenUnlocked)},{value:'{"isUserActive":false,"isScreenUnlocked":false}',title:R(w.userIdleScreenLocked),text:R(w.userIdleScreenLocked)}]});const h={developerResources:"Developer Resources",showDeveloperResources:"Show Developer Resources"},E=i.i18n.registerUIStrings("panels/developer_resources/developer_resources-meta.ts",h),v=i.i18n.getLazilyComputedLocalizedString.bind(void 0,E);let T;o.ViewManager.registerViewExtension({location:"drawer-view",id:"resource-loading-pane",title:v(h.developerResources),commandPrompt:v(h.showDeveloperResources),order:100,persistence:"closeable",experiment:t.Runtime.ExperimentName.DEVELOPER_RESOURCES_VIEW,loadView:async()=>new((await async function(){return T||(T=await import("../../panels/developer_resources/developer_resources.js")),T}()).DeveloperResourcesView.DeveloperResourcesView)});const N={rendering:"Rendering",showRendering:"Show Rendering",paint:"paint",layout:"layout",fps:"fps",cssMediaType:"CSS media type",cssMediaFeature:"CSS media feature",visionDeficiency:"vision deficiency",colorVisionDeficiency:"color vision deficiency",reloadPage:"Reload page",hardReloadPage:"Hard reload page",forceAdBlocking:"Force ad blocking on this site",blockAds:"Block ads on this site",showAds:"Show ads on this site, if allowed",autoOpenDevTools:"Auto-open DevTools for popups",doNotAutoOpen:"Do not auto-open DevTools for popups",disablePaused:"Disable paused state overlay",toggleCssPrefersColorSchemeMedia:"Toggle CSS media feature prefers-color-scheme"},f=i.i18n.registerUIStrings("entrypoints/inspector_main/inspector_main-meta.ts",N),C=i.i18n.getLazilyComputedLocalizedString.bind(void 0,f);let k;async function I(){return k||(k=await import("../inspector_main/inspector_main.js")),k}o.ViewManager.registerViewExtension({location:"drawer-view",id:"rendering",title:C(N.rendering),commandPrompt:C(N.showRendering),persistence:"closeable",order:50,loadView:async()=>(await I()).RenderingOptions.RenderingOptionsView.instance(),tags:[C(N.paint),C(N.layout),C(N.fps),C(N.cssMediaType),C(N.cssMediaFeature),C(N.visionDeficiency),C(N.colorVisionDeficiency)]}),o.ActionRegistration.registerActionExtension({category:o.ActionRegistration.ActionCategory.NAVIGATION,actionId:"inspector_main.reload",loadActionDelegate:async()=>(await I()).InspectorMain.ReloadActionDelegate.instance(),iconClass:"refresh",title:C(N.reloadPage),bindings:[{platform:"windows,linux",shortcut:"Ctrl+R"},{platform:"windows,linux",shortcut:"F5"},{platform:"mac",shortcut:"Meta+R"}]}),o.ActionRegistration.registerActionExtension({category:o.ActionRegistration.ActionCategory.NAVIGATION,actionId:"inspector_main.hard-reload",loadActionDelegate:async()=>(await I()).InspectorMain.ReloadActionDelegate.instance(),title:C(N.hardReloadPage),bindings:[{platform:"windows,linux",shortcut:"Shift+Ctrl+R"},{platform:"windows,linux",shortcut:"Shift+F5"},{platform:"windows,linux",shortcut:"Ctrl+F5"},{platform:"windows,linux",shortcut:"Ctrl+Shift+F5"},{platform:"mac",shortcut:"Shift+Meta+R"}]}),o.ActionRegistration.registerActionExtension({actionId:"rendering.toggle-prefers-color-scheme",category:o.ActionRegistration.ActionCategory.RENDERING,title:C(N.toggleCssPrefersColorSchemeMedia),loadActionDelegate:async()=>(await I()).RenderingOptions.ReloadActionDelegate.instance()}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.NETWORK,title:C(N.forceAdBlocking),settingName:"network.adBlockingEnabled",settingType:e.Settings.SettingType.BOOLEAN,storageType:e.Settings.SettingStorageType.Session,defaultValue:!1,options:[{value:!0,title:C(N.blockAds)},{value:!1,title:C(N.showAds)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.GLOBAL,storageType:e.Settings.SettingStorageType.Synced,title:C(N.autoOpenDevTools),settingName:"autoAttachToCreatedPages",settingType:e.Settings.SettingType.BOOLEAN,order:2,defaultValue:!1,options:[{value:!0,title:C(N.autoOpenDevTools)},{value:!1,title:C(N.doNotAutoOpen)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.APPEARANCE,storageType:e.Settings.SettingStorageType.Synced,title:C(N.disablePaused),settingName:"disablePausedStateOverlay",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1}),o.Toolbar.registerToolbarItem({loadItem:async()=>(await I()).InspectorMain.NodeIndicator.instance(),order:2,location:o.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_LEFT,showLabel:void 0,condition:void 0,separator:void 0,actionId:void 0}),o.Toolbar.registerToolbarItem({loadItem:async()=>(await I()).OutermostTargetSelector.OutermostTargetSelector.instance(),order:98,location:o.Toolbar.ToolbarItemLocation.MAIN_TOOLBAR_RIGHT,showLabel:void 0,condition:void 0,separator:void 0,actionId:void 0,experiment:t.Runtime.ExperimentName.OUTERMOST_TARGET_SELECTOR});const P={issues:"Issues",showIssues:"Show Issues",cspViolations:"CSP Violations",showCspViolations:"Show CSP Violations"},x=i.i18n.registerUIStrings("panels/issues/issues-meta.ts",P),b=i.i18n.getLazilyComputedLocalizedString.bind(void 0,x);let D;async function L(){return D||(D=await import("../../panels/issues/issues.js")),D}o.ViewManager.registerViewExtension({location:"drawer-view",id:"issues-pane",title:b(P.issues),commandPrompt:b(P.showIssues),order:100,persistence:"closeable",loadView:async()=>(await L()).IssuesPane.IssuesPane.instance()}),o.ViewManager.registerViewExtension({location:"drawer-view",id:"csp-violations-pane",title:b(P.cspViolations),commandPrompt:b(P.showCspViolations),order:100,persistence:"closeable",loadView:async()=>(await L()).CSPViolationsView.CSPViolationsView.instance(),experiment:t.Runtime.ExperimentName.CSP_VIOLATIONS_VIEW}),e.Revealer.registerRevealer({contextTypes:()=>[n.Issue.Issue],destination:e.Revealer.RevealerDestination.ISSUES_VIEW,loadRevealer:async()=>(await L()).IssueRevealer.IssueRevealer.instance()});const M={throttling:"Throttling",showThrottling:"Show Throttling",goOffline:"Go offline",device:"device",throttlingTag:"throttling",enableSlowGThrottling:"Enable slow `3G` throttling",enableFastGThrottling:"Enable fast `3G` throttling",goOnline:"Go online"},V=i.i18n.registerUIStrings("panels/mobile_throttling/mobile_throttling-meta.ts",M),O=i.i18n.getLazilyComputedLocalizedString.bind(void 0,V);let _;async function U(){return _||(_=await import("../../panels/mobile_throttling/mobile_throttling.js")),_}o.ViewManager.registerViewExtension({location:"settings-view",id:"throttling-conditions",title:O(M.throttling),commandPrompt:O(M.showThrottling),order:35,loadView:async()=>(await U()).ThrottlingSettingsTab.ThrottlingSettingsTab.instance(),settings:["customNetworkConditions"]}),o.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-offline",category:o.ActionRegistration.ActionCategory.NETWORK,title:O(M.goOffline),loadActionDelegate:async()=>(await U()).ThrottlingManager.ActionDelegate.instance(),tags:[O(M.device),O(M.throttlingTag)]}),o.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-low-end-mobile",category:o.ActionRegistration.ActionCategory.NETWORK,title:O(M.enableSlowGThrottling),loadActionDelegate:async()=>(await U()).ThrottlingManager.ActionDelegate.instance(),tags:[O(M.device),O(M.throttlingTag)]}),o.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-mid-tier-mobile",category:o.ActionRegistration.ActionCategory.NETWORK,title:O(M.enableFastGThrottling),loadActionDelegate:async()=>(await U()).ThrottlingManager.ActionDelegate.instance(),tags:[O(M.device),O(M.throttlingTag)]}),o.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-online",category:o.ActionRegistration.ActionCategory.NETWORK,title:O(M.goOnline),loadActionDelegate:async()=>(await U()).ThrottlingManager.ActionDelegate.instance(),tags:[O(M.device),O(M.throttlingTag)]}),e.Settings.registerSettingExtension({storageType:e.Settings.SettingStorageType.Synced,settingName:"customNetworkConditions",settingType:e.Settings.SettingType.ARRAY,defaultValue:[]});const B={showNetwork:"Show Network",network:"Network",showNetworkRequestBlocking:"Show Network request blocking",networkRequestBlocking:"Network request blocking",showNetworkConditions:"Show Network conditions",networkConditions:"Network conditions",diskCache:"disk cache",networkThrottling:"network throttling",showSearch:"Show Search",search:"Search",recordNetworkLog:"Record network log",stopRecordingNetworkLog:"Stop recording network log",hideRequestDetails:"Hide request details",colorcodeResourceTypes:"Color-code resource types",colorCode:"color code",resourceType:"resource type",colorCodeByResourceType:"Color code by resource type",useDefaultColors:"Use default colors",groupNetworkLogByFrame:"Group network log by frame",netWork:"network",frame:"frame",group:"group",groupNetworkLogItemsByFrame:"Group network log items by frame",dontGroupNetworkLogItemsByFrame:"Don't group network log items by frame",clear:"Clear network log"},F=i.i18n.registerUIStrings("panels/network/network-meta.ts",B),z=i.i18n.getLazilyComputedLocalizedString.bind(void 0,F);let W;async function K(){return W||(W=await import("../../panels/network/network.js")),W}function j(e){return void 0===W?[]:e(W)}o.ViewManager.registerViewExtension({location:"panel",id:"network",commandPrompt:z(B.showNetwork),title:z(B.network),order:40,condition:t.Runtime.ConditionName.REACT_NATIVE_UNSTABLE_NETWORK_PANEL,loadView:async()=>(await K()).NetworkPanel.NetworkPanel.instance()}),o.ViewManager.registerViewExtension({location:"drawer-view",id:"network.blocked-urls",commandPrompt:z(B.showNetworkRequestBlocking),title:z(B.networkRequestBlocking),persistence:"closeable",order:60,loadView:async()=>(await K()).BlockedURLsPane.BlockedURLsPane.instance()}),o.ViewManager.registerViewExtension({location:"drawer-view",id:"network.config",commandPrompt:z(B.showNetworkConditions),title:z(B.networkConditions),persistence:"closeable",order:40,tags:[z(B.diskCache),z(B.networkThrottling),i.i18n.lockedLazyString("useragent"),i.i18n.lockedLazyString("user agent"),i.i18n.lockedLazyString("user-agent")],loadView:async()=>(await K()).NetworkConfigView.NetworkConfigView.instance()}),o.ViewManager.registerViewExtension({location:"network-sidebar",id:"network.search-network-tab",commandPrompt:z(B.showSearch),title:z(B.search),persistence:"permanent",loadView:async()=>(await K()).NetworkPanel.SearchNetworkView.instance()}),o.ActionRegistration.registerActionExtension({actionId:"network.toggle-recording",category:o.ActionRegistration.ActionCategory.NETWORK,iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>j((e=>[e.NetworkPanel.NetworkPanel])),loadActionDelegate:async()=>(await K()).NetworkPanel.ActionDelegate.instance(),options:[{value:!0,title:z(B.recordNetworkLog)},{value:!1,title:z(B.stopRecordingNetworkLog)}],bindings:[{shortcut:"Ctrl+E",platform:"windows,linux"},{shortcut:"Meta+E",platform:"mac"}]}),o.ActionRegistration.registerActionExtension({actionId:"network.clear",category:o.ActionRegistration.ActionCategory.NETWORK,title:z(B.clear),iconClass:"clear",loadActionDelegate:async()=>(await K()).NetworkPanel.ActionDelegate.instance(),contextTypes:()=>j((e=>[e.NetworkPanel.NetworkPanel])),bindings:[{shortcut:"Ctrl+L"},{shortcut:"Meta+K",platform:"mac"}]}),o.ActionRegistration.registerActionExtension({actionId:"network.hide-request-details",category:o.ActionRegistration.ActionCategory.NETWORK,title:z(B.hideRequestDetails),contextTypes:()=>j((e=>[e.NetworkPanel.NetworkPanel])),loadActionDelegate:async()=>(await K()).NetworkPanel.ActionDelegate.instance(),bindings:[{shortcut:"Esc"}]}),o.ActionRegistration.registerActionExtension({actionId:"network.search",category:o.ActionRegistration.ActionCategory.NETWORK,title:z(B.search),contextTypes:()=>j((e=>[e.NetworkPanel.NetworkPanel])),loadActionDelegate:async()=>(await K()).NetworkPanel.ActionDelegate.instance(),bindings:[{platform:"mac",shortcut:"Meta+F",keybindSets:["devToolsDefault","vsCode"]},{platform:"windows,linux",shortcut:"Ctrl+F",keybindSets:["devToolsDefault","vsCode"]}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.NETWORK,storageType:e.Settings.SettingStorageType.Synced,title:z(B.colorcodeResourceTypes),settingName:"networkColorCodeResourceTypes",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,tags:[z(B.colorCode),z(B.resourceType)],options:[{value:!0,title:z(B.colorCodeByResourceType)},{value:!1,title:z(B.useDefaultColors)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.NETWORK,storageType:e.Settings.SettingStorageType.Synced,title:z(B.groupNetworkLogByFrame),settingName:"network.group-by-frame",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,tags:[z(B.netWork),z(B.frame),z(B.group)],options:[{value:!0,title:z(B.groupNetworkLogItemsByFrame)},{value:!1,title:z(B.dontGroupNetworkLogItemsByFrame)}]}),o.ViewManager.registerLocationResolver({name:"network-sidebar",category:o.ViewManager.ViewLocationCategory.NETWORK,loadResolver:async()=>(await K()).NetworkPanel.NetworkPanel.instance()}),o.ContextMenu.registerProvider({contextTypes:()=>[a.NetworkRequest.NetworkRequest,a.Resource.Resource,r.UISourceCode.UISourceCode],loadProvider:async()=>(await K()).NetworkPanel.ContextMenuProvider.instance(),experiment:void 0}),e.Revealer.registerRevealer({contextTypes:()=>[a.NetworkRequest.NetworkRequest],destination:e.Revealer.RevealerDestination.NETWORK_PANEL,loadRevealer:async()=>(await K()).NetworkPanel.RequestRevealer.instance()}),e.Revealer.registerRevealer({contextTypes:()=>[s.UIRequestLocation.UIRequestLocation],loadRevealer:async()=>(await K()).NetworkPanel.RequestLocationRevealer.instance(),destination:void 0}),e.Revealer.registerRevealer({contextTypes:()=>[s.NetworkRequestId.NetworkRequestId],destination:e.Revealer.RevealerDestination.NETWORK_PANEL,loadRevealer:async()=>(await K()).NetworkPanel.RequestIdRevealer.instance()}),e.Revealer.registerRevealer({contextTypes:()=>[s.UIFilter.UIRequestFilter],destination:e.Revealer.RevealerDestination.NETWORK_PANEL,loadRevealer:async()=>(await K()).NetworkPanel.NetworkLogWithFilterRevealer.instance()});const q={profiler:"Profiler",showProfiler:"Show Profiler",performance:"Performance",showPerformance:"Show Performance",startStopRecording:"Start/stop recording",showRecentTimelineSessions:"Show recent timeline sessions",record:"Record",stop:"Stop",startProfilingAndReloadPage:"Start profiling and reload page"},G=i.i18n.registerUIStrings("panels/js_profiler/js_profiler-meta.ts",q),H=i.i18n.getLazilyComputedLocalizedString.bind(void 0,G);let J,Q;async function Y(){return Q||(Q=await import("../../panels/profiler/profiler.js")),Q}async function X(){return J||(J=await import("../../panels/timeline/timeline.js")),J}function Z(e){return void 0===J?[]:e(J)}o.ViewManager.registerViewExtension({location:"panel",id:"js_profiler",title:H(q.profiler),commandPrompt:H(q.showProfiler),order:65,persistence:"permanent",experiment:t.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,loadView:async()=>(await Y()).ProfilesPanel.JSProfilerPanel.instance()}),o.ActionRegistration.registerActionExtension({actionId:"profiler.js-toggle-recording",category:o.ActionRegistration.ActionCategory.JAVASCRIPT_PROFILER,title:H(q.startStopRecording),iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>void 0===Q?[]:(e=>[e.ProfilesPanel.JSProfilerPanel])(Q),loadActionDelegate:async()=>(await Y()).ProfilesPanel.JSProfilerPanel.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),o.ActionRegistration.registerActionExtension({actionId:"timeline.show-history",loadActionDelegate:async()=>(await X()).TimelinePanel.ActionDelegate.instance(),category:o.ActionRegistration.ActionCategory.PERFORMANCE,title:H(q.showRecentTimelineSessions),contextTypes:()=>Z((e=>[e.TimelinePanel.TimelinePanel])),bindings:[{platform:"windows,linux",shortcut:"Ctrl+H"},{platform:"mac",shortcut:"Meta+Y"}]}),o.ActionRegistration.registerActionExtension({actionId:"timeline.toggle-recording",category:o.ActionRegistration.ActionCategory.PERFORMANCE,iconClass:"record-start",toggleable:!0,toggledIconClass:"record-stop",toggleWithRedColor:!0,contextTypes:()=>Z((e=>[e.TimelinePanel.TimelinePanel])),loadActionDelegate:async()=>(await X()).TimelinePanel.ActionDelegate.instance(),options:[{value:!0,title:H(q.record)},{value:!1,title:H(q.stop)}],bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),o.ActionRegistration.registerActionExtension({actionId:"timeline.record-reload",iconClass:"refresh",contextTypes:()=>Z((e=>[e.TimelinePanel.TimelinePanel])),category:o.ActionRegistration.ActionCategory.PERFORMANCE,title:H(q.startProfilingAndReloadPage),loadActionDelegate:async()=>(await X()).TimelinePanel.ActionDelegate.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+Shift+E"},{platform:"mac",shortcut:"Meta+Shift+E"}]});const $={rnWelcome:"⚛️ Welcome",showRnWelcome:"Show React Native Welcome panel"},ee=i.i18n.registerUIStrings("panels/rn_welcome/rn_welcome-meta.ts",$),te=i.i18n.getLazilyComputedLocalizedString.bind(void 0,ee);let oe;o.ViewManager.registerViewExtension({location:"panel",id:"rn-welcome",title:te($.rnWelcome),commandPrompt:te($.showRnWelcome),order:-10,persistence:"permanent",loadView:async()=>(await async function(){return oe||(oe=await import("../../panels/rn_welcome/rn_welcome.js")),oe}()).RNWelcome.RNWelcomeImpl.instance(),experiment:t.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI}),l.RNPerfMetrics.registerPerfMetricsGlobalPostMessageHandler(),t.Runtime.experiments.register(t.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,"Enable JavaScript Profiler (legacy)",!1),t.Runtime.experiments.register(t.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,"Show React Native-specific UI",!1),t.Runtime.experiments.register(t.Runtime.ExperimentName.ENABLE_REACT_DEVTOOLS_PANEL,"Enable React DevTools panel",!0),t.Runtime.experiments.enableExperimentsByDefault([t.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE,t.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI]);class ie extends a.SDKModel.SDKModel{constructor(e){super(e),e.router()?.sendMessage(e.sessionId,"FuseboxClient","FuseboxClient.setClientMetadata",{},(()=>{}))}}a.SDKModel.SDKModel.register(ie,{capabilities:a.Target.Capability.None,autostart:!0}),self.runtime=t.Runtime.Runtime.instance({forceNew:!0}),new c.MainImpl.MainImpl; diff --git a/packages/debugger-frontend/dist/third-party/front_end/inspector.html b/packages/debugger-frontend/dist/third-party/front_end/inspector.html index 3484b3280d95bd..35043750dcdac2 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/inspector.html +++ b/packages/debugger-frontend/dist/third-party/front_end/inspector.html @@ -17,5 +17,6 @@ + diff --git a/packages/debugger-frontend/dist/third-party/front_end/js_app.html b/packages/debugger-frontend/dist/third-party/front_end/js_app.html index b55821f5acc5db..c43145fc6c52bf 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/js_app.html +++ b/packages/debugger-frontend/dist/third-party/front_end/js_app.html @@ -17,5 +17,6 @@ + diff --git a/packages/debugger-frontend/dist/third-party/front_end/ndb_app.html b/packages/debugger-frontend/dist/third-party/front_end/ndb_app.html index d7cad3a743df1b..26879bc1ebee46 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/ndb_app.html +++ b/packages/debugger-frontend/dist/third-party/front_end/ndb_app.html @@ -17,5 +17,6 @@ + diff --git a/packages/debugger-frontend/dist/third-party/front_end/node_app.html b/packages/debugger-frontend/dist/third-party/front_end/node_app.html index 70b82d8edcc517..38ae19a1c1f5e5 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/node_app.html +++ b/packages/debugger-frontend/dist/third-party/front_end/node_app.html @@ -17,5 +17,6 @@ + diff --git a/packages/debugger-frontend/dist/third-party/front_end/panels/profiler/profiler.js b/packages/debugger-frontend/dist/third-party/front_end/panels/profiler/profiler.js index 07ff97d1b0a8ea..58282c4391b251 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/panels/profiler/profiler.js +++ b/packages/debugger-frontend/dist/third-party/front_end/panels/profiler/profiler.js @@ -4,4 +4,4 @@ import*as e from"../../core/platform/platform.js";import*as t from"../../core/i1 ${t} @${this.snapshotNodeId} - `,r=i.$("container");this.prefixObjectCell(r),this.reachableFromWindow&&r.appendChild(s.Fragment.html`🗖`),this.detachedDOMTreeNode&&r.appendChild(s.Fragment.html``),this.appendSourceLocation(r);const o=i.element();return this.depth&&o.style.setProperty("padding-left",this.depth*this.dataGrid.indentWidth+"px"),o}prefixObjectCell(e){}async appendSourceLocation(e){const t=s.Fragment.html``;e.appendChild(t);const i=await this.dataGridInternal.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(qe(Je.previewIsNotAvailable))}async tryQueryObjectContent(e,t){return"string"===this.type?e.runtimeModel().createRemoteObjectFromPrimitiveValue(this.nameInternal):await e.objectForSnapshotObjectId(String(this.snapshotNodeId),t)}async updateHasChildren(){const e=await this.provider().isEmpty();this.setHasChildren(!e)}shortenWindowURL(t,i){const r=t.indexOf("/"),s=i?t.indexOf("@"):t.length;if(-1===r||-1===s)return t;const o=t.substring(r+1,s).trimLeft();let n=e.StringUtilities.trimURL(o);return n.length>40&&(n=e.StringUtilities.trimMiddle(n,40)),t.substr(0,r+2)+n+t.substr(s)}populateContextMenu(e,t,i){if(e.revealSection().appendItem(qe(Je.revealInSummaryView),(()=>{t.showObject(String(this.snapshotNodeId),qe(Je.summary))})),this.referenceName)for(const i of this.referenceName.matchAll(/\((?[^@)]*) @(?\d+)\)/g)){const{objectName:r,snapshotNodeId:s}=i.groups;e.revealSection().appendItem(qe(Je.revealObjectSWithIdSInSummary,{PH1:r,PH2:s}),(()=>{t.showObject(s,qe(Je.summary))}))}i&&e.revealSection().appendItem(qe(Je.storeAsGlobalVariable),(async()=>{const e=await this.tryQueryObjectContent(i,"");if(e){const t=i.target().model(l.ConsoleModel.ConsoleModel);await(t?.saveToTempVariable(s.Context.Context.instance().flavor(l.RuntimeModel.ExecutionContext),e))}else o.Console.Console.instance().error(qe(Je.previewIsNotAvailable))}))}}class Ze extends Ye{referenceName;referenceType;edgeIndex;snapshot;parentObjectNode;cycledWithAncestorGridNode;constructor(e,t,i,r){super(e,i.node),this.referenceName=i.name,this.referenceType=i.type,this.edgeIndex=i.edgeIndex,this.snapshot=t,this.parentObjectNode=r,this.cycledWithAncestorGridNode=this.findAncestorWithSameSnapshotNodeId(),this.cycledWithAncestorGridNode||this.updateHasChildren();const s=this.data;s.count="",s.addedCount="",s.removedCount="",s.countDelta="",s.addedSize="",s.removedSize="",s.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 Ze(this.dataGridInternal,this.snapshot,e,this)}getHash(){return this.edgeIndex}comparator(){const e=this.dataGridInternal.isSortOrderAscending();switch(this.dataGridInternal.sortColumnId()){case"object":return new p.HeapSnapshotModel.ComparatorConfig("!edgeName",e,"retainedSize",!1);case"count":default:return new p.HeapSnapshotModel.ComparatorConfig("!edgeName",!0,"retainedSize",!1);case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("selfSize",e,"!edgeName",!0);case"retainedSize":return new p.HeapSnapshotModel.ComparatorConfig("retainedSize",e,"!edgeName",!0);case"distance":return new p.HeapSnapshotModel.ComparatorConfig("distance",e,"name",!0)}}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(s.Fragment.html`${t} ${this.edgeNodeSeparator()}`)}edgeNodeSeparator(){return"::"}}class Xe extends Ze{constructor(e,t,i,r){super(e,t,i,r)}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 Xe(this.dataGridInternal,this.snapshot,e,this)}edgeNodeSeparator(){return qe(Je.inElement)}expand(){this.expandRetainersChain(20)}expandRetainersChain(e){if(!this.populated)return this.once(Ke.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.dataGridInternal.dispatchEventToListeners(pt.ExpandRetainersComplete)}}class et extends Ye{baseSnapshotOrSnapshot;isDeletedNode;constructor(t,i,r,s){super(t,r),this.baseSnapshotOrSnapshot=i,this.isDeletedNode=s,this.updateHasChildren();const o=this.data;o.count="",o.countDelta="",o.sizeDelta="",this.isDeletedNode?(o.addedCount="",o.addedSize="",o.removedCount="•",o.removedSize=e.NumberUtilities.withThousandsSeparator(this.shallowSize||0)):(o.addedCount="•",o.addedSize=e.NumberUtilities.withThousandsSeparator(this.shallowSize||0),o.removedCount="",o.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 Ze(this.dataGridInternal,this.baseSnapshotOrSnapshot,e,null)}getHash(){if(void 0===this.snapshotNodeId)throw new Error("Cannot hash root nodes");return this.snapshotNodeId}comparator(){const e=this.dataGridInternal.isSortOrderAscending();switch(this.dataGridInternal.sortColumnId()){case"object":return new p.HeapSnapshotModel.ComparatorConfig("!edgeName",e,"retainedSize",!1);case"distance":return new p.HeapSnapshotModel.ComparatorConfig("distance",e,"retainedSize",!1);case"count":default:return new p.HeapSnapshotModel.ComparatorConfig("!edgeName",!0,"retainedSize",!1);case"addedSize":case"removedSize":case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("selfSize",e,"!edgeName",!0);case"retainedSize":return new p.HeapSnapshotModel.ComparatorConfig("retainedSize",e,"!edgeName",!0)}}}class tt extends Ke{nameInternal;nodeFilter;distance;count;shallowSize;retainedSize;constructor(t,i,r,s){super(t,r.count>0),this.nameInternal=i,this.nodeFilter=s,this.distance=r.distance,this.count=r.count,this.shallowSize=r.self,this.retainedSize=r.maxRet;const o=t.snapshot,n=this.retainedSize/o.totalSize*100,a=this.shallowSize/o.totalSize*100;this.data={object:i,count:e.NumberUtilities.withThousandsSeparator(this.count),distance:this.toUIDistance(this.distance),shallowSize:e.NumberUtilities.withThousandsSeparator(this.shallowSize),retainedSize:e.NumberUtilities.withThousandsSeparator(this.retainedSize),"shallowSize-percent":this.toPercentString(a),"retainedSize-percent":this.toPercentString(n)}}get name(){return this.nameInternal}createProvider(){return this.dataGridInternal.snapshot.createNodesProviderForClass(this.nameInternal,this.nodeFilter)}async populateNodeBySnapshotObjectId(e){this.dataGridInternal.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.nameInternal.toLowerCase().indexOf(e)}createCell(e){const t="object"===e?super.createCell(e):this.createValueCell(e);return"object"===e&&this.count>1&&t.appendChild(s.Fragment.html`×${this.count}`),t}createChildNode(e){return new et(this.dataGridInternal,this.dataGridInternal.snapshot,e,!1)}comparator(){const e=this.dataGridInternal.isSortOrderAscending(),t=this.dataGridInternal.sortColumnId();switch(t){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",e,"id",!0);case"distance":return new p.HeapSnapshotModel.ComparatorConfig("distance",e,"retainedSize",!1);case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("selfSize",e,"id",!0);case"retainedSize":return new p.HeapSnapshotModel.ComparatorConfig("retainedSize",e,"id",!0);default:throw new Error(`Invalid sort column id ${t}`)}}}class it{addedNodesProvider;deletedNodesProvider;addedCount;removedCount;constructor(e,t,i,r){this.addedNodesProvider=e,this.deletedNodesProvider=t,this.addedCount=i,this.removedCount=r}dispose(){this.addedNodesProvider.dispose(),this.deletedNodesProvider.dispose()}nodePosition(e){throw new Error("Unreachable")}isEmpty(){return Promise.resolve(!1)}async serializeItemsRange(e,t){let i,r;if(e=t)return i.totalLength=this.addedCount+this.removedCount,i;r=i,i=await this.deletedNodesProvider.serializeItemsRange(0,t-i.endPosition)}else r=new p.HeapSnapshotModel.ItemsRange(0,0,0,[]),i=await this.deletedNodesProvider.serializeItemsRange(e-this.addedCount,t-this.addedCount);r.items.length||(r.startPosition=this.addedCount+i.startPosition);for(const e of i.items)e.isAddedNotRemoved=!1;return r.items.push(...i.items),r.endPosition=this.addedCount+i.endPosition,r.totalLength=this.addedCount+this.removedCount,r}async sortAndRewind(e){await this.addedNodesProvider.sortAndRewind(e),await this.deletedNodesProvider.sortAndRewind(e)}}class rt extends Ke{nameInternal;addedCount;removedCount;countDelta;addedSize;removedSize;sizeDelta;deletedIndexes;constructor(t,i,r){super(t,!0),this.nameInternal=i,this.addedCount=r.addedCount,this.removedCount=r.removedCount,this.countDelta=r.countDelta,this.addedSize=r.addedSize,this.removedSize=r.removedSize,this.sizeDelta=r.sizeDelta,this.deletedIndexes=r.deletedIndexes,this.data={object:i,addedCount:e.NumberUtilities.withThousandsSeparator(this.addedCount),removedCount:e.NumberUtilities.withThousandsSeparator(this.removedCount),countDelta:this.signForDelta(this.countDelta)+e.NumberUtilities.withThousandsSeparator(Math.abs(this.countDelta)),addedSize:e.NumberUtilities.withThousandsSeparator(this.addedSize),removedSize:e.NumberUtilities.withThousandsSeparator(this.removedSize),sizeDelta:this.signForDelta(this.sizeDelta)+e.NumberUtilities.withThousandsSeparator(Math.abs(this.sizeDelta))}}get name(){return this.nameInternal}createProvider(){const e=this.dataGridInternal;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.nameInternal),i=e.baseSnapshot.createDeletedNodesProvider(this.deletedIndexes);if(!t||!i)throw new Error("Failed to create node providers");return new it(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.dataGridInternal;if(e.isAddedNotRemoved){if(null===t.snapshot)throw new Error("Data sources have not been set correctly");return new et(this.dataGridInternal,t.snapshot,e,!1)}if(void 0===t.baseSnapshot)throw new Error("Data sources have not been set correctly");return new et(this.dataGridInternal,t.baseSnapshot,e,!0)}comparator(){const e=this.dataGridInternal.isSortOrderAscending(),t=this.dataGridInternal.sortColumnId();switch(t){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",e,"id",!0);case"addedCount":case"removedCount":case"countDelta":return new p.HeapSnapshotModel.ComparatorConfig("name",!0,"id",!0);case"addedSize":case"removedSize":case"sizeDelta":return new p.HeapSnapshotModel.ComparatorConfig("selfSize",e,"id",!0);default:throw new Error(`Invalid sort column ${t}`)}}filteredOut(e){return-1===this.nameInternal.toLowerCase().indexOf(e)}signForDelta(e){return 0===e?"":e>0?"+":"−"}}class st extends Ke{populated;allocationNode;constructor(t,i){super(t,i.hasChildren),this.populated=!1,this.allocationNode=i,this.data={liveCount:e.NumberUtilities.withThousandsSeparator(i.liveCount),count:e.NumberUtilities.withThousandsSeparator(i.count),liveSize:e.NumberUtilities.withThousandsSeparator(i.liveSize),size:e.NumberUtilities.withThousandsSeparator(i.size),name:i.name}}populate(){this.populated||this.doPopulate()}async doPopulate(){this.populated=!0;const e=await this.dataGridInternal.snapshot.allocationNodeCallers(this.allocationNode.id),t=e.nodesWithSingleCaller;let i=this;const r=this.dataGridInternal;for(const e of t){const t=new st(r,e);r.appendNode(i,t),i=t,i.populated=!0,this.expanded&&i.expand()}const s=e.branchingCallers;s.sort(this.dataGridInternal.createComparator());for(const e of s)r.appendNode(i,new st(r,e));r.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,r=this.dataGridInternal.heapProfilerModel();if(i.scriptId){const e=this.dataGridInternal.linkifier.linkifyScriptLocation(r?r.target():null,String(i.scriptId),i.scriptName,i.line-1,{columnNumber:i.column-1,inlineFrameIndex:0,className:"profile-node-file"});e.style.maxWidth="75%",t.insertBefore(e,t.firstChild)}return t}allocationNodeId(){return this.allocationNode.id}}var ot=Object.freeze({__proto__:null,get HeapSnapshotGridNode(){return Ke},HeapSnapshotGenericObjectNode:Ye,HeapSnapshotObjectNode:Ze,HeapSnapshotRetainingObjectNode:Xe,HeapSnapshotInstanceNode:et,HeapSnapshotConstructorNode:tt,HeapSnapshotDiffNodesProvider:it,HeapSnapshotDiffNode:rt,AllocationGridNode:st});const nt={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"},at=t.i18n.registerUIStrings("panels/profiler/HeapSnapshotDataGrids.ts",nt),lt=t.i18n.getLocalizedString.bind(void 0,at),dt=new WeakMap;class ht extends r.DataGrid.DataGridImpl{}class ct extends(o.ObjectWrapper.eventMixin(ht)){snapshot;selectedNode;heapProfilerModelInternal;dataDisplayDelegateInternal;recursiveSortingDepth;populatedAndSorted;nameFilter;nodeFilterInternal;lastSortColumnId;lastSortAscending;constructor(e,t,i){super(i),this.snapshot=null,this.selectedNode=null,this.heapProfilerModelInternal=e,this.dataDisplayDelegateInternal=t;const s=[["distance",lt(nt.distanceFromWindowObject)],["shallowSize",lt(nt.sizeOfTheObjectItselfInBytes)],["retainedSize",lt(nt.sizeOfTheObjectPlusTheGraphIt)]];for(const e of s){const t=this.headerTableHeader(e[0]);t&&t.setAttribute("title",e[1])}this.recursiveSortingDepth=0,this.populatedAndSorted=!1,this.nameFilter=null,this.nodeFilterInternal=new p.HeapSnapshotModel.NodeFilter,this.addEventListener(pt.SortingComplete,this.sortingComplete,this),this.addEventListener(r.DataGrid.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 rt||e instanceof tt)&&e.filteredOut(t))}heapProfilerModel(){return this.heapProfilerModelInternal}dataDisplayDelegate(){return this.dataDisplayDelegateInternal}nodeFilter(){return this.nodeFilterInternal}setNameFilter(e){this.nameFilter=e}defaultPopulateCount(){return 100}disposeAllNodes(){const e=this.topLevelNodes();for(let t=0,i=e.length;ts?1:0;return i.ascending1||(o=-o),0!==o||(r=e[i.fieldName2],s=t[i.fieldName2],o=rs?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=this.topPaddingHeight&&r>=this.bottomPaddingHeight)return;i-=500,s+=1e3;const o=this.selectedNode;this.rootNode().removeChildren(),this.topPaddingHeight=0,this.bottomPaddingHeight=0,this.addVisibleNodes(this.rootNode(),i,i+s),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 r=this.allChildren(e);let s=0,o=0;for(;ot)break;s=i}let n=s;for(;o=r&&t{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 r=0;r=t}onResize(){super.onResize(),this.updateVisibleNodes(!1)}onScroll(e){this.updateVisibleNodes(!1),this.scrollToResolveCallback&&(this.scrollToResolveCallback(),this.scrollToResolveCallback=null)}}class ft extends ct{constructor(e,t,i,s){super(e,t,{displayName:i,columns:s=s||[{id:"object",title:lt(nt.object),disclosure:!0,sortable:!0},{id:"distance",title:lt(nt.distance),width:"70px",sortable:!0,fixedWidth:!0},{id:"shallowSize",title:lt(nt.shallowSize),width:"110px",sortable:!0,fixedWidth:!0},{id:"retainedSize",title:lt(nt.retainedSize),width:"110px",sortable:!0,fixedWidth:!0,sort:r.DataGrid.Order.Descending}]})}async setDataSource(e,t){this.snapshot=e;const i=new p.HeapSnapshotModel.Node(-1,"root",0,t||e.rootNodeIndex,0,0,"");this.setRootNode(this.createRootNode(e,i)),this.rootNode().sort()}createRootNode(e,t){const i=new p.HeapSnapshotModel.Edge("",t,"",-1);return new Ze(this,e,i,null)}sortingChanged(){const e=this.rootNode();e.hasChildren()&&e.sort()}}class gt extends ft{constructor(e,t){const i=[{id:"object",title:lt(nt.object),disclosure:!0,sortable:!0},{id:"distance",title:lt(nt.distance),width:"70px",sortable:!0,fixedWidth:!0,sort:r.DataGrid.Order.Ascending},{id:"shallowSize",title:lt(nt.shallowSize),width:"110px",sortable:!0,fixedWidth:!0},{id:"retainedSize",title:lt(nt.retainedSize),width:"110px",sortable:!0,fixedWidth:!0}];super(e,t,lt(nt.heapSnapshotRetainment),i)}createRootNode(e,t){const i=new p.HeapSnapshotModel.Edge("",t,"",-1);return new Xe(this,e,i,null)}sortFields(e,t){switch(e){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",t,"count",!1);case"count":return new p.HeapSnapshotModel.ComparatorConfig("count",t,"name",!0);case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("shallowSize",t,"name",!0);case"retainedSize":return new p.HeapSnapshotModel.ComparatorConfig("retainedSize",t,"name",!0);case"distance":return new p.HeapSnapshotModel.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()}}!function(e){e.ExpandRetainersComplete="ExpandRetainersComplete"}(ut||(ut={}));class vt extends mt{profileIndex;objectIdToSelect;nextRequestedFilter;lastFilter;filterInProgress;constructor(e,t){const i=[{id:"object",title:lt(nt.constructorString),disclosure:!0,sortable:!0},{id:"distance",title:lt(nt.distance),width:"70px",sortable:!0,fixedWidth:!0},{id:"shallowSize",title:lt(nt.shallowSize),width:"110px",sortable:!0,fixedWidth:!0},{id:"retainedSize",title:lt(nt.retainedSize),width:"110px",sort:r.DataGrid.Order.Descending,sortable:!0,fixedWidth:!0}];super(e,t,{displayName:lt(nt.heapSnapshotConstructors).toString(),columns:i}),this.profileIndex=-1,this.objectIdToSelect=null,this.nextRequestedFilter=null}sortFields(e,t){switch(e){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",t,"retainedSize",!1);case"distance":return new p.HeapSnapshotModel.ComparatorConfig("distance",t,"retainedSize",!1);case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("shallowSize",t,"name",!0);case"retainedSize":return new p.HeapSnapshotModel.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 r=await i.populateNodeBySnapshotObjectId(parseInt(e,10));return r.length?this.revealTreeNode(r):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.nodeFilterInternal=new p.HeapSnapshotModel.NodeFilter(e,t),this.populateChildren(this.nodeFilterInternal)}setAllocationNodeId(e){this.nodeFilterInternal=new p.HeapSnapshotModel.NodeFilter,this.nodeFilterInternal.allocationNodeId=e,this.populateChildren(this.nodeFilterInternal)}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 tt(this,i,t[i],e));this.sortingChanged(),this.lastFilter=e}async populateChildren(e){const t=e||new p.HeapSnapshotModel.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.nodeFilterInternal=void 0,-1!==t){const i=t>0?e[t-1].maxJSObjectId:0,r=e[t].maxJSObjectId;this.nodeFilterInternal=new p.HeapSnapshotModel.NodeFilter(i,r)}this.populateChildren(this.nodeFilterInternal)}}class wt extends mt{baseSnapshot;constructor(e,t){const i=[{id:"object",title:lt(nt.constructorString),disclosure:!0,sortable:!0},{id:"addedCount",title:lt(nt.New),width:"75px",sortable:!0,fixedWidth:!0},{id:"removedCount",title:lt(nt.Deleted),width:"75px",sortable:!0,fixedWidth:!0},{id:"countDelta",title:lt(nt.Delta),width:"65px",sortable:!0,fixedWidth:!0},{id:"addedSize",title:lt(nt.allocSize),width:"75px",sortable:!0,fixedWidth:!0,sort:r.DataGrid.Order.Descending},{id:"removedSize",title:lt(nt.freedSize),width:"75px",sortable:!0,fixedWidth:!0},{id:"sizeDelta",title:lt(nt.sizeDelta),width:"75px",sortable:!0,fixedWidth:!0}];super(e,t,{displayName:lt(nt.heapSnapshotDiff).toString(),columns:i})}defaultPopulateCount(){return 50}sortFields(e,t){switch(e){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",t,"count",!1);case"addedCount":return new p.HeapSnapshotModel.ComparatorConfig("addedCount",t,"name",!0);case"removedCount":return new p.HeapSnapshotModel.ComparatorConfig("removedCount",t,"name",!0);case"countDelta":return new p.HeapSnapshotModel.ComparatorConfig("countDelta",t,"name",!0);case"addedSize":return new p.HeapSnapshotModel.ComparatorConfig("addedSize",t,"name",!0);case"removedSize":return new p.HeapSnapshotModel.ComparatorConfig("removedSize",t,"name",!0);case"sizeDelta":return new p.HeapSnapshotModel.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(pt.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 rt(this,e,i))}this.sortingChanged()}}class St extends mt{linkifierInternal;topNodes;constructor(e,t){const i=[{id:"liveCount",title:lt(nt.liveCount),width:"75px",sortable:!0,fixedWidth:!0},{id:"count",title:lt(nt.count),width:"65px",sortable:!0,fixedWidth:!0},{id:"liveSize",title:lt(nt.liveSize),width:"75px",sortable:!0,fixedWidth:!0},{id:"size",title:lt(nt.size),width:"75px",sortable:!0,fixedWidth:!0,sort:r.DataGrid.Order.Descending},{id:"name",title:lt(nt.function),disclosure:!0,sortable:!0}];super(e,t,{displayName:lt(nt.allocation).toString(),columns:i}),this.linkifierInternal=new d.Linkifier.Linkifier}get linkifier(){return this.linkifierInternal}dispose(){this.linkifierInternal.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 st(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.DataGrid.Order.Ascending?1:-1;return function(i,r){return i[e]>r[e]?t:i[e]{e(t?new r(this,n):null)})),this.postMessage({callId:s,disposition:"factory",objectId:t,methodName:i,methodArguments:o,newObjectId:n}),null):(this.postMessage({callId:s,disposition:"factory",objectId:t,methodName:i,methodArguments:o,newObjectId:n}),new r(this,n))}callMethod(e,t,i){const r=this.nextCallId++,s=Array.prototype.slice.call(arguments,3);e&&this.callbacks.set(r,e),this.postMessage({callId:r,disposition:"method",objectId:t,methodName:i,methodArguments:s})}startCheckingForLongRunningCalls(){this.interval||(this.checkLongRunningCalls(),this.interval=window.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("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.Console.instance().error(Tt(Ct.anErrorOccurredWhenACallToMethod,{PH1:t.errorMethodName})),o.Console.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)}}class yt{worker;objectId;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,...r){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 It extends yt{profileUid;snapshotReceivedCallback;constructor(e,t,i,r){super(e,t),this.profileUid=i,this.snapshotReceivedCallback=r}async write(e){await this.callMethodPromise("write",e)}async close(){await this.callMethodPromise("close");const e=await new Promise((e=>this.callFactoryMethod(e,"buildSnapshot",Rt)));this.dispose(),e.setProfileUid(this.profileUid),await e.updateStaticData(),this.snapshotReceivedCallback(e)}}class Rt extends yt{staticData;profileUid;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",Et,e)}createRetainingEdgesProvider(e){return this.callFactoryMethod(null,"createRetainingEdgesProvider",Et,e)}createAddedNodesProvider(e,t){return this.callFactoryMethod(null,"createAddedNodesProvider",Et,e,t)}createDeletedNodesProvider(e){return this.callFactoryMethod(null,"createDeletedNodesProvider",Et,e)}createNodesProvider(e){return this.callFactoryMethod(null,"createNodesProvider",Et,e)}createNodesProviderForClass(e,t){return this.callFactoryMethod(null,"createNodesProviderForClass",Et,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 Et extends yt{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 Nt=Object.freeze({__proto__:null,HeapSnapshotWorkerProxy:xt,HeapSnapshotProxyObject:yt,HeapSnapshotLoaderProxy:It,HeapSnapshotProxy:Rt,HeapSnapshotProviderProxy:Et});const kt={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.",exposeInternals:"Expose internals (includes additional implementation-specific details)",captureNumericValue:"Include numerical values in capture",snapshotting:"Snapshotting…",snapshotD:"Snapshot {PH1}",percentagePlaceholder:"{PH1}%",allocationInstrumentationOn:"Allocation instrumentation on timeline",stopRecordingHeapProfile:"Stop recording heap profile",startRecordingHeapProfile:"Start recording heap profile",recordAllocationStacksExtra:"Record stack traces of allocations (extra performance overhead)",recording:"Recording…",allocationTimelines:"ALLOCATION TIMELINES",AllocationTimelinesShowInstrumented:"Allocation timelines show instrumented JavaScript memory allocations over time. Once profile is recorded you can select a time interval to see objects that were allocated within it and still alive by the end of recording. 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."},Dt=t.i18n.registerUIStrings("panels/profiler/HeapSnapshotView.ts",kt),Mt=t.i18n.getLocalizedString.bind(void 0,Dt),Ft=t.i18n.registerUIStrings("panels/profiler/ModuleUIStrings.ts",{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…"}),Ht=t.i18n.getLocalizedString.bind(void 0,Ft);class Lt extends s.View.SimpleView{searchResults;profile;linkifier;parentDataDisplayDelegate;searchableViewInternal;splitWidget;containmentDataGrid;containmentWidget;statisticsView;constructorsDataGrid;constructorsWidget;diffDataGrid;diffWidget;allocationDataGrid;allocationWidget;allocationStackView;tabbedPane;retainmentDataGrid;retainmentWidget;objectDetailsView;perspectives;comparisonPerspective;perspectiveSelect;baseSelect;filterSelect;classNameFilter;selectedSizeText;popoverHelper;currentPerspectiveIndex;currentPerspective;dataGrid;searchThrottler;baseProfile;trackingOverviewGrid;currentSearchResultIndex=-1;currentQuery;constructor(e,t){super(Mt(kt.heapSnapshot)),this.searchResults=[],this.element.classList.add("heap-snapshot-view"),this.profile=t,this.linkifier=new d.Linkifier.Linkifier;const i=t.profileType();i.addEventListener("SnapshotReceived",this.onReceiveSnapshot,this),i.addEventListener(D.RemoveProfileHeader,this.onProfileHeaderRemoved,this);const n=i.id===At.TypeId;n&&this.createOverview();const a=Kt.trackingHeapSnapshotProfileType.recordAllocationStacksSetting().get();this.parentDataDisplayDelegate=e,this.searchableViewInternal=new s.SearchableView.SearchableView(this,null),this.searchableViewInternal.setPlaceholder(Mt(kt.find),Mt(kt.find)),this.searchableViewInternal.show(this.element),this.splitWidget=new s.SplitWidget.SplitWidget(!1,!0,"heapSnapshotSplitViewState",200,200),this.splitWidget.show(this.searchableViewInternal.element);const l=t.heapProfilerModel();let h;if(this.containmentDataGrid=new ft(l,this,Mt(kt.containment)),this.containmentDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.selectionChanged,this),this.containmentWidget=this.containmentDataGrid.asWidget(),this.containmentWidget.setMinimumSize(50,25),this.statisticsView=new _t,this.constructorsDataGrid=new vt(l,this),this.constructorsDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.selectionChanged,this),this.constructorsWidget=this.constructorsDataGrid.asWidget(),this.constructorsWidget.setMinimumSize(50,25),this.diffDataGrid=new wt(l,this),this.diffDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.selectionChanged,this),this.diffWidget=this.diffDataGrid.asWidget(),this.diffWidget.setMinimumSize(50,25),this.allocationDataGrid=null,n&&a&&(this.allocationDataGrid=new St(l,this),this.allocationDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.onSelectAllocationNode,this),this.allocationWidget=this.allocationDataGrid.asWidget(),this.allocationWidget.setMinimumSize(50,25),this.allocationStackView=new Jt(l),this.allocationStackView.setMinimumSize(50,25),this.tabbedPane=new s.TabbedPane.TabbedPane),this.retainmentDataGrid=new gt(l,this),this.retainmentWidget=this.retainmentDataGrid.asWidget(),this.retainmentWidget.setMinimumSize(50,21),this.retainmentWidget.element.classList.add("retaining-paths-view"),this.allocationStackView)this.tabbedPane=new s.TabbedPane.TabbedPane,this.tabbedPane.appendTab("retainers",Mt(kt.retainers),this.retainmentWidget),this.tabbedPane.appendTab("allocation-stack",Mt(kt.allocationStack),this.allocationStackView),h=this.tabbedPane.headerElement(),this.objectDetailsView=this.tabbedPane;else{const e=document.createElement("div");e.classList.add("heap-snapshot-view-resizer");const t=e.createChild("div","title");e.createChild("div","verticalResizerIcon");t.createChild("span").textContent=Mt(kt.retainers),h=e,this.objectDetailsView=new s.Widget.VBox,this.objectDetailsView.element.appendChild(e),this.retainmentWidget.show(this.objectDetailsView.element)}this.splitWidget.hideDefaultResizer(),this.splitWidget.installResizer(h),this.retainmentDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.inspectedObjectChanged,this),this.retainmentDataGrid.reset(),this.perspectives=[],this.comparisonPerspective=new zt,this.perspectives.push(new Ot),t.profileType()!==Kt.trackingHeapSnapshotProfileType&&this.perspectives.push(this.comparisonPerspective),this.perspectives.push(new Bt),this.allocationWidget&&this.perspectives.push(new Gt),this.perspectives.push(new Vt),this.perspectiveSelect=new s.Toolbar.ToolbarComboBox(this.onSelectedPerspectiveChanged.bind(this),Mt(kt.perspective)),this.updatePerspectiveOptions(),this.baseSelect=new s.Toolbar.ToolbarComboBox(this.changeBase.bind(this),Mt(kt.baseSnapshot)),this.baseSelect.setVisible(!1),this.updateBaseOptions(),this.filterSelect=new s.Toolbar.ToolbarComboBox(this.changeFilter.bind(this),Mt(kt.filter)),this.filterSelect.setVisible(!1),this.updateFilterOptions(),this.classNameFilter=new s.Toolbar.ToolbarInput(Mt(kt.classFilter)),this.classNameFilter.setVisible(!1),this.constructorsDataGrid.setNameFilter(this.classNameFilter),this.diffDataGrid.setNameFilter(this.classNameFilter),this.selectedSizeText=new s.Toolbar.ToolbarText,this.popoverHelper=new s.PopoverHelper.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 o.Throttler.Throttler(0);for(const e of this.profiles())e.addEventListener(k.ProfileTitleChanged,this.updateControls,this)}createOverview(){const e=this.profile.profileType();this.trackingOverviewGrid=new Re,this.trackingOverviewGrid.addEventListener("IdsRangeChanged",this.onIdsRangeChanged.bind(this)),this.profile.fromFile()||e.profileBeingRecorded()!==this.profile||(e.addEventListener("HeapStatsUpdate",this.onHeapStatsUpdate,this),e.addEventListener("TrackingStopped",this.onStopTracking,this),this.trackingOverviewGrid.start())}onStopTracking(){const e=this.profile.profileType();e.removeEventListener("HeapStatsUpdate",this.onHeapStatsUpdate,this),e.removeEventListener("TrackingStopped",this.onStopTracking,this),this.trackingOverviewGrid&&this.trackingOverviewGrid.stop()}onHeapStatsUpdate({data:e}){this.trackingOverviewGrid&&this.trackingOverviewGrid.setSamples(e)}searchableView(){return this.searchableViewInternal}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 r=t.runtimeModel().debuggerModel().createRawLocationByScriptId(String(i.scriptId),i.lineNumber,i.columnNumber);if(!r)return null;const s=r.script(),o=s&&s.sourceURL;return o&&this.linkifier?this.linkifier.linkifyRawLocation(r,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===At.TypeId&&this.profile.fromFile()){const t=await e.getSamples();if(t){console.assert(Boolean(t.timestamps.length));const e=new Ne;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:Mt(kt.code)},{value:t.strings,color:"#5e5",title:Mt(kt.strings)},{value:t.jsArrays,color:"#7af",title:Mt(kt.jsArrays)},{value:t.native,color:"#fc5",title:Mt(kt.typedArrays)},{value:t.system,color:"#98f",title:Mt(kt.systemObjects)}];return this.statisticsView.setTotalAndRecords(t.total,i),t}onIdsRangeChanged(t){const{minId:i,maxId:r}=t.data;this.selectedSizeText.setText(Mt(kt.selectedSizeS,{PH1:e.NumberUtilities.bytesToString(t.data.size)})),this.constructorsDataGrid.snapshot&&this.constructorsDataGrid.setSelectionRange(i,r)}async toolbarItems(){const e=[this.perspectiveSelect,this.classNameFilter];return this.profile.profileType()!==Kt.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}onSearchCanceled(){this.currentSearchResultIndex=-1,this.searchResults=[]}selectRevealedNode(e){e&&e.select()}performSearch(e,t,i){const r=new p.HeapSnapshotModel.SearchConfig(e.query.trim(),e.caseSensitive,e.isRegex,t,i||!1);this.searchThrottler.schedule(this.performSearchInternal.bind(this,r))}async performSearchInternal(e){if(this.onSearchCanceled(),!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.searchableViewInternal.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.searchableViewInternal.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 Ye&&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 r=i.once(pt.ContentShown),s=this.perspectiveSelect.options().find((e=>e.value===String(t)));this.perspectiveSelect.select(s),this.changePerspective(t),await r}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.Console.instance().error("Cannot find corresponding heap snapshot node")}getPopoverRequest(e){const t=s.UIUtils.enclosingNodeOrSelfWithNodeName(e.target,"span"),i=s.UIUtils.enclosingNodeOrSelfWithNodeName(e.target,"tr");if(!i)return null;if(!this.dataGrid)return null;const r=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),o=this.profile.heapProfilerModel();if(!r||!t||!o)return null;let n;return{box:t.boxInWindow(),show:async e=>{if(!o)return!1;const t=await r.queryObjectContent(o,"popover");return!!t&&(n=await u.ObjectPopoverHelper.ObjectPopoverHelper.buildObjectPopover(t,e),!!n||(o.runtimeModel().releaseObjectGroup("popover"),!1))},hide:()=>{o.runtimeModel().releaseObjectGroup("popover"),n&&n.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(Mt(kt.allObjects));for(let t=0;t-1&&this.filterSelect.setSelectedIndex(t)}updateControls(){this.updatePerspectiveOptions(),this.updateBaseOptions(),this.updateFilterOptions()}onReceiveSnapshot(e){this.updateControls();e.data.addEventListener(k.ProfileTitleChanged,this.updateControls,this)}onProfileHeaderRemoved(e){const t=e.data;t.removeEventListener(k.ProfileTitleChanged,this.updateControls,this),this.profile===t?(this.detach(),this.profile.profileType().removeEventListener("SnapshotReceived",this.onReceiveSnapshot,this),this.profile.profileType().removeEventListener(D.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("IdsRangeChanged",this.onIdsRangeChanged.bind(this))}}class jt{titleInternal;constructor(e){this.titleInternal=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.titleInternal}supportsSearch(){return!1}}class Ot extends jt{constructor(){super(Mt(kt.summary))}activate(e){e.splitWidget.setMainWidget(e.constructorsWidget),e.splitWidget.setSidebarWidget(e.objectDetailsView),e.splitWidget.show(e.searchableViewInternal.element),e.filterSelect.setVisible(!0),e.classNameFilter.setVisible(!0),e.trackingOverviewGrid&&(e.trackingOverviewGrid.show(e.searchableViewInternal.element,e.splitWidget.element),e.trackingOverviewGrid.update(),e.trackingOverviewGrid.updateGrid())}masterGrid(e){return e.constructorsDataGrid}supportsSearch(){return!0}}class zt extends jt{constructor(){super(Mt(kt.comparison))}activate(e){e.splitWidget.setMainWidget(e.diffWidget),e.splitWidget.setSidebarWidget(e.objectDetailsView),e.splitWidget.show(e.searchableViewInternal.element),e.baseSelect.setVisible(!0),e.classNameFilter.setVisible(!0)}masterGrid(e){return e.diffDataGrid}supportsSearch(){return!0}}class Bt extends jt{constructor(){super(Mt(kt.containment))}activate(e){e.splitWidget.setMainWidget(e.containmentWidget),e.splitWidget.setSidebarWidget(e.objectDetailsView),e.splitWidget.show(e.searchableViewInternal.element)}masterGrid(e){return e.containmentDataGrid}}class Gt extends jt{allocationSplitWidget;constructor(){super(Mt(kt.allocation)),this.allocationSplitWidget=new s.SplitWidget.SplitWidget(!1,!0,"heapSnapshotAllocationSplitViewState",200,200),this.allocationSplitWidget.setSidebarWidget(new s.Widget.VBox)}activate(e){e.allocationWidget&&this.allocationSplitWidget.setMainWidget(e.allocationWidget),e.splitWidget.setMainWidget(e.constructorsWidget),e.splitWidget.setSidebarWidget(e.objectDetailsView);const t=new s.Widget.VBox,i=document.createElement("div");i.classList.add("heap-snapshot-view-resizer");const r=i.createChild("div","title").createChild("span");if(i.createChild("div","verticalResizerIcon"),r.textContent=Mt(kt.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.searchableViewInternal.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 Vt extends jt{constructor(){super(Mt(kt.statistics))}activate(e){e.statisticsView.show(e.searchableViewInternal.element)}masterGrid(e){return null}}class Ut extends(o.ObjectWrapper.eventMixin(L)){exposeInternals;captureNumericValue;customContentInternal;constructor(e,t){super(e||Ut.TypeId,t||Mt(kt.heapSnapshot)),l.TargetManager.TargetManager.instance().observeModels(l.HeapProfilerModel.HeapProfilerModel,this),l.TargetManager.TargetManager.instance().addModelListener(l.HeapProfilerModel.HeapProfilerModel,l.HeapProfilerModel.Events.ResetProfiles,this.resetProfiles,this),l.TargetManager.TargetManager.instance().addModelListener(l.HeapProfilerModel.HeapProfilerModel,l.HeapProfilerModel.Events.AddHeapSnapshotChunk,this.addHeapSnapshotChunk,this),l.TargetManager.TargetManager.instance().addModelListener(l.HeapProfilerModel.HeapProfilerModel,l.HeapProfilerModel.Events.ReportHeapSnapshotProgress,this.reportHeapSnapshotProgress,this),this.exposeInternals=o.Settings.Settings.instance().createSetting("exposeInternals",!1),this.captureNumericValue=o.Settings.Settings.instance().createSetting("captureNumericValue",!1),this.customContentInternal=null}modelAdded(e){e.enable()}modelRemoved(e){}getProfiles(){return super.getProfiles()}fileExtension(){return".heapsnapshot"}get buttonTooltip(){return Mt(kt.takeHeapSnapshot)}isInstantProfile(){return!0}buttonClicked(){return this.takeHeapSnapshot(),a.userMetrics.actionTaken(a.UserMetrics.Action.ProfilesHeapProfileTaken),!1}get treeItemTitle(){return Mt(kt.heapSnapshots)}get description(){return Mt(kt.heapSnapshotProfilesShowMemory)}customContent(){const e=document.createElement("div"),t=c.Runtime.experiments.isEnabled("showOptionToExposeInternalsInHeapSnapshot"),i=!t;if(t){const t=s.SettingsUI.createSettingCheckbox(Mt(kt.exposeInternals),this.exposeInternals,i);e.appendChild(t)}const r=s.SettingsUI.createSettingCheckbox(Mt(kt.captureNumericValue),this.captureNumericValue,i);return e.appendChild(r),this.customContentInternal=e,e}setCustomContentEnabled(e){this.customContentInternal&&this.customContentInternal.querySelectorAll("[is=dt-checkbox]").forEach((t=>{t.checkboxElement.disabled=!e}))}createProfileLoadedFromFile(e){return new Wt(null,this,e)}async takeHeapSnapshot(){if(this.profileBeingRecorded())return;const e=s.Context.Context.instance().flavor(l.HeapProfilerModel.HeapProfilerModel);if(!e)return;let t=new Wt(e,this);this.setProfileBeingRecorded(t),this.addProfile(t),t.updateStatus(Mt(kt.snapshotting)),await e.takeHeapSnapshot({reportProgress:!0,captureNumericValue:this.captureNumericValue.get(),exposeInternals:this.exposeInternals.get()}),t=this.profileBeingRecorded(),t&&(t.title=Mt(kt.snapshotD,{PH1:t.uid}),t.finishLoad(),this.setProfileBeingRecorded(null),this.dispatchEventToListeners(D.ProfileComplete,t))}addHeapSnapshotChunk(e){const t=this.profileBeingRecorded();t&&t.transferChunk(e.data)}reportHeapSnapshotProgress(e){const t=this.profileBeingRecorded();if(!t)return;const{done:i,total:r,finished:s}=e.data;t.updateStatus(Mt(kt.percentagePlaceholder,{PH1:(i/r*100).toFixed(0)}),!0),s&&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("SnapshotReceived",e)}static TypeId="HEAP";static SnapshotReceived="SnapshotReceived"}class At extends(o.ObjectWrapper.eventMixin(Ut)){recordAllocationStacksSettingInternal;customContentInternal;recording;profileSamples;constructor(){super(At.TypeId,Mt(kt.allocationInstrumentationOn)),this.recordAllocationStacksSettingInternal=o.Settings.Settings.instance().createSetting("recordAllocationStacks",!1),this.customContentInternal=null,this.recording=!1}modelAdded(e){super.modelAdded(e),e.addEventListener(l.HeapProfilerModel.Events.HeapStatsUpdate,this.heapStatsUpdate,this),e.addEventListener(l.HeapProfilerModel.Events.LastSeenObjectId,this.lastSeenObjectId,this)}modelRemoved(e){super.modelRemoved(e),e.removeEventListener(l.HeapProfilerModel.Events.HeapStatsUpdate,this.heapStatsUpdate,this),e.removeEventListener(l.HeapProfilerModel.Events.LastSeenObjectId,this.lastSeenObjectId,this)}heapStatsUpdate(e){if(!this.profileSamples)return;const t=e.data;let i;for(let e=0;e{this.fulfillLoad=e})),this.totalNumberOfChunks=0,this.bufferedWriter=null,this.onTempFileReady=null}heapProfilerModel(){return this.heapProfilerModelInternal}async getLocation(e){return this.snapshotProxy?this.snapshotProxy.getLocation(e):null}createSidebarTreeElement(e){return new A(e,this,"heap-snapshot-sidebar-tree-item")}createView(e){return new Lt(e,this)}prepareToLoad(){console.assert(!this.receiver,"Already loading"),this.setupWorker(),this.updateStatus(Mt(kt.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 xt(this.handleWorkerEvent.bind(this)),this.workerProxy.addEventListener("Wait",(e=>{this.updateStatus(null,e.data)}),this),this.receiver=this.workerProxy.createLoader(this.uid,this.snapshotReceived.bind(this))}handleWorkerEvent(e,i){if(p.HeapSnapshotModel.HeapSnapshotProgressEvent.BrokenSnapshot===e){const e=i;return void o.Console.Console.instance().error(e)}if(p.HeapSnapshotModel.HeapSnapshotProgressEvent.Update!==e)return;const r=i,s=t.i18n.deserializeUIString(r);this.updateStatus(Ht(s.string,s.values))}dispose(){this.workerProxy&&this.workerProxy.dispose(),this.removeTempFile(),this.wasDisposed=!0}didCompleteSnapshotTransfer(){this.snapshotProxy&&this.updateStatus(e.NumberUtilities.bytesToString(this.snapshotProxy.totalSize),!1)}transferChunk(e){this.bufferedWriter||(this.bufferedWriter=new h.TempFile.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.fulfillLoad(this.snapshotProxy),this.profileType().snapshotReceived(this),this.canSaveToFile()&&this.dispatchEventToListeners(k.ProfileReceived)}canSaveToFile(){return!this.fromFile()&&Boolean(this.snapshotProxy)}saveToFile(){const t=new h.FileUtils.FileOutputStream;this.fileName=this.fileName||"Heap-"+e.DateUtilities.toISO8601Compact(new Date)+this.profileType().fileExtension();const i=async e=>{if(e){if(this.failedToCreateTempFile)return o.Console.Console.instance().error("Failed to open temp file with heap snapshot"),void t.close();if(this.tempFile){const e=await this.tempFile.copyToOutputStream(t,this.onChunkTransferred.bind(this));return e&&o.Console.Console.instance().error("Failed to read heap snapshot from temp file: "+e.message),void this.didCompleteSnapshotTransfer()}this.onTempFileReady=()=>{i(e)},this.updateSaveProgress(0,1)}};t.open(this.fileName).then(i.bind(this))}onChunkTransferred(e){this.updateSaveProgress(e.loadedSize(),e.fileSize())}updateSaveProgress(e,t){const i=(100*(t&&e/t)).toFixed(0);this.updateStatus(Mt(kt.savingD,{PH1:i}))}async loadFromFile(e){this.updateStatus(Mt(kt.loading),!0),this.setupWorker();const t=new h.FileUtils.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()}profileType(){return super.profileType()}}class _t extends s.Widget.VBox{pieChart;constructor(){super(),this.element.classList.add("heap-snapshot-statistics-view"),this.pieChart=new n.PieChart.PieChart,this.setTotalAndRecords(0,[]),this.pieChart.classList.add("heap-snapshot-stats-pie-chart"),this.element.appendChild(this.pieChart)}static valueFormatter(t){return Mt(kt.sKb,{PH1:e.NumberUtilities.withThousandsSeparator(Math.round(t/1e3))})}setTotalAndRecords(e,t){this.pieChart.data={chartName:Mt(kt.heapMemoryUsage),size:150,formatter:_t.valueFormatter,showLegend:!0,total:e,slices:t}}}class Jt extends s.Widget.Widget{heapProfilerModel;linkifier;frameElements;constructor(e){super(),this.heapProfilerModel=e,this.linkifier=new d.Linkifier.Linkifier,this.frameElements=[]}onContextMenu(e,t){const i=new s.ContextMenu.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=$t.get(t);if(!i)return;const r=d.Linkifier.Linkifier.linkInfo(i);if(!r)return;return void(d.Linkifier.Linkifier.invokeFirstAction(r)&&e.consume(!0))}let i;const r=e;if("ArrowUp"===r.key)i=!1;else{if("ArrowDown"!==r.key)return;i=!0}const s=this.frameElements.indexOf(t);if(-1===s)return;const o=i?s+1:s-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 s.UIUtils.createTextChild(e,Mt(kt.stackWasNotRecordedForThisObject))}const r=this.element.createChild("div","heap-allocation-stack");r.addEventListener("keydown",this.onStackViewKeydown.bind(this),!1);for(const e of i){const t=r.createChild("div","stack-frame");this.frameElements.push(t),t.tabIndex=-1;if(t.createChild("div").textContent=s.UIUtils.beautifyFunctionName(e.functionName),!e.scriptId)continue;const i=this.heapProfilerModel?this.heapProfilerModel.target():null,o={columnNumber:e.column-1,inlineFrameIndex:0},n=this.linkifier.linkifyScriptLocation(i,String(e.scriptId),e.scriptName,e.line-1,o);t.appendChild(n),$t.set(t,n),t.addEventListener("contextmenu",this.onContextMenu.bind(this,n))}this.frameElements[0].tabIndex=0}clear(){this.element.removeChildren(),this.frameElements=[],this.linkifier.reset()}}const $t=new WeakMap;var qt=Object.freeze({__proto__:null,HeapSnapshotView:Lt,Perspective:jt,SummaryPerspective:Ot,ComparisonPerspective:zt,ContainmentPerspective:Bt,AllocationPerspective:Gt,StatisticsPerspective:Vt,HeapSnapshotProfileType:Ut,TrackingHeapSnapshotProfileType:At,HeapProfileHeader:Wt,HeapSnapshotStatisticsView:_t,HeapAllocationStackView:Jt});class Qt{cpuProfileType;heapSnapshotProfileType;samplingHeapProfileType;trackingHeapSnapshotProfileType;constructor(){this.cpuProfileType=new oe,this.heapSnapshotProfileType=new Ut,this.samplingHeapProfileType=new Be,this.trackingHeapSnapshotProfileType=new At}}const Kt=new Qt;var Yt=Object.freeze({__proto__:null,ProfileTypeRegistry:Qt,instance:Kt});const Zt={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",deprecationWarnMsg:"This panel will be deprecated in the upcoming version. Use the Performance panel to record JavaScript CPU profiles.",learnMore:"Learn more",feedback:"Feedback",goToPerformancePanel:"Go to Performance Panel",enableThisPanelTemporarily:"Enable this panel temporarily"},Xt=t.i18n.registerUIStrings("panels/profiler/ProfilesPanel.ts",Zt),ei=t.i18n.getLocalizedString.bind(void 0,Xt);class ti extends s.Panel.PanelWithSidebar{profileTypes;profilesItemTreeElement;sidebarTree;profileViews;toolbarElement;toggleRecordAction;toggleRecordButton;clearResultsButton;profileViewToolbar;profileGroups;launcherView;visibleView;profileToView;typeIdToSidebarSection;fileSelectorElement;selectedProfileType;constructor(e,t,i){super(e),this.profileTypes=t;const r=new s.Widget.VBox;this.splitWidget().setMainWidget(r),this.profilesItemTreeElement=new oi(this),this.sidebarTree=new s.TreeOutline.TreeOutlineInShadow,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"),r.element.appendChild(this.profileViews),this.toolbarElement=document.createElement("div"),this.toolbarElement.classList.add("profiles-toolbar"),r.element.insertBefore(this.toolbarElement,r.element.firstChild),this.panelSidebarElement().classList.add("profiles-tree-sidebar");const o=document.createElement("div");o.classList.add("profiles-toolbar"),this.panelSidebarElement().insertBefore(o,this.panelSidebarElement().firstChild);const n=new s.Toolbar.Toolbar("",o);this.toggleRecordAction=s.ActionRegistry.ActionRegistry.instance().action(i),this.toggleRecordButton=s.Toolbar.Toolbar.createActionButton(this.toggleRecordAction),n.appendToolbarItem(this.toggleRecordButton),this.clearResultsButton=new s.Toolbar.ToolbarButton(ei(Zt.clearAllProfiles),"clear"),this.clearResultsButton.addEventListener(s.Toolbar.ToolbarButton.Events.Click,this.reset,this),n.appendToolbarItem(this.clearResultsButton),n.appendSeparator(),n.appendToolbarItem(s.Toolbar.Toolbar.createActionButtonForId("components.collect-garbage")),this.profileViewToolbar=new s.Toolbar.Toolbar("",this.toolbarElement),this.profileViewToolbar.makeWrappable(!0),this.profileGroups={},this.launcherView=new xe(this),this.launcherView.addEventListener(ye.ProfileTypeSelected,this.onProfileTypeSelected,this),this.profileToView=[],this.typeIdToSidebarSection={};const a=this.profileTypes;for(let e=0;eBoolean(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.Console.instance().error(ei(Zt.cantLoadFileSupportedFile,{PH1:Array.from(e).join("', '")}))}if(Boolean(t.profileBeingRecorded()))return void o.Console.Console.instance().error(ei(Zt.cantLoadProfileWhileAnother));const i=await t.loadFromFile(e);i&&"message"in i&&s.UIUtils.MessageDialog.show(ei(Zt.profileLoadingFailedS,{PH1:i.message}))}toggleRecord(){if(!this.toggleRecordAction.enabled())return!0;const t=e.DOMUtilities.deepActiveElement(this.element.ownerDocument),i=this.selectedProfileType;if(!i)return!0;const r=i.buttonClicked();return this.updateToggleRecordAction(r),r?(this.launcherView.profileStarted(),i.hasTemporaryView()&&this.showProfile(i.profileBeingRecorded())):this.launcherView.profileFinished(),t&&t.focus(),!0}onSuspendStateChanged(){this.updateToggleRecordAction(this.toggleRecordAction.toggled())}updateToggleRecordAction(e){const t=Boolean(s.Context.Context.instance().flavor(l.CPUProfilerModel.CPUProfilerModel)||s.Context.Context.instance().flavor(l.HeapProfilerModel.HeapProfilerModel)),i=e||!l.TargetManager.TargetManager.instance().allTargetsSuspended()&&t;this.toggleRecordAction.setEnabled(i),this.toggleRecordAction.setToggled(e),i?this.toggleRecordButton.setTitle(this.selectedProfileType?this.selectedProfileType.buttonTooltip:""):this.toggleRecordButton.setTitle(s.UIUtils.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 ii(this,e);this.typeIdToSidebarSection[e.id]=t,this.sidebarTree.appendChild(t),t.childrenListElement.addEventListener("contextmenu",this.handleContextMenuEvent.bind(this),!1),e.addEventListener(D.ViewUpdated,this.updateProfileTypeSpecificUI,this),e.addEventListener(D.AddProfileHeader,(function(e){this.addProfileHeader(e.data)}),this),e.addEventListener(D.RemoveProfileHeader,(function(e){this.removeProfileHeader(e.data)}),this),e.addEventListener(D.ProfileComplete,(function(e){this.showProfile(e.data)}),this);const i=e.getProfiles();for(let e=0;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()}wasShown(){super.wasShown(),this.registerCSSFiles([he,pe,ce]),this.sidebarTree.registerCSSFiles([ue])}}class ii extends s.TreeOutline.TreeElement{dataDisplayDelegate;profileTreeElements;profileGroups;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 r=e.createSidebarTreeElement(this.dataDisplayDelegate);if(this.profileTreeElements.push(r),!e.fromFile()&&t.profileBeingRecorded()!==e){const t=e.title;let s=this.profileGroups[t];s||(s=new ri,this.profileGroups[t]=s),s.profileSidebarTreeElements.push(r);const o=s.profileSidebarTreeElements.length;if(2===o){s.sidebarTreeElement=new si(this.dataDisplayDelegate,e.title);const t=s.profileSidebarTreeElements[0],i=this.children().indexOf(t);this.insertChild(s.sidebarTreeElement,i);const r=t.selected;this.removeChild(t),s.sidebarTreeElement.appendChild(t),r&&t.revealAndSelect(),t.setSmall(!0),t.setMainTitle(ei(Zt.runD,{PH1:1})),this.treeOutline&&this.treeOutline.element.classList.add("some-expandable")}o>=2&&(i=s.sidebarTreeElement,r.setSmall(!0),r.setMainTitle(ei(Zt.runD,{PH1:o})))}i&&i.appendChild(r)}removeProfileHeader(e){const t=this.sidebarElementIndex(e);if(-1===t)return!1;const i=this.profileTreeElements[t];this.profileTreeElements.splice(t,1);let r=this;const s=this.profileGroups[e.title];if(s){const t=s.profileSidebarTreeElements;if(t.splice(t.indexOf(i),1),1===t.length){const i=r.children().indexOf(s.sidebarTreeElement);s.sidebarTreeElement&&s.sidebarTreeElement.removeChild(t[0]),this.insertChild(t[0],i),t[0].setSmall(!1),t[0].setMainTitle(e.title),s.sidebarTreeElement&&this.removeChild(s.sidebarTreeElement)}0!==t.length&&(r=s.sidebarTreeElement)}return r&&r.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;i0;if(e){const e=this.lastChild();e instanceof A&&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 oi extends s.TreeOutline.TreeElement{panel;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=ei(Zt.profiles)}}let ni;class ai extends ti{constructor(){super("js_profiler",[Kt.cpuProfileType],"profiler.js-toggle-recording"),this.splitWidget().mainWidget()?.setMinimumSize(350,0),c.Runtime.experiments.isEnabled(c.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI)||(c.Runtime.experiments.isEnabled("jsProfilerTemporarilyEnable")?this.#t():this.#i())}static instance(e={forceNew:null}){const{forceNew:t}=e;return ni&&!t||(ni=new ai),ni}#t(){function e(){a.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab("https://github.com/ChromeDevTools/rfcs/discussions/2")}const t=new s.Infobar.Infobar(s.Infobar.Type.Warning,ei(Zt.deprecationWarnMsg),[{text:ei(Zt.learnMore),highlight:!1,delegate:e,dismiss:!1},{text:ei(Zt.feedback),highlight:!1,delegate:e,dismiss:!1},{text:ei(Zt.goToPerformancePanel),highlight:!0,delegate:async function(){await s.InspectorView.InspectorView.instance().showPanel("timeline")},dismiss:!1}],void 0);t.setParentView(this),this.splitWidget().mainWidget()?.element.prepend(t.element)}#i(){const e=this.splitWidget().mainWidget();if(e?.detachChildWidgets(),e){const t=new s.Widget.VBox;t.contentElement.classList.add("empty-landing-page","fill");const i=t.contentElement.createChild("div");i.createChild("p").textContent="This panel is deprecated and will be removed in the next version. Use the Performance panel to record JavaScript CPU profiles.",i.createChild("p").textContent="You can temporarily enable this panel with Settings > Experiments > Enable JavaScript Profiler.",i.appendChild(s.UIUtils.createTextButton(ei(Zt.goToPerformancePanel),(async function(){await s.InspectorView.InspectorView.instance().showPanel("timeline")}),"infobar-button primary-button")),i.appendChild(s.UIUtils.createTextButton(ei(Zt.learnMore),(function(){a.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab("https://developer.chrome.com/blog/js-profiler-deprecation/")}))),i.appendChild(s.UIUtils.createTextButton(ei(Zt.feedback),(function(){a.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab("https://bugs.chromium.org/p/chromium/issues/detail?id=1354548")}))),i.appendChild(s.UIUtils.createTextButton(ei(Zt.enableThisPanelTemporarily),(async function(){await s.ViewManager.ViewManager.instance().showView("experiments");(await s.ViewManager.ViewManager.instance().view("experiments").widget()).setFilter("Enable JavaScript Profiler temporarily")}))),t.show(e.element)}}wasShown(){super.wasShown(),s.Context.Context.instance().setFlavor(ai,this)}willHide(){s.Context.Context.instance().setFlavor(ai,null)}handleAction(e,t){const i=s.Context.Context.instance().flavor(ai);if(!(i instanceof ai))throw new Error("non-null JSProfilerPanel expected!");return i.toggleRecord(),!0}}var li=Object.freeze({__proto__:null,ProfilesPanel:ti,ProfileTypeSidebarSection:ii,ProfileGroup:ri,ProfileGroupSidebarTreeElement:si,ProfilesSidebarTreeElement:oi,JSProfilerPanel:ai});const di={revealInSummaryView:"Reveal in Summary view"},hi=t.i18n.registerUIStrings("panels/profiler/HeapProfilerPanel.ts",di),ci=t.i18n.getLocalizedString.bind(void 0,hi);let pi;class ui extends ti{constructor(){const e=Kt;super("heap_profiler",[e.heapSnapshotProfileType,e.trackingHeapSnapshotProfileType,e.samplingHeapProfileType],"profiler.heap-toggle-recording")}static instance(){return pi||(pi=new ui),pi}appendApplicableItems(e,t,i){if(!(i instanceof l.RemoteObject.RemoteObject))return;if(!this.isShowing())return;const r=i;if(!r.objectId)return;const s=r.objectId;if(!Kt.heapSnapshotProfileType.getProfiles().length)return;const o=r.runtimeModel().heapProfilerModel();o&&t.revealSection().appendItem(ci(di.revealInSummaryView),function(e){o.snapshotObjectIdForObjectId(s).then((t=>{this.isShowing()&&t&&this.showObject(t,e)}))}.bind(this,"Summary"))}handleAction(e,t){const i=s.Context.Context.instance().flavor(ui);return console.assert(Boolean(i)&&i instanceof ui),i&&i.toggleRecord(),!0}wasShown(){super.wasShown(),s.Context.Context.instance().setFlavor(ui,this),a.userMetrics.panelLoaded("heap_profiler","DevTools.Launch.HeapProfiler")}willHide(){s.Context.Context.instance().setFlavor(ui,null)}showObject(e,t){const i=Kt.heapSnapshotProfileType.getProfiles();for(let r=0;r=parseInt(e,10)){this.showProfile(s);this.viewForProfile(s).selectLiveObject(t,e);break}}}}var mi=Object.freeze({__proto__:null,HeapProfilerPanel:ui});const fi=new CSSStyleSheet;fi.replaceSync(".data-grid{border:none}.data-grid td .size-units{margin-left:4px;font-size:75%}.data-grid tr:not(.selected) td .size-units{color:var(--color-text-secondary)}.toolbar{border-bottom:1px solid var(--color-details-hairline)}\n/*# sourceURL=liveHeapProfile.css */\n");const gi={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"},vi=t.i18n.registerUIStrings("panels/profiler/LiveHeapProfileView.ts",gi),wi=t.i18n.getLocalizedString.bind(void 0,vi);let Si,bi;class Ci extends s.Widget.VBox{gridNodeByUrl;setting;toggleRecordAction;toggleRecordButton;startWithReloadButton;dataGrid;currentPollId;constructor(){super(!0),this.gridNodeByUrl=new Map,this.setting=o.Settings.Settings.instance().moduleSetting("memoryLiveHeapProfile");const e=new s.Toolbar.Toolbar("live-heap-profile-toolbar",this.contentElement);this.toggleRecordAction=s.ActionRegistry.ActionRegistry.instance().action("live-heap-profile.toggle-recording"),this.toggleRecordButton=s.Toolbar.Toolbar.createActionButton(this.toggleRecordAction),this.toggleRecordButton.setToggled(this.setting.get()),e.appendToolbarItem(this.toggleRecordButton);const t=l.TargetManager.TargetManager.instance().primaryPageTarget();if(t&&t.model(l.ResourceTreeModel.ResourceTreeModel)){const t=s.ActionRegistry.ActionRegistry.instance().action("live-heap-profile.start-with-reload");this.startWithReloadButton=s.Toolbar.Toolbar.createActionButton(t),e.appendToolbarItem(this.startWithReloadButton)}this.dataGrid=this.createDataGrid(),this.dataGrid.asWidget().show(this.contentElement),this.currentPollId=0}static instance(){return Si||(Si=new Ci),Si}createDataGrid(){const e={id:"",title:o.UIString.LocalizedEmptyString,width:void 0,fixedWidth:!0,sortable:!0,align:r.DataGrid.Align.Right,sort:r.DataGrid.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:wi(gi.jsHeap),width:"72px",fixedWidth:!0,sortable:!0,align:r.DataGrid.Align.Right,sort:r.DataGrid.Order.Descending,tooltip:wi(gi.allocatedJsHeapSizeCurrentlyIn)},{...e,id:"isolates",title:wi(gi.vms),width:"40px",fixedWidth:!0,align:r.DataGrid.Align.Right,tooltip:wi(gi.numberOfVmsSharingTheSameScript)},{...e,id:"url",title:wi(gi.scriptUrl),fixedWidth:!1,sortable:!0,tooltip:wi(gi.urlOfTheScriptSource)}],i=new r.SortableDataGrid.SortableDataGrid({displayName:wi(gi.heapProfile),columns:t,editCallback:void 0,deleteCallback:void 0,refreshCallback:void 0});i.setResizeMethod(r.DataGrid.ResizeMethod.Last),i.element.classList.add("flex-auto"),i.element.addEventListener("keydown",this.onKeyDown.bind(this),!1),i.addEventListener(r.DataGrid.Events.OpenedNode,this.revealSourceForSelectedNode,this),i.addEventListener(r.DataGrid.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(){super.wasShown(),this.poll(),this.registerCSSFiles([fi]),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(l.IsolateManager.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=>window.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 r=this.dataGrid.rootNode(),s=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 Pi(t,i,o),this.gridNodeByUrl.set(t,n),r.appendChild(n)),s.add(n)}for(const e of r.children.slice()){s.has(e)||e.remove();const t=e;this.gridNodeByUrl.delete(t.url)}function o(e,t,r){const s=r.callFrame.url||t||function(e){const t=e.callFrame.functionName;return t.startsWith("(")&&"(root)"!==t?t:""}(r)||function(e){return Number(e.callFrame.scriptId)?wi(gi.anonymousScriptS,{PH1:e.callFrame.scriptId}):""}(r);if(r.children.forEach(o.bind(null,e,s)),!r.selfSize)return;let n=i.get(s);n||(n={size:0,isolates:new Set},i.set(s,n)),n.size+=r.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=m.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(e.url);t&&o.Revealer.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=l.TargetManager.TargetManager.instance().primaryPageTarget();if(!t)return;const i=t.model(l.ResourceTreeModel.ResourceTreeModel);i&&i.reloadPage()}async stopRecording(){this.setting.set(!1)}}class Pi extends r.SortableDataGrid.SortableDataGridNode{url;size;isolateCount;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(t){const i=this.createTD(t);switch(t){case"url":i.textContent=this.url;break;case"size":i.textContent=e.NumberUtilities.withThousandsSeparator(Math.round(this.size/1e3)),i.createChild("span","size-units").textContent=wi(gi.kb);break;case"isolates":i.textContent=`${this.isolateCount}`}return i}}class Ti{static instance(e={forceNew:null}){const{forceNew:t}=e;return bi&&!t||(bi=new Ti),bi}handleAction(e,t){return(async()=>{const e="live_heap_profile";await s.ViewManager.ViewManager.instance().showView(e);const i=s.ViewManager.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 xi=Object.freeze({__proto__:null,LiveHeapProfileView:Ci,GridNode:Pi,ActionDelegate:Ti});export{T as BottomUpProfileDataGrid,M as CPUProfileFlameChart,de as CPUProfileView,x as ChildrenProvider,_e as HeapProfileView,mi as HeapProfilerPanel,bt as HeapSnapshotDataGrids,ot as HeapSnapshotGridNodes,Nt as HeapSnapshotProxy,qt as HeapSnapshotView,De as HeapTimelineOverview,Se as IsolateSelector,xi as LiveHeapProfileView,b as ProfileDataGrid,j as ProfileHeader,Ie as ProfileLauncherView,W as ProfileSidebarTreeElement,Yt as ProfileTypeRegistry,ee as ProfileView,li as ProfilesPanel,$ as TopDownProfileDataGrid}; + `,r=i.$("container");this.prefixObjectCell(r),this.reachableFromWindow&&r.appendChild(s.Fragment.html`🗖`),this.detachedDOMTreeNode&&r.appendChild(s.Fragment.html``),this.appendSourceLocation(r);const o=i.element();return this.depth&&o.style.setProperty("padding-left",this.depth*this.dataGrid.indentWidth+"px"),o}prefixObjectCell(e){}async appendSourceLocation(e){const t=s.Fragment.html``;e.appendChild(t);const i=await this.dataGridInternal.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(qe(Je.previewIsNotAvailable))}async tryQueryObjectContent(e,t){return"string"===this.type?e.runtimeModel().createRemoteObjectFromPrimitiveValue(this.nameInternal):await e.objectForSnapshotObjectId(String(this.snapshotNodeId),t)}async updateHasChildren(){const e=await this.provider().isEmpty();this.setHasChildren(!e)}shortenWindowURL(t,i){const r=t.indexOf("/"),s=i?t.indexOf("@"):t.length;if(-1===r||-1===s)return t;const o=t.substring(r+1,s).trimLeft();let n=e.StringUtilities.trimURL(o);return n.length>40&&(n=e.StringUtilities.trimMiddle(n,40)),t.substr(0,r+2)+n+t.substr(s)}populateContextMenu(e,t,i){if(e.revealSection().appendItem(qe(Je.revealInSummaryView),(()=>{t.showObject(String(this.snapshotNodeId),qe(Je.summary))})),this.referenceName)for(const i of this.referenceName.matchAll(/\((?[^@)]*) @(?\d+)\)/g)){const{objectName:r,snapshotNodeId:s}=i.groups;e.revealSection().appendItem(qe(Je.revealObjectSWithIdSInSummary,{PH1:r,PH2:s}),(()=>{t.showObject(s,qe(Je.summary))}))}i&&e.revealSection().appendItem(qe(Je.storeAsGlobalVariable),(async()=>{const e=await this.tryQueryObjectContent(i,"");if(e){const t=i.target().model(l.ConsoleModel.ConsoleModel);await(t?.saveToTempVariable(s.Context.Context.instance().flavor(l.RuntimeModel.ExecutionContext),e))}else o.Console.Console.instance().error(qe(Je.previewIsNotAvailable))}))}}class Ze extends Ye{referenceName;referenceType;edgeIndex;snapshot;parentObjectNode;cycledWithAncestorGridNode;constructor(e,t,i,r){super(e,i.node),this.referenceName=i.name,this.referenceType=i.type,this.edgeIndex=i.edgeIndex,this.snapshot=t,this.parentObjectNode=r,this.cycledWithAncestorGridNode=this.findAncestorWithSameSnapshotNodeId(),this.cycledWithAncestorGridNode||this.updateHasChildren();const s=this.data;s.count="",s.addedCount="",s.removedCount="",s.countDelta="",s.addedSize="",s.removedSize="",s.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 Ze(this.dataGridInternal,this.snapshot,e,this)}getHash(){return this.edgeIndex}comparator(){const e=this.dataGridInternal.isSortOrderAscending();switch(this.dataGridInternal.sortColumnId()){case"object":return new p.HeapSnapshotModel.ComparatorConfig("!edgeName",e,"retainedSize",!1);case"count":default:return new p.HeapSnapshotModel.ComparatorConfig("!edgeName",!0,"retainedSize",!1);case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("selfSize",e,"!edgeName",!0);case"retainedSize":return new p.HeapSnapshotModel.ComparatorConfig("retainedSize",e,"!edgeName",!0);case"distance":return new p.HeapSnapshotModel.ComparatorConfig("distance",e,"name",!0)}}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(s.Fragment.html`${t} ${this.edgeNodeSeparator()}`)}edgeNodeSeparator(){return"::"}}class Xe extends Ze{constructor(e,t,i,r){super(e,t,i,r)}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 Xe(this.dataGridInternal,this.snapshot,e,this)}edgeNodeSeparator(){return qe(Je.inElement)}expand(){this.expandRetainersChain(20)}expandRetainersChain(e){if(!this.populated)return this.once(Ke.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.dataGridInternal.dispatchEventToListeners(pt.ExpandRetainersComplete)}}class et extends Ye{baseSnapshotOrSnapshot;isDeletedNode;constructor(t,i,r,s){super(t,r),this.baseSnapshotOrSnapshot=i,this.isDeletedNode=s,this.updateHasChildren();const o=this.data;o.count="",o.countDelta="",o.sizeDelta="",this.isDeletedNode?(o.addedCount="",o.addedSize="",o.removedCount="•",o.removedSize=e.NumberUtilities.withThousandsSeparator(this.shallowSize||0)):(o.addedCount="•",o.addedSize=e.NumberUtilities.withThousandsSeparator(this.shallowSize||0),o.removedCount="",o.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 Ze(this.dataGridInternal,this.baseSnapshotOrSnapshot,e,null)}getHash(){if(void 0===this.snapshotNodeId)throw new Error("Cannot hash root nodes");return this.snapshotNodeId}comparator(){const e=this.dataGridInternal.isSortOrderAscending();switch(this.dataGridInternal.sortColumnId()){case"object":return new p.HeapSnapshotModel.ComparatorConfig("!edgeName",e,"retainedSize",!1);case"distance":return new p.HeapSnapshotModel.ComparatorConfig("distance",e,"retainedSize",!1);case"count":default:return new p.HeapSnapshotModel.ComparatorConfig("!edgeName",!0,"retainedSize",!1);case"addedSize":case"removedSize":case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("selfSize",e,"!edgeName",!0);case"retainedSize":return new p.HeapSnapshotModel.ComparatorConfig("retainedSize",e,"!edgeName",!0)}}}class tt extends Ke{nameInternal;nodeFilter;distance;count;shallowSize;retainedSize;constructor(t,i,r,s){super(t,r.count>0),this.nameInternal=i,this.nodeFilter=s,this.distance=r.distance,this.count=r.count,this.shallowSize=r.self,this.retainedSize=r.maxRet;const o=t.snapshot,n=this.retainedSize/o.totalSize*100,a=this.shallowSize/o.totalSize*100;this.data={object:i,count:e.NumberUtilities.withThousandsSeparator(this.count),distance:this.toUIDistance(this.distance),shallowSize:e.NumberUtilities.withThousandsSeparator(this.shallowSize),retainedSize:e.NumberUtilities.withThousandsSeparator(this.retainedSize),"shallowSize-percent":this.toPercentString(a),"retainedSize-percent":this.toPercentString(n)}}get name(){return this.nameInternal}createProvider(){return this.dataGridInternal.snapshot.createNodesProviderForClass(this.nameInternal,this.nodeFilter)}async populateNodeBySnapshotObjectId(e){this.dataGridInternal.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.nameInternal.toLowerCase().indexOf(e)}createCell(e){const t="object"===e?super.createCell(e):this.createValueCell(e);return"object"===e&&this.count>1&&t.appendChild(s.Fragment.html`×${this.count}`),t}createChildNode(e){return new et(this.dataGridInternal,this.dataGridInternal.snapshot,e,!1)}comparator(){const e=this.dataGridInternal.isSortOrderAscending(),t=this.dataGridInternal.sortColumnId();switch(t){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",e,"id",!0);case"distance":return new p.HeapSnapshotModel.ComparatorConfig("distance",e,"retainedSize",!1);case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("selfSize",e,"id",!0);case"retainedSize":return new p.HeapSnapshotModel.ComparatorConfig("retainedSize",e,"id",!0);default:throw new Error(`Invalid sort column id ${t}`)}}}class it{addedNodesProvider;deletedNodesProvider;addedCount;removedCount;constructor(e,t,i,r){this.addedNodesProvider=e,this.deletedNodesProvider=t,this.addedCount=i,this.removedCount=r}dispose(){this.addedNodesProvider.dispose(),this.deletedNodesProvider.dispose()}nodePosition(e){throw new Error("Unreachable")}isEmpty(){return Promise.resolve(!1)}async serializeItemsRange(e,t){let i,r;if(e=t)return i.totalLength=this.addedCount+this.removedCount,i;r=i,i=await this.deletedNodesProvider.serializeItemsRange(0,t-i.endPosition)}else r=new p.HeapSnapshotModel.ItemsRange(0,0,0,[]),i=await this.deletedNodesProvider.serializeItemsRange(e-this.addedCount,t-this.addedCount);r.items.length||(r.startPosition=this.addedCount+i.startPosition);for(const e of i.items)e.isAddedNotRemoved=!1;return r.items.push(...i.items),r.endPosition=this.addedCount+i.endPosition,r.totalLength=this.addedCount+this.removedCount,r}async sortAndRewind(e){await this.addedNodesProvider.sortAndRewind(e),await this.deletedNodesProvider.sortAndRewind(e)}}class rt extends Ke{nameInternal;addedCount;removedCount;countDelta;addedSize;removedSize;sizeDelta;deletedIndexes;constructor(t,i,r){super(t,!0),this.nameInternal=i,this.addedCount=r.addedCount,this.removedCount=r.removedCount,this.countDelta=r.countDelta,this.addedSize=r.addedSize,this.removedSize=r.removedSize,this.sizeDelta=r.sizeDelta,this.deletedIndexes=r.deletedIndexes,this.data={object:i,addedCount:e.NumberUtilities.withThousandsSeparator(this.addedCount),removedCount:e.NumberUtilities.withThousandsSeparator(this.removedCount),countDelta:this.signForDelta(this.countDelta)+e.NumberUtilities.withThousandsSeparator(Math.abs(this.countDelta)),addedSize:e.NumberUtilities.withThousandsSeparator(this.addedSize),removedSize:e.NumberUtilities.withThousandsSeparator(this.removedSize),sizeDelta:this.signForDelta(this.sizeDelta)+e.NumberUtilities.withThousandsSeparator(Math.abs(this.sizeDelta))}}get name(){return this.nameInternal}createProvider(){const e=this.dataGridInternal;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.nameInternal),i=e.baseSnapshot.createDeletedNodesProvider(this.deletedIndexes);if(!t||!i)throw new Error("Failed to create node providers");return new it(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.dataGridInternal;if(e.isAddedNotRemoved){if(null===t.snapshot)throw new Error("Data sources have not been set correctly");return new et(this.dataGridInternal,t.snapshot,e,!1)}if(void 0===t.baseSnapshot)throw new Error("Data sources have not been set correctly");return new et(this.dataGridInternal,t.baseSnapshot,e,!0)}comparator(){const e=this.dataGridInternal.isSortOrderAscending(),t=this.dataGridInternal.sortColumnId();switch(t){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",e,"id",!0);case"addedCount":case"removedCount":case"countDelta":return new p.HeapSnapshotModel.ComparatorConfig("name",!0,"id",!0);case"addedSize":case"removedSize":case"sizeDelta":return new p.HeapSnapshotModel.ComparatorConfig("selfSize",e,"id",!0);default:throw new Error(`Invalid sort column ${t}`)}}filteredOut(e){return-1===this.nameInternal.toLowerCase().indexOf(e)}signForDelta(e){return 0===e?"":e>0?"+":"−"}}class st extends Ke{populated;allocationNode;constructor(t,i){super(t,i.hasChildren),this.populated=!1,this.allocationNode=i,this.data={liveCount:e.NumberUtilities.withThousandsSeparator(i.liveCount),count:e.NumberUtilities.withThousandsSeparator(i.count),liveSize:e.NumberUtilities.withThousandsSeparator(i.liveSize),size:e.NumberUtilities.withThousandsSeparator(i.size),name:i.name}}populate(){this.populated||this.doPopulate()}async doPopulate(){this.populated=!0;const e=await this.dataGridInternal.snapshot.allocationNodeCallers(this.allocationNode.id),t=e.nodesWithSingleCaller;let i=this;const r=this.dataGridInternal;for(const e of t){const t=new st(r,e);r.appendNode(i,t),i=t,i.populated=!0,this.expanded&&i.expand()}const s=e.branchingCallers;s.sort(this.dataGridInternal.createComparator());for(const e of s)r.appendNode(i,new st(r,e));r.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,r=this.dataGridInternal.heapProfilerModel();if(i.scriptId){const e=this.dataGridInternal.linkifier.linkifyScriptLocation(r?r.target():null,String(i.scriptId),i.scriptName,i.line-1,{columnNumber:i.column-1,inlineFrameIndex:0,className:"profile-node-file"});e.style.maxWidth="75%",t.insertBefore(e,t.firstChild)}return t}allocationNodeId(){return this.allocationNode.id}}var ot=Object.freeze({__proto__:null,get HeapSnapshotGridNode(){return Ke},HeapSnapshotGenericObjectNode:Ye,HeapSnapshotObjectNode:Ze,HeapSnapshotRetainingObjectNode:Xe,HeapSnapshotInstanceNode:et,HeapSnapshotConstructorNode:tt,HeapSnapshotDiffNodesProvider:it,HeapSnapshotDiffNode:rt,AllocationGridNode:st});const nt={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"},at=t.i18n.registerUIStrings("panels/profiler/HeapSnapshotDataGrids.ts",nt),lt=t.i18n.getLocalizedString.bind(void 0,at),dt=new WeakMap;class ht extends r.DataGrid.DataGridImpl{}class ct extends(o.ObjectWrapper.eventMixin(ht)){snapshot;selectedNode;heapProfilerModelInternal;dataDisplayDelegateInternal;recursiveSortingDepth;populatedAndSorted;nameFilter;nodeFilterInternal;lastSortColumnId;lastSortAscending;constructor(e,t,i){super(i),this.snapshot=null,this.selectedNode=null,this.heapProfilerModelInternal=e,this.dataDisplayDelegateInternal=t;const s=[["distance",lt(nt.distanceFromWindowObject)],["shallowSize",lt(nt.sizeOfTheObjectItselfInBytes)],["retainedSize",lt(nt.sizeOfTheObjectPlusTheGraphIt)]];for(const e of s){const t=this.headerTableHeader(e[0]);t&&t.setAttribute("title",e[1])}this.recursiveSortingDepth=0,this.populatedAndSorted=!1,this.nameFilter=null,this.nodeFilterInternal=new p.HeapSnapshotModel.NodeFilter,this.addEventListener(pt.SortingComplete,this.sortingComplete,this),this.addEventListener(r.DataGrid.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 rt||e instanceof tt)&&e.filteredOut(t))}heapProfilerModel(){return this.heapProfilerModelInternal}dataDisplayDelegate(){return this.dataDisplayDelegateInternal}nodeFilter(){return this.nodeFilterInternal}setNameFilter(e){this.nameFilter=e}defaultPopulateCount(){return 100}disposeAllNodes(){const e=this.topLevelNodes();for(let t=0,i=e.length;ts?1:0;return i.ascending1||(o=-o),0!==o||(r=e[i.fieldName2],s=t[i.fieldName2],o=rs?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=this.topPaddingHeight&&r>=this.bottomPaddingHeight)return;i-=500,s+=1e3;const o=this.selectedNode;this.rootNode().removeChildren(),this.topPaddingHeight=0,this.bottomPaddingHeight=0,this.addVisibleNodes(this.rootNode(),i,i+s),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 r=this.allChildren(e);let s=0,o=0;for(;ot)break;s=i}let n=s;for(;o=r&&t{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 r=0;r=t}onResize(){super.onResize(),this.updateVisibleNodes(!1)}onScroll(e){this.updateVisibleNodes(!1),this.scrollToResolveCallback&&(this.scrollToResolveCallback(),this.scrollToResolveCallback=null)}}class ft extends ct{constructor(e,t,i,s){super(e,t,{displayName:i,columns:s=s||[{id:"object",title:lt(nt.object),disclosure:!0,sortable:!0},{id:"distance",title:lt(nt.distance),width:"70px",sortable:!0,fixedWidth:!0},{id:"shallowSize",title:lt(nt.shallowSize),width:"110px",sortable:!0,fixedWidth:!0},{id:"retainedSize",title:lt(nt.retainedSize),width:"110px",sortable:!0,fixedWidth:!0,sort:r.DataGrid.Order.Descending}]})}async setDataSource(e,t){this.snapshot=e;const i=new p.HeapSnapshotModel.Node(-1,"root",0,t||e.rootNodeIndex,0,0,"");this.setRootNode(this.createRootNode(e,i)),this.rootNode().sort()}createRootNode(e,t){const i=new p.HeapSnapshotModel.Edge("",t,"",-1);return new Ze(this,e,i,null)}sortingChanged(){const e=this.rootNode();e.hasChildren()&&e.sort()}}class gt extends ft{constructor(e,t){const i=[{id:"object",title:lt(nt.object),disclosure:!0,sortable:!0},{id:"distance",title:lt(nt.distance),width:"70px",sortable:!0,fixedWidth:!0,sort:r.DataGrid.Order.Ascending},{id:"shallowSize",title:lt(nt.shallowSize),width:"110px",sortable:!0,fixedWidth:!0},{id:"retainedSize",title:lt(nt.retainedSize),width:"110px",sortable:!0,fixedWidth:!0}];super(e,t,lt(nt.heapSnapshotRetainment),i)}createRootNode(e,t){const i=new p.HeapSnapshotModel.Edge("",t,"",-1);return new Xe(this,e,i,null)}sortFields(e,t){switch(e){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",t,"count",!1);case"count":return new p.HeapSnapshotModel.ComparatorConfig("count",t,"name",!0);case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("shallowSize",t,"name",!0);case"retainedSize":return new p.HeapSnapshotModel.ComparatorConfig("retainedSize",t,"name",!0);case"distance":return new p.HeapSnapshotModel.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()}}!function(e){e.ExpandRetainersComplete="ExpandRetainersComplete"}(ut||(ut={}));class vt extends mt{profileIndex;objectIdToSelect;nextRequestedFilter;lastFilter;filterInProgress;constructor(e,t){const i=[{id:"object",title:lt(nt.constructorString),disclosure:!0,sortable:!0},{id:"distance",title:lt(nt.distance),width:"70px",sortable:!0,fixedWidth:!0},{id:"shallowSize",title:lt(nt.shallowSize),width:"110px",sortable:!0,fixedWidth:!0},{id:"retainedSize",title:lt(nt.retainedSize),width:"110px",sort:r.DataGrid.Order.Descending,sortable:!0,fixedWidth:!0}];super(e,t,{displayName:lt(nt.heapSnapshotConstructors).toString(),columns:i}),this.profileIndex=-1,this.objectIdToSelect=null,this.nextRequestedFilter=null}sortFields(e,t){switch(e){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",t,"retainedSize",!1);case"distance":return new p.HeapSnapshotModel.ComparatorConfig("distance",t,"retainedSize",!1);case"shallowSize":return new p.HeapSnapshotModel.ComparatorConfig("shallowSize",t,"name",!0);case"retainedSize":return new p.HeapSnapshotModel.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 r=await i.populateNodeBySnapshotObjectId(parseInt(e,10));return r.length?this.revealTreeNode(r):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.nodeFilterInternal=new p.HeapSnapshotModel.NodeFilter(e,t),this.populateChildren(this.nodeFilterInternal)}setAllocationNodeId(e){this.nodeFilterInternal=new p.HeapSnapshotModel.NodeFilter,this.nodeFilterInternal.allocationNodeId=e,this.populateChildren(this.nodeFilterInternal)}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 tt(this,i,t[i],e));this.sortingChanged(),this.lastFilter=e}async populateChildren(e){const t=e||new p.HeapSnapshotModel.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.nodeFilterInternal=void 0,-1!==t){const i=t>0?e[t-1].maxJSObjectId:0,r=e[t].maxJSObjectId;this.nodeFilterInternal=new p.HeapSnapshotModel.NodeFilter(i,r)}this.populateChildren(this.nodeFilterInternal)}}class wt extends mt{baseSnapshot;constructor(e,t){const i=[{id:"object",title:lt(nt.constructorString),disclosure:!0,sortable:!0},{id:"addedCount",title:lt(nt.New),width:"75px",sortable:!0,fixedWidth:!0},{id:"removedCount",title:lt(nt.Deleted),width:"75px",sortable:!0,fixedWidth:!0},{id:"countDelta",title:lt(nt.Delta),width:"65px",sortable:!0,fixedWidth:!0},{id:"addedSize",title:lt(nt.allocSize),width:"75px",sortable:!0,fixedWidth:!0,sort:r.DataGrid.Order.Descending},{id:"removedSize",title:lt(nt.freedSize),width:"75px",sortable:!0,fixedWidth:!0},{id:"sizeDelta",title:lt(nt.sizeDelta),width:"75px",sortable:!0,fixedWidth:!0}];super(e,t,{displayName:lt(nt.heapSnapshotDiff).toString(),columns:i})}defaultPopulateCount(){return 50}sortFields(e,t){switch(e){case"object":return new p.HeapSnapshotModel.ComparatorConfig("name",t,"count",!1);case"addedCount":return new p.HeapSnapshotModel.ComparatorConfig("addedCount",t,"name",!0);case"removedCount":return new p.HeapSnapshotModel.ComparatorConfig("removedCount",t,"name",!0);case"countDelta":return new p.HeapSnapshotModel.ComparatorConfig("countDelta",t,"name",!0);case"addedSize":return new p.HeapSnapshotModel.ComparatorConfig("addedSize",t,"name",!0);case"removedSize":return new p.HeapSnapshotModel.ComparatorConfig("removedSize",t,"name",!0);case"sizeDelta":return new p.HeapSnapshotModel.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(pt.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 rt(this,e,i))}this.sortingChanged()}}class St extends mt{linkifierInternal;topNodes;constructor(e,t){const i=[{id:"liveCount",title:lt(nt.liveCount),width:"75px",sortable:!0,fixedWidth:!0},{id:"count",title:lt(nt.count),width:"65px",sortable:!0,fixedWidth:!0},{id:"liveSize",title:lt(nt.liveSize),width:"75px",sortable:!0,fixedWidth:!0},{id:"size",title:lt(nt.size),width:"75px",sortable:!0,fixedWidth:!0,sort:r.DataGrid.Order.Descending},{id:"name",title:lt(nt.function),disclosure:!0,sortable:!0}];super(e,t,{displayName:lt(nt.allocation).toString(),columns:i}),this.linkifierInternal=new d.Linkifier.Linkifier}get linkifier(){return this.linkifierInternal}dispose(){this.linkifierInternal.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 st(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.DataGrid.Order.Ascending?1:-1;return function(i,r){return i[e]>r[e]?t:i[e]{e(t?new r(this,n):null)})),this.postMessage({callId:s,disposition:"factory",objectId:t,methodName:i,methodArguments:o,newObjectId:n}),null):(this.postMessage({callId:s,disposition:"factory",objectId:t,methodName:i,methodArguments:o,newObjectId:n}),new r(this,n))}callMethod(e,t,i){const r=this.nextCallId++,s=Array.prototype.slice.call(arguments,3);e&&this.callbacks.set(r,e),this.postMessage({callId:r,disposition:"method",objectId:t,methodName:i,methodArguments:s})}startCheckingForLongRunningCalls(){this.interval||(this.checkLongRunningCalls(),this.interval=window.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("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.Console.instance().error(Tt(Ct.anErrorOccurredWhenACallToMethod,{PH1:t.errorMethodName})),o.Console.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)}}class yt{worker;objectId;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,...r){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 It extends yt{profileUid;snapshotReceivedCallback;constructor(e,t,i,r){super(e,t),this.profileUid=i,this.snapshotReceivedCallback=r}async write(e){await this.callMethodPromise("write",e)}async close(){await this.callMethodPromise("close");const e=await new Promise((e=>this.callFactoryMethod(e,"buildSnapshot",Rt)));this.dispose(),e.setProfileUid(this.profileUid),await e.updateStaticData(),this.snapshotReceivedCallback(e)}}class Rt extends yt{staticData;profileUid;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",Et,e)}createRetainingEdgesProvider(e){return this.callFactoryMethod(null,"createRetainingEdgesProvider",Et,e)}createAddedNodesProvider(e,t){return this.callFactoryMethod(null,"createAddedNodesProvider",Et,e,t)}createDeletedNodesProvider(e){return this.callFactoryMethod(null,"createDeletedNodesProvider",Et,e)}createNodesProvider(e){return this.callFactoryMethod(null,"createNodesProvider",Et,e)}createNodesProviderForClass(e,t){return this.callFactoryMethod(null,"createNodesProviderForClass",Et,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 Et extends yt{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 Nt=Object.freeze({__proto__:null,HeapSnapshotWorkerProxy:xt,HeapSnapshotProxyObject:yt,HeapSnapshotLoaderProxy:It,HeapSnapshotProxy:Rt,HeapSnapshotProviderProxy:Et});const kt={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.",exposeInternals:"Expose internals (includes additional implementation-specific details)",captureNumericValue:"Include numerical values in capture",snapshotting:"Snapshotting…",snapshotD:"Snapshot {PH1}",percentagePlaceholder:"{PH1}%",allocationInstrumentationOn:"Allocation instrumentation on timeline",stopRecordingHeapProfile:"Stop recording heap profile",startRecordingHeapProfile:"Start recording heap profile",recordAllocationStacksExtra:"Record stack traces of allocations (extra performance overhead)",recording:"Recording…",allocationTimelines:"ALLOCATION TIMELINES",AllocationTimelinesShowInstrumented:"Allocation timelines show instrumented JavaScript memory allocations over time. Once profile is recorded you can select a time interval to see objects that were allocated within it and still alive by the end of recording. 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."},Dt=t.i18n.registerUIStrings("panels/profiler/HeapSnapshotView.ts",kt),Mt=t.i18n.getLocalizedString.bind(void 0,Dt),Ft=t.i18n.registerUIStrings("panels/profiler/ModuleUIStrings.ts",{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…"}),Ht=t.i18n.getLocalizedString.bind(void 0,Ft);class Lt extends s.View.SimpleView{searchResults;profile;linkifier;parentDataDisplayDelegate;searchableViewInternal;splitWidget;containmentDataGrid;containmentWidget;statisticsView;constructorsDataGrid;constructorsWidget;diffDataGrid;diffWidget;allocationDataGrid;allocationWidget;allocationStackView;tabbedPane;retainmentDataGrid;retainmentWidget;objectDetailsView;perspectives;comparisonPerspective;perspectiveSelect;baseSelect;filterSelect;classNameFilter;selectedSizeText;popoverHelper;currentPerspectiveIndex;currentPerspective;dataGrid;searchThrottler;baseProfile;trackingOverviewGrid;currentSearchResultIndex=-1;currentQuery;constructor(e,t){super(Mt(kt.heapSnapshot)),this.searchResults=[],this.element.classList.add("heap-snapshot-view"),this.profile=t,this.linkifier=new d.Linkifier.Linkifier;const i=t.profileType();i.addEventListener("SnapshotReceived",this.onReceiveSnapshot,this),i.addEventListener(D.RemoveProfileHeader,this.onProfileHeaderRemoved,this);const n=i.id===At.TypeId;n&&this.createOverview();const a=Kt.trackingHeapSnapshotProfileType.recordAllocationStacksSetting().get();this.parentDataDisplayDelegate=e,this.searchableViewInternal=new s.SearchableView.SearchableView(this,null),this.searchableViewInternal.setPlaceholder(Mt(kt.find),Mt(kt.find)),this.searchableViewInternal.show(this.element),this.splitWidget=new s.SplitWidget.SplitWidget(!1,!0,"heapSnapshotSplitViewState",200,200),this.splitWidget.show(this.searchableViewInternal.element);const l=t.heapProfilerModel();let h;if(this.containmentDataGrid=new ft(l,this,Mt(kt.containment)),this.containmentDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.selectionChanged,this),this.containmentWidget=this.containmentDataGrid.asWidget(),this.containmentWidget.setMinimumSize(50,25),this.statisticsView=new _t,this.constructorsDataGrid=new vt(l,this),this.constructorsDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.selectionChanged,this),this.constructorsWidget=this.constructorsDataGrid.asWidget(),this.constructorsWidget.setMinimumSize(50,25),this.diffDataGrid=new wt(l,this),this.diffDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.selectionChanged,this),this.diffWidget=this.diffDataGrid.asWidget(),this.diffWidget.setMinimumSize(50,25),this.allocationDataGrid=null,n&&a&&(this.allocationDataGrid=new St(l,this),this.allocationDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.onSelectAllocationNode,this),this.allocationWidget=this.allocationDataGrid.asWidget(),this.allocationWidget.setMinimumSize(50,25),this.allocationStackView=new Jt(l),this.allocationStackView.setMinimumSize(50,25),this.tabbedPane=new s.TabbedPane.TabbedPane),this.retainmentDataGrid=new gt(l,this),this.retainmentWidget=this.retainmentDataGrid.asWidget(),this.retainmentWidget.setMinimumSize(50,21),this.retainmentWidget.element.classList.add("retaining-paths-view"),this.allocationStackView)this.tabbedPane=new s.TabbedPane.TabbedPane,this.tabbedPane.appendTab("retainers",Mt(kt.retainers),this.retainmentWidget),this.tabbedPane.appendTab("allocation-stack",Mt(kt.allocationStack),this.allocationStackView),h=this.tabbedPane.headerElement(),this.objectDetailsView=this.tabbedPane;else{const e=document.createElement("div");e.classList.add("heap-snapshot-view-resizer");const t=e.createChild("div","title");e.createChild("div","verticalResizerIcon");t.createChild("span").textContent=Mt(kt.retainers),h=e,this.objectDetailsView=new s.Widget.VBox,this.objectDetailsView.element.appendChild(e),this.retainmentWidget.show(this.objectDetailsView.element)}this.splitWidget.hideDefaultResizer(),this.splitWidget.installResizer(h),this.retainmentDataGrid.addEventListener(r.DataGrid.Events.SelectedNode,this.inspectedObjectChanged,this),this.retainmentDataGrid.reset(),this.perspectives=[],this.comparisonPerspective=new zt,this.perspectives.push(new Ot),t.profileType()!==Kt.trackingHeapSnapshotProfileType&&this.perspectives.push(this.comparisonPerspective),this.perspectives.push(new Bt),this.allocationWidget&&this.perspectives.push(new Gt),this.perspectives.push(new Vt),this.perspectiveSelect=new s.Toolbar.ToolbarComboBox(this.onSelectedPerspectiveChanged.bind(this),Mt(kt.perspective)),this.updatePerspectiveOptions(),this.baseSelect=new s.Toolbar.ToolbarComboBox(this.changeBase.bind(this),Mt(kt.baseSnapshot)),this.baseSelect.setVisible(!1),this.updateBaseOptions(),this.filterSelect=new s.Toolbar.ToolbarComboBox(this.changeFilter.bind(this),Mt(kt.filter)),this.filterSelect.setVisible(!1),this.updateFilterOptions(),this.classNameFilter=new s.Toolbar.ToolbarInput(Mt(kt.classFilter)),this.classNameFilter.setVisible(!1),this.constructorsDataGrid.setNameFilter(this.classNameFilter),this.diffDataGrid.setNameFilter(this.classNameFilter),this.selectedSizeText=new s.Toolbar.ToolbarText,this.popoverHelper=new s.PopoverHelper.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 o.Throttler.Throttler(0);for(const e of this.profiles())e.addEventListener(k.ProfileTitleChanged,this.updateControls,this)}createOverview(){const e=this.profile.profileType();this.trackingOverviewGrid=new Re,this.trackingOverviewGrid.addEventListener("IdsRangeChanged",this.onIdsRangeChanged.bind(this)),this.profile.fromFile()||e.profileBeingRecorded()!==this.profile||(e.addEventListener("HeapStatsUpdate",this.onHeapStatsUpdate,this),e.addEventListener("TrackingStopped",this.onStopTracking,this),this.trackingOverviewGrid.start())}onStopTracking(){const e=this.profile.profileType();e.removeEventListener("HeapStatsUpdate",this.onHeapStatsUpdate,this),e.removeEventListener("TrackingStopped",this.onStopTracking,this),this.trackingOverviewGrid&&this.trackingOverviewGrid.stop()}onHeapStatsUpdate({data:e}){this.trackingOverviewGrid&&this.trackingOverviewGrid.setSamples(e)}searchableView(){return this.searchableViewInternal}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 r=t.runtimeModel().debuggerModel().createRawLocationByScriptId(String(i.scriptId),i.lineNumber,i.columnNumber);if(!r)return null;const s=r.script(),o=s&&s.sourceURL;return o&&this.linkifier?this.linkifier.linkifyRawLocation(r,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===At.TypeId&&this.profile.fromFile()){const t=await e.getSamples();if(t){console.assert(Boolean(t.timestamps.length));const e=new Ne;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:Mt(kt.code)},{value:t.strings,color:"#5e5",title:Mt(kt.strings)},{value:t.jsArrays,color:"#7af",title:Mt(kt.jsArrays)},{value:t.native,color:"#fc5",title:Mt(kt.typedArrays)},{value:t.system,color:"#98f",title:Mt(kt.systemObjects)}];return this.statisticsView.setTotalAndRecords(t.total,i),t}onIdsRangeChanged(t){const{minId:i,maxId:r}=t.data;this.selectedSizeText.setText(Mt(kt.selectedSizeS,{PH1:e.NumberUtilities.bytesToString(t.data.size)})),this.constructorsDataGrid.snapshot&&this.constructorsDataGrid.setSelectionRange(i,r)}async toolbarItems(){const e=[this.perspectiveSelect,this.classNameFilter];return this.profile.profileType()!==Kt.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}onSearchCanceled(){this.currentSearchResultIndex=-1,this.searchResults=[]}selectRevealedNode(e){e&&e.select()}performSearch(e,t,i){const r=new p.HeapSnapshotModel.SearchConfig(e.query.trim(),e.caseSensitive,e.isRegex,t,i||!1);this.searchThrottler.schedule(this.performSearchInternal.bind(this,r))}async performSearchInternal(e){if(this.onSearchCanceled(),!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.searchableViewInternal.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.searchableViewInternal.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 Ye&&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 r=i.once(pt.ContentShown),s=this.perspectiveSelect.options().find((e=>e.value===String(t)));this.perspectiveSelect.select(s),this.changePerspective(t),await r}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.Console.instance().error("Cannot find corresponding heap snapshot node")}getPopoverRequest(e){const t=s.UIUtils.enclosingNodeOrSelfWithNodeName(e.target,"span"),i=s.UIUtils.enclosingNodeOrSelfWithNodeName(e.target,"tr");if(!i)return null;if(!this.dataGrid)return null;const r=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),o=this.profile.heapProfilerModel();if(!r||!t||!o)return null;let n;return{box:t.boxInWindow(),show:async e=>{if(!o)return!1;const t=await r.queryObjectContent(o,"popover");return!!t&&(n=await u.ObjectPopoverHelper.ObjectPopoverHelper.buildObjectPopover(t,e),!!n||(o.runtimeModel().releaseObjectGroup("popover"),!1))},hide:()=>{o.runtimeModel().releaseObjectGroup("popover"),n&&n.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(Mt(kt.allObjects));for(let t=0;t-1&&this.filterSelect.setSelectedIndex(t)}updateControls(){this.updatePerspectiveOptions(),this.updateBaseOptions(),this.updateFilterOptions()}onReceiveSnapshot(e){this.updateControls();e.data.addEventListener(k.ProfileTitleChanged,this.updateControls,this)}onProfileHeaderRemoved(e){const t=e.data;t.removeEventListener(k.ProfileTitleChanged,this.updateControls,this),this.profile===t?(this.detach(),this.profile.profileType().removeEventListener("SnapshotReceived",this.onReceiveSnapshot,this),this.profile.profileType().removeEventListener(D.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("IdsRangeChanged",this.onIdsRangeChanged.bind(this))}}class jt{titleInternal;constructor(e){this.titleInternal=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.titleInternal}supportsSearch(){return!1}}class Ot extends jt{constructor(){super(Mt(kt.summary))}activate(e){e.splitWidget.setMainWidget(e.constructorsWidget),e.splitWidget.setSidebarWidget(e.objectDetailsView),e.splitWidget.show(e.searchableViewInternal.element),e.filterSelect.setVisible(!0),e.classNameFilter.setVisible(!0),e.trackingOverviewGrid&&(e.trackingOverviewGrid.show(e.searchableViewInternal.element,e.splitWidget.element),e.trackingOverviewGrid.update(),e.trackingOverviewGrid.updateGrid())}masterGrid(e){return e.constructorsDataGrid}supportsSearch(){return!0}}class zt extends jt{constructor(){super(Mt(kt.comparison))}activate(e){e.splitWidget.setMainWidget(e.diffWidget),e.splitWidget.setSidebarWidget(e.objectDetailsView),e.splitWidget.show(e.searchableViewInternal.element),e.baseSelect.setVisible(!0),e.classNameFilter.setVisible(!0)}masterGrid(e){return e.diffDataGrid}supportsSearch(){return!0}}class Bt extends jt{constructor(){super(Mt(kt.containment))}activate(e){e.splitWidget.setMainWidget(e.containmentWidget),e.splitWidget.setSidebarWidget(e.objectDetailsView),e.splitWidget.show(e.searchableViewInternal.element)}masterGrid(e){return e.containmentDataGrid}}class Gt extends jt{allocationSplitWidget;constructor(){super(Mt(kt.allocation)),this.allocationSplitWidget=new s.SplitWidget.SplitWidget(!1,!0,"heapSnapshotAllocationSplitViewState",200,200),this.allocationSplitWidget.setSidebarWidget(new s.Widget.VBox)}activate(e){e.allocationWidget&&this.allocationSplitWidget.setMainWidget(e.allocationWidget),e.splitWidget.setMainWidget(e.constructorsWidget),e.splitWidget.setSidebarWidget(e.objectDetailsView);const t=new s.Widget.VBox,i=document.createElement("div");i.classList.add("heap-snapshot-view-resizer");const r=i.createChild("div","title").createChild("span");if(i.createChild("div","verticalResizerIcon"),r.textContent=Mt(kt.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.searchableViewInternal.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 Vt extends jt{constructor(){super(Mt(kt.statistics))}activate(e){e.statisticsView.show(e.searchableViewInternal.element)}masterGrid(e){return null}}class Ut extends(o.ObjectWrapper.eventMixin(L)){exposeInternals;captureNumericValue;customContentInternal;constructor(e,t){super(e||Ut.TypeId,t||Mt(kt.heapSnapshot)),l.TargetManager.TargetManager.instance().observeModels(l.HeapProfilerModel.HeapProfilerModel,this),l.TargetManager.TargetManager.instance().addModelListener(l.HeapProfilerModel.HeapProfilerModel,l.HeapProfilerModel.Events.ResetProfiles,this.resetProfiles,this),l.TargetManager.TargetManager.instance().addModelListener(l.HeapProfilerModel.HeapProfilerModel,l.HeapProfilerModel.Events.AddHeapSnapshotChunk,this.addHeapSnapshotChunk,this),l.TargetManager.TargetManager.instance().addModelListener(l.HeapProfilerModel.HeapProfilerModel,l.HeapProfilerModel.Events.ReportHeapSnapshotProgress,this.reportHeapSnapshotProgress,this),this.exposeInternals=o.Settings.Settings.instance().createSetting("exposeInternals",!1),this.captureNumericValue=o.Settings.Settings.instance().createSetting("captureNumericValue",!1),this.customContentInternal=null}modelAdded(e){e.enable()}modelRemoved(e){}getProfiles(){return super.getProfiles()}fileExtension(){return".heapsnapshot"}get buttonTooltip(){return Mt(kt.takeHeapSnapshot)}isInstantProfile(){return!0}buttonClicked(){return this.takeHeapSnapshot(),a.userMetrics.actionTaken(a.UserMetrics.Action.ProfilesHeapProfileTaken),!1}get treeItemTitle(){return Mt(kt.heapSnapshots)}get description(){return Mt(kt.heapSnapshotProfilesShowMemory)}customContent(){const e=document.createElement("div"),t=c.Runtime.experiments.isEnabled("showOptionToExposeInternalsInHeapSnapshot"),i=!t;if(t){const t=s.SettingsUI.createSettingCheckbox(Mt(kt.exposeInternals),this.exposeInternals,i);e.appendChild(t)}const r=s.SettingsUI.createSettingCheckbox(Mt(kt.captureNumericValue),this.captureNumericValue,i);return e.appendChild(r),this.customContentInternal=e,e}setCustomContentEnabled(e){this.customContentInternal&&this.customContentInternal.querySelectorAll("[is=dt-checkbox]").forEach((t=>{t.checkboxElement.disabled=!e}))}createProfileLoadedFromFile(e){return new Wt(null,this,e)}async takeHeapSnapshot(){if(this.profileBeingRecorded())return;const e=s.Context.Context.instance().flavor(l.HeapProfilerModel.HeapProfilerModel);if(!e)return;let t=new Wt(e,this);this.setProfileBeingRecorded(t),this.addProfile(t),t.updateStatus(Mt(kt.snapshotting)),await e.takeHeapSnapshot({reportProgress:!0,captureNumericValue:this.captureNumericValue.get(),exposeInternals:this.exposeInternals.get()}),t=this.profileBeingRecorded(),t&&(t.title=Mt(kt.snapshotD,{PH1:t.uid}),t.finishLoad(),this.setProfileBeingRecorded(null),this.dispatchEventToListeners(D.ProfileComplete,t))}addHeapSnapshotChunk(e){const t=this.profileBeingRecorded();t&&t.transferChunk(e.data)}reportHeapSnapshotProgress(e){const t=this.profileBeingRecorded();if(!t)return;const{done:i,total:r,finished:s}=e.data;t.updateStatus(Mt(kt.percentagePlaceholder,{PH1:(i/r*100).toFixed(0)}),!0),s&&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("SnapshotReceived",e)}static TypeId="HEAP";static SnapshotReceived="SnapshotReceived"}class At extends(o.ObjectWrapper.eventMixin(Ut)){recordAllocationStacksSettingInternal;customContentInternal;recording;profileSamples;constructor(){super(At.TypeId,Mt(kt.allocationInstrumentationOn)),this.recordAllocationStacksSettingInternal=o.Settings.Settings.instance().createSetting("recordAllocationStacks",!1),this.customContentInternal=null,this.recording=!1}modelAdded(e){super.modelAdded(e),e.addEventListener(l.HeapProfilerModel.Events.HeapStatsUpdate,this.heapStatsUpdate,this),e.addEventListener(l.HeapProfilerModel.Events.LastSeenObjectId,this.lastSeenObjectId,this)}modelRemoved(e){super.modelRemoved(e),e.removeEventListener(l.HeapProfilerModel.Events.HeapStatsUpdate,this.heapStatsUpdate,this),e.removeEventListener(l.HeapProfilerModel.Events.LastSeenObjectId,this.lastSeenObjectId,this)}heapStatsUpdate(e){if(!this.profileSamples)return;const t=e.data;let i;for(let e=0;e{this.fulfillLoad=e})),this.totalNumberOfChunks=0,this.bufferedWriter=null,this.onTempFileReady=null}heapProfilerModel(){return this.heapProfilerModelInternal}async getLocation(e){return this.snapshotProxy?this.snapshotProxy.getLocation(e):null}createSidebarTreeElement(e){return new A(e,this,"heap-snapshot-sidebar-tree-item")}createView(e){return new Lt(e,this)}prepareToLoad(){console.assert(!this.receiver,"Already loading"),this.setupWorker(),this.updateStatus(Mt(kt.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 xt(this.handleWorkerEvent.bind(this)),this.workerProxy.addEventListener("Wait",(e=>{this.updateStatus(null,e.data)}),this),this.receiver=this.workerProxy.createLoader(this.uid,this.snapshotReceived.bind(this))}handleWorkerEvent(e,i){if(p.HeapSnapshotModel.HeapSnapshotProgressEvent.BrokenSnapshot===e){const e=i;return void o.Console.Console.instance().error(e)}if(p.HeapSnapshotModel.HeapSnapshotProgressEvent.Update!==e)return;const r=i,s=t.i18n.deserializeUIString(r);this.updateStatus(Ht(s.string,s.values))}dispose(){this.workerProxy&&this.workerProxy.dispose(),this.removeTempFile(),this.wasDisposed=!0}didCompleteSnapshotTransfer(){this.snapshotProxy&&this.updateStatus(e.NumberUtilities.bytesToString(this.snapshotProxy.totalSize),!1)}transferChunk(e){this.bufferedWriter||(this.bufferedWriter=new h.TempFile.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.fulfillLoad(this.snapshotProxy),this.profileType().snapshotReceived(this),this.canSaveToFile()&&this.dispatchEventToListeners(k.ProfileReceived)}canSaveToFile(){return!this.fromFile()&&Boolean(this.snapshotProxy)}saveToFile(){const t=new h.FileUtils.FileOutputStream;this.fileName=this.fileName||"Heap-"+e.DateUtilities.toISO8601Compact(new Date)+this.profileType().fileExtension();const i=async e=>{if(e){if(this.failedToCreateTempFile)return o.Console.Console.instance().error("Failed to open temp file with heap snapshot"),void t.close();if(this.tempFile){const e=await this.tempFile.copyToOutputStream(t,this.onChunkTransferred.bind(this));return e&&o.Console.Console.instance().error("Failed to read heap snapshot from temp file: "+e.message),void this.didCompleteSnapshotTransfer()}this.onTempFileReady=()=>{i(e)},this.updateSaveProgress(0,1)}};t.open(this.fileName).then(i.bind(this))}onChunkTransferred(e){this.updateSaveProgress(e.loadedSize(),e.fileSize())}updateSaveProgress(e,t){const i=(100*(t&&e/t)).toFixed(0);this.updateStatus(Mt(kt.savingD,{PH1:i}))}async loadFromFile(e){this.updateStatus(Mt(kt.loading),!0),this.setupWorker();const t=new h.FileUtils.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()}profileType(){return super.profileType()}}class _t extends s.Widget.VBox{pieChart;constructor(){super(),this.element.classList.add("heap-snapshot-statistics-view"),this.pieChart=new n.PieChart.PieChart,this.setTotalAndRecords(0,[]),this.pieChart.classList.add("heap-snapshot-stats-pie-chart"),this.element.appendChild(this.pieChart)}static valueFormatter(t){return Mt(kt.sKb,{PH1:e.NumberUtilities.withThousandsSeparator(Math.round(t/1e3))})}setTotalAndRecords(e,t){this.pieChart.data={chartName:Mt(kt.heapMemoryUsage),size:150,formatter:_t.valueFormatter,showLegend:!0,total:e,slices:t}}}class Jt extends s.Widget.Widget{heapProfilerModel;linkifier;frameElements;constructor(e){super(),this.heapProfilerModel=e,this.linkifier=new d.Linkifier.Linkifier,this.frameElements=[]}onContextMenu(e,t){const i=new s.ContextMenu.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=$t.get(t);if(!i)return;const r=d.Linkifier.Linkifier.linkInfo(i);if(!r)return;return void(d.Linkifier.Linkifier.invokeFirstAction(r)&&e.consume(!0))}let i;const r=e;if("ArrowUp"===r.key)i=!1;else{if("ArrowDown"!==r.key)return;i=!0}const s=this.frameElements.indexOf(t);if(-1===s)return;const o=i?s+1:s-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 s.UIUtils.createTextChild(e,Mt(kt.stackWasNotRecordedForThisObject))}const r=this.element.createChild("div","heap-allocation-stack");r.addEventListener("keydown",this.onStackViewKeydown.bind(this),!1);for(const e of i){const t=r.createChild("div","stack-frame");this.frameElements.push(t),t.tabIndex=-1;if(t.createChild("div").textContent=s.UIUtils.beautifyFunctionName(e.functionName),!e.scriptId)continue;const i=this.heapProfilerModel?this.heapProfilerModel.target():null,o={columnNumber:e.column-1,inlineFrameIndex:0},n=this.linkifier.linkifyScriptLocation(i,String(e.scriptId),e.scriptName,e.line-1,o);t.appendChild(n),$t.set(t,n),t.addEventListener("contextmenu",this.onContextMenu.bind(this,n))}this.frameElements[0].tabIndex=0}clear(){this.element.removeChildren(),this.frameElements=[],this.linkifier.reset()}}const $t=new WeakMap;var qt=Object.freeze({__proto__:null,HeapSnapshotView:Lt,Perspective:jt,SummaryPerspective:Ot,ComparisonPerspective:zt,ContainmentPerspective:Bt,AllocationPerspective:Gt,StatisticsPerspective:Vt,HeapSnapshotProfileType:Ut,TrackingHeapSnapshotProfileType:At,HeapProfileHeader:Wt,HeapSnapshotStatisticsView:_t,HeapAllocationStackView:Jt});class Qt{cpuProfileType;heapSnapshotProfileType;samplingHeapProfileType;trackingHeapSnapshotProfileType;constructor(){this.cpuProfileType=new oe,this.heapSnapshotProfileType=new Ut,this.samplingHeapProfileType=new Be,this.trackingHeapSnapshotProfileType=new At}}const Kt=new Qt;var Yt=Object.freeze({__proto__:null,ProfileTypeRegistry:Qt,instance:Kt});const Zt={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",deprecationWarnMsg:"This panel will be deprecated in the upcoming version. Use the Performance panel to record JavaScript CPU profiles.",learnMore:"Learn more",feedback:"Feedback",goToPerformancePanel:"Go to Performance Panel",enableThisPanelTemporarily:"Enable this panel temporarily"},Xt=t.i18n.registerUIStrings("panels/profiler/ProfilesPanel.ts",Zt),ei=t.i18n.getLocalizedString.bind(void 0,Xt);class ti extends s.Panel.PanelWithSidebar{profileTypes;profilesItemTreeElement;sidebarTree;profileViews;toolbarElement;toggleRecordAction;toggleRecordButton;clearResultsButton;profileViewToolbar;profileGroups;launcherView;visibleView;profileToView;typeIdToSidebarSection;fileSelectorElement;selectedProfileType;constructor(e,t,i){super(e),this.profileTypes=t;const r=new s.Widget.VBox;this.splitWidget().setMainWidget(r),this.profilesItemTreeElement=new oi(this),this.sidebarTree=new s.TreeOutline.TreeOutlineInShadow,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"),r.element.appendChild(this.profileViews),this.toolbarElement=document.createElement("div"),this.toolbarElement.classList.add("profiles-toolbar"),r.element.insertBefore(this.toolbarElement,r.element.firstChild),this.panelSidebarElement().classList.add("profiles-tree-sidebar");const o=document.createElement("div");o.classList.add("profiles-toolbar"),this.panelSidebarElement().insertBefore(o,this.panelSidebarElement().firstChild);const n=new s.Toolbar.Toolbar("",o);this.toggleRecordAction=s.ActionRegistry.ActionRegistry.instance().action(i),this.toggleRecordButton=s.Toolbar.Toolbar.createActionButton(this.toggleRecordAction),n.appendToolbarItem(this.toggleRecordButton),this.clearResultsButton=new s.Toolbar.ToolbarButton(ei(Zt.clearAllProfiles),"clear"),this.clearResultsButton.addEventListener(s.Toolbar.ToolbarButton.Events.Click,this.reset,this),n.appendToolbarItem(this.clearResultsButton),n.appendSeparator(),n.appendToolbarItem(s.Toolbar.Toolbar.createActionButtonForId("components.collect-garbage")),this.profileViewToolbar=new s.Toolbar.Toolbar("",this.toolbarElement),this.profileViewToolbar.makeWrappable(!0),this.profileGroups={},this.launcherView=new xe(this),this.launcherView.addEventListener(ye.ProfileTypeSelected,this.onProfileTypeSelected,this),this.profileToView=[],this.typeIdToSidebarSection={};const a=this.profileTypes;for(let e=0;eBoolean(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.Console.instance().error(ei(Zt.cantLoadFileSupportedFile,{PH1:Array.from(e).join("', '")}))}if(Boolean(t.profileBeingRecorded()))return void o.Console.Console.instance().error(ei(Zt.cantLoadProfileWhileAnother));const i=await t.loadFromFile(e);i&&"message"in i&&s.UIUtils.MessageDialog.show(ei(Zt.profileLoadingFailedS,{PH1:i.message}))}toggleRecord(){if(!this.toggleRecordAction.enabled())return!0;const t=e.DOMUtilities.deepActiveElement(this.element.ownerDocument),i=this.selectedProfileType;if(!i)return!0;const r=i.buttonClicked();return this.updateToggleRecordAction(r),r?(this.launcherView.profileStarted(),i.hasTemporaryView()&&this.showProfile(i.profileBeingRecorded())):this.launcherView.profileFinished(),t&&t.focus(),!0}onSuspendStateChanged(){this.updateToggleRecordAction(this.toggleRecordAction.toggled())}updateToggleRecordAction(e){const t=Boolean(s.Context.Context.instance().flavor(l.CPUProfilerModel.CPUProfilerModel)||s.Context.Context.instance().flavor(l.HeapProfilerModel.HeapProfilerModel)),i=e||!l.TargetManager.TargetManager.instance().allTargetsSuspended()&&t;this.toggleRecordAction.setEnabled(i),this.toggleRecordAction.setToggled(e),i?this.toggleRecordButton.setTitle(this.selectedProfileType?this.selectedProfileType.buttonTooltip:""):this.toggleRecordButton.setTitle(s.UIUtils.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 ii(this,e);this.typeIdToSidebarSection[e.id]=t,this.sidebarTree.appendChild(t),t.childrenListElement.addEventListener("contextmenu",this.handleContextMenuEvent.bind(this),!1),e.addEventListener(D.ViewUpdated,this.updateProfileTypeSpecificUI,this),e.addEventListener(D.AddProfileHeader,(function(e){this.addProfileHeader(e.data)}),this),e.addEventListener(D.RemoveProfileHeader,(function(e){this.removeProfileHeader(e.data)}),this),e.addEventListener(D.ProfileComplete,(function(e){this.showProfile(e.data)}),this);const i=e.getProfiles();for(let e=0;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()}wasShown(){super.wasShown(),this.registerCSSFiles([he,pe,ce]),this.sidebarTree.registerCSSFiles([ue])}}class ii extends s.TreeOutline.TreeElement{dataDisplayDelegate;profileTreeElements;profileGroups;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 r=e.createSidebarTreeElement(this.dataDisplayDelegate);if(this.profileTreeElements.push(r),!e.fromFile()&&t.profileBeingRecorded()!==e){const t=e.title;let s=this.profileGroups[t];s||(s=new ri,this.profileGroups[t]=s),s.profileSidebarTreeElements.push(r);const o=s.profileSidebarTreeElements.length;if(2===o){s.sidebarTreeElement=new si(this.dataDisplayDelegate,e.title);const t=s.profileSidebarTreeElements[0],i=this.children().indexOf(t);this.insertChild(s.sidebarTreeElement,i);const r=t.selected;this.removeChild(t),s.sidebarTreeElement.appendChild(t),r&&t.revealAndSelect(),t.setSmall(!0),t.setMainTitle(ei(Zt.runD,{PH1:1})),this.treeOutline&&this.treeOutline.element.classList.add("some-expandable")}o>=2&&(i=s.sidebarTreeElement,r.setSmall(!0),r.setMainTitle(ei(Zt.runD,{PH1:o})))}i&&i.appendChild(r)}removeProfileHeader(e){const t=this.sidebarElementIndex(e);if(-1===t)return!1;const i=this.profileTreeElements[t];this.profileTreeElements.splice(t,1);let r=this;const s=this.profileGroups[e.title];if(s){const t=s.profileSidebarTreeElements;if(t.splice(t.indexOf(i),1),1===t.length){const i=r.children().indexOf(s.sidebarTreeElement);s.sidebarTreeElement&&s.sidebarTreeElement.removeChild(t[0]),this.insertChild(t[0],i),t[0].setSmall(!1),t[0].setMainTitle(e.title),s.sidebarTreeElement&&this.removeChild(s.sidebarTreeElement)}0!==t.length&&(r=s.sidebarTreeElement)}return r&&r.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;i0;if(e){const e=this.lastChild();e instanceof A&&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 oi extends s.TreeOutline.TreeElement{panel;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=ei(Zt.profiles)}}let ni;class ai extends ti{constructor(){super("js_profiler",[Kt.cpuProfileType],"profiler.js-toggle-recording"),this.splitWidget().mainWidget()?.setMinimumSize(350,0),c.Runtime.experiments.isEnabled(c.Runtime.ExperimentName.JS_PROFILER_TEMP_ENABLE)&&(c.Runtime.experiments.isEnabled("jsProfilerTemporarilyEnable")?this.#t():this.#i())}static instance(e={forceNew:null}){const{forceNew:t}=e;return ni&&!t||(ni=new ai),ni}#t(){function e(){a.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab("https://github.com/ChromeDevTools/rfcs/discussions/2")}const t=new s.Infobar.Infobar(s.Infobar.Type.Warning,ei(Zt.deprecationWarnMsg),[{text:ei(Zt.learnMore),highlight:!1,delegate:e,dismiss:!1},{text:ei(Zt.feedback),highlight:!1,delegate:e,dismiss:!1},{text:ei(Zt.goToPerformancePanel),highlight:!0,delegate:async function(){await s.InspectorView.InspectorView.instance().showPanel("timeline")},dismiss:!1}],void 0);t.setParentView(this),this.splitWidget().mainWidget()?.element.prepend(t.element)}#i(){const e=this.splitWidget().mainWidget();if(e?.detachChildWidgets(),e){const t=new s.Widget.VBox;t.contentElement.classList.add("empty-landing-page","fill");const i=t.contentElement.createChild("div");i.createChild("p").textContent="This panel is deprecated and will be removed in the next version. Use the Performance panel to record JavaScript CPU profiles.",i.createChild("p").textContent="You can temporarily enable this panel with Settings > Experiments > Enable JavaScript Profiler.",i.appendChild(s.UIUtils.createTextButton(ei(Zt.goToPerformancePanel),(async function(){await s.InspectorView.InspectorView.instance().showPanel("timeline")}),"infobar-button primary-button")),i.appendChild(s.UIUtils.createTextButton(ei(Zt.learnMore),(function(){a.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab("https://developer.chrome.com/blog/js-profiler-deprecation/")}))),i.appendChild(s.UIUtils.createTextButton(ei(Zt.feedback),(function(){a.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab("https://bugs.chromium.org/p/chromium/issues/detail?id=1354548")}))),i.appendChild(s.UIUtils.createTextButton(ei(Zt.enableThisPanelTemporarily),(async function(){await s.ViewManager.ViewManager.instance().showView("experiments");(await s.ViewManager.ViewManager.instance().view("experiments").widget()).setFilter("Enable JavaScript Profiler temporarily")}))),t.show(e.element)}}wasShown(){super.wasShown(),s.Context.Context.instance().setFlavor(ai,this)}willHide(){s.Context.Context.instance().setFlavor(ai,null)}handleAction(e,t){const i=s.Context.Context.instance().flavor(ai);if(!(i instanceof ai))throw new Error("non-null JSProfilerPanel expected!");return i.toggleRecord(),!0}}var li=Object.freeze({__proto__:null,ProfilesPanel:ti,ProfileTypeSidebarSection:ii,ProfileGroup:ri,ProfileGroupSidebarTreeElement:si,ProfilesSidebarTreeElement:oi,JSProfilerPanel:ai});const di={revealInSummaryView:"Reveal in Summary view"},hi=t.i18n.registerUIStrings("panels/profiler/HeapProfilerPanel.ts",di),ci=t.i18n.getLocalizedString.bind(void 0,hi);let pi;class ui extends ti{constructor(){const e=Kt;super("heap_profiler",[e.heapSnapshotProfileType,e.trackingHeapSnapshotProfileType,e.samplingHeapProfileType],"profiler.heap-toggle-recording")}static instance(){return pi||(pi=new ui),pi}appendApplicableItems(e,t,i){if(!(i instanceof l.RemoteObject.RemoteObject))return;if(!this.isShowing())return;const r=i;if(!r.objectId)return;const s=r.objectId;if(!Kt.heapSnapshotProfileType.getProfiles().length)return;const o=r.runtimeModel().heapProfilerModel();o&&t.revealSection().appendItem(ci(di.revealInSummaryView),function(e){o.snapshotObjectIdForObjectId(s).then((t=>{this.isShowing()&&t&&this.showObject(t,e)}))}.bind(this,"Summary"))}handleAction(e,t){const i=s.Context.Context.instance().flavor(ui);return console.assert(Boolean(i)&&i instanceof ui),i&&i.toggleRecord(),!0}wasShown(){super.wasShown(),s.Context.Context.instance().setFlavor(ui,this),a.userMetrics.panelLoaded("heap_profiler","DevTools.Launch.HeapProfiler")}willHide(){s.Context.Context.instance().setFlavor(ui,null)}showObject(e,t){const i=Kt.heapSnapshotProfileType.getProfiles();for(let r=0;r=parseInt(e,10)){this.showProfile(s);this.viewForProfile(s).selectLiveObject(t,e);break}}}}var mi=Object.freeze({__proto__:null,HeapProfilerPanel:ui});const fi=new CSSStyleSheet;fi.replaceSync(".data-grid{border:none}.data-grid td .size-units{margin-left:4px;font-size:75%}.data-grid tr:not(.selected) td .size-units{color:var(--color-text-secondary)}.toolbar{border-bottom:1px solid var(--color-details-hairline)}\n/*# sourceURL=liveHeapProfile.css */\n");const gi={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"},vi=t.i18n.registerUIStrings("panels/profiler/LiveHeapProfileView.ts",gi),wi=t.i18n.getLocalizedString.bind(void 0,vi);let Si,bi;class Ci extends s.Widget.VBox{gridNodeByUrl;setting;toggleRecordAction;toggleRecordButton;startWithReloadButton;dataGrid;currentPollId;constructor(){super(!0),this.gridNodeByUrl=new Map,this.setting=o.Settings.Settings.instance().moduleSetting("memoryLiveHeapProfile");const e=new s.Toolbar.Toolbar("live-heap-profile-toolbar",this.contentElement);this.toggleRecordAction=s.ActionRegistry.ActionRegistry.instance().action("live-heap-profile.toggle-recording"),this.toggleRecordButton=s.Toolbar.Toolbar.createActionButton(this.toggleRecordAction),this.toggleRecordButton.setToggled(this.setting.get()),e.appendToolbarItem(this.toggleRecordButton);const t=l.TargetManager.TargetManager.instance().primaryPageTarget();if(t&&t.model(l.ResourceTreeModel.ResourceTreeModel)){const t=s.ActionRegistry.ActionRegistry.instance().action("live-heap-profile.start-with-reload");this.startWithReloadButton=s.Toolbar.Toolbar.createActionButton(t),e.appendToolbarItem(this.startWithReloadButton)}this.dataGrid=this.createDataGrid(),this.dataGrid.asWidget().show(this.contentElement),this.currentPollId=0}static instance(){return Si||(Si=new Ci),Si}createDataGrid(){const e={id:"",title:o.UIString.LocalizedEmptyString,width:void 0,fixedWidth:!0,sortable:!0,align:r.DataGrid.Align.Right,sort:r.DataGrid.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:wi(gi.jsHeap),width:"72px",fixedWidth:!0,sortable:!0,align:r.DataGrid.Align.Right,sort:r.DataGrid.Order.Descending,tooltip:wi(gi.allocatedJsHeapSizeCurrentlyIn)},{...e,id:"isolates",title:wi(gi.vms),width:"40px",fixedWidth:!0,align:r.DataGrid.Align.Right,tooltip:wi(gi.numberOfVmsSharingTheSameScript)},{...e,id:"url",title:wi(gi.scriptUrl),fixedWidth:!1,sortable:!0,tooltip:wi(gi.urlOfTheScriptSource)}],i=new r.SortableDataGrid.SortableDataGrid({displayName:wi(gi.heapProfile),columns:t,editCallback:void 0,deleteCallback:void 0,refreshCallback:void 0});i.setResizeMethod(r.DataGrid.ResizeMethod.Last),i.element.classList.add("flex-auto"),i.element.addEventListener("keydown",this.onKeyDown.bind(this),!1),i.addEventListener(r.DataGrid.Events.OpenedNode,this.revealSourceForSelectedNode,this),i.addEventListener(r.DataGrid.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(){super.wasShown(),this.poll(),this.registerCSSFiles([fi]),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(l.IsolateManager.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=>window.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 r=this.dataGrid.rootNode(),s=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 Pi(t,i,o),this.gridNodeByUrl.set(t,n),r.appendChild(n)),s.add(n)}for(const e of r.children.slice()){s.has(e)||e.remove();const t=e;this.gridNodeByUrl.delete(t.url)}function o(e,t,r){const s=r.callFrame.url||t||function(e){const t=e.callFrame.functionName;return t.startsWith("(")&&"(root)"!==t?t:""}(r)||function(e){return Number(e.callFrame.scriptId)?wi(gi.anonymousScriptS,{PH1:e.callFrame.scriptId}):""}(r);if(r.children.forEach(o.bind(null,e,s)),!r.selfSize)return;let n=i.get(s);n||(n={size:0,isolates:new Set},i.set(s,n)),n.size+=r.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=m.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(e.url);t&&o.Revealer.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=l.TargetManager.TargetManager.instance().primaryPageTarget();if(!t)return;const i=t.model(l.ResourceTreeModel.ResourceTreeModel);i&&i.reloadPage()}async stopRecording(){this.setting.set(!1)}}class Pi extends r.SortableDataGrid.SortableDataGridNode{url;size;isolateCount;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(t){const i=this.createTD(t);switch(t){case"url":i.textContent=this.url;break;case"size":i.textContent=e.NumberUtilities.withThousandsSeparator(Math.round(this.size/1e3)),i.createChild("span","size-units").textContent=wi(gi.kb);break;case"isolates":i.textContent=`${this.isolateCount}`}return i}}class Ti{static instance(e={forceNew:null}){const{forceNew:t}=e;return bi&&!t||(bi=new Ti),bi}handleAction(e,t){return(async()=>{const e="live_heap_profile";await s.ViewManager.ViewManager.instance().showView(e);const i=s.ViewManager.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 xi=Object.freeze({__proto__:null,LiveHeapProfileView:Ci,GridNode:Pi,ActionDelegate:Ti});export{T as BottomUpProfileDataGrid,M as CPUProfileFlameChart,de as CPUProfileView,x as ChildrenProvider,_e as HeapProfileView,mi as HeapProfilerPanel,bt as HeapSnapshotDataGrids,ot as HeapSnapshotGridNodes,Nt as HeapSnapshotProxy,qt as HeapSnapshotView,De as HeapTimelineOverview,Se as IsolateSelector,xi as LiveHeapProfileView,b as ProfileDataGrid,j as ProfileHeader,Ie as ProfileLauncherView,W as ProfileSidebarTreeElement,Yt as ProfileTypeRegistry,ee as ProfileView,li as ProfilesPanel,$ as TopDownProfileDataGrid}; diff --git a/packages/debugger-frontend/dist/third-party/front_end/rn_inspector.html b/packages/debugger-frontend/dist/third-party/front_end/rn_inspector.html index 8240cf910ef714..cbfd72cd1b841b 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/rn_inspector.html +++ b/packages/debugger-frontend/dist/third-party/front_end/rn_inspector.html @@ -17,5 +17,6 @@ + diff --git a/packages/debugger-frontend/dist/third-party/front_end/worker_app.html b/packages/debugger-frontend/dist/third-party/front_end/worker_app.html index 060998a61b4778..9f28da40b46519 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/worker_app.html +++ b/packages/debugger-frontend/dist/third-party/front_end/worker_app.html @@ -17,5 +17,6 @@ +