blob: 9f07d27bea741af802efa4baf988bdf93b8bfe64 [file] [log] [blame]
var allDescriptors=[{"dependencies":["platform","common","host","ui","diff"],"name":"ui_lazy","scripts":[]},{"experiment":"promiseTracker","extensions":[{"name":"promises","title":"Promises","className":"WebInspector.PromisePane","type":"drawer-view","order":30,"persistence":"permanent"}],"name":"promises","dependencies":["components","ui_lazy"],"scripts":[]},{"experiment":"accessibilityInspection","extensions":[{"className":"WebInspector.AccessibilitySidebarView","type":"@WebInspector.Widget","location":"elements-panel","title":"Accessibility"}],"name":"accessibility","dependencies":["elements"],"scripts":[]},{"dependencies":["components","source_frame","snippets","ui_lazy","extensions"],"extensions":[{"className":"WebInspector.SourcesPanelFactory","order":30,"type":"@WebInspector.PanelFactory","name":"sources","title":"Sources"},{"className":"WebInspector.SourcesPanel.ContextMenuProvider","contextTypes":["WebInspector.UISourceCode","WebInspector.UILocation","WebInspector.RemoteObject","WebInspector.NetworkRequest"],"type":"@WebInspector.ContextMenu.Provider"},{"iconClass":"pause-toolbar-item","className":"WebInspector.SourcesPanel.RevealingActionDelegate","contextTypes":["WebInspector.SourcesPanel","WebInspector.ShortcutRegistry.ForwardedShortcut"],"actionId":"debugger.toggle-pause","bindings":[{"platform":"windows,linux","shortcut":"F8 Ctrl+\\"},{"platform":"mac","shortcut":"F8 Meta+\\"}],"type":"@WebInspector.ActionDelegate"},{"iconClass":"step-over-toolbar-item","title":"Step over next function call","className":"WebInspector.SourcesPanel.DebuggingActionDelegate","contextTypes":["WebInspector.SourcesPanel"],"actionId":"debugger.step-over","bindings":[{"platform":"windows,linux","shortcut":"F10 Ctrl+'"},{"platform":"mac","shortcut":"F10 Meta+'"}],"type":"@WebInspector.ActionDelegate"},{"iconClass":"step-in-toolbar-item","title":"Step into next function call","className":"WebInspector.SourcesPanel.DebuggingActionDelegate","contextTypes":["WebInspector.SourcesPanel"],"actionId":"debugger.step-into","bindings":[{"platform":"windows,linux","shortcut":"F11 Ctrl+;"},{"platform":"mac","shortcut":"F11 Meta+;"}],"type":"@WebInspector.ActionDelegate"},{"className":"WebInspector.SourcesPanel.DebuggingActionDelegate","experiment":"stepIntoAsync","contextTypes":["WebInspector.SourcesPanel"],"actionId":"debugger.step-into-async","bindings":[{"platform":"windows,linux","shortcut":"Alt+F11 Alt+Ctrl+;"},{"platform":"mac","shortcut":"Alt+F11 Alt+Meta+;"}],"type":"@WebInspector.ActionDelegate"},{"iconClass":"step-out-toolbar-item","title":"Step out of current function","className":"WebInspector.SourcesPanel.DebuggingActionDelegate","contextTypes":["WebInspector.SourcesPanel"],"actionId":"debugger.step-out","bindings":[{"platform":"windows,linux","shortcut":"Shift+F11 Shift+Ctrl+;"},{"platform":"mac","shortcut":"Shift+F11 Shift+Meta+;"}],"type":"@WebInspector.ActionDelegate"},{"iconClass":"play-toolbar-item","title":"Run snippet","className":"WebInspector.SourcesPanel.DebuggingActionDelegate","contextTypes":["WebInspector.SourcesPanel"],"actionId":"debugger.run-snippet","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+Enter"},{"platform":"mac","shortcut":"Meta+Enter"}],"type":"@WebInspector.ActionDelegate"},{"className":"WebInspector.AdvancedSearchView.ActionDelegate","bindings":[{"platform":"mac","shortcut":"Meta+Alt+F"},{"platform":"windows,linux","shortcut":"Ctrl+Shift+F"}],"type":"@WebInspector.ActionDelegate","actionId":"sources.search.toggle","title":"Search all files"},{"iconClass":"breakpoint-toolbar-item","className":"WebInspector.SourcesPanel.DebuggingActionDelegate","contextTypes":["WebInspector.SourcesPanel"],"actionId":"debugger.toggle-breakpoints-active","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+F8"},{"platform":"mac","shortcut":"Meta+F8"}],"type":"@WebInspector.ActionDelegate"},{"type":"context-menu-item","location":"mainMenu/navigate","actionId":"sources.search.toggle"},{"type":"context-menu-item","location":"navigatorMenu/navigate","actionId":"sources.go-to-source"},{"className":"WebInspector.SourcesPanel.UILocationRevealer","contextTypes":["WebInspector.UILocation"],"type":"@WebInspector.Revealer"},{"className":"WebInspector.SourcesPanel.DebuggerLocationRevealer","contextTypes":["WebInspector.DebuggerModel.Location"],"type":"@WebInspector.Revealer"},{"className":"WebInspector.SourcesPanel.UISourceCodeRevealer","contextTypes":["WebInspector.UISourceCode"],"type":"@WebInspector.Revealer"},{"className":"WebInspector.SourcesPanel.DebuggerPausedDetailsRevealer","contextTypes":["WebInspector.DebuggerPausedDetails"],"type":"@WebInspector.Revealer"},{"className":"WebInspector.InplaceFormatterEditorAction","type":"@WebInspector.SourcesView.EditorAction"},{"className":"WebInspector.ScriptFormatterEditorAction","type":"@WebInspector.SourcesView.EditorAction"},{"name":"sources","title":"Sources","className":"WebInspector.SourcesNavigatorView","type":"navigator-view","order":1,"persistence":"permanent"},{"name":"contentScripts","title":"Content scripts","className":"WebInspector.ContentScriptsNavigatorView","type":"navigator-view","order":2,"persistence":"permanent"},{"name":"snippets","title":"Snippets","className":"WebInspector.SnippetsNavigatorView","type":"navigator-view","order":3,"persistence":"permanent"},{"title":"Go to file...","className":"WebInspector.SourcesPanel.RevealingActionDelegate","actionId":"sources.go-to-source","bindings":[{"platform":"mac","shortcut":"Meta+P Meta+O"},{"platform":"windows,linux","shortcut":"Ctrl+P Ctrl+O"}],"type":"@WebInspector.ActionDelegate","order":100},{"className":"WebInspector.SourcesView.SwitchFileActionDelegate","contextTypes":["WebInspector.SourcesView"],"bindings":[{"shortcut":"Alt+O"}],"type":"@WebInspector.ActionDelegate","actionId":"sources.switch-file"},{"defaultValue":"true","type":"setting","settingName":"navigatorGroupByFolder","settingType":"boolean"},{"category":"Sources","title":"Search in content scripts","defaultValue":false,"settingName":"searchInContentScripts","settingType":"boolean","type":"setting"},{"category":"Sources","title":"Enable JavaScript source maps","defaultValue":true,"settingName":"jsSourceMapsEnabled","settingType":"boolean","type":"setting"},{"category":"Sources","title":"Detect indentation","defaultValue":true,"settingName":"textEditorAutoDetectIndent","settingType":"boolean","type":"setting"},{"category":"Sources","title":"Autocompletion","defaultValue":true,"settingName":"textEditorAutocompletion","settingType":"boolean","type":"setting"},{"category":"Sources","title":"Bracket matching","defaultValue":true,"settingName":"textEditorBracketMatching","settingType":"boolean","type":"setting"},{"category":"Sources","title":"Show whitespace characters:","defaultValue":"original","settingName":"showWhitespacesInEditor","settingType":"enum","type":"setting","options":[["None","none"],["All","all"],["Trailing","trailing"]]},{"category":"Sources","title":"Display variable values inline while debugging","defaultValue":true,"settingName":"inlineVariableValues","settingType":"boolean","type":"setting"},{"category":"Sources","title":"Enable CSS source maps","defaultValue":true,"settingName":"cssSourceMapsEnabled","settingType":"boolean","type":"setting"},{"title":"Auto-reload generated CSS","defaultValue":false,"parentSettingName":"cssSourceMapsEnabled","settingName":"cssReloadEnabled","settingType":"boolean","type":"setting"},{"name":"sources.search","title":"Search","className":"WebInspector.AdvancedSearchView","type":"drawer-view","order":100,"persistence":"closeable"},{"className":"WebInspector.RevisionHistoryView","type":"drawer-view","name":"sources.history","persistence":"temporary","title":"History"}],"name":"sources","scripts":[]},{"dependencies":["platform","ui","host","components"],"extensions":[{"className":"WebInspector.DevicesDialog.ActionDelegate","type":"@WebInspector.ActionDelegate","actionId":"devices.dialog.show","title":"Inspect devices\u2026"},{"actionId":"devices.dialog.show","type":"context-menu-item","location":"mainMenu/tools/open","order":50}],"name":"devices","scripts":[]},{"skip_compilation":["diff_match_patch.js"],"dependencies":["common"],"name":"diff","scripts":[]},{"dependencies":["components","extensions"],"extensions":[{"className":"WebInspector.AuditsPanelFactory","order":90,"type":"@WebInspector.PanelFactory","name":"audits","title":"Audits"}],"name":"audits","scripts":[]},{"dependencies":["sdk","platform","workspace"],"name":"bindings","scripts":[]},{"dependencies":["bindings"],"name":"snippets","scripts":[]},{"dependencies":["timeline"],"extensions":[{"className":"WebInspector.LayersPanelFactory","order":100,"type":"@WebInspector.PanelFactory","name":"layers","title":"Layers"},{"className":"WebInspector.LayersPanel.LayerTreeRevealer","contextTypes":["WebInspector.DeferredLayerTree"],"type":"@WebInspector.Revealer"}],"experiment":"layersPanel","scripts":[],"name":"layers"},{"dependencies":["components","ui_lazy"],"extensions":[{"className":"WebInspector.ConsolePanelFactory","order":20,"type":"@WebInspector.PanelFactory","name":"console","title":"Console"},{"name":"console","title":"Console","className":"WebInspector.ConsolePanel.WrapperView","type":"drawer-view","order":0,"persistence":"permanent"},{"className":"WebInspector.ConsolePanel.ConsoleRevealer","contextTypes":["WebInspector.Console"],"type":"@WebInspector.Revealer"},{"className":"WebInspector.ConsoleView.ActionDelegate","bindings":[{"shortcut":"Ctrl+`"}],"type":"@WebInspector.ActionDelegate","actionId":"console.show"},{"iconClass":"clear-toolbar-item","title":"Clear console","className":"WebInspector.ConsoleView.ActionDelegate","actionId":"console.clear","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+L"},{"platform":"mac","shortcut":"Ctrl+L Meta+K"}],"type":"@WebInspector.ActionDelegate"},{"category":"Console","title":"Hide network messages","defaultValue":false,"settingName":"hideNetworkMessages","settingType":"boolean","type":"setting"},{"category":"Console","title":"Log XMLHttpRequests","defaultValue":false,"settingName":"monitoringXHREnabled","settingType":"boolean","type":"setting"},{"category":"Console","title":"Preserve log upon navigation","defaultValue":false,"settingName":"preserveConsoleLog","settingType":"boolean","type":"setting"},{"category":"Console","title":"Show timestamps","defaultValue":false,"settingName":"consoleTimestampsEnabled","settingType":"boolean","type":"setting"}],"name":"console","scripts":[]},{"dependencies":["source_frame","components","components_lazy","ui_lazy"],"extensions":[{"className":"WebInspector.NetworkPanelFactory","order":40,"type":"@WebInspector.PanelFactory","name":"network","title":"Network"},{"className":"WebInspector.NetworkPanel.ContextMenuProvider","contextTypes":["WebInspector.NetworkRequest","WebInspector.Resource","WebInspector.UISourceCode"],"type":"@WebInspector.ContextMenu.Provider"},{"className":"WebInspector.NetworkPanel.RequestRevealer","contextTypes":["WebInspector.NetworkRequest"],"type":"@WebInspector.Revealer"},{"category":"Network","title":"Show primary load waterfall","defaultValue":false,"experiment":"showPrimaryLoadWaterfallInNetworkTimeline","settingName":"networkShowPrimaryLoadWaterfall","settingType":"boolean","type":"setting"},{"category":"Network","title":"Color-code resource types","defaultValue":false,"settingName":"networkColorCodeResourceTypes","settingType":"boolean","type":"setting"},{"className":"WebInspector.BlockedURLsPane.ActionDelegate","iconClass":"block-toolbar-item","type":"@WebInspector.ActionDelegate","actionId":"network.blocked-urls.show","title":"Block network requests"},{"iconClass":"record-toolbar-item","className":"WebInspector.NetworkPanel.RecordActionDelegate","contextTypes":["WebInspector.NetworkPanel"],"actionId":"network.toggle-recording","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+E"},{"platform":"mac","shortcut":"Meta+E"}],"type":"@WebInspector.ActionDelegate"},{"name":"network.blocked-urls","title":"Request blocking","className":"WebInspector.BlockedURLsPane","experiment":"requestBlocking","type":"drawer-view","order":60,"persistence":"closeable"},{"className":"WebInspector.NetworkConfigView.ShowActionDelegate","type":"@WebInspector.ActionDelegate","actionId":"network.show-config","title":"Network conditions"},{"actionId":"network.show-config","type":"context-menu-item","location":"mainMenu/tools/open","order":60},{"name":"network.config","title":"Network conditions","className":"WebInspector.NetworkConfigView","type":"drawer-view","order":40,"persistence":"closeable"}],"name":"network","scripts":[]},{"remote":true,"name":"cm_modes","dependencies":["source_frame"],"extensions":[{"className":"WebInspector.DefaultCodeMirrorMimeMode","mimeTypes":["text/x-csrc","text/x-c","text/x-chdr","text/x-c++src","text/x-c++hdr","text/x-java","text/x-csharp","text/x-scala","x-shader/x-vertex","x-shader/x-fragment"],"type":"@WebInspector.CodeMirrorMimeMode","fileName":"clike.js"},{"className":"WebInspector.DefaultCodeMirrorMimeMode","mimeTypes":["text/x-coffeescript"],"type":"@WebInspector.CodeMirrorMimeMode","fileName":"coffeescript.js"},{"className":"WebInspector.DefaultCodeMirrorMimeMode","mimeTypes":["application/x-httpd-php","application/x-httpd-php-open","text/x-php"],"dependencies":["clike.js"],"type":"@WebInspector.CodeMirrorMimeMode","fileName":"php.js"},{"className":"WebInspector.DefaultCodeMirrorMimeMode","mimeTypes":["text/x-python","text/x-cython"],"type":"@WebInspector.CodeMirrorMimeMode","fileName":"python.js"},{"className":"WebInspector.DefaultCodeMirrorMimeMode","mimeTypes":["text/x-sh"],"type":"@WebInspector.CodeMirrorMimeMode","fileName":"shell.js"},{"className":"WebInspector.DefaultCodeMirrorMimeMode","mimeTypes":["text/x-livescript"],"type":"@WebInspector.CodeMirrorMimeMode","fileName":"livescript.js"},{"className":"WebInspector.DefaultCodeMirrorMimeMode","mimeTypes":["text/x-clojure"],"type":"@WebInspector.CodeMirrorMimeMode","fileName":"clojure.js"},{"className":"WebInspector.DefaultCodeMirrorMimeMode","mimeTypes":["text/x-styl"],"type":"@WebInspector.CodeMirrorMimeMode","fileName":"stylus.js"}],"scripts":[]},{"dependencies":[],"name":"platform","scripts":[]},{"dependencies":["elements"],"extensions":[{"className":"WebInspector.AnimationTimeline.ButtonProvider","type":"@WebInspector.ToolbarItem.Provider","order":2,"location":"styles-sidebarpane-toolbar"},{"name":"animations","title":"Animations","className":"WebInspector.AnimationTimeline","type":"drawer-view","order":0,"persistence":"closeable"}],"name":"animation","scripts":[]},{"dependencies":["components"],"extensions":[{"className":"WebInspector.CodeMirrorUtils","type":"@WebInspector.InplaceEditor"},{"className":"WebInspector.CodeMirrorUtils.TokenizerFactory","type":"@WebInspector.TokenizerFactory"},{"category":"Sources","title":"Default indentation:","defaultValue":" ","settingName":"textEditorIndent","settingType":"enum","type":"setting","options":[["2 spaces"," "],["4 spaces"," "],["8 spaces"," "],["Tab character","\t"]]}],"name":"source_frame","scripts":[],"skip_compilation":["../cm/codemirror.js","../cm/css.js","../cm/javascript.js","../cm/simple.js","../cm/xml.js","../cm/htmlmixed.js","../cm/htmlembedded.js","../cm/matchbrackets.js","../cm/closebrackets.js","../cm/markselection.js","../cm/comment.js","../cm/overlay.js","../cm/activeline.js"]},{"dependencies":["extensions","host","platform","sdk","emulation"],"extensions":[{"className":"WebInspector.AdvancedAppProvider","type":"@WebInspector.AppProvider","order":0,"condition":"can_dock"},{"className":"WebInspector.SimpleAppProvider","type":"@WebInspector.AppProvider","order":10},{"className":"WebInspector.HandlerRegistry.ContextMenuProvider","contextTypes":["WebInspector.UISourceCode","WebInspector.Resource","WebInspector.NetworkRequest","Node"],"type":"@WebInspector.ContextMenu.Provider"},{"className":"WebInspector.Main.ReloadActionDelegate","bindings":[{"platform":"windows,linux","shortcut":"F5 Ctrl+R"},{"platform":"mac","shortcut":"Meta+R"}],"type":"@WebInspector.ActionDelegate","actionId":"main.reload"},{"className":"WebInspector.Main.ReloadActionDelegate","bindings":[{"platform":"windows,linux","shortcut":"Shift+F5 Ctrl+F5 Ctrl+Shift+F5 Shift+Ctrl+R"},{"platform":"mac","shortcut":"Shift+Meta+R"}],"type":"@WebInspector.ActionDelegate","actionId":"main.hard-reload"},{"className":"WebInspector.InspectorView.DrawerToggleActionDelegate","bindings":[{"shortcut":"Esc"}],"type":"@WebInspector.ActionDelegate","actionId":"main.toggle-drawer","order":100},{"className":"WebInspector.Main.ReloadActionDelegate","bindings":[{"shortcut":"Alt+R"}],"type":"@WebInspector.ActionDelegate","actionId":"main.debug-reload"},{"className":"WebInspector.DockController.ToggleDockActionDelegate","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+Shift+D"},{"platform":"mac","shortcut":"Meta+Shift+D"}],"type":"@WebInspector.ActionDelegate","actionId":"main.toggle-dock"},{"className":"WebInspector.Main.ZoomActionDelegate","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+Plus Ctrl+Shift+Plus Ctrl+NumpadPlus Ctrl+Shift+NumpadPlus"},{"platform":"mac","shortcut":"Meta+Plus Meta+Shift+Plus Meta+NumpadPlus Meta+Shift+NumpadPlus"}],"type":"@WebInspector.ActionDelegate","actionId":"main.zoom-in"},{"className":"WebInspector.Main.ZoomActionDelegate","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+Minus Ctrl+Shift+Minus Ctrl+NumpadMinus Ctrl+Shift+NumpadMinus"},{"platform":"mac","shortcut":"Meta+Minus Meta+Shift+Minus Meta+NumpadMinus Meta+Shift+NumpadMinus"}],"type":"@WebInspector.ActionDelegate","actionId":"main.zoom-out"},{"className":"WebInspector.Main.ZoomActionDelegate","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+0 Ctrl+Numpad0"},{"platform":"mac","shortcut":"Meta+0 Meta+Numpad0"}],"type":"@WebInspector.ActionDelegate","actionId":"main.zoom-reset"},{"className":"WebInspector.Main.SearchActionDelegate","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+F"},{"platform":"mac","shortcut":"Meta+F F3"}],"type":"@WebInspector.ActionDelegate","actionId":"main.search-in-panel.find"},{"className":"WebInspector.Main.SearchActionDelegate","bindings":[{"shortcut":"Esc"}],"type":"@WebInspector.ActionDelegate","actionId":"main.search-in-panel.cancel","order":10},{"className":"WebInspector.Main.SearchActionDelegate","bindings":[{"platform":"mac","shortcut":"Meta+G"}],"type":"@WebInspector.ActionDelegate","actionId":"main.search-in-panel.find-next"},{"className":"WebInspector.Main.SearchActionDelegate","bindings":[{"platform":"mac","shortcut":"Meta+Shift+G"}],"type":"@WebInspector.ActionDelegate","actionId":"main.search-in-panel.find-previous"},{"className":"WebInspector.RenderingOptionsView.ShowActionDelegate","type":"@WebInspector.ActionDelegate","actionId":"main.show-rendering-options","title":"Rendering settings"},{"separator":true,"type":"@WebInspector.ToolbarItem.Provider","location":"main-toolbar-left","order":100},{"className":"WebInspector.Main.WarningErrorCounter","type":"@WebInspector.ToolbarItem.Provider","order":1,"location":"main-toolbar-right"},{"separator":true,"type":"@WebInspector.ToolbarItem.Provider","order":98,"location":"main-toolbar-right"},{"className":"WebInspector.Main.MainMenuItem","type":"@WebInspector.ToolbarItem.Provider","order":99,"location":"main-toolbar-right"},{"className":"WebInspector.DockController.CloseButtonProvider","type":"@WebInspector.ToolbarItem.Provider","order":100,"location":"main-toolbar-right"},{"category":"","title":"Disable cache (while DevTools is open)","defaultValue":false,"settingName":"cacheDisabled","settingType":"boolean","type":"setting"},{"category":"","title":"Disable JavaScript","defaultValue":false,"settingName":"javaScriptDisabled","settingType":"boolean","type":"setting"},{"category":"Appearance","title":"Theme:","defaultValue":"default","settingName":"uiTheme","settingType":"enum","type":"setting","options":[["Default","default"],["Dark","dark"]]},{"category":"Appearance","title":"Panel layout:","defaultValue":"auto","settingName":"sidebarPosition","settingType":"enum","type":"setting","options":[["horizontal","bottom"],["vertical","right"],["auto","auto"]]},{"category":"Appearance","title-mac":"Enable Cmd + 1-9 shortcut to switch panels","title":"Enable Ctrl + 1-9 shortcut to switch panels","defaultValue":false,"settingName":"shortcutPanelSwitch","settingType":"boolean","type":"setting"},{"category":"Appearance","title":"Don't show emulation warnings","defaultValue":false,"settingName":"disableOverridesWarning","settingType":"boolean","type":"setting"},{"category":"Appearance","title":"Don't show Chrome Data Saver warning","defaultValue":false,"settingName":"disableDataSaverInfobar","settingType":"boolean","type":"setting"},{"category":"Appearance","title":"Disable paused state overlay","defaultValue":false,"settingName":"disablePausedStateOverlay","settingType":"boolean","type":"setting"},{"category":"Extensions","className":"WebInspector.HandlerRegistry.OpenAnchorLocationSettingUI","type":"@WebInspector.SettingUI"},{"subMenuId":"mainMenu/tools","order":80,"type":"context-menu-item","location":"mainMenu/navigate","title":"More tools"},{"actionId":"main.show-rendering-options","type":"context-menu-item","location":"mainMenu/tools/open","order":80},{"name":"rendering","title":"Rendering","className":"WebInspector.RenderingOptionsView","type":"drawer-view","order":50,"persistence":"closeable"}],"name":"main","scripts":[],"skip_compilation":["Tests.js"]},{"dependencies":["source_frame","ui_lazy","components_lazy"],"extensions":[{"className":"WebInspector.ResourcesPanelFactory","order":70,"type":"@WebInspector.PanelFactory","name":"resources","title":"Resources"},{"className":"WebInspector.ResourcesPanel.ResourceRevealer","contextTypes":["WebInspector.Resource"],"type":"@WebInspector.Revealer"}],"name":"resources","scripts":[]},{"skip_compilation":["../acorn/acorn.js","../cm/headlesscodemirror.js","../cm/css.js","../cm/xml.js","../cm/htmlmixed.js"],"name":"script_formatter_worker","scripts":[]},{"dependencies":["components","extensions"],"extensions":[{"className":"WebInspector.ElementsPanelFactory","order":10,"type":"@WebInspector.PanelFactory","name":"elements","title":"Elements"},{"className":"WebInspector.ElementsPanel.ContextMenuProvider","contextTypes":["WebInspector.RemoteObject","WebInspector.DOMNode","WebInspector.DeferredDOMNode"],"type":"@WebInspector.ContextMenu.Provider"},{"className":"WebInspector.ElementsTreeOutline.Renderer","contextTypes":["WebInspector.DOMNode","WebInspector.RemoteObject"],"type":"@WebInspector.Renderer"},{"className":"WebInspector.ElementsPanel.DOMNodeRevealer","contextTypes":["WebInspector.DOMNode","WebInspector.DeferredDOMNode","WebInspector.RemoteObject"],"type":"@WebInspector.Revealer"},{"category":"Elements","title":"Color format:","defaultValue":"original","options":[["As authored","original"],["HEX: #DAC0DE","hex",true],["RGB: rgb(128, 255, 255)","rgb",true],["HSL: hsl(300, 80%, 90%)","hsl",true]],"settingName":"colorFormat","settingType":"enum","type":"setting","order":0},{"category":"Elements","title":"Show user agent shadow DOM","defaultValue":false,"settingName":"showUAShadowDOM","settingType":"boolean","type":"setting","order":1},{"category":"Elements","title":"Word wrap","defaultValue":true,"settingName":"domWordWrap","settingType":"boolean","type":"setting","order":2},{"category":"Elements","title":"Show rulers","defaultValue":false,"settingName":"showMetricsRulers","settingType":"boolean","type":"setting","order":3},{"category":"Elements","title":"Reveal DOM node on hover.","defaultValue":true,"settingName":"highlightNodeOnHoverInOverlay","settingType":"boolean","type":"setting","order":4},{"className":"WebInspector.ClassesPaneWidget.ButtonProvider","type":"@WebInspector.ToolbarItem.Provider","order":1,"location":"styles-sidebarpane-toolbar"},{"className":"WebInspector.ElementStatePaneWidget.ButtonProvider","type":"@WebInspector.ToolbarItem.Provider","order":1,"location":"styles-sidebarpane-toolbar"},{"className":"WebInspector.ElementsActionDelegate","contextTypes":["WebInspector.ElementsPanel"],"bindings":[{"shortcut":"H"}],"type":"@WebInspector.ActionDelegate","actionId":"elements.hide-element"},{"className":"WebInspector.ElementsActionDelegate","contextTypes":["WebInspector.ElementsPanel"],"bindings":[{"shortcut":"F2"}],"type":"@WebInspector.ActionDelegate","actionId":"elements.edit-as-html"},{"className":"WebInspector.ElementsPanel.PseudoStateMarkerDecorator","marker":"pseudo-state-marker","type":"@WebInspector.DOMPresentationUtils.MarkerDecorator"},{"className":"WebInspector.DOMPresentationUtils.GenericDecorator","marker":"hidden-marker","type":"@WebInspector.DOMPresentationUtils.MarkerDecorator","color":"#555","title":"Element is hidden"},{"iconClass":"node-search-toolbar-item","title":"Select an element in the page to inspect it","className":"WebInspector.InspectElementModeController.ToggleSearchActionDelegate","actionId":"elements.toggle-element-search","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+Shift+C"},{"platform":"mac","shortcut":"Meta+Shift+C"}],"type":"@WebInspector.ActionDelegate"},{"order":0,"type":"@WebInspector.ToolbarItem.Provider","actionId":"elements.toggle-element-search","location":"main-toolbar-left"},{"className":"WebInspector.InspectElementModeController.LayoutEditorButtonProvider","experiment":"layoutEditor","type":"@WebInspector.ToolbarItem.Provider","order":4,"location":"styles-sidebarpane-toolbar"}],"name":"elements","scripts":[]},{"dependencies":["common","host","platform"],"name":"workspace","scripts":[]},{"dependencies":["components","components_lazy","ui_lazy"],"extensions":[{"className":"WebInspector.TimelinePanelFactory","order":50,"type":"@WebInspector.PanelFactory","name":"timeline","title":"Timeline"},{"category":"Profiler","title":"Hide chrome frame in Layers view","defaultValue":false,"settingName":"frameViewerHideChromeWindow","settingType":"boolean","type":"setting"},{"className":"WebInspector.LoadTimelineHandler","type":"@WebInspector.QueryParamHandler","name":"loadTimelineFromURL"},{"iconClass":"record-toolbar-item","className":"WebInspector.TimelinePanel.ActionDelegate","contextTypes":["WebInspector.TimelinePanel"],"actionId":"timeline.toggle-recording","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+E"},{"platform":"mac","shortcut":"Meta+E"}],"type":"@WebInspector.ActionDelegate"},{"className":"WebInspector.TimelinePanel.ActionDelegate","contextTypes":["WebInspector.TimelinePanel"],"bindings":[{"platform":"windows,linux","shortcut":"Ctrl+S"},{"platform":"mac","shortcut":"Meta+S"}],"type":"@WebInspector.ActionDelegate","actionId":"timeline.save-to-file"},{"className":"WebInspector.TimelinePanel.ActionDelegate","contextTypes":["WebInspector.TimelinePanel"],"actionId":"timeline.load-from-file","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+O"},{"platform":"mac","shortcut":"Meta+O"}],"type":"@WebInspector.ActionDelegate","order":"10"},{"className":"WebInspector.TimelinePanel.ActionDelegate","contextTypes":["WebInspector.TimelinePanel"],"bindings":[{"shortcut":"["}],"type":"@WebInspector.ActionDelegate","actionId":"timeline.jump-to-previous-frame"},{"className":"WebInspector.TimelinePanel.ActionDelegate","contextTypes":["WebInspector.TimelinePanel"],"bindings":[{"shortcut":"]"}],"type":"@WebInspector.ActionDelegate","actionId":"timeline.jump-to-next-frame"}],"name":"timeline","scripts":[]},{"name":"heap_snapshot_worker","scripts":[]},{"dependencies":["common","platform"],"name":"host","scripts":[]},{"dependencies":["bindings","components","platform","ui"],"extensions":[{"name":"emulation","title":"Emulation","className":"WebInspector.OverridesView","experiment":"!deviceMode","type":"drawer-view","order":10,"persistence":"closeable"},{"className":"WebInspector.DeviceModeButtonProvider","experiment":"!deviceMode","location":"main-toolbar-left","type":"@WebInspector.ToolbarItem.Provider","order":1,"condition":"can_dock"},{"iconClass":"emulation-toolbar-item","title":"Toggle device mode","className":"WebInspector.ToggleDeviceModeActionDelegate","experiment":"!deviceMode","actionId":"emulation.toggle-device-mode","bindings":[{"platform":"windows,linux","shortcut":"Shift+Ctrl+M"},{"platform":"mac","shortcut":"Shift+Meta+M"}],"type":"@WebInspector.ActionDelegate","condition":"can_dock"},{"className":"WebInspector.DeviceModeView.ActionDelegate","bindings":[{"platform":"windows,linux","shortcut":"Shift+Ctrl+M"},{"platform":"mac","shortcut":"Shift+Meta+M"}],"experiment":"deviceMode","type":"@WebInspector.ActionDelegate","actionId":"emulation.toggle-device-mode"},{"className":"WebInspector.DeviceModeView.ActionDelegate","experiment":"deviceMode","type":"@WebInspector.ActionDelegate","actionId":"emulation.toggle-device-toolbar","title":"Toggle device toolbar"},{"className":"WebInspector.OverridesView.Revealer","contextTypes":["WebInspector.OverridesSupport"],"type":"@WebInspector.Revealer"},{"name":"devices","settings":["standardEmulatedDeviceList","customEmulatedDeviceList"],"title":"Devices","className":"WebInspector.DevicesSettingsTab","type":"settings-view","order":"30"},{"className":"WebInspector.SensorsView.ShowActionDelegate","type":"@WebInspector.ActionDelegate","actionId":"emulation.show-sensors","title":"Sensors"},{"actionId":"emulation.show-sensors","type":"context-menu-item","location":"mainMenu/tools/open","order":100},{"actionId":"emulation.toggle-device-toolbar","type":"context-menu-item","location":"mainMenu/navigate","order":10},{"name":"sensors","title":"Sensors","className":"WebInspector.SensorsView","type":"drawer-view","order":100,"persistence":"closeable"}],"name":"emulation","scripts":[]},{"dependencies":["platform","common","host"],"name":"ui","scripts":[]},{"skip_compilation":["../InspectorBackendCommands.js","../SupportedCSSProperties.js"],"dependencies":["common","host","platform"],"extensions":[{"defaultValue":[],"type":"setting","settingName":"blockedURLs","settingType":"array"},{"defaultValue":"","type":"setting","settingName":"skipStackFramesPattern","settingType":"regex"},{"defaultValue":false,"type":"setting","settingName":"skipContentScripts","settingType":"boolean"},{"defaultValue":false,"type":"setting","settingName":"pauseOnExceptionEnabled","settingType":"boolean"},{"defaultValue":false,"type":"setting","settingName":"pauseOnCaughtException","settingType":"boolean"},{"defaultValue":false,"type":"setting","settingName":"enableAsyncStackTraces","settingType":"boolean"}],"name":"sdk","scripts":[]},{"name":"temp_storage_shared_worker","scripts":[]},{"dependencies":["platform","common","diff","sdk"],"name":"sass","scripts":[]},{"dependencies":["components"],"extensions":[{"className":"WebInspector.SettingsController.ActionDelegate","bindings":[{"shortcut":"F1 Shift+?"}],"type":"@WebInspector.ActionDelegate","actionId":"settings.show","title":"Settings"},{"className":"WebInspector.SettingsController.ActionDelegate","type":"@WebInspector.ActionDelegate","actionId":"settings.help","title":"Help"},{"className":"WebInspector.SettingsController.ActionDelegate","type":"@WebInspector.ActionDelegate","actionId":"settings.shortcuts","title":"Shortcuts"},{"className":"WebInspector.SettingsController.Revealer","contextTypes":["WebInspector.Setting"],"type":"@WebInspector.Revealer"},{"actionId":"settings.shortcuts","type":"context-menu-item","location":"mainMenu/footer","order":10},{"actionId":"settings.show","type":"context-menu-item","location":"mainMenu/footer","order":20},{"actionId":"settings.help","type":"context-menu-item","location":"mainMenu/footer","order":30}],"name":"settings","scripts":[]},{"dependencies":["sdk","ui","ui_lazy"],"name":"components_lazy","scripts":[]},{"dependencies":["components","ui_lazy"],"extensions":[{"className":"WebInspector.ProfilesPanelFactory","order":60,"type":"@WebInspector.PanelFactory","name":"profiles","title":"Profiles"},{"className":"WebInspector.ProfilesPanel.ContextMenuProvider","contextTypes":["WebInspector.RemoteObject"],"type":"@WebInspector.ContextMenu.Provider"},{"category":"Profiler","title":"Show advanced heap snapshot properties","defaultValue":false,"settingName":"showAdvancedHeapSnapshotProperties","settingType":"boolean","type":"setting"},{"category":"Profiler","title":"Record heap allocation stack traces","defaultValue":false,"settingName":"recordAllocationStacks","settingType":"boolean","type":"setting"},{"category":"Profiler","title":"High resolution CPU profiling","defaultValue":true,"settingName":"highResolutionCpuProfiling","settingType":"boolean","type":"setting"},{"category":"Profiler","title":"Show native functions in JS Profile","defaultValue":false,"settingName":"showNativeFunctionsInJSProfile","settingType":"boolean","type":"setting"},{"iconClass":"record-toolbar-item","className":"WebInspector.ProfilesPanel.RecordActionDelegate","contextTypes":["WebInspector.ProfilesPanel"],"actionId":"profiler.toggle-recording","bindings":[{"platform":"windows,linux","shortcut":"Ctrl+E"},{"platform":"mac","shortcut":"Meta+E"}],"type":"@WebInspector.ActionDelegate"}],"name":"profiler","scripts":[]},{"remote":true,"name":"screencast","dependencies":["components"],"extensions":[{"className":"WebInspector.ScreencastAppProvider","type":"@WebInspector.AppProvider","order":1},{"className":"WebInspector.ScreencastApp.ToolbarButtonProvider","type":"@WebInspector.ToolbarItem.Provider","order":1,"location":"main-toolbar-left"}],"scripts":[],"condition":"remoteFrontend"},{"dependencies":["components"],"name":"extensions","scripts":[]},{"skip_compilation":["TestBase.js"],"dependencies":["platform"],"name":"common","scripts":[]},{"dependencies":["bindings","platform","ui"],"extensions":[{"category":"Console","title":"Enable custom formatters","defaultValue":false,"settingName":"customFormatters","settingType":"boolean","type":"setting"},{"className":"WebInspector.DOMPresentationUtils.GenericDecorator","marker":"breakpoint-marker","type":"@WebInspector.DOMPresentationUtils.MarkerDecorator","color":"rgb(105, 140, 254)","title":"DOM Breakpoint"},{"defaultValue":[],"type":"setting","settingName":"networkConditionsCustomProfiles","settingType":"array"},{"name":"network-conditions","settings":["networkConditionsCustomProfiles"],"title":"Throttling","className":"WebInspector.NetworkConditionsSettingsTab","type":"settings-view","order":"35"}],"name":"components","scripts":[]},{"experiment":"securityPanel","extensions":[{"className":"WebInspector.SecurityPanelFactory","order":80,"type":"@WebInspector.PanelFactory","name":"security","title":"Security"}],"name":"security","dependencies":["network","platform","ui","sdk"],"scripts":[]},{"remote":true,"name":"emulated_devices","dependencies":["emulation"],"extensions":[{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"iPhone 4","screen":{"horizontal":{"width":480,"height":320},"device-pixel-ratio":2,"vertical":{"width":320,"height":480}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":true,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"iPhone 5","screen":{"horizontal":{"width":568,"height":320},"device-pixel-ratio":2,"vertical":{"width":320,"height":568}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1","type":"phone"},"type":"emulated-device","order":40},{"device":{"show-by-default":true,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"iPhone 6","screen":{"horizontal":{"width":667,"height":375},"device-pixel-ratio":2,"vertical":{"width":375,"height":667}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1","type":"phone"},"type":"emulated-device","order":50},{"device":{"show-by-default":true,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"iPhone 6 Plus","screen":{"horizontal":{"width":736,"height":414},"device-pixel-ratio":3,"vertical":{"width":414,"height":736}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1","type":"phone"},"type":"emulated-device","order":60},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"BlackBerry Z30","screen":{"horizontal":{"width":640,"height":360},"device-pixel-ratio":2,"vertical":{"width":360,"height":640}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Nexus 4","screen":{"horizontal":{"width":640,"height":384},"device-pixel-ratio":2,"vertical":{"width":384,"height":640}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":25,"right":0,"bottom":48,"left":0},"image":"@url(google-nexus-5-vertical-default-1x.png) 1x, @url(google-nexus-5-vertical-default-2x.png) 2x","orientation":"vertical","title":"default"},{"insets":{"top":80,"right":0,"bottom":48,"left":0},"image":"@url(google-nexus-5-vertical-navigation-1x.png) 1x, @url(google-nexus-5-vertical-navigation-2x.png) 2x","orientation":"vertical","title":"navigation bar"},{"insets":{"top":80,"right":0,"bottom":312,"left":0},"image":"@url(google-nexus-5-vertical-keyboard-1x.png) 1x, @url(google-nexus-5-vertical-keyboard-2x.png) 2x","orientation":"vertical","title":"keyboard"},{"insets":{"top":25,"right":42,"bottom":0,"left":0},"image":"@url(google-nexus-5-horizontal-default-1x.png) 1x, @url(google-nexus-5-horizontal-default-2x.png) 2x","orientation":"horizontal","title":"default"},{"insets":{"top":80,"right":42,"bottom":0,"left":0},"image":"@url(google-nexus-5-horizontal-navigation-1x.png) 1x, @url(google-nexus-5-horizontal-navigation-2x.png) 2x","orientation":"horizontal","title":"navigation bar"},{"insets":{"top":80,"right":42,"bottom":202,"left":0},"image":"@url(google-nexus-5-horizontal-keyboard-1x.png) 1x, @url(google-nexus-5-horizontal-keyboard-2x.png) 2x","orientation":"horizontal","title":"keyboard"}],"title":"Nexus 5","screen":{"horizontal":{"width":640,"height":360},"device-pixel-ratio":3,"vertical":{"width":360,"height":640}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":true,"modes":[{"insets":{"top":24,"right":0,"bottom":48,"left":0},"image":"@url(google-nexus-5x-vertical-default-1x.png) 1x, @url(google-nexus-5x-vertical-default-2x.png) 2x","orientation":"vertical","title":"default"},{"insets":{"top":80,"right":0,"bottom":48,"left":0},"image":"@url(google-nexus-5x-vertical-navigation-1x.png) 1x, @url(google-nexus-5x-vertical-navigation-2x.png) 2x","orientation":"vertical","title":"navigation bar"},{"insets":{"top":80,"right":0,"bottom":342,"left":0},"image":"@url(google-nexus-5x-vertical-keyboard-1x.png) 1x, @url(google-nexus-5x-vertical-keyboard-2x.png) 2x","orientation":"vertical","title":"keyboard"},{"insets":{"top":24,"right":48,"bottom":0,"left":0},"image":"@url(google-nexus-5x-horizontal-default-1x.png) 1x, @url(google-nexus-5x-horizontal-default-2x.png) 2x","orientation":"horizontal","title":"default"},{"insets":{"top":80,"right":48,"bottom":0,"left":0},"image":"@url(google-nexus-5x-horizontal-navigation-1x.png) 1x, @url(google-nexus-5x-horizontal-navigation-2x.png) 2x","orientation":"horizontal","title":"navigation bar"},{"insets":{"top":80,"right":48,"bottom":222,"left":0},"image":"@url(google-nexus-5x-horizontal-keyboard-1x.png) 1x, @url(google-nexus-5x-horizontal-keyboard-2x.png) 2x","orientation":"horizontal","title":"keyboard"}],"title":"Nexus 5X","screen":{"horizontal":{"width":731,"height":411},"device-pixel-ratio":2.625,"vertical":{"width":411,"height":731}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36","type":"phone"},"type":"emulated-device","order":20},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Nexus 6","screen":{"horizontal":{"width":732,"height":412},"device-pixel-ratio":3.5,"vertical":{"width":412,"height":732}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":true,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Nexus 6P","screen":{"horizontal":{"width":773,"height":435},"device-pixel-ratio":3.3,"vertical":{"width":435,"height":773}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36","type":"phone"},"type":"emulated-device","order":30},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"LG Optimus L70","screen":{"horizontal":{"width":640,"height":384},"device-pixel-ratio":1.25,"vertical":{"width":384,"height":640}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/48.0.2564.23 Mobile Safari/537.36","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Nokia N9","screen":{"horizontal":{"width":640,"height":360},"device-pixel-ratio":1,"vertical":{"width":360,"height":640}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Nokia Lumia 520","screen":{"horizontal":{"width":533,"height":320},"device-pixel-ratio":1.4,"vertical":{"width":320,"height":533}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Galaxy S III","screen":{"horizontal":{"width":640,"height":360},"device-pixel-ratio":2,"vertical":{"width":360,"height":640}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":true,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Galaxy S5","screen":{"horizontal":{"width":640,"height":360},"device-pixel-ratio":3,"vertical":{"width":360,"height":640}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36","type":"phone"},"type":"emulated-device","order":10},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Kindle Fire HDX","screen":{"horizontal":{"width":2560,"height":1600},"device-pixel-ratio":2,"vertical":{"width":1600,"height":2560}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true","type":"tablet"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"iPad Mini","screen":{"horizontal":{"width":1024,"height":768},"device-pixel-ratio":2,"vertical":{"width":768,"height":1024}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1","type":"tablet"},"type":"emulated-device"},{"device":{"show-by-default":true,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"iPad","screen":{"horizontal":{"width":1024,"height":768},"device-pixel-ratio":2,"vertical":{"width":768,"height":1024}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1","type":"tablet"},"type":"emulated-device","order":70},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Blackberry PlayBook","screen":{"horizontal":{"width":1024,"height":600},"device-pixel-ratio":1,"vertical":{"width":600,"height":1024}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+","type":"tablet"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Nexus 10","screen":{"horizontal":{"width":1280,"height":800},"device-pixel-ratio":2,"vertical":{"width":800,"height":1280}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; Android 4.3; Nexus 10 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Safari/537.36","type":"tablet"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Nexus 7","screen":{"horizontal":{"width":960,"height":600},"device-pixel-ratio":2,"vertical":{"width":600,"height":960}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Safari/537.36","type":"tablet"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Galaxy Note 3","screen":{"horizontal":{"width":640,"height":360},"device-pixel-ratio":3,"vertical":{"width":360,"height":640}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"vertical","title":"default"},{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Galaxy Note II","screen":{"horizontal":{"width":640,"height":360},"device-pixel-ratio":2,"vertical":{"width":360,"height":640}},"capabilities":["touch","mobile"],"user-agent":"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30","type":"phone"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Laptop with touch","screen":{"horizontal":{"width":1280,"height":950},"device-pixel-ratio":1,"vertical":{"width":950,"height":1280}},"capabilities":["touch"],"user-agent":"","type":"notebook"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Laptop with HiDPI screen","screen":{"horizontal":{"width":1440,"height":900},"device-pixel-ratio":2,"vertical":{"width":900,"height":1440}},"capabilities":[],"user-agent":"","type":"notebook"},"type":"emulated-device"},{"device":{"show-by-default":false,"modes":[{"insets":{"top":0,"right":0,"bottom":0,"left":0},"orientation":"horizontal","title":"default"}],"title":"Laptop with MDPI screen","screen":{"horizontal":{"width":1280,"height":800},"device-pixel-ratio":1,"vertical":{"width":800,"height":1280}},"capabilities":[],"user-agent":"","type":"notebook"},"type":"emulated-device"}],"scripts":[]}];var applicationDescriptor;var _loadedScripts={};for(var k of[]){};function loadResourcePromise(url)
{return new Promise(load);function load(fulfill,reject)
{var xhr=new XMLHttpRequest();xhr.open("GET",url,true);xhr.onreadystatechange=onreadystatechange;function onreadystatechange(e)
{if(xhr.readyState!==4)
return;if([0,200,304].indexOf(xhr.status)===-1)
reject(new Error("While loading from url "+url+" server responded with a status of "+xhr.status));else
fulfill(e.target.response);}
xhr.send(null);}}
function normalizePath(path)
{if(path.indexOf("..")===-1&&path.indexOf('.')===-1)
return path;var normalizedSegments=[];var segments=path.split("/");for(var i=0;i<segments.length;i++){var segment=segments[i];if(segment===".")
continue;else if(segment==="..")
normalizedSegments.pop();else if(segment)
normalizedSegments.push(segment);}
var normalizedPath=normalizedSegments.join("/");if(normalizedPath[normalizedPath.length-1]==="/")
return normalizedPath;if(path[0]==="/"&&normalizedPath)
normalizedPath="/"+normalizedPath;if((path[path.length-1]==="/")||(segments[segments.length-1]===".")||(segments[segments.length-1]===".."))
normalizedPath=normalizedPath+"/";return normalizedPath;}
function loadScriptsPromise(scriptNames,base)
{var promises=[];var urls=[];var sources=new Array(scriptNames.length);var scriptToEval=0;for(var i=0;i<scriptNames.length;++i){var scriptName=scriptNames[i];var sourceURL=(base||self._importScriptPathPrefix)+scriptName;var schemaIndex=sourceURL.indexOf("://")+3;sourceURL=sourceURL.substring(0,schemaIndex)+normalizePath(sourceURL.substring(schemaIndex));if(_loadedScripts[sourceURL])
continue;urls.push(sourceURL);promises.push(loadResourcePromise(sourceURL).then(scriptSourceLoaded.bind(null,i),scriptSourceLoaded.bind(null,i,undefined)));}
return Promise.all(promises).then(undefined);function scriptSourceLoaded(scriptNumber,scriptSource)
{sources[scriptNumber]=scriptSource||"";while(typeof sources[scriptToEval]!=="undefined"){evaluateScript(urls[scriptToEval],sources[scriptToEval]);++scriptToEval;}}
function evaluateScript(sourceURL,scriptSource)
{_loadedScripts[sourceURL]=true;if(!scriptSource){console.error("Empty response arrived for script '"+sourceURL+"'");return;}
self.eval(scriptSource+"\n//# sourceURL="+sourceURL);}}
(function(){var baseUrl=self.location?self.location.origin+self.location.pathname:"";self._importScriptPathPrefix=baseUrl.substring(0,baseUrl.lastIndexOf("/")+1);})();function Runtime(descriptors,coreModuleNames)
{this._modules=[];this._modulesMap={};this._extensions=[];this._cachedTypeClasses={};this._descriptorsMap={};for(var i=0;i<descriptors.length;++i)
this._registerModule(descriptors[i]);if(coreModuleNames)
this._loadAutoStartModules(coreModuleNames);}
Runtime._queryParamsObject={__proto__:null};Runtime.cachedResources={__proto__:null};Runtime.isReleaseMode=function()
{return!!allDescriptors.length;}
Runtime.startApplication=function(appName)
{console.timeStamp("Runtime.startApplication");var allDescriptorsByName={};for(var i=0;Runtime.isReleaseMode()&&i<allDescriptors.length;++i){var d=allDescriptors[i];allDescriptorsByName[d["name"]]=d;}
var applicationPromise;if(applicationDescriptor)
applicationPromise=Promise.resolve(applicationDescriptor);else
applicationPromise=loadResourcePromise(appName+".json").then(JSON.parse.bind(JSON));applicationPromise.then(parseModuleDescriptors);function parseModuleDescriptors(configuration)
{var moduleJSONPromises=[];var coreModuleNames=[];for(var i=0;i<configuration.length;++i){var descriptor=configuration[i];if(descriptor["type"]==="worker")
continue;var name=descriptor["name"];var moduleJSON=allDescriptorsByName[name];if(moduleJSON)
moduleJSONPromises.push(Promise.resolve(moduleJSON));else
moduleJSONPromises.push(loadResourcePromise(name+"/module.json").then(JSON.parse.bind(JSON)));if(descriptor["type"]==="autostart")
coreModuleNames.push(name);}
Promise.all(moduleJSONPromises).then(instantiateRuntime);function instantiateRuntime(moduleDescriptors)
{for(var i=0;!Runtime.isReleaseMode()&&i<moduleDescriptors.length;++i){moduleDescriptors[i]["name"]=configuration[i]["name"];moduleDescriptors[i]["condition"]=configuration[i]["condition"];}
self.runtime=new Runtime(moduleDescriptors,coreModuleNames);}}}
Runtime.queryParam=function(name)
{return Runtime._queryParamsObject[name]||null;}
Runtime.constructQueryParams=function(banned)
{var params=[];for(var key in Runtime._queryParamsObject){if(!key||banned.indexOf(key)!==-1)
continue;params.push(key+"="+Runtime._queryParamsObject[key]);}
return params.length?"?"+params.join("&"):"";}
Runtime._experimentsSetting=function()
{try{return(JSON.parse(self.localStorage&&self.localStorage["experiments"]?self.localStorage["experiments"]:"{}"));}catch(e){console.error("Failed to parse localStorage['experiments']");return{};}}
Runtime._some=function(promises)
{var all=[];var wasRejected=[];for(var i=0;i<promises.length;++i){var handlerFunction=(handler.bind(promises[i],i));all.push(promises[i].catch(handlerFunction));}
return Promise.all(all).then(filterOutFailuresResults);function filterOutFailuresResults(results)
{var filtered=[];for(var i=0;i<results.length;++i){if(!wasRejected[i])
filtered.push(results[i]);}
return filtered;}
function handler(index,e)
{wasRejected[index]=true;console.error(e.stack);}}
Runtime._console=console;Runtime._originalAssert=console.assert;Runtime._assert=function(value,message)
{if(value)
return;Runtime._originalAssert.call(Runtime._console,value,message+" "+new Error().stack);}
Runtime.prototype={useTestBase:function()
{Runtime._remoteBase="http://localhost:8000/inspector-sources/";},_registerModule:function(descriptor)
{var module=new Runtime.Module(this,descriptor);this._modules.push(module);this._modulesMap[descriptor["name"]]=module;},loadModulePromise:function(moduleName)
{return this._modulesMap[moduleName]._loadPromise();},_loadAutoStartModules:function(moduleNames)
{var promises=[];for(var i=0;i<moduleNames.length;++i){if(Runtime.isReleaseMode())
this._modulesMap[moduleNames[i]]._loaded=true;else
promises.push(this.loadModulePromise(moduleNames[i]));}
return Promise.all(promises);},_checkExtensionApplicability:function(extension,predicate)
{if(!predicate)
return false;var contextTypes=(extension.descriptor().contextTypes);if(!contextTypes)
return true;for(var i=0;i<contextTypes.length;++i){var contextType=this._resolve(contextTypes[i]);var isMatching=!!contextType&&predicate(contextType);if(isMatching)
return true;}
return false;},isExtensionApplicableToContext:function(extension,context)
{if(!context)
return true;return this._checkExtensionApplicability(extension,isInstanceOf);function isInstanceOf(targetType)
{return context instanceof targetType;}},isExtensionApplicableToContextTypes:function(extension,currentContextTypes)
{if(!extension.descriptor().contextTypes)
return true;return this._checkExtensionApplicability(extension,currentContextTypes?isContextTypeKnown:null);function isContextTypeKnown(targetType)
{return currentContextTypes.has(targetType);}},extensions:function(type,context)
{return this._extensions.filter(filter).sort(orderComparator);function filter(extension)
{if(extension._type!==type&&extension._typeClass()!==type)
return false;if(!extension.enabled())
return false;return!context||extension.isApplicable(context);}
function orderComparator(extension1,extension2)
{var order1=extension1.descriptor()["order"]||0;var order2=extension2.descriptor()["order"]||0;return order1-order2;}},extension:function(type,context)
{return this.extensions(type,context)[0]||null;},instancesPromise:function(type,context)
{var extensions=this.extensions(type,context);var promises=[];for(var i=0;i<extensions.length;++i)
promises.push(extensions[i].instancePromise());return Runtime._some(promises);},instancePromise:function(type,context)
{var extension=this.extension(type,context);if(!extension)
return Promise.reject(new Error("No such extension: "+type+" in given context."));return extension.instancePromise();},_resolve:function(typeName)
{if(!this._cachedTypeClasses[typeName]){var path=typeName.split(".");var object=window;for(var i=0;object&&(i<path.length);++i)
object=object[path[i]];if(object)
this._cachedTypeClasses[typeName]=(object);}
return this._cachedTypeClasses[typeName]||null;}}
Runtime.ModuleDescriptor=function()
{this.name;this.extensions;this.dependencies;this.scripts;this.remote;}
Runtime.ExtensionDescriptor=function()
{this.type;this.className;this.contextTypes;}
Runtime.Module=function(manager,descriptor)
{this._manager=manager;this._descriptor=descriptor;this._name=descriptor.name;this._instanceMap={};var extensions=(descriptor.extensions);for(var i=0;extensions&&i<extensions.length;++i)
this._manager._extensions.push(new Runtime.Extension(this,extensions[i]));this._loaded=false;}
Runtime.Module.prototype={name:function()
{return this._name;},enabled:function()
{var activatorExperiment=this._descriptor["experiment"];if(activatorExperiment&&!Runtime.experiments.isEnabled(activatorExperiment))
return false;var condition=this._descriptor["condition"];if(condition&&!Runtime.queryParam(condition))
return false;return true;},resource:function(name)
{var fullName=this._name+"/"+name;var content=Runtime.cachedResources[fullName];if(!content)
throw new Error(fullName+" not preloaded. Check module.json");return content;},_loadPromise:function()
{if(this._loaded)
return Promise.resolve();if(!this.enabled())
return Promise.reject(new Error("Module "+this._name+" is not enabled"));if(this._pendingLoadPromise)
return this._pendingLoadPromise;var dependencies=this._descriptor.dependencies;var dependencyPromises=[];for(var i=0;dependencies&&i<dependencies.length;++i)
dependencyPromises.push(this._manager._modulesMap[dependencies[i]]._loadPromise());this._pendingLoadPromise=Promise.all(dependencyPromises).then(this._loadResources.bind(this)).then(this._loadScripts.bind(this)).then(markAsLoaded.bind(this));return this._pendingLoadPromise;function markAsLoaded()
{delete this._pendingLoadPromise;this._loaded=true;}},_loadResources:function()
{var resources=this._descriptor["resources"];if(!resources)
return Promise.resolve();var promises=[];for(var i=0;i<resources.length;++i){var url=this._modularizeURL(resources[i]);promises.push(loadResourcePromise(url).then(cacheResource.bind(this,url),cacheResource.bind(this,url,undefined)));}
return Promise.all(promises).then(undefined);function cacheResource(path,content)
{if(!content){console.error("Failed to load resource: "+path);return;}
Runtime.cachedResources[path]=content+Runtime.resolveSourceURL(path);}},_loadScripts:function()
{if(!this._descriptor.scripts)
return Promise.resolve();if(Runtime.isReleaseMode())
return loadScriptsPromise([this._name+"_module.js"],this._remoteBase());return loadScriptsPromise(this._descriptor.scripts.map(this._modularizeURL,this));},_modularizeURL:function(resourceName)
{return normalizePath(this._name+"/"+resourceName);},_remoteBase:function()
{return this._descriptor.remote&&Runtime._remoteBase||undefined;},substituteURL:function(value)
{var base=this._remoteBase()||"";return value.replace(/@url\(([^\)]*?)\)/g,convertURL.bind(this));function convertURL(match,url)
{return base+this._modularizeURL(url);}},_instance:function(className,extension)
{if(className in this._instanceMap)
return this._instanceMap[className];var constructorFunction=window.eval(className);if(!(constructorFunction instanceof Function)){this._instanceMap[className]=null;return null;}
var instance=new constructorFunction(extension);this._instanceMap[className]=instance;return instance;}}
Runtime.Extension=function(module,descriptor)
{this._module=module;this._descriptor=descriptor;this._type=descriptor.type;this._hasTypeClass=this._type.charAt(0)==="@";this._className=descriptor.className||null;}
Runtime.Extension.prototype={descriptor:function()
{return this._descriptor;},module:function()
{return this._module;},enabled:function()
{var activatorExperiment=this.descriptor()["experiment"];if(activatorExperiment&&activatorExperiment.startsWith("!")&&Runtime.experiments.isEnabled(activatorExperiment.substring(1)))
return false;if(activatorExperiment&&!activatorExperiment.startsWith("!")&&!Runtime.experiments.isEnabled(activatorExperiment))
return false;var condition=this.descriptor()["condition"];if(condition&&!Runtime.queryParam(condition))
return false;return this._module.enabled();},_typeClass:function()
{if(!this._hasTypeClass)
return null;return this._module._manager._resolve(this._type.substring(1));},isApplicable:function(context)
{return this._module._manager.isExtensionApplicableToContext(this,context);},instancePromise:function()
{if(!this._className)
return Promise.reject(new Error("No class name in extension"));var className=this._className;if(this._instance)
return Promise.resolve(this._instance);return this._module._loadPromise().then(constructInstance.bind(this));function constructInstance()
{var result=this._module._instance(className,this);if(!result)
return Promise.reject("Could not instantiate: "+className);return result;}},title:function(platform)
{return this._descriptor["title-"+platform]||this._descriptor["title"];}}
Runtime.ExperimentsSupport=function()
{this._supportEnabled=Runtime.queryParam("experiments")!==null;this._experiments=[];this._experimentNames={};this._enabledTransiently={};}
Runtime.ExperimentsSupport.prototype={allConfigurableExperiments:function()
{var result=[];for(var i=0;i<this._experiments.length;i++){var experiment=this._experiments[i];if(!this._enabledTransiently[experiment.name])
result.push(experiment);}
return result;},supportEnabled:function()
{return this._supportEnabled;},_setExperimentsSetting:function(value)
{if(!self.localStorage)
return;self.localStorage["experiments"]=JSON.stringify(value);},register:function(experimentName,experimentTitle,hidden)
{Runtime._assert(!this._experimentNames[experimentName],"Duplicate registration of experiment "+experimentName);this._experimentNames[experimentName]=true;this._experiments.push(new Runtime.Experiment(this,experimentName,experimentTitle,!!hidden));},isEnabled:function(experimentName)
{this._checkExperiment(experimentName);if(this._enabledTransiently[experimentName])
return true;if(!this.supportEnabled())
return false;return!!Runtime._experimentsSetting()[experimentName];},setEnabled:function(experimentName,enabled)
{this._checkExperiment(experimentName);var experimentsSetting=Runtime._experimentsSetting();experimentsSetting[experimentName]=enabled;this._setExperimentsSetting(experimentsSetting);},setDefaultExperiments:function(experimentNames)
{for(var i=0;i<experimentNames.length;++i){this._checkExperiment(experimentNames[i]);this._enabledTransiently[experimentNames[i]]=true;}},enableForTest:function(experimentName)
{this._checkExperiment(experimentName);this._enabledTransiently[experimentName]=true;},clearForTest:function()
{this._experiments=[];this._experimentNames={};this._enabledTransiently={};},cleanUpStaleExperiments:function()
{var experimentsSetting=Runtime._experimentsSetting();var cleanedUpExperimentSetting={};for(var i=0;i<this._experiments.length;++i){var experimentName=this._experiments[i].name;if(experimentsSetting[experimentName])
cleanedUpExperimentSetting[experimentName]=true;}
this._setExperimentsSetting(cleanedUpExperimentSetting);},_checkExperiment:function(experimentName)
{Runtime._assert(this._experimentNames[experimentName],"Unknown experiment "+experimentName);}}
Runtime.Experiment=function(experiments,name,title,hidden)
{this.name=name;this.title=title;this.hidden=hidden;this._experiments=experiments;}
Runtime.Experiment.prototype={isEnabled:function()
{return this._experiments.isEnabled(this.name);},setEnabled:function(enabled)
{this._experiments.setEnabled(this.name,enabled);}}
{(function parseQueryParameters()
{var queryParams=location.search;if(!queryParams)
return;var params=queryParams.substring(1).split("&");for(var i=0;i<params.length;++i){var pair=params[i].split("=");var name=pair.shift();Runtime._queryParamsObject[name]=pair.join("=");}})();}
Runtime.experiments=new Runtime.ExperimentsSupport();Runtime._remoteBase=Runtime.queryParam("remoteBase");Runtime.resolveSourceURL=function(path)
{var sourceURL=window.location.href;if(window.location.search)
sourceURL=sourceURL.replace(window.location.search,"");sourceURL=sourceURL.substring(0,sourceURL.lastIndexOf("/")+1)+path;return"\n/*# sourceURL="+sourceURL+" */";}
var runtime;console=console;console.__originalAssert=console.assert;console.assert=function(value,message)
{if(value)
return;console.__originalAssert(value,message);}
var ArrayLike;Object.isEmpty=function(obj)
{for(var i in obj)
return false;return true;}
Object.values=function(obj)
{var result=Object.keys(obj);var length=result.length;for(var i=0;i<length;++i)
result[i]=obj[result[i]];return result;}
function mod(m,n)
{return((m%n)+n)%n;}
String.prototype.findAll=function(string)
{var matches=[];var i=this.indexOf(string);while(i!==-1){matches.push(i);i=this.indexOf(string,i+string.length);}
return matches;}
String.prototype.lineEndings=function()
{if(!this._lineEndings){this._lineEndings=this.findAll("\n");this._lineEndings.push(this.length);}
return this._lineEndings;}
String.prototype.lineCount=function()
{var lineEndings=this.lineEndings();return lineEndings.length;}
String.prototype.lineAt=function(lineNumber)
{var lineEndings=this.lineEndings();var lineStart=lineNumber>0?lineEndings[lineNumber-1]+1:0;var lineEnd=lineEndings[lineNumber];var lineContent=this.substring(lineStart,lineEnd);if(lineContent.length>0&&lineContent.charAt(lineContent.length-1)==="\r")
lineContent=lineContent.substring(0,lineContent.length-1);return lineContent;}
String.prototype.escapeCharacters=function(chars)
{var foundChar=false;for(var i=0;i<chars.length;++i){if(this.indexOf(chars.charAt(i))!==-1){foundChar=true;break;}}
if(!foundChar)
return String(this);var result="";for(var i=0;i<this.length;++i){if(chars.indexOf(this.charAt(i))!==-1)
result+="\\";result+=this.charAt(i);}
return result;}
String.regexSpecialCharacters=function()
{return"^[]{}()\\.^$*+?|-,";}
String.prototype.escapeForRegExp=function()
{return this.escapeCharacters(String.regexSpecialCharacters());}
String.prototype.escapeHTML=function()
{return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");}
String.prototype.unescapeHTML=function()
{return this.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&#58;/g,":").replace(/&quot;/g,"\"").replace(/&#60;/g,"<").replace(/&#62;/g,">").replace(/&amp;/g,"&");}
String.prototype.collapseWhitespace=function()
{return this.replace(/[\s\xA0]+/g," ");}
String.prototype.trimMiddle=function(maxLength)
{if(this.length<=maxLength)
return String(this);var leftHalf=maxLength>>1;var rightHalf=maxLength-leftHalf-1;return this.substr(0,leftHalf)+"\u2026"+this.substr(this.length-rightHalf,rightHalf);}
String.prototype.trimEnd=function(maxLength)
{if(this.length<=maxLength)
return String(this);return this.substr(0,maxLength-1)+"\u2026";}
String.prototype.trimURL=function(baseURLDomain)
{var result=this.replace(/^(https|http|file):\/\//i,"");if(baseURLDomain){if(result.toLowerCase().startsWith(baseURLDomain.toLowerCase()))
result=result.substr(baseURLDomain.length);}
return result;}
String.prototype.toTitleCase=function()
{return this.substring(0,1).toUpperCase()+this.substring(1);}
String.prototype.compareTo=function(other)
{if(this>other)
return 1;if(this<other)
return-1;return 0;}
function sanitizeHref(href)
{return href&&href.trim().toLowerCase().startsWith("javascript:")?null:href;}
String.prototype.removeURLFragment=function()
{var fragmentIndex=this.indexOf("#");if(fragmentIndex==-1)
fragmentIndex=this.length;return this.substring(0,fragmentIndex);}
String.hashCode=function(string)
{if(!string)
return 0;var result=0;for(var i=0;i<string.length;++i)
result=(result*3+string.charCodeAt(i))|0;return result;}
String.isDigitAt=function(string,index)
{var c=string.charCodeAt(index);return 48<=c&&c<=57;}
String.prototype.toBase64=function()
{function encodeBits(b)
{return b<26?b+65:b<52?b+71:b<62?b-4:b===62?43:b===63?47:65;}
var encoder=new TextEncoder();var data=encoder.encode(this.toString());var n=data.length;var encoded="";if(n===0)
return encoded;var shift;var v=0;for(var i=0;i<n;i++){shift=i%3;v|=data[i]<<(16>>>shift&24);if(shift===2){encoded+=String.fromCharCode(encodeBits(v>>>18&63),encodeBits(v>>>12&63),encodeBits(v>>>6&63),encodeBits(v&63));v=0;}}
if(shift===0)
encoded+=String.fromCharCode(encodeBits(v>>>18&63),encodeBits(v>>>12&63),61,61);else if(shift===1)
encoded+=String.fromCharCode(encodeBits(v>>>18&63),encodeBits(v>>>12&63),encodeBits(v>>>6&63),61);return encoded;}
String.naturalOrderComparator=function(a,b)
{var chunk=/^\d+|^\D+/;var chunka,chunkb,anum,bnum;while(1){if(a){if(!b)
return 1;}else{if(b)
return-1;else
return 0;}
chunka=a.match(chunk)[0];chunkb=b.match(chunk)[0];anum=!isNaN(chunka);bnum=!isNaN(chunkb);if(anum&&!bnum)
return-1;if(bnum&&!anum)
return 1;if(anum&&bnum){var diff=chunka-chunkb;if(diff)
return diff;if(chunka.length!==chunkb.length){if(!+chunka&&!+chunkb)
return chunka.length-chunkb.length;else
return chunkb.length-chunka.length;}}else if(chunka!==chunkb)
return(chunka<chunkb)?-1:1;a=a.substring(chunka.length);b=b.substring(chunkb.length);}}
String.caseInsensetiveComparator=function(a,b)
{a=a.toUpperCase();b=b.toUpperCase();if(a===b)
return 0;return a>b?1:-1;}
Number.constrain=function(num,min,max)
{if(num<min)
num=min;else if(num>max)
num=max;return num;}
Number.gcd=function(a,b)
{if(b===0)
return a;else
return Number.gcd(b,a%b);}
Number.toFixedIfFloating=function(value)
{if(!value||isNaN(value))
return value;var number=Number(value);return number%1?number.toFixed(3):String(number);}
Date.prototype.toISO8601Compact=function()
{function leadZero(x)
{return(x>9?"":"0")+x;}
return this.getFullYear()+
leadZero(this.getMonth()+1)+
leadZero(this.getDate())+"T"+
leadZero(this.getHours())+
leadZero(this.getMinutes())+
leadZero(this.getSeconds());}
Date.prototype.toConsoleTime=function()
{function leadZero2(x)
{return(x>9?"":"0")+x;}
function leadZero3(x)
{return"0".repeat(3-x.toString().length)+x;}
return this.getFullYear()+"-"+
leadZero2(this.getMonth()+1)+"-"+
leadZero2(this.getDate())+" "+
leadZero2(this.getHours())+":"+
leadZero2(this.getMinutes())+":"+
leadZero2(this.getSeconds())+"."+
leadZero3(this.getMilliseconds());}
Object.defineProperty(Array.prototype,"remove",{value:function(value,firstOnly)
{var index=this.indexOf(value);if(index===-1)
return false;if(firstOnly){this.splice(index,1);return true;}
for(var i=index+1,n=this.length;i<n;++i){if(this[i]!==value)
this[index++]=this[i];}
this.length=index;return true;}});Object.defineProperty(Array.prototype,"keySet",{value:function()
{var keys={};for(var i=0;i<this.length;++i)
keys[this[i]]=true;return keys;}});Object.defineProperty(Array.prototype,"pushAll",{value:function(array)
{Array.prototype.push.apply(this,array);}});Object.defineProperty(Array.prototype,"rotate",{value:function(index)
{var result=[];for(var i=index;i<index+this.length;++i)
result.push(this[i%this.length]);return result;}});Object.defineProperty(Array.prototype,"sortNumbers",{value:function()
{function numericComparator(a,b)
{return a-b;}
this.sort(numericComparator);}});Object.defineProperty(Uint32Array.prototype,"sort",{value:Array.prototype.sort});(function(){var partition={value:function(comparator,left,right,pivotIndex)
{function swap(array,i1,i2)
{var temp=array[i1];array[i1]=array[i2];array[i2]=temp;}
var pivotValue=this[pivotIndex];swap(this,right,pivotIndex);var storeIndex=left;for(var i=left;i<right;++i){if(comparator(this[i],pivotValue)<0){swap(this,storeIndex,i);++storeIndex;}}
swap(this,right,storeIndex);return storeIndex;}};Object.defineProperty(Array.prototype,"partition",partition);Object.defineProperty(Uint32Array.prototype,"partition",partition);var sortRange={value:function(comparator,leftBound,rightBound,sortWindowLeft,sortWindowRight)
{function quickSortRange(array,comparator,left,right,sortWindowLeft,sortWindowRight)
{if(right<=left)
return;var pivotIndex=Math.floor(Math.random()*(right-left))+left;var pivotNewIndex=array.partition(comparator,left,right,pivotIndex);if(sortWindowLeft<pivotNewIndex)
quickSortRange(array,comparator,left,pivotNewIndex-1,sortWindowLeft,sortWindowRight);if(pivotNewIndex<sortWindowRight)
quickSortRange(array,comparator,pivotNewIndex+1,right,sortWindowLeft,sortWindowRight);}
if(leftBound===0&&rightBound===(this.length-1)&&sortWindowLeft===0&&sortWindowRight>=rightBound)
this.sort(comparator);else
quickSortRange(this,comparator,leftBound,rightBound,sortWindowLeft,sortWindowRight);return this;}}
Object.defineProperty(Array.prototype,"sortRange",sortRange);Object.defineProperty(Uint32Array.prototype,"sortRange",sortRange);})();Object.defineProperty(Array.prototype,"stableSort",{value:function(comparator)
{function defaultComparator(a,b)
{return a<b?-1:(a>b?1:0);}
comparator=comparator||defaultComparator;var indices=new Array(this.length);for(var i=0;i<this.length;++i)
indices[i]=i;var self=this;function indexComparator(a,b)
{var result=comparator(self[a],self[b]);return result?result:a-b;}
indices.sort(indexComparator);for(var i=0;i<this.length;++i){if(indices[i]<0||i===indices[i])
continue;var cyclical=i;var saved=this[i];while(true){var next=indices[cyclical];indices[cyclical]=-1;if(next===i){this[cyclical]=saved;break;}else{this[cyclical]=this[next];cyclical=next;}}}
return this;}});Object.defineProperty(Array.prototype,"qselect",{value:function(k,comparator)
{if(k<0||k>=this.length)
return;if(!comparator)
comparator=function(a,b){return a-b;}
var low=0;var high=this.length-1;for(;;){var pivotPosition=this.partition(comparator,low,high,Math.floor((high+low)/2));if(pivotPosition===k)
return this[k];else if(pivotPosition>k)
high=pivotPosition-1;else
low=pivotPosition+1;}}});Object.defineProperty(Array.prototype,"lowerBound",{value:function(object,comparator,left,right)
{function defaultComparator(a,b)
{return a<b?-1:(a>b?1:0);}
comparator=comparator||defaultComparator;var l=left||0;var r=right!==undefined?right:this.length;while(l<r){var m=(l+r)>>1;if(comparator(object,this[m])>0)
l=m+1;else
r=m;}
return r;}});Object.defineProperty(Array.prototype,"upperBound",{value:function(object,comparator,left,right)
{function defaultComparator(a,b)
{return a<b?-1:(a>b?1:0);}
comparator=comparator||defaultComparator;var l=left||0;var r=right!==undefined?right:this.length;while(l<r){var m=(l+r)>>1;if(comparator(object,this[m])>=0)
l=m+1;else
r=m;}
return r;}});Object.defineProperty(Uint32Array.prototype,"lowerBound",{value:Array.prototype.lowerBound});Object.defineProperty(Uint32Array.prototype,"upperBound",{value:Array.prototype.upperBound});Object.defineProperty(Float64Array.prototype,"lowerBound",{value:Array.prototype.lowerBound});Object.defineProperty(Array.prototype,"binaryIndexOf",{value:function(value,comparator)
{var index=this.lowerBound(value,comparator);return index<this.length&&comparator(value,this[index])===0?index:-1;}});Object.defineProperty(Array.prototype,"select",{value:function(field)
{var result=new Array(this.length);for(var i=0;i<this.length;++i)
result[i]=this[i][field];return result;}});Object.defineProperty(Array.prototype,"peekLast",{value:function()
{return this[this.length-1];}});(function(){function mergeOrIntersect(array1,array2,comparator,mergeNotIntersect)
{var result=[];var i=0;var j=0;while(i<array1.length&&j<array2.length){var compareValue=comparator(array1[i],array2[j]);if(mergeNotIntersect||!compareValue)
result.push(compareValue<=0?array1[i]:array2[j]);if(compareValue<=0)
i++;if(compareValue>=0)
j++;}
if(mergeNotIntersect){while(i<array1.length)
result.push(array1[i++]);while(j<array2.length)
result.push(array2[j++]);}
return result;}
Object.defineProperty(Array.prototype,"intersectOrdered",{value:function(array,comparator)
{return mergeOrIntersect(this,array,comparator,false);}});Object.defineProperty(Array.prototype,"mergeOrdered",{value:function(array,comparator)
{return mergeOrIntersect(this,array,comparator,true);}});}());function insertionIndexForObjectInListSortedByFunction(object,list,comparator,insertionIndexAfter)
{if(insertionIndexAfter)
return list.upperBound(object,comparator);else
return list.lowerBound(object,comparator);}
String.sprintf=function(format,var_arg)
{return String.vsprintf(format,Array.prototype.slice.call(arguments,1));}
String.tokenizeFormatString=function(format,formatters)
{var tokens=[];var substitutionIndex=0;function addStringToken(str)
{if(tokens.length&&tokens[tokens.length-1].type==="string")
tokens[tokens.length-1].value+=str;else
tokens.push({type:"string",value:str});}
function addSpecifierToken(specifier,precision,substitutionIndex)
{tokens.push({type:"specifier",specifier:specifier,precision:precision,substitutionIndex:substitutionIndex});}
var index=0;for(var precentIndex=format.indexOf("%",index);precentIndex!==-1;precentIndex=format.indexOf("%",index)){if(format.length===index)
break;addStringToken(format.substring(index,precentIndex));index=precentIndex+1;if(format[index]==="%"){addStringToken("%");++index;continue;}
if(String.isDigitAt(format,index)){var number=parseInt(format.substring(index),10);while(String.isDigitAt(format,index))
++index;if(number>0&&format[index]==="$"){substitutionIndex=(number-1);++index;}}
var precision=-1;if(format[index]==="."){++index;precision=parseInt(format.substring(index),10);if(isNaN(precision))
precision=0;while(String.isDigitAt(format,index))
++index;}
if(!(format[index]in formatters)){addStringToken(format.substring(precentIndex,index+1));++index;continue;}
addSpecifierToken(format[index],precision,substitutionIndex);++substitutionIndex;++index;}
addStringToken(format.substring(index));return tokens;}
String.standardFormatters={d:function(substitution)
{return!isNaN(substitution)?substitution:0;},f:function(substitution,token)
{if(substitution&&token.precision>-1)
substitution=substitution.toFixed(token.precision);return!isNaN(substitution)?substitution:(token.precision>-1?Number(0).toFixed(token.precision):0);},s:function(substitution)
{return substitution;}}
String.vsprintf=function(format,substitutions)
{return String.format(format,substitutions,String.standardFormatters,"",function(a,b){return a+b;}).formattedResult;}
String.format=function(format,substitutions,formatters,initialValue,append,tokenizedFormat)
{if(!format||!substitutions||!substitutions.length)
return{formattedResult:append(initialValue,format),unusedSubstitutions:substitutions};function prettyFunctionName()
{return"String.format(\""+format+"\", \""+Array.prototype.join.call(substitutions,"\", \"")+"\")";}
function warn(msg)
{console.warn(prettyFunctionName()+": "+msg);}
function error(msg)
{console.error(prettyFunctionName()+": "+msg);}
var result=initialValue;var tokens=tokenizedFormat||String.tokenizeFormatString(format,formatters);var usedSubstitutionIndexes={};for(var i=0;i<tokens.length;++i){var token=tokens[i];if(token.type==="string"){result=append(result,token.value);continue;}
if(token.type!=="specifier"){error("Unknown token type \""+token.type+"\" found.");continue;}
if(token.substitutionIndex>=substitutions.length){error("not enough substitution arguments. Had "+substitutions.length+" but needed "+(token.substitutionIndex+1)+", so substitution was skipped.");result=append(result,"%"+(token.precision>-1?token.precision:"")+token.specifier);continue;}
usedSubstitutionIndexes[token.substitutionIndex]=true;if(!(token.specifier in formatters)){warn("unsupported format character \u201C"+token.specifier+"\u201D. Treating as a string.");result=append(result,substitutions[token.substitutionIndex]);continue;}
result=append(result,formatters[token.specifier](substitutions[token.substitutionIndex],token));}
var unusedSubstitutions=[];for(var i=0;i<substitutions.length;++i){if(i in usedSubstitutionIndexes)
continue;unusedSubstitutions.push(substitutions[i]);}
return{formattedResult:result,unusedSubstitutions:unusedSubstitutions};}
function createSearchRegex(query,caseSensitive,isRegex)
{var regexFlags=caseSensitive?"g":"gi";var regexObject;if(isRegex){try{regexObject=new RegExp(query,regexFlags);}catch(e){}}
if(!regexObject)
regexObject=createPlainTextSearchRegex(query,regexFlags);return regexObject;}
function createPlainTextSearchRegex(query,flags)
{var regexSpecialCharacters=String.regexSpecialCharacters();var regex="";for(var i=0;i<query.length;++i){var c=query.charAt(i);if(regexSpecialCharacters.indexOf(c)!=-1)
regex+="\\";regex+=c;}
return new RegExp(regex,flags||"");}
function countRegexMatches(regex,content)
{var text=content;var result=0;var match;while(text&&(match=regex.exec(text))){if(match[0].length>0)
++result;text=text.substring(match.index+1);}
return result;}
function spacesPadding(spacesCount)
{return"\u00a0".repeat(spacesCount);}
function numberToStringWithSpacesPadding(value,symbolsCount)
{var numberString=value.toString();var paddingLength=Math.max(0,symbolsCount-numberString.length);return spacesPadding(paddingLength)+numberString;}
Array.from=function(iterator)
{var values=[];for(var iteratorValue=iterator.next();!iteratorValue.done;iteratorValue=iterator.next())
values.push(iteratorValue.value);return values;}
Set.prototype.valuesArray=function()
{return Array.from(this.values());}
Map.prototype.remove=function(key)
{var value=this.get(key);this.delete(key);return value;}
Map.prototype.valuesArray=function()
{return Array.from(this.values());}
Map.prototype.keysArray=function()
{return Array.from(this.keys());}
var Multimap=function()
{this._map=new Map();}
Multimap.prototype={set:function(key,value)
{var set=this._map.get(key);if(!set){set=new Set();this._map.set(key,set);}
set.add(value);},get:function(key)
{var result=this._map.get(key);if(!result)
result=new Set();return result;},has:function(key)
{return this._map.has(key);},get size()
{return this._map.size;},remove:function(key,value)
{var values=this.get(key);values.delete(value);if(!values.size)
this._map.delete(key);},removeAll:function(key)
{this._map.delete(key);},keysArray:function()
{return this._map.keysArray();},valuesArray:function()
{var result=[];var keys=this.keysArray();for(var i=0;i<keys.length;++i)
result.pushAll(this.get(keys[i]).valuesArray());return result;},clear:function()
{this._map.clear();}}
function loadXHR(url)
{return new Promise(load);function load(successCallback,failureCallback)
{function onReadyStateChanged()
{if(xhr.readyState!==XMLHttpRequest.DONE)
return;if(xhr.status!==200){xhr.onreadystatechange=null;failureCallback(new Error(xhr.status));return;}
xhr.onreadystatechange=null;successCallback(xhr.responseText);}
var xhr=new XMLHttpRequest();xhr.withCredentials=false;xhr.open("GET",url,true);xhr.onreadystatechange=onReadyStateChanged;xhr.send(null);}}
function CallbackBarrier()
{this._pendingIncomingCallbacksCount=0;}
CallbackBarrier.prototype={createCallback:function(userCallback)
{console.assert(!this._outgoingCallback,"CallbackBarrier.createCallback() is called after CallbackBarrier.callWhenDone()");++this._pendingIncomingCallbacksCount;return this._incomingCallback.bind(this,userCallback);},callWhenDone:function(callback)
{console.assert(!this._outgoingCallback,"CallbackBarrier.callWhenDone() is called multiple times");this._outgoingCallback=callback;if(!this._pendingIncomingCallbacksCount)
this._outgoingCallback();},donePromise:function()
{return new Promise(promiseConstructor.bind(this));function promiseConstructor(success)
{this.callWhenDone(success);}},_incomingCallback:function(userCallback)
{console.assert(this._pendingIncomingCallbacksCount>0);if(userCallback){var args=Array.prototype.slice.call(arguments,1);userCallback.apply(null,args);}
if(!--this._pendingIncomingCallbacksCount&&this._outgoingCallback)
this._outgoingCallback();}}
function suppressUnused(value)
{}
self.setImmediate=function(callback)
{Promise.resolve().then(callback);return 0;}
Promise.prototype.spread=function(callback)
{return this.then(spreadPromise);function spreadPromise(arg)
{return callback.apply(null,arg);}}
Promise.prototype.catchException=function(defaultValue){return this.catch(function(error){console.error(error);return defaultValue;});};Node.prototype.rangeOfWord=function(offset,stopCharacters,stayWithinNode,direction)
{var startNode;var startOffset=0;var endNode;var endOffset=0;if(!stayWithinNode)
stayWithinNode=this;if(!direction||direction==="backward"||direction==="both"){var node=this;while(node){if(node===stayWithinNode){if(!startNode)
startNode=stayWithinNode;break;}
if(node.nodeType===Node.TEXT_NODE){var start=(node===this?(offset-1):(node.nodeValue.length-1));for(var i=start;i>=0;--i){if(stopCharacters.indexOf(node.nodeValue[i])!==-1){startNode=node;startOffset=i+1;break;}}}
if(startNode)
break;node=node.traversePreviousNode(stayWithinNode);}
if(!startNode){startNode=stayWithinNode;startOffset=0;}}else{startNode=this;startOffset=offset;}
if(!direction||direction==="forward"||direction==="both"){node=this;while(node){if(node===stayWithinNode){if(!endNode)
endNode=stayWithinNode;break;}
if(node.nodeType===Node.TEXT_NODE){var start=(node===this?offset:0);for(var i=start;i<node.nodeValue.length;++i){if(stopCharacters.indexOf(node.nodeValue[i])!==-1){endNode=node;endOffset=i;break;}}}
if(endNode)
break;node=node.traverseNextNode(stayWithinNode);}
if(!endNode){endNode=stayWithinNode;endOffset=stayWithinNode.nodeType===Node.TEXT_NODE?stayWithinNode.nodeValue.length:stayWithinNode.childNodes.length;}}else{endNode=this;endOffset=offset;}
var result=this.ownerDocument.createRange();result.setStart(startNode,startOffset);result.setEnd(endNode,endOffset);return result;}
Node.prototype.traverseNextTextNode=function(stayWithin)
{var node=this.traverseNextNode(stayWithin);if(!node)
return null;var nonTextTags={"STYLE":1,"SCRIPT":1};while(node&&(node.nodeType!==Node.TEXT_NODE||nonTextTags[node.parentElement.nodeName]))
node=node.traverseNextNode(stayWithin);return node;}
Element.prototype.positionAt=function(x,y,relativeTo)
{var shift={x:0,y:0};if(relativeTo)
shift=relativeTo.boxInWindow(this.ownerDocument.defaultView);if(typeof x==="number")
this.style.setProperty("left",(shift.x+x)+"px");else
this.style.removeProperty("left");if(typeof y==="number")
this.style.setProperty("top",(shift.y+y)+"px");else
this.style.removeProperty("top");if(typeof x==="number"||typeof y==="number")
this.style.setProperty("position","absolute");else
this.style.removeProperty("position");}
Element.prototype.isScrolledToBottom=function()
{return Math.abs(this.scrollTop+this.clientHeight-this.scrollHeight)<=2;}
function removeSubsequentNodes(fromNode,toNode)
{for(var node=fromNode;node&&node!==toNode;){var nodeToRemove=node;node=node.nextSibling;nodeToRemove.remove();}}
Element.prototype.containsEventPoint=function(event)
{var box=this.getBoundingClientRect();return box.left<event.x&&event.x<box.right&&box.top<event.y&&event.y<box.bottom;}
Node.prototype.enclosingNodeOrSelfWithNodeNameInArray=function(nameArray)
{for(var node=this;node&&node!==this.ownerDocument;node=node.parentNodeOrShadowHost()){for(var i=0;i<nameArray.length;++i){if(node.nodeName.toLowerCase()===nameArray[i].toLowerCase())
return node;}}
return null;}
Node.prototype.enclosingNodeOrSelfWithNodeName=function(nodeName)
{return this.enclosingNodeOrSelfWithNodeNameInArray([nodeName]);}
Node.prototype.enclosingNodeOrSelfWithClass=function(className,stayWithin)
{return this.enclosingNodeOrSelfWithClassList([className],stayWithin);}
Node.prototype.enclosingNodeOrSelfWithClassList=function(classNames,stayWithin)
{for(var node=this;node&&node!==stayWithin&&node!==this.ownerDocument;node=node.parentNodeOrShadowHost()){if(node.nodeType===Node.ELEMENT_NODE){var containsAll=true;for(var i=0;i<classNames.length&&containsAll;++i){if(!node.classList.contains(classNames[i]))
containsAll=false;}
if(containsAll)
return(node);}}
return null;}
Node.prototype.parentElementOrShadowHost=function()
{var node=this.parentNode;if(!node)
return null;if(node.nodeType===Node.ELEMENT_NODE)
return(node);if(node.nodeType===Node.DOCUMENT_FRAGMENT_NODE)
return(node.host);return null;}
Node.prototype.parentNodeOrShadowHost=function()
{return this.parentNode||this.host||null;}
Node.prototype.getComponentSelection=function()
{var parent=this.parentNode;while(parent&&parent.nodeType!==Node.DOCUMENT_FRAGMENT_NODE)
parent=parent.parentNode;return parent instanceof ShadowRoot?parent.getSelection():this.window().getSelection();}
Node.prototype.isComponentSelectionCollapsed=function()
{var selection=this.getComponentSelection();return selection&&selection.rangeCount?selection.getRangeAt(0).collapsed:true;}
Node.prototype.getDeepSelection=function()
{var activeElement=this.ownerDocument.activeElement;var shadowRoot=null;while(activeElement&&activeElement.shadowRoot){shadowRoot=activeElement.shadowRoot;activeElement=shadowRoot.activeElement;}
return shadowRoot?shadowRoot.getSelection():this.window().getSelection();}
Node.prototype.window=function()
{return this.ownerDocument.defaultView;}
Element.prototype.query=function(query)
{return this.ownerDocument.evaluate(query,this,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;}
Element.prototype.removeChildren=function()
{if(this.firstChild)
this.textContent="";}
Element.prototype.isInsertionCaretInside=function()
{var selection=this.getComponentSelection();if(!selection.rangeCount||!selection.isCollapsed)
return false;var selectionRange=selection.getRangeAt(0);return selectionRange.startContainer.isSelfOrDescendant(this);}
function createElement(tagName,customElementType)
{return document.createElement(tagName,customElementType||"");}
function createEvent(type,bubbles,cancelable)
{var event=document.createEvent("Event");event.initEvent(type,bubbles,cancelable);return event;}
function createTextNode(data)
{return document.createTextNode(data);}
Document.prototype.createElementWithClass=function(elementName,className,customElementType)
{var element=this.createElement(elementName,customElementType||"");if(className)
element.className=className;return element;}
function createElementWithClass(elementName,className,customElementType)
{return document.createElementWithClass(elementName,className,customElementType);}
Document.prototype.createSVGElement=function(childType,className)
{var element=this.createElementNS("https://www.w3.org/2000/svg",childType);if(className)
element.setAttribute("class",className);return element;}
function createSVGElement(childType,className)
{return document.createSVGElement(childType,className);}
function createDocumentFragment()
{return document.createDocumentFragment();}
Element.prototype.createChild=function(elementName,className,customElementType)
{var element=this.ownerDocument.createElementWithClass(elementName,className,customElementType);this.appendChild(element);return element;}
DocumentFragment.prototype.createChild=Element.prototype.createChild;Element.prototype.createTextChild=function(text)
{var element=this.ownerDocument.createTextNode(text);this.appendChild(element);return element;}
DocumentFragment.prototype.createTextChild=Element.prototype.createTextChild;Element.prototype.createTextChildren=function(var_args)
{for(var i=0,n=arguments.length;i<n;++i)
this.createTextChild(arguments[i]);}
DocumentFragment.prototype.createTextChildren=Element.prototype.createTextChildren;Element.prototype.totalOffsetLeft=function()
{return this.totalOffset().left;}
Element.prototype.totalOffsetTop=function()
{return this.totalOffset().top;}
Element.prototype.totalOffset=function()
{var rect=this.getBoundingClientRect();return{left:rect.left,top:rect.top};}
Element.prototype.scrollOffset=function()
{var curLeft=0;var curTop=0;for(var element=this;element;element=element.scrollParent){curLeft+=element.scrollLeft;curTop+=element.scrollTop;}
return{left:curLeft,top:curTop};}
Element.prototype.createSVGChild=function(childType,className)
{var child=this.ownerDocument.createSVGElement(childType,className);this.appendChild(child);return child;}
function AnchorBox(x,y,width,height)
{this.x=x||0;this.y=y||0;this.width=width||0;this.height=height||0;}
AnchorBox.prototype.relativeTo=function(box)
{return new AnchorBox(this.x-box.x,this.y-box.y,this.width,this.height);}
AnchorBox.prototype.relativeToElement=function(element)
{return this.relativeTo(element.boxInWindow(element.ownerDocument.defaultView));}
AnchorBox.prototype.equals=function(anchorBox)
{return!!anchorBox&&this.x===anchorBox.x&&this.y===anchorBox.y&&this.width===anchorBox.width&&this.height===anchorBox.height;}
Element.prototype.offsetRelativeToWindow=function(targetWindow)
{var elementOffset=new AnchorBox();var curElement=this;var curWindow=this.ownerDocument.defaultView;while(curWindow&&curElement){elementOffset.x+=curElement.totalOffsetLeft();elementOffset.y+=curElement.totalOffsetTop();if(curWindow===targetWindow)
break;curElement=curWindow.frameElement;curWindow=curWindow.parent;}
return elementOffset;}
Element.prototype.boxInWindow=function(targetWindow)
{targetWindow=targetWindow||this.ownerDocument.defaultView;var anchorBox=this.offsetRelativeToWindow(window);anchorBox.width=Math.min(this.offsetWidth,window.innerWidth-anchorBox.x);anchorBox.height=Math.min(this.offsetHeight,window.innerHeight-anchorBox.y);return anchorBox;}
Element.prototype.setTextAndTitle=function(text)
{this.textContent=text;this.title=text;}
KeyboardEvent.prototype.__defineGetter__("data",function()
{switch(this.type){case"keypress":if(!this.ctrlKey&&!this.metaKey)
return String.fromCharCode(this.charCode);else
return"";case"keydown":case"keyup":if(!this.ctrlKey&&!this.metaKey&&!this.altKey)
return String.fromCharCode(this.which);else
return"";}});Event.prototype.consume=function(preventDefault)
{this.stopImmediatePropagation();if(preventDefault)
this.preventDefault();this.handled=true;}
Text.prototype.select=function(start,end)
{start=start||0;end=end||this.textContent.length;if(start<0)
start=end+start;var selection=this.getComponentSelection();selection.removeAllRanges();var range=this.ownerDocument.createRange();range.setStart(this,start);range.setEnd(this,end);selection.addRange(range);return this;}
Element.prototype.selectionLeftOffset=function()
{var selection=this.getComponentSelection();if(!selection.containsNode(this,true))
return null;var leftOffset=selection.anchorOffset;var node=selection.anchorNode;while(node!==this){while(node.previousSibling){node=node.previousSibling;leftOffset+=node.textContent.length;}
node=node.parentNodeOrShadowHost();}
return leftOffset;}
HTMLImageElement.prototype.completePromise=function()
{var element=this;if(element.complete)
return Promise.resolve(element);return new Promise(promiseBody);function promiseBody(resolve)
{element.addEventListener("load",oncomplete);element.addEventListener("error",oncomplete);function oncomplete()
{resolve(element);}}}
Node.prototype.appendChildren=function(var_args)
{for(var i=0,n=arguments.length;i<n;++i)
this.appendChild(arguments[i]);}
Node.prototype.deepTextContent=function()
{return this.childTextNodes().map(function(node){return node.textContent;}).join("");}
Node.prototype.childTextNodes=function()
{var node=this.traverseNextTextNode(this);var result=[];var nonTextTags={"STYLE":1,"SCRIPT":1};while(node){if(!nonTextTags[node.parentElement.nodeName])
result.push(node);node=node.traverseNextTextNode(this);}
return result;}
Node.prototype.isAncestor=function(node)
{if(!node)
return false;var currentNode=node.parentNodeOrShadowHost();while(currentNode){if(this===currentNode)
return true;currentNode=currentNode.parentNodeOrShadowHost();}
return false;}
Node.prototype.isDescendant=function(descendant)
{return!!descendant&&descendant.isAncestor(this);}
Node.prototype.isSelfOrAncestor=function(node)
{return!!node&&(node===this||this.isAncestor(node));}
Node.prototype.isSelfOrDescendant=function(node)
{return!!node&&(node===this||this.isDescendant(node));}
Node.prototype.traverseNextNode=function(stayWithin)
{if(this.shadowRoot)
return this.shadowRoot;var distributedNodes=this.getDistributedNodes?this.getDistributedNodes():[];if(distributedNodes.length)
return distributedNodes[0];if(this.firstChild)
return this.firstChild;var node=this;while(node){if(stayWithin&&node===stayWithin)
return null;var sibling=nextSibling(node);if(sibling)
return sibling;node=insertionPoint(node)||node.parentNodeOrShadowHost();}
function nextSibling(node)
{var parent=insertionPoint(node);if(!parent)
return node.nextSibling;var distributedNodes=parent.getDistributedNodes?parent.getDistributedNodes():[];var position=Array.prototype.indexOf.call(distributedNodes,node);if(position+1<distributedNodes.length)
return distributedNodes[position+1];return null;}
function insertionPoint(node)
{var insertionPoints=node.getDestinationInsertionPoints?node.getDestinationInsertionPoints():[];return insertionPoints.length>0?insertionPoints[insertionPoints.length-1]:null;}
return null;}
Node.prototype.traversePreviousNode=function(stayWithin)
{if(stayWithin&&this===stayWithin)
return null;var node=this.previousSibling;while(node&&node.lastChild)
node=node.lastChild;if(node)
return node;return this.parentNodeOrShadowHost();}
Node.prototype.setTextContentTruncatedIfNeeded=function(text,placeholder)
{const maxTextContentLength=10000;if(typeof text==="string"&&text.length>maxTextContentLength){this.textContent=typeof placeholder==="string"?placeholder:text.trimMiddle(maxTextContentLength);return true;}
this.textContent=text;return false;}
Event.prototype.deepElementFromPoint=function()
{var node=this.target;while(node&&node.nodeType!==Node.DOCUMENT_FRAGMENT_NODE&&node.nodeType!==Node.DOCUMENT_NODE)
node=node.parentNode;if(!node)
return null;node=node.elementFromPoint(this.pageX,this.pageY);while(node&&node.shadowRoot)
node=node.shadowRoot.elementFromPoint(this.pageX,this.pageY);return node;}
Event.prototype.deepActiveElement=function()
{var activeElement=this.target&&this.target.ownerDocument?this.target.ownerDocument.activeElement:null;while(activeElement&&activeElement.shadowRoot)
activeElement=activeElement.shadowRoot.activeElement;return activeElement;}
Document.prototype.deepElementFromPoint=function(x,y)
{var node=this.elementFromPoint(x,y);while(node&&node.shadowRoot)
node=node.shadowRoot.elementFromPoint(x,y);return node;}
function isEnterKey(event)
{return event.keyCode!==229&&event.keyIdentifier==="Enter";}
function isEscKey(event)
{return event.keyCode===27;}
function consumeEvent(e)
{e.consume();}
function runOnWindowLoad(callback)
{function windowLoaded()
{window.removeEventListener("DOMContentLoaded",windowLoaded,false);callback();}
if(document.readyState==="complete"||document.readyState==="interactive")
callback();else
window.addEventListener("DOMContentLoaded",windowLoaded,false);};var WorkerRuntime={};WorkerRuntime.startSharedWorker=function(moduleName,workerName)
{if(Runtime.isReleaseMode()){try{var worker=new SharedWorker(moduleName+"_module.js",workerName);return Promise.resolve(worker);}catch(e){return Promise.reject(e);}}
return loadResourcePromise(moduleName+"/module.json").then(start,start.bind(null,undefined));function start(content)
{if(!content)
throw new Error("Worker is not defined: "+moduleName+" "+new Error().stack);var scripts=JSON.parse(content)["scripts"];if(scripts.length!==1)
throw new Error("WorkerRuntime.startSharedWorker supports modules with only one script!");return new SharedWorker(moduleName+"/"+scripts[0],workerName);}}
WorkerRuntime.startWorker=function(moduleName)
{if(Runtime.isReleaseMode())
return Promise.resolve(new Worker(moduleName+"_module.js"));var loader=function(){self.onmessage=function(event){self.onmessage=null;var scripts=event.data;for(var i=0;i<scripts.length;++i){var source=scripts[i]["source"];self.eval(source+"\n//# sourceURL="+scripts[i]["url"]);}};};return loadResourcePromise(moduleName+"/module.json").then(start,start.bind(null,undefined));function start(content)
{if(!content)
throw new Error("Worker is not defined: "+moduleName+" "+new Error().stack);var message=[];var scripts=JSON.parse(content)["scripts"];var promise=Promise.resolve();for(var i=0;i<scripts.length;++i){var url=self._importScriptPathPrefix+moduleName+"/"+scripts[i];var parts=url.split("://");url=parts.length===1?url:parts[0]+"://"+normalizePath(parts[1]);promise=promise.then(promiseGetter(loadResourcePromise(moduleName+"/"+scripts[i]))).then(pushSource.bind(null,url),pushSource.bind(null,null,null));}
return promise.then(createWorker);function promiseGetter(promise)
{return function(){return promise;};}
function pushSource(url,source)
{if(!url){console.error("Failed to load "+url);return;}
message.push({source:source,url:url});}
function createWorker()
{var blob=new Blob(["("+loader.toString()+")()\n//# sourceURL="+moduleName],{type:"text/javascript"});var workerURL=window.URL.createObjectURL(blob);try{var worker=new Worker(workerURL);worker.postMessage(message);return worker;}finally{window.URL.revokeObjectURL(workerURL);}}}}
WorkerRuntime.Worker=function(moduleName,workerName)
{this._workerPromise=workerName?WorkerRuntime.startSharedWorker(moduleName,(workerName)):WorkerRuntime.startWorker(moduleName);}
WorkerRuntime.Worker.prototype={postMessage:function(message)
{this._workerPromise.then(postToWorker.bind(this));function postToWorker(worker)
{if(!this._disposed)
worker.postMessage(message);}},dispose:function()
{this._disposed=true;this._workerPromise.then(terminate);function terminate(worker)
{worker.terminate();}},terminate:function()
{this.dispose();},set onmessage(listener)
{this._workerPromise.then(setOnMessage);function setOnMessage(worker)
{worker.onmessage=listener;}},set onerror(listener)
{this._workerPromise.then(setOnError);function setOnError(worker)
{worker.onerror=listener;}},get port()
{return new WorkerRuntime.Worker.FuturePort(this);}}
WorkerRuntime.Worker.FuturePort=function(worker)
{this._worker=worker;}
WorkerRuntime.Worker.FuturePort.prototype={set onmessage(listener)
{this._worker._workerPromise.then(setOnMessage);function setOnMessage(worker)
{worker.port.onmessage=listener;}},set onerror(listener)
{this._worker._workerPromise.then(setOnError);function setOnError(worker)
{worker.port.onerror=listener;}}};self.WebInspector={};WebInspector.TextDictionary=function()
{this._words={};}
WebInspector.TextDictionary.prototype={addWord:function(word)
{if(!this._words[word])
this._words[word]=1;else
++this._words[word];},removeWord:function(word)
{if(!this._words[word])
return;if(this._words[word]===1)
delete this._words[word];else
--this._words[word];},wordsWithPrefix:function(prefix)
{var words=[];for(var i in this._words){if(i.startsWith(prefix))
words.push(i);}
return words;},hasWord:function(word)
{return!!this._words[word];},wordCount:function(word)
{return this._words[word]?this._words[word]:0;},reset:function()
{this._words={};}};WebInspector.Object=function(){}
WebInspector.Object.prototype={addEventListener:function(eventType,listener,thisObject)
{if(!listener)
console.assert(false);if(!this._listeners)
this._listeners=new Map();if(!this._listeners.has(eventType))
this._listeners.set(eventType,[]);this._listeners.get(eventType).push({thisObject:thisObject,listener:listener});return new WebInspector.EventTarget.EventDescriptor(this,eventType,thisObject,listener);},removeEventListener:function(eventType,listener,thisObject)
{console.assert(listener);if(!this._listeners||!this._listeners.has(eventType))
return;var listeners=this._listeners.get(eventType);for(var i=0;i<listeners.length;++i){if(listeners[i].listener===listener&&listeners[i].thisObject===thisObject)
listeners.splice(i--,1);}
if(!listeners.length)
this._listeners.delete(eventType);},removeAllListeners:function()
{delete this._listeners;},hasEventListeners:function(eventType)
{if(!this._listeners||!this._listeners.has(eventType))
return false;return true;},dispatchEventToListeners:function(eventType,eventData)
{if(!this._listeners||!this._listeners.has(eventType))
return false;var event=new WebInspector.Event(this,eventType,eventData);var listeners=this._listeners.get(eventType).slice(0);for(var i=0;i<listeners.length;++i){listeners[i].listener.call(listeners[i].thisObject,event);if(event._stoppedPropagation)
break;}
return event.defaultPrevented;}}
WebInspector.Event=function(target,type,data)
{this.target=target;this.type=type;this.data=data;this.defaultPrevented=false;this._stoppedPropagation=false;}
WebInspector.Event.prototype={stopPropagation:function()
{this._stoppedPropagation=true;},preventDefault:function()
{this.defaultPrevented=true;},consume:function(preventDefault)
{this.stopPropagation();if(preventDefault)
this.preventDefault();}}
WebInspector.EventTarget=function()
{}
WebInspector.EventTarget.removeEventListeners=function(eventList)
{for(var i=0;i<eventList.length;++i){var eventInfo=eventList[i];eventInfo.eventTarget.removeEventListener(eventInfo.eventType,eventInfo.method,eventInfo.receiver);}}
WebInspector.EventTarget.prototype={addEventListener:function(eventType,listener,thisObject){},removeEventListener:function(eventType,listener,thisObject){},removeAllListeners:function(){},hasEventListeners:function(eventType){},dispatchEventToListeners:function(eventType,eventData){},}
WebInspector.EventTarget.EventDescriptor=function(eventTarget,eventType,receiver,method)
{this.eventTarget=eventTarget;this.eventType=eventType;this.receiver=receiver;this.method=method;};WebInspector.NotificationService=function(){}
WebInspector.NotificationService.prototype={__proto__:WebInspector.Object.prototype}
WebInspector.NotificationService.Events={InspectorAgentEnabledForTests:"InspectorAgentEnabledForTests",SelectedNodeChanged:"SelectedNodeChanged"}
WebInspector.notifications=new WebInspector.NotificationService();;WebInspector.Color=function(rgba,format,originalText)
{this._rgba=rgba;this._originalText=originalText||null;this._originalTextIsValid=!!this._originalText;this._format=format;if(typeof this._rgba[3]==="undefined")
this._rgba[3]=1;for(var i=0;i<4;++i){if(this._rgba[i]<0){this._rgba[i]=0;this._originalTextIsValid=false;}
if(this._rgba[i]>1){this._rgba[i]=1;this._originalTextIsValid=false;}}}
WebInspector.Color.Format={Original:"original",Nickname:"nickname",HEX:"hex",ShortHEX:"shorthex",RGB:"rgb",RGBA:"rgba",HSL:"hsl",HSLA:"hsla"}
WebInspector.Color.parse=function(text)
{var value=text.toLowerCase().replace(/\s+/g,"");var simple=/^(?:#([0-9a-f]{3}|[0-9a-f]{6})|rgb\(((?:-?\d+%?,){2}-?\d+%?)\)|(\w+)|hsl\((-?\d+\.?\d*(?:,-?\d+\.?\d*%){2})\))$/i;var match=value.match(simple);if(match){if(match[1]){var hex=match[1].toUpperCase();var format;if(hex.length===3){format=WebInspector.Color.Format.ShortHEX;hex=hex.charAt(0)+hex.charAt(0)+hex.charAt(1)+hex.charAt(1)+hex.charAt(2)+hex.charAt(2);}else
format=WebInspector.Color.Format.HEX;var r=parseInt(hex.substring(0,2),16);var g=parseInt(hex.substring(2,4),16);var b=parseInt(hex.substring(4,6),16);return new WebInspector.Color([r/255,g/255,b/255,1],format,text);}
if(match[2]){var rgbString=match[2].split(/\s*,\s*/);var rgba=[WebInspector.Color._parseRgbNumeric(rgbString[0]),WebInspector.Color._parseRgbNumeric(rgbString[1]),WebInspector.Color._parseRgbNumeric(rgbString[2]),1];return new WebInspector.Color(rgba,WebInspector.Color.Format.RGB,text);}
if(match[3]){var nickname=match[3].toLowerCase();if(nickname in WebInspector.Color.Nicknames){var rgba=WebInspector.Color.Nicknames[nickname];var color=WebInspector.Color.fromRGBA(rgba);color._format=WebInspector.Color.Format.Nickname;color._originalText=text;return color;}
return null;}
if(match[4]){var hslString=match[4].replace(/%/g,"").split(/\s*,\s*/);var hsla=[WebInspector.Color._parseHueNumeric(hslString[0]),WebInspector.Color._parseSatLightNumeric(hslString[1]),WebInspector.Color._parseSatLightNumeric(hslString[2]),1];var rgba=[];WebInspector.Color.hsl2rgb(hsla,rgba);return new WebInspector.Color(rgba,WebInspector.Color.Format.HSL,text);}
return null;}
var advanced=/^(?:rgba\(((?:-?\d+%?,){3}-?(?:\d+|\d*\.\d+))\)|hsla\((-?(?:\d+|\d*\.\d+)(?:,-?(?:\d+|\d*\.\d+)*%){2},-?(?:\d+|\d*\.\d+))\))$/;match=value.match(advanced);if(match){if(match[1]){var rgbaString=match[1].split(/\s*,\s*/);var rgba=[WebInspector.Color._parseRgbNumeric(rgbaString[0]),WebInspector.Color._parseRgbNumeric(rgbaString[1]),WebInspector.Color._parseRgbNumeric(rgbaString[2]),WebInspector.Color._parseAlphaNumeric(rgbaString[3])];return new WebInspector.Color(rgba,WebInspector.Color.Format.RGBA,text);}
if(match[2]){var hslaString=match[2].replace(/%/g,"").split(/\s*,\s*/);var hsla=[WebInspector.Color._parseHueNumeric(hslaString[0]),WebInspector.Color._parseSatLightNumeric(hslaString[1]),WebInspector.Color._parseSatLightNumeric(hslaString[2]),WebInspector.Color._parseAlphaNumeric(hslaString[3])];var rgba=[];WebInspector.Color.hsl2rgb(hsla,rgba);return new WebInspector.Color(rgba,WebInspector.Color.Format.HSLA,text);}}
return null;}
WebInspector.Color.fromRGBA=function(rgba)
{return new WebInspector.Color([rgba[0]/255,rgba[1]/255,rgba[2]/255,rgba[3]],WebInspector.Color.Format.RGBA);}
WebInspector.Color.fromHSVA=function(hsva)
{var rgba=[];WebInspector.Color.hsva2rgba(hsva,rgba);return new WebInspector.Color(rgba,WebInspector.Color.Format.HSLA);}
WebInspector.Color.prototype={format:function()
{return this._format;},hsla:function()
{if(this._hsla)
return this._hsla;var r=this._rgba[0];var g=this._rgba[1];var b=this._rgba[2];var max=Math.max(r,g,b);var min=Math.min(r,g,b);var diff=max-min;var add=max+min;if(min===max)
var h=0;else if(r===max)
var h=((1/6*(g-b)/diff)+1)%1;else if(g===max)
var h=(1/6*(b-r)/diff)+1/3;else
var h=(1/6*(r-g)/diff)+2/3;var l=0.5*add;if(l===0)
var s=0;else if(l===1)
var s=0;else if(l<=0.5)
var s=diff/add;else
var s=diff/(2-add);this._hsla=[h,s,l,this._rgba[3]];return this._hsla;},canonicalHSLA:function()
{var hsla=this.hsla();return[Math.round(hsla[0]*360),Math.round(hsla[1]*100),Math.round(hsla[2]*100),hsla[3]];},hsva:function()
{var hsla=this.hsla();var h=hsla[0];var s=hsla[1];var l=hsla[2];s*=l<0.5?l:1-l;return[h,s!==0?2*s/(l+s):0,(l+s),hsla[3]];},hasAlpha:function()
{return this._rgba[3]!==1;},canBeShortHex:function()
{if(this.hasAlpha())
return false;for(var i=0;i<3;++i){var c=Math.round(this._rgba[i]*255);if(c%17)
return false;}
return true;},asString:function(format)
{if(format===this._format&&this._originalTextIsValid)
return this._originalText;if(!format)
format=this._format;function toRgbValue(value)
{return Math.round(value*255);}
function toHexValue(value)
{var hex=Math.round(value*255).toString(16);return hex.length===1?"0"+hex:hex;}
function toShortHexValue(value)
{return(Math.round(value*255)/17).toString(16);}
switch(format){case WebInspector.Color.Format.Original:return this._originalText;case WebInspector.Color.Format.RGB:if(this.hasAlpha())
return null;return String.sprintf("rgb(%d, %d, %d)",toRgbValue(this._rgba[0]),toRgbValue(this._rgba[1]),toRgbValue(this._rgba[2]));case WebInspector.Color.Format.RGBA:return String.sprintf("rgba(%d, %d, %d, %f)",toRgbValue(this._rgba[0]),toRgbValue(this._rgba[1]),toRgbValue(this._rgba[2]),this._rgba[3]);case WebInspector.Color.Format.HSL:if(this.hasAlpha())
return null;var hsl=this.hsla();return String.sprintf("hsl(%d, %d%, %d%)",Math.round(hsl[0]*360),Math.round(hsl[1]*100),Math.round(hsl[2]*100));case WebInspector.Color.Format.HSLA:var hsla=this.hsla();return String.sprintf("hsla(%d, %d%, %d%, %f)",Math.round(hsla[0]*360),Math.round(hsla[1]*100),Math.round(hsla[2]*100),hsla[3]);case WebInspector.Color.Format.HEX:if(this.hasAlpha())
return null;return String.sprintf("#%s%s%s",toHexValue(this._rgba[0]),toHexValue(this._rgba[1]),toHexValue(this._rgba[2])).toUpperCase();case WebInspector.Color.Format.ShortHEX:if(!this.canBeShortHex())
return null;return String.sprintf("#%s%s%s",toShortHexValue(this._rgba[0]),toShortHexValue(this._rgba[1]),toShortHexValue(this._rgba[2])).toUpperCase();case WebInspector.Color.Format.Nickname:return this.nickname();}
return this._originalText;},rgba:function()
{return this._rgba.slice();},canonicalRGBA:function()
{var rgba=new Array(4);for(var i=0;i<3;++i)
rgba[i]=Math.round(this._rgba[i]*255);rgba[3]=this._rgba[3];return rgba;},nickname:function()
{if(!WebInspector.Color._rgbaToNickname){WebInspector.Color._rgbaToNickname={};for(var nickname in WebInspector.Color.Nicknames){var rgba=WebInspector.Color.Nicknames[nickname];if(rgba.length!==4)
rgba=rgba.concat(1);WebInspector.Color._rgbaToNickname[rgba]=nickname;}}
return WebInspector.Color._rgbaToNickname[this.canonicalRGBA()]||null;},toProtocolRGBA:function()
{var rgba=this.canonicalRGBA();var result={r:rgba[0],g:rgba[1],b:rgba[2]};if(rgba[3]!==1)
result.a=rgba[3];return result;},invert:function()
{var rgba=[];rgba[0]=1-this._rgba[0];rgba[1]=1-this._rgba[1];rgba[2]=1-this._rgba[2];rgba[3]=this._rgba[3];return new WebInspector.Color(rgba,WebInspector.Color.Format.RGBA);},setAlpha:function(alpha)
{var rgba=this._rgba.slice();rgba[3]=alpha;return new WebInspector.Color(rgba,WebInspector.Color.Format.RGBA);}}
WebInspector.Color._parseRgbNumeric=function(value)
{var parsed=parseInt(value,10);if(value.indexOf("%")!==-1)
parsed/=100;else
parsed/=255;return parsed;}
WebInspector.Color._parseHueNumeric=function(value)
{return isNaN(value)?0:(parseFloat(value)/360)%1;}
WebInspector.Color._parseSatLightNumeric=function(value)
{return Math.min(1,parseFloat(value)/100);}
WebInspector.Color._parseAlphaNumeric=function(value)
{return isNaN(value)?0:parseFloat(value);}
WebInspector.Color._hsva2hsla=function(hsva,out_hsla)
{var h=hsva[0];var s=hsva[1];var v=hsva[2];var t=(2-s)*v;if(v===0||s===0)
s=0;else
s*=v/(t<1?t:2-t);out_hsla[0]=h;out_hsla[1]=s;out_hsla[2]=t/2;out_hsla[3]=hsva[3];}
WebInspector.Color.hsl2rgb=function(hsl,out_rgb)
{var h=hsl[0];var s=hsl[1];var l=hsl[2];function hue2rgb(p,q,h)
{if(h<0)
h+=1;else if(h>1)
h-=1;if((h*6)<1)
return p+(q-p)*h*6;else if((h*2)<1)
return q;else if((h*3)<2)
return p+(q-p)*((2/3)-h)*6;else
return p;}
if(s<0)
s=0;if(l<=0.5)
var q=l*(1+s);else
var q=l+s-(l*s);var p=2*l-q;var tr=h+(1/3);var tg=h;var tb=h-(1/3);out_rgb[0]=hue2rgb(p,q,tr);out_rgb[1]=hue2rgb(p,q,tg);out_rgb[2]=hue2rgb(p,q,tb);out_rgb[3]=hsl[3];}
WebInspector.Color.hsva2rgba=function(hsva,out_rgba)
{WebInspector.Color._hsva2hsla(hsva,WebInspector.Color.hsva2rgba._tmpHSLA);WebInspector.Color.hsl2rgb(WebInspector.Color.hsva2rgba._tmpHSLA,out_rgba);for(var i=0;i<WebInspector.Color.hsva2rgba._tmpHSLA.length;i++)
WebInspector.Color.hsva2rgba._tmpHSLA[i]=0;};WebInspector.Color.hsva2rgba._tmpHSLA=[0,0,0,0];WebInspector.Color.luminance=function(rgba)
{var rSRGB=rgba[0];var gSRGB=rgba[1];var bSRGB=rgba[2];var r=rSRGB<=0.03928?rSRGB/12.92:Math.pow(((rSRGB+0.055)/1.055),2.4);var g=gSRGB<=0.03928?gSRGB/12.92:Math.pow(((gSRGB+0.055)/1.055),2.4);var b=bSRGB<=0.03928?bSRGB/12.92:Math.pow(((bSRGB+0.055)/1.055),2.4);return 0.2126*r+0.7152*g+0.0722*b;}
WebInspector.Color.blendColors=function(fgRGBA,bgRGBA,out_blended)
{var alpha=fgRGBA[3];out_blended[0]=((1-alpha)*bgRGBA[0])+(alpha*fgRGBA[0]);out_blended[1]=((1-alpha)*bgRGBA[1])+(alpha*fgRGBA[1]);out_blended[2]=((1-alpha)*bgRGBA[2])+(alpha*fgRGBA[2]);out_blended[3]=alpha+(bgRGBA[3]*(1-alpha));}
WebInspector.Color.calculateContrastRatio=function(fgRGBA,bgRGBA)
{WebInspector.Color.blendColors(fgRGBA,bgRGBA,WebInspector.Color.calculateContrastRatio._blendedFg);var fgLuminance=WebInspector.Color.luminance(WebInspector.Color.calculateContrastRatio._blendedFg);var bgLuminance=WebInspector.Color.luminance(bgRGBA);var contrastRatio=(Math.max(fgLuminance,bgLuminance)+0.05)/(Math.min(fgLuminance,bgLuminance)+0.05);for(var i=0;i<WebInspector.Color.calculateContrastRatio._blendedFg.length;i++)
WebInspector.Color.calculateContrastRatio._blendedFg[i]=0;return contrastRatio;}
WebInspector.Color.calculateContrastRatio._blendedFg=[0,0,0,0];WebInspector.Color.desiredLuminance=function(luminance,contrast,lighter)
{function computeLuminance()
{if(lighter)
return(luminance+0.05)*contrast-0.05;else
return(luminance+0.05)/contrast-0.05;}
var desiredLuminance=computeLuminance();if(desiredLuminance<0||desiredLuminance>1){lighter=!lighter;desiredLuminance=computeLuminance();}
return desiredLuminance;};WebInspector.Color.Nicknames={"aliceblue":[240,248,255],"antiquewhite":[250,235,215],"aqua":[0,255,255],"aquamarine":[127,255,212],"azure":[240,255,255],"beige":[245,245,220],"bisque":[255,228,196],"black":[0,0,0],"blanchedalmond":[255,235,205],"blue":[0,0,255],"blueviolet":[138,43,226],"brown":[165,42,42],"burlywood":[222,184,135],"cadetblue":[95,158,160],"chartreuse":[127,255,0],"chocolate":[210,105,30],"coral":[255,127,80],"cornflowerblue":[100,149,237],"cornsilk":[255,248,220],"crimson":[237,20,61],"cyan":[0,255,255],"darkblue":[0,0,139],"darkcyan":[0,139,139],"darkgoldenrod":[184,134,11],"darkgray":[169,169,169],"darkgrey":[169,169,169],"darkgreen":[0,100,0],"darkkhaki":[189,183,107],"darkmagenta":[139,0,139],"darkolivegreen":[85,107,47],"darkorange":[255,140,0],"darkorchid":[153,50,204],"darkred":[139,0,0],"darksalmon":[233,150,122],"darkseagreen":[143,188,143],"darkslateblue":[72,61,139],"darkslategray":[47,79,79],"darkslategrey":[47,79,79],"darkturquoise":[0,206,209],"darkviolet":[148,0,211],"deeppink":[255,20,147],"deepskyblue":[0,191,255],"dimgray":[105,105,105],"dimgrey":[105,105,105],"dodgerblue":[30,144,255],"firebrick":[178,34,34],"floralwhite":[255,250,240],"forestgreen":[34,139,34],"fuchsia":[255,0,255],"gainsboro":[220,220,220],"ghostwhite":[248,248,255],"gold":[255,215,0],"goldenrod":[218,165,32],"gray":[128,128,128],"grey":[128,128,128],"green":[0,128,0],"greenyellow":[173,255,47],"honeydew":[240,255,240],"hotpink":[255,105,180],"indianred":[205,92,92],"indigo":[75,0,130],"ivory":[255,255,240],"khaki":[240,230,140],"lavender":[230,230,250],"lavenderblush":[255,240,245],"lawngreen":[124,252,0],"lemonchiffon":[255,250,205],"lightblue":[173,216,230],"lightcoral":[240,128,128],"lightcyan":[224,255,255],"lightgoldenrodyellow":[250,250,210],"lightgreen":[144,238,144],"lightgray":[211,211,211],"lightgrey":[211,211,211],"lightpink":[255,182,193],"lightsalmon":[255,160,122],"lightseagreen":[32,178,170],"lightskyblue":[135,206,250],"lightslategray":[119,136,153],"lightslategrey":[119,136,153],"lightsteelblue":[176,196,222],"lightyellow":[255,255,224],"lime":[0,255,0],"limegreen":[50,205,50],"linen":[250,240,230],"magenta":[255,0,255],"maroon":[128,0,0],"mediumaquamarine":[102,205,170],"mediumblue":[0,0,205],"mediumorchid":[186,85,211],"mediumpurple":[147,112,219],"mediumseagreen":[60,179,113],"mediumslateblue":[123,104,238],"mediumspringgreen":[0,250,154],"mediumturquoise":[72,209,204],"mediumvioletred":[199,21,133],"midnightblue":[25,25,112],"mintcream":[245,255,250],"mistyrose":[255,228,225],"moccasin":[255,228,181],"navajowhite":[255,222,173],"navy":[0,0,128],"oldlace":[253,245,230],"olive":[128,128,0],"olivedrab":[107,142,35],"orange":[255,165,0],"orangered":[255,69,0],"orchid":[218,112,214],"palegoldenrod":[238,232,170],"palegreen":[152,251,152],"paleturquoise":[175,238,238],"palevioletred":[219,112,147],"papayawhip":[255,239,213],"peachpuff":[255,218,185],"peru":[205,133,63],"pink":[255,192,203],"plum":[221,160,221],"powderblue":[176,224,230],"purple":[128,0,128],"rebeccapurple":[102,51,153],"red":[255,0,0],"rosybrown":[188,143,143],"royalblue":[65,105,225],"saddlebrown":[139,69,19],"salmon":[250,128,114],"sandybrown":[244,164,96],"seagreen":[46,139,87],"seashell":[255,245,238],"sienna":[160,82,45],"silver":[192,192,192],"skyblue":[135,206,235],"slateblue":[106,90,205],"slategray":[112,128,144],"slategrey":[112,128,144],"snow":[255,250,250],"springgreen":[0,255,127],"steelblue":[70,130,180],"tan":[210,180,140],"teal":[0,128,128],"thistle":[216,191,216],"tomato":[255,99,71],"turquoise":[64,224,208],"violet":[238,130,238],"wheat":[245,222,179],"white":[255,255,255],"whitesmoke":[245,245,245],"yellow":[255,255,0],"yellowgreen":[154,205,50],"transparent":[0,0,0,0],};WebInspector.Color.PageHighlight={Content:WebInspector.Color.fromRGBA([111,168,220,.66]),ContentLight:WebInspector.Color.fromRGBA([111,168,220,.5]),ContentOutline:WebInspector.Color.fromRGBA([9,83,148]),Padding:WebInspector.Color.fromRGBA([147,196,125,.55]),PaddingLight:WebInspector.Color.fromRGBA([147,196,125,.4]),Border:WebInspector.Color.fromRGBA([255,229,153,.66]),BorderLight:WebInspector.Color.fromRGBA([255,229,153,.5]),Margin:WebInspector.Color.fromRGBA([246,178,107,.66]),MarginLight:WebInspector.Color.fromRGBA([246,178,107,.5]),EventTarget:WebInspector.Color.fromRGBA([255,196,196,.66]),Shape:WebInspector.Color.fromRGBA([96,82,177,0.8]),ShapeMargin:WebInspector.Color.fromRGBA([96,82,127,.6])}
WebInspector.Color.detectColorFormat=function(color)
{const cf=WebInspector.Color.Format;var format;var formatSetting=WebInspector.moduleSetting("colorFormat").get();if(formatSetting===cf.Original)
format=cf.Original;else if(formatSetting===cf.RGB)
format=(color.hasAlpha()?cf.RGBA:cf.RGB);else if(formatSetting===cf.HSL)
format=(color.hasAlpha()?cf.HSLA:cf.HSL);else if(!color.hasAlpha())
format=(color.canBeShortHex()?cf.ShortHEX:cf.HEX);else
format=cf.RGBA;return format;};WebInspector.Geometry={};WebInspector.Geometry._Eps=1e-5;WebInspector.Geometry.Vector=function(x,y,z)
{this.x=x;this.y=y;this.z=z;}
WebInspector.Geometry.Vector.prototype={length:function()
{return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);},normalize:function()
{var length=this.length();if(length<=WebInspector.Geometry._Eps)
return;this.x/=length;this.y/=length;this.z/=length;}}
WebInspector.Geometry.Point=function(x,y){this.x=x;this.y=y;}
WebInspector.Geometry.Point.prototype={distanceTo:function(p)
{return Math.sqrt(Math.pow(p.x-this.x,2)+Math.pow(p.y-this.y,2));},toString:function()
{return Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100;}}
WebInspector.Geometry.CubicBezier=function(point1,point2)
{this.controlPoints=[point1,point2];}
WebInspector.Geometry.CubicBezier.KeywordValues={"linear":"cubic-bezier(0, 0, 1, 1)","ease":"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)"}
WebInspector.Geometry.CubicBezier.parse=function(text)
{var keywordValues=WebInspector.Geometry.CubicBezier.KeywordValues;var value=text.toLowerCase().replace(/\s+/g,"");if(Object.keys(keywordValues).indexOf(value)!=-1)
return WebInspector.Geometry.CubicBezier.parse(keywordValues[value]);var bezierRegex=/^cubic-bezier\(([^,]+),([^,]+),([^,]+),([^,]+)\)$/;var match=value.match(bezierRegex);if(match){var control1=new WebInspector.Geometry.Point(parseFloat(match[1]),parseFloat(match[2]));var control2=new WebInspector.Geometry.Point(parseFloat(match[3]),parseFloat(match[4]));return new WebInspector.Geometry.CubicBezier(control1,control2);}
return null;}
WebInspector.Geometry.CubicBezier.prototype={evaluateAt:function(t)
{function evaluate(v1,v2,t)
{return 3*(1-t)*(1-t)*t*v1+3*(1-t)*t*t*v2+Math.pow(t,3);}
var x=evaluate(this.controlPoints[0].x,this.controlPoints[1].x,t);var y=evaluate(this.controlPoints[0].y,this.controlPoints[1].y,t);return new WebInspector.Geometry.Point(x,y);},asCSSText:function()
{var raw="cubic-bezier("+this.controlPoints.join(", ")+")";var keywordValues=WebInspector.Geometry.CubicBezier.KeywordValues;for(var keyword in keywordValues){if(raw===keywordValues[keyword])
return keyword;}
return raw;}}
WebInspector.Geometry.EulerAngles=function(alpha,beta,gamma)
{this.alpha=alpha;this.beta=beta;this.gamma=gamma;}
WebInspector.Geometry.EulerAngles.fromRotationMatrix=function(rotationMatrix)
{var beta=Math.atan2(rotationMatrix.m23,rotationMatrix.m33);var gamma=Math.atan2(-rotationMatrix.m13,Math.sqrt(rotationMatrix.m11*rotationMatrix.m11+rotationMatrix.m12*rotationMatrix.m12));var alpha=Math.atan2(rotationMatrix.m12,rotationMatrix.m11);return new WebInspector.Geometry.EulerAngles(WebInspector.Geometry.radToDeg(alpha),WebInspector.Geometry.radToDeg(beta),WebInspector.Geometry.radToDeg(gamma));}
WebInspector.Geometry.scalarProduct=function(u,v)
{return u.x*v.x+u.y*v.y+u.z*v.z;}
WebInspector.Geometry.crossProduct=function(u,v)
{var x=u.y*v.z-u.z*v.y;var y=u.z*v.x-u.x*v.z;var z=u.x*v.y-u.y*v.x;return new WebInspector.Geometry.Vector(x,y,z);}
WebInspector.Geometry.subtract=function(u,v)
{var x=u.x-v.x;var y=u.y-v.y;var z=u.z-v.z;return new WebInspector.Geometry.Vector(x,y,z);}
WebInspector.Geometry.multiplyVectorByMatrixAndNormalize=function(v,m)
{var t=v.x*m.m14+v.y*m.m24+v.z*m.m34+m.m44;var x=(v.x*m.m11+v.y*m.m21+v.z*m.m31+m.m41)/t;var y=(v.x*m.m12+v.y*m.m22+v.z*m.m32+m.m42)/t;var z=(v.x*m.m13+v.y*m.m23+v.z*m.m33+m.m43)/t;return new WebInspector.Geometry.Vector(x,y,z);}
WebInspector.Geometry.calculateAngle=function(u,v)
{var uLength=u.length();var vLength=v.length();if(uLength<=WebInspector.Geometry._Eps||vLength<=WebInspector.Geometry._Eps)
return 0;var cos=WebInspector.Geometry.scalarProduct(u,v)/uLength/vLength;if(Math.abs(cos)>1)
return 0;return WebInspector.Geometry.radToDeg(Math.acos(cos));}
WebInspector.Geometry.radToDeg=function(rad)
{return rad*180/Math.PI;}
WebInspector.Geometry.boundsForTransformedPoints=function(matrix,points,aggregateBounds)
{if(!aggregateBounds)
aggregateBounds={minX:Infinity,maxX:-Infinity,minY:Infinity,maxY:-Infinity};if(points.length%3)
console.assert("Invalid size of points array");for(var p=0;p<points.length;p+=3){var vector=new WebInspector.Geometry.Vector(points[p],points[p+1],points[p+2]);vector=WebInspector.Geometry.multiplyVectorByMatrixAndNormalize(vector,matrix);aggregateBounds.minX=Math.min(aggregateBounds.minX,vector.x);aggregateBounds.maxX=Math.max(aggregateBounds.maxX,vector.x);aggregateBounds.minY=Math.min(aggregateBounds.minY,vector.y);aggregateBounds.maxY=Math.max(aggregateBounds.maxY,vector.y);}
return aggregateBounds;}
function Size(width,height)
{this.width=width;this.height=height;}
Size.prototype.isEqual=function(size)
{return!!size&&this.width===size.width&&this.height===size.height;};Size.prototype.widthToMax=function(size)
{return new Size(Math.max(this.width,(typeof size==="number"?size:size.width)),this.height);};Size.prototype.addWidth=function(size)
{return new Size(this.width+(typeof size==="number"?size:size.width),this.height);};Size.prototype.heightToMax=function(size)
{return new Size(this.width,Math.max(this.height,(typeof size==="number"?size:size.height)));};Size.prototype.addHeight=function(size)
{return new Size(this.width,this.height+(typeof size==="number"?size:size.height));};function Insets(left,top,right,bottom)
{this.left=left;this.top=top;this.right=right;this.bottom=bottom;}
Insets.prototype={isEqual:function(insets)
{return!!insets&&this.left===insets.left&&this.top===insets.top&&this.right==insets.right&&this.bottom==insets.bottom;}}
WebInspector.Rect=function(left,top,width,height)
{this.left=left;this.top=top;this.width=width;this.height=height;}
WebInspector.Rect.prototype={isEqual:function(rect)
{return!!rect&&this.left===rect.left&&this.top===rect.top&&this.width==rect.width&&this.height==rect.height;},scale:function(scale)
{return new WebInspector.Rect(this.left*scale,this.top*scale,this.width*scale,this.height*scale);},size:function()
{return new Size(this.width,this.height);}}
function Constraints(minimum,preferred)
{this.minimum=minimum||new Size(0,0);this.preferred=preferred||this.minimum;if(this.minimum.width>this.preferred.width||this.minimum.height>this.preferred.height)
throw new Error("Minimum size is greater than preferred.");}
Constraints.prototype.isEqual=function(constraints)
{return!!constraints&&this.minimum.isEqual(constraints.minimum)&&this.preferred.isEqual(constraints.preferred);}
Constraints.prototype.widthToMax=function(value)
{if(typeof value==="number")
return new Constraints(this.minimum.widthToMax(value),this.preferred.widthToMax(value));return new Constraints(this.minimum.widthToMax(value.minimum),this.preferred.widthToMax(value.preferred));}
Constraints.prototype.addWidth=function(value)
{if(typeof value==="number")
return new Constraints(this.minimum.addWidth(value),this.preferred.addWidth(value));return new Constraints(this.minimum.addWidth(value.minimum),this.preferred.addWidth(value.preferred));}
Constraints.prototype.heightToMax=function(value)
{if(typeof value==="number")
return new Constraints(this.minimum.heightToMax(value),this.preferred.heightToMax(value));return new Constraints(this.minimum.heightToMax(value.minimum),this.preferred.heightToMax(value.preferred));}
Constraints.prototype.addHeight=function(value)
{if(typeof value==="number")
return new Constraints(this.minimum.addHeight(value),this.preferred.addHeight(value));return new Constraints(this.minimum.addHeight(value.minimum),this.preferred.addHeight(value.preferred));};WebInspector.Console=function()
{this._messages=[];}
WebInspector.Console.Events={MessageAdded:"messageAdded"}
WebInspector.Console.MessageLevel={Log:"log",Warning:"warning",Error:"error"}
WebInspector.Console.Message=function(text,level,timestamp,show)
{this.text=text;this.level=level;this.timestamp=(typeof timestamp==="number")?timestamp:Date.now();this.show=show;}
WebInspector.Console.UIDelegate=function()
{}
WebInspector.Console.UIDelegate.prototype={showConsole:function(){}}
WebInspector.Console.prototype={setUIDelegate:function(uiDelegate)
{this._uiDelegate=uiDelegate;},addMessage:function(text,level,show)
{var message=new WebInspector.Console.Message(text,level||WebInspector.Console.MessageLevel.Log,Date.now(),show||false);this._messages.push(message);this.dispatchEventToListeners(WebInspector.Console.Events.MessageAdded,message);},log:function(text)
{this.addMessage(text,WebInspector.Console.MessageLevel.Log);},warn:function(text)
{this.addMessage(text,WebInspector.Console.MessageLevel.Warning);},error:function(text)
{this.addMessage(text,WebInspector.Console.MessageLevel.Error,true);},messages:function()
{return this._messages;},show:function()
{this.showPromise();},showPromise:function()
{if(this._uiDelegate)
return this._uiDelegate.showConsole();return Promise.reject();},__proto__:WebInspector.Object.prototype}
WebInspector.console=new WebInspector.Console();;WebInspector.ContentProvider=function(){}
WebInspector.ContentProvider.prototype={contentURL:function(){},contentType:function(){},requestContent:function(callback){},searchInContent:function(query,caseSensitive,isRegex,callback){}}
WebInspector.ContentProvider.SearchMatch=function(lineNumber,lineContent){this.lineNumber=lineNumber;this.lineContent=lineContent;}
WebInspector.ContentProvider.performSearchInContent=function(content,query,caseSensitive,isRegex)
{var regex=createSearchRegex(query,caseSensitive,isRegex);var contentString=new String(content);var result=[];for(var i=0;i<contentString.lineCount();++i){var lineContent=contentString.lineAt(i);regex.lastIndex=0;if(regex.exec(lineContent))
result.push(new WebInspector.ContentProvider.SearchMatch(i,lineContent));}
return result;};WebInspector.ParsedURL=function(url)
{this.isValid=false;this.url=url;this.scheme="";this.host="";this.port="";this.path="";this.queryParams="";this.fragment="";this.folderPathComponents="";this.lastPathComponent="";var match=url.match(/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^\s\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i);if(match){this.isValid=true;this.scheme=match[1].toLowerCase();this.host=match[2];this.port=match[3];this.path=match[4]||"/";this.fragment=match[5];}else{if(this.url.startsWith("data:")){this.scheme="data";return;}
if(this.url==="about:blank"){this.scheme="about";return;}
this.path=this.url;}
var path=this.path;var indexOfQuery=path.indexOf("?");if(indexOfQuery!==-1){this.queryParams=path.substring(indexOfQuery+1);path=path.substring(0,indexOfQuery);}
var lastSlashIndex=path.lastIndexOf("/");if(lastSlashIndex!==-1){this.folderPathComponents=path.substring(0,lastSlashIndex);this.lastPathComponent=path.substring(lastSlashIndex+1);}else
this.lastPathComponent=path;}
WebInspector.ParsedURL.splitURLIntoPathComponents=function(url)
{var parsedURL=new WebInspector.ParsedURL(url);var origin;var folderPath;var name;if(parsedURL.isValid){origin=parsedURL.scheme+"://"+parsedURL.host;if(parsedURL.port)
origin+=":"+parsedURL.port;folderPath=parsedURL.folderPathComponents;name=parsedURL.lastPathComponent;if(parsedURL.queryParams)
name+="?"+parsedURL.queryParams;}else{origin="";folderPath="";name=url;}
var result=[origin];var splittedPath=folderPath.split("/");for(var i=1;i<splittedPath.length;++i){if(!splittedPath[i])
continue;result.push(splittedPath[i]);}
result.push(name);return result;}
WebInspector.ParsedURL.extractOrigin=function(url)
{var parsedURL=new WebInspector.ParsedURL(url);if(!parsedURL.isValid)
return"";var origin=parsedURL.scheme+"://"+parsedURL.host;if(parsedURL.port)
origin+=":"+parsedURL.port;return origin;}
WebInspector.ParsedURL.completeURL=function(baseURL,href)
{if(href){var trimmedHref=href.trim();if(trimmedHref.startsWith("data:")||trimmedHref.startsWith("blob:")||trimmedHref.startsWith("javascript:"))
return href;var parsedHref=trimmedHref.asParsedURL();if(parsedHref&&parsedHref.scheme)
return trimmedHref;}else{return baseURL;}
var parsedURL=baseURL.asParsedURL();if(parsedURL){if(parsedURL.isDataURL())
return href;var path=href;var query=path.indexOf("?");var postfix="";if(query!==-1){postfix=path.substring(query);path=path.substring(0,query);}else{var fragment=path.indexOf("#");if(fragment!==-1){postfix=path.substring(fragment);path=path.substring(0,fragment);}}
if(!path){var basePath=parsedURL.path;if(postfix.charAt(0)==="?"){var baseQuery=parsedURL.path.indexOf("?");if(baseQuery!==-1)
basePath=basePath.substring(0,baseQuery);}
return parsedURL.scheme+"://"+parsedURL.host+(parsedURL.port?(":"+parsedURL.port):"")+basePath+postfix;}else if(path.charAt(0)!=="/"){var prefix=parsedURL.path;var prefixQuery=prefix.indexOf("?");if(prefixQuery!==-1)
prefix=prefix.substring(0,prefixQuery);prefix=prefix.substring(0,prefix.lastIndexOf("/"))+"/";path=prefix+path;}else if(path.length>1&&path.charAt(1)==="/"){return parsedURL.scheme+":"+path+postfix;}
return parsedURL.scheme+"://"+parsedURL.host+(parsedURL.port?(":"+parsedURL.port):"")+normalizePath(path)+postfix;}
return null;}
WebInspector.ParsedURL.prototype={get displayName()
{if(this._displayName)
return this._displayName;if(this.isDataURL())
return this.dataURLDisplayName();if(this.isAboutBlank())
return this.url;this._displayName=this.lastPathComponent;if(!this._displayName)
this._displayName=(this.host||"")+"/";if(this._displayName==="/")
this._displayName=this.url;return this._displayName;},dataURLDisplayName:function()
{if(this._dataURLDisplayName)
return this._dataURLDisplayName;if(!this.isDataURL())
return"";this._dataURLDisplayName=this.url.trimEnd(20);return this._dataURLDisplayName;},isAboutBlank:function()
{return this.url==="about:blank";},isDataURL:function()
{return this.scheme==="data";},lastPathComponentWithFragment:function()
{return this.lastPathComponent+(this.fragment?"#"+this.fragment:"");},domain:function()
{return this.host+(this.port?":"+this.port:"");},urlWithoutScheme:function()
{if(this.scheme&&this.url.startsWith(this.scheme+"://"))
return this.url.substring(this.scheme.length+3);return this.url;},}
WebInspector.ParsedURL.splitLineAndColumn=function(string)
{var lineColumnRegEx=/(?::(\d+))?(?::(\d+))?$/;var lineColumnMatch=lineColumnRegEx.exec(string);var lineNumber;var columnNumber;console.assert(lineColumnMatch);if(typeof(lineColumnMatch[1])==="string"){lineNumber=parseInt(lineColumnMatch[1],10);lineNumber=isNaN(lineNumber)?undefined:lineNumber-1;}
if(typeof(lineColumnMatch[2])==="string"){columnNumber=parseInt(lineColumnMatch[2],10);columnNumber=isNaN(columnNumber)?undefined:columnNumber-1;}
return{url:string.substring(0,string.length-lineColumnMatch[0].length),lineNumber:lineNumber,columnNumber:columnNumber};}
String.prototype.asParsedURL=function()
{var parsedURL=new WebInspector.ParsedURL(this.toString());if(parsedURL.isValid)
return parsedURL;return null;};WebInspector.Progress=function()
{}
WebInspector.Progress.prototype={setTotalWork:function(totalWork){},setTitle:function(title){},setWorked:function(worked,title){},worked:function(worked){},done:function(){},isCanceled:function(){return false;},}
WebInspector.CompositeProgress=function(parent)
{this._parent=parent;this._children=[];this._childrenDone=0;this._parent.setTotalWork(1);this._parent.setWorked(0);}
WebInspector.CompositeProgress.prototype={_childDone:function()
{if(++this._childrenDone!==this._children.length)
return;this._parent.done();},createSubProgress:function(weight)
{var child=new WebInspector.SubProgress(this,weight);this._children.push(child);return child;},_update:function()
{var totalWeights=0;var done=0;for(var i=0;i<this._children.length;++i){var child=this._children[i];if(child._totalWork)
done+=child._weight*child._worked/child._totalWork;totalWeights+=child._weight;}
this._parent.setWorked(done/totalWeights);}}
WebInspector.SubProgress=function(composite,weight)
{this._composite=composite;this._weight=weight||1;this._worked=0;}
WebInspector.SubProgress.prototype={isCanceled:function()
{return this._composite._parent.isCanceled();},setTitle:function(title)
{this._composite._parent.setTitle(title);},done:function()
{this.setWorked(this._totalWork);this._composite._childDone();},setTotalWork:function(totalWork)
{this._totalWork=totalWork;this._composite._update();},setWorked:function(worked,title)
{this._worked=worked;if(typeof title!=="undefined")
this.setTitle(title);this._composite._update();},worked:function(worked)
{this.setWorked(this._worked+(worked||1));}}
WebInspector.ProgressProxy=function(delegate,doneCallback)
{this._delegate=delegate;this._doneCallback=doneCallback;}
WebInspector.ProgressProxy.prototype={isCanceled:function()
{return this._delegate?this._delegate.isCanceled():false;},setTitle:function(title)
{if(this._delegate)
this._delegate.setTitle(title);},done:function()
{if(this._delegate)
this._delegate.done();if(this._doneCallback)
this._doneCallback();},setTotalWork:function(totalWork)
{if(this._delegate)
this._delegate.setTotalWork(totalWork);},setWorked:function(worked,title)
{if(this._delegate)
this._delegate.setWorked(worked,title);},worked:function(worked)
{if(this._delegate)
this._delegate.worked(worked);}};WebInspector.ResourceType=function(name,title,category,isTextType)
{this._name=name;this._title=title;this._category=category;this._isTextType=isTextType;}
WebInspector.ResourceType.prototype={name:function()
{return this._name;},title:function()
{return this._title;},category:function()
{return this._category;},isTextType:function()
{return this._isTextType;},isScript:function()
{return this._name==="script"||this._name==="sm-script";},hasScripts:function()
{return this.isScript()||this.isDocument();},isStyleSheet:function()
{return this._name==="stylesheet"||this._name==="sm-stylesheet";},isDocument:function()
{return this._name==="document";},isDocumentOrScriptOrStyleSheet:function()
{return this.isDocument()||this.isScript()||this.isStyleSheet();},isFromSourceMap:function()
{return this._name.startsWith("sm-");},toString:function()
{return this._name;},canonicalMimeType:function()
{if(this.isDocument())
return"text/html";if(this.isScript())
return"text/javascript";if(this.isStyleSheet())
return"text/css";return"";}}
WebInspector.ResourceCategory=function(title,shortTitle)
{this.title=title;this.shortTitle=shortTitle;}
WebInspector.resourceCategories={XHR:new WebInspector.ResourceCategory("XHR and Fetch","XHR"),Script:new WebInspector.ResourceCategory("Scripts","JS"),Stylesheet:new WebInspector.ResourceCategory("Stylesheets","CSS"),Image:new WebInspector.ResourceCategory("Images","Img"),Media:new WebInspector.ResourceCategory("Media","Media"),Font:new WebInspector.ResourceCategory("Fonts","Font"),Document:new WebInspector.ResourceCategory("Documents","Doc"),WebSocket:new WebInspector.ResourceCategory("WebSockets","WS"),Manifest:new WebInspector.ResourceCategory("Manifest","Manifest"),Other:new WebInspector.ResourceCategory("Other","Other")}
WebInspector.resourceTypes={XHR:new WebInspector.ResourceType("xhr","XHR",WebInspector.resourceCategories.XHR,true),Fetch:new WebInspector.ResourceType("fetch","Fetch",WebInspector.resourceCategories.XHR,true),EventSource:new WebInspector.ResourceType("eventsource","EventSource",WebInspector.resourceCategories.XHR,true),Script:new WebInspector.ResourceType("script","Script",WebInspector.resourceCategories.Script,true),Stylesheet:new WebInspector.ResourceType("stylesheet","Stylesheet",WebInspector.resourceCategories.Stylesheet,true),Image:new WebInspector.ResourceType("image","Image",WebInspector.resourceCategories.Image,false),Media:new WebInspector.ResourceType("media","Media",WebInspector.resourceCategories.Media,false),Font:new WebInspector.ResourceType("font","Font",WebInspector.resourceCategories.Font,false),Document:new WebInspector.ResourceType("document","Document",WebInspector.resourceCategories.Document,true),TextTrack:new WebInspector.ResourceType("texttrack","TextTrack",WebInspector.resourceCategories.Other,true),WebSocket:new WebInspector.ResourceType("websocket","WebSocket",WebInspector.resourceCategories.WebSocket,false),Other:new WebInspector.ResourceType("other","Other",WebInspector.resourceCategories.Other,false),SourceMapScript:new WebInspector.ResourceType("sm-script","Script",WebInspector.resourceCategories.Script,false),SourceMapStyleSheet:new WebInspector.ResourceType("sm-stylesheet","Stylesheet",WebInspector.resourceCategories.Stylesheet,false),Manifest:new WebInspector.ResourceType("manifest","Manifest",WebInspector.resourceCategories.Manifest,false),}
WebInspector.ResourceType.mimeFromURL=function(url)
{var name=WebInspector.TextUtils.fileName(url);if(WebInspector.ResourceType.mimeTypeByName[name]){return WebInspector.ResourceType.mimeTypeByName[name];}
var ext=WebInspector.TextUtils.extension(url).toLowerCase();return WebInspector.ResourceType.mimeTypeByExtension[ext];}
WebInspector.ResourceType.mimeTypeByName={"Cakefile":"text/x-coffeescript"}
WebInspector.ResourceType.mimeTypeByExtension={"js":"text/javascript","css":"text/css","html":"text/html","htm":"text/html","xml":"application/xml","xsl":"application/xml","asp":"application/x-aspx","aspx":"application/x-aspx","jsp":"application/x-jsp","c":"text/x-c++src","cc":"text/x-c++src","cpp":"text/x-c++src","h":"text/x-c++src","m":"text/x-c++src","mm":"text/x-c++src","coffee":"text/x-coffeescript","dart":"text/javascript","ts":"text/typescript","json":"application/json","gyp":"application/json","gypi":"application/json","cs":"text/x-csharp","java":"text/x-java","less":"text/x-less","php":"text/x-php","phtml":"application/x-httpd-php","py":"text/x-python","sh":"text/x-sh","scss":"text/x-scss","vtt":"text/vtt","ls":"text/x-livescript","cljs":"text/x-clojure","cljc":"text/x-clojure","cljx":"text/x-clojure","styl":"text/x-styl","jpeg":"image/jpeg","jpg":"image/jpeg","svg":"image/svg","gif":"image/gif","webp":"image/webp","png":"image/png","ico":"image/ico","tiff":"image/tiff","tif":"image/tif","bmp":"image/bmp","ttf":"font/opentype","otf":"font/opentype","ttc":"font/opentype","woff":"application/font-woff"};WebInspector.Settings=function(storage)
{this._settingsStorage=storage;var clearLocalStorage=window.localStorage?window.localStorage.clear.bind(window.localStorage):undefined;this._localStorage=new WebInspector.SettingsStorage(window.localStorage||{},undefined,undefined,clearLocalStorage);this._eventSupport=new WebInspector.Object();this._registry=new Map();this._moduleSettings=new Map();self.runtime.extensions("setting").forEach(this._registerModuleSetting.bind(this));}
WebInspector.Settings.prototype={_registerModuleSetting:function(extension)
{var descriptor=extension.descriptor();var settingName=descriptor["settingName"];var settingType=descriptor["settingType"];var defaultValue=descriptor["defaultValue"];var isLocal=!!descriptor["local"];var setting=settingType==="regex"?this.createRegExpSetting(settingName,defaultValue,undefined,isLocal):this.createSetting(settingName,defaultValue,isLocal);this._moduleSettings.set(settingName,setting);},moduleSetting:function(settingName)
{var setting=this._moduleSettings.get(settingName);if(!setting)
throw new Error("No setting registered: "+settingName);return setting;},settingForTest:function(settingName)
{var setting=this._registry.get(settingName);if(!setting)
throw new Error("No setting registered: "+settingName);return setting;},createSetting:function(key,defaultValue,isLocal)
{if(!this._registry.get(key))
this._registry.set(key,new WebInspector.Setting(this,key,defaultValue,this._eventSupport,isLocal?this._localStorage:this._settingsStorage));return(this._registry.get(key));},createLocalSetting:function(key,defaultValue)
{return this.createSetting(key,defaultValue,true);},createRegExpSetting:function(key,defaultValue,regexFlags,isLocal)
{if(!this._registry.get(key))
this._registry.set(key,new WebInspector.RegExpSetting(this,key,defaultValue,this._eventSupport,isLocal?this._localStorage:this._settingsStorage,regexFlags));return(this._registry.get(key));},clearAll:function()
{this._settingsStorage.removeAll();this._localStorage.removeAll();var versionSetting=WebInspector.settings.createSetting(WebInspector.VersionController._currentVersionName,0);versionSetting.set(WebInspector.VersionController.currentVersion);}}
WebInspector.SettingsStorage=function(object,setCallback,removeCallback,removeAllCallback)
{this._object=object;this._setCallback=setCallback||function(){};this._removeCallback=removeCallback||function(){};this._removeAllCallback=removeAllCallback||function(){};}
WebInspector.SettingsStorage.prototype={set:function(name,value)
{this._object[name]=value;this._setCallback(name,value);},has:function(name)
{return name in this._object;},get:function(name)
{return this._object[name];},remove:function(name)
{delete this._object[name];this._removeCallback(name);},removeAll:function()
{this._object={};this._removeAllCallback();},_dumpSizes:function()
{WebInspector.console.log("Ten largest settings: ");var sizes={__proto__:null};for(var key in this._object)
sizes[key]=this._object[key].length;var keys=Object.keys(sizes);function comparator(key1,key2)
{return sizes[key2]-sizes[key1];}
keys.sort(comparator);for(var i=0;i<10&&i<keys.length;++i)
WebInspector.console.log("Setting: '"+keys[i]+"', size: "+sizes[keys[i]]);}}
WebInspector.Setting=function(settings,name,defaultValue,eventSupport,storage)
{this._settings=settings;this._name=name;this._defaultValue=defaultValue;this._eventSupport=eventSupport;this._storage=storage;}
WebInspector.Setting.prototype={addChangeListener:function(listener,thisObject)
{this._eventSupport.addEventListener(this._name,listener,thisObject);},removeChangeListener:function(listener,thisObject)
{this._eventSupport.removeEventListener(this._name,listener,thisObject);},get name()
{return this._name;},get:function()
{if(typeof this._value!=="undefined")
return this._value;this._value=this._defaultValue;if(this._storage.has(this._name)){try{this._value=JSON.parse(this._storage.get(this._name));}catch(e){this.remove();}}
return this._value;},set:function(value)
{this._value=value;try{var settingString=JSON.stringify(value);try{this._storage.set(this._name,settingString);}catch(e){this._printSettingsSavingError(e.message,this._name,settingString);}}catch(e){WebInspector.console.error("Cannot stringify setting with name: "+this._name+", error: "+e.message);}
this._eventSupport.dispatchEventToListeners(this._name,value);},remove:function()
{this._settings._registry.delete(this._name);this._settings._moduleSettings.delete(this._name);this._storage.remove(this._name);},_printSettingsSavingError:function(message,name,value)
{var errorMessage="Error saving setting with name: "+this._name+", value length: "+value.length+". Error: "+message;console.error(errorMessage);WebInspector.console.error(errorMessage);this._storage._dumpSizes();}}
WebInspector.RegExpSetting=function(settings,name,defaultValue,eventSupport,storage,regexFlags)
{WebInspector.Setting.call(this,settings,name,defaultValue?[{pattern:defaultValue}]:[],eventSupport,storage);this._regexFlags=regexFlags;}
WebInspector.RegExpSetting.prototype={get:function()
{var result=[];var items=this.getAsArray();for(var i=0;i<items.length;++i){var item=items[i];if(item.pattern&&!item.disabled)
result.push(item.pattern);}
return result.join("|");},getAsArray:function()
{return WebInspector.Setting.prototype.get.call(this);},set:function(value)
{this.setAsArray([{pattern:value}]);},setAsArray:function(value)
{delete this._regex;WebInspector.Setting.prototype.set.call(this,value);},asRegExp:function()
{if(typeof this._regex!=="undefined")
return this._regex;this._regex=null;try{var pattern=this.get();if(pattern)
this._regex=new RegExp(pattern,this._regexFlags||"");}catch(e){}
return this._regex;},__proto__:WebInspector.Setting.prototype}
WebInspector.VersionController=function()
{}
WebInspector.VersionController._currentVersionName="inspectorVersion";WebInspector.VersionController.currentVersion=18;WebInspector.VersionController.prototype={updateVersion:function()
{var localStorageVersion=window.localStorage?window.localStorage[WebInspector.VersionController._currentVersionName]:0;var versionSetting=WebInspector.settings.createSetting(WebInspector.VersionController._currentVersionName,0);var currentVersion=WebInspector.VersionController.currentVersion;var oldVersion=parseInt(localStorageVersion||"0",10)||versionSetting.get();if(oldVersion===0){versionSetting.set(currentVersion);return;}
var methodsToRun=this._methodsToRunToUpdateVersion(oldVersion,currentVersion);for(var i=0;i<methodsToRun.length;++i)
this[methodsToRun[i]].call(this);versionSetting.set(currentVersion);},_methodsToRunToUpdateVersion:function(oldVersion,currentVersion)
{var result=[];for(var i=oldVersion;i<currentVersion;++i)
result.push("_updateVersionFrom"+i+"To"+(i+1));return result;},_updateVersionFrom0To1:function()
{this._clearBreakpointsWhenTooMany(WebInspector.settings.createLocalSetting("breakpoints",[]),500000);},_updateVersionFrom1To2:function()
{WebInspector.settings.createSetting("previouslyViewedFiles",[]).set([]);},_updateVersionFrom2To3:function()
{WebInspector.settings.createSetting("fileSystemMapping",{}).set({});WebInspector.settings.createSetting("fileMappingEntries",[]).remove();},_updateVersionFrom3To4:function()
{var advancedMode=WebInspector.settings.createSetting("showHeaSnapshotObjectsHiddenProperties",false);WebInspector.moduleSetting("showAdvancedHeapSnapshotProperties").set(advancedMode.get());advancedMode.remove();},_updateVersionFrom4To5:function()
{var settingNames={"FileSystemViewSidebarWidth":"fileSystemViewSplitViewState","elementsSidebarWidth":"elementsPanelSplitViewState","StylesPaneSplitRatio":"stylesPaneSplitViewState","heapSnapshotRetainersViewSize":"heapSnapshotSplitViewState","InspectorView.splitView":"InspectorView.splitViewState","InspectorView.screencastSplitView":"InspectorView.screencastSplitViewState","Inspector.drawerSplitView":"Inspector.drawerSplitViewState","layerDetailsSplitView":"layerDetailsSplitViewState","networkSidebarWidth":"networkPanelSplitViewState","sourcesSidebarWidth":"sourcesPanelSplitViewState","scriptsPanelNavigatorSidebarWidth":"sourcesPanelNavigatorSplitViewState","sourcesPanelSplitSidebarRatio":"sourcesPanelDebuggerSidebarSplitViewState","timeline-details":"timelinePanelDetailsSplitViewState","timeline-split":"timelinePanelRecorsSplitViewState","timeline-view":"timelinePanelTimelineStackSplitViewState","auditsSidebarWidth":"auditsPanelSplitViewState","layersSidebarWidth":"layersPanelSplitViewState","profilesSidebarWidth":"profilesPanelSplitViewState","resourcesSidebarWidth":"resourcesPanelSplitViewState"};var empty={};for(var oldName in settingNames){var newName=settingNames[oldName];var oldNameH=oldName+"H";var newValue=null;var oldSetting=WebInspector.settings.createSetting(oldName,empty);if(oldSetting.get()!==empty){newValue=newValue||{};newValue.vertical={};newValue.vertical.size=oldSetting.get();oldSetting.remove();}
var oldSettingH=WebInspector.settings.createSetting(oldNameH,empty);if(oldSettingH.get()!==empty){newValue=newValue||{};newValue.horizontal={};newValue.horizontal.size=oldSettingH.get();oldSettingH.remove();}
if(newValue)
WebInspector.settings.createSetting(newName,{}).set(newValue);}},_updateVersionFrom5To6:function()
{var settingNames={"debuggerSidebarHidden":"sourcesPanelSplitViewState","navigatorHidden":"sourcesPanelNavigatorSplitViewState","WebInspector.Drawer.showOnLoad":"Inspector.drawerSplitViewState"};for(var oldName in settingNames){var oldSetting=WebInspector.settings.createSetting(oldName,null);if(oldSetting.get()===null){oldSetting.remove();continue;}
var newName=settingNames[oldName];var invert="WebInspector.Drawer.showOnLoad"===oldName;var hidden=oldSetting.get()!==invert;oldSetting.remove();var showMode=hidden?"OnlyMain":"Both";var newSetting=WebInspector.settings.createSetting(newName,{});var newValue=newSetting.get()||{};newValue.vertical=newValue.vertical||{};newValue.vertical.showMode=showMode;newValue.horizontal=newValue.horizontal||{};newValue.horizontal.showMode=showMode;newSetting.set(newValue);}},_updateVersionFrom6To7:function()
{var settingNames={"sourcesPanelNavigatorSplitViewState":"sourcesPanelNavigatorSplitViewState","elementsPanelSplitViewState":"elementsPanelSplitViewState","stylesPaneSplitViewState":"stylesPaneSplitViewState","sourcesPanelDebuggerSidebarSplitViewState":"sourcesPanelDebuggerSidebarSplitViewState"};var empty={};for(var name in settingNames){var setting=WebInspector.settings.createSetting(name,empty);var value=setting.get();if(value===empty)
continue;if(value.vertical&&value.vertical.size&&value.vertical.size<1)
value.vertical.size=0;if(value.horizontal&&value.horizontal.size&&value.horizontal.size<1)
value.horizontal.size=0;setting.set(value);}},_updateVersionFrom7To8:function()
{},_updateVersionFrom8To9:function()
{var settingNames=["skipStackFramesPattern","workspaceFolderExcludePattern"];for(var i=0;i<settingNames.length;++i){var setting=WebInspector.settings.createSetting(settingNames[i],"");var value=setting.get();if(!value)
return;if(typeof value==="string")
value=[value];for(var j=0;j<value.length;++j){if(typeof value[j]==="string")
value[j]={pattern:value[j]};}
setting.set(value);}},_updateVersionFrom9To10:function()
{if(!window.localStorage)
return;for(var key in window.localStorage){if(key.startsWith("revision-history"))
window.localStorage.removeItem(key);}},_updateVersionFrom10To11:function()
{var oldSettingName="customDevicePresets";var newSettingName="customEmulatedDeviceList";var oldSetting=WebInspector.settings.createSetting(oldSettingName,undefined);var list=oldSetting.get();if(!Array.isArray(list))
return;var newList=[];for(var i=0;i<list.length;++i){var value=list[i];var device={};device["title"]=value["title"];device["type"]="unknown";device["user-agent"]=value["userAgent"];device["capabilities"]=[];if(value["touch"])
device["capabilities"].push("touch");if(value["mobile"])
device["capabilities"].push("mobile");device["screen"]={};device["screen"]["vertical"]={width:value["width"],height:value["height"]};device["screen"]["horizontal"]={width:value["height"],height:value["width"]};device["screen"]["device-pixel-ratio"]=value["deviceScaleFactor"];device["modes"]=[];device["show-by-default"]=true;device["show"]="Default";newList.push(device);}
if(newList.length)
WebInspector.settings.createSetting(newSettingName,[]).set(newList);oldSetting.remove();},_updateVersionFrom11To12:function()
{this._migrateSettingsFromLocalStorage();},_updateVersionFrom12To13:function()
{this._migrateSettingsFromLocalStorage();WebInspector.settings.createSetting("timelineOverviewMode","").remove();},_updateVersionFrom13To14:function()
{var defaultValue={"throughput":-1,"latency":0};WebInspector.settings.createSetting("networkConditions",defaultValue).set(defaultValue);},_updateVersionFrom14To15:function()
{var setting=WebInspector.settings.createLocalSetting("workspaceExcludedFolders",{});var oldValue=setting.get();var newValue={};for(var fileSystemPath in oldValue){newValue[fileSystemPath]=[];for(var entry of oldValue[fileSystemPath])
newValue[fileSystemPath].push(entry.path);}
setting.set(newValue);},_updateVersionFrom15To16:function()
{var setting=WebInspector.settings.createSetting("InspectorView.panelOrder",{});var tabOrders=setting.get();for(var key of Object.keys(tabOrders))
tabOrders[key]=(tabOrders[key]+1)*10;setting.set(tabOrders);},_updateVersionFrom16To17:function()
{var setting=WebInspector.settings.createSetting("networkConditionsCustomProfiles",[]);var oldValue=setting.get();var newValue=[];if(Array.isArray(oldValue)){for(var preset of oldValue){if(typeof preset.title==="string"&&typeof preset.value==="object"&&typeof preset.value.throughput==="number"&&typeof preset.value.latency==="number")
newValue.push({title:preset.title,value:{download:preset.value.throughput,upload:preset.value.throughput,latency:preset.value.latency}});}}
setting.set(newValue);},_updateVersionFrom17To18:function()
{var setting=WebInspector.settings.createLocalSetting("workspaceExcludedFolders",{});var oldValue=setting.get();var newValue={};for(var oldKey in oldValue){var newKey=oldKey.replace(/\\/g,"/");if(!newKey.startsWith("file://")){if(newKey.startsWith("/"))
newKey="file://"+newKey;else
newKey="file:///"+newKey;}
newValue[newKey]=oldValue[oldKey];}
setting.set(newValue);},_migrateSettingsFromLocalStorage:function()
{var localSettings=["advancedSearchConfig","breakpoints","consoleHistory","domBreakpoints","eventListenerBreakpoints","fileSystemMapping","lastSelectedSourcesSidebarPaneTab","previouslyViewedFiles","savedURLs","watchExpressions","workspaceExcludedFolders","xhrBreakpoints"].keySet();if(!window.localStorage)
return;for(var key in window.localStorage){if(key in localSettings)
continue;var value=window.localStorage[key];window.localStorage.removeItem(key);WebInspector.settings._settingsStorage[key]=value;}},_clearBreakpointsWhenTooMany:function(breakpointsSetting,maxBreakpointsCount)
{if(breakpointsSetting.get().length>maxBreakpointsCount)
breakpointsSetting.set([]);}}
WebInspector.settings;WebInspector.moduleSetting=function(settingName)
{return WebInspector.settings.moduleSetting(settingName);}
WebInspector.settingForTest=function(settingName)
{return WebInspector.settings.settingForTest(settingName);};WebInspector.StaticContentProvider=function(contentType,content,contentURL)
{this._content=content;this._contentType=contentType;this._contentURL=contentURL||"";}
WebInspector.StaticContentProvider.searchInContent=function(content,query,caseSensitive,isRegex,callback)
{function performSearch()
{callback(WebInspector.ContentProvider.performSearchInContent(content,query,caseSensitive,isRegex));}
setTimeout(performSearch.bind(null),0);}
WebInspector.StaticContentProvider.prototype={contentURL:function()
{return this._contentURL;},contentType:function()
{return this._contentType;},requestContent:function(callback)
{callback(this._content);},searchInContent:function(query,caseSensitive,isRegex,callback)
{WebInspector.StaticContentProvider.searchInContent(this._content,query,caseSensitive,isRegex,callback);}};WebInspector.OutputStream=function()
{}
WebInspector.OutputStream.prototype={write:function(data,callback){},close:function(){}}
WebInspector.StringOutputStream=function()
{this._data="";}
WebInspector.StringOutputStream.prototype={write:function(chunk,callback)
{this._data+=chunk;},close:function()
{},data:function()
{return this._data;}};WebInspector.TestBase=function(domAutomationController)
{this.domAutomationController_=domAutomationController;this.controlTaken_=false;this.timerId_=-1;};WebInspector.TestBase.prototype.fail=function(message)
{if(this.controlTaken_)
this.reportFailure_(message);else
throw message;};WebInspector.TestBase.prototype.assertEquals=function(expected,actual,opt_message)
{if(expected!==actual){var message="Expected: '"+expected+"', but was '"+actual+"'";if(opt_message)
message=opt_message+"("+message+")";this.fail(message);}};WebInspector.TestBase.prototype.assertTrue=function(value,opt_message)
{this.assertEquals(true,!!value,opt_message);};WebInspector.TestBase.prototype.takeControl=function()
{this.controlTaken_=true;var self=this;this.timerId_=setTimeout(function(){self.reportFailure_("Timeout exceeded: 20 sec");},20000);};WebInspector.TestBase.prototype.releaseControl=function()
{if(this.timerId_!==-1){clearTimeout(this.timerId_);this.timerId_=-1;}
this.reportOk_();};WebInspector.TestBase.prototype.reportOk_=function()
{this.domAutomationController_.send("[OK]");};WebInspector.TestBase.prototype.reportFailure_=function(error)
{if(this.timerId_!==-1){clearTimeout(this.timerId_);this.timerId_=-1;}
this.domAutomationController_.send("[FAILED] "+error);};WebInspector.TestBase.prototype.dispatch=function(args)
{var methodName=args.shift();try{this[methodName].apply(this,args);if(!this.controlTaken_)
this.reportOk_();}catch(e){this.reportFailure_(e);}};WebInspector.TestBase.prototype.addSniffer=function(receiver,methodName,override,opt_sticky)
{var orig=receiver[methodName];if(typeof orig!=="function")
this.fail("Cannot find method to override: "+methodName);var test=this;receiver[methodName]=function(var_args){try{var result=orig.apply(this,arguments);}finally{if(!opt_sticky)
receiver[methodName]=orig;}
try{override.apply(this,arguments);}catch(e){test.fail("Exception in overriden method '"+methodName+"': "+e);}
return result;};};WebInspector.TestBase.prototype.waitForThrottler=function(throttler,callback)
{var test=this;var scheduleShouldFail=true;test.addSniffer(throttler,"schedule",onSchedule);function hasSomethingScheduled()
{return throttler._isRunningProcess||throttler._process;}
function checkState()
{if(!hasSomethingScheduled()){scheduleShouldFail=false;callback();return;}
test.addSniffer(throttler,"_processCompletedForTests",checkState);}
function onSchedule()
{if(scheduleShouldFail)
test.fail("Unexpected Throttler.schedule");}
checkState();};;WebInspector.TextRange=function(startLine,startColumn,endLine,endColumn)
{this.startLine=startLine;this.startColumn=startColumn;this.endLine=endLine;this.endColumn=endColumn;}
WebInspector.TextRange.createFromLocation=function(line,column)
{return new WebInspector.TextRange(line,column,line,column);}
WebInspector.TextRange.fromObject=function(serializedTextRange)
{return new WebInspector.TextRange(serializedTextRange.startLine,serializedTextRange.startColumn,serializedTextRange.endLine,serializedTextRange.endColumn);}
WebInspector.TextRange.comparator=function(range1,range2)
{return range1.compareTo(range2);}
WebInspector.TextRange.prototype={isEmpty:function()
{return this.startLine===this.endLine&&this.startColumn===this.endColumn;},immediatelyPrecedes:function(range)
{if(!range)
return false;return this.endLine===range.startLine&&this.endColumn===range.startColumn;},immediatelyFollows:function(range)
{if(!range)
return false;return range.immediatelyPrecedes(this);},follows:function(range)
{return(range.endLine===this.startLine&&range.endColumn<=this.startColumn)||range.endLine<this.startLine;},get linesCount()
{return this.endLine-this.startLine;},collapseToEnd:function()
{return new WebInspector.TextRange(this.endLine,this.endColumn,this.endLine,this.endColumn);},collapseToStart:function()
{return new WebInspector.TextRange(this.startLine,this.startColumn,this.startLine,this.startColumn);},normalize:function()
{if(this.startLine>this.endLine||(this.startLine===this.endLine&&this.startColumn>this.endColumn))
return new WebInspector.TextRange(this.endLine,this.endColumn,this.startLine,this.startColumn);else
return this.clone();},clone:function()
{return new WebInspector.TextRange(this.startLine,this.startColumn,this.endLine,this.endColumn);},serializeToObject:function()
{var serializedTextRange={};serializedTextRange.startLine=this.startLine;serializedTextRange.startColumn=this.startColumn;serializedTextRange.endLine=this.endLine;serializedTextRange.endColumn=this.endColumn;return serializedTextRange;},compareTo:function(other)
{if(this.startLine>other.startLine)
return 1;if(this.startLine<other.startLine)
return-1;if(this.startColumn>other.startColumn)
return 1;if(this.startColumn<other.startColumn)
return-1;return 0;},equal:function(other)
{return this.startLine===other.startLine&&this.endLine===other.endLine&&this.startColumn===other.startColumn&&this.endColumn===other.endColumn;},shift:function(lineOffset)
{return new WebInspector.TextRange(this.startLine+lineOffset,this.startColumn,this.endLine+lineOffset,this.endColumn);},relativeTo:function(line,column)
{var relative=this.clone();if(this.startLine==line)
relative.startColumn-=column;if(this.endLine==line)
relative.endColumn-=column;relative.startLine-=line;relative.endLine-=line;return relative;},toSourceRange:function(text)
{var start=(this.startLine?text.lineEndings()[this.startLine-1]+1:0)+this.startColumn;var end=(this.endLine?text.lineEndings()[this.endLine-1]+1:0)+this.endColumn;return new WebInspector.SourceRange(start,end-start);},rebaseAfterTextEdit:function(originalRange,editedRange)
{console.assert(originalRange.startLine===editedRange.startLine);console.assert(originalRange.startColumn===editedRange.startColumn);var rebase=this.clone();if(!this.follows(originalRange))
return rebase;var lineDelta=editedRange.endLine-originalRange.endLine;var columnDelta=editedRange.endColumn-originalRange.endColumn;rebase.startLine+=lineDelta;rebase.endLine+=lineDelta;if(rebase.startLine===editedRange.endLine)
rebase.startColumn+=columnDelta;if(rebase.endLine===editedRange.endLine)
rebase.endColumn+=columnDelta;return rebase;},toString:function()
{return JSON.stringify(this);},replaceInText:function(text,replacement)
{var sourceRange=this.toSourceRange(text);return text.substring(0,sourceRange.offset)+replacement+text.substring(sourceRange.offset+sourceRange.length);},extract:function(text)
{var sourceRange=this.toSourceRange(text);return text.substr(sourceRange.offset,sourceRange.length);},containsLocation:function(lineNumber,columnNumber)
{if(this.startLine===this.endLine)
return this.startLine===lineNumber&&this.startColumn<=columnNumber&&columnNumber<=this.endColumn;if(this.startLine===lineNumber)
return this.startColumn<=columnNumber;if(this.endLine===lineNumber)
return columnNumber<=this.endColumn;return this.startLine<lineNumber&&lineNumber<this.endLine;}}
WebInspector.SourceRange=function(offset,length)
{this.offset=offset;this.length=length;}
WebInspector.SourceEdit=function(sourceURL,oldRange,oldText,newText)
{this.sourceURL=sourceURL;this.oldRange=oldRange;this.oldText=oldText;this.newText=newText;}
WebInspector.SourceEdit.prototype={newRange:function()
{var endLine=this.oldRange.startLine;var endColumn=this.oldRange.startColumn+this.newText.length;var lineEndings=this.newText.lineEndings();if(lineEndings.length>1){endLine=this.oldRange.startLine+lineEndings.length-1;var len=lineEndings.length;endColumn=lineEndings[len-1]-lineEndings[len-2]-1;}
return new WebInspector.TextRange(this.oldRange.startLine,this.oldRange.startColumn,endLine,endColumn);},applyToText:function(text)
{return this.oldRange.replaceInText(text,this.newText);},};WebInspector.TextUtils={isStopChar:function(char)
{return(char>" "&&char<"0")||(char>"9"&&char<"A")||(char>"Z"&&char<"_")||(char>"_"&&char<"a")||(char>"z"&&char<="~");},isWordChar:function(char)
{return!WebInspector.TextUtils.isStopChar(char)&&!WebInspector.TextUtils.isSpaceChar(char);},isSpaceChar:function(char)
{return WebInspector.TextUtils._SpaceCharRegex.test(char);},isWord:function(word)
{for(var i=0;i<word.length;++i){if(!WebInspector.TextUtils.isWordChar(word.charAt(i)))
return false;}
return true;},isOpeningBraceChar:function(char)
{return char==="("||char==="{";},isClosingBraceChar:function(char)
{return char===")"||char==="}";},isBraceChar:function(char)
{return WebInspector.TextUtils.isOpeningBraceChar(char)||WebInspector.TextUtils.isClosingBraceChar(char);},textToWords:function(text,isWordChar,wordCallback)
{var startWord=-1;for(var i=0;i<text.length;++i){if(!isWordChar(text.charAt(i))){if(startWord!==-1)
wordCallback(text.substring(startWord,i));startWord=-1;}else if(startWord===-1)
startWord=i;}
if(startWord!==-1)
wordCallback(text.substring(startWord));},lineIndent:function(line)
{var indentation=0;while(indentation<line.length&&WebInspector.TextUtils.isSpaceChar(line.charAt(indentation)))
++indentation;return line.substr(0,indentation);},isUpperCase:function(text)
{return text===text.toUpperCase();},isLowerCase:function(text)
{return text===text.toLowerCase();},_lastSectionBeforeQuery:function(text,delimiter)
{var lastIndexOfDot=text.lastIndexOf(delimiter);var extension=lastIndexOfDot!==-1?text.substr(lastIndexOfDot+1):"";var indexOfQuestionMark=extension.indexOf("?");if(indexOfQuestionMark!==-1)
extension=extension.substr(0,indexOfQuestionMark);return extension;},extension:function(text)
{return WebInspector.TextUtils._lastSectionBeforeQuery(text,".");},fileName:function(text)
{return WebInspector.TextUtils._lastSectionBeforeQuery(text,"/");}}
WebInspector.TextUtils._SpaceCharRegex=/\s/;WebInspector.TextUtils.Indent={TwoSpaces:" ",FourSpaces:" ",EightSpaces:" ",TabCharacter:"\t"}
WebInspector.TextUtils.BalancedJSONTokenizer=function(callback,findMultiple)
{this._callback=callback;this._index=0;this._balance=0;this._buffer="";this._findMultiple=findMultiple||false;this._closingDoubleQuoteRegex=/[^\\](?:\\\\)*"/g;}
WebInspector.TextUtils.BalancedJSONTokenizer.prototype={write:function(chunk)
{this._buffer+=chunk;var lastIndex=this._buffer.length;var buffer=this._buffer;for(var index=this._index;index<lastIndex;++index){var character=buffer[index];if(character==="\""){this._closingDoubleQuoteRegex.lastIndex=index;if(!this._closingDoubleQuoteRegex.test(buffer))
break;index=this._closingDoubleQuoteRegex.lastIndex-1;}else if(character==="{"){++this._balance;}else if(character==="}"){if(--this._balance===0){this._lastBalancedIndex=index+1;if(!this._findMultiple)
break;}}}
this._index=index;this._reportBalanced();},_reportBalanced:function()
{if(!this._lastBalancedIndex)
return;this._callback(this._buffer.slice(0,this._lastBalancedIndex));this._buffer=this._buffer.slice(this._lastBalancedIndex);this._index-=this._lastBalancedIndex;this._lastBalancedIndex=0;},remainder:function()
{return this._buffer;}}
WebInspector.TokenizerFactory=function(){}
WebInspector.TokenizerFactory.prototype={createTokenizer:function(mimeType){}};WebInspector.Throttler=function(timeout)
{this._timeout=timeout;this._isRunningProcess=false;this._asSoonAsPossible=false;this._process=null;}
WebInspector.Throttler.prototype={_processCompleted:function()
{this._isRunningProcess=false;if(this._process)
this._innerSchedule(false);this._processCompletedForTests();},_processCompletedForTests:function()
{},_onTimeout:function()
{delete this._processTimeout;this._asSoonAsPossible=false;this._isRunningProcess=true;Promise.resolve().then(this._process).catch(console.error.bind(console)).then(this._processCompleted.bind(this));this._process=null;},schedule:function(process,asSoonAsPossible)
{this._process=process;var hasScheduledTasks=!!this._processTimeout||this._isRunningProcess;asSoonAsPossible=!!asSoonAsPossible||!hasScheduledTasks;var forceTimerUpdate=asSoonAsPossible&&!this._asSoonAsPossible;this._asSoonAsPossible=this._asSoonAsPossible||asSoonAsPossible;this._innerSchedule(forceTimerUpdate);},_innerSchedule:function(forceTimerUpdate)
{if(this._isRunningProcess)
return;if(this._processTimeout&&!forceTimerUpdate)
return;if(this._processTimeout)
this._clearTimeout(this._processTimeout);var timeout=this._asSoonAsPossible?0:this._timeout;this._processTimeout=this._setTimeout(this._onTimeout.bind(this),timeout);},_clearTimeout:function(timeoutId)
{clearTimeout(timeoutId);},_setTimeout:function(operation,timeout)
{return setTimeout(operation,timeout);}}
WebInspector.Throttler.FinishCallback;;WebInspector.UIString=function(string,vararg)
{return String.vsprintf(WebInspector.localize(string),Array.prototype.slice.call(arguments,1));}
WebInspector.UIString.capitalize=function(string,vararg)
{if(WebInspector._useLowerCaseMenuTitles===undefined)
throw"WebInspector.setLocalizationPlatform() has not been called";var localized=WebInspector.localize(string);var capitalized;if(WebInspector._useLowerCaseMenuTitles)
capitalized=localized.replace(/\^(.)/g,"$1");else
capitalized=localized.replace(/\^(.)/g,function(str,char){return char.toUpperCase();});return String.vsprintf(capitalized,Array.prototype.slice.call(arguments,1));}
WebInspector.setLocalizationPlatform=function(platform)
{WebInspector._useLowerCaseMenuTitles=platform==="windows";}
WebInspector.localize=function(string)
{return string;}
WebInspector.UIStringFormat=function(format)
{this._localizedFormat=WebInspector.localize(format);this._tokenizedFormat=String.tokenizeFormatString(this._localizedFormat,String.standardFormatters);}
WebInspector.UIStringFormat._append=function(a,b)
{return a+b;}
WebInspector.UIStringFormat.prototype={format:function(vararg)
{return String.format(this._localizedFormat,arguments,String.standardFormatters,"",WebInspector.UIStringFormat._append,this._tokenizedFormat).formattedResult;}};WebInspector.Renderer=function()
{}
WebInspector.Renderer.prototype={render:function(object){}}
WebInspector.Renderer.renderPromise=function(object)
{if(!object)
return Promise.reject(new Error("Can't render "+object));return self.runtime.instancePromise(WebInspector.Renderer,object).then(render);function render(renderer)
{return renderer.render(object);}}
WebInspector.Revealer=function()
{}
WebInspector.Revealer.reveal=function(revealable,lineNumber)
{WebInspector.Revealer.revealPromise(revealable,lineNumber);}
WebInspector.Revealer.revealPromise=function(revealable,lineNumber)
{if(!revealable)
return Promise.reject(new Error("Can't reveal "+revealable));return self.runtime.instancesPromise(WebInspector.Revealer,revealable).then(reveal);function reveal(revealers)
{var promises=[];for(var i=0;i<revealers.length;++i)
promises.push(revealers[i].reveal((revealable),lineNumber));return Promise.race(promises);}}
WebInspector.Revealer.prototype={reveal:function(object,lineNumber){}}
WebInspector.App=function()
{}
WebInspector.App.prototype={presentUI:function(document,callback){}}
WebInspector.AppProvider=function()
{}
WebInspector.AppProvider.prototype={createApp:function(){}}
WebInspector.QueryParamHandler=function()
{}
WebInspector.QueryParamHandler.prototype={handleQueryParam:function(value){}};function InspectorFrontendHostAPI()
{}
InspectorFrontendHostAPI.ContextMenuDescriptor;InspectorFrontendHostAPI.LoadNetworkResourceResult;InspectorFrontendHostAPI.Events={AddExtensions:"addExtensions",AppendedToURL:"appendedToURL",CanceledSaveURL:"canceledSaveURL",ContextMenuCleared:"contextMenuCleared",ContextMenuItemSelected:"contextMenuItemSelected",DeviceCountUpdated:"deviceCountUpdated",DevicesDiscoveryConfigChanged:"devicesDiscoveryConfigChanged",DevicesPortForwardingStatusChanged:"devicesPortForwardingStatusChanged",DevicesUpdated:"devicesUpdated",DispatchMessage:"dispatchMessage",DispatchMessageChunk:"dispatchMessageChunk",DispatchFrontendAPIMessage:"dispatchFrontendAPIMessage",EnterInspectElementMode:"enterInspectElementMode",FileSystemsLoaded:"fileSystemsLoaded",FileSystemRemoved:"fileSystemRemoved",FileSystemAdded:"fileSystemAdded",FileSystemFilesChanged:"fileSystemFilesChanged",FrontendAPIAttached:"frontendAPIAttached",FrontendAPIDetached:"frontendAPIDetached",IndexingTotalWorkCalculated:"indexingTotalWorkCalculated",IndexingWorked:"indexingWorked",IndexingDone:"indexingDone",KeyEventUnhandled:"keyEventUnhandled",ReloadInspectedPage:"reloadInspectedPage",RevealSourceLine:"revealSourceLine",SavedURL:"savedURL",SearchCompleted:"searchCompleted",SetInspectedTabId:"setInspectedTabId",SetUseSoftMenu:"setUseSoftMenu",ShowPanel:"showPanel"}
InspectorFrontendHostAPI.EventDescriptors=[[InspectorFrontendHostAPI.Events.AddExtensions,["extensions"]],[InspectorFrontendHostAPI.Events.AppendedToURL,["url"]],[InspectorFrontendHostAPI.Events.CanceledSaveURL,["url"]],[InspectorFrontendHostAPI.Events.ContextMenuCleared,[]],[InspectorFrontendHostAPI.Events.ContextMenuItemSelected,["id"]],[InspectorFrontendHostAPI.Events.DeviceCountUpdated,["count"]],[InspectorFrontendHostAPI.Events.DevicesDiscoveryConfigChanged,["discoverUsbDevices","portForwardingEnabled","portForwardingConfig"]],[InspectorFrontendHostAPI.Events.DevicesPortForwardingStatusChanged,["status"]],[InspectorFrontendHostAPI.Events.DevicesUpdated,["devices"]],[InspectorFrontendHostAPI.Events.DispatchMessage,["messageObject"]],[InspectorFrontendHostAPI.Events.DispatchMessageChunk,["messageChunk","messageSize"]],[InspectorFrontendHostAPI.Events.DispatchFrontendAPIMessage,["messageObject"]],[InspectorFrontendHostAPI.Events.EnterInspectElementMode,[]],[InspectorFrontendHostAPI.Events.FileSystemsLoaded,["fileSystems"]],[InspectorFrontendHostAPI.Events.FileSystemRemoved,["fileSystemPath"]],[InspectorFrontendHostAPI.Events.FileSystemAdded,["errorMessage","fileSystem"]],[InspectorFrontendHostAPI.Events.FileSystemFilesChanged,["paths"]],[InspectorFrontendHostAPI.Events.FrontendAPIAttached,["frontendAPIAttached"]],[InspectorFrontendHostAPI.Events.FrontendAPIDetached,["frontendAPIDetached"]],[InspectorFrontendHostAPI.Events.IndexingTotalWorkCalculated,["requestId","fileSystemPath","totalWork"]],[InspectorFrontendHostAPI.Events.IndexingWorked,["requestId","fileSystemPath","worked"]],[InspectorFrontendHostAPI.Events.IndexingDone,["requestId","fileSystemPath"]],[InspectorFrontendHostAPI.Events.KeyEventUnhandled,["event"]],[InspectorFrontendHostAPI.Events.ReloadInspectedPage,["hard"]],[InspectorFrontendHostAPI.Events.RevealSourceLine,["url","lineNumber","columnNumber"]],[InspectorFrontendHostAPI.Events.SavedURL,["url"]],[InspectorFrontendHostAPI.Events.SearchCompleted,["requestId","fileSystemPath","files"]],[InspectorFrontendHostAPI.Events.SetInspectedTabId,["tabId"]],[InspectorFrontendHostAPI.Events.SetUseSoftMenu,["useSoftMenu"]],[InspectorFrontendHostAPI.Events.ShowPanel,["panelName"]]];InspectorFrontendHostAPI.prototype={addFileSystem:function(fileSystemPath){},append:function(url,content){},loadCompleted:function(){},indexPath:function(requestId,fileSystemPath){},getSelectionBackgroundColor:function(){},getSelectionForegroundColor:function(){},setInspectedPageBounds:function(bounds){},setWhitelistedShortcuts:function(shortcuts){},inspectElementCompleted:function(){},openInNewTab:function(url){},removeFileSystem:function(fileSystemPath){},requestFileSystems:function(){},save:function(url,content,forceSaveAs){},searchInPath:function(requestId,fileSystemPath,query){},stopIndexing:function(requestId){},bringToFront:function(){},closeWindow:function(){},copyText:function(text){},inspectedURLChanged:function(url){},isolatedFileSystem:function(fileSystemId,registeredName){},loadNetworkResource:function(url,headers,streamId,callback){},getPreferences:function(callback){},setPreference:function(name,value){},removePreference:function(name){},clearPreferences:function(){},upgradeDraggedFileSystemPermissions:function(fileSystem){},platform:function(){},recordEnumeratedHistogram:function(actionName,actionCode,bucketSize){},sendMessageToBackend:function(message){},setDevicesDiscoveryConfig:function(discoverUsbDevices,portForwardingEnabled,portForwardingConfig){},setDevicesUpdatesEnabled:function(enabled){},performActionOnRemotePage:function(pageId,action){},openRemotePage:function(browserId,url){},setInjectedScriptForOrigin:function(origin,script){},setIsDocked:function(isDocked,callback){},zoomFactor:function(){},zoomIn:function(){},zoomOut:function(){},resetZoom:function(){},showContextMenuAtPoint:function(x,y,items,document){},isUnderTest:function(){},isHostedMode:function(){},sendFrontendAPINotification:function(message){}};WebInspector.InspectorFrontendHostStub=function()
{function stopEventPropagation(event)
{var zoomModifier=WebInspector.isMac()?event.metaKey:event.ctrlKey;if(zoomModifier&&(event.keyCode===187||event.keyCode===189))
event.stopPropagation();}
document.addEventListener("keydown",stopEventPropagation,true);}
WebInspector.InspectorFrontendHostStub.prototype={getSelectionBackgroundColor:function()
{return"#6e86ff";},getSelectionForegroundColor:function()
{return"#ffffff";},platform:function()
{var match=navigator.userAgent.match(/Windows NT/);if(match)
return"windows";match=navigator.userAgent.match(/Mac OS X/);if(match)
return"mac";return"linux";},loadCompleted:function()
{},bringToFront:function()
{this._windowVisible=true;},closeWindow:function()
{this._windowVisible=false;},setIsDocked:function(isDocked,callback)
{setTimeout(callback,0);},setInspectedPageBounds:function(bounds)
{},inspectElementCompleted:function()
{},setInjectedScriptForOrigin:function(origin,script)
{},inspectedURLChanged:function(url)
{document.title=WebInspector.UIString("Developer Tools - %s",url);},copyText:function(text)
{WebInspector.console.error("Clipboard is not enabled in hosted mode. Please inspect using chrome://inspect");},openInNewTab:function(url)
{window.open(url,"_blank");},save:function(url,content,forceSaveAs)
{WebInspector.console.error("Saving files is not enabled in hosted mode. Please inspect using chrome://inspect");this.events.dispatchEventToListeners(InspectorFrontendHostAPI.Events.CanceledSaveURL,url);},append:function(url,content)
{WebInspector.console.error("Saving files is not enabled in hosted mode. Please inspect using chrome://inspect");},sendMessageToBackend:function(message)
{},recordEnumeratedHistogram:function(actionName,actionCode,bucketSize)
{},requestFileSystems:function()
{this.events.dispatchEventToListeners(InspectorFrontendHostAPI.Events.FileSystemsLoaded,[]);},addFileSystem:function(fileSystemPath)
{},removeFileSystem:function(fileSystemPath)
{},isolatedFileSystem:function(fileSystemId,registeredName)
{return null;},loadNetworkResource:function(url,headers,streamId,callback)
{loadResourcePromise(url).then(function(text){WebInspector.ResourceLoader.streamWrite(streamId,text);callback({statusCode:200});}).catch(function(){callback({statusCode:404});});},getPreferences:function(callback)
{var prefs={};for(var name in window.localStorage)
prefs[name]=window.localStorage[name];callback(prefs);},setPreference:function(name,value)
{window.localStorage[name]=value;},removePreference:function(name)
{delete window.localStorage[name];},clearPreferences:function()
{window.localStorage.clear();},upgradeDraggedFileSystemPermissions:function(fileSystem)
{},indexPath:function(requestId,fileSystemPath)
{},stopIndexing:function(requestId)
{},searchInPath:function(requestId,fileSystemPath,query)
{},zoomFactor:function()
{return 1;},zoomIn:function()
{},zoomOut:function()
{},resetZoom:function()
{},setWhitelistedShortcuts:function(shortcuts)
{},isUnderTest:function()
{return false;},setDevicesDiscoveryConfig:function(discoverUsbDevices,portForwardingEnabled,portForwardingConfig)
{},setDevicesUpdatesEnabled:function(enabled)
{},performActionOnRemotePage:function(pageId,action)
{},openRemotePage:function(browserId,url)
{},showContextMenuAtPoint:function(x,y,items,document)
{throw"Soft context menu should be used";},isHostedMode:function()
{return true;},sendFrontendAPINotification:function(message)
{}};var InspectorFrontendHost=window.InspectorFrontendHost||null;(function(){function initializeInspectorFrontendHost()
{if(!InspectorFrontendHost){InspectorFrontendHost=new WebInspector.InspectorFrontendHostStub();}else{var proto=WebInspector.InspectorFrontendHostStub.prototype;for(var name in proto){var value=proto[name];if(typeof value!=="function"||InspectorFrontendHost[name])
continue;InspectorFrontendHost[name]=stub.bind(null,name);}}
function stub(name)
{console.error("Incompatible embedder: method InspectorFrontendHost."+name+" is missing. Using stub instead.");var args=Array.prototype.slice.call(arguments,1);return proto[name].apply(InspectorFrontendHost,args);}
InspectorFrontendHost.events=new WebInspector.Object();}
function InspectorFrontendAPIImpl()
{this._debugFrontend=!!Runtime.queryParam("debugFrontend")||(window["InspectorTest"]&&window["InspectorTest"]["debugTest"]);var descriptors=InspectorFrontendHostAPI.EventDescriptors;for(var i=0;i<descriptors.length;++i)
this[descriptors[i][0]]=this._dispatch.bind(this,descriptors[i][0],descriptors[i][1],descriptors[i][2]);}
InspectorFrontendAPIImpl.prototype={_dispatch:function(name,signature,runOnceLoaded)
{var params=Array.prototype.slice.call(arguments,3);if(this._debugFrontend)
setImmediate(innerDispatch);else
innerDispatch();function innerDispatch()
{if(signature.length<2){try{InspectorFrontendHost.events.dispatchEventToListeners(name,params[0]);}catch(e){console.error(e+" "+e.stack);}
return;}
var data={};for(var i=0;i<signature.length;++i)
data[signature[i]]=params[i];try{InspectorFrontendHost.events.dispatchEventToListeners(name,data);}catch(e){console.error(e+" "+e.stack);}}},streamWrite:function(id,chunk)
{WebInspector.ResourceLoader.streamWrite(id,chunk);}}
initializeInspectorFrontendHost();window.InspectorFrontendAPI=new InspectorFrontendAPIImpl();WebInspector.setLocalizationPlatform(InspectorFrontendHost.platform());})();InspectorFrontendHost.events;;WebInspector.platform=function()
{if(!WebInspector._platform)
WebInspector._platform=InspectorFrontendHost.platform();return WebInspector._platform;}
WebInspector.isMac=function()
{if(typeof WebInspector._isMac==="undefined")
WebInspector._isMac=WebInspector.platform()==="mac";return WebInspector._isMac;}
WebInspector.isWin=function()
{if(typeof WebInspector._isWin==="undefined")
WebInspector._isWin=WebInspector.platform()==="windows";return WebInspector._isWin;}
WebInspector.fontFamily=function()
{if(WebInspector._fontFamily)
return WebInspector._fontFamily;switch(WebInspector.platform()){case"linux":WebInspector._fontFamily="Ubuntu, Arial, sans-serif";break;case"mac":WebInspector._fontFamily="'Lucida Grande', sans-serif";break;case"windows":WebInspector._fontFamily="'Segoe UI', Tahoma, sans-serif";break;}
return WebInspector._fontFamily;}
WebInspector.monospaceFontFamily=function()
{if(WebInspector._monospaceFontFamily)
return WebInspector._monospaceFontFamily;switch(WebInspector.platform()){case"linux":WebInspector._monospaceFontFamily="dejavu sans mono, monospace";break;case"mac":WebInspector._monospaceFontFamily="Menlo, monospace";break;case"windows":WebInspector._monospaceFontFamily="Consolas, monospace";break;}
return WebInspector._monospaceFontFamily;};WebInspector.ResourceLoader={}
WebInspector.ResourceLoader._lastStreamId=0;WebInspector.ResourceLoader._boundStreams={};WebInspector.ResourceLoader._bindOutputStream=function(stream)
{WebInspector.ResourceLoader._boundStreams[++WebInspector.ResourceLoader._lastStreamId]=stream;return WebInspector.ResourceLoader._lastStreamId;}
WebInspector.ResourceLoader._discardOutputStream=function(id)
{WebInspector.ResourceLoader._boundStreams[id].close();delete WebInspector.ResourceLoader._boundStreams[id];}
WebInspector.ResourceLoader.streamWrite=function(id,chunk)
{WebInspector.ResourceLoader._boundStreams[id].write(chunk);}
WebInspector.ResourceLoader.load=function(url,headers,callback)
{var stream=new WebInspector.StringOutputStream();WebInspector.ResourceLoader.loadAsStream(url,headers,stream,mycallback);function mycallback(statusCode,headers)
{callback(statusCode,headers,stream.data());}}
WebInspector.ResourceLoader.loadAsStream=function(url,headers,stream,callback)
{var streamId=WebInspector.ResourceLoader._bindOutputStream(stream);var parsedURL=new WebInspector.ParsedURL(url);if(parsedURL.isDataURL()){loadXHR(url).then(dataURLDecodeSuccessful).catch(dataURLDecodeFailed);return;}
var rawHeaders=[];if(headers){for(var key in headers)
rawHeaders.push(key+": "+headers[key]);}
InspectorFrontendHost.loadNetworkResource(url,rawHeaders.join("\r\n"),streamId,finishedCallback);function finishedCallback(response)
{if(callback)
callback(response.statusCode,response.headers||{});WebInspector.ResourceLoader._discardOutputStream(streamId);}
function dataURLDecodeSuccessful(text)
{WebInspector.ResourceLoader.streamWrite(streamId,text);finishedCallback(({statusCode:200}));}
function dataURLDecodeFailed()
{finishedCallback(({statusCode:404}));}};WebInspector.UserMetrics=function()
{}
WebInspector.UserMetrics.Action={WindowDocked:1,WindowUndocked:2,ScriptsBreakpointSet:3,TimelineStarted:4,ProfilesCPUProfileTaken:5,ProfilesHeapProfileTaken:6,AuditsStarted:7,ConsoleEvaluated:8,FileSavedInWorkspace:9,DeviceModeEnabled:10,AnimationsPlaybackRateChanged:11,RevisionApplied:12,FileSystemDirectoryContentReceived:13,StyleRuleEdited:14,CommandEvaluatedInConsolePanel:15,DOMPropertiesExpanded:16,ResizedViewInResponsiveMode:17}
WebInspector.UserMetrics._PanelCodes={elements:1,resources:2,network:3,sources:4,timeline:5,profiles:6,audits:7,console:8,layers:9}
WebInspector.UserMetrics._DrawerCodes={"console":1,"animations":2,"network.config":3,"rendering":4,"sensors":5,"sources.search":6}
WebInspector.UserMetrics.prototype={panelShown:function(panelName)
{var code=WebInspector.UserMetrics._PanelCodes[panelName]||0;var size=Object.keys(WebInspector.UserMetrics._PanelCodes).length+1;InspectorFrontendHost.recordEnumeratedHistogram("DevTools.PanelShown",code,size);},drawerShown:function(viewId)
{var code=WebInspector.UserMetrics._DrawerCodes[viewId]||0;var size=Object.keys(WebInspector.UserMetrics._DrawerCodes).length+1;InspectorFrontendHost.recordEnumeratedHistogram("DevTools.DrawerShown",code,size);},actionTaken:function(action)
{var size=Object.keys(WebInspector.UserMetrics.Action).length+1;InspectorFrontendHost.recordEnumeratedHistogram("DevTools.ActionTaken",action,size);}}
WebInspector.userMetrics=new WebInspector.UserMetrics();;WebInspector.Widget=function(isWebComponent)
{this.contentElement=createElementWithClass("div","widget");if(isWebComponent){this.element=createElementWithClass("div","vbox flex-auto");this._shadowRoot=WebInspector.createShadowRootWithCoreStyles(this.element);this._shadowRoot.appendChild(this.contentElement);}else{this.element=this.contentElement;}
this._isWebComponent=isWebComponent;this.element.__widget=this;this._visible=true;this._isRoot=false;this._isShowing=false;this._children=[];this._hideOnDetach=false;this._notificationDepth=0;}
WebInspector.Widget.prototype={markAsRoot:function()
{WebInspector.Widget.__assert(!this.element.parentElement,"Attempt to mark as root attached node");this._isRoot=true;},parentWidget:function()
{return this._parentWidget;},children:function()
{return this._children;},childWasDetached:function(widget)
{},isShowing:function()
{return this._isShowing;},shouldHideOnDetach:function()
{if(this._hideOnDetach)
return true;for(var child of this._children){if(child.shouldHideOnDetach())
return true;}
return false;},setHideOnDetach:function()
{this._hideOnDetach=true;},_inNotification:function()
{return!!this._notificationDepth||(this._parentWidget&&this._parentWidget._inNotification());},_parentIsShowing:function()
{if(this._isRoot)
return true;return this._parentWidget&&this._parentWidget.isShowing();},_callOnVisibleChildren:function(method)
{var copy=this._children.slice();for(var i=0;i<copy.length;++i){if(copy[i]._parentWidget===this&&copy[i]._visible)
method.call(copy[i]);}},_processWillShow:function()
{this._callOnVisibleChildren(this._processWillShow);this._isShowing=true;},_processWasShown:function()
{if(this._inNotification())
return;this.restoreScrollPositions();this._notify(this.wasShown);this._callOnVisibleChildren(this._processWasShown);},_processWillHide:function()
{if(this._inNotification())
return;this.storeScrollPositions();this._callOnVisibleChildren(this._processWillHide);this._notify(this.willHide);this._isShowing=false;},_processWasHidden:function()
{this._callOnVisibleChildren(this._processWasHidden);},_processOnResize:function()
{if(this._inNotification())
return;if(!this.isShowing())
return;this._notify(this.onResize);this._callOnVisibleChildren(this._processOnResize);},_notify:function(notification)
{++this._notificationDepth;try{notification.call(this);}finally{--this._notificationDepth;}},wasShown:function()
{},willHide:function()
{},onResize:function()
{},onLayout:function()
{},show:function(parentElement,insertBefore)
{WebInspector.Widget.__assert(parentElement,"Attempt to attach widget with no parent element");if(this.element.parentElement!==parentElement){if(this.element.parentElement)
this.detach();var currentParent=parentElement;while(currentParent&&!currentParent.__widget)
currentParent=currentParent.parentElementOrShadowHost();if(currentParent){this._parentWidget=currentParent.__widget;this._parentWidget._children.push(this);this._isRoot=false;}else
WebInspector.Widget.__assert(this._isRoot,"Attempt to attach widget to orphan node");}else if(this._visible){return;}
this._visible=true;if(this._parentIsShowing())
this._processWillShow();this.element.classList.remove("hidden");if(this.element.parentElement!==parentElement){WebInspector.Widget._incrementWidgetCounter(parentElement,this.element);if(insertBefore)
WebInspector.Widget._originalInsertBefore.call(parentElement,this.element,insertBefore);else
WebInspector.Widget._originalAppendChild.call(parentElement,this.element);}
if(this._parentIsShowing())
this._processWasShown();if(this._parentWidget&&this._hasNonZeroConstraints())
this._parentWidget.invalidateConstraints();else
this._processOnResize();},detach:function(overrideHideOnDetach)
{var parentElement=this.element.parentElement;if(!parentElement)
return;if(this._parentIsShowing())
this._processWillHide();if(!overrideHideOnDetach&&this.shouldHideOnDetach()){this.element.classList.add("hidden");this._visible=false;if(this._parentIsShowing())
this._processWasHidden();if(this._parentWidget&&this._hasNonZeroConstraints())
this._parentWidget.invalidateConstraints();return;}
WebInspector.Widget._decrementWidgetCounter(parentElement,this.element);WebInspector.Widget._originalRemoveChild.call(parentElement,this.element);this._visible=false;if(this._parentIsShowing())
this._processWasHidden();if(this._parentWidget){var childIndex=this._parentWidget._children.indexOf(this);WebInspector.Widget.__assert(childIndex>=0,"Attempt to remove non-child widget");this._parentWidget._children.splice(childIndex,1);this._parentWidget.childWasDetached(this);var parent=this._parentWidget;this._parentWidget=null;if(this._hasNonZeroConstraints())
parent.invalidateConstraints();}else
WebInspector.Widget.__assert(this._isRoot,"Removing non-root widget from DOM");},detachChildWidgets:function()
{var children=this._children.slice();for(var i=0;i<children.length;++i)
children[i].detach();},elementsToRestoreScrollPositionsFor:function()
{return[this.element];},storeScrollPositions:function()
{var elements=this.elementsToRestoreScrollPositionsFor();for(var i=0;i<elements.length;++i){var container=elements[i];container._scrollTop=container.scrollTop;container._scrollLeft=container.scrollLeft;}},restoreScrollPositions:function()
{var elements=this.elementsToRestoreScrollPositionsFor();for(var i=0;i<elements.length;++i){var container=elements[i];if(container._scrollTop)
container.scrollTop=container._scrollTop;if(container._scrollLeft)
container.scrollLeft=container._scrollLeft;}},doResize:function()
{if(!this.isShowing())
return;if(!this._inNotification())
this._callOnVisibleChildren(this._processOnResize);},doLayout:function()
{if(!this.isShowing())
return;this._notify(this.onLayout);this.doResize();},registerRequiredCSS:function(cssFile)
{WebInspector.appendStyle(this._isWebComponent?this._shadowRoot:this.element,cssFile);},printWidgetHierarchy:function()
{var lines=[];this._collectWidgetHierarchy("",lines);console.log(lines.join("\n"));},_collectWidgetHierarchy:function(prefix,lines)
{lines.push(prefix+"["+this.element.className+"]"+(this._children.length?" {":""));for(var i=0;i<this._children.length;++i)
this._children[i]._collectWidgetHierarchy(prefix+" ",lines);if(this._children.length)
lines.push(prefix+"}");},defaultFocusedElement:function()
{return this._defaultFocusedElement||this.element;},setDefaultFocusedElement:function(element)
{this._defaultFocusedElement=element;},focus:function()
{var element=this.defaultFocusedElement();if(!element||element.isAncestor(this.element.ownerDocument.activeElement))
return;WebInspector.setCurrentFocusElement(element);},hasFocus:function()
{var activeElement=this.element.ownerDocument.activeElement;return activeElement&&activeElement.isSelfOrDescendant(this.element);},measurePreferredSize:function()
{var document=this.element.ownerDocument;WebInspector.Widget._originalAppendChild.call(document.body,this.element);this.element.positionAt(0,0);var result=new Size(this.element.offsetWidth,this.element.offsetHeight);this.element.positionAt(undefined,undefined);WebInspector.Widget._originalRemoveChild.call(document.body,this.element);return result;},calculateConstraints:function()
{return new Constraints();},constraints:function()
{if(typeof this._constraints!=="undefined")
return this._constraints;if(typeof this._cachedConstraints==="undefined")
this._cachedConstraints=this.calculateConstraints();return this._cachedConstraints;},setMinimumAndPreferredSizes:function(width,height,preferredWidth,preferredHeight)
{this._constraints=new Constraints(new Size(width,height),new Size(preferredWidth,preferredHeight));this.invalidateConstraints();},setMinimumSize:function(width,height)
{this._constraints=new Constraints(new Size(width,height));this.invalidateConstraints();},_hasNonZeroConstraints:function()
{var constraints=this.constraints();return!!(constraints.minimum.width||constraints.minimum.height||constraints.preferred.width||constraints.preferred.height);},invalidateConstraints:function()
{var cached=this._cachedConstraints;delete this._cachedConstraints;var actual=this.constraints();if(!actual.isEqual(cached)&&this._parentWidget)
this._parentWidget.invalidateConstraints();else
this.doLayout();},invalidateSize:function()
{if(this._parentWidget)
this._parentWidget.doLayout();},__proto__:WebInspector.Object.prototype}
WebInspector.Widget._originalAppendChild=Element.prototype.appendChild;WebInspector.Widget._originalInsertBefore=Element.prototype.insertBefore;WebInspector.Widget._originalRemoveChild=Element.prototype.removeChild;WebInspector.Widget._originalRemoveChildren=Element.prototype.removeChildren;WebInspector.Widget._incrementWidgetCounter=function(parentElement,childElement)
{var count=(childElement.__widgetCounter||0)+(childElement.__widget?1:0);if(!count)
return;while(parentElement){parentElement.__widgetCounter=(parentElement.__widgetCounter||0)+count;parentElement=parentElement.parentElementOrShadowHost();}}
WebInspector.Widget._decrementWidgetCounter=function(parentElement,childElement)
{var count=(childElement.__widgetCounter||0)+(childElement.__widget?1:0);if(!count)
return;while(parentElement){parentElement.__widgetCounter-=count;parentElement=parentElement.parentElementOrShadowHost();}}
WebInspector.Widget.__assert=function(condition,message)
{if(!condition){console.trace();throw new Error(message);}}
WebInspector.VBox=function(isWebComponent)
{WebInspector.Widget.call(this,isWebComponent);this.contentElement.classList.add("vbox");};WebInspector.VBox.prototype={calculateConstraints:function()
{var constraints=new Constraints();function updateForChild()
{var child=this.constraints();constraints=constraints.widthToMax(child);constraints=constraints.addHeight(child);}
this._callOnVisibleChildren(updateForChild);return constraints;},__proto__:WebInspector.Widget.prototype};WebInspector.HBox=function(isWebComponent)
{WebInspector.Widget.call(this,isWebComponent);this.contentElement.classList.add("hbox");};WebInspector.HBox.prototype={calculateConstraints:function()
{var constraints=new Constraints();function updateForChild()
{var child=this.constraints();constraints=constraints.addWidth(child);constraints=constraints.heightToMax(child);}
this._callOnVisibleChildren(updateForChild);return constraints;},__proto__:WebInspector.Widget.prototype};WebInspector.VBoxWithResizeCallback=function(resizeCallback)
{WebInspector.VBox.call(this);this._resizeCallback=resizeCallback;}
WebInspector.VBoxWithResizeCallback.prototype={onResize:function()
{this._resizeCallback();},__proto__:WebInspector.VBox.prototype}
WebInspector.VBoxWithToolbarItems=function()
{WebInspector.VBox.call(this);}
WebInspector.VBoxWithToolbarItems.prototype={toolbarItems:function()
{return[];},__proto__:WebInspector.VBox.prototype}
Element.prototype.appendChild=function(child)
{WebInspector.Widget.__assert(!child.__widget||child.parentElement===this,"Attempt to add widget via regular DOM operation.");return WebInspector.Widget._originalAppendChild.call(this,child);}
Element.prototype.insertBefore=function(child,anchor)
{WebInspector.Widget.__assert(!child.__widget||child.parentElement===this,"Attempt to add widget via regular DOM operation.");return WebInspector.Widget._originalInsertBefore.call(this,child,anchor);}
Element.prototype.removeChild=function(child)
{WebInspector.Widget.__assert(!child.__widgetCounter&&!child.__widget,"Attempt to remove element containing widget via regular DOM operation");return WebInspector.Widget._originalRemoveChild.call(this,child);}
Element.prototype.removeChildren=function()
{WebInspector.Widget.__assert(!this.__widgetCounter,"Attempt to remove element containing widget via regular DOM operation");WebInspector.Widget._originalRemoveChildren.call(this);};function TreeOutline(nonFocusable)
{this._createRootElement();this.selectedTreeElement=null;this.expandTreeElementsWhenArrowing=false;this._comparator=null;this._contentElement=this._rootElement._childrenListNode;this._contentElement.addEventListener("keydown",this._treeKeyDown.bind(this),true);this.setFocusable(!nonFocusable);this.element=this._contentElement;}
TreeOutline.Events={ElementAttached:"ElementAttached",ElementExpanded:"ElementExpanded",ElementCollapsed:"ElementCollapsed",ElementSelected:"ElementSelected"}
TreeOutline.prototype={_createRootElement:function()
{this._rootElement=new TreeElement();this._rootElement.treeOutline=this;this._rootElement.root=true;this._rootElement.selectable=false;this._rootElement.expanded=true;this._rootElement._childrenListNode.classList.remove("children");},rootElement:function()
{return this._rootElement;},firstChild:function()
{return this._rootElement.firstChild();},appendChild:function(child)
{this._rootElement.appendChild(child);},insertChild:function(child,index)
{this._rootElement.insertChild(child,index);},removeChild:function(child)
{this._rootElement.removeChild(child);},removeChildren:function()
{this._rootElement.removeChildren();},treeElementFromPoint:function(x,y)
{var node=this._contentElement.ownerDocument.deepElementFromPoint(x,y);if(!node)
return null;var listNode=node.enclosingNodeOrSelfWithNodeNameInArray(["ol","li"]);if(listNode)
return listNode.parentTreeElement||listNode.treeElement;return null;},treeElementFromEvent:function(event)
{return event?this.treeElementFromPoint(event.pageX,event.pageY):null;},setComparator:function(comparator)
{this._comparator=comparator;},setFocusable:function(focusable)
{if(focusable)
this._contentElement.setAttribute("tabIndex",0);else
this._contentElement.removeAttribute("tabIndex");},focus:function()
{this._contentElement.focus();},_bindTreeElement:function(element)
{if(element.treeOutline)
console.error("Binding element for the second time: "+new Error().stack);element.treeOutline=this;element.onbind();},_unbindTreeElement:function(element)
{if(!element.treeOutline)
console.error("Unbinding element that was not bound: "+new Error().stack);element.deselect();element.onunbind();element.treeOutline=null;},selectPrevious:function()
{var nextSelectedElement=this.selectedTreeElement.traversePreviousTreeElement(true);while(nextSelectedElement&&!nextSelectedElement.selectable)
nextSelectedElement=nextSelectedElement.traversePreviousTreeElement(!this.expandTreeElementsWhenArrowing);if(nextSelectedElement){nextSelectedElement.reveal();nextSelectedElement.select(false,true);return true;}
return false;},selectNext:function()
{var nextSelectedElement=this.selectedTreeElement.traverseNextTreeElement(true);while(nextSelectedElement&&!nextSelectedElement.selectable)
nextSelectedElement=nextSelectedElement.traverseNextTreeElement(!this.expandTreeElementsWhenArrowing);if(nextSelectedElement){nextSelectedElement.reveal();nextSelectedElement.select(false,true);return true;}
return false;},_treeKeyDown:function(event)
{if(event.target!==this._contentElement)
return;if(!this.selectedTreeElement||event.shiftKey||event.metaKey||event.ctrlKey)
return;var handled=false;var nextSelectedElement;if(event.keyIdentifier==="Up"&&!event.altKey){handled=this.selectPrevious();}else if(event.keyIdentifier==="Down"&&!event.altKey){handled=this.selectNext();}else if(event.keyIdentifier==="Left"){if(this.selectedTreeElement.expanded){if(event.altKey)
this.selectedTreeElement.collapseRecursively();else
this.selectedTreeElement.collapse();handled=true;}else if(this.selectedTreeElement.parent&&!this.selectedTreeElement.parent.root){handled=true;if(this.selectedTreeElement.parent.selectable){nextSelectedElement=this.selectedTreeElement.parent;while(nextSelectedElement&&!nextSelectedElement.selectable)
nextSelectedElement=nextSelectedElement.parent;handled=nextSelectedElement?true:false;}else if(this.selectedTreeElement.parent)
this.selectedTreeElement.parent.collapse();}}else if(event.keyIdentifier==="Right"){if(!this.selectedTreeElement.revealed()){this.selectedTreeElement.reveal();handled=true;}else if(this.selectedTreeElement._expandable){handled=true;if(this.selectedTreeElement.expanded){nextSelectedElement=this.selectedTreeElement.firstChild();while(nextSelectedElement&&!nextSelectedElement.selectable)
nextSelectedElement=nextSelectedElement.nextSibling;handled=nextSelectedElement?true:false;}else{if(event.altKey)
this.selectedTreeElement.expandRecursively();else
this.selectedTreeElement.expand();}}}else if(event.keyCode===8||event.keyCode===46)
handled=this.selectedTreeElement.ondelete();else if(isEnterKey(event))
handled=this.selectedTreeElement.onenter();else if(event.keyCode===WebInspector.KeyboardShortcut.Keys.Space.code)
handled=this.selectedTreeElement.onspace();if(nextSelectedElement){nextSelectedElement.reveal();nextSelectedElement.select(false,true);}
if(handled)
event.consume(true);},_deferredScrollIntoView:function(treeElement,center)
{if(!this._treeElementToScrollIntoView)
this.element.window().requestAnimationFrame(deferredScrollIntoView.bind(this));this._treeElementToScrollIntoView=treeElement;this._centerUponScrollIntoView=center;function deferredScrollIntoView()
{this._treeElementToScrollIntoView.listItemElement.scrollIntoViewIfNeeded(this._centerUponScrollIntoView);delete this._treeElementToScrollIntoView;delete this._centerUponScrollIntoView;}},__proto__:WebInspector.Object.prototype}
function TreeOutlineInShadow(className)
{TreeOutline.call(this);var innerElement=this.element;innerElement.classList.add("tree-outline");if(className)
innerElement.classList.add(className);this.element=createElement("div");this._shadowRoot=WebInspector.createShadowRootWithCoreStyles(this.element,"ui/treeoutline.css");var contentElement=this._shadowRoot.createChild("div","tree-outline-disclosure");contentElement.appendChild(innerElement);this._renderSelection=true;}
TreeOutlineInShadow.prototype={registerRequiredCSS:function(cssFile)
{WebInspector.appendStyle(this._shadowRoot,cssFile);},__proto__:TreeOutline.prototype}
function TreeElement(title,expandable)
{this.treeOutline=null;this.parent=null;this.previousSibling=null;this.nextSibling=null;this._listItemNode=createElement("li");this._listItemNode.treeElement=this;if(title)
this.title=title;this._listItemNode.addEventListener("mousedown",this._handleMouseDown.bind(this),false);this._listItemNode.addEventListener("selectstart",this._treeElementSelectStart.bind(this),false);this._listItemNode.addEventListener("click",this._treeElementToggled.bind(this),false);this._listItemNode.addEventListener("dblclick",this._handleDoubleClick.bind(this),false);this._childrenListNode=createElement("ol");this._childrenListNode.parentTreeElement=this;this._childrenListNode.classList.add("children");this._hidden=false;this._selectable=true;this.expanded=false;this.selected=false;this.setExpandable(expandable||false);this._collapsible=true;}
TreeElement._ArrowToggleWidth=10;TreeElement.prototype={hasAncestor:function(ancestor)
{if(!ancestor)
return false;var currentNode=this.parent;while(currentNode){if(ancestor===currentNode)
return true;currentNode=currentNode.parent;}
return false;},hasAncestorOrSelf:function(ancestor)
{return this===ancestor||this.hasAncestor(ancestor);},children:function()
{return this._children||[];},childCount:function()
{return this._children?this._children.length:0;},firstChild:function()
{return this._children?this._children[0]:null;},lastChild:function()
{return this._children?this._children[this._children.length-1]:null;},childAt:function(index)
{return this._children?this._children[index]:null;},indexOfChild:function(child)
{return this._children?this._children.indexOf(child):-1;},appendChild:function(child)
{if(!this._children)
this._children=[];var insertionIndex;if(this.treeOutline&&this.treeOutline._comparator)
insertionIndex=insertionIndexForObjectInListSortedByFunction(child,this._children,this.treeOutline._comparator);else
insertionIndex=this._children.length;this.insertChild(child,insertionIndex);},insertChild:function(child,index)
{if(!this._children)
this._children=[];if(!child)
throw("child can't be undefined or null");console.assert(!child.parent,"Attempting to insert a child that is already in the tree, reparenting is not supported.");var previousChild=(index>0?this._children[index-1]:null);if(previousChild){previousChild.nextSibling=child;child.previousSibling=previousChild;}else{child.previousSibling=null;}
var nextChild=this._children[index];if(nextChild){nextChild.previousSibling=child;child.nextSibling=nextChild;}else{child.nextSibling=null;}
this._children.splice(index,0,child);this.setExpandable(true);child.parent=this;if(this.treeOutline)
this.treeOutline._bindTreeElement(child);for(var current=child.firstChild();this.treeOutline&&current;current=current.traverseNextTreeElement(false,child,true))
this.treeOutline._bindTreeElement(current);child.onattach();child._ensureSelection();if(this.treeOutline)
this.treeOutline.dispatchEventToListeners(TreeOutline.Events.ElementAttached,child);var nextSibling=child.nextSibling?child.nextSibling._listItemNode:null;this._childrenListNode.insertBefore(child._listItemNode,nextSibling);this._childrenListNode.insertBefore(child._childrenListNode,nextSibling);if(child.selected)
child.select();if(child.expanded)
child.expand();},removeChildAtIndex:function(childIndex)
{if(childIndex<0||childIndex>=this._children.length)
throw("childIndex out of range");var child=this._children[childIndex];this._children.splice(childIndex,1);var parent=child.parent;if(this.treeOutline&&this.treeOutline.selectedTreeElement&&this.treeOutline.selectedTreeElement.hasAncestorOrSelf(child)){if(child.nextSibling)
child.nextSibling.select(true);else if(child.previousSibling)
child.previousSibling.select(true);else if(parent)
parent.select(true);}
if(child.previousSibling)
child.previousSibling.nextSibling=child.nextSibling;if(child.nextSibling)
child.nextSibling.previousSibling=child.previousSibling;child.parent=null;if(this.treeOutline)
this.treeOutline._unbindTreeElement(child);for(var current=child.firstChild();this.treeOutline&&current;current=current.traverseNextTreeElement(false,child,true))
this.treeOutline._unbindTreeElement(current);child._detach();},removeChild:function(child)
{if(!child)
throw("child can't be undefined or null");if(child.parent!==this)
return;var childIndex=this._children.indexOf(child);if(childIndex===-1)
throw("child not found in this node's children");this.removeChildAtIndex(childIndex);},removeChildren:function()
{if(!this.root&&this.treeOutline&&this.treeOutline.selectedTreeElement&&this.treeOutline.selectedTreeElement.hasAncestorOrSelf(this))
this.select(true);for(var i=0;this._children&&i<this._children.length;++i){var child=this._children[i];child.previousSibling=null
child.nextSibling=null;child.parent=null;if(this.treeOutline)
this.treeOutline._unbindTreeElement(child);for(var current=child.firstChild();this.treeOutline&&current;current=current.traverseNextTreeElement(false,child,true))
this.treeOutline._unbindTreeElement(current);child._detach();}
this._children=[];},get selectable()
{if(this._hidden)
return false;return this._selectable;},set selectable(x)
{this._selectable=x;},get listItemElement()
{return this._listItemNode;},get childrenListElement()
{return this._childrenListNode;},get title()
{return this._title;},set title(x)
{if(this._title===x)
return;this._title=x;if(typeof x==="string"){this._titleElement=createElementWithClass("span","tree-element-title");this._titleElement.textContent=x;this.tooltip=x;}else{this._titleElement=x;this.tooltip="";}
this._listItemNode.removeChildren();if(this._iconElement)
this._listItemNode.appendChild(this._iconElement);this._listItemNode.appendChild(this._titleElement);this._ensureSelection();},startEditingTitle:function(editingConfig)
{WebInspector.InplaceEditor.startEditing(this._titleElement,editingConfig);this.treeOutline._shadowRoot.getSelection().setBaseAndExtent(this._titleElement,0,this._titleElement,1);},createIcon()
{if(!this._iconElement){this._iconElement=createElementWithClass("div","icon");this._listItemNode.insertBefore(this._iconElement,this._listItemNode.firstChild);this._ensureSelection();}},get tooltip()
{return this._tooltip||"";},set tooltip(x)
{if(this._tooltip===x)
return;this._tooltip=x;this._listItemNode.title=x;},isExpandable:function()
{return this._expandable;},setExpandable:function(expandable)
{if(this._expandable===expandable)
return;this._expandable=expandable;this._listItemNode.classList.toggle("parent",expandable);if(!expandable)
this.collapse();},setCollapsible:function(collapsible)
{if(this._collapsible===collapsible)
return;this._collapsible=collapsible;this._listItemNode.classList.toggle("always-parent",!collapsible);if(!collapsible)
this.expand();},get hidden()
{return this._hidden;},set hidden(x)
{if(this._hidden===x)
return;this._hidden=x;this._listItemNode.classList.toggle("hidden",x);this._childrenListNode.classList.toggle("hidden",x);},invalidateChildren:function()
{if(this._children){this.removeChildren();this._children=null;}},_ensureSelection:function()
{if(!this.treeOutline||!this.treeOutline._renderSelection)
return;if(!this._selectionElement)
this._selectionElement=createElementWithClass("div","selection fill");this._listItemNode.insertBefore(this._selectionElement,this.listItemElement.firstChild);},_treeElementSelectStart:function(event)
{event.currentTarget._selectionStarted=true;},_treeElementToggled:function(event)
{var element=event.currentTarget;if(element._selectionStarted){delete element._selectionStarted;var selection=element.getComponentSelection();if(selection&&!selection.isCollapsed&&element.isSelfOrAncestor(selection.anchorNode)&&element.isSelfOrAncestor(selection.focusNode))
return;}
if(element.treeElement!==this)
return;var toggleOnClick=this.toggleOnClick&&!this.selectable;var isInTriangle=this.isEventWithinDisclosureTriangle(event);if(!toggleOnClick&&!isInTriangle)
return;if(event.target&&event.target.enclosingNodeOrSelfWithNodeName("a"))
return;if(this.expanded){if(event.altKey)
this.collapseRecursively();else
this.collapse();}else{if(event.altKey)
this.expandRecursively();else
this.expand();}
event.consume();},_handleMouseDown:function(event)
{var element=event.currentTarget;if(!element)
return;delete element._selectionStarted;if(!this.selectable)
return;if(element.treeElement!==this)
return;if(this.isEventWithinDisclosureTriangle(event))
return;this.selectOnMouseDown(event);},_handleDoubleClick:function(event)
{var element=event.currentTarget;if(!element||element.treeElement!==this)
return;var handled=this.ondblclick(event);if(handled)
return;if(this._expandable&&!this.expanded)
this.expand();},_detach:function()
{this._listItemNode.remove();this._childrenListNode.remove();},collapse:function()
{if(!this.expanded||!this._collapsible)
return;this._listItemNode.classList.remove("expanded");this._childrenListNode.classList.remove("expanded");this.expanded=false;this.oncollapse();if(this.treeOutline)
this.treeOutline.dispatchEventToListeners(TreeOutline.Events.ElementCollapsed,this);},collapseRecursively:function()
{var item=this;while(item){if(item.expanded)
item.collapse();item=item.traverseNextTreeElement(false,this,true);}},expand:function()
{if(!this._expandable||(this.expanded&&this._children))
return;this.expanded=true;this._populateIfNeeded();this._listItemNode.classList.add("expanded");this._childrenListNode.classList.add("expanded");if(this.treeOutline){this.onexpand();this.treeOutline.dispatchEventToListeners(TreeOutline.Events.ElementExpanded,this);}},expandRecursively:function(maxDepth)
{var item=this;var info={};var depth=0;if(isNaN(maxDepth))
maxDepth=3;while(item){if(depth<maxDepth)
item.expand();item=item.traverseNextTreeElement(false,this,(depth>=maxDepth),info);depth+=info.depthChange;}},reveal:function(center)
{var currentAncestor=this.parent;while(currentAncestor&&!currentAncestor.root){if(!currentAncestor.expanded)
currentAncestor.expand();currentAncestor=currentAncestor.parent;}
this.treeOutline._deferredScrollIntoView(this,!!center);},revealed:function()
{var currentAncestor=this.parent;while(currentAncestor&&!currentAncestor.root){if(!currentAncestor.expanded)
return false;currentAncestor=currentAncestor.parent;}
return true;},selectOnMouseDown:function(event)
{if(this.select(false,true))
event.consume(true);},select:function(omitFocus,selectedByUser)
{if(!this.treeOutline||!this.selectable||this.selected)
return false;if(this.treeOutline.selectedTreeElement)
this.treeOutline.selectedTreeElement.deselect();this.treeOutline.selectedTreeElement=null;if(this.treeOutline._rootElement===this)
return false;this.selected=true;if(!omitFocus)
this.treeOutline.focus();if(!this.treeOutline)
return false;this.treeOutline.selectedTreeElement=this;this._listItemNode.classList.add("selected");this.treeOutline.dispatchEventToListeners(TreeOutline.Events.ElementSelected,this);return this.onselect(selectedByUser);},revealAndSelect:function(omitFocus)
{this.reveal(true);this.select(omitFocus);},deselect:function(supressOnDeselect)
{if(!this.treeOutline||this.treeOutline.selectedTreeElement!==this||!this.selected)
return;this.selected=false;this.treeOutline.selectedTreeElement=null;this._listItemNode.classList.remove("selected");},_populateIfNeeded:function()
{if(this.treeOutline&&this._expandable&&!this._children){this._children=[];this.onpopulate();}},onpopulate:function()
{},onenter:function()
{return false;},ondelete:function()
{return false;},onspace:function()
{return false;},onbind:function()
{},onunbind:function()
{},onattach:function()
{},onexpand:function()
{},oncollapse:function()
{},ondblclick:function(e)
{return false;},onselect:function(selectedByUser)
{return false;},traverseNextTreeElement:function(skipUnrevealed,stayWithin,dontPopulate,info)
{if(!dontPopulate)
this._populateIfNeeded();if(info)
info.depthChange=0;var element=skipUnrevealed?(this.revealed()?this.firstChild():null):this.firstChild();if(element&&(!skipUnrevealed||(skipUnrevealed&&this.expanded))){if(info)
info.depthChange=1;return element;}
if(this===stayWithin)
return null;element=skipUnrevealed?(this.revealed()?this.nextSibling:null):this.nextSibling;if(element)
return element;element=this;while(element&&!element.root&&!(skipUnrevealed?(element.revealed()?element.nextSibling:null):element.nextSibling)&&element.parent!==stayWithin){if(info)
info.depthChange-=1;element=element.parent;}
if(!element||element.root)
return null;return(skipUnrevealed?(element.revealed()?element.nextSibling:null):element.nextSibling);},traversePreviousTreeElement:function(skipUnrevealed,dontPopulate)
{var element=skipUnrevealed?(this.revealed()?this.previousSibling:null):this.previousSibling;if(!dontPopulate&&element)
element._populateIfNeeded();while(element&&(skipUnrevealed?(element.revealed()&&element.expanded?element.lastChild():null):element.lastChild())){if(!dontPopulate)
element._populateIfNeeded();element=(skipUnrevealed?(element.revealed()&&element.expanded?element.lastChild():null):element.lastChild());}
if(element)
return element;if(!this.parent||this.parent.root)
return null;return this.parent;},isEventWithinDisclosureTriangle:function(event)
{var paddingLeftValue=window.getComputedStyle(this._listItemNode).paddingLeft;console.assert(paddingLeftValue.endsWith("px"));var computedLeftPadding=parseFloat(paddingLeftValue);var left=this._listItemNode.totalOffsetLeft()+computedLeftPadding;return event.pageX>=left&&event.pageX<=left+TreeElement._ArrowToggleWidth&&this._expandable;}};WebInspector.ActionRegistry=function()
{this._actionsById=new Map();this._registerActions();}
WebInspector.ActionRegistry.prototype={_registerActions:function()
{self.runtime.extensions(WebInspector.ActionDelegate).forEach(registerExtension,this);function registerExtension(extension)
{var actionId=extension.descriptor()["actionId"];console.assert(actionId);console.assert(!this._actionsById.get(actionId));this._actionsById.set(actionId,new WebInspector.Action(extension));}},applicableActions:function(actionIds,context)
{var extensions=[];actionIds.forEach(function(actionId){var action=this._actionsById.get(actionId);if(action)
extensions.push(action._extension);},this);return context.applicableExtensions(extensions).valuesArray().map(extensionToAction.bind(this));function extensionToAction(extension)
{return this.action(extension.descriptor()["actionId"]);}},action:function(actionId)
{var action=this._actionsById.get(actionId);console.assert(action,"No action found for actionId '"+actionId+"'");return(action);}}
WebInspector.Action=function(extension)
{WebInspector.Object.call(this);this._extension=extension;this._enabled=true;this._toggled=false;this._title=this._extension.descriptor()["title"]||"";this._statesCount=this._extension.descriptor()["states"]||2;if(this._statesCount==2)
this._state=WebInspector.Action._ToggleState.Off;else
this._state="0";}
WebInspector.Action._ToggleState={On:"on",Off:"off"}
WebInspector.Action.Events={Enabled:"Enabled",StateChanged:"StateChanged",TitleChanged:"TitleChanged",}
WebInspector.Action.prototype={statesCount:function()
{return this._statesCount;},id:function()
{return this._extension.descriptor()["actionId"];},execute:function()
{return this._extension.instancePromise().then(handleAction.bind(this));function handleAction(actionDelegate)
{var actionId=this._extension.descriptor()["actionId"];var delegate=(actionDelegate);return delegate.handleAction(WebInspector.context,actionId);}},icon:function()
{return this._extension.descriptor()["iconClass"]||"";},setEnabled:function(enabled)
{if(this._enabled===enabled)
return;this._enabled=enabled;this.dispatchEventToListeners(WebInspector.Action.Events.Enabled,enabled);},enabled:function()
{return this._enabled;},setTitle:function(title)
{if(this._title===title)
return;this._title=title;this.dispatchEventToListeners(WebInspector.Action.Events.TitleChanged,this._title);},title:function()
{return this._title;},state:function()
{return this._state;},setState:function(newState)
{if(this._state===newState)
return;var oldState=this._state;this._state=newState;this.dispatchEventToListeners(WebInspector.Action.Events.StateChanged,{oldState:oldState,newState:newState})},toggled:function()
{if(this._statesCount!==2)
throw("Only used toggled when there are 2 states, otherwise, use state");return this.state()===WebInspector.Action._ToggleState.On;},setToggled:function(toggled)
{if(this._statesCount!==2)
throw("Only used toggled when there are 2 states, otherwise, use state");this.setState(toggled?WebInspector.Action._ToggleState.On:WebInspector.Action._ToggleState.Off);},__proto__:WebInspector.Object.prototype}
WebInspector.ActionDelegate=function()
{}
WebInspector.ActionDelegate.prototype={handleAction:function(context,actionId){}}
WebInspector.actionRegistry;;WebInspector.ShortcutRegistry=function(actionRegistry,document)
{this._actionRegistry=actionRegistry;this._defaultKeyToActions=new Multimap();this._defaultActionToShortcut=new Multimap();this._registerBindings(document);}
WebInspector.ShortcutRegistry.prototype={_applicableActions:function(key)
{return this._actionRegistry.applicableActions(this._defaultActionsForKey(key).valuesArray(),WebInspector.context);},_defaultActionsForKey:function(key)
{return this._defaultKeyToActions.get(String(key));},shortcutDescriptorsForAction:function(actionId)
{return this._defaultActionToShortcut.get(actionId).valuesArray();},keysForActions:function(actionIds)
{var result=[];for(var i=0;i<actionIds.length;++i){var descriptors=this.shortcutDescriptorsForAction(actionIds[i]);for(var j=0;j<descriptors.length;++j)
result.push(descriptors[j].key);}
return result;},shortcutTitleForAction:function(actionId)
{var descriptors=this.shortcutDescriptorsForAction(actionId);if(descriptors.length)
return descriptors[0].name;},handleShortcut:function(event)
{this.handleKey(WebInspector.KeyboardShortcut.makeKeyFromEvent(event),event.keyIdentifier,event);},handleKey:function(key,keyIdentifier,event)
{var keyModifiers=key>>8;var actions=this._applicableActions(key);if(!actions.length)
return;if(WebInspector.GlassPane.DefaultFocusedViewStack.length>1){if(event&&!isPossiblyInputKey())
event.consume(true);return;}
if(!isPossiblyInputKey()){if(event)
event.consume(true);processNextAction.call(this,false);}else{this._pendingActionTimer=setTimeout(processNextAction.bind(this,false),0);}
function processNextAction(handled)
{delete this._pendingActionTimer;var action=actions.shift();if(!action||handled)
return;action.execute().then(processNextAction.bind(this));}
function isPossiblyInputKey()
{if(!event||!WebInspector.isEditing()||/^F\d+|Control|Shift|Alt|Meta|Win|U\+001B$/.test(keyIdentifier))
return false;if(!keyModifiers)
return true;var modifiers=WebInspector.KeyboardShortcut.Modifiers;if((keyModifiers&(modifiers.Ctrl|modifiers.Alt))===(modifiers.Ctrl|modifiers.Alt))
return WebInspector.isWin();return!hasModifier(modifiers.Ctrl)&&!hasModifier(modifiers.Alt)&&!hasModifier(modifiers.Meta);}
function hasModifier(mod)
{return!!(keyModifiers&mod);}},registerShortcut:function(actionId,shortcut)
{var descriptor=WebInspector.KeyboardShortcut.makeDescriptorFromBindingShortcut(shortcut);if(!descriptor)
return;this._defaultActionToShortcut.set(actionId,descriptor);this._defaultKeyToActions.set(String(descriptor.key),actionId);},dismissPendingShortcutAction:function()
{if(this._pendingActionTimer){clearTimeout(this._pendingActionTimer);delete this._pendingActionTimer;}},_registerBindings:function(document)
{document.addEventListener("input",this.dismissPendingShortcutAction.bind(this),true);var extensions=self.runtime.extensions(WebInspector.ActionDelegate);extensions.forEach(registerExtension,this);function registerExtension(extension)
{var descriptor=extension.descriptor();var bindings=descriptor["bindings"];for(var i=0;bindings&&i<bindings.length;++i){if(!platformMatches(bindings[i].platform))
continue;var shortcuts=bindings[i]["shortcut"].split(/\s+/);shortcuts.forEach(this.registerShortcut.bind(this,descriptor["actionId"]));}}
function platformMatches(platformsString)
{if(!platformsString)
return true;var platforms=platformsString.split(",");var isMatch=false;var currentPlatform=WebInspector.platform();for(var i=0;!isMatch&&i<platforms.length;++i)
isMatch=platforms[i]===currentPlatform;return isMatch;}}}
WebInspector.ShortcutRegistry.ForwardedShortcut=function()
{}
WebInspector.ShortcutRegistry.ForwardedShortcut.instance=new WebInspector.ShortcutRegistry.ForwardedShortcut();WebInspector.shortcutRegistry;;WebInspector.ColorSwatch=function()
{}
WebInspector.ColorSwatch.create=function()
{if(!WebInspector.ColorSwatch._constructor)
WebInspector.ColorSwatch._constructor=registerCustomElement("span","color-swatch",WebInspector.ColorSwatch.prototype);return(new WebInspector.ColorSwatch._constructor());}
WebInspector.ColorSwatch.prototype={color:function()
{return this._color;},setColorText:function(colorText)
{this._color=WebInspector.Color.parse(colorText);console.assert(this._color,"Color text could not be parsed.");this._format=this._color.format();this._colorValueElement.textContent=this._color.asString(this._format);this._swatchInner.style.backgroundColor=colorText;},format:function()
{return this._format;},setFormat:function(format)
{this._format=format;this._colorValueElement.textContent=this._color.asString(this._format);},toggleNextFormat:function()
{do{this._format=WebInspector.ColorSwatch._nextColorFormat(this._color,this._format);var currentValue=this._color.asString(this._format);}while(currentValue===this._colorValueElement.textContent);this._colorValueElement.textContent=currentValue;},iconElement:function()
{return this._iconElement;},createdCallback:function()
{var root=WebInspector.createShadowRootWithCoreStyles(this,"ui/colorSwatch.css");this._iconElement=root.createChild("span","color-swatch");this._iconElement.title=WebInspector.UIString("Shift-click to change color format");this._swatchInner=this._iconElement.createChild("span","color-swatch-inner");this._swatchInner.addEventListener("dblclick",consumeEvent,false);this._swatchInner.addEventListener("mousedown",consumeEvent,false);this._swatchInner.addEventListener("click",this._handleClick.bind(this),true);root.createChild("content");this._colorValueElement=this.createChild("span");this.setColorText("white");},_handleClick:function(event)
{if(!event.shiftKey)
return;event.target.parentNode.parentNode.host.toggleNextFormat();event.consume(true);},__proto__:HTMLSpanElement.prototype}
WebInspector.ColorSwatch._nextColorFormat=function(color,curFormat)
{var cf=WebInspector.Color.Format;switch(curFormat){case cf.Original:return!color.hasAlpha()?cf.RGB:cf.RGBA;case cf.RGB:case cf.RGBA:return!color.hasAlpha()?cf.HSL:cf.HSLA;case cf.HSL:case cf.HSLA:if(color.nickname())
return cf.Nickname;if(!color.hasAlpha())
return color.canBeShortHex()?cf.ShortHEX:cf.HEX;else
return cf.Original;case cf.ShortHEX:return cf.HEX;case cf.HEX:return cf.Original;case cf.Nickname:if(!color.hasAlpha())
return color.canBeShortHex()?cf.ShortHEX:cf.HEX;else
return cf.Original;default:return cf.RGBA;}};WebInspector.Context=function()
{this._flavors=new Map();this._eventDispatchers=new Map();}
WebInspector.Context.Events={FlavorChanged:"FlavorChanged"}
WebInspector.Context.prototype={setFlavor:function(flavorType,flavorValue)
{var value=this._flavors.get(flavorType)||null;if(value===flavorValue)
return;if(flavorValue)
this._flavors.set(flavorType,flavorValue);else
this._flavors.remove(flavorType);this._dispatchFlavorChange(flavorType,flavorValue);},_dispatchFlavorChange:function(flavorType,flavorValue)
{var dispatcher=this._eventDispatchers.get(flavorType);if(!dispatcher)
return;dispatcher.dispatchEventToListeners(WebInspector.Context.Events.FlavorChanged,flavorValue);},addFlavorChangeListener:function(flavorType,listener,thisObject)
{var dispatcher=this._eventDispatchers.get(flavorType);if(!dispatcher){dispatcher=new WebInspector.Object();this._eventDispatchers.set(flavorType,dispatcher);}
dispatcher.addEventListener(WebInspector.Context.Events.FlavorChanged,listener,thisObject);},removeFlavorChangeListener:function(flavorType,listener,thisObject)
{var dispatcher=this._eventDispatchers.get(flavorType);if(!dispatcher)
return;dispatcher.removeEventListener(WebInspector.Context.Events.FlavorChanged,listener,thisObject);if(!dispatcher.hasEventListeners(WebInspector.Context.Events.FlavorChanged))
this._eventDispatchers.remove(flavorType);},flavor:function(flavorType)
{return this._flavors.get(flavorType)||null;},flavors:function()
{return new Set(this._flavors.keys());},applicableExtensions:function(extensions)
{var targetExtensionSet=new Set();var availableFlavors=this.flavors();extensions.forEach(function(extension){if(self.runtime.isExtensionApplicableToContextTypes(extension,availableFlavors))
targetExtensionSet.add(extension);});return targetExtensionSet;}}
WebInspector.context=new WebInspector.Context();;WebInspector.ContextMenuItem=function(topLevelMenu,type,label,disabled,checked)
{this._type=type;this._label=label;this._disabled=disabled;this._checked=checked;this._contextMenu=topLevelMenu;if(type==="item"||type==="checkbox")
this._id=topLevelMenu._nextId();}
WebInspector.ContextMenuItem.prototype={id:function()
{return this._id;},type:function()
{return this._type;},isEnabled:function()
{return!this._disabled;},setEnabled:function(enabled)
{this._disabled=!enabled;},_buildDescriptor:function()
{switch(this._type){case"item":var result={type:"item",id:this._id,label:this._label,enabled:!this._disabled};if(this._customElement)
result.element=this._customElement;if(this._shortcut)
result.shortcut=this._shortcut;return result;case"separator":return{type:"separator"};case"checkbox":return{type:"checkbox",id:this._id,label:this._label,checked:!!this._checked,enabled:!this._disabled};}
throw new Error("Invalid item type:"+this._type);},setShortcut:function(shortcut)
{this._shortcut=shortcut;}}
WebInspector.ContextSubMenuItem=function(topLevelMenu,label,disabled)
{WebInspector.ContextMenuItem.call(this,topLevelMenu,"subMenu",label,disabled);this._items=[];}
WebInspector.ContextSubMenuItem.prototype={appendItem:function(label,handler,disabled)
{var item=new WebInspector.ContextMenuItem(this._contextMenu,"item",label,disabled);this._pushItem(item);this._contextMenu._setHandler(item.id(),handler);return item;},appendCustomItem:function(element)
{var item=new WebInspector.ContextMenuItem(this._contextMenu,"item","<custom>");item._customElement=element;this._pushItem(item);return item;},appendAction:function(actionId,label)
{var action=WebInspector.actionRegistry.action(actionId);if(!label)
label=action.title();var result=this.appendItem(label,action.execute.bind(action));var shortcut=WebInspector.shortcutRegistry.shortcutTitleForAction(actionId);if(shortcut)
result.setShortcut(shortcut);return result;},appendSubMenuItem:function(label,disabled)
{var item=new WebInspector.ContextSubMenuItem(this._contextMenu,label,disabled);this._pushItem(item);return item;},appendCheckboxItem:function(label,handler,checked,disabled)
{var item=new WebInspector.ContextMenuItem(this._contextMenu,"checkbox",label,disabled,checked);this._pushItem(item);this._contextMenu._setHandler(item.id(),handler);return item;},appendSeparator:function()
{if(this._items.length)
this._pendingSeparator=true;},_pushItem:function(item)
{if(this._pendingSeparator){this._items.push(new WebInspector.ContextMenuItem(this._contextMenu,"separator"));delete this._pendingSeparator;}
this._items.push(item);},isEmpty:function()
{return!this._items.length;},_buildDescriptor:function()
{var result={type:"subMenu",label:this._label,enabled:!this._disabled,subItems:[]};for(var i=0;i<this._items.length;++i)
result.subItems.push(this._items[i]._buildDescriptor());return result;},appendItemsAtLocation:function(location)
{function appendExtension(menu,extension)
{var subMenuId=extension.descriptor()["subMenuId"];if(subMenuId){var subMenuItem=menu.appendSubMenuItem(extension.title(WebInspector.platform()));subMenuItem.appendItemsAtLocation(subMenuId);}else{menu.appendAction(extension.descriptor()["actionId"]);}}
var groupWeights=["new","open","clipboard","navigate","footer"];var groups=new Map();var extensions=self.runtime.extensions("context-menu-item");for(var extension of extensions){var itemLocation=extension.descriptor()["location"]||"";if(!itemLocation.startsWith(location+"/"))
continue;var itemGroup=itemLocation.substr(location.length+1);if(!itemGroup||itemGroup.includes("/"))
continue;var group=groups.get(itemGroup);if(!group){group=[];groups.set(itemGroup,group);if(groupWeights.indexOf(itemGroup)===-1)
groupWeights.splice(4,0,itemGroup);}
group.push(extension);}
for(var groupName of groupWeights){var group=groups.get(groupName);if(!group)
continue;group.forEach(appendExtension.bind(null,this));this.appendSeparator();}},__proto__:WebInspector.ContextMenuItem.prototype}
WebInspector.ContextMenu=function(event,useSoftMenu,x,y)
{WebInspector.ContextSubMenuItem.call(this,this,"");this._pendingPromises=[];this._pendingTargets=[];this._event=event;this._useSoftMenu=!!useSoftMenu;this._x=x===undefined?event.x:x;this._y=y===undefined?event.y:y;this._handlers={};this._id=0;}
WebInspector.ContextMenu.initialize=function()
{InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.SetUseSoftMenu,setUseSoftMenu);function setUseSoftMenu(event)
{WebInspector.ContextMenu._useSoftMenu=(event.data);}}
WebInspector.ContextMenu.installHandler=function(doc)
{doc.body.addEventListener("contextmenu",handler,false);function handler(event)
{var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendApplicableItems((event.deepElementFromPoint()));contextMenu.show();}}
WebInspector.ContextMenu.prototype={_nextId:function()
{return this._id++;},show:function()
{Promise.all(this._pendingPromises).then(populateAndShow.bind(this));WebInspector.ContextMenu._pendingMenu=this;function populateAndShow(appendCallResults)
{if(WebInspector.ContextMenu._pendingMenu!==this)
return;delete WebInspector.ContextMenu._pendingMenu;for(var i=0;i<appendCallResults.length;++i){var providers=appendCallResults[i];var target=this._pendingTargets[i];for(var j=0;j<providers.length;++j){var provider=(providers[j]);this.appendSeparator();provider.appendApplicableItems(this._event,this,target);this.appendSeparator();}}
this._pendingPromises=[];this._pendingTargets=[];this._innerShow();}
this._event.consume(true);},discard:function()
{if(this._softMenu)
this._softMenu.discard();},_innerShow:function()
{var menuObject=this._buildDescriptors();WebInspector._contextMenu=this;if(this._useSoftMenu||WebInspector.ContextMenu._useSoftMenu||InspectorFrontendHost.isHostedMode()){this._softMenu=new WebInspector.SoftContextMenu(menuObject,this._itemSelected.bind(this));this._softMenu.show(this._event.target.ownerDocument,this._x,this._y);}else{InspectorFrontendHost.showContextMenuAtPoint(this._x,this._y,menuObject,this._event.target.ownerDocument);function listenToEvents()
{InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.ContextMenuCleared,this._menuCleared,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.ContextMenuItemSelected,this._onItemSelected,this);}
setImmediate(listenToEvents.bind(this));}},_setHandler:function(id,handler)
{if(handler)
this._handlers[id]=handler;},_buildDescriptors:function()
{var result=[];for(var i=0;i<this._items.length;++i)
result.push(this._items[i]._buildDescriptor());return result;},_onItemSelected:function(event)
{this._itemSelected((event.data));},_itemSelected:function(id)
{if(this._handlers[id])
this._handlers[id].call(this);this._menuCleared();},_menuCleared:function()
{InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAPI.Events.ContextMenuCleared,this._menuCleared,this);InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAPI.Events.ContextMenuItemSelected,this._onItemSelected,this);},appendApplicableItems:function(target)
{this._pendingPromises.push(self.runtime.instancesPromise(WebInspector.ContextMenu.Provider,target));this._pendingTargets.push(target);},__proto__:WebInspector.ContextSubMenuItem.prototype}
WebInspector.ContextMenu.Provider=function(){}
WebInspector.ContextMenu.Provider.prototype={appendApplicableItems:function(event,contextMenu,target){}};WebInspector.Dialog=function()
{WebInspector.Widget.call(this,true);this.markAsRoot();this.registerRequiredCSS("ui/dialog.css");this.contentElement.createChild("content");this.contentElement.tabIndex=0;this.contentElement.addEventListener("focus",this._onFocus.bind(this),false);this.contentElement.addEventListener("keydown",this._onKeyDown.bind(this),false);this._wrapsContent=false;this._dimmed=false;this._tabIndexMap=new Map();}
WebInspector.Dialog.hasInstance=function()
{return!!WebInspector.Dialog._instance;}
WebInspector.Dialog.prototype={show:function()
{if(WebInspector.Dialog._instance)
WebInspector.Dialog._instance.detach();WebInspector.Dialog._instance=this;var document=(WebInspector.Dialog._modalHostView.element.ownerDocument);this._disableTabIndexOnElements(document);this._glassPane=new WebInspector.GlassPane(document,this._dimmed);this._glassPane.element.addEventListener("click",this._onGlassPaneClick.bind(this),false);WebInspector.GlassPane.DefaultFocusedViewStack.push(this);WebInspector.Widget.prototype.show.call(this,this._glassPane.element);this._position();this.focus();},detach:function()
{WebInspector.Widget.prototype.detach.call(this);WebInspector.GlassPane.DefaultFocusedViewStack.pop();this._glassPane.dispose();delete this._glassPane;this._restoreTabIndexOnElements();delete WebInspector.Dialog._instance;},addCloseButton:function()
{var closeButton=this.contentElement.createChild("div","dialog-close-button","dt-close-button");closeButton.gray=true;closeButton.addEventListener("click",this.detach.bind(this,false),false);},setMaxSize:function(size)
{this._maxSize=size;},setWrapsContent:function(wraps)
{this.element.classList.toggle("wraps-content",wraps);this._wrapsContent=wraps;},setDimmed:function(dimmed)
{this._dimmed=dimmed;},contentResized:function()
{if(this._wrapsContent)
this._position();},_disableTabIndexOnElements:function(document)
{this._tabIndexMap.clear();for(var node=document;node;node=node.traverseNextNode(document)){if(node instanceof HTMLElement){var element=(node);var tabIndex=element.tabIndex;if(tabIndex>=0){this._tabIndexMap.set(element,tabIndex);element.tabIndex=-1;}}}},_restoreTabIndexOnElements:function()
{for(var element of this._tabIndexMap.keys())
element.tabIndex=this._tabIndexMap.get(element);this._tabIndexMap.clear();},_onFocus:function(event)
{this.focus();},_onGlassPaneClick:function(event)
{if(!this.element.isSelfOrAncestor((event.target)))
this.detach();},_position:function()
{var container=WebInspector.Dialog._modalHostView.element;var width=container.offsetWidth-10;var height=container.offsetHeight-10;if(this._wrapsContent){width=Math.min(width,this.contentElement.offsetWidth);height=Math.min(height,this.contentElement.offsetHeight);}
if(this._maxSize){width=Math.min(width,this._maxSize.width);height=Math.min(height,this._maxSize.height);}
var positionX=(container.offsetWidth-width)/2;positionX=Number.constrain(positionX,0,container.offsetWidth-width);var positionY=(container.offsetHeight-height)/2;positionY=Number.constrain(positionY,0,container.offsetHeight-height);this.element.style.width=width+"px";this.element.style.height=height+"px";this.element.positionAt(positionX,positionY,container);},_onKeyDown:function(event)
{if(event.keyCode===WebInspector.KeyboardShortcut.Keys.Esc.code){event.consume(true);this.detach();}},defaultFocusedElement:function()
{var children=this.children();if(children.length)
return children[0].defaultFocusedElement();return this.element;},__proto__:WebInspector.Widget.prototype};WebInspector.Dialog._modalHostView=null;WebInspector.Dialog.setModalHostView=function(view)
{WebInspector.Dialog._modalHostView=view;};WebInspector.Dialog.modalHostView=function()
{return WebInspector.Dialog._modalHostView;};WebInspector.Dialog.modalHostRepositioned=function()
{if(WebInspector.Dialog._instance)
WebInspector.Dialog._instance._position();};;WebInspector.DOMSyntaxHighlighter=function(mimeType,stripExtraWhitespace)
{this._mimeType=mimeType;this._stripExtraWhitespace=stripExtraWhitespace;}
WebInspector.DOMSyntaxHighlighter.prototype={createSpan:function(content,className)
{var span=createElement("span");span.className="cm-"+className;if(this._stripExtraWhitespace&&className!=="whitespace")
content=content.replace(/^[\n\r]*/,"").replace(/\s*$/,"");span.createTextChild(content);return span;},syntaxHighlightNode:function(node)
{var lines=node.textContent.split("\n");var plainTextStart;var line;return self.runtime.instancePromise(WebInspector.TokenizerFactory).then(processTokens.bind(this));function processTokens(tokenizerFactory)
{node.removeChildren();var tokenize=tokenizerFactory.createTokenizer(this._mimeType);for(var i=lines[0].length?0:1;i<lines.length;++i){line=lines[i];plainTextStart=0;tokenize(line,processToken.bind(this));if(plainTextStart<line.length){var plainText=line.substring(plainTextStart,line.length);node.createTextChild(plainText);}
if(i<lines.length-1)
node.createTextChild("\n");}}
function processToken(token,tokenType,column,newColumn)
{if(!tokenType)
return;if(column>plainTextStart){var plainText=line.substring(plainTextStart,column);node.createTextChild(plainText);}
node.appendChild(this.createSpan(token,tokenType));plainTextStart=newColumn;}}};WebInspector.DropDownMenu=function(element)
{this._items=[];element.addEventListener("mousedown",this._onMouseDown.bind(this));}
WebInspector.DropDownMenu.Item;WebInspector.DropDownMenu.Events={ItemSelected:"ItemSelected"}
WebInspector.DropDownMenu.prototype={_onMouseDown:function(event)
{if(event.which!==1)
return;var menu=new WebInspector.ContextMenu(event);for(var item of this._items)
menu.appendCheckboxItem(item.title,this._itemHandler.bind(this,item.id),item.id===this._selectedItemId);menu.show();},_itemHandler:function(id)
{this.dispatchEventToListeners(WebInspector.DropDownMenu.Events.ItemSelected,id);},addItem:function(id,title)
{this._items.push({id:id,title:title});},selectItem:function(id)
{this._selectedItemId=id;},clear:function()
{this._items=[];delete this._selectedItemId;},__proto__:WebInspector.Object.prototype};WebInspector.DropTarget=function(element,transferTypes,messageText,handleDrop)
{element.addEventListener("dragenter",this._onDragEnter.bind(this),true);element.addEventListener("dragover",this._onDragOver.bind(this),true);this._element=element;this._transferTypes=transferTypes;this._messageText=messageText;this._handleDrop=handleDrop;this._enabled=true;}
WebInspector.DropTarget.Types={Files:"Files",URIList:"text/uri-list"}
WebInspector.DropTarget.prototype={setEnabled:function(enabled)
{this._enabled=enabled;},_onDragEnter:function(event)
{if(this._enabled&&this._hasMatchingType(event))
event.consume(true);},_hasMatchingType:function(event)
{for(var type of this._transferTypes){if(event.dataTransfer.types.indexOf(type)!==-1)
return true;}
return false;},_onDragOver:function(event)
{if(!this._enabled||!this._hasMatchingType(event))
return;event.dataTransfer.dropEffect="copy";event.consume(true);if(this._dragMaskElement)
return;this._dragMaskElement=this._element.createChild("div","");var shadowRoot=WebInspector.createShadowRootWithCoreStyles(this._dragMaskElement,"ui/dropTarget.css");shadowRoot.createChild("div","drop-target-message").textContent=this._messageText;this._dragMaskElement.addEventListener("drop",this._onDrop.bind(this),true);this._dragMaskElement.addEventListener("dragleave",this._onDragLeave.bind(this),true);},_onDrop:function(event)
{event.consume(true);this._removeMask();if(this._enabled)
this._handleDrop(event.dataTransfer);},_onDragLeave:function(event)
{event.consume(true);this._removeMask();},_removeMask:function()
{this._dragMaskElement.remove();delete this._dragMaskElement;}};WebInspector.EmptyWidget=function(text)
{WebInspector.VBox.call(this);this.registerRequiredCSS("ui/emptyWidget.css");this.element.classList.add("empty-view");this.textElement=this.element.createChild("span");this._text=text;}
WebInspector.EmptyWidget.prototype={wasShown:function()
{this.textElement.textContent=this._text;},set text(text)
{this._text=text;if(this.isShowing())
this.textElement.textContent=this._text;},__proto__:WebInspector.VBox.prototype};WebInspector.FilterBar=function(name,visibleByDefault)
{WebInspector.HBox.call(this);this.registerRequiredCSS("ui/filter.css");this._filtersShown=false;this._enabled=true;this.element.classList.add("filter-bar");this._filterButton=new WebInspector.ToolbarButton(WebInspector.UIString("Filter"),"filter-toolbar-item");this._filterButton.addEventListener("click",this._handleFilterButtonClick,this);this._filters=[];this._stateSetting=WebInspector.settings.createSetting("filterBar-"+name+"-toggled",!!visibleByDefault);this._setState(this._stateSetting.get());}
WebInspector.FilterBar.FilterBarState={Inactive:"inactive",Active:"active",Shown:"on"};WebInspector.FilterBar.Events={Toggled:"Toggled"};WebInspector.FilterBar.prototype={filterButton:function()
{return this._filterButton;},addFilter:function(filter)
{this._filters.push(filter);this.element.appendChild(filter.element());filter.addEventListener(WebInspector.FilterUI.Events.FilterChanged,this._filterChanged,this);this._updateFilterButton();},setEnabled:function(enabled)
{this._enabled=enabled;this._filterButton.setEnabled(enabled);this._updateFilterBar();},forceShowFilterBar:function()
{this._alwaysShowFilters=true;this._updateFilterBar();},wasShown:function()
{this._updateFilterBar();},_filterChanged:function(event)
{this._updateFilterButton();},_filterBarState:function()
{if(this._filtersShown)
return WebInspector.FilterBar.FilterBarState.Shown;var isActive=false;for(var i=0;i<this._filters.length;++i){if(this._filters[i].isActive())
return WebInspector.FilterBar.FilterBarState.Active;}
return WebInspector.FilterBar.FilterBarState.Inactive;},_updateFilterBar:function()
{var visible=this._alwaysShowFilters||(this._filtersShown&&this._enabled);this.element.classList.toggle("hidden",!visible);if(visible){for(var i=0;i<this._filters.length;++i){if(this._filters[i]instanceof WebInspector.TextFilterUI){var textFilterUI=(this._filters[i]);textFilterUI.focus();}}}
this.invalidateSize();},_updateFilterButton:function()
{this._filterButton.setState(this._filterBarState());},_handleFilterButtonClick:function(event)
{this._setState(!this._filtersShown);},_setState:function(filtersShown)
{if(this._filtersShown===filtersShown)
return;this._filtersShown=filtersShown;if(this._stateSetting)
this._stateSetting.set(filtersShown);this._updateFilterButton();this._updateFilterBar();this.dispatchEventToListeners(WebInspector.FilterBar.Events.Toggled);},clear:function()
{this.element.removeChildren();this._filters=[];this._updateFilterButton();},__proto__:WebInspector.HBox.prototype}
WebInspector.FilterUI=function()
{}
WebInspector.FilterUI.Events={FilterChanged:"FilterChanged"}
WebInspector.FilterUI.prototype={isActive:function(){},element:function(){}}
WebInspector.TextFilterUI=function(supportRegex)
{this._supportRegex=!!supportRegex;this._regex=null;this._filterElement=createElement("div");this._filterElement.className="filter-text-filter";this._filterInputElement=(this._filterElement.createChild("input","filter-input-field"));this._filterInputElement.placeholder=WebInspector.UIString("Filter");this._filterInputElement.id="filter-input-field";this._filterInputElement.addEventListener("mousedown",this._onFilterFieldManualFocus.bind(this),false);this._filterInputElement.addEventListener("input",this._onInput.bind(this),false);this._filterInputElement.addEventListener("change",this._onChange.bind(this),false);this._filterInputElement.addEventListener("keydown",this._onInputKeyDown.bind(this),true);this._filterInputElement.addEventListener("blur",this._onBlur.bind(this),true);this._suggestionBuilder=null;this._suggestBox=new WebInspector.SuggestBox(this);if(this._supportRegex){this._filterElement.classList.add("supports-regex");var label=createCheckboxLabel(WebInspector.UIString("Regex"));this._regexCheckBox=label.checkboxElement;this._regexCheckBox.id="text-filter-regex";this._regexCheckBox.addEventListener("change",this._onInput.bind(this),false);this._filterElement.appendChild(label);this._regexLabel=this._filterElement.textElement;}}
WebInspector.TextFilterUI.prototype={isActive:function()
{return!!this._filterInputElement.value;},element:function()
{return this._filterElement;},value:function()
{return this._filterInputElement.value;},setValue:function(value)
{this._filterInputElement.value=value;this._valueChanged(false);},regex:function()
{return this._regex;},_onFilterFieldManualFocus:function(event)
{WebInspector.setCurrentFocusElement((event.target));},_onBlur:function(event)
{this._cancelSuggestion();},_cancelSuggestion:function()
{if(this._suggestionBuilder&&this._suggestBox.visible){this._suggestionBuilder.unapplySuggestion(this._filterInputElement);this._suggestBox.hide();}},_onInput:function()
{this._valueChanged(true);},_onChange:function()
{this._valueChanged(false);},focus:function()
{this._filterInputElement.focus();},setSuggestionBuilder:function(suggestionBuilder)
{this._cancelSuggestion();this._suggestionBuilder=suggestionBuilder;},_updateSuggestions:function()
{if(!this._suggestionBuilder)
return;var suggestions=this._suggestionBuilder.buildSuggestions(this._filterInputElement);if(suggestions&&suggestions.length){if(this._suppressSuggestion)
delete this._suppressSuggestion;else
this._suggestionBuilder.applySuggestion(this._filterInputElement,suggestions[0],true);var anchorBox=this._filterInputElement.boxInWindow().relativeTo(new AnchorBox(-3,0));this._suggestBox.updateSuggestions(anchorBox,suggestions,0,true,"");}else{this._suggestBox.hide();}},_valueChanged:function(showSuggestions)
{if(showSuggestions)
this._updateSuggestions();else
this._suggestBox.hide();var filterQuery=this.value();this._regex=null;this._filterInputElement.classList.remove("filter-text-invalid");if(filterQuery){if(this._supportRegex&&this._regexCheckBox.checked){try{this._regex=new RegExp(filterQuery,"i");}catch(e){this._filterInputElement.classList.add("filter-text-invalid");}}else{this._regex=createPlainTextSearchRegex(filterQuery,"i");}}
this._dispatchFilterChanged();},_dispatchFilterChanged:function()
{this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged,null);},_onInputKeyDown:function(event)
{var handled=false;if(event.keyIdentifier==="U+0008"){this._suppressSuggestion=true;}else if(this._suggestBox.visible()){if(event.keyIdentifier==="U+001B"){this._cancelSuggestion();handled=true;}else if(event.keyIdentifier==="U+0009"){this._suggestBox.acceptSuggestion();this._valueChanged(true);handled=true;}else{handled=this._suggestBox.keyPressed((event));}}
if(handled)
event.consume(true);return handled;},applySuggestion:function(suggestion,isIntermediateSuggestion)
{if(!this._suggestionBuilder)
return;this._suggestionBuilder.applySuggestion(this._filterInputElement,suggestion,!!isIntermediateSuggestion);if(isIntermediateSuggestion)
this._dispatchFilterChanged();},acceptSuggestion:function()
{this._filterInputElement.scrollLeft=this._filterInputElement.scrollWidth;this._valueChanged(true);},__proto__:WebInspector.Object.prototype}
WebInspector.TextFilterUI.SuggestionBuilder=function()
{}
WebInspector.TextFilterUI.SuggestionBuilder.prototype={buildSuggestions:function(input){},applySuggestion:function(input,suggestion,isIntermediate){},unapplySuggestion:function(input){}}
WebInspector.NamedBitSetFilterUI=function(items,setting)
{this._filtersElement=createElementWithClass("div","filter-bitset-filter");this._filtersElement.title=WebInspector.UIString("%sClick to select multiple types",WebInspector.KeyboardShortcut.shortcutToString("",WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta));this._allowedTypes={};this._typeFilterElements={};this._addBit(WebInspector.NamedBitSetFilterUI.ALL_TYPES,WebInspector.UIString("All"));this._filtersElement.createChild("div","filter-bitset-filter-divider");for(var i=0;i<items.length;++i)
this._addBit(items[i].name,items[i].label,items[i].title);if(setting){this._setting=setting;setting.addChangeListener(this._settingChanged.bind(this));this._settingChanged();}else{this._toggleTypeFilter(WebInspector.NamedBitSetFilterUI.ALL_TYPES,false);}}
WebInspector.NamedBitSetFilterUI.Item;WebInspector.NamedBitSetFilterUI.ALL_TYPES="all";WebInspector.NamedBitSetFilterUI.prototype={isActive:function()
{return!this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES];},element:function()
{return this._filtersElement;},accept:function(typeName)
{return!!this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES]||!!this._allowedTypes[typeName];},_settingChanged:function()
{var allowedTypes=this._setting.get();this._allowedTypes={};for(var typeName in this._typeFilterElements){if(allowedTypes[typeName])
this._allowedTypes[typeName]=true;}
this._update();},_update:function()
{if((Object.keys(this._allowedTypes).length===0)||this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES]){this._allowedTypes={};this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES]=true;}
for(var typeName in this._typeFilterElements)
this._typeFilterElements[typeName].classList.toggle("selected",this._allowedTypes[typeName]);this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged,null);},_addBit:function(name,label,title)
{var typeFilterElement=this._filtersElement.createChild("li",name);typeFilterElement.typeName=name;typeFilterElement.createTextChild(label);if(title)
typeFilterElement.title=title;typeFilterElement.addEventListener("click",this._onTypeFilterClicked.bind(this),false);this._typeFilterElements[name]=typeFilterElement;},_onTypeFilterClicked:function(e)
{var toggle;if(WebInspector.isMac())
toggle=e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey;else
toggle=e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey;this._toggleTypeFilter(e.target.typeName,toggle);},_toggleTypeFilter:function(typeName,allowMultiSelect)
{if(allowMultiSelect&&typeName!==WebInspector.NamedBitSetFilterUI.ALL_TYPES)
this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES]=false;else
this._allowedTypes={};this._allowedTypes[typeName]=!this._allowedTypes[typeName];if(this._setting)
this._setting.set(this._allowedTypes);else
this._update();},__proto__:WebInspector.Object.prototype}
WebInspector.ComboBoxFilterUI=function(options)
{this._filterElement=createElement("div");this._filterElement.className="filter-combobox-filter";this._options=options;this._filterComboBox=new WebInspector.ToolbarComboBox(this._filterChanged.bind(this));for(var i=0;i<options.length;++i){var filterOption=options[i];var option=createElement("option");option.text=filterOption.label;option.title=filterOption.title;this._filterComboBox.addOption(option);this._filterComboBox.element.title=this._filterComboBox.selectedOption().title;}
this._filterElement.appendChild(this._filterComboBox.element);}
WebInspector.ComboBoxFilterUI.prototype={isActive:function()
{return this._filterComboBox.selectedIndex()!==0;},element:function()
{return this._filterElement;},value:function()
{var option=this._options[this._filterComboBox.selectedIndex()];return option.value;},setSelectedIndex:function(index)
{this._filterComboBox.setSelectedIndex(index);},selectedIndex:function(index)
{return this._filterComboBox.selectedIndex();},_filterChanged:function(event)
{var option=this._options[this._filterComboBox.selectedIndex()];this._filterComboBox.element.title=option.title;this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged,null);},__proto__:WebInspector.Object.prototype}
WebInspector.CheckboxFilterUI=function(className,title,activeWhenChecked,setting)
{this._filterElement=createElementWithClass("div","filter-checkbox-filter");this._activeWhenChecked=!!activeWhenChecked;this._label=createCheckboxLabel(title);this._filterElement.appendChild(this._label);this._checkboxElement=this._label.checkboxElement;if(setting)
WebInspector.SettingsUI.bindCheckbox(this._checkboxElement,setting);else
this._checkboxElement.checked=true;this._checkboxElement.addEventListener("change",this._fireUpdated.bind(this),false);}
WebInspector.CheckboxFilterUI.prototype={isActive:function()
{return this._activeWhenChecked===this._checkboxElement.checked;},checked:function()
{return this._checkboxElement.checked;},element:function()
{return this._filterElement;},labelElement:function()
{return this._label;},_fireUpdated:function()
{this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged,null);},setColor:function(backgroundColor,borderColor)
{this._label.backgroundColor=backgroundColor;this._label.borderColor=borderColor;},__proto__:WebInspector.Object.prototype};WebInspector.ForwardedInputEventHandler=function()
{InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.KeyEventUnhandled,this._onKeyEventUnhandled,this);}
WebInspector.ForwardedInputEventHandler.prototype={_onKeyEventUnhandled:function(event)
{var data=event.data;var type=(data.type);var keyIdentifier=(data.keyIdentifier);var keyCode=(data.keyCode);var modifiers=(data.modifiers);if(type!=="keydown")
return;WebInspector.context.setFlavor(WebInspector.ShortcutRegistry.ForwardedShortcut,WebInspector.ShortcutRegistry.ForwardedShortcut.instance);WebInspector.shortcutRegistry.handleKey(WebInspector.KeyboardShortcut.makeKey(keyCode,modifiers),keyIdentifier);WebInspector.context.setFlavor(WebInspector.ShortcutRegistry.ForwardedShortcut,null);}}
WebInspector.forwardedEventHandler=new WebInspector.ForwardedInputEventHandler();;WebInspector.HistoryInput=function()
{}
WebInspector.HistoryInput.create=function()
{if(!WebInspector.HistoryInput._constructor)
WebInspector.HistoryInput._constructor=registerCustomElement("input","history-input",WebInspector.HistoryInput.prototype);return(new WebInspector.HistoryInput._constructor());}
WebInspector.HistoryInput.prototype={createdCallback:function()
{this._history=[""];this._historyPosition=0;this.addEventListener("keydown",this._onKeyDown.bind(this),false);this.addEventListener("input",this._onInput.bind(this),false);},_onInput:function(event)
{if(this._history.length===this._historyPosition+1)
this._history[this._history.length-1]=this.value;},_onKeyDown:function(event)
{if(event.keyCode===WebInspector.KeyboardShortcut.Keys.Up.code){this._historyPosition=Math.max(this._historyPosition-1,0);this.value=this._history[this._historyPosition];this.dispatchEvent(createEvent("input",true,true));event.consume(true);}else if(event.keyCode===WebInspector.KeyboardShortcut.Keys.Down.code){this._historyPosition=Math.min(this._historyPosition+1,this._history.length-1);this.value=this._history[this._historyPosition];this.dispatchEvent(createEvent("input",true,true));event.consume(true);}else if(event.keyCode===WebInspector.KeyboardShortcut.Keys.Enter.code){this._saveToHistory();}},_saveToHistory:function()
{if(this._history.length>1&&this._history[this._history.length-2]===this.value)
return;this._history[this._history.length-1]=this.value;this._historyPosition=this._history.length-1;this._history.push("");},__proto__:HTMLInputElement.prototype};WebInspector.Infobar=function(type,text,disableSetting)
{this.element=createElementWithClass("div","flex-none");this._shadowRoot=WebInspector.createShadowRootWithCoreStyles(this.element,"ui/infobar.css");this._contentElement=this._shadowRoot.createChild("div","infobar infobar-"+type);this._mainRow=this._contentElement.createChild("div","infobar-main-row");this._mainRow.createChild("div",type+"-icon icon");this._mainRowText=this._mainRow.createChild("div","infobar-main-title");this._mainRowText.textContent=text;this._detailsRows=this._contentElement.createChild("div","infobar-details-rows hidden");this._toggleElement=this._mainRow.createChild("div","infobar-toggle hidden");this._toggleElement.addEventListener("click",this._onToggleDetails.bind(this),false);this._toggleElement.textContent=WebInspector.UIString("more");this._disableSetting=disableSetting||null;if(disableSetting){var disableButton=this._mainRow.createChild("div","infobar-toggle");disableButton.textContent=WebInspector.UIString("never show");disableButton.addEventListener("click",this._onDisable.bind(this),false);}
this._closeButton=this._contentElement.createChild("div","close-button","dt-close-button");this._closeButton.addEventListener("click",this.dispose.bind(this),false);this._closeCallback=null;}
WebInspector.Infobar.create=function(type,text,disableSetting)
{if(disableSetting&&disableSetting.get())
return null;return new WebInspector.Infobar(type,text,disableSetting);}
WebInspector.Infobar.Type={Warning:"warning",Info:"info"}
WebInspector.Infobar.prototype={dispose:function()
{this.element.remove();this._onResize();if(this._closeCallback)
this._closeCallback.call(null);},setText:function(text)
{this._mainRowText.textContent=text;this._onResize();},setCloseCallback:function(callback)
{this._closeCallback=callback;},setParentView:function(parentView)
{this._parentView=parentView;},_onResize:function()
{if(this._parentView)
this._parentView.doResize();},_onDisable:function()
{this._disableSetting.set(true);this.dispose();},_onToggleDetails:function()
{this._detailsRows.classList.remove("hidden");this._toggleElement.remove();this._onResize();},createDetailsRowMessage:function(message)
{this._toggleElement.classList.remove("hidden");var infobarDetailsRow=this._detailsRows.createChild("div","infobar-details-row");var detailsRowMessage=infobarDetailsRow.createChild("span","infobar-row-message");detailsRowMessage.textContent=message||"";return detailsRowMessage;}};WebInspector.InplaceEditor=function()
{}
WebInspector.InplaceEditor.Controller;WebInspector.InplaceEditor.startEditing=function(element,config)
{if(!WebInspector.InplaceEditor._defaultInstance)
WebInspector.InplaceEditor._defaultInstance=new WebInspector.InplaceEditor();return WebInspector.InplaceEditor._defaultInstance.startEditing(element,config);}
WebInspector.InplaceEditor.startMultilineEditing=function(element,config)
{return self.runtime.instancePromise(WebInspector.InplaceEditor).then(startEditing);function startEditing(inplaceEditor)
{var controller=(inplaceEditor).startEditing(element,config);if(!controller)
return Promise.reject(new Error("Editing is already in progress"));return controller;}}
WebInspector.InplaceEditor.prototype={editorContent:function(editingContext){var element=editingContext.element;if(element.tagName==="INPUT"&&element.type==="text")
return element.value;return element.textContent;},setUpEditor:function(editingContext)
{var element=editingContext.element;element.classList.add("editing");var oldTabIndex=element.getAttribute("tabIndex");if(typeof oldTabIndex!=="number"||oldTabIndex<0)
element.tabIndex=0;WebInspector.setCurrentFocusElement(element);editingContext.oldTabIndex=oldTabIndex;},closeEditor:function(editingContext)
{var element=editingContext.element;element.classList.remove("editing");if(typeof editingContext.oldTabIndex!=="number")
element.removeAttribute("tabIndex");else
element.tabIndex=editingContext.oldTabIndex;element.scrollTop=0;element.scrollLeft=0;},cancelEditing:function(editingContext)
{var element=editingContext.element;if(element.tagName==="INPUT"&&element.type==="text")
element.value=editingContext.oldText;else
element.textContent=editingContext.oldText;},augmentEditingHandle:function(editingContext,handle)
{},startEditing:function(element,config)
{if(!WebInspector.markBeingEdited(element,true))
return null;config=config||new WebInspector.InplaceEditor.Config(function(){},function(){});var editingContext={element:element,config:config};var committedCallback=config.commitHandler;var cancelledCallback=config.cancelHandler;var pasteCallback=config.pasteHandler;var context=config.context;var isMultiline=config.multiline||false;var moveDirection="";var self=this;function consumeCopy(e)
{e.consume();}
this.setUpEditor(editingContext);editingContext.oldText=isMultiline?config.initialValue:this.editorContent(editingContext);function blurEventListener(e){if(config.blurHandler&&!config.blurHandler(element,e))
return;if(!isMultiline||!e||!e.relatedTarget||!e.relatedTarget.isSelfOrDescendant(element))
editingCommitted.call(element);}
function cleanUpAfterEditing()
{WebInspector.markBeingEdited(element,false);element.removeEventListener("blur",blurEventListener,isMultiline);element.removeEventListener("keydown",keyDownEventListener,true);if(pasteCallback)
element.removeEventListener("paste",pasteEventListener,true);WebInspector.restoreFocusFromElement(element);self.closeEditor(editingContext);}
function editingCancelled()
{self.cancelEditing(editingContext);cleanUpAfterEditing();cancelledCallback(this,context);}
function editingCommitted()
{cleanUpAfterEditing();committedCallback(this,self.editorContent(editingContext),editingContext.oldText,context,moveDirection);}
function defaultFinishHandler(event)
{var isMetaOrCtrl=WebInspector.isMac()?event.metaKey&&!event.shiftKey&&!event.ctrlKey&&!event.altKey:event.ctrlKey&&!event.shiftKey&&!event.metaKey&&!event.altKey;if(isEnterKey(event)&&(event.isMetaOrCtrlForTest||!isMultiline||isMetaOrCtrl))
return"commit";else if(event.keyCode===WebInspector.KeyboardShortcut.Keys.Esc.code||event.keyIdentifier==="U+001B")
return"cancel";else if(!isMultiline&&event.keyIdentifier==="U+0009")
return"move-"+(event.shiftKey?"backward":"forward");return"";}
function handleEditingResult(result,event)
{if(result==="commit"){editingCommitted.call(element);event.consume(true);}else if(result==="cancel"){editingCancelled.call(element);event.consume(true);}else if(result&&result.startsWith("move-")){moveDirection=result.substring(5);if(event.keyIdentifier!=="U+0009")
blurEventListener();}}
function pasteEventListener(event)
{var result=pasteCallback(event);handleEditingResult(result,event);}
function keyDownEventListener(event)
{var result=defaultFinishHandler(event);if(!result&&config.postKeydownFinishHandler)
result=config.postKeydownFinishHandler(event);handleEditingResult(result,event);}
element.addEventListener("blur",blurEventListener,isMultiline);element.addEventListener("keydown",keyDownEventListener,true);if(pasteCallback)
element.addEventListener("paste",pasteEventListener,true);var handle={cancel:editingCancelled.bind(element),commit:editingCommitted.bind(element),setWidth:function(){}};this.augmentEditingHandle(editingContext,handle);return handle;}}
WebInspector.InplaceEditor.Config=function(commitHandler,cancelHandler,context,blurHandler)
{this.commitHandler=commitHandler;this.cancelHandler=cancelHandler;this.context=context;this.blurHandler=blurHandler;this.pasteHandler;this.multiline;this.postKeydownFinishHandler;}
WebInspector.InplaceEditor.Config.prototype={setPasteHandler:function(pasteHandler)
{this.pasteHandler=pasteHandler;},setMultilineOptions:function(initialValue,mode,theme,lineWrapping,smartIndent)
{this.multiline=true;this.initialValue=initialValue;this.mode=mode;this.theme=theme;this.lineWrapping=lineWrapping;this.smartIndent=smartIndent;},setPostKeydownFinishHandler:function(postKeydownFinishHandler)
{this.postKeydownFinishHandler=postKeydownFinishHandler;}};WebInspector.KeyboardShortcut=function()
{}
WebInspector.KeyboardShortcut.Modifiers={None:0,Shift:1,Ctrl:2,Alt:4,Meta:8,get CtrlOrMeta()
{return WebInspector.isMac()?this.Meta:this.Ctrl;},get ShiftOrOption()
{return WebInspector.isMac()?this.Alt:this.Shift;}};WebInspector.KeyboardShortcut.Key;WebInspector.KeyboardShortcut.Keys={Backspace:{code:8,name:"\u21a4"},Tab:{code:9,name:{mac:"\u21e5",other:"Tab"}},Enter:{code:13,name:{mac:"\u21a9",other:"Enter"}},Shift:{code:16,name:{mac:"\u21e7",other:"Shift"}},Ctrl:{code:17,name:"Ctrl"},Esc:{code:27,name:"Esc"},Space:{code:32,name:"Space"},PageUp:{code:33,name:{mac:"\u21de",other:"PageUp"}},PageDown:{code:34,name:{mac:"\u21df",other:"PageDown"}},End:{code:35,name:{mac:"\u2197",other:"End"}},Home:{code:36,name:{mac:"\u2196",other:"Home"}},Left:{code:37,name:"\u2190"},Up:{code:38,name:"\u2191"},Right:{code:39,name:"\u2192"},Down:{code:40,name:"\u2193"},Delete:{code:46,name:"Del"},Zero:{code:48,name:"0"},H:{code:72,name:"H"},Meta:{code:91,name:"Meta"},F1:{code:112,name:"F1"},F2:{code:113,name:"F2"},F3:{code:114,name:"F3"},F4:{code:115,name:"F4"},F5:{code:116,name:"F5"},F6:{code:117,name:"F6"},F7:{code:118,name:"F7"},F8:{code:119,name:"F8"},F9:{code:120,name:"F9"},F10:{code:121,name:"F10"},F11:{code:122,name:"F11"},F12:{code:123,name:"F12"},Semicolon:{code:186,name:";"},NumpadPlus:{code:107,name:"Numpad +"},NumpadMinus:{code:109,name:"Numpad -"},Numpad0:{code:96,name:"Numpad 0"},Plus:{code:187,name:"+"},Comma:{code:188,name:","},Minus:{code:189,name:"-"},Period:{code:190,name:"."},Slash:{code:191,name:"/"},QuestionMark:{code:191,name:"?"},Apostrophe:{code:192,name:"`"},Tilde:{code:192,name:"Tilde"},LeftSquareBracket:{code:219,name:"["},RightSquareBracket:{code:221,name:"]"},Backslash:{code:220,name:"\\"},SingleQuote:{code:222,name:"\'"},get CtrlOrMeta()
{return WebInspector.isMac()?this.Meta:this.Ctrl;},};WebInspector.KeyboardShortcut.KeyBindings={};(function(){for(var key in WebInspector.KeyboardShortcut.Keys){var descriptor=WebInspector.KeyboardShortcut.Keys[key];if(typeof descriptor==="object"&&descriptor["code"]){var name=typeof descriptor["name"]==="string"?descriptor["name"]:key;WebInspector.KeyboardShortcut.KeyBindings[name]=descriptor;}}})();WebInspector.KeyboardShortcut.makeKey=function(keyCode,modifiers)
{if(typeof keyCode==="string")
keyCode=keyCode.charCodeAt(0)-(/^[a-z]/.test(keyCode)?32:0);modifiers=modifiers||WebInspector.KeyboardShortcut.Modifiers.None;return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode,modifiers);}
WebInspector.KeyboardShortcut.makeKeyFromEvent=function(keyboardEvent)
{var modifiers=WebInspector.KeyboardShortcut.Modifiers.None;if(keyboardEvent.shiftKey)
modifiers|=WebInspector.KeyboardShortcut.Modifiers.Shift;if(keyboardEvent.ctrlKey)
modifiers|=WebInspector.KeyboardShortcut.Modifiers.Ctrl;if(keyboardEvent.altKey)
modifiers|=WebInspector.KeyboardShortcut.Modifiers.Alt;if(keyboardEvent.metaKey)
modifiers|=WebInspector.KeyboardShortcut.Modifiers.Meta;var keyCode=keyboardEvent.keyCode||keyboardEvent["__keyCode"];return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode,modifiers);}
WebInspector.KeyboardShortcut.makeKeyFromEventIgnoringModifiers=function(keyboardEvent)
{var keyCode=keyboardEvent.keyCode||keyboardEvent["__keyCode"];return WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers(keyCode,WebInspector.KeyboardShortcut.Modifiers.None);}
WebInspector.KeyboardShortcut.eventHasCtrlOrMeta=function(event)
{return WebInspector.isMac()?event.metaKey&&!event.ctrlKey:event.ctrlKey&&!event.metaKey;}
WebInspector.KeyboardShortcut.hasNoModifiers=function(event)
{return!event.ctrlKey&&!event.shiftKey&&!event.altKey&&!event.metaKey;}
WebInspector.KeyboardShortcut.Descriptor;WebInspector.KeyboardShortcut.makeDescriptor=function(key,modifiers)
{return{key:WebInspector.KeyboardShortcut.makeKey(typeof key==="string"?key:key.code,modifiers),name:WebInspector.KeyboardShortcut.shortcutToString(key,modifiers)};}
WebInspector.KeyboardShortcut.makeDescriptorFromBindingShortcut=function(shortcut)
{var parts=shortcut.split(/\+(?!$)/);var modifiers=0;var keyString;for(var i=0;i<parts.length;++i){if(typeof WebInspector.KeyboardShortcut.Modifiers[parts[i]]!=="undefined"){modifiers|=WebInspector.KeyboardShortcut.Modifiers[parts[i]];continue;}
console.assert(i===parts.length-1,"Only one key other than modifier is allowed in shortcut <"+shortcut+">");keyString=parts[i];break;}
console.assert(keyString,"Modifiers-only shortcuts are not allowed (encountered <"+shortcut+">)");if(!keyString)
return null;var key=WebInspector.KeyboardShortcut.Keys[keyString]||WebInspector.KeyboardShortcut.KeyBindings[keyString];if(key&&key.shiftKey)
modifiers|=WebInspector.KeyboardShortcut.Modifiers.Shift;return WebInspector.KeyboardShortcut.makeDescriptor(key?key:keyString,modifiers);}
WebInspector.KeyboardShortcut.shortcutToString=function(key,modifiers)
{return WebInspector.KeyboardShortcut._modifiersToString(modifiers)+WebInspector.KeyboardShortcut._keyName(key);}
WebInspector.KeyboardShortcut._keyName=function(key)
{if(typeof key==="string")
return key.toUpperCase();if(typeof key.name==="string")
return key.name;return key.name[WebInspector.platform()]||key.name.other||'';}
WebInspector.KeyboardShortcut._makeKeyFromCodeAndModifiers=function(keyCode,modifiers)
{return(keyCode&255)|(modifiers<<8);};WebInspector.KeyboardShortcut.keyCodeAndModifiersFromKey=function(key)
{return{keyCode:key&255,modifiers:key>>8};}
WebInspector.KeyboardShortcut._modifiersToString=function(modifiers)
{var isMac=WebInspector.isMac();var m=WebInspector.KeyboardShortcut.Modifiers;var modifierNames=new Map([[m.Ctrl,isMac?"Ctrl\u2004":"Ctrl\u200A+\u200A"],[m.Alt,isMac?"opt\u2004":"Alt\u200A+\u200A"],[m.Shift,isMac?"\u21e7\u2004":"Shift\u200A+\u200A"],[m.Meta,isMac?"\u2318\u2004":"Win\u200A+\u200A"]]);return[m.Meta,m.Ctrl,m.Alt,m.Shift].map(mapModifiers).join("");function mapModifiers(m)
{return modifiers&m?(modifierNames.get(m)):"";}};WebInspector.KeyboardShortcut.SelectAll=WebInspector.KeyboardShortcut.makeKey("a",WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta);;WebInspector.ListWidget=function(delegate)
{WebInspector.VBox.call(this,true);this.registerRequiredCSS("ui/listWidget.css");this._delegate=delegate;this._list=this.contentElement.createChild("div","list");this._editor=null;this._editItem=null;this._editElement=null;this._emptyPlaceholder=null;this.clear();}
WebInspector.ListWidget.Delegate=function()
{}
WebInspector.ListWidget.Delegate.prototype={renderItem:function(item,editable){},removeItemRequested:function(item,index){},beginEdit:function(item){},commitEdit:function(item,editor,isNew){}}
WebInspector.ListWidget.prototype={clear:function()
{this._items=[];this._editable=[];this._elements=[];this._lastSeparator=false;this._list.removeChildren();this._updatePlaceholder();this._stopEditing();},appendItem:function(item,editable)
{if(this._lastSeparator&&this._items.length)
this._list.appendChild(createElementWithClass("div","list-separator"));this._lastSeparator=false;this._items.push(item);this._editable.push(editable);var element=this._list.createChild("div","list-item");element.appendChild(this._delegate.renderItem(item,editable));if(editable){element.classList.add("editable");element.appendChild(this._createControls(item,element));}
this._elements.push(element);this._updatePlaceholder();},appendSeparator:function()
{this._lastSeparator=true;},removeItem:function(index)
{if(this._editItem===this._items[index])
this._stopEditing();var element=this._elements[index];var previous=element.previousElementSibling;var previousIsSeparator=previous&&previous.classList.contains("list-separator");var next=element.nextElementSibling;var nextIsSeparator=next&&next.classList.contains("list-separator");if(previousIsSeparator&&(nextIsSeparator||!next))
previous.remove();if(nextIsSeparator&&!previous)
next.remove();element.remove();this._elements.splice(index,1);this._items.splice(index,1);this._editable.splice(index,1);this._updatePlaceholder();},addNewItem:function(index,item)
{this._startEditing(item,null,this._elements[index]||null);},setEmptyPlaceholder:function(element)
{this._emptyPlaceholder=element;this._updatePlaceholder();},_createControls:function(item,element)
{var controls=createElementWithClass("div","controls-container fill");var gradient=controls.createChild("div","controls-gradient");var buttons=controls.createChild("div","controls-buttons");var editButton=buttons.createChild("div","edit-button");editButton.title=WebInspector.UIString("Edit");editButton.addEventListener("click",onEditClicked.bind(this),false);var removeButton=buttons.createChild("div","remove-button");removeButton.title=WebInspector.UIString("Remove");removeButton.addEventListener("click",onRemoveClicked.bind(this),false);return controls;function onEditClicked(event)
{event.consume();var insertionPoint=element&&element.nextElementSibling?element.nextElementSibling:null;this._startEditing(item,element,insertionPoint);}
function onRemoveClicked(event)
{event.consume();var index=this._elements.indexOf(element);this._delegate.removeItemRequested(this._items[index],index);}},wasShown:function()
{WebInspector.VBox.prototype.wasShown.call(this);this._stopEditing();},_updatePlaceholder:function()
{if(!this._emptyPlaceholder)
return;if(!this._elements.length&&!this._editor)
this._list.appendChild(this._emptyPlaceholder);else
this._emptyPlaceholder.remove();},_startEditing:function(item,element,insertionPoint)
{if(element&&this._editElement===element)
return;this._stopEditing();this._list.classList.add("list-editing");this._editItem=item;this._editElement=element;if(element)
element.classList.add("hidden");var index=element?this._elements.indexOf(element):-1;this._editor=this._delegate.beginEdit(item);this._updatePlaceholder();this._list.insertBefore(this._editor.element,insertionPoint);this._editor.beginEdit(item,index,element?WebInspector.UIString("Save"):WebInspector.UIString("Add"),this._commitEditing.bind(this),this._stopEditing.bind(this));},_commitEditing:function()
{var editItem=this._editItem;var isNew=!this._editElement;var editor=(this._editor);this._stopEditing();this._delegate.commitEdit(editItem,editor,isNew);},_stopEditing:function()
{this._list.classList.remove("list-editing");if(this._editElement)
this._editElement.classList.remove("hidden");if(this._editor&&this._editor.element.parentElement)
this._editor.element.remove();this._editor=null;this._editItem=null;this._editElement=null;this._updatePlaceholder();},__proto__:WebInspector.VBox.prototype}
WebInspector.ListWidget.Editor=function()
{this.element=createElementWithClass("div","editor-container");this.element.addEventListener("keydown",onKeyDown.bind(null,isEscKey,this._cancelClicked.bind(this)),false);this.element.addEventListener("keydown",onKeyDown.bind(null,isEnterKey,this._commitClicked.bind(this)),false);this._contentElement=this.element.createChild("div","editor-content");var buttonsRow=this.element.createChild("div","editor-buttons");this._commitButton=createTextButton("",this._commitClicked.bind(this));buttonsRow.appendChild(this._commitButton);this._cancelButton=createTextButton(WebInspector.UIString("Cancel"),this._cancelClicked.bind(this));this._cancelButton.addEventListener("keydown",onKeyDown.bind(null,isEnterKey,this._cancelClicked.bind(this)),false);buttonsRow.appendChild(this._cancelButton);function onKeyDown(predicate,callback,event)
{if(predicate(event)){event.consume(true);callback();}}
this._controls=[];this._controlByName=new Map();this._validators=[];this._commit=null;this._cancel=null;this._item=null;this._index=-1;}
WebInspector.ListWidget.Editor.prototype={contentElement:function()
{return this._contentElement;},createInput:function(name,type,title,validator)
{var input=(createElement("input"));input.type=type;input.placeholder=title;input.addEventListener("input",this._validateControls.bind(this,false),false);input.addEventListener("blur",this._validateControls.bind(this,false),false);this._controlByName.set(name,input);this._controls.push(input);this._validators.push(validator);return input;},createSelect:function(name,options,validator)
{var select=(createElementWithClass("select","chrome-select"));for(var index=0;index<options.length;++index){var option=select.createChild("option");option.value=options[index];option.textContent=options[index];}
select.addEventListener("input",this._validateControls.bind(this,false),false);select.addEventListener("blur",this._validateControls.bind(this,false),false);this._controlByName.set(name,select);this._controls.push(select);this._validators.push(validator);return select;},control:function(name)
{return(this._controlByName.get(name));},_validateControls:function(forceValid)
{var allValid=true;for(var index=0;index<this._controls.length;++index){var input=this._controls[index];var valid=this._validators[index].call(null,this._item,this._index,input);input.classList.toggle("error-input",!valid&&!forceValid);allValid&=valid;}
this._commitButton.disabled=!allValid;},beginEdit:function(item,index,commitButtonTitle,commit,cancel)
{this._commit=commit;this._cancel=cancel;this._item=item;this._index=index;this._commitButton.textContent=commitButtonTitle;this.element.scrollIntoViewIfNeeded(false);if(this._controls.length)
this._controls[0].focus();this._validateControls(true);},_commitClicked:function()
{if(this._commitButton.disabled)
return;var commit=this._commit;this._commit=null;this._cancel=null;this._item=null;this._index=-1;commit();},_cancelClicked:function()
{var cancel=this._cancel;this._commit=null;this._cancel=null;this._item=null;this._index=-1;cancel();}};WebInspector.Panel=function(name)
{WebInspector.VBox.call(this);this.element.classList.add("panel");this.element.classList.add(name);this._panelName=name;this._shortcuts=({});}
WebInspector.Panel.counterRightMargin=25;WebInspector.Panel.prototype={get name()
{return this._panelName;},reset:function()
{},searchableView:function()
{return null;},elementsToRestoreScrollPositionsFor:function()
{return[];},handleShortcut:function(event)
{var shortcutKey=WebInspector.KeyboardShortcut.makeKeyFromEvent(event);var handler=this._shortcuts[shortcutKey];if(handler&&handler(event))
event.handled=true;},registerShortcuts:function(keys,handler)
{for(var i=0;i<keys.length;++i)
this._shortcuts[keys[i].key]=handler;},showInfobar:function(infobar)
{infobar.setCloseCallback(this._onInfobarClosed.bind(this,infobar));if(this.element.firstChild)
this.element.insertBefore(infobar.element,this.element.firstChild);else
this.element.appendChild(infobar.element);infobar.setParentView(this);this.doResize();},_onInfobarClosed:function(infobar)
{infobar.element.remove();this.doResize();},__proto__:WebInspector.VBox.prototype}
WebInspector.PanelWithSidebar=function(name,defaultWidth)
{WebInspector.Panel.call(this,name);this._panelSplitWidget=new WebInspector.SplitWidget(true,false,this._panelName+"PanelSplitViewState",defaultWidth||200);this._panelSplitWidget.show(this.element);this._mainWidget=new WebInspector.VBox();this._panelSplitWidget.setMainWidget(this._mainWidget);this._sidebarWidget=new WebInspector.VBox();this._sidebarWidget.setMinimumSize(100,25);this._panelSplitWidget.setSidebarWidget(this._sidebarWidget);this._sidebarWidget.element.classList.add("sidebar");}
WebInspector.PanelWithSidebar.prototype={panelSidebarElement:function()
{return this._sidebarWidget.element;},mainElement:function()
{return this._mainWidget.element;},splitWidget:function()
{return this._panelSplitWidget;},__proto__:WebInspector.Panel.prototype}
WebInspector.PanelDescriptor=function()
{}
WebInspector.PanelDescriptor.prototype={name:function(){},title:function(){},panel:function(){}}
WebInspector.PanelFactory=function()
{}
WebInspector.PanelFactory.prototype={createPanel:function(){}}
WebInspector.RuntimeExtensionPanelDescriptor=function(extension)
{this._name=extension.descriptor()["name"];this._title=WebInspector.UIString(extension.descriptor()["title"]);this._extension=extension;}
WebInspector.RuntimeExtensionPanelDescriptor.prototype={name:function()
{return this._name;},title:function()
{return this._title;},panel:function()
{return this._extension.instancePromise().then(createPanel);function createPanel(panelFactory)
{return(panelFactory).createPanel();}}};WebInspector.Popover=function(popoverHelper)
{WebInspector.Widget.call(this);this.markAsRoot();this.element.className=WebInspector.Popover._classNamePrefix;this._containerElement=createElementWithClass("div","fill popover-container");this._popupArrowElement=this.element.createChild("div","arrow");this._contentDiv=this.element.createChild("div","content");this._popoverHelper=popoverHelper;this._hideBound=this.hide.bind(this);}
WebInspector.Popover._classNamePrefix="popover";WebInspector.Popover.prototype={showForAnchor:function(element,anchor,preferredWidth,preferredHeight,arrowDirection)
{this._innerShow(null,element,anchor,preferredWidth,preferredHeight,arrowDirection);},showView:function(view,anchor,preferredWidth,preferredHeight)
{this._innerShow(view,view.element,anchor,preferredWidth,preferredHeight);},_innerShow:function(view,contentElement,anchor,preferredWidth,preferredHeight,arrowDirection)
{if(this._disposed)
return;this._contentElement=contentElement;if(WebInspector.Popover._popover)
WebInspector.Popover._popover.hide();WebInspector.Popover._popover=this;var document=anchor instanceof Element?anchor.ownerDocument:contentElement.ownerDocument;var window=document.defaultView;var preferredSize=view?view.measurePreferredSize():WebInspector.measurePreferredSize(this._contentElement);this._preferredWidth=preferredWidth||preferredSize.width;this._preferredHeight=preferredHeight||preferredSize.height;window.addEventListener("resize",this._hideBound,false);document.body.appendChild(this._containerElement);WebInspector.Widget.prototype.show.call(this,this._containerElement);if(view)
view.show(this._contentDiv);else
this._contentDiv.appendChild(this._contentElement);this.positionElement(anchor,this._preferredWidth,this._preferredHeight,arrowDirection);if(this._popoverHelper){this._contentDiv.addEventListener("mousemove",this._popoverHelper._killHidePopoverTimer.bind(this._popoverHelper),true);this.element.addEventListener("mouseout",this._popoverHelper._popoverMouseOut.bind(this._popoverHelper),true);}},hide:function()
{this._containerElement.ownerDocument.defaultView.removeEventListener("resize",this._hideBound,false);this.detach();this._containerElement.remove();delete WebInspector.Popover._popover;},get disposed()
{return this._disposed;},dispose:function()
{if(this.isShowing())
this.hide();this._disposed=true;},setCanShrink:function(canShrink)
{this._hasFixedHeight=!canShrink;this._contentDiv.classList.toggle("fixed-height",this._hasFixedHeight);},setNoMargins:function(noMargins)
{this._hasNoMargins=noMargins;this._contentDiv.classList.toggle("no-margin",this._hasNoMargins);},positionElement:function(anchorElement,preferredWidth,preferredHeight,arrowDirection)
{const borderWidth=this._hasNoMargins?0:8;const scrollerWidth=this._hasFixedHeight?0:14;const arrowHeight=this._hasNoMargins?8:15;const arrowOffset=10;const borderRadius=4;const arrowRadius=6;preferredWidth=preferredWidth||this._preferredWidth;preferredHeight=preferredHeight||this._preferredHeight;preferredWidth=Math.max(preferredWidth,50);const container=WebInspector.Dialog.modalHostView().element;const totalWidth=container.offsetWidth;const totalHeight=container.offsetHeight;var anchorBox=anchorElement instanceof AnchorBox?anchorElement:anchorElement.boxInWindow(window);anchorBox=anchorBox.relativeToElement(container);var newElementPosition={x:0,y:0,width:preferredWidth+scrollerWidth,height:preferredHeight};var verticalAlignment;var roomAbove=anchorBox.y;var roomBelow=totalHeight-anchorBox.y-anchorBox.height;if((roomAbove>roomBelow)||(arrowDirection===WebInspector.Popover.Orientation.Bottom)){if((anchorBox.y>newElementPosition.height+arrowHeight+borderRadius)||(arrowDirection===WebInspector.Popover.Orientation.Bottom))
newElementPosition.y=anchorBox.y-newElementPosition.height-arrowHeight;else{newElementPosition.y=borderRadius;newElementPosition.height=anchorBox.y-borderRadius*2-arrowHeight;if(this._hasFixedHeight&&newElementPosition.height<preferredHeight){newElementPosition.y=borderRadius;newElementPosition.height=preferredHeight;}}
verticalAlignment=WebInspector.Popover.Orientation.Bottom;}else{newElementPosition.y=anchorBox.y+anchorBox.height+arrowHeight;if((newElementPosition.y+newElementPosition.height+borderRadius>=totalHeight)&&(arrowDirection!==WebInspector.Popover.Orientation.Top)){newElementPosition.height=totalHeight-borderRadius-newElementPosition.y;if(this._hasFixedHeight&&newElementPosition.height<preferredHeight){newElementPosition.y=totalHeight-preferredHeight-borderRadius;newElementPosition.height=preferredHeight;}}
verticalAlignment=WebInspector.Popover.Orientation.Top;}
var horizontalAlignment;this._popupArrowElement.removeAttribute("style");if(anchorBox.x+newElementPosition.width<totalWidth){newElementPosition.x=Math.max(borderRadius,anchorBox.x-borderRadius-arrowOffset);horizontalAlignment="left";this._popupArrowElement.style.left=arrowOffset+"px";}else if(newElementPosition.width+borderRadius*2<totalWidth){newElementPosition.x=totalWidth-newElementPosition.width-borderRadius-2*borderWidth;horizontalAlignment="right";var arrowRightPosition=Math.max(0,totalWidth-anchorBox.x-anchorBox.width-borderRadius-arrowOffset);arrowRightPosition+=anchorBox.width/2;arrowRightPosition=Math.min(arrowRightPosition,newElementPosition.width-borderRadius-arrowOffset);this._popupArrowElement.style.right=arrowRightPosition+"px";}else{newElementPosition.x=borderRadius;newElementPosition.width=totalWidth-borderRadius*2;newElementPosition.height+=scrollerWidth;horizontalAlignment="left";if(verticalAlignment===WebInspector.Popover.Orientation.Bottom)
newElementPosition.y-=scrollerWidth;this._popupArrowElement.style.left=Math.max(0,anchorBox.x-newElementPosition.x-borderRadius-arrowRadius+anchorBox.width/2)+"px";}
this.element.className=WebInspector.Popover._classNamePrefix+" "+verticalAlignment+"-"+horizontalAlignment+"-arrow";this.element.positionAt(newElementPosition.x,newElementPosition.y-borderWidth,container);this.element.style.width=newElementPosition.width+borderWidth*2+"px";this.element.style.height=newElementPosition.height+borderWidth*2+"px";},__proto__:WebInspector.Widget.prototype}
WebInspector.PopoverHelper=function(panelElement,getAnchor,showPopover,onHide,disableOnClick)
{this._getAnchor=getAnchor;this._showPopover=showPopover;this._onHide=onHide;this._disableOnClick=!!disableOnClick;panelElement.addEventListener("mousedown",this._mouseDown.bind(this),false);panelElement.addEventListener("mousemove",this._mouseMove.bind(this),false);panelElement.addEventListener("mouseout",this._mouseOut.bind(this),false);this.setTimeout(1000,500);}
WebInspector.PopoverHelper.prototype={setTimeout:function(timeout,hideTimeout)
{this._timeout=timeout;if(typeof hideTimeout==="number")
this._hideTimeout=hideTimeout;else
this._hideTimeout=timeout/2;},_eventInHoverElement:function(event)
{if(!this._hoverElement)
return false;var box=this._hoverElement instanceof AnchorBox?this._hoverElement:this._hoverElement.boxInWindow();return(box.x<=event.clientX&&event.clientX<=box.x+box.width&&box.y<=event.clientY&&event.clientY<=box.y+box.height);},_mouseDown:function(event)
{if(this._disableOnClick||!this._eventInHoverElement(event))
this.hidePopover();else{this._killHidePopoverTimer();this._handleMouseAction(event,true);}},_mouseMove:function(event)
{if(this._eventInHoverElement(event))
return;this._startHidePopoverTimer();this._handleMouseAction(event,false);},_popoverMouseOut:function(event)
{if(!this.isPopoverVisible())
return;if(event.relatedTarget&&!event.relatedTarget.isSelfOrDescendant(this._popover._contentDiv))
this._startHidePopoverTimer();},_mouseOut:function(event)
{if(!this.isPopoverVisible())
return;if(!this._eventInHoverElement(event))
this._startHidePopoverTimer();},_startHidePopoverTimer:function()
{if(!this._popover||this._hidePopoverTimer)
return;function doHide()
{this._hidePopover();delete this._hidePopoverTimer;}
this._hidePopoverTimer=setTimeout(doHide.bind(this),this._hideTimeout);},_handleMouseAction:function(event,isMouseDown)
{this._resetHoverTimer();if(event.which&&this._disableOnClick)
return;this._hoverElement=this._getAnchor(event.target,event);if(!this._hoverElement)
return;const toolTipDelay=isMouseDown?0:(this._popup?this._timeout*0.6:this._timeout);this._hoverTimer=setTimeout(this._mouseHover.bind(this,this._hoverElement),toolTipDelay);},_resetHoverTimer:function()
{if(this._hoverTimer){clearTimeout(this._hoverTimer);delete this._hoverTimer;}},isPopoverVisible:function()
{return!!this._popover;},hidePopover:function()
{this._resetHoverTimer();this._hidePopover();},_hidePopover:function()
{if(!this._popover)
return;if(this._onHide)
this._onHide();this._popover.dispose();delete this._popover;this._hoverElement=null;},_mouseHover:function(element)
{delete this._hoverTimer;this._hoverElement=element;this._hidePopover();this._popover=new WebInspector.Popover(this);this._showPopover(element,this._popover);},_killHidePopoverTimer:function()
{if(this._hidePopoverTimer){clearTimeout(this._hidePopoverTimer);delete this._hidePopoverTimer;this._resetHoverTimer();}}}
WebInspector.Popover.Orientation={Top:"top",Bottom:"bottom"};WebInspector.ProgressIndicator=function()
{this.element=createElementWithClass("div","progress-indicator");this._shadowRoot=WebInspector.createShadowRootWithCoreStyles(this.element,"ui/progressIndicator.css");this._contentElement=this._shadowRoot.createChild("div","progress-indicator-shadow-container");this._labelElement=this._contentElement.createChild("div","title");this._progressElement=this._contentElement.createChild("progress");this._progressElement.value=0;this._stopButton=this._contentElement.createChild("button","progress-indicator-shadow-stop-button");this._stopButton.addEventListener("click",this.cancel.bind(this));this._isCanceled=false;this._worked=0;}
WebInspector.ProgressIndicator.prototype={show:function(parent)
{parent.appendChild(this.element);},done:function()
{if(this._isDone)
return;this._isDone=true;this.element.remove();},cancel:function()
{this._isCanceled=true;},isCanceled:function()
{return this._isCanceled;},setTitle:function(title)
{this._labelElement.textContent=title;},setTotalWork:function(totalWork)
{this._progressElement.max=totalWork;},setWorked:function(worked,title)
{this._worked=worked;this._progressElement.value=worked;if(title)
this.setTitle(title);},worked:function(worked)
{this.setWorked(this._worked+(worked||1));}};WebInspector.ResizerWidget=function()
{WebInspector.Object.call(this);this._isEnabled=true;this._elements=[];this._installDragOnMouseDownBound=this._installDragOnMouseDown.bind(this);this._cursor="nwse-resize";};WebInspector.ResizerWidget.Events={ResizeStart:"ResizeStart",ResizeUpdate:"ResizeUpdate",ResizeEnd:"ResizeEnd"};WebInspector.ResizerWidget.prototype={isEnabled:function()
{return this._isEnabled;},setEnabled:function(enabled)
{this._isEnabled=enabled;this.updateElementCursors();},elements:function()
{return this._elements.slice();},addElement:function(element)
{if(this._elements.indexOf(element)!==-1)
return;this._elements.push(element);element.addEventListener("mousedown",this._installDragOnMouseDownBound,false);this._updateElementCursor(element);},removeElement:function(element)
{if(this._elements.indexOf(element)===-1)
return;this._elements.remove(element);element.removeEventListener("mousedown",this._installDragOnMouseDownBound,false);element.style.removeProperty("cursor");},updateElementCursors:function()
{this._elements.forEach(this._updateElementCursor.bind(this));},_updateElementCursor:function(element)
{if(this._isEnabled)
element.style.setProperty("cursor",this.cursor());else
element.style.removeProperty("cursor");},cursor:function()
{return this._cursor;},setCursor:function(cursor)
{this._cursor=cursor;this.updateElementCursors();},_installDragOnMouseDown:function(event)
{if(this._elements.indexOf(event.target)===-1)
return false;WebInspector.elementDragStart((event.target),this._dragStart.bind(this),this._drag.bind(this),this._dragEnd.bind(this),this.cursor(),event);},_dragStart:function(event)
{if(!this._isEnabled)
return false;this._startX=event.pageX;this._startY=event.pageY;this.sendDragStart(this._startX,this._startY);return true;},sendDragStart:function(x,y)
{this.dispatchEventToListeners(WebInspector.ResizerWidget.Events.ResizeStart,{startX:x,currentX:x,startY:y,currentY:y});},_drag:function(event)
{if(!this._isEnabled){this._dragEnd(event);return true;}
this.sendDragMove(this._startX,event.pageX,this._startY,event.pageY,event.shiftKey);event.preventDefault();return false;},sendDragMove:function(startX,currentX,startY,currentY,shiftKey)
{this.dispatchEventToListeners(WebInspector.ResizerWidget.Events.ResizeUpdate,{startX:startX,currentX:currentX,startY:startY,currentY:currentY,shiftKey:shiftKey});},_dragEnd:function(event)
{this.dispatchEventToListeners(WebInspector.ResizerWidget.Events.ResizeEnd);delete this._startX;delete this._startY;},__proto__:WebInspector.Object.prototype};WebInspector.SimpleResizerWidget=function()
{WebInspector.ResizerWidget.call(this);this._isVertical=true;};WebInspector.SimpleResizerWidget.prototype={isVertical:function()
{return this._isVertical;},setVertical:function(vertical)
{this._isVertical=vertical;this.updateElementCursors();},cursor:function()
{return this._isVertical?"ns-resize":"ew-resize";},sendDragStart:function(x,y)
{var position=this._isVertical?y:x;this.dispatchEventToListeners(WebInspector.ResizerWidget.Events.ResizeStart,{startPosition:position,currentPosition:position});},sendDragMove:function(startX,currentX,startY,currentY,shiftKey)
{if(this._isVertical)
this.dispatchEventToListeners(WebInspector.ResizerWidget.Events.ResizeUpdate,{startPosition:startY,currentPosition:currentY,shiftKey:shiftKey});else
this.dispatchEventToListeners(WebInspector.ResizerWidget.Events.ResizeUpdate,{startPosition:startX,currentPosition:currentX,shiftKey:shiftKey});},__proto__:WebInspector.ResizerWidget.prototype};;WebInspector.RootView=function()
{WebInspector.VBox.call(this);this.markAsRoot();this.element.classList.add("root-view");this.element.setAttribute("spellcheck",false);}
WebInspector.RootView.prototype={attachToDocument:function(document)
{document.defaultView.addEventListener("resize",this.doResize.bind(this),false);this._window=document.defaultView;this.doResize();this.show(document.body);},doResize:function()
{if(this._window){var size=this.constraints().minimum;var zoom=WebInspector.zoomManager.zoomFactor();var right=Math.min(0,this._window.innerWidth-size.width/zoom);this.element.style.marginRight=right+"px";var bottom=Math.min(0,this._window.innerHeight-size.height/zoom);this.element.style.marginBottom=bottom+"px";}
WebInspector.VBox.prototype.doResize.call(this);},__proto__:WebInspector.VBox.prototype};WebInspector.SearchableView=function(searchable,settingName)
{WebInspector.VBox.call(this,true);this.registerRequiredCSS("ui/searchableView.css");this.element[WebInspector.SearchableView._symbol]=this;this._searchProvider=searchable;this._setting=settingName?WebInspector.settings.createSetting(settingName,{}):null;this.contentElement.createChild("content");this._footerElementContainer=this.contentElement.createChild("div","search-bar hidden");this._footerElementContainer.style.order=100;var toolbar=new WebInspector.Toolbar("search-toolbar",this._footerElementContainer);if(this._searchProvider.supportsCaseSensitiveSearch()){this._caseSensitiveButton=new WebInspector.ToolbarToggle(WebInspector.UIString("Case sensitive"),"");this._caseSensitiveButton.setText("Aa");this._caseSensitiveButton.addEventListener("click",this._toggleCaseSensitiveSearch,this);toolbar.appendToolbarItem(this._caseSensitiveButton);}
if(this._searchProvider.supportsRegexSearch()){this._regexButton=new WebInspector.ToolbarToggle(WebInspector.UIString("Regex"),"");this._regexButton.setText(".*");this._regexButton.addEventListener("click",this._toggleRegexSearch,this);toolbar.appendToolbarItem(this._regexButton);}
this._footerElement=this._footerElementContainer.createChild("table","toolbar-search");this._footerElement.cellSpacing=0;this._firstRowElement=this._footerElement.createChild("tr");this._secondRowElement=this._footerElement.createChild("tr","hidden");var searchControlElementColumn=this._firstRowElement.createChild("td");this._searchControlElement=searchControlElementColumn.createChild("span","toolbar-search-control");this._searchInputElement=WebInspector.HistoryInput.create();this._searchInputElement.classList.add("search-replace");this._searchControlElement.appendChild(this._searchInputElement);this._searchInputElement.id="search-input-field";this._searchInputElement.placeholder=WebInspector.UIString("Find");this._matchesElement=this._searchControlElement.createChild("label","search-results-matches");this._matchesElement.setAttribute("for","search-input-field");this._searchNavigationElement=this._searchControlElement.createChild("div","toolbar-search-navigation-controls");this._searchNavigationPrevElement=this._searchNavigationElement.createChild("div","toolbar-search-navigation toolbar-search-navigation-prev");this._searchNavigationPrevElement.addEventListener("click",this._onPrevButtonSearch.bind(this),false);this._searchNavigationPrevElement.title=WebInspector.UIString("Search Previous");this._searchNavigationNextElement=this._searchNavigationElement.createChild("div","toolbar-search-navigation toolbar-search-navigation-next");this._searchNavigationNextElement.addEventListener("click",this._onNextButtonSearch.bind(this),false);this._searchNavigationNextElement.title=WebInspector.UIString("Search Next");this._searchInputElement.addEventListener("mousedown",this._onSearchFieldManualFocus.bind(this),false);this._searchInputElement.addEventListener("keydown",this._onSearchKeyDown.bind(this),true);this._searchInputElement.addEventListener("input",this._onInput.bind(this),false);this._replaceInputElement=this._secondRowElement.createChild("td").createChild("input","search-replace toolbar-replace-control");this._replaceInputElement.addEventListener("keydown",this._onReplaceKeyDown.bind(this),true);this._replaceInputElement.placeholder=WebInspector.UIString("Replace");this._findButtonElement=this._firstRowElement.createChild("td").createChild("button","search-action-button hidden");this._findButtonElement.textContent=WebInspector.UIString("Find");this._findButtonElement.tabIndex=-1;this._findButtonElement.addEventListener("click",this._onFindClick.bind(this),false);this._replaceButtonElement=this._secondRowElement.createChild("td").createChild("button","search-action-button");this._replaceButtonElement.textContent=WebInspector.UIString("Replace");this._replaceButtonElement.disabled=true;this._replaceButtonElement.tabIndex=-1;this._replaceButtonElement.addEventListener("click",this._replace.bind(this),false);this._prevButtonElement=this._firstRowElement.createChild("td").createChild("button","search-action-button hidden");this._prevButtonElement.textContent=WebInspector.UIString("Previous");this._prevButtonElement.tabIndex=-1;this._prevButtonElement.addEventListener("click",this._onPreviousClick.bind(this),false);this._replaceAllButtonElement=this._secondRowElement.createChild("td").createChild("button","search-action-button");this._replaceAllButtonElement.textContent=WebInspector.UIString("Replace All");this._replaceAllButtonElement.addEventListener("click",this._replaceAll.bind(this),false);this._replaceElement=this._firstRowElement.createChild("td").createChild("span");this._replaceLabelElement=createCheckboxLabel(WebInspector.UIString("Replace"));this._replaceCheckboxElement=this._replaceLabelElement.checkboxElement;this._uniqueId=++WebInspector.SearchableView._lastUniqueId;var replaceCheckboxId="search-replace-trigger"+this._uniqueId;this._replaceCheckboxElement.id=replaceCheckboxId;this._replaceCheckboxElement.addEventListener("change",this._updateSecondRowVisibility.bind(this),false);this._replaceElement.appendChild(this._replaceLabelElement);var cancelButtonElement=this._firstRowElement.createChild("td").createChild("button","search-action-button");cancelButtonElement.textContent=WebInspector.UIString("Cancel");cancelButtonElement.tabIndex=-1;cancelButtonElement.addEventListener("click",this.closeSearch.bind(this),false);this._minimalSearchQuerySize=3;this._loadSetting();}
WebInspector.SearchableView._lastUniqueId=0;WebInspector.SearchableView._symbol=Symbol("searchableView");WebInspector.SearchableView.fromElement=function(element)
{var view=null;while(element&&!view){view=element[WebInspector.SearchableView._symbol];element=element.parentElementOrShadowHost();}
return view;}
WebInspector.SearchableView.prototype={_toggleCaseSensitiveSearch:function()
{this._caseSensitiveButton.setToggled(!this._caseSensitiveButton.toggled());this._saveSetting();this._performSearch(false,true);},_toggleRegexSearch:function()
{this._regexButton.setToggled(!this._regexButton.toggled());this._saveSetting();this._performSearch(false,true);},_saveSetting:function()
{if(!this._setting)
return;var settingValue=this._setting.get()||{};settingValue.caseSensitive=this._caseSensitiveButton.toggled();settingValue.isRegex=this._regexButton.toggled();this._setting.set(settingValue);},_loadSetting:function()
{var settingValue=this._setting?(this._setting.get()||{}):{};if(this._searchProvider.supportsCaseSensitiveSearch())
this._caseSensitiveButton.setToggled(!!settingValue.caseSensitive);if(this._searchProvider.supportsRegexSearch())
this._regexButton.setToggled(!!settingValue.isRegex);},defaultFocusedElement:function()
{var children=this.children();for(var i=0;i<children.length;++i){var element=children[i].defaultFocusedElement();if(element)
return element;}
return WebInspector.Widget.prototype.defaultFocusedElement.call(this);},setMinimalSearchQuerySize:function(minimalSearchQuerySize)
{this._minimalSearchQuerySize=minimalSearchQuerySize;},setPlaceholder:function(placeholder)
{this._searchInputElement.placeholder=placeholder;},setReplaceable:function(replaceable)
{this._replaceable=replaceable;},updateSearchMatchesCount:function(matches)
{this._searchProvider.currentSearchMatches=matches;this._updateSearchMatchesCountAndCurrentMatchIndex(this._searchProvider.currentQuery?matches:0,-1);},updateCurrentMatchIndex:function(currentMatchIndex)
{this._updateSearchMatchesCountAndCurrentMatchIndex(this._searchProvider.currentSearchMatches,currentMatchIndex);},isSearchVisible:function()
{return this._searchIsVisible;},closeSearch:function()
{this.cancelSearch();if(WebInspector.currentFocusElement()&&WebInspector.currentFocusElement().isDescendant(this._footerElementContainer))
this.focus();},_toggleSearchBar:function(toggled)
{this._footerElementContainer.classList.toggle("hidden",!toggled);this.doResize();},cancelSearch:function()
{if(!this._searchIsVisible)
return;this.resetSearch();delete this._searchIsVisible;this._toggleSearchBar(false);},resetSearch:function()
{this._clearSearch();this._updateReplaceVisibility();this._matchesElement.textContent="";},refreshSearch:function()
{if(!this._searchIsVisible)
return;this.resetSearch();this._performSearch(false,false);},handleFindNextShortcut:function()
{if(!this._searchIsVisible)
return false;this._searchProvider.jumpToNextSearchResult();return true;},handleFindPreviousShortcut:function()
{if(!this._searchIsVisible)
return false;this._searchProvider.jumpToPreviousSearchResult();return true;},handleFindShortcut:function()
{this.showSearchField();return true;},handleCancelSearchShortcut:function()
{if(!this._searchIsVisible)
return false;this.closeSearch();return true;},_updateSearchNavigationButtonState:function(enabled)
{this._replaceButtonElement.disabled=!enabled;if(enabled){this._searchNavigationPrevElement.classList.add("enabled");this._searchNavigationNextElement.classList.add("enabled");}else{this._searchNavigationPrevElement.classList.remove("enabled");this._searchNavigationNextElement.classList.remove("enabled");}},_updateSearchMatchesCountAndCurrentMatchIndex:function(matches,currentMatchIndex)
{if(!this._currentQuery)
this._matchesElement.textContent="";else if(matches===0||currentMatchIndex>=0)
this._matchesElement.textContent=WebInspector.UIString("%d of %d",currentMatchIndex+1,matches);else if(matches===1)
this._matchesElement.textContent=WebInspector.UIString("1 match");else
this._matchesElement.textContent=WebInspector.UIString("%d matches",matches);this._updateSearchNavigationButtonState(matches>0);},showSearchField:function()
{if(this._searchIsVisible)
this.cancelSearch();var queryCandidate;if(WebInspector.currentFocusElement()!==this._searchInputElement){var selection=this._searchInputElement.getComponentSelection();if(selection.rangeCount)
queryCandidate=selection.toString().replace(/\r?\n.*/,"");}
this._toggleSearchBar(true);this._updateReplaceVisibility();if(queryCandidate)
this._searchInputElement.value=queryCandidate;this._performSearch(false,false);this._searchInputElement.focus();this._searchInputElement.select();this._searchIsVisible=true;},_updateReplaceVisibility:function()
{this._replaceElement.classList.toggle("hidden",!this._replaceable);if(!this._replaceable){this._replaceCheckboxElement.checked=false;this._updateSecondRowVisibility();}},_onSearchFieldManualFocus:function(event)
{WebInspector.setCurrentFocusElement((event.target));},_onSearchKeyDown:function(event)
{if(!isEnterKey(event))
return;if(!this._currentQuery)
this._performSearch(true,true,event.shiftKey);else
this._jumpToNextSearchResult(event.shiftKey);},_onReplaceKeyDown:function(event)
{if(isEnterKey(event))
this._replace();},_jumpToNextSearchResult:function(isBackwardSearch)
{if(!this._currentQuery||!this._searchNavigationPrevElement.classList.contains("enabled"))
return;if(isBackwardSearch)
this._searchProvider.jumpToPreviousSearchResult();else
this._searchProvider.jumpToNextSearchResult();},_onNextButtonSearch:function(event)
{if(!this._searchNavigationNextElement.classList.contains("enabled"))
return;this._jumpToNextSearchResult();this._searchInputElement.focus();},_onPrevButtonSearch:function(event)
{if(!this._searchNavigationPrevElement.classList.contains("enabled"))
return;this._jumpToNextSearchResult(true);this._searchInputElement.focus();},_onFindClick:function(event)
{if(!this._currentQuery)
this._performSearch(true,true);else
this._jumpToNextSearchResult();this._searchInputElement.focus();},_onPreviousClick:function(event)
{if(!this._currentQuery)
this._performSearch(true,true,true);else
this._jumpToNextSearchResult(true);this._searchInputElement.focus();},_clearSearch:function()
{delete this._currentQuery;if(!!this._searchProvider.currentQuery){delete this._searchProvider.currentQuery;this._searchProvider.searchCanceled();}
this._updateSearchMatchesCountAndCurrentMatchIndex(0,-1);},_performSearch:function(forceSearch,shouldJump,jumpBackwards)
{var query=this._searchInputElement.value;if(!query||(!forceSearch&&query.length<this._minimalSearchQuerySize&&!this._currentQuery)){this._clearSearch();return;}
this._currentQuery=query;this._searchProvider.currentQuery=query;var searchConfig=this._currentSearchConfig();this._searchProvider.performSearch(searchConfig,shouldJump,jumpBackwards);},_currentSearchConfig:function()
{var query=this._searchInputElement.value;var caseSensitive=this._caseSensitiveButton?this._caseSensitiveButton.toggled():false;var isRegex=this._regexButton?this._regexButton.toggled():false;return new WebInspector.SearchableView.SearchConfig(query,caseSensitive,isRegex);},_updateSecondRowVisibility:function()
{var secondRowVisible=this._replaceCheckboxElement.checked;this._footerElementContainer.classList.toggle("replaceable",secondRowVisible);this._footerElement.classList.toggle("toolbar-search-replace",secondRowVisible);this._secondRowElement.classList.toggle("hidden",!secondRowVisible);this._prevButtonElement.classList.toggle("hidden",!secondRowVisible);this._findButtonElement.classList.toggle("hidden",!secondRowVisible);this._replaceCheckboxElement.tabIndex=secondRowVisible?-1:0;if(secondRowVisible)
this._replaceInputElement.focus();else
this._searchInputElement.focus();this.doResize();},_replace:function()
{var searchConfig=this._currentSearchConfig();(this._searchProvider).replaceSelectionWith(searchConfig,this._replaceInputElement.value);delete this._currentQuery;this._performSearch(true,true);},_replaceAll:function()
{var searchConfig=this._currentSearchConfig();(this._searchProvider).replaceAllWith(searchConfig,this._replaceInputElement.value);},_onInput:function(event)
{if(this._valueChangedTimeoutId)
clearTimeout(this._valueChangedTimeoutId);var timeout=this._searchInputElement.value.length<3?200:0;this._valueChangedTimeoutId=setTimeout(this._onValueChanged.bind(this),timeout);},_onValueChanged:function()
{delete this._valueChangedTimeoutId;this._performSearch(false,true);},__proto__:WebInspector.VBox.prototype}
WebInspector.Searchable=function()
{}
WebInspector.Searchable.prototype={searchCanceled:function(){},performSearch:function(searchConfig,shouldJump,jumpBackwards){},jumpToNextSearchResult:function(){},jumpToPreviousSearchResult:function(){},supportsCaseSensitiveSearch:function(){},supportsRegexSearch:function(){}}
WebInspector.Replaceable=function()
{}
WebInspector.Replaceable.prototype={replaceSelectionWith:function(searchConfig,replacement){},replaceAllWith:function(searchConfig,replacement){}}
WebInspector.SearchableView.SearchConfig=function(query,caseSensitive,isRegex)
{this.query=query;this.caseSensitive=caseSensitive;this.isRegex=isRegex;}
WebInspector.SearchableView.SearchConfig.prototype={toSearchRegex:function(global)
{var modifiers=this.caseSensitive?"":"i";if(global)
modifiers+="g";var query=this.isRegex?"/"+this.query+"/":this.query;var regex;try{if(/^\/.+\/$/.test(query)){regex=new RegExp(query.substring(1,query.length-1),modifiers);regex.__fromRegExpQuery=true;}}catch(e){}
if(!regex)
regex=createPlainTextSearchRegex(query,modifiers);return regex;}};WebInspector.Section=function(title,subtitle)
{this.element=createElementWithClass("div","section");this.element._section=this;this.registerRequiredCSS("ui/section.css");this.headerElement=createElementWithClass("div","header monospace");this.titleElement=createElementWithClass("div","title");this.subtitleElement=createElementWithClass("div","subtitle");this.headerElement.appendChild(this.subtitleElement);this.headerElement.appendChild(this.titleElement);this.headerElement.addEventListener("click",this.handleClick.bind(this),false);this.element.appendChild(this.headerElement);this.title=title;if(subtitle){this._subtitle=subtitle;this.subtitleElement.textContent=subtitle;}
this._expanded=false;}
WebInspector.Section.prototype={get title()
{return this._title;},set title(x)
{if(this._title===x)
return;this._title=x;if(x instanceof Node){this.titleElement.removeChildren();this.titleElement.appendChild(x);}else
this.titleElement.textContent=x;},get subtitle()
{return this._subtitle;},get expanded()
{return this._expanded;},repopulate:function()
{this._populated=false;if(this._expanded){this.onpopulate();this._populated=true;}},onpopulate:function()
{},expand:function()
{if(this._expanded)
return;this._expanded=true;this.element.classList.add("expanded");if(!this._populated){this.onpopulate();this._populated=true;}},collapse:function()
{if(!this._expanded)
return;this._expanded=false;this.element.classList.remove("expanded");},registerRequiredCSS:function(cssFile)
{WebInspector.appendStyle(this.element,cssFile);},handleClick:function(event)
{if(this._doNotExpandOnTitleClick)
return;if(this._expanded)
this.collapse();else
this.expand();event.consume();},doNotExpandOnTitleClick:function()
{this._doNotExpandOnTitleClick=true;}}
WebInspector.PropertiesSection=function(title,subtitle)
{WebInspector.Section.call(this,title,subtitle);this.registerRequiredCSS("ui/propertiesSection.css");this.propertiesTreeOutline=new TreeOutline(true);this.propertiesElement=this.propertiesTreeOutline.element;this.propertiesElement.classList.add("properties","properties-tree","monospace");this.propertiesTreeOutline.setFocusable(false);this.propertiesTreeOutline.section=this;this.element.appendChild(this.propertiesElement);}
WebInspector.PropertiesSection.prototype={__proto__:WebInspector.Section.prototype};WebInspector.SettingsUI={}
WebInspector.SettingsUI.createSettingCheckbox=function(name,setting,omitParagraphElement,tooltip)
{var label=createCheckboxLabel(name);if(tooltip)
label.title=tooltip;var input=label.checkboxElement;input.name=name;WebInspector.SettingsUI.bindCheckbox(input,setting);if(omitParagraphElement)
return label;var p=createElement("p");p.appendChild(label);return p;}
WebInspector.SettingsUI.bindCheckbox=function(input,setting)
{function settingChanged()
{if(input.checked!==setting.get())
input.checked=setting.get();}
setting.addChangeListener(settingChanged);settingChanged();function inputChanged()
{if(setting.get()!==input.checked)
setting.set(input.checked);}
input.addEventListener("change",inputChanged,false);}
WebInspector.SettingsUI.createSettingInputField=function(label,setting,numeric,maxLength,width,validatorCallback,instant,clearForZero,placeholder)
{var p=createElement("p");var labelElement=p.createChild("label");labelElement.textContent=label;var inputElement=p.createChild("input");inputElement.type="text";if(numeric)
inputElement.className="numeric";if(maxLength)
inputElement.maxLength=maxLength;if(width)
inputElement.style.width=width;inputElement.placeholder=placeholder||"";var errorMessageLabel;if(validatorCallback)
errorMessageLabel=p.createChild("div","field-error-message");WebInspector.SettingsUI.bindSettingInputField(inputElement,setting,numeric,validatorCallback,instant,clearForZero,errorMessageLabel);return p;}
WebInspector.SettingsUI.bindSettingInputField=function(inputElement,setting,numeric,validatorCallback,instant,clearForZero,errorMessageLabel)
{if(validatorCallback||instant){inputElement.addEventListener("change",onInput,false);inputElement.addEventListener("input",onInput,false);}
inputElement.addEventListener("keydown",onKeyDown,false);function onInput()
{if(validatorCallback)
validate();if(instant)
apply();}
function onKeyDown(event)
{if(isEnterKey(event))
apply();incrementForArrows(event);}
function incrementForArrows(event)
{if(!numeric)
return;var increment=event.keyIdentifier==="Up"?1:event.keyIdentifier==="Down"?-1:0;if(!increment)
return;if(event.shiftKey)
increment*=10;var value=inputElement.value;if(validatorCallback&&validatorCallback(value))
return;value=Number(value);if(clearForZero&&!value)
return;value+=increment;if(clearForZero&&!value)
return;value=String(value);if(validatorCallback&&validatorCallback(value))
return;inputElement.value=value;apply();event.preventDefault();}
function validate()
{var error=validatorCallback(inputElement.value);if(!error)
error="";inputElement.classList.toggle("error-input",!!error);if(errorMessageLabel)
errorMessageLabel.textContent=error;}
if(!instant)
inputElement.addEventListener("blur",apply,false);function apply()
{if(validatorCallback&&validatorCallback(inputElement.value))
return;setting.removeChangeListener(onSettingChange);setting.set(numeric?Number(inputElement.value):inputElement.value);setting.addChangeListener(onSettingChange);}
setting.addChangeListener(onSettingChange);function onSettingChange()
{var value=setting.get();if(clearForZero&&!value)
value="";inputElement.value=value;validate();}
onSettingChange();if(validatorCallback)
validate();}
WebInspector.SettingsUI.createCustomSetting=function(name,element)
{var p=createElement("p");var fieldsetElement=p.createChild("fieldset");fieldsetElement.createChild("label").textContent=name;fieldsetElement.appendChild(element);return p;}
WebInspector.SettingsUI.createSettingFieldset=function(setting)
{var fieldset=createElement("fieldset");fieldset.disabled=!setting.get();setting.addChangeListener(settingChanged);return fieldset;function settingChanged()
{fieldset.disabled=!setting.get();}}
WebInspector.SettingsUI.regexValidator=function(text)
{var regex;try{regex=new RegExp(text);}catch(e){}
return regex?null:WebInspector.UIString("Invalid pattern");}
WebInspector.SettingsUI.createInput=function(parentElement,id,defaultText,eventListener,numeric,size)
{var element=parentElement.createChild("input");element.id=id;element.type="text";element.maxLength=12;element.style.width=size||"80px";element.value=defaultText;element.align="right";if(numeric)
element.className="numeric";element.addEventListener("input",eventListener,false);element.addEventListener("keydown",keyDownListener,false);function keyDownListener(event)
{if(isEnterKey(event))
eventListener(event);}
return element;}
WebInspector.SettingUI=function()
{}
WebInspector.SettingUI.prototype={settingElement:function(){}};WebInspector.SidebarSectionTreeElement=function(title)
{TreeElement.call(this,title.escapeHTML(),true);this.expand();}
WebInspector.SidebarSectionTreeElement.prototype={selectable:false,collapse:function()
{},get smallChildren()
{return this._smallChildren;},set smallChildren(x)
{if(this._smallChildren===x)
return;this._smallChildren=x;this._childrenListNode.classList.toggle("small",this._smallChildren);},onattach:function()
{this.listItemElement.classList.add("sidebar-tree-section");},__proto__:TreeElement.prototype}
WebInspector.SidebarTreeElement=function(className,title,subtitle,expandable)
{TreeElement.call(this,"",expandable);if(expandable)
this.disclosureButton=createElementWithClass("button","disclosure-button");this.iconElement=createElementWithClass("div","icon");this.statusElement=createElementWithClass("div","status");this._titlesElement=createElementWithClass("div","titles");this.titleContainer=this._titlesElement.createChild("span","title-container");this.titleElement=this.titleContainer.createChild("span","title");this.subtitleElement=this._titlesElement.createChild("span","subtitle");this.className=className;this.mainTitle=title;this.subtitle=subtitle;}
WebInspector.SidebarTreeElement.prototype={get small()
{return this._small;},set small(x)
{this._small=x;if(this.listItemElement)
this.listItemElement.classList.toggle("small",this._small);},get mainTitle()
{return this._mainTitle;},set mainTitle(x)
{this._mainTitle=x;this.refreshTitles();},get subtitle()
{return this._subtitle;},set subtitle(x)
{this._subtitle=x;this.refreshTitles();},set wait(x)
{this.listItemElement.classList.toggle("wait",x);},refreshTitles:function()
{var mainTitle=this.mainTitle;if(this.titleElement.textContent!==mainTitle)
this.titleElement.textContent=mainTitle;var subtitle=this.subtitle;if(subtitle){if(this.subtitleElement.textContent!==subtitle)
this.subtitleElement.textContent=subtitle;this._titlesElement.classList.remove("no-subtitle");}else{this.subtitleElement.textContent="";this._titlesElement.classList.add("no-subtitle");}},isEventWithinDisclosureTriangle:function(event)
{return event.target===this.disclosureButton;},onattach:function()
{this.listItemElement.classList.add("sidebar-tree-item");if(this.className)
this.listItemElement.classList.add(this.className);if(this.small)
this.listItemElement.classList.add("small");if(this.isExpandable()&&this.disclosureButton)
this.listItemElement.appendChild(this.disclosureButton);this.listItemElement.appendChildren(this.iconElement,this.statusElement,this._titlesElement);},__proto__:TreeElement.prototype};WebInspector.SoftContextMenu=function(items,itemSelectedCallback,parentMenu)
{this._items=items;this._itemSelectedCallback=itemSelectedCallback;this._parentMenu=parentMenu;}
WebInspector.SoftContextMenu.prototype={show:function(document,x,y)
{if(!this._items.length)
return;this._document=document;this._x=x;this._y=y;this._time=new Date().getTime();this.element=createElementWithClass("div","soft-context-menu");var root=WebInspector.createShadowRootWithCoreStyles(this.element,"ui/softContextMenu.css");this._contextMenuElement=root.createChild("div");this.element.style.top=y+"px";var subMenuOverlap=3;this.element.style.left=(this._parentMenu?x-subMenuOverlap:x)+"px";this._contextMenuElement.tabIndex=0;this._contextMenuElement.addEventListener("mouseup",consumeEvent,false);this._contextMenuElement.addEventListener("keydown",this._menuKeyDown.bind(this),false);for(var i=0;i<this._items.length;++i)
this._contextMenuElement.appendChild(this._createMenuItem(this._items[i]));if(!this._parentMenu){this._glassPaneElement=createElementWithClass("div","soft-context-menu-glass-pane fill");this._glassPaneElement.tabIndex=0;this._glassPaneElement.addEventListener("mouseup",this._glassPaneMouseUp.bind(this),false);this._glassPaneElement.appendChild(this.element);document.body.appendChild(this._glassPaneElement);this._discardMenuOnResizeListener=this._discardMenu.bind(this,true);document.defaultView.addEventListener("resize",this._discardMenuOnResizeListener,false);}else{this._parentMenu._parentGlassPaneElement().appendChild(this.element);}
if(document.body.offsetWidth<this.element.offsetLeft+this.element.offsetWidth){this.element.style.left=Math.max(WebInspector.Dialog.modalHostView().element.totalOffsetLeft(),this._parentMenu?this._parentMenu.element.offsetLeft-this.element.offsetWidth+subMenuOverlap:document.body.offsetWidth-this.element.offsetWidth)+"px";}
if(this._parentMenu&&document.body.offsetHeight<this.element.offsetTop+this.element.offsetHeight){y=Math.max(WebInspector.Dialog.modalHostView().element.totalOffsetTop(),document.body.offsetHeight-this.element.offsetHeight);this.element.style.top=y+"px";}
var maxHeight=WebInspector.Dialog.modalHostView().element.offsetHeight;maxHeight-=y-WebInspector.Dialog.modalHostView().element.totalOffsetTop();this.element.style.maxHeight=maxHeight+"px";this._focus();},discard:function()
{this._discardMenu(true);},_parentGlassPaneElement:function()
{if(this._glassPaneElement)
return this._glassPaneElement;if(this._parentMenu)
return this._parentMenu._parentGlassPaneElement();return null;},_createMenuItem:function(item)
{if(item.type==="separator")
return this._createSeparator();if(item.type==="subMenu")
return this._createSubMenu(item);var menuItemElement=createElementWithClass("div","soft-context-menu-item");var checkMarkElement=menuItemElement.createChild("div","checkmark");if(!item.checked)
checkMarkElement.style.opacity="0";if(item.element){var wrapper=menuItemElement.createChild("div","soft-context-menu-custom-item");wrapper.appendChild(item.element);menuItemElement._isCustom=true;return menuItemElement;}
if(!item.enabled)
menuItemElement.classList.add("soft-context-menu-disabled");menuItemElement.createTextChild(item.label);menuItemElement.createChild("span","soft-context-menu-shortcut").textContent=item.shortcut;menuItemElement.addEventListener("mousedown",this._menuItemMouseDown.bind(this),false);menuItemElement.addEventListener("mouseup",this._menuItemMouseUp.bind(this),false);menuItemElement.addEventListener("mouseover",this._menuItemMouseOver.bind(this),false);menuItemElement.addEventListener("mouseleave",this._menuItemMouseLeave.bind(this),false);menuItemElement._actionId=item.id;return menuItemElement;},_createSubMenu:function(item)
{var menuItemElement=createElementWithClass("div","soft-context-menu-item");menuItemElement._subItems=item.subItems;var checkMarkElement=menuItemElement.createChild("span","soft-context-menu-item-checkmark checkmark");checkMarkElement.textContent="\u2713 ";checkMarkElement.style.opacity="0";menuItemElement.createTextChild(item.label);var subMenuArrowElement=menuItemElement.createChild("span","soft-context-menu-item-submenu-arrow");subMenuArrowElement.textContent="\u25B6";menuItemElement.addEventListener("mousedown",this._menuItemMouseDown.bind(this),false);menuItemElement.addEventListener("mouseup",this._menuItemMouseUp.bind(this),false);menuItemElement.addEventListener("mouseover",this._menuItemMouseOver.bind(this),false);menuItemElement.addEventListener("mouseleave",this._menuItemMouseLeave.bind(this),false);return menuItemElement;},_createSeparator:function()
{var separatorElement=createElementWithClass("div","soft-context-menu-separator");separatorElement._isSeparator=true;separatorElement.createChild("div","separator-line");return separatorElement;},_menuItemMouseDown:function(event)
{event.consume(true);},_menuItemMouseUp:function(event)
{this._triggerAction(event.target,event);event.consume();},_focus:function()
{this._contextMenuElement.focus();},_triggerAction:function(menuItemElement,event)
{if(!menuItemElement._subItems){this._discardMenu(true,event);if(typeof menuItemElement._actionId!=="undefined"){this._itemSelectedCallback(menuItemElement._actionId);delete menuItemElement._actionId;}
return;}
this._showSubMenu(menuItemElement);event.consume();},_showSubMenu:function(menuItemElement)
{if(menuItemElement._subMenuTimer){clearTimeout(menuItemElement._subMenuTimer);delete menuItemElement._subMenuTimer;}
if(this._subMenu)
return;this._subMenu=new WebInspector.SoftContextMenu(menuItemElement._subItems,this._itemSelectedCallback,this);var topPadding=4;this._subMenu.show(this._document,menuItemElement.totalOffsetLeft()+menuItemElement.offsetWidth,menuItemElement.totalOffsetTop()-1-topPadding);},_hideSubMenu:function()
{if(!this._subMenu)
return;this._subMenu._discardSubMenus();this._focus();},_menuItemMouseOver:function(event)
{this._highlightMenuItem(event.target,true);},_menuItemMouseLeave:function(event)
{if(!this._subMenu||!event.relatedTarget){this._highlightMenuItem(null,true);return;}
var relatedTarget=event.relatedTarget;if(relatedTarget.classList.contains("soft-context-menu-glass-pane"))
this._highlightMenuItem(null,true);},_highlightMenuItem:function(menuItemElement,scheduleSubMenu)
{if(this._highlightedMenuItemElement===menuItemElement)
return;this._hideSubMenu();if(this._highlightedMenuItemElement){this._highlightedMenuItemElement.classList.remove("soft-context-menu-item-mouse-over");if(this._highlightedMenuItemElement._subItems&&this._highlightedMenuItemElement._subMenuTimer){clearTimeout(this._highlightedMenuItemElement._subMenuTimer);delete this._highlightedMenuItemElement._subMenuTimer;}}
this._highlightedMenuItemElement=menuItemElement;if(this._highlightedMenuItemElement){this._highlightedMenuItemElement.classList.add("soft-context-menu-item-mouse-over");this._contextMenuElement.focus();if(scheduleSubMenu&&this._highlightedMenuItemElement._subItems&&!this._highlightedMenuItemElement._subMenuTimer)
this._highlightedMenuItemElement._subMenuTimer=setTimeout(this._showSubMenu.bind(this,this._highlightedMenuItemElement),150);}},_highlightPrevious:function()
{var menuItemElement=this._highlightedMenuItemElement?this._highlightedMenuItemElement.previousSibling:this._contextMenuElement.lastChild;while(menuItemElement&&(menuItemElement._isSeparator||menuItemElement._isCustom))
menuItemElement=menuItemElement.previousSibling;if(menuItemElement)
this._highlightMenuItem(menuItemElement,false);},_highlightNext:function()
{var menuItemElement=this._highlightedMenuItemElement?this._highlightedMenuItemElement.nextSibling:this._contextMenuElement.firstChild;while(menuItemElement&&(menuItemElement._isSeparator||menuItemElement._isCustom))
menuItemElement=menuItemElement.nextSibling;if(menuItemElement)
this._highlightMenuItem(menuItemElement,false);},_menuKeyDown:function(event)
{switch(event.keyIdentifier){case"Up":this._highlightPrevious();break;case"Down":this._highlightNext();break;case"Left":if(this._parentMenu){this._highlightMenuItem(null,false);this._parentMenu._hideSubMenu();}
break;case"Right":if(!this._highlightedMenuItemElement)
break;if(this._highlightedMenuItemElement._subItems){this._showSubMenu(this._highlightedMenuItemElement);this._subMenu._focus();this._subMenu._highlightNext();}
break;case"U+001B":this._discardMenu(false,event);break;case"Enter":if(!isEnterKey(event))
break;case"U+0020":if(this._highlightedMenuItemElement)
this._triggerAction(this._highlightedMenuItemElement,event);if(this._highlightedMenuItemElement._subItems){this._subMenu._focus();this._subMenu._highlightNext();}
break;}
event.consume(true);},_glassPaneMouseUp:function(event)
{if(new Date().getTime()-this._time<300)
return;if(event.target===this.element)
return;this._discardMenu(true,event);event.consume();},_discardMenu:function(closeParentMenus,event)
{if(this._subMenu&&!closeParentMenus)
return;if(this._glassPaneElement){var glassPane=this._glassPaneElement;delete this._glassPaneElement;this._document.body.removeChild(glassPane);if(this._parentMenu){delete this._parentMenu._subMenu;if(closeParentMenus)
this._parentMenu._discardMenu(closeParentMenus,event);else
this._parentMenu._focus();}
if(event)
event.consume(true);}else if(this._parentMenu&&this._contextMenuElement.parentElementOrShadowHost()){this._discardSubMenus();if(closeParentMenus)
this._parentMenu._discardMenu(closeParentMenus,event);else
this._parentMenu._focus();if(event)
event.consume(true);}
if(this._discardMenuOnResizeListener){this._document.defaultView.removeEventListener("resize",this._discardMenuOnResizeListener,false);delete this._discardMenuOnResizeListener;}},_discardSubMenus:function()
{if(this._subMenu)
this._subMenu._discardSubMenus();this.element.remove();if(this._parentMenu)
delete this._parentMenu._subMenu;}};WebInspector.SplitWidget=function(isVertical,secondIsSidebar,settingName,defaultSidebarWidth,defaultSidebarHeight,constraintsInDip)
{WebInspector.Widget.call(this,true);this.element.classList.add("split-widget");this.registerRequiredCSS("ui/splitWidget.css");this.contentElement.classList.add("shadow-split-widget");this._mainElement=this.contentElement.createChild("div","shadow-split-widget-contents shadow-split-widget-main vbox");this._mainElement.createChild("content").select=".insertion-point-main";this._sidebarElement=this.contentElement.createChild("div","shadow-split-widget-contents shadow-split-widget-sidebar vbox");this._sidebarElement.createChild("content").select=".insertion-point-sidebar";this._resizerElement=this.contentElement.createChild("div","shadow-split-widget-resizer");this._resizerWidget=new WebInspector.SimpleResizerWidget();this._resizerWidget.setEnabled(true);this._resizerWidget.addEventListener(WebInspector.ResizerWidget.Events.ResizeStart,this._onResizeStart,this);this._resizerWidget.addEventListener(WebInspector.ResizerWidget.Events.ResizeUpdate,this._onResizeUpdate,this);this._resizerWidget.addEventListener(WebInspector.ResizerWidget.Events.ResizeEnd,this._onResizeEnd,this);this._defaultSidebarWidth=defaultSidebarWidth||200;this._defaultSidebarHeight=defaultSidebarHeight||this._defaultSidebarWidth;this._constraintsInDip=!!constraintsInDip;this._setting=settingName?WebInspector.settings.createSetting(settingName,{}):null;this.setSecondIsSidebar(secondIsSidebar);this._innerSetVertical(isVertical);this._showMode=WebInspector.SplitWidget.ShowMode.Both;this.installResizer(this._resizerElement);}
WebInspector.SplitWidget.SettingForOrientation;WebInspector.SplitWidget.ShowMode={Both:"Both",OnlyMain:"OnlyMain",OnlySidebar:"OnlySidebar"}
WebInspector.SplitWidget.Events={SidebarSizeChanged:"SidebarSizeChanged",ShowModeChanged:"ShowModeChanged"}
WebInspector.SplitWidget.MinPadding=20;WebInspector.SplitWidget.prototype={isVertical:function()
{return this._isVertical;},setVertical:function(isVertical)
{if(this._isVertical===isVertical)
return;this._innerSetVertical(isVertical);if(this.isShowing())
this._updateLayout();},_innerSetVertical:function(isVertical)
{this.contentElement.classList.toggle("vbox",!isVertical);this.contentElement.classList.toggle("hbox",isVertical);this._isVertical=isVertical;delete this._resizerElementSize;this._sidebarSizeDIP=-1;this._restoreSidebarSizeFromSettings();if(this._shouldSaveShowMode)
this._restoreAndApplyShowModeFromSettings();this._updateShowHideSidebarButton();this._resizerWidget.setVertical(!isVertical);this.invalidateConstraints();},_updateLayout:function(animate)
{delete this._totalSizeCSS;delete this._totalSizeOtherDimensionCSS;this._mainElement.style.removeProperty("width");this._mainElement.style.removeProperty("height");this._sidebarElement.style.removeProperty("width");this._sidebarElement.style.removeProperty("height");this._innerSetSidebarSizeDIP(this._preferredSidebarSizeDIP(),!!animate);},setMainWidget:function(widget)
{if(this._mainWidget)
this._mainWidget.detach();this._mainWidget=widget;if(widget){widget.element.classList.add("insertion-point-main");widget.element.classList.remove("insertion-point-sidebar");if(this._showMode===WebInspector.SplitWidget.ShowMode.OnlyMain||this._showMode===WebInspector.SplitWidget.ShowMode.Both)
widget.show(this.element);}},setSidebarWidget:function(widget)
{if(this._sidebarWidget)
this._sidebarWidget.detach();this._sidebarWidget=widget;if(widget){widget.element.classList.add("insertion-point-sidebar");widget.element.classList.remove("insertion-point-main");if(this._showMode===WebInspector.SplitWidget.ShowMode.OnlySidebar||this._showMode===WebInspector.SplitWidget.ShowMode.Both)
widget.show(this.element);}},mainWidget:function()
{return this._mainWidget;},sidebarWidget:function()
{return this._sidebarWidget;},childWasDetached:function(widget)
{if(this._detaching)
return;if(this._mainWidget===widget)
delete this._mainWidget;if(this._sidebarWidget===widget)
delete this._sidebarWidget;},isSidebarSecond:function()
{return this._secondIsSidebar;},enableShowModeSaving:function()
{this._shouldSaveShowMode=true;this._restoreAndApplyShowModeFromSettings();},showMode:function()
{return this._showMode;},setSecondIsSidebar:function(secondIsSidebar)
{this.contentElement.classList.toggle("shadow-split-widget-first-is-sidebar",!secondIsSidebar);this._secondIsSidebar=secondIsSidebar;},sidebarSide:function()
{if(this._showMode!==WebInspector.SplitWidget.ShowMode.Both)
return null;return this._isVertical?(this._secondIsSidebar?"right":"left"):(this._secondIsSidebar?"bottom":"top");},resizerElement:function()
{return this._resizerElement;},hideMain:function(animate)
{this._showOnly(this._sidebarWidget,this._mainWidget,this._sidebarElement,this._mainElement,animate);this._updateShowMode(WebInspector.SplitWidget.ShowMode.OnlySidebar);},hideSidebar:function(animate)
{this._showOnly(this._mainWidget,this._sidebarWidget,this._mainElement,this._sidebarElement,animate);this._updateShowMode(WebInspector.SplitWidget.ShowMode.OnlyMain);},_showOnly:function(sideToShow,sideToHide,shadowToShow,shadowToHide,animate)
{this._cancelAnimation();function callback()
{if(sideToShow){if(sideToShow===this._mainWidget)
this._mainWidget.show(this.element,this._sidebarWidget?this._sidebarWidget.element:null);else
this._sidebarWidget.show(this.element);}
if(sideToHide){this._detaching=true;sideToHide.detach();delete this._detaching;}
this._resizerElement.classList.add("hidden");shadowToShow.classList.remove("hidden");shadowToShow.classList.add("maximized");shadowToHide.classList.add("hidden");shadowToHide.classList.remove("maximized");this._removeAllLayoutProperties();this.doResize();}
if(animate)
this._animate(true,callback.bind(this));else
callback.call(this);this._sidebarSizeDIP=-1;this.setResizable(false);},_removeAllLayoutProperties:function()
{this._sidebarElement.style.removeProperty("flexBasis");this._mainElement.style.removeProperty("width");this._mainElement.style.removeProperty("height");this._sidebarElement.style.removeProperty("width");this._sidebarElement.style.removeProperty("height");this._resizerElement.style.removeProperty("left");this._resizerElement.style.removeProperty("right");this._resizerElement.style.removeProperty("top");this._resizerElement.style.removeProperty("bottom");this._resizerElement.style.removeProperty("margin-left");this._resizerElement.style.removeProperty("margin-right");this._resizerElement.style.removeProperty("margin-top");this._resizerElement.style.removeProperty("margin-bottom");},showBoth:function(animate)
{if(this._showMode===WebInspector.SplitWidget.ShowMode.Both)
animate=false;this._cancelAnimation();this._mainElement.classList.remove("maximized","hidden");this._sidebarElement.classList.remove("maximized","hidden");this._resizerElement.classList.remove("hidden");if(this._sidebarWidget)
this._sidebarWidget.show(this.element);if(this._mainWidget)
this._mainWidget.show(this.element,this._sidebarWidget?this._sidebarWidget.element:null);this.setSecondIsSidebar(this._secondIsSidebar);this._sidebarSizeDIP=-1;this.setResizable(true);this._updateShowMode(WebInspector.SplitWidget.ShowMode.Both);this._updateLayout(animate);},setResizable:function(resizable)
{this._resizerWidget.setEnabled(resizable);},isResizable:function()
{return this._resizerWidget.isEnabled();},setSidebarSize:function(size)
{var sizeDIP=WebInspector.zoomManager.cssToDIP(size);this._savedSidebarSizeDIP=sizeDIP;this._saveSetting();this._innerSetSidebarSizeDIP(sizeDIP,false,true);},sidebarSize:function()
{var sizeDIP=Math.max(0,this._sidebarSizeDIP);return WebInspector.zoomManager.dipToCSS(sizeDIP);},_totalSizeDIP:function()
{if(!this._totalSizeCSS){this._totalSizeCSS=this._isVertical?this.contentElement.offsetWidth:this.contentElement.offsetHeight;this._totalSizeOtherDimensionCSS=this._isVertical?this.contentElement.offsetHeight:this.contentElement.offsetWidth;}
return WebInspector.zoomManager.cssToDIP(this._totalSizeCSS);},_updateShowMode:function(showMode)
{this._showMode=showMode;this._saveShowModeToSettings();this._updateShowHideSidebarButton();this.dispatchEventToListeners(WebInspector.SplitWidget.Events.ShowModeChanged,showMode);this.invalidateConstraints();},_innerSetSidebarSizeDIP:function(sizeDIP,animate,userAction)
{if(this._showMode!==WebInspector.SplitWidget.ShowMode.Both||!this.isShowing())
return;sizeDIP=this._applyConstraints(sizeDIP,userAction);if(this._sidebarSizeDIP===sizeDIP)
return;if(!this._resizerElementSize)
this._resizerElementSize=this._isVertical?this._resizerElement.offsetWidth:this._resizerElement.offsetHeight;this._removeAllLayoutProperties();var sidebarSizeValue=WebInspector.zoomManager.dipToCSS(sizeDIP)+"px";var mainSizeValue=(this._totalSizeCSS-WebInspector.zoomManager.dipToCSS(sizeDIP))+"px";this._sidebarElement.style.flexBasis=sidebarSizeValue;if(this._isVertical){this._sidebarElement.style.width=sidebarSizeValue;this._mainElement.style.width=mainSizeValue;this._sidebarElement.style.height=this._totalSizeOtherDimensionCSS+"px";this._mainElement.style.height=this._totalSizeOtherDimensionCSS+"px";}else{this._sidebarElement.style.height=sidebarSizeValue;this._mainElement.style.height=mainSizeValue;this._sidebarElement.style.width=this._totalSizeOtherDimensionCSS+"px";this._mainElement.style.width=this._totalSizeOtherDimensionCSS+"px";}
if(this._isVertical){if(this._secondIsSidebar){this._resizerElement.style.right=sidebarSizeValue;this._resizerElement.style.marginRight=-this._resizerElementSize/2+"px";}else{this._resizerElement.style.left=sidebarSizeValue;this._resizerElement.style.marginLeft=-this._resizerElementSize/2+"px";}}else{if(this._secondIsSidebar){this._resizerElement.style.bottom=sidebarSizeValue;this._resizerElement.style.marginBottom=-this._resizerElementSize/2+"px";}else{this._resizerElement.style.top=sidebarSizeValue;this._resizerElement.style.marginTop=-this._resizerElementSize/2+"px";}}
this._sidebarSizeDIP=sizeDIP;if(animate){this._animate(false);}else{this.doResize();this.dispatchEventToListeners(WebInspector.SplitWidget.Events.SidebarSizeChanged,this.sidebarSize());}},_animate:function(reverse,callback)
{var animationTime=50;this._animationCallback=callback;var animatedMarginPropertyName;if(this._isVertical)
animatedMarginPropertyName=this._secondIsSidebar?"margin-right":"margin-left";else
animatedMarginPropertyName=this._secondIsSidebar?"margin-bottom":"margin-top";var marginFrom=reverse?"0":"-"+WebInspector.zoomManager.dipToCSS(this._sidebarSizeDIP)+"px";var marginTo=reverse?"-"+WebInspector.zoomManager.dipToCSS(this._sidebarSizeDIP)+"px":"0";this.contentElement.style.setProperty(animatedMarginPropertyName,marginFrom);if(!reverse){suppressUnused(this._mainElement.offsetWidth);suppressUnused(this._sidebarElement.offsetWidth);}
if(!reverse)
this._sidebarWidget.doResize();this.contentElement.style.setProperty("transition",animatedMarginPropertyName+" "+animationTime+"ms linear");var boundAnimationFrame;var startTime;function animationFrame()
{delete this._animationFrameHandle;if(!startTime){this.contentElement.style.setProperty(animatedMarginPropertyName,marginTo);startTime=window.performance.now();}else if(window.performance.now()<startTime+animationTime){if(this._mainWidget)
this._mainWidget.doResize();}else{this._cancelAnimation();if(this._mainWidget)
this._mainWidget.doResize();this.dispatchEventToListeners(WebInspector.SplitWidget.Events.SidebarSizeChanged,this.sidebarSize());return;}
this._animationFrameHandle=this.contentElement.window().requestAnimationFrame(boundAnimationFrame);}
boundAnimationFrame=animationFrame.bind(this);this._animationFrameHandle=this.contentElement.window().requestAnimationFrame(boundAnimationFrame);},_cancelAnimation:function()
{this.contentElement.style.removeProperty("margin-top");this.contentElement.style.removeProperty("margin-right");this.contentElement.style.removeProperty("margin-bottom");this.contentElement.style.removeProperty("margin-left");this.contentElement.style.removeProperty("transition");if(this._animationFrameHandle){this.contentElement.window().cancelAnimationFrame(this._animationFrameHandle);delete this._animationFrameHandle;}
if(this._animationCallback){this._animationCallback();delete this._animationCallback;}},_applyConstraints:function(sidebarSize,userAction)
{var totalSize=this._totalSizeDIP();var zoomFactor=this._constraintsInDip?1:WebInspector.zoomManager.zoomFactor();var constraints=this._sidebarWidget?this._sidebarWidget.constraints():new Constraints();var minSidebarSize=this.isVertical()?constraints.minimum.width:constraints.minimum.height;if(!minSidebarSize)
minSidebarSize=WebInspector.SplitWidget.MinPadding;minSidebarSize*=zoomFactor;var preferredSidebarSize=this.isVertical()?constraints.preferred.width:constraints.preferred.height;if(!preferredSidebarSize)
preferredSidebarSize=WebInspector.SplitWidget.MinPadding;preferredSidebarSize*=zoomFactor;if(sidebarSize<preferredSidebarSize)
preferredSidebarSize=Math.max(sidebarSize,minSidebarSize);preferredSidebarSize+=zoomFactor;constraints=this._mainWidget?this._mainWidget.constraints():new Constraints();var minMainSize=this.isVertical()?constraints.minimum.width:constraints.minimum.height;if(!minMainSize)
minMainSize=WebInspector.SplitWidget.MinPadding;minMainSize*=zoomFactor;var preferredMainSize=this.isVertical()?constraints.preferred.width:constraints.preferred.height;if(!preferredMainSize)
preferredMainSize=WebInspector.SplitWidget.MinPadding;preferredMainSize*=zoomFactor;var savedMainSize=this.isVertical()?this._savedVerticalMainSize:this._savedHorizontalMainSize;if(typeof savedMainSize!=="undefined")
preferredMainSize=Math.min(preferredMainSize,savedMainSize*zoomFactor);if(userAction)
preferredMainSize=minMainSize;var totalPreferred=preferredMainSize+preferredSidebarSize;if(totalPreferred<=totalSize)
return Number.constrain(sidebarSize,preferredSidebarSize,totalSize-preferredMainSize);if(minMainSize+minSidebarSize<=totalSize){var delta=totalPreferred-totalSize;var sidebarDelta=delta*preferredSidebarSize/totalPreferred;sidebarSize=preferredSidebarSize-sidebarDelta;return Number.constrain(sidebarSize,minSidebarSize,totalSize-minMainSize);}
return Math.max(0,totalSize-minMainSize);},wasShown:function()
{this._forceUpdateLayout();WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged,this._onZoomChanged,this);},willHide:function()
{WebInspector.zoomManager.removeEventListener(WebInspector.ZoomManager.Events.ZoomChanged,this._onZoomChanged,this);},onResize:function()
{this._updateLayout();},onLayout:function()
{this._updateLayout();},calculateConstraints:function()
{if(this._showMode===WebInspector.SplitWidget.ShowMode.OnlyMain)
return this._mainWidget?this._mainWidget.constraints():new Constraints();if(this._showMode===WebInspector.SplitWidget.ShowMode.OnlySidebar)
return this._sidebarWidget?this._sidebarWidget.constraints():new Constraints();var mainConstraints=this._mainWidget?this._mainWidget.constraints():new Constraints();var sidebarConstraints=this._sidebarWidget?this._sidebarWidget.constraints():new Constraints();var min=WebInspector.SplitWidget.MinPadding;if(this._isVertical){mainConstraints=mainConstraints.widthToMax(min).addWidth(1);sidebarConstraints=sidebarConstraints.widthToMax(min);return mainConstraints.addWidth(sidebarConstraints).heightToMax(sidebarConstraints);}else{mainConstraints=mainConstraints.heightToMax(min).addHeight(1);sidebarConstraints=sidebarConstraints.heightToMax(min);return mainConstraints.widthToMax(sidebarConstraints).addHeight(sidebarConstraints);}},_onResizeStart:function(event)
{this._resizeStartSizeDIP=this._sidebarSizeDIP;},_onResizeUpdate:function(event)
{var offset=event.data.currentPosition-event.data.startPosition;var offsetDIP=WebInspector.zoomManager.cssToDIP(offset);var newSizeDIP=this._secondIsSidebar?this._resizeStartSizeDIP-offsetDIP:this._resizeStartSizeDIP+offsetDIP;var constrainedSizeDIP=this._applyConstraints(newSizeDIP,true);this._savedSidebarSizeDIP=constrainedSizeDIP;this._saveSetting();this._innerSetSidebarSizeDIP(constrainedSizeDIP,false,true);if(this.isVertical())
this._savedVerticalMainSize=this._totalSizeDIP()-this._sidebarSizeDIP;else
this._savedHorizontalMainSize=this._totalSizeDIP()-this._sidebarSizeDIP;},_onResizeEnd:function(event)
{delete this._resizeStartSizeDIP;},hideDefaultResizer:function()
{this.uninstallResizer(this._resizerElement);},installResizer:function(resizerElement)
{this._resizerWidget.addElement(resizerElement);},uninstallResizer:function(resizerElement)
{this._resizerWidget.removeElement(resizerElement);},hasCustomResizer:function()
{var elements=this._resizerWidget.elements();return elements.length>1||(elements.length==1&&elements[0]!==this._resizerElement);},toggleResizer:function(resizer,on)
{if(on)
this.installResizer(resizer);else
this.uninstallResizer(resizer);},_settingForOrientation:function()
{var state=this._setting?this._setting.get():{};return this._isVertical?state.vertical:state.horizontal;},_preferredSidebarSizeDIP:function()
{var size=this._savedSidebarSizeDIP;if(!size){size=this._isVertical?this._defaultSidebarWidth:this._defaultSidebarHeight;if(0<size&&size<1)
size*=this._totalSizeDIP();}
return size;},_restoreSidebarSizeFromSettings:function()
{var settingForOrientation=this._settingForOrientation();this._savedSidebarSizeDIP=settingForOrientation?settingForOrientation.size:0;},_restoreAndApplyShowModeFromSettings:function()
{var orientationState=this._settingForOrientation();this._savedShowMode=orientationState&&orientationState.showMode?orientationState.showMode:this._showMode;this._showMode=this._savedShowMode;switch(this._savedShowMode){case WebInspector.SplitWidget.ShowMode.Both:this.showBoth();break;case WebInspector.SplitWidget.ShowMode.OnlyMain:this.hideSidebar();break;case WebInspector.SplitWidget.ShowMode.OnlySidebar:this.hideMain();break;}},_saveShowModeToSettings:function()
{this._savedShowMode=this._showMode;this._saveSetting();},_saveSetting:function()
{if(!this._setting)
return;var state=this._setting.get();var orientationState=(this._isVertical?state.vertical:state.horizontal)||{};orientationState.size=this._savedSidebarSizeDIP;if(this._shouldSaveShowMode)
orientationState.showMode=this._savedShowMode;if(this._isVertical)
state.vertical=orientationState;else
state.horizontal=orientationState;this._setting.set(state);},_forceUpdateLayout:function()
{this._sidebarSizeDIP=-1;this._updateLayout();},_onZoomChanged:function(event)
{this._forceUpdateLayout();},displayShowHideSidebarButton:function(title,className)
{console.assert(this.isVertical(),"Buttons for split widget with horizontal split are not supported yet.");this._showHideSidebarButtonTitle=WebInspector.UIString(title);this._showHideSidebarButton=this._mainElement.createChild("button","sidebar-show-hide-button "+(className||""));this._showHideSidebarButton.addEventListener("click",buttonClicked.bind(this),false);this._updateShowHideSidebarButton();function buttonClicked(event)
{if(this._showMode!==WebInspector.SplitWidget.ShowMode.Both)
this.showBoth(true);else
this.hideSidebar(true);}
return this._showHideSidebarButton;},_updateShowHideSidebarButton:function()
{if(!this._showHideSidebarButton)
return;var sidebarHidden=this._showMode===WebInspector.SplitWidget.ShowMode.OnlyMain;this._showHideSidebarButton.classList.toggle("toggled-show",sidebarHidden);this._showHideSidebarButton.classList.toggle("toggled-hide",!sidebarHidden);this._showHideSidebarButton.classList.toggle("top-sidebar-show-hide-button",!this.isVertical()&&!this.isSidebarSecond());this._showHideSidebarButton.classList.toggle("right-sidebar-show-hide-button",this.isVertical()&&this.isSidebarSecond());this._showHideSidebarButton.classList.toggle("bottom-sidebar-show-hide-button",!this.isVertical()&&this.isSidebarSecond());this._showHideSidebarButton.classList.toggle("left-sidebar-show-hide-button",this.isVertical()&&!this.isSidebarSecond());this._showHideSidebarButton.title=sidebarHidden?WebInspector.UIString("Show %s",this._showHideSidebarButtonTitle):WebInspector.UIString("Hide %s",this._showHideSidebarButtonTitle);},__proto__:WebInspector.Widget.prototype};WebInspector.StackView=function(isVertical)
{WebInspector.VBox.call(this);this._isVertical=isVertical;this._currentSplitWidget=null;}
WebInspector.StackView.prototype={appendView:function(view,sidebarSizeSettingName,defaultSidebarWidth,defaultSidebarHeight)
{var splitWidget=new WebInspector.SplitWidget(this._isVertical,true,sidebarSizeSettingName,defaultSidebarWidth,defaultSidebarHeight);splitWidget.setMainWidget(view);splitWidget.hideSidebar();if(!this._currentSplitWidget){splitWidget.show(this.element);}else{this._currentSplitWidget.setSidebarWidget(splitWidget);this._currentSplitWidget.showBoth();}
this._currentSplitWidget=splitWidget;return splitWidget;},detachChildWidgets:function()
{WebInspector.Widget.prototype.detachChildWidgets.call(this);this._currentSplitWidget=null;},__proto__:WebInspector.VBox.prototype};WebInspector.Toolbar=function(className,parentElement)
{this._items=[];this._reverse=false;this.element=parentElement?parentElement.createChild("div"):createElement("div");this.element.className=className;this.element.classList.add("toolbar");this._shadowRoot=WebInspector.createShadowRootWithCoreStyles(this.element,"ui/toolbar.css");this._contentElement=this._shadowRoot.createChild("div","toolbar-shadow");this._insertionPoint=this._contentElement.createChild("content");}
WebInspector.Toolbar.prototype={makeWrappable:function(reverse)
{this._contentElement.classList.add("wrappable");this._reverse=!!reverse;if(reverse)
this._contentElement.classList.add("wrappable-reverse");},makeVertical:function()
{this._contentElement.classList.add("vertical");},makeBlueOnHover:function()
{this._contentElement.classList.add("toolbar-blue-on-hover");},makeToggledGray:function()
{this._contentElement.classList.add("toolbar-toggled-gray");},setEnabled:function(enabled)
{for(var item of this._items)
item.setEnabled(enabled);},appendToolbarItem:function(item)
{this._items.push(item);item._toolbar=this;if(this._reverse)
this._contentElement.insertBefore(item.element,this._insertionPoint.nextSibling);else
this._contentElement.insertBefore(item.element,this._insertionPoint);this._hideSeparatorDupes();},appendSeparator:function()
{this.appendToolbarItem(new WebInspector.ToolbarSeparator());},appendText:function(text)
{this.appendToolbarItem(new WebInspector.ToolbarLabel(text));},removeToolbarItems:function()
{for(var item of this._items)
delete item._toolbar;this._items=[];this._contentElement.removeChildren();this._insertionPoint=this._contentElement.createChild("content");},setColor:function(color)
{var style=createElement("style");style.textContent=".toolbar-glyph { background-color: "+color+" !important }";this._shadowRoot.appendChild(style);},setToggledColor:function(color)
{var style=createElement("style");style.textContent=".toolbar-button.toolbar-state-on .toolbar-glyph { background-color: "+color+" !important }";this._shadowRoot.appendChild(style);},_hideSeparatorDupes:function()
{if(!this._items.length)
return;var previousIsSeparator=false;var lastSeparator;var nonSeparatorVisible=false;for(var i=0;i<this._items.length;++i){if(this._items[i]instanceof WebInspector.ToolbarSeparator){this._items[i].setVisible(!previousIsSeparator);previousIsSeparator=true;lastSeparator=this._items[i];continue;}
if(this._items[i].visible()){previousIsSeparator=false;lastSeparator=null;nonSeparatorVisible=true;}}
if(lastSeparator&&lastSeparator!==this._items.peekLast())
lastSeparator.setVisible(false);this.element.classList.toggle("hidden",lastSeparator&&lastSeparator.visible()&&!nonSeparatorVisible);}}
WebInspector.ToolbarItem=function(element)
{this.element=element;this.element.classList.add("toolbar-item");this._visible=true;this._enabled=true;this.element.addEventListener("mouseenter",this._mouseEnter.bind(this),false);this.element.addEventListener("mouseleave",this._mouseLeave.bind(this),false);}
WebInspector.ToolbarItem.prototype={_mouseEnter:function()
{this.element.classList.add("hover");},_mouseLeave:function()
{this.element.classList.remove("hover");},setEnabled:function(value)
{if(this._enabled===value)
return;this._enabled=value;this._applyEnabledState();},_applyEnabledState:function()
{this.element.disabled=!this._enabled;},visible:function()
{return this._visible;},setVisible:function(x)
{if(this._visible===x)
return;this.element.classList.toggle("hidden",!x);this._visible=x;if(this._toolbar&&!(this instanceof WebInspector.ToolbarSeparator))
this._toolbar._hideSeparatorDupes();},__proto__:WebInspector.Object.prototype}
WebInspector.ToolbarLabel=function(text,glyph)
{WebInspector.ToolbarItem.call(this,createElementWithClass("button","toolbar-text-glyph"));this._glyphElement=this.element.createChild("div","toolbar-glyph hidden");this._textElement=this.element.createChild("div","toolbar-text hidden");this.setText(text||"");if(glyph)
this.setGlyph(glyph);this._state="";this._title="";}
WebInspector.ToolbarLabel.prototype={setText:function(text)
{if(this._text===text)
return;this._textElement.textContent=text;this._textElement.classList.toggle("hidden",!text);this._text=text;},setGlyph:function(glyph)
{if(this._glyph===glyph)
return;if(this._glyph)
this._glyphElement.classList.remove(this._glyph);if(glyph)
this._glyphElement.classList.add(glyph);this._glyphElement.classList.toggle("hidden",!glyph);this.element.classList.toggle("toolbar-has-glyph",!!glyph);this._glyph=glyph;},setBackgroundImage:function(iconURL)
{this.element.style.backgroundImage="url("+iconURL+")";},state:function()
{return this._state;},setState:function(state)
{if(this._state===state)
return;this.element.classList.remove("toolbar-state-"+this._state);this.element.classList.add("toolbar-state-"+state);this._state=state;},setTitle:function(title)
{if(this._title===title)
return;this._title=title;WebInspector.Tooltip.install(this.element,title);},setBold:function(bold)
{this.element.classList.toggle("toolbar-bold",bold);},setDimmed:function(dimmed)
{this.element.classList.toggle("toolbar-dimmed",dimmed);},addDropDownArrow:function()
{this.element.classList.add("toolbar-has-dropdown");this.element.createChild("div","toolbar-dropdown-arrow");},__proto__:WebInspector.ToolbarItem.prototype}
WebInspector.ToolbarButton=function(title,glyph)
{WebInspector.ToolbarLabel.call(this);this.element.classList.add("toolbar-button");this.element.addEventListener("click",this._clicked.bind(this),false);this.element.addEventListener("mousedown",this._mouseDown.bind(this),false);this.element.addEventListener("mouseup",this._mouseUp.bind(this),false);this.setBold(true);this.setTitle(title);this.setGlyph(glyph);}
WebInspector.ToolbarButton.prototype={_clicked:function(event)
{var defaultPrevented=this.dispatchEventToListeners("click",event);event.consume(defaultPrevented);},_mouseDown:function(event)
{this.dispatchEventToListeners("mousedown",event);},_mouseUp:function(event)
{this.dispatchEventToListeners("mouseup",event);},__proto__:WebInspector.ToolbarLabel.prototype}
WebInspector.ToolbarInput=function(placeholder,growFactor)
{WebInspector.ToolbarItem.call(this,createElementWithClass("input","toolbar-item"));this.element.addEventListener("input",this._onChangeCallback.bind(this),false);if(growFactor)
this.element.style.flexGrow=growFactor;if(placeholder)
this.element.setAttribute("placeholder",placeholder);this._value="";}
WebInspector.ToolbarInput.Event={TextChanged:"TextChanged"};WebInspector.ToolbarInput.prototype={setValue:function(value)
{this._value=value;this.element.value=value;},value:function()
{return this.element.value;},_onChangeCallback:function()
{this.dispatchEventToListeners(WebInspector.ToolbarInput.Event.TextChanged,this.element.value);},__proto__:WebInspector.ToolbarItem.prototype}
WebInspector.ToolbarToggle=function(title,glyph)
{WebInspector.ToolbarButton.call(this,title,glyph);this._toggled=false;this.setState("off");}
WebInspector.ToolbarToggle.prototype={toggled:function()
{return this._toggled;},setToggled:function(toggled)
{if(this._toggled===toggled)
return;this._toggled=toggled;this.setState(toggled?"on":"off");},__proto__:WebInspector.ToolbarButton.prototype}
WebInspector.Toolbar.createActionButton=function(action,toggledOptions,untoggledOptions)
{var button=new WebInspector.ToolbarButton(action.title(),action.icon());button.addEventListener("click",action.execute,action);action.addEventListener(WebInspector.Action.Events.Enabled,enabledChanged);action.addEventListener(WebInspector.Action.Events.StateChanged,stateChanged);action.addEventListener(WebInspector.Action.Events.TitleChanged,titleChanged);var longClickController=null;var longClickButtons=null;var longClickGlyph=null;titleChanged();stateChanged();return button;function titleChanged()
{WebInspector.Tooltip.install(button.element,action.title(),action.id());}
function enabledChanged(event)
{button.setEnabled((event.data));}
function stateChanged()
{button.setState(action.state());updateOptions();}
function updateOptions()
{if(action.statesCount()!==2)
return;var buttons=action.toggled()?(toggledOptions||null):(untoggledOptions||null);if(buttons&&buttons.length){if(!longClickController){longClickController=new WebInspector.LongClickController(button.element,showOptions);longClickGlyph=button.element.createChild("div","long-click-glyph toolbar-button-theme");longClickButtons=buttons;}}else{if(longClickController){longClickController.dispose();longClickController=null;longClickGlyph.remove();longClickGlyph=null;longClickButtons=null;}}}
function showOptions()
{var buttons=longClickButtons.slice();var mainButtonClone=new WebInspector.ToolbarButton(action.title(),action.icon());mainButtonClone.addEventListener("click",clicked);function clicked(event)
{button._clicked((event.data));}
mainButtonClone.setState(action.state());buttons.push(mainButtonClone);var document=button.element.ownerDocument;document.documentElement.addEventListener("mouseup",mouseUp,false);var optionsGlassPane=new WebInspector.GlassPane(document);var optionsBar=new WebInspector.Toolbar("fill",optionsGlassPane.element);optionsBar._contentElement.classList.add("floating");const buttonHeight=26;var hostButtonPosition=button.element.totalOffset();var topNotBottom=hostButtonPosition.top+buttonHeight*buttons.length<document.documentElement.offsetHeight;if(topNotBottom)
buttons=buttons.reverse();optionsBar.element.style.height=(buttonHeight*buttons.length)+"px";if(topNotBottom)
optionsBar.element.style.top=(hostButtonPosition.top+1)+"px";else
optionsBar.element.style.top=(hostButtonPosition.top-(buttonHeight*(buttons.length-1)))+"px";optionsBar.element.style.left=(hostButtonPosition.left+1)+"px";for(var i=0;i<buttons.length;++i){buttons[i].element.addEventListener("mousemove",mouseOver,false);buttons[i].element.addEventListener("mouseout",mouseOut,false);optionsBar.appendToolbarItem(buttons[i]);}
var hostButtonIndex=topNotBottom?0:buttons.length-1;buttons[hostButtonIndex].element.classList.add("emulate-active");function mouseOver(e)
{if(e.which!==1)
return;var buttonElement=e.target.enclosingNodeOrSelfWithClass("toolbar-item");buttonElement.classList.add("emulate-active");}
function mouseOut(e)
{if(e.which!==1)
return;var buttonElement=e.target.enclosingNodeOrSelfWithClass("toolbar-item");buttonElement.classList.remove("emulate-active");}
function mouseUp(e)
{if(e.which!==1)
return;optionsGlassPane.dispose();document.documentElement.removeEventListener("mouseup",mouseUp,false);for(var i=0;i<buttons.length;++i){if(buttons[i].element.classList.contains("emulate-active")){buttons[i].element.classList.remove("emulate-active");buttons[i]._clicked(e);break;}}}}}
WebInspector.ToolbarMenuButton=function(contextMenuHandler,useSoftMenu)
{WebInspector.ToolbarButton.call(this,"","menu-toolbar-item");this._contextMenuHandler=contextMenuHandler;this._useSoftMenu=!!useSoftMenu;}
WebInspector.ToolbarMenuButton.prototype={_clicked:function(event)
{var contextMenu=new WebInspector.ContextMenu(event,this._useSoftMenu,this.element.totalOffsetLeft(),this.element.totalOffsetTop()+this.element.offsetHeight);this._contextMenuHandler(contextMenu);contextMenu.show();},__proto__:WebInspector.ToolbarButton.prototype}
WebInspector.ToolbarSettingToggle=function(setting,glyph,title,toggledTitle)
{WebInspector.ToolbarToggle.call(this,title,glyph);this._defaultTitle=title;this._toggledTitle=toggledTitle||title;this._setting=setting;this._settingChanged();this._setting.addChangeListener(this._settingChanged,this);}
WebInspector.ToolbarSettingToggle.prototype={_settingChanged:function()
{var toggled=this._setting.get();this.setToggled(toggled);this.setTitle(toggled?this._toggledTitle:this._defaultTitle);},_clicked:function(event)
{this._setting.set(!this.toggled());WebInspector.ToolbarToggle.prototype._clicked.call(this,event);},__proto__:WebInspector.ToolbarToggle.prototype}
WebInspector.ToolbarSeparator=function()
{WebInspector.ToolbarItem.call(this,createElementWithClass("div","toolbar-divider"));}
WebInspector.ToolbarSeparator.prototype={__proto__:WebInspector.ToolbarItem.prototype}
WebInspector.ToolbarItem.Provider=function()
{}
WebInspector.ToolbarItem.Provider.prototype={item:function(){}}
WebInspector.ToolbarComboBox=function(changeHandler,className)
{WebInspector.ToolbarItem.call(this,createElementWithClass("span","toolbar-select-container"));this._selectElement=this.element.createChild("select","toolbar-item");this.element.createChild("div","toolbar-dropdown-arrow");if(changeHandler)
this._selectElement.addEventListener("change",changeHandler,false);if(className)
this._selectElement.classList.add(className);}
WebInspector.ToolbarComboBox.prototype={selectElement:function()
{return(this._selectElement);},size:function()
{return this._selectElement.childElementCount;},options:function()
{return Array.prototype.slice.call(this._selectElement.children,0);},addOption:function(option)
{this._selectElement.appendChild(option);},createOption:function(label,title,value)
{var option=this._selectElement.createChild("option");option.text=label;if(title)
option.title=title;if(typeof value!=="undefined")
option.value=value;return option;},_applyEnabledState:function()
{this._selectElement.disabled=!this._enabled;},removeOption:function(option)
{this._selectElement.removeChild(option);},removeOptions:function()
{this._selectElement.removeChildren();},selectedOption:function()
{if(this._selectElement.selectedIndex>=0)
return this._selectElement[this._selectElement.selectedIndex];return null;},select:function(option)
{this._selectElement.selectedIndex=Array.prototype.indexOf.call((this._selectElement),option);},setSelectedIndex:function(index)
{this._selectElement.selectedIndex=index;},selectedIndex:function()
{return this._selectElement.selectedIndex;},setMaxWidth:function(width)
{this._selectElement.style.maxWidth=width+"px";},__proto__:WebInspector.ToolbarItem.prototype}
WebInspector.ToolbarCheckbox=function(text,title,setting)
{WebInspector.ToolbarItem.call(this,createCheckboxLabel(text));this.element.classList.add("checkbox");this.inputElement=this.element.checkboxElement;if(title)
this.element.title=title;if(setting)
WebInspector.SettingsUI.bindCheckbox(this.inputElement,setting);}
WebInspector.ToolbarCheckbox.prototype={checked:function()
{return this.inputElement.checked;},__proto__:WebInspector.ToolbarItem.prototype}
WebInspector.ExtensibleToolbar=function(location,parentElement)
{WebInspector.Toolbar.call(this,"",parentElement);this._loadItems(location);}
WebInspector.ExtensibleToolbar.prototype={_loadItems:function(location)
{var extensions=self.runtime.extensions(WebInspector.ToolbarItem.Provider);var promises=[];for(var i=0;i<extensions.length;++i){if(extensions[i].descriptor()["location"]===location)
promises.push(resolveItem(extensions[i]));}
Promise.all(promises).then(appendItemsInOrder.bind(this));function resolveItem(extension)
{var descriptor=extension.descriptor();if(descriptor["separator"])
return Promise.resolve((new WebInspector.ToolbarSeparator()));if(descriptor["actionId"])
return Promise.resolve((WebInspector.Toolbar.createActionButton(WebInspector.actionRegistry.action(descriptor["actionId"]))));return extension.instancePromise().then(fetchItemFromProvider);function fetchItemFromProvider(provider)
{return(provider).item();}}
function appendItemsInOrder(items)
{for(var i=0;i<items.length;++i){var item=items[i];if(item)
this.appendToolbarItem(item);}}},__proto__:WebInspector.Toolbar.prototype};WebInspector.Tooltip=function(doc)
{this.element=doc.body.createChild("div");this._shadowRoot=WebInspector.createShadowRootWithCoreStyles(this.element,"ui/tooltip.css");this._tooltipElement=this._shadowRoot.createChild("div","tooltip");doc.addEventListener("mousemove",this._mouseMove.bind(this),true);doc.addEventListener("mousedown",this._hide.bind(this,true),true);doc.addEventListener("mouseleave",this._hide.bind(this,false),true);doc.addEventListener("keydown",this._hide.bind(this,true),true);WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged,this._reset,this);doc.defaultView.addEventListener("resize",this._reset.bind(this),false);}
WebInspector.Tooltip.Timing={"InstantThreshold":300,"OpeningDelay":600}
WebInspector.Tooltip.prototype={_mouseMove:function(event)
{var path=event.deepPath?event.deepPath:event.path;if(!path||event.buttons!==0)
return;if(this._anchorElement&&path.indexOf(this._anchorElement)===-1)
this._hide(false);for(var element of path){if(element===this._anchorElement){return;}else if(element[WebInspector.Tooltip._symbol]){this._show(element,event);return;}}},_show:function(anchorElement,event)
{var tooltip=anchorElement[WebInspector.Tooltip._symbol];this._anchorElement=anchorElement;this._tooltipElement.removeChildren();for(var element of WebInspector.Tooltip._nativeOverrideContainer){if(this._anchorElement.isSelfOrDescendant(element)){Object.defineProperty(this._anchorElement,"title",WebInspector.Tooltip._nativeTitle);this._anchorElement.title=tooltip.content;return;}}
if(typeof tooltip.content==="string")
this._tooltipElement.textContent=tooltip.content;else
this._tooltipElement.appendChild(tooltip.content);if(tooltip.actionId){var shortcuts=WebInspector.shortcutRegistry.shortcutDescriptorsForAction(tooltip.actionId);for(var shortcut of shortcuts){var shortcutElement=this._tooltipElement.createChild("div","tooltip-shortcut");shortcutElement.textContent=shortcut.name;}}
this._tooltipElement.classList.add("shown");this._tooltipElement.positionAt(0,0);var now=Date.now();var instant=(this._tooltipLastClosed&&now-this._tooltipLastClosed<WebInspector.Tooltip.Timing.InstantThreshold);this._tooltipElement.classList.toggle("instant",instant);this._tooltipLastOpened=instant?now:now+WebInspector.Tooltip.Timing.OpeningDelay;var container=WebInspector.Dialog.modalHostView().element;if(!anchorElement.isDescendant(container))
container=this.element.parentElement;var containerOffset=container.offsetRelativeToWindow(this.element.window());var containerOffsetWidth=container.offsetWidth;var containerOffsetHeight=container.offsetHeight;var anchorBox=this._anchorElement.boxInWindow(this.element.window());const anchorOffset=2;const pageMargin=2;var cursorOffset=10;this._tooltipElement.style.maxWidth=(containerOffsetWidth-pageMargin*2)+"px";this._tooltipElement.style.maxHeight="";var tooltipWidth=this._tooltipElement.offsetWidth;var tooltipHeight=this._tooltipElement.offsetHeight;var anchorTooltipAtElement=this._anchorElement.nodeName==="BUTTON"||this._anchorElement.nodeName==="LABEL";var tooltipX=anchorTooltipAtElement?anchorBox.x:event.x+cursorOffset;tooltipX=Number.constrain(tooltipX,containerOffset.x+pageMargin,containerOffset.x+containerOffsetWidth-tooltipWidth-pageMargin);var tooltipY;if(!anchorTooltipAtElement){tooltipY=event.y+cursorOffset+tooltipHeight<containerOffset.y+containerOffsetHeight?event.y+cursorOffset:event.y-tooltipHeight;}else{var onBottom=anchorBox.y+anchorOffset+anchorBox.height+tooltipHeight<containerOffset.y+containerOffsetHeight;tooltipY=onBottom?anchorBox.y+anchorBox.height+anchorOffset:anchorBox.y-tooltipHeight-anchorOffset;}
this._tooltipElement.positionAt(tooltipX,tooltipY);},_hide:function(removeInstant)
{delete this._anchorElement;this._tooltipElement.classList.remove("shown");if(Date.now()>this._tooltipLastOpened)
this._tooltipLastClosed=Date.now();if(removeInstant)
delete this._tooltipLastClosed;},_reset:function()
{this._hide(true);this._tooltipElement.positionAt(0,0);this._tooltipElement.style.maxWidth="0";this._tooltipElement.style.maxHeight="0";}}
WebInspector.Tooltip._symbol=Symbol("Tooltip");WebInspector.Tooltip.installHandler=function(doc)
{new WebInspector.Tooltip(doc);}
WebInspector.Tooltip.install=function(element,tooltipContent,actionId,options)
{if(typeof tooltipContent==="string"&&tooltipContent===""){delete element[WebInspector.Tooltip._symbol];return;}
element[WebInspector.Tooltip._symbol]={content:tooltipContent,actionId:actionId,options:options||{}};}
WebInspector.Tooltip.addNativeOverrideContainer=function(element)
{WebInspector.Tooltip._nativeOverrideContainer.push(element);}
WebInspector.Tooltip._nativeOverrideContainer=[];WebInspector.Tooltip._nativeTitle=(Object.getOwnPropertyDescriptor(HTMLElement.prototype,"title"));Object.defineProperty(HTMLElement.prototype,"title",{get:function()
{var tooltip=this[WebInspector.Tooltip._symbol];return tooltip?tooltip.content:"";},set:function(x)
{WebInspector.Tooltip.install(this,x);}});;WebInspector.SuggestBoxDelegate=function()
{}
WebInspector.SuggestBoxDelegate.prototype={applySuggestion:function(suggestion,isIntermediateSuggestion){},acceptSuggestion:function(){},}
WebInspector.SuggestBox=function(suggestBoxDelegate,maxItemsHeight)
{this._suggestBoxDelegate=suggestBoxDelegate;this._length=0;this._selectedIndex=-1;this._selectedElement=null;this._maxItemsHeight=maxItemsHeight;this._maybeHideBound=this._maybeHide.bind(this);this._container=createElementWithClass("div","suggest-box-container");this._element=this._container.createChild("div","suggest-box");this._element.addEventListener("mousedown",this._onBoxMouseDown.bind(this),true);this._detailsPopup=this._container.createChild("div","suggest-box details-popup monospace");this._detailsPopup.classList.add("hidden");this._asyncDetailsCallback=null;this._asyncDetailsPromises=({});}
WebInspector.SuggestBox.prototype={visible:function()
{return!!this._container.parentElement;},setPosition:function(anchorBox)
{this._updateBoxPosition(anchorBox);},_updateBoxPosition:function(anchorBox)
{console.assert(this._overlay);if(this._lastAnchorBox&&this._lastAnchorBox.equals(anchorBox))
return;this._lastAnchorBox=anchorBox;var container=WebInspector.Dialog.modalHostView().element;anchorBox=anchorBox.relativeToElement(container);var totalHeight=container.offsetHeight;var aboveHeight=anchorBox.y;var underHeight=totalHeight-anchorBox.y-anchorBox.height;this._overlay.setLeftOffset(anchorBox.x);var under=underHeight>=aboveHeight;if(under)
this._overlay.setVerticalOffset(anchorBox.y+anchorBox.height,true);else
this._overlay.setVerticalOffset(totalHeight-anchorBox.y,false);var rowHeight=17;var spacer=6;var maxHeight=this._maxItemsHeight?this._maxItemsHeight*rowHeight:Math.max(underHeight,aboveHeight)-spacer;this._element.style.maxHeight=maxHeight+"px";},_onBoxMouseDown:function(event)
{if(this._hideTimeoutId){window.clearTimeout(this._hideTimeoutId);delete this._hideTimeoutId;}
event.preventDefault();},_maybeHide:function()
{if(!this._hideTimeoutId)
this._hideTimeoutId=window.setTimeout(this.hide.bind(this),0);},_show:function()
{if(this.visible())
return;this._bodyElement=document.body;this._bodyElement.addEventListener("mousedown",this._maybeHideBound,true);this._overlay=new WebInspector.SuggestBox.Overlay();this._overlay.setContentElement(this._container);},hide:function()
{if(!this.visible())
return;this._bodyElement.removeEventListener("mousedown",this._maybeHideBound,true);delete this._bodyElement;this._container.remove();this._overlay.dispose();delete this._overlay;delete this._selectedElement;this._selectedIndex=-1;delete this._lastAnchorBox;},removeFromElement:function()
{this.hide();},_applySuggestion:function(isIntermediateSuggestion)
{if(!this.visible()||!this._selectedElement)
return false;var suggestion=this._selectedElement.__fullValue;if(!suggestion)
return false;this._suggestBoxDelegate.applySuggestion(suggestion,isIntermediateSuggestion);return true;},acceptSuggestion:function()
{var result=this._applySuggestion();this.hide();if(!result)
return false;this._suggestBoxDelegate.acceptSuggestion();return true;},_selectClosest:function(shift,isCircular)
{if(!this._length)
return false;if(this._selectedIndex===-1&&shift<0)
shift+=1;var index=this._selectedIndex+shift;if(isCircular)
index=(this._length+index)%this._length;else
index=Number.constrain(index,0,this._length-1);this._selectItem(index,true);this._applySuggestion(true);return true;},_onItemMouseDown:function(event)
{this._selectedElement=event.currentTarget;this.acceptSuggestion();event.consume(true);},_createItemElement:function(prefix,text,index)
{var element=createElementWithClass("div","suggest-box-content-item source-code");element.tabIndex=-1;if(prefix&&prefix.length&&!text.indexOf(prefix)){element.createChild("span","prefix").textContent=prefix;element.createChild("span","suffix").textContent=text.substring(prefix.length).trimEnd(50);}else{element.createChild("span","suffix").textContent=text.trimEnd(50);}
element.__fullValue=text;element.createChild("span","spacer");element.addEventListener("mousedown",this._onItemMouseDown.bind(this),false);return element;},_updateItems:function(items,userEnteredText,asyncDetails)
{this._length=items.length;this._asyncDetailsPromises={};this._asyncDetailsCallback=asyncDetails;this._element.removeChildren();delete this._selectedElement;for(var i=0;i<items.length;++i){var item=items[i];var currentItemElement=this._createItemElement(userEnteredText,item,i);this._element.appendChild(currentItemElement);}},_asyncDetails:function(index)
{if(!this._asyncDetailsCallback)
return Promise.resolve();if(!this._asyncDetailsPromises[index])
this._asyncDetailsPromises[index]=this._asyncDetailsCallback(index);return this._asyncDetailsPromises[index];},_showDetailsPopup:function(details)
{this._detailsPopup.removeChildren();if(!details)
return;this._detailsPopup.createChild("section","detail").createTextChild(details.detail);this._detailsPopup.createChild("section","description").createTextChild(details.description);this._detailsPopup.classList.remove("hidden");},_selectItem:function(index,scrollIntoView)
{if(this._selectedElement)
this._selectedElement.classList.remove("selected");this._selectedIndex=index;if(index<0)
return;this._selectedElement=this._element.children[index];this._selectedElement.classList.add("selected");this._detailsPopup.classList.add("hidden");var elem=this._selectedElement;this._asyncDetails(index).then(showDetails.bind(this),function(){});if(scrollIntoView)
this._selectedElement.scrollIntoViewIfNeeded(false);function showDetails(details)
{if(elem===this._selectedElement)
this._showDetailsPopup(details);}},_canShowBox:function(completions,canShowForSingleItem,userEnteredText)
{if(!completions||!completions.length)
return false;if(completions.length>1)
return true;return canShowForSingleItem&&completions[0]!==userEnteredText;},_ensureRowCountPerViewport:function()
{if(this._rowCountPerViewport)
return;if(!this._element.firstChild)
return;this._rowCountPerViewport=Math.floor(this._element.offsetHeight/this._element.firstChild.offsetHeight);},updateSuggestions:function(anchorBox,completions,selectedIndex,canShowForSingleItem,userEnteredText,asyncDetails)
{if(this._canShowBox(completions,canShowForSingleItem,userEnteredText)){this._updateItems(completions,userEnteredText,asyncDetails);this._show();this._updateBoxPosition(anchorBox);this._selectItem(selectedIndex,selectedIndex>0);delete this._rowCountPerViewport;}else
this.hide();},keyPressed:function(event)
{switch(event.keyIdentifier){case"Up":return this.upKeyPressed();case"Down":return this.downKeyPressed();case"PageUp":return this.pageUpKeyPressed();case"PageDown":return this.pageDownKeyPressed();case"Enter":return this.enterKeyPressed();}
return false;},upKeyPressed:function()
{return this._selectClosest(-1,true);},downKeyPressed:function()
{return this._selectClosest(1,true);},pageUpKeyPressed:function()
{this._ensureRowCountPerViewport();return this._selectClosest(-this._rowCountPerViewport,false);},pageDownKeyPressed:function()
{this._ensureRowCountPerViewport();return this._selectClosest(this._rowCountPerViewport,false);},enterKeyPressed:function()
{var hasSelectedItem=!!this._selectedElement;this.acceptSuggestion();return hasSelectedItem;}}
WebInspector.SuggestBox.Overlay=function()
{this.element=createElementWithClass("div","suggest-box-overlay");var root=WebInspector.createShadowRootWithCoreStyles(this.element,"ui/suggestBox.css");this._leftSpacerElement=root.createChild("div","suggest-box-left-spacer");this._horizontalElement=root.createChild("div","suggest-box-horizontal");this._topSpacerElement=this._horizontalElement.createChild("div","suggest-box-top-spacer");this._bottomSpacerElement=this._horizontalElement.createChild("div","suggest-box-bottom-spacer");this._resize();document.body.appendChild(this.element);}
WebInspector.SuggestBox.Overlay.prototype={setLeftOffset:function(offset)
{this._leftSpacerElement.style.flexBasis=offset+"px";},setVerticalOffset:function(offset,isTopOffset)
{this.element.classList.toggle("under-anchor",isTopOffset);if(isTopOffset){this._bottomSpacerElement.style.flexBasis="auto";this._topSpacerElement.style.flexBasis=offset+"px";}else{this._bottomSpacerElement.style.flexBasis=offset+"px";this._topSpacerElement.style.flexBasis="auto";}},setContentElement:function(element)
{this._horizontalElement.insertBefore(element,this._bottomSpacerElement);},_resize:function()
{var container=WebInspector.Dialog.modalHostView().element;var containerBox=container.boxInWindow(container.ownerDocument.defaultView);this.element.style.left=containerBox.x+"px";this.element.style.top=containerBox.y+"px";this.element.style.height=containerBox.height+"px";this.element.style.width=containerBox.width+"px";},dispose:function()
{this.element.remove();}};WebInspector.TabbedPane=function()
{WebInspector.VBox.call(this,true);this.registerRequiredCSS("ui/tabbedPane.css");this.element.classList.add("tabbed-pane");this.contentElement.classList.add("tabbed-pane-shadow");this.contentElement.tabIndex=-1;this._headerElement=this.contentElement.createChild("div","tabbed-pane-header");this._headerElement.createChild("content").select=".tabbed-pane-header-before";this._headerContentsElement=this._headerElement.createChild("div","tabbed-pane-header-contents");this._tabSlider=createElementWithClass("div","tabbed-pane-tab-slider");this._headerElement.createChild("content").select=".tabbed-pane-header-after";this._tabsElement=this._headerContentsElement.createChild("div","tabbed-pane-header-tabs");this._contentElement=this.contentElement.createChild("div","tabbed-pane-content");this._contentElement.createChild("content");this._tabs=[];this._tabsHistory=[];this._tabsById={};this._currentTabLocked=false;this._dropDownButton=this._createDropDownButton();WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged,this._zoomChanged,this);}
WebInspector.TabbedPane.EventTypes={TabSelected:"TabSelected",TabClosed:"TabClosed",TabOrderChanged:"TabOrderChanged"}
WebInspector.TabbedPane.prototype={setCurrentTabLocked:function(locked)
{this._currentTabLocked=locked;this._headerElement.classList.toggle("locked",this._currentTabLocked);},get visibleView()
{return this._currentTab?this._currentTab.view:null;},tabViews:function()
{function tabToView(tab)
{return tab.view;}
return this._tabs.map(tabToView);},get selectedTabId()
{return this._currentTab?this._currentTab.id:null;},setShrinkableTabs:function(shrinkableTabs)
{this._shrinkableTabs=shrinkableTabs;},setVerticalTabLayout:function(verticalTabLayout)
{this._verticalTabLayout=verticalTabLayout;this.contentElement.classList.add("vertical-tab-layout");this.invalidateConstraints();},setCloseableTabs:function(closeableTabs)
{this._closeableTabs=closeableTabs;},defaultFocusedElement:function()
{return this.visibleView?this.visibleView.defaultFocusedElement():this.contentElement;},focus:function()
{if(this.visibleView)
this.visibleView.focus();else
this.contentElement.focus();},headerElement:function()
{return this._headerElement;},isTabCloseable:function(id)
{var tab=this._tabsById[id];return tab?tab.isCloseable():false;},setTabDelegate:function(delegate)
{var tabs=this._tabs.slice();for(var i=0;i<tabs.length;++i)
tabs[i].setDelegate(delegate);this._delegate=delegate;},appendTab:function(id,tabTitle,view,tabTooltip,userGesture,isCloseable,index)
{isCloseable=typeof isCloseable==="boolean"?isCloseable:this._closeableTabs;var tab=new WebInspector.TabbedPaneTab(this,id,tabTitle,isCloseable,view,tabTooltip);tab.setDelegate(this._delegate);this._tabsById[id]=tab;if(index!==undefined)
this._tabs.splice(index,0,tab);else
this._tabs.push(tab);this._tabsHistory.push(tab);if(this._tabsHistory[0]===tab&&this.isShowing())
this.selectTab(tab.id,userGesture);this._updateTabElements();},closeTab:function(id,userGesture)
{this.closeTabs([id],userGesture);},closeTabs:function(ids,userGesture)
{var focused=this.hasFocus();for(var i=0;i<ids.length;++i)
this._innerCloseTab(ids[i],userGesture);this._updateTabElements();if(this._tabsHistory.length)
this.selectTab(this._tabsHistory[0].id,false);if(focused)
this.focus();},_innerCloseTab:function(id,userGesture)
{if(!this._tabsById[id])
return;if(userGesture&&!this._tabsById[id]._closeable)
return;if(this._currentTab&&this._currentTab.id===id)
this._hideCurrentTab();var tab=this._tabsById[id];delete this._tabsById[id];this._tabsHistory.splice(this._tabsHistory.indexOf(tab),1);this._tabs.splice(this._tabs.indexOf(tab),1);if(tab._shown)
this._hideTabElement(tab);var eventData={tabId:id,view:tab.view,isUserGesture:userGesture};this.dispatchEventToListeners(WebInspector.TabbedPane.EventTypes.TabClosed,eventData);return true;},hasTab:function(tabId)
{return!!this._tabsById[tabId];},allTabs:function()
{return this._tabs.map(function(tab){return tab.id;});},otherTabs:function(id)
{var result=[];for(var i=0;i<this._tabs.length;++i){if(this._tabs[i].id!==id)
result.push(this._tabs[i].id);}
return result;},_tabsToTheRight:function(id)
{var index=-1;for(var i=0;i<this._tabs.length;++i){if(this._tabs[i].id===id){index=i;break;}}
if(index===-1)
return[];return this._tabs.slice(index+1).map(function(tab){return tab.id;});},selectTab:function(id,userGesture)
{if(this._currentTabLocked)
return false;var focused=this.hasFocus();var tab=this._tabsById[id];if(!tab)
return false;if(this._currentTab&&this._currentTab.id===id)
return true;this._hideCurrentTab();this._showTab(tab);this._currentTab=tab;this._tabsHistory.splice(this._tabsHistory.indexOf(tab),1);this._tabsHistory.splice(0,0,tab);this._updateTabElements();if(focused)
this.focus();var eventData={tabId:id,view:tab.view,isUserGesture:userGesture};this.dispatchEventToListeners(WebInspector.TabbedPane.EventTypes.TabSelected,eventData);return true;},lastOpenedTabIds:function(tabsCount)
{function tabToTabId(tab){return tab.id;}
return this._tabsHistory.slice(0,tabsCount).map(tabToTabId);},setTabIcon:function(id,iconType,iconTooltip)
{var tab=this._tabsById[id];if(tab._setIconType(iconType,iconTooltip))
this._updateTabElements();},toggleTabClass:function(id,className,force)
{var tab=this._tabsById[id];if(tab._toggleClass(className,force))
this._updateTabElements();},_zoomChanged:function(event)
{for(var i=0;i<this._tabs.length;++i)
delete this._tabs[i]._measuredWidth;if(this.isShowing())
this._updateTabElements();},changeTabTitle:function(id,tabTitle)
{var tab=this._tabsById[id];if(tab.title===tabTitle)
return;tab.title=tabTitle;this._updateTabElements();},changeTabView:function(id,view)
{var tab=this._tabsById[id];if(this._currentTab&&this._currentTab.id===tab.id){if(tab.view!==view)
this._hideTab(tab);tab.view=view;this._showTab(tab);}else
tab.view=view;},onResize:function()
{this._updateTabElements();},headerResized:function()
{this._updateTabElements();},wasShown:function()
{var effectiveTab=this._currentTab||this._tabsHistory[0];if(effectiveTab)
this.selectTab(effectiveTab.id);},setTabSlider:function(enable)
{this._sliderEnabled=enable;this._tabSlider.classList.toggle("enabled",enable);},calculateConstraints:function()
{var constraints=WebInspector.VBox.prototype.calculateConstraints.call(this);var minContentConstraints=new Constraints(new Size(0,0),new Size(50,50));constraints=constraints.widthToMax(minContentConstraints).heightToMax(minContentConstraints);if(this._verticalTabLayout)
constraints=constraints.addWidth(new Constraints(new Size(120,0)));else
constraints=constraints.addHeight(new Constraints(new Size(0,30)));return constraints;},_updateTabElements:function()
{WebInspector.invokeOnceAfterBatchUpdate(this,this._innerUpdateTabElements);},setPlaceholderText:function(text)
{this._noTabsMessage=text;},_innerUpdateTabElements:function()
{if(!this.isShowing())
return;if(!this._tabs.length){this._contentElement.classList.add("has-no-tabs");if(this._noTabsMessage&&!this._noTabsMessageElement){this._noTabsMessageElement=this._contentElement.createChild("div","tabbed-pane-placeholder fill");this._noTabsMessageElement.textContent=this._noTabsMessage;}}else{this._contentElement.classList.remove("has-no-tabs");if(this._noTabsMessageElement){this._noTabsMessageElement.remove();delete this._noTabsMessageElement;}}
this._measureDropDownButton();this._updateWidths();this._updateTabsDropDown();this._updateTabSlider();},_showTabElement:function(index,tab)
{if(index>=this._tabsElement.children.length)
this._tabsElement.appendChild(tab.tabElement);else
this._tabsElement.insertBefore(tab.tabElement,this._tabsElement.children[index]);tab._shown=true;},_hideTabElement:function(tab)
{this._tabsElement.removeChild(tab.tabElement);tab._shown=false;},_createDropDownButton:function()
{var dropDownContainer=createElementWithClass("div","tabbed-pane-header-tabs-drop-down-container");dropDownContainer.createChild("div","glyph");this._dropDownMenu=new WebInspector.DropDownMenu(dropDownContainer);this._dropDownMenu.addEventListener(WebInspector.DropDownMenu.Events.ItemSelected,this._dropDownMenuItemSelected,this);return dropDownContainer;},_dropDownMenuItemSelected:function(event)
{var tabId=(event.data);this._lastSelectedOverflowTab=this._tabsById[tabId];this.selectTab(tabId,true);},_totalWidth:function()
{return this._headerContentsElement.getBoundingClientRect().width;},_numberOfTabsShown:function()
{var numTabsShown=0;for(var tab of this._tabs){if(tab._shown)
numTabsShown++;}
return numTabsShown;},disableOverflowMenu:function()
{this._overflowDisabled=true;},_updateTabsDropDown:function()
{var tabsToShowIndexes=this._tabsToShowIndexes(this._tabs,this._tabsHistory,this._totalWidth(),this._measuredDropDownButtonWidth||0);if(this._lastSelectedOverflowTab&&this._numberOfTabsShown()!==tabsToShowIndexes.length){delete this._lastSelectedOverflowTab;this._updateTabsDropDown();return;}
for(var i=0;i<this._tabs.length;++i){if(this._tabs[i]._shown&&tabsToShowIndexes.indexOf(i)===-1)
this._hideTabElement(this._tabs[i]);}
for(var i=0;i<tabsToShowIndexes.length;++i){var tab=this._tabs[tabsToShowIndexes[i]];if(!tab._shown)
this._showTabElement(i,tab);}
if(!this._overflowDisabled)
this._populateDropDownFromIndex();},_populateDropDownFromIndex:function()
{if(this._dropDownButton.parentElement)
this._headerContentsElement.removeChild(this._dropDownButton);this._dropDownMenu.clear();var tabsToShow=[];for(var i=0;i<this._tabs.length;++i){if(!this._tabs[i]._shown)
tabsToShow.push(this._tabs[i]);}
var selectedId=null;for(var i=0;i<tabsToShow.length;++i){var tab=tabsToShow[i];this._dropDownMenu.addItem(tab.id,tab.title);if(this._tabsHistory[0]===tab)
selectedId=tab.id;}
if(tabsToShow.length){this._headerContentsElement.appendChild(this._dropDownButton);this._dropDownMenu.selectItem(selectedId);}},_measureDropDownButton:function()
{if(this._overflowDisabled||this._measuredDropDownButtonWidth)
return;this._dropDownButton.classList.add("measuring");this._headerContentsElement.appendChild(this._dropDownButton);this._measuredDropDownButtonWidth=this._dropDownButton.getBoundingClientRect().width;this._headerContentsElement.removeChild(this._dropDownButton);this._dropDownButton.classList.remove("measuring");},_updateWidths:function()
{var measuredWidths=this._measureWidths();var maxWidth=this._shrinkableTabs?this._calculateMaxWidth(measuredWidths.slice(),this._totalWidth()):Number.MAX_VALUE;var i=0;for(var tabId in this._tabs){var tab=this._tabs[tabId];tab.setWidth(this._verticalTabLayout?-1:Math.min(maxWidth,measuredWidths[i++]));}},_measureWidths:function()
{this._tabsElement.style.setProperty("width","2000px");var measuringTabElements=[];for(var tabId in this._tabs){var tab=this._tabs[tabId];if(typeof tab._measuredWidth==="number")
continue;var measuringTabElement=tab._createTabElement(true);measuringTabElement.__tab=tab;measuringTabElements.push(measuringTabElement);this._tabsElement.appendChild(measuringTabElement);}
for(var i=0;i<measuringTabElements.length;++i){var width=measuringTabElements[i].getBoundingClientRect().width;measuringTabElements[i].__tab._measuredWidth=Math.ceil(width);}
for(var i=0;i<measuringTabElements.length;++i)
measuringTabElements[i].remove();var measuredWidths=[];for(var tabId in this._tabs)
measuredWidths.push(this._tabs[tabId]._measuredWidth);this._tabsElement.style.removeProperty("width");return measuredWidths;},_calculateMaxWidth:function(measuredWidths,totalWidth)
{if(!measuredWidths.length)
return 0;measuredWidths.sort(function(x,y){return x-y;});var totalMeasuredWidth=0;for(var i=0;i<measuredWidths.length;++i)
totalMeasuredWidth+=measuredWidths[i];if(totalWidth>=totalMeasuredWidth)
return measuredWidths[measuredWidths.length-1];var totalExtraWidth=0;for(var i=measuredWidths.length-1;i>0;--i){var extraWidth=measuredWidths[i]-measuredWidths[i-1];totalExtraWidth+=(measuredWidths.length-i)*extraWidth;if(totalWidth+totalExtraWidth>=totalMeasuredWidth)
return measuredWidths[i-1]+(totalWidth+totalExtraWidth-totalMeasuredWidth)/(measuredWidths.length-i);}
return totalWidth/measuredWidths.length;},_tabsToShowIndexes:function(tabsOrdered,tabsHistory,totalWidth,measuredDropDownButtonWidth)
{var tabsToShowIndexes=[];var totalTabsWidth=0;var tabCount=tabsOrdered.length;var tabsToLookAt=tabsOrdered.slice(0);if(this._currentTab!==undefined)
tabsToLookAt.unshift(tabsToLookAt.splice(tabsToLookAt.indexOf(this._currentTab),1)[0]);if(this._lastSelectedOverflowTab!==undefined)
tabsToLookAt.unshift(tabsToLookAt.splice(tabsToLookAt.indexOf(this._lastSelectedOverflowTab),1)[0]);for(var i=0;i<tabCount;++i){var tab=this._automaticReorder?tabsHistory[i]:tabsToLookAt[i];totalTabsWidth+=tab.width();var minimalRequiredWidth=totalTabsWidth;if(i!==tabCount-1)
minimalRequiredWidth+=measuredDropDownButtonWidth;if(!this._verticalTabLayout&&minimalRequiredWidth>totalWidth)
break;tabsToShowIndexes.push(tabsOrdered.indexOf(tab));}
tabsToShowIndexes.sort(function(x,y){return x-y;});return tabsToShowIndexes;},_hideCurrentTab:function()
{if(!this._currentTab)
return;this._hideTab(this._currentTab);delete this._currentTab;},_showTab:function(tab)
{tab.tabElement.classList.add("selected");tab.view.show(this.element);this._updateTabSlider();},_updateTabSlider:function()
{if(!this._currentTab||!this._sliderEnabled)
return;var left=0;for(var i=0;i<this._tabs.length&&this._currentTab!==this._tabs[i]&&this._tabs[i]._shown;i++)
left+=this._tabs[i]._measuredWidth;var sliderWidth=this._currentTab._shown?this._currentTab._measuredWidth:this._dropDownButton.offsetWidth;var scaleFactor=window.devicePixelRatio>=1.5?" scaleY(0.75)":"";this._tabSlider.style.transform="translateX("+left+"px)"+scaleFactor;this._tabSlider.style.width=sliderWidth+"px";if(this._tabSlider.parentElement!==this._headerContentsElement)
this._headerContentsElement.appendChild(this._tabSlider);},_hideTab:function(tab)
{tab.tabElement.classList.remove("selected");tab.view.detach();},elementsToRestoreScrollPositionsFor:function()
{return[this._contentElement];},_insertBefore:function(tab,index)
{this._tabsElement.insertBefore(tab._tabElement||null,this._tabsElement.childNodes[index]);var oldIndex=this._tabs.indexOf(tab);this._tabs.splice(oldIndex,1);if(oldIndex<index)
--index;this._tabs.splice(index,0,tab);this.dispatchEventToListeners(WebInspector.TabbedPane.EventTypes.TabOrderChanged,this._tabs);},insertBeforeTabStrip:function(element)
{element.classList.add("tabbed-pane-header-before");this.element.appendChild(element);},appendAfterTabStrip:function(element)
{element.classList.add("tabbed-pane-header-after");this.element.appendChild(element);},renderWithNoHeaderBackground:function()
{this._headerElement.classList.add("tabbed-pane-no-header-background");},setAllowTabReorder:function(allow,automatic)
{this._allowTabReorder=allow;this._automaticReorder=automatic;},__proto__:WebInspector.VBox.prototype}
WebInspector.TabbedPaneTab=function(tabbedPane,id,title,closeable,view,tooltip)
{this._closeable=closeable;this._tabbedPane=tabbedPane;this._id=id;this._title=title;this._tooltip=tooltip;this._view=view;this._shown=false;this._measuredWidth;this._tabElement;}
WebInspector.TabbedPaneTab.prototype={get id()
{return this._id;},get title()
{return this._title;},set title(title)
{if(title===this._title)
return;this._title=title;if(this._titleElement)
this._titleElement.textContent=title;delete this._measuredWidth;},isCloseable:function()
{return this._closeable;},_setIconType:function(iconType,iconTooltip)
{if(iconType===this._iconType&&iconTooltip===this._iconTooltip)
return false;this._iconType=iconType;this._iconTooltip=iconTooltip;if(this._tabElement)
this._createIconElement(this._tabElement,this._titleElement);delete this._measuredWidth;return true;},_toggleClass:function(className,force)
{var element=this.tabElement;var hasClass=element.classList.contains(className);if(hasClass===force)
return false;element.classList.toggle(className,force);delete this._measuredWidth;return true;},get view()
{return this._view;},set view(view)
{this._view=view;},get tooltip()
{return this._tooltip;},set tooltip(tooltip)
{this._tooltip=tooltip;if(this._titleElement)
this._titleElement.title=tooltip||"";},get tabElement()
{if(!this._tabElement)
this._tabElement=this._createTabElement(false);return this._tabElement;},width:function()
{return this._width;},setWidth:function(width)
{this.tabElement.style.width=width===-1?"":(width+"px");this._width=width;},setDelegate:function(delegate)
{this._delegate=delegate;},_createIconElement:function(tabElement,titleElement)
{if(tabElement.__iconElement)
tabElement.__iconElement.remove();if(!this._iconType)
return;var iconElement=createElementWithClass("label","tabbed-pane-header-tab-icon","dt-icon-label");iconElement.type=this._iconType;if(this._iconTooltip)
iconElement.title=this._iconTooltip;tabElement.insertBefore(iconElement,titleElement);tabElement.__iconElement=iconElement;},_createTabElement:function(measuring)
{var tabElement=createElementWithClass("div","tabbed-pane-header-tab");tabElement.id="tab-"+this._id;tabElement.tabIndex=-1;tabElement.selectTabForTest=this._tabbedPane.selectTab.bind(this._tabbedPane,this.id,true);var titleElement=tabElement.createChild("span","tabbed-pane-header-tab-title");titleElement.textContent=this.title;titleElement.title=this.tooltip||"";this._createIconElement(tabElement,titleElement);if(!measuring)
this._titleElement=titleElement;if(this._closeable)
tabElement.createChild("div","tabbed-pane-close-button","dt-close-button").gray=true;if(measuring){tabElement.classList.add("measuring");}else{tabElement.addEventListener("click",this._tabClicked.bind(this),false);tabElement.addEventListener("mousedown",this._tabMouseDown.bind(this),false);tabElement.addEventListener("mouseup",this._tabMouseUp.bind(this),false);tabElement.addEventListener("contextmenu",this._tabContextMenu.bind(this),false);if(this._tabbedPane._allowTabReorder)
WebInspector.installDragHandle(tabElement,this._startTabDragging.bind(this),this._tabDragging.bind(this),this._endTabDragging.bind(this),"-webkit-grabbing","pointer",200);}
return tabElement;},_tabClicked:function(event)
{var middleButton=event.button===1;var shouldClose=this._closeable&&(middleButton||event.target.classList.contains("tabbed-pane-close-button"));if(!shouldClose){this._tabbedPane.focus();return;}
this._closeTabs([this.id]);event.consume(true);},_tabMouseDown:function(event)
{if(event.target.classList.contains("tabbed-pane-close-button")||event.button===1)
return;this._tabbedPane.selectTab(this.id,true);},_tabMouseUp:function(event)
{if(event.button===1)
event.consume(true);},_closeTabs:function(ids)
{if(this._delegate){this._delegate.closeTabs(this._tabbedPane,ids);return;}
this._tabbedPane.closeTabs(ids,true);},_tabContextMenu:function(event)
{function close()
{this._closeTabs([this.id]);}
function closeOthers()
{this._closeTabs(this._tabbedPane.otherTabs(this.id));}
function closeAll()
{this._closeTabs(this._tabbedPane.allTabs());}
function closeToTheRight()
{this._closeTabs(this._tabbedPane._tabsToTheRight(this.id));}
var contextMenu=new WebInspector.ContextMenu(event);if(this._closeable){contextMenu.appendItem(WebInspector.UIString.capitalize("Close"),close.bind(this));contextMenu.appendItem(WebInspector.UIString.capitalize("Close ^others"),closeOthers.bind(this));contextMenu.appendItem(WebInspector.UIString.capitalize("Close ^tabs to the ^right"),closeToTheRight.bind(this));contextMenu.appendItem(WebInspector.UIString.capitalize("Close ^all"),closeAll.bind(this));}
if(this._delegate)
this._delegate.onContextMenu(this.id,contextMenu);contextMenu.show();},_startTabDragging:function(event)
{if(event.target.classList.contains("tabbed-pane-close-button"))
return false;this._dragStartX=event.pageX;this._tabElement.classList.add("dragging");this._tabbedPane._tabSlider.remove();return true;},_tabDragging:function(event)
{var tabElements=this._tabbedPane._tabsElement.childNodes;for(var i=0;i<tabElements.length;++i){var tabElement=tabElements[i];if(tabElement===this._tabElement)
continue;var intersects=tabElement.offsetLeft+tabElement.clientWidth>this._tabElement.offsetLeft&&this._tabElement.offsetLeft+this._tabElement.clientWidth>tabElement.offsetLeft;if(!intersects)
continue;if(Math.abs(event.pageX-this._dragStartX)<tabElement.clientWidth/2+5)
break;if(event.pageX-this._dragStartX>0){tabElement=tabElement.nextSibling;++i;}
var oldOffsetLeft=this._tabElement.offsetLeft;this._tabbedPane._insertBefore(this,i);this._dragStartX+=this._tabElement.offsetLeft-oldOffsetLeft;break;}
if(!this._tabElement.previousSibling&&event.pageX-this._dragStartX<0){this._tabElement.style.setProperty("left","0px");return;}
if(!this._tabElement.nextSibling&&event.pageX-this._dragStartX>0){this._tabElement.style.setProperty("left","0px");return;}
this._tabElement.style.setProperty("left",(event.pageX-this._dragStartX)+"px");},_endTabDragging:function(event)
{this._tabElement.classList.remove("dragging");this._tabElement.style.removeProperty("left");delete this._dragStartX;this._tabbedPane._updateTabSlider();}}
WebInspector.TabbedPaneTabDelegate=function()
{}
WebInspector.TabbedPaneTabDelegate.prototype={closeTabs:function(tabbedPane,ids){},onContextMenu:function(tabId,contextMenu){}}
WebInspector.ExtensibleTabbedPaneController=function(tabbedPane,extensionPoint,viewCallback)
{this._tabbedPane=tabbedPane;this._extensionPoint=extensionPoint;this._viewCallback=viewCallback;this._promiseForId={};this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabClosed,this._tabClosed,this);this._views=new Map();this._closeableTabSetting=WebInspector.settings.createSetting(extensionPoint+"-closeableTabs",{});this._initialize();}
WebInspector.ExtensibleTabbedPaneController.prototype={_initialize:function()
{this._extensions=new Map();var extensions=self.runtime.extensions(this._extensionPoint);for(var i=0;i<extensions.length;++i){var id=extensions[i].descriptor()["name"];this._extensions.set(id,extensions[i]);if(this._isPermanentTab(id))
this._appendTab(extensions[i]);}
for(var i=0;i<extensions.length;i++){var id=extensions[i].descriptor()["name"];if(this._isCloseableTab(id)&&this._closeableTabSetting.get()[id])
this._appendTab(extensions[i]);}},_isPermanentTab:function(id)
{return this._extensions.get(id).descriptor()["persistence"]==="permanent"||!this._extensions.get(id).descriptor()["persistence"];},_isCloseableTab:function(id)
{return this._extensions.get(id).descriptor()["persistence"]==="closeable";},enableMoreTabsButton:function()
{var toolbar=new WebInspector.Toolbar("drawer-toolbar");toolbar.appendToolbarItem(new WebInspector.ToolbarMenuButton(this._appendTabsToMenu.bind(this)));this._tabbedPane.insertBeforeTabStrip(toolbar.element);this._tabbedPane.disableOverflowMenu();},_appendTabsToMenu:function(contextMenu)
{for(var id of this._extensions.keysArray().filter(this._isPermanentTab.bind(this))){var title=WebInspector.UIString(this._extensions.get(id).title(WebInspector.platform()));contextMenu.appendItem(title,this.showTab.bind(this,id));}
for(var id of this._extensions.keysArray().filter(this._isCloseableTab.bind(this))){var title=WebInspector.UIString(this._extensions.get(id).title(WebInspector.platform()));contextMenu.appendItem(title,this.showTab.bind(this,id));}},_appendTab:function(extension)
{var descriptor=extension.descriptor();var id=descriptor["name"];var title=WebInspector.UIString(extension.title(WebInspector.platform()));var closeable=descriptor["persistence"]==="closeable"||descriptor["persistence"]==="temporary";this._tabbedPane.appendTab(id,title,this._views.get(id)||new WebInspector.Widget(),undefined,false,closeable);},showTab:function(id)
{function viewLoaded(view)
{if(this._pendingView===id)
this._tabbedPane.selectTab(id);delete this._pendingView;return view;}
console.assert(this._extensions.get(id));if(!this._tabbedPane.hasTab(id))
this._appendTab((this._extensions.get(id)));this._tabbedPane.selectTab(id);var descriptor=this._extensions.get(id).descriptor();if(descriptor["persistence"]==="closeable"){var tabs=this._closeableTabSetting.get();if(!tabs[id]){tabs[id]=true;this._closeableTabSetting.set(tabs);}}
this._pendingView=id;return this.viewForId(id).then(viewLoaded.bind(this));},_tabSelected:function(event)
{var tabId=(event.data.tabId);this.viewForId(tabId);},_tabClosed:function(event)
{var tabs=this._closeableTabSetting.get();if(tabs[event.data.tabId]){delete tabs[event.data.tabId];this._closeableTabSetting.set(tabs);}},viewIds:function()
{return this._extensions.keysArray();},viewForId:function(id)
{if(this._views.has(id))
return Promise.resolve((this._views.get(id)));if(!this._extensions.has(id))
return Promise.resolve((null));if(this._promiseForId[id])
return this._promiseForId[id];var promise=this._extensions.get(id).instancePromise();this._promiseForId[id]=(promise);return promise.then(cacheView.bind(this));function cacheView(object)
{var view=(object);delete this._promiseForId[id];this._views.set(id,view);if(this._viewCallback&&view)
this._viewCallback(id,view);var shouldFocus=this._tabbedPane.visibleView.element.isSelfOrAncestor(WebInspector.currentFocusElement());this._tabbedPane.changeTabView(id,view);if(shouldFocus)
view.focus();return view;}}};WebInspector.SidebarPane=function(title)
{WebInspector.Widget.call(this);this.setMinimumSize(25,0);this.element.className="sidebar-pane";this._title=title;this._expandCallback=null;this._paneVisible=true;}
WebInspector.SidebarPane.prototype={toolbar:function()
{if(!this._toolbar){this._toolbar=new WebInspector.Toolbar("");this._toolbar.element.addEventListener("click",consumeEvent);this.element.insertBefore(this._toolbar.element,this.element.firstChild);}
return this._toolbar;},title:function()
{return this._title;},expand:function()
{this.onContentReady();},onContentReady:function()
{if(this._expandCallback)
this._expandCallback();else
this._expandPending=true;},_attached:function(setVisibleCallback,expandCallback)
{this._setVisibleCallback=setVisibleCallback;this._setVisibleCallback(this._paneVisible);this._expandCallback=expandCallback;if(this._expandPending){delete this._expandPending;this._expandCallback();}},setVisible:function(visible)
{this._paneVisible=visible;if(this._setVisibleCallback)
this._setVisibleCallback(visible)},__proto__:WebInspector.Widget.prototype}
WebInspector.SidebarPaneTitle=function(container,pane)
{this._pane=pane;this.element=container.createChild("div","sidebar-pane-title");this.element.textContent=pane.title();this.element.tabIndex=0;this.element.addEventListener("click",this._toggleExpanded.bind(this),false);this.element.addEventListener("keydown",this._onTitleKeyDown.bind(this),false);}
WebInspector.SidebarPaneTitle.prototype={_expand:function()
{this.element.classList.add("expanded");this._pane.show(this.element.parentElement,(this.element.nextSibling));},_collapse:function()
{this.element.classList.remove("expanded");if(this._pane.element.parentNode==this.element.parentNode)
this._pane.detach();},_toggleExpanded:function()
{if(this.element.classList.contains("expanded"))
this._collapse();else
this._pane.expand();},_onTitleKeyDown:function(event)
{if(isEnterKey(event)||event.keyCode===WebInspector.KeyboardShortcut.Keys.Space.code)
this._toggleExpanded();}}
WebInspector.SidebarPaneStack=function()
{WebInspector.Widget.call(this);this.setMinimumSize(25,0);this.element.className="sidebar-pane-stack";this._titleByPane=new Map();}
WebInspector.SidebarPaneStack.prototype={addPane:function(pane)
{var paneTitle=new WebInspector.SidebarPaneTitle(this.element,pane);this._titleByPane.set(pane,paneTitle);if(pane._toolbar)
paneTitle.element.appendChild(pane._toolbar.element);pane._attached(this._setPaneVisible.bind(this,pane),paneTitle._expand.bind(paneTitle));},_setPaneVisible:function(pane,visible)
{var title=this._titleByPane.get(pane);if(!title)
return;title.element.classList.toggle("hidden",!visible);pane.element.classList.toggle("sidebar-pane-hidden",!visible);},__proto__:WebInspector.Widget.prototype}
WebInspector.SidebarTabbedPane=function()
{WebInspector.TabbedPane.call(this);this.element.classList.add("sidebar-tabbed-pane");}
WebInspector.SidebarTabbedPane.prototype={addPane:function(pane)
{var title=pane.title();this.appendTab(title,title,pane);if(pane._toolbar)
pane.element.insertBefore(pane._toolbar.element,pane.element.firstChild);pane._attached(this._setPaneVisible.bind(this,pane),this.selectTab.bind(this,title));},_setPaneVisible:function(pane,visible)
{var title=pane._title;if(visible){if(!this.hasTab(title))
this.appendTab(title,title,pane);}else{if(this.hasTab(title))
this.closeTab(title);}},__proto__:WebInspector.TabbedPane.prototype};WebInspector.TextPrompt=function(completions,stopCharacters)
{this._proxyElement;this._proxyElementDisplay="inline-block";this._loadCompletions=completions;this._completionStopCharacters=stopCharacters||" =:[({;,!+-*/&|^<>.";this._autocompletionTimeout=WebInspector.TextPrompt.DefaultAutocompletionTimeout;}
WebInspector.TextPrompt.DefaultAutocompletionTimeout=250;WebInspector.TextPrompt.Events={ItemApplied:"text-prompt-item-applied",ItemAccepted:"text-prompt-item-accepted"};WebInspector.TextPrompt.prototype={setAutocompletionTimeout:function(timeout)
{this._autocompletionTimeout=timeout;},setSuggestBoxEnabled:function(suggestBoxEnabled)
{this._suggestBoxEnabled=suggestBoxEnabled;},renderAsBlock:function()
{this._proxyElementDisplay="block";},attach:function(element)
{return this._attachInternal(element);},attachAndStartEditing:function(element,blurListener)
{var proxyElement=this._attachInternal(element);this._startEditing(blurListener);return proxyElement;},_attachInternal:function(element)
{if(this._proxyElement)
throw"Cannot attach an attached TextPrompt";this._element=element;this._boundOnKeyDown=this.onKeyDown.bind(this);this._boundOnInput=this.onInput.bind(this);this._boundOnMouseWheel=this.onMouseWheel.bind(this);this._boundSelectStart=this._selectStart.bind(this);this._boundRemoveSuggestionAids=this._removeSuggestionAids.bind(this);this._proxyElement=element.ownerDocument.createElement("span");var shadowRoot=WebInspector.createShadowRootWithCoreStyles(this._proxyElement,"ui/textPrompt.css");this._contentElement=shadowRoot.createChild("div");this._contentElement.createChild("content");this._proxyElement.style.display=this._proxyElementDisplay;element.parentElement.insertBefore(this._proxyElement,element);this._proxyElement.appendChild(element);this._element.classList.add("text-prompt");this._element.addEventListener("keydown",this._boundOnKeyDown,false);this._element.addEventListener("input",this._boundOnInput,false);this._element.addEventListener("mousewheel",this._boundOnMouseWheel,false);this._element.addEventListener("selectstart",this._boundSelectStart,false);this._element.addEventListener("blur",this._boundRemoveSuggestionAids,false);this._element.ownerDocument.defaultView.addEventListener("resize",this._boundRemoveSuggestionAids,false);if(this._suggestBoxEnabled)
this._suggestBox=new WebInspector.SuggestBox(this);return this._proxyElement;},detach:function()
{this._removeFromElement();this._proxyElement.parentElement.insertBefore(this._element,this._proxyElement);this._proxyElement.remove();delete this._proxyElement;this._element.classList.remove("text-prompt");WebInspector.restoreFocusFromElement(this._element);},text:function()
{return this._element.textContent;},userEnteredText:function()
{var text=this.text();if(this.autoCompleteElement){var addition=this.autoCompleteElement.textContent;text=text.substring(0,text.length-addition.length);}
return text;},setText:function(x)
{this._removeSuggestionAids();if(!x){this._element.removeChildren();this._element.createChild("br");}else{this._element.textContent=x;}
this.moveCaretToEndOfPrompt();this._element.scrollIntoView();},_removeFromElement:function()
{this.clearAutoComplete(true);this._element.removeEventListener("keydown",this._boundOnKeyDown,false);this._element.removeEventListener("input",this._boundOnInput,false);this._element.removeEventListener("selectstart",this._boundSelectStart,false);this._element.removeEventListener("blur",this._boundRemoveSuggestionAids,false);this._element.ownerDocument.defaultView.removeEventListener("resize",this._boundRemoveSuggestionAids,false);if(this._isEditing)
this._stopEditing();if(this._suggestBox)
this._suggestBox.removeFromElement();},_startEditing:function(blurListener)
{this._isEditing=true;this._contentElement.classList.add("text-prompt-editing");if(blurListener){this._blurListener=blurListener;this._element.addEventListener("blur",this._blurListener,false);}
this._oldTabIndex=this._element.tabIndex;if(this._element.tabIndex<0)
this._element.tabIndex=0;WebInspector.setCurrentFocusElement(this._element);if(!this.text())
this._updateAutoComplete();},_stopEditing:function()
{this._element.tabIndex=this._oldTabIndex;if(this._blurListener)
this._element.removeEventListener("blur",this._blurListener,false);this._contentElement.classList.remove("text-prompt-editing");delete this._isEditing;},_removeSuggestionAids:function()
{this.clearAutoComplete();this.hideSuggestBox();},_selectStart:function()
{if(this._selectionTimeout)
clearTimeout(this._selectionTimeout);this._removeSuggestionAids();function moveBackIfOutside()
{delete this._selectionTimeout;if(!this.isCaretInsidePrompt()&&this._element.isComponentSelectionCollapsed()){this.moveCaretToEndOfPrompt();this.autoCompleteSoon();}}
this._selectionTimeout=setTimeout(moveBackIfOutside.bind(this),100);},_updateAutoComplete:function(force)
{this.clearAutoComplete();this.autoCompleteSoon(force);},onMouseWheel:function(event)
{},onKeyDown:function(event)
{var handled=false;delete this._needUpdateAutocomplete;switch(event.keyIdentifier){case"U+0009":handled=this.tabKeyPressed(event);break;case"Left":case"Home":this._removeSuggestionAids();break;case"Right":case"End":if(this.isCaretAtEndOfPrompt())
handled=this.acceptAutoComplete();else
this._removeSuggestionAids();break;case"U+001B":if(this.isSuggestBoxVisible()){this._removeSuggestionAids();handled=true;}
break;case"U+0020":if(event.ctrlKey&&!event.metaKey&&!event.altKey&&!event.shiftKey){this._updateAutoComplete(true);handled=true;}
break;case"Alt":case"Meta":case"Shift":case"Control":break;}
if(!handled&&this.isSuggestBoxVisible())
handled=this._suggestBox.keyPressed(event);if(!handled)
this._needUpdateAutocomplete=true;if(handled)
event.consume(true);},onInput:function(event)
{if(this._needUpdateAutocomplete)
this._updateAutoComplete();},acceptAutoComplete:function()
{var result=false;if(this.isSuggestBoxVisible())
result=this._suggestBox.acceptSuggestion();if(!result)
result=this._acceptSuggestionInternal();return result;},clearAutoComplete:function(includeTimeout)
{if(includeTimeout&&this._completeTimeout){clearTimeout(this._completeTimeout);delete this._completeTimeout;}
delete this._waitingForCompletions;if(!this.autoCompleteElement)
return;this.autoCompleteElement.remove();delete this.autoCompleteElement;delete this._userEnteredRange;delete this._userEnteredText;},autoCompleteSoon:function(force)
{var immediately=this.isSuggestBoxVisible()||force;if(!this._completeTimeout)
this._completeTimeout=setTimeout(this.complete.bind(this,force),immediately?0:this._autocompletionTimeout);},complete:function(force,reverse)
{this.clearAutoComplete(true);var selection=this._element.getComponentSelection();if(!selection.rangeCount)
return;var selectionRange=selection.getRangeAt(0);var shouldExit;if(!force&&!this.isCaretAtEndOfPrompt()&&!this.isSuggestBoxVisible())
shouldExit=true;else if(!selection.isCollapsed)
shouldExit=true;else if(!force){var wordSuffixRange=selectionRange.startContainer.rangeOfWord(selectionRange.endOffset,this._completionStopCharacters,this._element,"forward");if(wordSuffixRange.toString().length)
shouldExit=true;}
if(shouldExit){this.hideSuggestBox();return;}
var wordPrefixRange=selectionRange.startContainer.rangeOfWord(selectionRange.startOffset,this._completionStopCharacters,this._element,"backward");this._waitingForCompletions=true;this._loadCompletions((this._proxyElement),this.text(),selectionRange.startOffset,wordPrefixRange,force||false,this._completionsReady.bind(this,selection,wordPrefixRange,!!reverse,!!force));},disableDefaultSuggestionForEmptyInput:function()
{this._disableDefaultSuggestionForEmptyInput=true;},_boxForAnchorAtStart:function(selection,textRange)
{var rangeCopy=selection.getRangeAt(0).cloneRange();var anchorElement=createElement("span");anchorElement.textContent="\u200B";textRange.insertNode(anchorElement);var box=anchorElement.boxInWindow(window);anchorElement.remove();selection.removeAllRanges();selection.addRange(rangeCopy);return box;},_buildCommonPrefix:function(completions,wordPrefixLength)
{var commonPrefix=completions[0];for(var i=0;i<completions.length;++i){var completion=completions[i];var lastIndex=Math.min(commonPrefix.length,completion.length);for(var j=wordPrefixLength;j<lastIndex;++j){if(commonPrefix[j]!==completion[j]){commonPrefix=commonPrefix.substr(0,j);break;}}}
return commonPrefix;},_createRange:function()
{return document.createRange();},additionalCompletions:function(prefix)
{return[];},_completionsReady:function(selection,originalWordPrefixRange,reverse,force,completions,selectedIndex)
{var prefix=originalWordPrefixRange.toString();if(prefix||force){if(prefix)
completions=completions.concat(this.additionalCompletions(prefix));else
completions=this.additionalCompletions(prefix).concat(completions);}
var store=new Set();completions=completions.filter(item=>!store.has(item)&&!!store.add(item));if(!this._waitingForCompletions||!completions.length){this.hideSuggestBox();return;}
delete this._waitingForCompletions;var selectionRange=selection.getRangeAt(0);var fullWordRange=this._createRange();fullWordRange.setStart(originalWordPrefixRange.startContainer,originalWordPrefixRange.startOffset);fullWordRange.setEnd(selectionRange.endContainer,selectionRange.endOffset);if(prefix+selectionRange.toString()!==fullWordRange.toString())
return;selectedIndex=(this._disableDefaultSuggestionForEmptyInput&&!this.text())?-1:(selectedIndex||0);this._userEnteredRange=fullWordRange;this._userEnteredText=fullWordRange.toString();if(this._suggestBox)
this._suggestBox.updateSuggestions(this._boxForAnchorAtStart(selection,fullWordRange),completions,selectedIndex,!this.isCaretAtEndOfPrompt(),this._userEnteredText);if(selectedIndex===-1)
return;var wordPrefixLength=originalWordPrefixRange.toString().length;this._commonPrefix=this._buildCommonPrefix(completions,wordPrefixLength);if(this.isCaretAtEndOfPrompt()){var completionText=completions[selectedIndex];var prefixText=this._userEnteredRange.toString();var suffixText=completionText.substring(wordPrefixLength);this._userEnteredRange.deleteContents();this._element.normalize();var finalSelectionRange=this._createRange();var prefixTextNode=createTextNode(prefixText);fullWordRange.insertNode(prefixTextNode);this.autoCompleteElement=createElementWithClass("span","auto-complete-text");this.autoCompleteElement.textContent=suffixText;prefixTextNode.parentNode.insertBefore(this.autoCompleteElement,prefixTextNode.nextSibling);finalSelectionRange.setStart(prefixTextNode,wordPrefixLength);finalSelectionRange.setEnd(prefixTextNode,wordPrefixLength);selection.removeAllRanges();selection.addRange(finalSelectionRange);this.dispatchEventToListeners(WebInspector.TextPrompt.Events.ItemApplied);}},_completeCommonPrefix:function()
{if(!this.autoCompleteElement||!this._commonPrefix||!this._userEnteredText||!this._commonPrefix.startsWith(this._userEnteredText))
return;if(!this.isSuggestBoxVisible()){this.acceptAutoComplete();return;}
this.autoCompleteElement.textContent=this._commonPrefix.substring(this._userEnteredText.length);this._acceptSuggestionInternal(true);},applySuggestion:function(completionText,isIntermediateSuggestion)
{this._applySuggestion(completionText,isIntermediateSuggestion);},_applySuggestion:function(completionText,isIntermediateSuggestion)
{var wordPrefixLength=this._userEnteredText?this._userEnteredText.length:0;this._userEnteredRange.deleteContents();this._element.normalize();var finalSelectionRange=this._createRange();var completionTextNode=createTextNode(completionText);this._userEnteredRange.insertNode(completionTextNode);if(this.autoCompleteElement){this.autoCompleteElement.remove();delete this.autoCompleteElement;}
if(isIntermediateSuggestion)
finalSelectionRange.setStart(completionTextNode,wordPrefixLength);else
finalSelectionRange.setStart(completionTextNode,completionText.length);finalSelectionRange.setEnd(completionTextNode,completionText.length);var selection=this._element.getComponentSelection();selection.removeAllRanges();selection.addRange(finalSelectionRange);if(isIntermediateSuggestion)
this.dispatchEventToListeners(WebInspector.TextPrompt.Events.ItemApplied,{itemText:completionText});},acceptSuggestion:function()
{this._acceptSuggestionInternal();},_acceptSuggestionInternal:function(prefixAccepted)
{if(!this.autoCompleteElement||!this.autoCompleteElement.parentNode)
return false;var text=this.autoCompleteElement.textContent;var textNode=createTextNode(text);this.autoCompleteElement.parentNode.replaceChild(textNode,this.autoCompleteElement);delete this.autoCompleteElement;var finalSelectionRange=this._createRange();finalSelectionRange.setStart(textNode,text.length);finalSelectionRange.setEnd(textNode,text.length);var selection=this._element.getComponentSelection();selection.removeAllRanges();selection.addRange(finalSelectionRange);if(!prefixAccepted){this.hideSuggestBox();this.dispatchEventToListeners(WebInspector.TextPrompt.Events.ItemAccepted);}else
this.autoCompleteSoon(true);return true;},hideSuggestBox:function()
{if(this.isSuggestBoxVisible())
this._suggestBox.hide();},isSuggestBoxVisible:function()
{return this._suggestBox&&this._suggestBox.visible();},isCaretInsidePrompt:function()
{return this._element.isInsertionCaretInside();},isCaretAtEndOfPrompt:function()
{var selection=this._element.getComponentSelection();if(!selection.rangeCount||!selection.isCollapsed)
return false;var selectionRange=selection.getRangeAt(0);var node=selectionRange.startContainer;if(!node.isSelfOrDescendant(this._element))
return false;if(node.nodeType===Node.TEXT_NODE&&selectionRange.startOffset<node.nodeValue.length)
return false;var foundNextText=false;while(node){if(node.nodeType===Node.TEXT_NODE&&node.nodeValue.length){if(foundNextText&&(!this.autoCompleteElement||!this.autoCompleteElement.isAncestor(node)))
return false;foundNextText=true;}
node=node.traverseNextNode(this._element);}
return true;},isCaretOnFirstLine:function()
{var selection=this._element.getComponentSelection();var focusNode=selection.focusNode;if(!focusNode||focusNode.nodeType!==Node.TEXT_NODE||focusNode.parentNode!==this._element)
return true;if(focusNode.textContent.substring(0,selection.focusOffset).indexOf("\n")!==-1)
return false;focusNode=focusNode.previousSibling;while(focusNode){if(focusNode.nodeType!==Node.TEXT_NODE)
return true;if(focusNode.textContent.indexOf("\n")!==-1)
return false;focusNode=focusNode.previousSibling;}
return true;},isCaretOnLastLine:function()
{var selection=this._element.getComponentSelection();var focusNode=selection.focusNode;if(!focusNode||focusNode.nodeType!==Node.TEXT_NODE||focusNode.parentNode!==this._element)
return true;if(focusNode.textContent.substring(selection.focusOffset).indexOf("\n")!==-1)
return false;focusNode=focusNode.nextSibling;while(focusNode){if(focusNode.nodeType!==Node.TEXT_NODE)
return true;if(focusNode.textContent.indexOf("\n")!==-1)
return false;focusNode=focusNode.nextSibling;}
return true;},moveCaretToEndOfPrompt:function()
{var selection=this._element.getComponentSelection();var selectionRange=this._createRange();var container=this._element;while(container.childNodes.length)
container=container.lastChild;var offset=container.nodeType===Node.TEXT_NODE?container.textContent.length:0;selectionRange.setStart(container,offset);selectionRange.setEnd(container,offset);selection.removeAllRanges();selection.addRange(selectionRange);},tabKeyPressed:function(event)
{this._completeCommonPrefix();return true;},proxyElementForTests:function()
{return this._proxyElement||null;},__proto__:WebInspector.Object.prototype}
WebInspector.TextPromptWithHistory=function(completions,stopCharacters)
{WebInspector.TextPrompt.call(this,completions,stopCharacters);this._data=[];this._historyOffset=1;}
WebInspector.TextPromptWithHistory.prototype={historyData:function()
{return this._data;},additionalCompletions:function(prefix)
{if(!this.isCaretAtEndOfPrompt())
return[];var result=[];var text=this.text();for(var i=this._data.length-1;i>=0&&result.length<50;--i){var item=this._data[i];if(!item.startsWith(text))
continue;result.push(item.substring(text.length-prefix.length));}
return result;},setHistoryData:function(data)
{this._data=[].concat(data);this._historyOffset=1;},pushHistoryItem:function(text)
{if(this._uncommittedIsTop){this._data.pop();delete this._uncommittedIsTop;}
this._historyOffset=1;if(text===this._currentHistoryItem())
return;this._data.push(text);},_pushCurrentText:function()
{if(this._uncommittedIsTop)
this._data.pop();this._uncommittedIsTop=true;this.clearAutoComplete(true);this._data.push(this.text());},_previous:function()
{if(this._historyOffset>this._data.length)
return undefined;if(this._historyOffset===1)
this._pushCurrentText();++this._historyOffset;return this._currentHistoryItem();},_next:function()
{if(this._historyOffset===1)
return undefined;--this._historyOffset;return this._currentHistoryItem();},_currentHistoryItem:function()
{return this._data[this._data.length-this._historyOffset];},onKeyDown:function(event)
{var newText;var isPrevious;switch(event.keyIdentifier){case"Up":if(!this.isCaretOnFirstLine()||this.isSuggestBoxVisible())
break;newText=this._previous();isPrevious=true;break;case"Down":if(!this.isCaretOnLastLine()||this.isSuggestBoxVisible())
break;newText=this._next();break;case"U+0050":if(WebInspector.isMac()&&event.ctrlKey&&!event.metaKey&&!event.altKey&&!event.shiftKey){newText=this._previous();isPrevious=true;}
break;case"U+004E":if(WebInspector.isMac()&&event.ctrlKey&&!event.metaKey&&!event.altKey&&!event.shiftKey)
newText=this._next();break;}
if(newText!==undefined){event.consume(true);this.setText(newText);if(isPrevious){var firstNewlineIndex=this.text().indexOf("\n");if(firstNewlineIndex===-1)
this.moveCaretToEndOfPrompt();else{var selection=this._element.getComponentSelection();var selectionRange=this._createRange();selectionRange.setStart(this._element.firstChild,firstNewlineIndex);selectionRange.setEnd(this._element.firstChild,firstNewlineIndex);selection.removeAllRanges();selection.addRange(selectionRange);}}
return;}
WebInspector.TextPrompt.prototype.onKeyDown.apply(this,arguments);},__proto__:WebInspector.TextPrompt.prototype};WebInspector.highlightedSearchResultClassName="highlighted-search-result";WebInspector.installDragHandle=function(element,elementDragStart,elementDrag,elementDragEnd,cursor,hoverCursor,startDelay)
{function onMouseDown(event)
{var dragStart=WebInspector.elementDragStart.bind(WebInspector,element,elementDragStart,elementDrag,elementDragEnd,cursor,event);if(!startDelay)
dragStart();startTimer=setTimeout(dragStart,startDelay||0);}
function onMouseUp()
{if(startTimer)
clearInterval(startTimer);startTimer=null;}
var startTimer;element.addEventListener("mousedown",onMouseDown,false);if(startDelay)
element.addEventListener("mouseup",onMouseUp,false);if(hoverCursor!==null)
element.style.cursor=hoverCursor||cursor;}
WebInspector.elementDragStart=function(targetElement,elementDragStart,elementDrag,elementDragEnd,cursor,event)
{if(event.button||(WebInspector.isMac()&&event.ctrlKey))
return;if(WebInspector._elementDraggingEventListener)
return;if(elementDragStart&&!elementDragStart((event)))
return;if(WebInspector._elementDraggingGlassPane){WebInspector._elementDraggingGlassPane.dispose();delete WebInspector._elementDraggingGlassPane;}
var targetDocument=event.target.ownerDocument;WebInspector._elementDraggingEventListener=elementDrag;WebInspector._elementEndDraggingEventListener=elementDragEnd;WebInspector._mouseOutWhileDraggingTargetDocument=targetDocument;WebInspector._dragEventsTargetDocument=targetDocument;WebInspector._dragEventsTargetDocumentTop=targetDocument.defaultView.top.document;targetDocument.addEventListener("mousemove",WebInspector._elementDragMove,true);targetDocument.addEventListener("mouseup",WebInspector._elementDragEnd,true);targetDocument.addEventListener("mouseout",WebInspector._mouseOutWhileDragging,true);if(targetDocument!==WebInspector._dragEventsTargetDocumentTop)
WebInspector._dragEventsTargetDocumentTop.addEventListener("mouseup",WebInspector._elementDragEnd,true);if(typeof cursor==="string"){WebInspector._restoreCursorAfterDrag=restoreCursor.bind(null,targetElement.style.cursor);targetElement.style.cursor=cursor;targetDocument.body.style.cursor=cursor;}
function restoreCursor(oldCursor)
{targetDocument.body.style.removeProperty("cursor");targetElement.style.cursor=oldCursor;WebInspector._restoreCursorAfterDrag=null;}
event.preventDefault();}
WebInspector._mouseOutWhileDragging=function()
{var document=WebInspector._mouseOutWhileDraggingTargetDocument;WebInspector._unregisterMouseOutWhileDragging();WebInspector._elementDraggingGlassPane=new WebInspector.GlassPane(document);}
WebInspector._unregisterMouseOutWhileDragging=function()
{if(!WebInspector._mouseOutWhileDraggingTargetDocument)
return;WebInspector._mouseOutWhileDraggingTargetDocument.removeEventListener("mouseout",WebInspector._mouseOutWhileDragging,true);delete WebInspector._mouseOutWhileDraggingTargetDocument;}
WebInspector._unregisterDragEvents=function()
{if(!WebInspector._dragEventsTargetDocument)
return;WebInspector._dragEventsTargetDocument.removeEventListener("mousemove",WebInspector._elementDragMove,true);WebInspector._dragEventsTargetDocument.removeEventListener("mouseup",WebInspector._elementDragEnd,true);if(WebInspector._dragEventsTargetDocument!==WebInspector._dragEventsTargetDocumentTop)
WebInspector._dragEventsTargetDocumentTop.removeEventListener("mouseup",WebInspector._elementDragEnd,true);delete WebInspector._dragEventsTargetDocument;delete WebInspector._dragEventsTargetDocumentTop;}
WebInspector._elementDragMove=function(event)
{if(event.buttons!==1){WebInspector._elementDragEnd(event);return;}
if(WebInspector._elementDraggingEventListener((event)))
WebInspector._cancelDragEvents(event);}
WebInspector._cancelDragEvents=function(event)
{WebInspector._unregisterDragEvents();WebInspector._unregisterMouseOutWhileDragging();if(WebInspector._restoreCursorAfterDrag)
WebInspector._restoreCursorAfterDrag();if(WebInspector._elementDraggingGlassPane)
WebInspector._elementDraggingGlassPane.dispose();delete WebInspector._elementDraggingGlassPane;delete WebInspector._elementDraggingEventListener;delete WebInspector._elementEndDraggingEventListener;}
WebInspector._elementDragEnd=function(event)
{var elementDragEnd=WebInspector._elementEndDraggingEventListener;WebInspector._cancelDragEvents((event));event.preventDefault();if(elementDragEnd)
elementDragEnd((event));}
WebInspector.GlassPane=function(document,dimmed)
{this.element=createElement("div");var background=dimmed?"rgba(255, 255, 255, 0.5)":"transparent";this._zIndex=WebInspector._glassPane?WebInspector._glassPane._zIndex+1000:3000;this.element.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;background-color:"+background+";z-index:"+this._zIndex+";overflow:hidden;";document.body.appendChild(this.element);WebInspector._glassPane=this;}
WebInspector.GlassPane.prototype={dispose:function()
{delete WebInspector._glassPane;if(WebInspector.GlassPane.DefaultFocusedViewStack.length)
WebInspector.GlassPane.DefaultFocusedViewStack.peekLast().focus();this.element.remove();}}
WebInspector._glassPane;WebInspector.GlassPane.DefaultFocusedViewStack=[];WebInspector.isBeingEdited=function(node)
{if(!node||node.nodeType!==Node.ELEMENT_NODE)
return false;var element=(node);if(element.classList.contains("text-prompt")||element.nodeName==="INPUT"||element.nodeName==="TEXTAREA")
return true;if(!WebInspector.__editingCount)
return false;while(element){if(element.__editing)
return true;element=element.parentElementOrShadowHost();}
return false;}
WebInspector.isEditing=function()
{if(WebInspector.__editingCount)
return true;var element=WebInspector.currentFocusElement();if(!element)
return false;return element.classList.contains("text-prompt")||element.nodeName==="INPUT"||element.nodeName==="TEXTAREA";}
WebInspector.markBeingEdited=function(element,value)
{if(value){if(element.__editing)
return false;element.classList.add("being-edited");element.__editing=true;WebInspector.__editingCount=(WebInspector.__editingCount||0)+1;}else{if(!element.__editing)
return false;element.classList.remove("being-edited");delete element.__editing;--WebInspector.__editingCount;}
return true;}
WebInspector.CSSNumberRegex=/^(-?(?:\d+(?:\.\d+)?|\.\d+))$/;WebInspector.StyleValueDelimiters=" \xA0\t\n\"':;,/()";WebInspector._valueModificationDirection=function(event)
{var direction=null;if(event.type==="mousewheel"){if(event.wheelDeltaY>0)
direction="Up";else if(event.wheelDeltaY<0)
direction="Down";}else{if(event.keyIdentifier==="Up"||event.keyIdentifier==="PageUp")
direction="Up";else if(event.keyIdentifier==="Down"||event.keyIdentifier==="PageDown")
direction="Down";}
return direction;}
WebInspector._modifiedHexValue=function(hexString,event)
{var direction=WebInspector._valueModificationDirection(event);if(!direction)
return hexString;var number=parseInt(hexString,16);if(isNaN(number)||!isFinite(number))
return hexString;var maxValue=Math.pow(16,hexString.length)-1;var arrowKeyOrMouseWheelEvent=(event.keyIdentifier==="Up"||event.keyIdentifier==="Down"||event.type==="mousewheel");var delta;if(arrowKeyOrMouseWheelEvent)
delta=(direction==="Up")?1:-1;else
delta=(event.keyIdentifier==="PageUp")?16:-16;if(event.shiftKey)
delta*=16;var result=number+delta;if(result<0)
result=0;else if(result>maxValue)
return hexString;var resultString=result.toString(16).toUpperCase();for(var i=0,lengthDelta=hexString.length-resultString.length;i<lengthDelta;++i)
resultString="0"+resultString;return resultString;}
WebInspector._modifiedFloatNumber=function(number,event)
{var direction=WebInspector._valueModificationDirection(event);if(!direction)
return number;var arrowKeyOrMouseWheelEvent=(event.keyIdentifier==="Up"||event.keyIdentifier==="Down"||event.type==="mousewheel");var changeAmount=1;if(event.shiftKey&&!arrowKeyOrMouseWheelEvent)
changeAmount=100;else if(event.shiftKey||!arrowKeyOrMouseWheelEvent)
changeAmount=10;else if(event.altKey)
changeAmount=0.1;if(direction==="Down")
changeAmount*=-1;var result=Number((number+changeAmount).toFixed(6));if(!String(result).match(WebInspector.CSSNumberRegex))
return null;return result;}
WebInspector.createReplacementString=function(wordString,event,customNumberHandler)
{var replacementString;var prefix,suffix,number;var matches;matches=/(.*#)([\da-fA-F]+)(.*)/.exec(wordString);if(matches&&matches.length){prefix=matches[1];suffix=matches[3];number=WebInspector._modifiedHexValue(matches[2],event);replacementString=customNumberHandler?customNumberHandler(prefix,number,suffix):prefix+number+suffix;}else{matches=/(.*?)(-?(?:\d+(?:\.\d+)?|\.\d+))(.*)/.exec(wordString);if(matches&&matches.length){prefix=matches[1];suffix=matches[3];number=WebInspector._modifiedFloatNumber(parseFloat(matches[2]),event);if(number===null)
return null;replacementString=customNumberHandler?customNumberHandler(prefix,number,suffix):prefix+number+suffix;}}
return replacementString||null;}
WebInspector.handleElementValueModifications=function(event,element,finishHandler,suggestionHandler,customNumberHandler)
{function createRange()
{return document.createRange();}
var arrowKeyOrMouseWheelEvent=(event.keyIdentifier==="Up"||event.keyIdentifier==="Down"||event.type==="mousewheel");var pageKeyPressed=(event.keyIdentifier==="PageUp"||event.keyIdentifier==="PageDown");if(!arrowKeyOrMouseWheelEvent&&!pageKeyPressed)
return false;var selection=element.getComponentSelection();if(!selection.rangeCount)
return false;var selectionRange=selection.getRangeAt(0);if(!selectionRange.commonAncestorContainer.isSelfOrDescendant(element))
return false;var originalValue=element.textContent;var wordRange=selectionRange.startContainer.rangeOfWord(selectionRange.startOffset,WebInspector.StyleValueDelimiters,element);var wordString=wordRange.toString();if(suggestionHandler&&suggestionHandler(wordString))
return false;var replacementString=WebInspector.createReplacementString(wordString,event,customNumberHandler);if(replacementString){var replacementTextNode=createTextNode(replacementString);wordRange.deleteContents();wordRange.insertNode(replacementTextNode);var finalSelectionRange=createRange();finalSelectionRange.setStart(replacementTextNode,0);finalSelectionRange.setEnd(replacementTextNode,replacementString.length);selection.removeAllRanges();selection.addRange(finalSelectionRange);event.handled=true;event.preventDefault();if(finishHandler)
finishHandler(originalValue,replacementString);return true;}
return false;}
Number.preciseMillisToString=function(ms,precision)
{precision=precision||0;var format="%."+precision+"f\u2009ms";return WebInspector.UIString(format,ms);}
WebInspector._subMillisFormat=new WebInspector.UIStringFormat("%.2f\u2009ms");WebInspector._millisFormat=new WebInspector.UIStringFormat("%.0f\u2009ms");WebInspector._secondsFormat=new WebInspector.UIStringFormat("%.2f\u2009s");WebInspector._minutesFormat=new WebInspector.UIStringFormat("%.1f\u2009min");WebInspector._hoursFormat=new WebInspector.UIStringFormat("%.1f\u2009hrs");WebInspector._daysFormat=new WebInspector.UIStringFormat("%.1f\u2009days");Number.millisToString=function(ms,higherResolution)
{if(!isFinite(ms))
return"-";if(ms===0)
return"0";if(higherResolution&&ms<1000)
return WebInspector._subMillisFormat.format(ms);else if(ms<1000)
return WebInspector._millisFormat.format(ms);var seconds=ms/1000;if(seconds<60)
return WebInspector._secondsFormat.format(seconds);var minutes=seconds/60;if(minutes<60)
return WebInspector._minutesFormat.format(minutes);var hours=minutes/60;if(hours<24)
return WebInspector._hoursFormat.format(hours);var days=hours/24;return WebInspector._daysFormat.format(days);}
Number.secondsToString=function(seconds,higherResolution)
{if(!isFinite(seconds))
return"-";return Number.millisToString(seconds*1000,higherResolution);}
Number.bytesToString=function(bytes)
{if(bytes<1024)
return WebInspector.UIString("%.0f\u2009B",bytes);var kilobytes=bytes/1024;if(kilobytes<100)
return WebInspector.UIString("%.1f\u2009KB",kilobytes);if(kilobytes<1024)
return WebInspector.UIString("%.0f\u2009KB",kilobytes);var megabytes=kilobytes/1024;if(megabytes<100)
return WebInspector.UIString("%.1f\u2009MB",megabytes);else
return WebInspector.UIString("%.0f\u2009MB",megabytes);}
Number.withThousandsSeparator=function(num)
{var str=num+"";var re=/(\d+)(\d{3})/;while(str.match(re))
str=str.replace(re,"$1\u2009$2");return str;}
WebInspector.formatLocalized=function(format,substitutions)
{var formatters={s:substitution=>substitution};function append(a,b)
{a.appendChild(typeof b==="string"?createTextNode(b):b);return a;}
return String.format(WebInspector.UIString(format),substitutions,formatters,createElement("span"),append).formattedResult;}
WebInspector.openLinkExternallyLabel=function()
{return WebInspector.UIString.capitalize("Open ^link in ^new ^tab");}
WebInspector.copyLinkAddressLabel=function()
{return WebInspector.UIString.capitalize("Copy ^link ^address");}
WebInspector.anotherProfilerActiveLabel=function()
{return WebInspector.UIString("Another profiler is already active");}
WebInspector.asyncStackTraceLabel=function(description)
{if(description)
return description+" "+WebInspector.UIString("(async)");return WebInspector.UIString("Async Call");}
WebInspector.manageBlackboxingSettingsTabLabel=function()
{return WebInspector.UIString("Blackboxing");}
WebInspector.installComponentRootStyles=function(element)
{WebInspector.appendStyle(element,"ui/inspectorCommon.css");WebInspector.themeSupport.injectHighlightStyleSheets(element);element.classList.add("platform-"+WebInspector.platform());if(Runtime.experiments.isEnabled("materialDesign"))
element.classList.add("material");}
WebInspector.createShadowRootWithCoreStyles=function(element,cssFile)
{var shadowRoot=element.createShadowRoot();WebInspector.appendStyle(shadowRoot,"ui/inspectorCommon.css");WebInspector.themeSupport.injectHighlightStyleSheets(shadowRoot);if(cssFile)
WebInspector.appendStyle(shadowRoot,cssFile);shadowRoot.addEventListener("focus",WebInspector._focusChanged.bind(WebInspector),true);return shadowRoot;}
WebInspector._windowFocused=function(document,event)
{if(event.target.document.nodeType===Node.DOCUMENT_NODE)
document.body.classList.remove("inactive");}
WebInspector._windowBlurred=function(document,event)
{if(event.target.document.nodeType===Node.DOCUMENT_NODE)
document.body.classList.add("inactive");}
WebInspector.previousFocusElement=function()
{return WebInspector._previousFocusElement;}
WebInspector.currentFocusElement=function()
{return WebInspector._currentFocusElement;}
WebInspector._focusChanged=function(event)
{var node=event.deepActiveElement();WebInspector.setCurrentFocusElement(node);}
WebInspector._documentBlurred=function(document,event)
{if(!event.relatedTarget&&document.activeElement===document.body)
WebInspector.setCurrentFocusElement(null);}
WebInspector._textInputTypes=["text","search","tel","url","email","password"].keySet();WebInspector._isTextEditingElement=function(element)
{if(element instanceof HTMLInputElement)
return element.type in WebInspector._textInputTypes;if(element instanceof HTMLTextAreaElement)
return true;return false;}
WebInspector.setCurrentFocusElement=function(x)
{if(WebInspector._glassPane&&x&&!WebInspector._glassPane.element.isAncestor(x))
return;if(WebInspector._currentFocusElement!==x)
WebInspector._previousFocusElement=WebInspector._currentFocusElement;WebInspector._currentFocusElement=x;if(x){x.focus();var selection=x.getComponentSelection();if(!WebInspector._isTextEditingElement(x)&&selection.isCollapsed&&!x.isInsertionCaretInside()){var selectionRange=x.ownerDocument.createRange();selectionRange.setStart(x,0);selectionRange.setEnd(x,0);selection.removeAllRanges();selection.addRange(selectionRange);}}else if(WebInspector._previousFocusElement)
WebInspector._previousFocusElement.blur();}
WebInspector.restoreFocusFromElement=function(element)
{if(element&&element.isSelfOrAncestor(WebInspector.currentFocusElement()))
WebInspector.setCurrentFocusElement(WebInspector.previousFocusElement());}
WebInspector.highlightSearchResult=function(element,offset,length,domChanges)
{var result=WebInspector.highlightSearchResults(element,[new WebInspector.SourceRange(offset,length)],domChanges);return result.length?result[0]:null;}
WebInspector.highlightSearchResults=function(element,resultRanges,changes)
{return WebInspector.highlightRangesWithStyleClass(element,resultRanges,WebInspector.highlightedSearchResultClassName,changes);}
WebInspector.runCSSAnimationOnce=function(element,className)
{function animationEndCallback()
{element.classList.remove(className);element.removeEventListener("webkitAnimationEnd",animationEndCallback,false);}
if(element.classList.contains(className))
element.classList.remove(className);element.addEventListener("webkitAnimationEnd",animationEndCallback,false);element.classList.add(className);}
WebInspector.highlightRangesWithStyleClass=function(element,resultRanges,styleClass,changes)
{changes=changes||[];var highlightNodes=[];var textNodes=element.childTextNodes();var lineText=textNodes.map(function(node){return node.textContent;}).join("");var ownerDocument=element.ownerDocument;if(textNodes.length===0)
return highlightNodes;var nodeRanges=[];var rangeEndOffset=0;for(var i=0;i<textNodes.length;++i){var range={};range.offset=rangeEndOffset;range.length=textNodes[i].textContent.length;rangeEndOffset=range.offset+range.length;nodeRanges.push(range);}
var startIndex=0;for(var i=0;i<resultRanges.length;++i){var startOffset=resultRanges[i].offset;var endOffset=startOffset+resultRanges[i].length;while(startIndex<textNodes.length&&nodeRanges[startIndex].offset+nodeRanges[startIndex].length<=startOffset)
startIndex++;var endIndex=startIndex;while(endIndex<textNodes.length&&nodeRanges[endIndex].offset+nodeRanges[endIndex].length<endOffset)
endIndex++;if(endIndex===textNodes.length)
break;var highlightNode=ownerDocument.createElement("span");highlightNode.className=styleClass;highlightNode.textContent=lineText.substring(startOffset,endOffset);var lastTextNode=textNodes[endIndex];var lastText=lastTextNode.textContent;lastTextNode.textContent=lastText.substring(endOffset-nodeRanges[endIndex].offset);changes.push({node:lastTextNode,type:"changed",oldText:lastText,newText:lastTextNode.textContent});if(startIndex===endIndex){lastTextNode.parentElement.insertBefore(highlightNode,lastTextNode);changes.push({node:highlightNode,type:"added",nextSibling:lastTextNode,parent:lastTextNode.parentElement});highlightNodes.push(highlightNode);var prefixNode=ownerDocument.createTextNode(lastText.substring(0,startOffset-nodeRanges[startIndex].offset));lastTextNode.parentElement.insertBefore(prefixNode,highlightNode);changes.push({node:prefixNode,type:"added",nextSibling:highlightNode,parent:lastTextNode.parentElement});}else{var firstTextNode=textNodes[startIndex];var firstText=firstTextNode.textContent;var anchorElement=firstTextNode.nextSibling;firstTextNode.parentElement.insertBefore(highlightNode,anchorElement);changes.push({node:highlightNode,type:"added",nextSibling:anchorElement,parent:firstTextNode.parentElement});highlightNodes.push(highlightNode);firstTextNode.textContent=firstText.substring(0,startOffset-nodeRanges[startIndex].offset);changes.push({node:firstTextNode,type:"changed",oldText:firstText,newText:firstTextNode.textContent});for(var j=startIndex+1;j<endIndex;j++){var textNode=textNodes[j];var text=textNode.textContent;textNode.textContent="";changes.push({node:textNode,type:"changed",oldText:text,newText:textNode.textContent});}}
startIndex=endIndex;nodeRanges[startIndex].offset=endOffset;nodeRanges[startIndex].length=lastTextNode.textContent.length;}
return highlightNodes;}
WebInspector.applyDomChanges=function(domChanges)
{for(var i=0,size=domChanges.length;i<size;++i){var entry=domChanges[i];switch(entry.type){case"added":entry.parent.insertBefore(entry.node,entry.nextSibling);break;case"changed":entry.node.textContent=entry.newText;break;}}}
WebInspector.revertDomChanges=function(domChanges)
{for(var i=domChanges.length-1;i>=0;--i){var entry=domChanges[i];switch(entry.type){case"added":entry.node.remove();break;case"changed":entry.node.textContent=entry.oldText;break;}}}
WebInspector.measurePreferredSize=function(element,containerElement)
{containerElement=containerElement||element.ownerDocument.body;containerElement.appendChild(element);element.positionAt(0,0);var result=new Size(element.offsetWidth,element.offsetHeight);element.positionAt(undefined,undefined);element.remove();return result;}
WebInspector.InvokeOnceHandlers=function(autoInvoke)
{this._handlers=null;this._autoInvoke=autoInvoke;}
WebInspector.InvokeOnceHandlers.prototype={add:function(object,method)
{if(!this._handlers){this._handlers=new Map();if(this._autoInvoke)
this.scheduleInvoke();}
var methods=this._handlers.get(object);if(!methods){methods=new Set();this._handlers.set(object,methods);}
methods.add(method);},scheduleInvoke:function()
{if(this._handlers)
requestAnimationFrame(this._invoke.bind(this));},_invoke:function()
{var handlers=this._handlers;this._handlers=null;var keys=handlers.keysArray();for(var i=0;i<keys.length;++i){var object=keys[i];var methods=handlers.get(object).valuesArray();for(var j=0;j<methods.length;++j)
methods[j].call(object);}}}
WebInspector._coalescingLevel=0;WebInspector._postUpdateHandlers=null;WebInspector.startBatchUpdate=function()
{if(!WebInspector._coalescingLevel++)
WebInspector._postUpdateHandlers=new WebInspector.InvokeOnceHandlers(false);}
WebInspector.endBatchUpdate=function()
{if(--WebInspector._coalescingLevel)
return;WebInspector._postUpdateHandlers.scheduleInvoke();WebInspector._postUpdateHandlers=null;}
WebInspector.invokeOnceAfterBatchUpdate=function(object,method)
{if(!WebInspector._postUpdateHandlers)
WebInspector._postUpdateHandlers=new WebInspector.InvokeOnceHandlers(true);WebInspector._postUpdateHandlers.add(object,method);}
WebInspector.animateFunction=function(window,func,params,frames,animationComplete)
{var values=new Array(params.length);var deltas=new Array(params.length);for(var i=0;i<params.length;++i){values[i]=params[i].from;deltas[i]=(params[i].to-params[i].from)/frames;}
var raf=window.requestAnimationFrame(animationStep);var framesLeft=frames;function animationStep()
{if(--framesLeft<0){if(animationComplete)
animationComplete();return;}
for(var i=0;i<params.length;++i){if(params[i].to>params[i].from)
values[i]=Number.constrain(values[i]+deltas[i],params[i].from,params[i].to);else
values[i]=Number.constrain(values[i]+deltas[i],params[i].to,params[i].from);}
func.apply(null,values);raf=window.requestAnimationFrame(animationStep);}
function cancelAnimation()
{window.cancelAnimationFrame(raf);}
return cancelAnimation;}
WebInspector.LongClickController=function(element,callback)
{this._element=element;this._callback=callback;this._enable();}
WebInspector.LongClickController.prototype={reset:function()
{if(this._longClickInterval){clearInterval(this._longClickInterval);delete this._longClickInterval;}},_enable:function()
{if(this._longClickData)
return;var boundMouseDown=mouseDown.bind(this);var boundMouseUp=mouseUp.bind(this);var boundReset=this.reset.bind(this);this._element.addEventListener("mousedown",boundMouseDown,false);this._element.addEventListener("mouseout",boundReset,false);this._element.addEventListener("mouseup",boundMouseUp,false);this._element.addEventListener("click",boundReset,true);this._longClickData={mouseUp:boundMouseUp,mouseDown:boundMouseDown,reset:boundReset};function mouseDown(e)
{if(e.which!==1)
return;var callback=this._callback;this._longClickInterval=setTimeout(callback.bind(null,e),200);}
function mouseUp(e)
{if(e.which!==1)
return;this.reset();}},dispose:function()
{if(!this._longClickData)
return;this._element.removeEventListener("mousedown",this._longClickData.mouseDown,false);this._element.removeEventListener("mouseout",this._longClickData.reset,false);this._element.removeEventListener("mouseup",this._longClickData.mouseUp,false);this._element.addEventListener("click",this._longClickData.reset,true);delete this._longClickData;},__proto__:WebInspector.Object.prototype}
WebInspector.initializeUIUtils=function(document,themeSetting)
{document.defaultView.addEventListener("focus",WebInspector._windowFocused.bind(WebInspector,document),false);document.defaultView.addEventListener("blur",WebInspector._windowBlurred.bind(WebInspector,document),false);document.addEventListener("focus",WebInspector._focusChanged.bind(WebInspector),true);document.addEventListener("blur",WebInspector._documentBlurred.bind(WebInspector,document),true);if(!WebInspector.themeSupport)
WebInspector.themeSupport=new WebInspector.ThemeSupport(themeSetting);WebInspector.themeSupport.applyTheme(document);}
WebInspector.beautifyFunctionName=function(name)
{return name||WebInspector.UIString("(anonymous function)");}
function registerCustomElement(localName,typeExtension,prototype)
{return document.registerElement(typeExtension,{prototype:Object.create(prototype),extends:localName});}
function createTextButton(text,clickHandler,className,title)
{var element=createElementWithClass("button",className||"","text-button");element.textContent=text;if(clickHandler)
element.addEventListener("click",clickHandler,false);if(title)
element.title=title;return element;}
function createRadioLabel(name,title,checked)
{var element=createElement("label","dt-radio");element.radioElement.name=name;element.radioElement.checked=!!checked;element.createTextChild(title);return element;}
function createCheckboxLabel(title,checked)
{var element=createElement("label","dt-checkbox");element.checkboxElement.checked=!!checked;if(title!==undefined){element.textElement=element.createChild("div","dt-checkbox-text");element.textElement.textContent=title;}
return element;}
WebInspector.appendStyle=function(node,cssFile)
{var content=Runtime.cachedResources[cssFile]||"";if(!content)
console.error(cssFile+" not preloaded. Check module.json");var styleElement=createElement("style");styleElement.type="text/css";styleElement.textContent=content;node.appendChild(styleElement);var themeStyleSheet=WebInspector.themeSupport.themeStyleSheet(cssFile,content);if(themeStyleSheet){styleElement=createElement("style");styleElement.type="text/css";styleElement.textContent=themeStyleSheet+"\n"+Runtime.resolveSourceURL(cssFile+".theme");node.appendChild(styleElement);}};(function(){registerCustomElement("button","text-button",{createdCallback:function()
{this.type="button";var root=WebInspector.createShadowRootWithCoreStyles(this,"ui/textButton.css");root.createChild("content");},__proto__:HTMLButtonElement.prototype});registerCustomElement("label","dt-radio",{createdCallback:function()
{this.radioElement=this.createChild("input","dt-radio-button");this.radioElement.type="radio";var root=WebInspector.createShadowRootWithCoreStyles(this,"ui/radioButton.css");root.createChild("content").select=".dt-radio-button";root.createChild("content");this.addEventListener("click",radioClickHandler,false);},__proto__:HTMLLabelElement.prototype});function radioClickHandler(event)
{if(this.radioElement.checked||this.radioElement.disabled)
return;this.radioElement.checked=true;this.radioElement.dispatchEvent(new Event("change"));}
registerCustomElement("label","dt-checkbox",{createdCallback:function()
{this._root=WebInspector.createShadowRootWithCoreStyles(this,"ui/checkboxTextLabel.css");var checkboxElement=createElementWithClass("input","dt-checkbox-button");checkboxElement.type="checkbox";this._root.appendChild(checkboxElement);this.checkboxElement=checkboxElement;this.addEventListener("click",toggleCheckbox.bind(this));function toggleCheckbox(event)
{if(event.target!==checkboxElement&&event.target!==this){event.consume();checkboxElement.click();}}
this._root.createChild("content");},set backgroundColor(color)
{this.checkboxElement.classList.add("dt-checkbox-themed");this.checkboxElement.style.backgroundColor=color;},set checkColor(color)
{this.checkboxElement.classList.add("dt-checkbox-themed");var stylesheet=createElement("style");stylesheet.textContent="input.dt-checkbox-themed:checked:after { background-color: "+color+"}";this._root.appendChild(stylesheet);},set borderColor(color)
{this.checkboxElement.classList.add("dt-checkbox-themed");this.checkboxElement.style.borderColor=color;},__proto__:HTMLLabelElement.prototype});registerCustomElement("label","dt-icon-label",{createdCallback:function()
{var root=WebInspector.createShadowRootWithCoreStyles(this,"ui/smallIcon.css");this._iconElement=root.createChild("div");root.createChild("content");},set type(type)
{this._iconElement.className=type;},__proto__:HTMLLabelElement.prototype});registerCustomElement("div","dt-close-button",{createdCallback:function()
{var root=WebInspector.createShadowRootWithCoreStyles(this,"ui/closeButton.css");this._buttonElement=root.createChild("div","close-button");},set gray(gray)
{this._buttonElement.className=gray?"close-button-gray":"close-button";},__proto__:HTMLDivElement.prototype});})();WebInspector.StringFormatter=function()
{this._processors=[];this._regexes=[];}
WebInspector.StringFormatter.prototype={addProcessor:function(regex,handler)
{this._regexes.push(regex);this._processors.push(handler);},formatText:function(text)
{return this._runProcessor(0,text);},_runProcessor:function(processorIndex,text)
{if(processorIndex>=this._processors.length)
return createTextNode(text);var container=createDocumentFragment();var regex=this._regexes[processorIndex];var processor=this._processors[processorIndex];var items=text.replace(regex,"\0$1\0").split("\0");for(var i=0;i<items.length;++i){var processedNode=i%2?processor(items[i]):this._runProcessor(processorIndex+1,items[i]);container.appendChild(processedNode);}
return container;}}
WebInspector.ThemeSupport=function(setting)
{this._themeName=setting.get()||"default";this._themableProperties=new Set(["color","box-shadow","text-shadow","outline-color","background-image","background-color","border-left-color","border-right-color","border-top-color","border-bottom-color","-webkit-border-image"]);this._cachedThemePatches=new Map();this._setting=setting;}
WebInspector.ThemeSupport.prototype={hasTheme:function()
{return this._themeName!=="default";},injectHighlightStyleSheets:function(element)
{this._injectingStyleSheet=true;WebInspector.appendStyle(element,"ui/inspectorSyntaxHighlight.css");if(this._themeName==="dark")
WebInspector.appendStyle(element,"ui/inspectorSyntaxHighlightDark.css");this._injectingStyleSheet=false;},applyTheme:function(document)
{if(!this.hasTheme())
return;if(this._themeName==="dark")
document.body.classList.add("-theme-with-dark-background");var styleSheets=document.styleSheets;var result=[];for(var i=0;i<styleSheets.length;++i)
result.push(this._patchForTheme(styleSheets[i].href,styleSheets[i]));result.push("/*# sourceURL=inspector.css.theme */");var styleElement=createElement("style");styleElement.type="text/css";styleElement.textContent=result.join("\n");document.head.appendChild(styleElement);},themeStyleSheet:function(id,text)
{if(!this.hasTheme()||this._injectingStyleSheet)
return"";var patch=this._cachedThemePatches.get(id);if(!patch){var styleElement=createElement("style");styleElement.type="text/css";styleElement.textContent=text;document.body.appendChild(styleElement);patch=this._patchForTheme(id,styleElement.sheet);document.body.removeChild(styleElement);}
return patch;},_patchForTheme:function(id,styleSheet)
{var cached=this._cachedThemePatches.get(id);if(cached)
return cached;try{var rules=styleSheet.cssRules;var result=[];for(var j=0;j<rules.length;++j){if(rules[j]instanceof CSSImportRule){result.push(this._patchForTheme(rules[j].styleSheet.href,rules[j].styleSheet));continue;}
var output=[];var style=rules[j].style;var selectorText=rules[j].selectorText;for(var i=0;style&&i<style.length;++i)
this._patchProperty(selectorText,style,style[i],output);if(output.length)
result.push(rules[j].selectorText+"{"+output.join("")+"}");}
var fullText=result.join("\n");this._cachedThemePatches.set(id,fullText);return fullText;}catch(e){this._setting.set("default");return"";}},_patchProperty:function(selectorText,style,name,output)
{if(!this._themableProperties.has(name))
return;var value=style.getPropertyValue(name);if(!value||value==="none"||value==="inherit"||value==="initial"||value==="transparent")
return;if(name==="background-image"&&value.indexOf("gradient")===-1)
return;var isSelection=selectorText.indexOf(".-theme-selection-color")!==-1;if(selectorText.indexOf("-theme-")!==-1&&!isSelection)
return;if(name==="-webkit-border-image"){output.push("-webkit-filter: invert(100%)");return;}
isSelection=isSelection||selectorText.indexOf("selected")!==-1||selectorText.indexOf(".selection")!==-1;var isBackground=name.indexOf("background")===0||name.indexOf("border")===0;var isForeground=name.indexOf("background")===-1;var colorRegex=/((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?!-))/g;output.push(name);output.push(":");var items=value.replace(colorRegex,"\0$1\0").split("\0");for(var i=0;i<items.length;++i)
output.push(this._patchColor(items[i],isSelection,isBackground,isForeground));if(style.getPropertyPriority(name))
output.push(" !important");output.push(";");},_patchColor:function(text,isSelection,isBackground,isForeground)
{var color=WebInspector.Color.parse(text);if(!color)
return text;var hsla=color.hsla();this._patchHSLA(hsla,isSelection,isBackground,isForeground);var rgba=[];WebInspector.Color.hsl2rgb(hsla,rgba);var outColor=new WebInspector.Color(rgba,color.format());var outText=outColor.asString(null);if(!outText)
outText=outColor.asString(outColor.hasAlpha()?WebInspector.Color.Format.RGBA:WebInspector.Color.Format.RGB);return outText||text;},_patchHSLA:function(hsla,isSelection,isBackground,isForeground)
{var hue=hsla[0];var sat=hsla[1];var lit=hsla[2];var alpha=hsla[3]
switch(this._themeName){case"dark":if(isSelection)
hue=(hue+0.5)%1;var minCap=isBackground?0.14:0;var maxCap=isForeground?0.9:1;lit=1-lit;if(lit<minCap*2)
lit=minCap+lit/2;else if(lit>2*maxCap-1)
lit=maxCap-1/2+lit/2;break;}
hsla[0]=Number.constrain(hue,0,1);hsla[1]=Number.constrain(sat,0,1);hsla[2]=Number.constrain(lit,0,1);hsla[3]=Number.constrain(alpha,0,1);}}
WebInspector.uiLabelForPriority=function(priority)
{var labelMap=WebInspector.uiLabelForPriority._priorityToUILabel;if(!labelMap){labelMap=new Map([[NetworkAgent.ResourcePriority.VeryLow,WebInspector.UIString("Lowest")],[NetworkAgent.ResourcePriority.Low,WebInspector.UIString("Low")],[NetworkAgent.ResourcePriority.Medium,WebInspector.UIString("Medium")],[NetworkAgent.ResourcePriority.High,WebInspector.UIString("High")],[NetworkAgent.ResourcePriority.VeryHigh,WebInspector.UIString("Highest")]]);WebInspector.uiLabelForPriority._priorityToUILabel=labelMap;}
return labelMap.get(priority)||WebInspector.UIString("Unknown");}
WebInspector.themeSupport;;WebInspector.ViewportControl=function(provider)
{this.element=createElement("div");this.element.style.overflow="auto";this._topGapElement=this.element.createChild("div");this._topGapElement.textContent=".";this._topGapElement.style.height="0px";this._topGapElement.style.color="transparent";this._contentElement=this.element.createChild("div");this._bottomGapElement=this.element.createChild("div");this._bottomGapElement.textContent=".";this._bottomGapElement.style.height="0px";this._bottomGapElement.style.color="transparent";this._provider=provider;this.element.addEventListener("scroll",this._onScroll.bind(this),false);this.element.addEventListener("copy",this._onCopy.bind(this),false);this.element.addEventListener("dragstart",this._onDragStart.bind(this),false);this._firstVisibleIndex=0;this._lastVisibleIndex=-1;this._renderedItems=[];this._anchorSelection=null;this._headSelection=null;this._stickToBottom=false;this._scrolledToBottom=true;}
WebInspector.ViewportControl.Provider=function()
{}
WebInspector.ViewportControl.Provider.prototype={fastHeight:function(index){return 0;},itemCount:function(){return 0;},minimumRowHeight:function(){return 0;},itemElement:function(index){return null;}}
WebInspector.ViewportElement=function(){}
WebInspector.ViewportElement.prototype={willHide:function(){},wasShown:function(){},element:function(){},}
WebInspector.StaticViewportElement=function(element)
{this._element=element;}
WebInspector.StaticViewportElement.prototype={willHide:function(){},wasShown:function(){},element:function()
{return this._element;},}
WebInspector.ViewportControl.prototype={scrolledToBottom:function()
{return this._scrolledToBottom;},setStickToBottom:function(value)
{this._stickToBottom=value;},_onCopy:function(event)
{var text=this._selectedText();if(!text)
return;event.preventDefault();event.clipboardData.setData("text/plain",text);},_onDragStart:function(event)
{var text=this._selectedText();if(!text)
return false;event.dataTransfer.clearData();event.dataTransfer.setData("text/plain",text);event.dataTransfer.effectAllowed="copy";return true;},contentElement:function()
{return this._contentElement;},invalidate:function()
{delete this._cumulativeHeights;delete this._cachedProviderElements;this.refresh();},_providerElement:function(index)
{if(!this._cachedProviderElements)
this._cachedProviderElements=new Array(this._provider.itemCount());var element=this._cachedProviderElements[index];if(!element){element=this._provider.itemElement(index);this._cachedProviderElements[index]=element;}
return element;},_rebuildCumulativeHeightsIfNeeded:function()
{if(this._cumulativeHeights)
return;var itemCount=this._provider.itemCount();if(!itemCount)
return;var firstVisibleIndex=this._firstVisibleIndex;var lastVisibleIndex=this._lastVisibleIndex;var height=0;this._cumulativeHeights=new Int32Array(itemCount);for(var i=0;i<itemCount;++i){if(firstVisibleIndex<=i&&i<=lastVisibleIndex)
height+=this._renderedItems[i-firstVisibleIndex].element().offsetHeight;else
height+=this._provider.fastHeight(i);this._cumulativeHeights[i]=height;}},_cachedItemHeight:function(index)
{return index===0?this._cumulativeHeights[0]:this._cumulativeHeights[index]-this._cumulativeHeights[index-1];},_isSelectionBackwards:function(selection)
{if(!selection||!selection.rangeCount)
return false;var range=document.createRange();range.setStart(selection.anchorNode,selection.anchorOffset);range.setEnd(selection.focusNode,selection.focusOffset);return range.collapsed;},_createSelectionModel:function(itemIndex,node,offset)
{return{item:itemIndex,node:node,offset:offset};},_updateSelectionModel:function(selection)
{if(!selection||!selection.rangeCount||selection.isCollapsed){this._headSelection=null;this._anchorSelection=null;return false;}
var firstSelected=Number.MAX_VALUE;var lastSelected=-1;var range=selection.getRangeAt(0);var hasVisibleSelection=false;for(var i=0;i<this._renderedItems.length;++i){if(range.intersectsNode(this._renderedItems[i].element())){var index=i+this._firstVisibleIndex;firstSelected=Math.min(firstSelected,index);lastSelected=Math.max(lastSelected,index);hasVisibleSelection=true;}}
if(hasVisibleSelection){firstSelected=this._createSelectionModel(firstSelected,(range.startContainer),range.startOffset);lastSelected=this._createSelectionModel(lastSelected,(range.endContainer),range.endOffset);}
var topOverlap=range.intersectsNode(this._topGapElement)&&this._topGapElement._active;var bottomOverlap=range.intersectsNode(this._bottomGapElement)&&this._bottomGapElement._active;if(!topOverlap&&!bottomOverlap&&!hasVisibleSelection){this._headSelection=null;this._anchorSelection=null;return false;}
if(!this._anchorSelection||!this._headSelection){this._anchorSelection=this._createSelectionModel(0,this.element,0);this._headSelection=this._createSelectionModel(this._provider.itemCount()-1,this.element,this.element.children.length);this._selectionIsBackward=false;}
var isBackward=this._isSelectionBackwards(selection);var startSelection=this._selectionIsBackward?this._headSelection:this._anchorSelection;var endSelection=this._selectionIsBackward?this._anchorSelection:this._headSelection;if(topOverlap&&bottomOverlap&&hasVisibleSelection){firstSelected=firstSelected.item<startSelection.item?firstSelected:startSelection;lastSelected=lastSelected.item>endSelection.item?lastSelected:endSelection;}else if(!hasVisibleSelection){firstSelected=startSelection;lastSelected=endSelection;}else if(topOverlap)
firstSelected=isBackward?this._headSelection:this._anchorSelection;else if(bottomOverlap)
lastSelected=isBackward?this._anchorSelection:this._headSelection;if(isBackward){this._anchorSelection=lastSelected;this._headSelection=firstSelected;}else{this._anchorSelection=firstSelected;this._headSelection=lastSelected;}
this._selectionIsBackward=isBackward;return true;},_restoreSelection:function(selection)
{var anchorElement=null;var anchorOffset;if(this._firstVisibleIndex<=this._anchorSelection.item&&this._anchorSelection.item<=this._lastVisibleIndex){anchorElement=this._anchorSelection.node;anchorOffset=this._anchorSelection.offset;}else{if(this._anchorSelection.item<this._firstVisibleIndex)
anchorElement=this._topGapElement;else if(this._anchorSelection.item>this._lastVisibleIndex)
anchorElement=this._bottomGapElement;anchorOffset=this._selectionIsBackward?1:0;}
var headElement=null;var headOffset;if(this._firstVisibleIndex<=this._headSelection.item&&this._headSelection.item<=this._lastVisibleIndex){headElement=this._headSelection.node;headOffset=this._headSelection.offset;}else{if(this._headSelection.item<this._firstVisibleIndex)
headElement=this._topGapElement;else if(this._headSelection.item>this._lastVisibleIndex)
headElement=this._bottomGapElement;headOffset=this._selectionIsBackward?0:1;}
selection.setBaseAndExtent(anchorElement,anchorOffset,headElement,headOffset);},refresh:function()
{if(!this._visibleHeight())
return;var itemCount=this._provider.itemCount();if(!itemCount){for(var i=0;i<this._renderedItems.length;++i)
this._renderedItems[i].willHide();this._renderedItems=[];this._contentElement.removeChildren();this._topGapElement.style.height="0px";this._bottomGapElement.style.height="0px";this._firstVisibleIndex=-1;this._lastVisibleIndex=-1;return;}
var selection=this.element.getComponentSelection();var shouldRestoreSelection=this._updateSelectionModel(selection);var visibleFrom=this.element.scrollTop;var visibleHeight=this._visibleHeight();this._scrolledToBottom=this.element.isScrolledToBottom();var isInvalidating=!this._cumulativeHeights;if(this._cumulativeHeights&&itemCount!==this._cumulativeHeights.length)
delete this._cumulativeHeights;for(var i=0;i<this._renderedItems.length;++i){if(this._cumulativeHeights&&Math.abs(this._cachedItemHeight(this._firstVisibleIndex+i)-this._renderedItems[i].element().offsetHeight)>1)
delete this._cumulativeHeights;}
this._rebuildCumulativeHeightsIfNeeded();var oldFirstVisibleIndex=this._firstVisibleIndex;var oldLastVisibleIndex=this._lastVisibleIndex;var shouldStickToBottom=this._stickToBottom&&this._scrolledToBottom;if(shouldStickToBottom){this._lastVisibleIndex=itemCount-1;this._firstVisibleIndex=Math.max(itemCount-Math.ceil(visibleHeight/this._provider.minimumRowHeight()),0);}else{this._firstVisibleIndex=Math.max(Array.prototype.lowerBound.call(this._cumulativeHeights,visibleFrom+1),0);this._lastVisibleIndex=this._firstVisibleIndex+Math.ceil(visibleHeight/this._provider.minimumRowHeight())-1;this._lastVisibleIndex=Math.min(this._lastVisibleIndex,itemCount-1);}
var topGapHeight=this._cumulativeHeights[this._firstVisibleIndex-1]||0;var bottomGapHeight=this._cumulativeHeights[this._cumulativeHeights.length-1]-this._cumulativeHeights[this._lastVisibleIndex];function prepare()
{this._topGapElement.style.height=topGapHeight+"px";this._bottomGapElement.style.height=bottomGapHeight+"px";this._topGapElement._active=!!topGapHeight;this._bottomGapElement._active=!!bottomGapHeight;this._contentElement.style.setProperty("height","10000000px");}
if(isInvalidating)
this._fullViewportUpdate(prepare.bind(this));else
this._partialViewportUpdate(oldFirstVisibleIndex,oldLastVisibleIndex,prepare.bind(this));this._contentElement.style.removeProperty("height");if(shouldRestoreSelection)
this._restoreSelection(selection);if(shouldStickToBottom)
this.element.scrollTop=this.element.scrollHeight;},_fullViewportUpdate:function(prepare)
{for(var i=0;i<this._renderedItems.length;++i)
this._renderedItems[i].willHide();prepare();this._renderedItems=[];this._contentElement.removeChildren();for(var i=this._firstVisibleIndex;i<=this._lastVisibleIndex;++i){var viewportElement=this._providerElement(i);this._contentElement.appendChild(viewportElement.element());this._renderedItems.push(viewportElement);}
for(var i=0;i<this._renderedItems.length;++i)
this._renderedItems[i].wasShown();},_partialViewportUpdate:function(oldFirstVisibleIndex,oldLastVisibleIndex,prepare)
{var willBeHidden=[];for(var i=0;i<this._renderedItems.length;++i){var index=oldFirstVisibleIndex+i;if(index<this._firstVisibleIndex||this._lastVisibleIndex<index)
willBeHidden.push(this._renderedItems[i]);}
for(var i=0;i<willBeHidden.length;++i)
willBeHidden[i].willHide();prepare();for(var i=0;i<willBeHidden.length;++i)
willBeHidden[i].element().remove();this._renderedItems=[];var anchor=this._contentElement.firstChild;var wasShown=[];for(var i=this._firstVisibleIndex;i<=this._lastVisibleIndex;++i){var viewportElement=this._providerElement(i);var element=viewportElement.element();if(element!==anchor){this._contentElement.insertBefore(element,anchor);wasShown.push(viewportElement);}else{anchor=anchor.nextSibling;}
this._renderedItems.push(viewportElement);}
for(var i=0;i<wasShown.length;++i)
wasShown[i].wasShown();},_selectedText:function()
{this._updateSelectionModel(this.element.getComponentSelection());if(!this._headSelection||!this._anchorSelection)
return null;var startSelection=null;var endSelection=null;if(this._selectionIsBackward){startSelection=this._headSelection;endSelection=this._anchorSelection;}else{startSelection=this._anchorSelection;endSelection=this._headSelection;}
var textLines=[];for(var i=startSelection.item;i<=endSelection.item;++i)
textLines.push(this._providerElement(i).element().deepTextContent());var endSelectionElement=this._providerElement(endSelection.item).element();if(endSelection.node&&endSelection.node.isSelfOrDescendant(endSelectionElement)){var itemTextOffset=this._textOffsetInNode(endSelectionElement,endSelection.node,endSelection.offset);textLines[textLines.length-1]=textLines.peekLast().substring(0,itemTextOffset);}
var startSelectionElement=this._providerElement(startSelection.item).element();if(startSelection.node&&startSelection.node.isSelfOrDescendant(startSelectionElement)){var itemTextOffset=this._textOffsetInNode(startSelectionElement,startSelection.node,startSelection.offset);textLines[0]=textLines[0].substring(itemTextOffset);}
return textLines.join("\n");},_textOffsetInNode:function(itemElement,container,offset)
{var chars=0;var node=itemElement;while((node=node.traverseNextTextNode())&&node!==container)
chars+=node.textContent.length;return chars+offset;},_onScroll:function(event)
{this.refresh();},firstVisibleIndex:function()
{return this._firstVisibleIndex;},lastVisibleIndex:function()
{return this._lastVisibleIndex;},renderedElementAt:function(index)
{if(index<this._firstVisibleIndex)
return null;if(index>this._lastVisibleIndex)
return null;return this._renderedItems[index-this._firstVisibleIndex].element();},scrollItemIntoView:function(index,makeLast)
{if(index>this._firstVisibleIndex&&index<this._lastVisibleIndex)
return;if(makeLast)
this.forceScrollItemToBeLast(index);else if(index<=this._firstVisibleIndex)
this.forceScrollItemToBeFirst(index);else if(index>=this._lastVisibleIndex)
this.forceScrollItemToBeLast(index);},forceScrollItemToBeFirst:function(index)
{this._rebuildCumulativeHeightsIfNeeded();this.element.scrollTop=index>0?this._cumulativeHeights[index-1]:0;this.refresh();},forceScrollItemToBeLast:function(index)
{this._rebuildCumulativeHeightsIfNeeded();this.element.scrollTop=this._cumulativeHeights[index]-this._visibleHeight();this.refresh();},_visibleHeight:function()
{return this.element.offsetHeight;}};WebInspector.ZoomManager=function(window,frontendHost)
{this._frontendHost=frontendHost;this._zoomFactor=this._frontendHost.zoomFactor();window.addEventListener("resize",this._onWindowResize.bind(this),true);};WebInspector.ZoomManager.Events={ZoomChanged:"ZoomChanged"};WebInspector.ZoomManager.prototype={zoomFactor:function()
{return this._zoomFactor;},cssToDIP:function(value)
{return value*this._zoomFactor;},dipToCSS:function(valueDIP)
{return valueDIP/this._zoomFactor;},_onWindowResize:function()
{var oldZoomFactor=this._zoomFactor;this._zoomFactor=this._frontendHost.zoomFactor();if(oldZoomFactor!==this._zoomFactor)
this.dispatchEventToListeners(WebInspector.ZoomManager.Events.ZoomChanged,{from:oldZoomFactor,to:this._zoomFactor});},__proto__:WebInspector.Object.prototype};WebInspector.zoomManager;;WebInspector.ThrottledWidget=function()
{WebInspector.Widget.call(this);this._updateThrottler=new WebInspector.Throttler(100);this._updateWhenVisible=false;}
WebInspector.ThrottledWidget.prototype={doUpdate:function()
{return Promise.resolve();},update:function()
{this._updateWhenVisible=!this.isShowing();if(this._updateWhenVisible)
return;this._updateThrottler.schedule(innerUpdate.bind(this));function innerUpdate()
{if(this.isShowing()){return this.doUpdate();}else{this._updateWhenVisible=true;return Promise.resolve();}}},wasShown:function()
{WebInspector.Widget.prototype.wasShown.call(this);if(this._updateWhenVisible)
this.update();},__proto__:WebInspector.Widget.prototype};function InspectorBackendClass()
{this._agentPrototypes={};this._dispatcherPrototypes={};this._initialized=false;this._initProtocolAgentsConstructor();}
InspectorBackendClass._DevToolsErrorCode=-32000;InspectorBackendClass.DevToolsStubErrorCode=-32015;InspectorBackendClass.reportProtocolError=function(error,messageObject)
{console.error(error+": "+JSON.stringify(messageObject));}
InspectorBackendClass.prototype={isInitialized:function()
{return this._initialized;},_initProtocolAgentsConstructor:function()
{window.Protocol={};window.Protocol.Agents=function(agentsMap){this._agentsMap=agentsMap;};},_addAgentGetterMethodToProtocolAgentsPrototype:function(domain)
{var upperCaseLength=0;while(upperCaseLength<domain.length&&domain[upperCaseLength].toLowerCase()!==domain[upperCaseLength])
++upperCaseLength;var methodName=domain.substr(0,upperCaseLength).toLowerCase()+domain.slice(upperCaseLength)+"Agent";function agentGetter()
{return this._agentsMap[domain];}
window.Protocol.Agents.prototype[methodName]=agentGetter;function registerDispatcher(dispatcher)
{this.registerDispatcher(domain,dispatcher)}
window.Protocol.Agents.prototype["register"+domain+"Dispatcher"]=registerDispatcher;},_agentPrototype:function(domain)
{if(!this._agentPrototypes[domain]){this._agentPrototypes[domain]=new InspectorBackendClass.AgentPrototype(domain);this._addAgentGetterMethodToProtocolAgentsPrototype(domain);}
return this._agentPrototypes[domain];},_dispatcherPrototype:function(domain)
{if(!this._dispatcherPrototypes[domain])
this._dispatcherPrototypes[domain]=new InspectorBackendClass.DispatcherPrototype();return this._dispatcherPrototypes[domain];},registerCommand:function(method,signature,replyArgs,hasErrorData)
{var domainAndMethod=method.split(".");this._agentPrototype(domainAndMethod[0]).registerCommand(domainAndMethod[1],signature,replyArgs,hasErrorData);this._initialized=true;},registerEnum:function(type,values)
{var domainAndMethod=type.split(".");var agentName=domainAndMethod[0]+"Agent";if(!window[agentName])
window[agentName]={};window[agentName][domainAndMethod[1]]=values;this._initialized=true;},registerEvent:function(eventName,params)
{var domain=eventName.split(".")[0];this._dispatcherPrototype(domain).registerEvent(eventName,params);this._initialized=true;},wrapClientCallback:function(clientCallback,errorPrefix,constructor,defaultValue)
{function callbackWrapper(error,value)
{if(error){console.error(errorPrefix+error);clientCallback(defaultValue);return;}
if(constructor)
clientCallback(new constructor(value));else
clientCallback(value);}
return callbackWrapper;}}
InspectorBackendClass.Connection=function()
{this._lastMessageId=1;this._pendingResponsesCount=0;this._agents={};this._dispatchers={};this._callbacks={};this._initialize(InspectorBackend._agentPrototypes,InspectorBackend._dispatcherPrototypes);this._isConnected=true;}
InspectorBackendClass.Connection.Events={Disconnected:"Disconnected",}
InspectorBackendClass.Connection.prototype={_initialize:function(agentPrototypes,dispatcherPrototypes)
{for(var domain in agentPrototypes){this._agents[domain]=Object.create(agentPrototypes[domain]);this._agents[domain].setConnection(this);}
for(var domain in dispatcherPrototypes)
this._dispatchers[domain]=Object.create(dispatcherPrototypes[domain]);},nextMessageId:function()
{return this._lastMessageId++;},agent:function(domain)
{return this._agents[domain];},agentsMap:function()
{return this._agents;},_wrapCallbackAndSendMessageObject:function(domain,method,params,callback)
{if(!this._isConnected&&callback){this._dispatchConnectionErrorResponse(domain,method,callback);return;}
var messageObject={};var messageId=this.nextMessageId();messageObject.id=messageId;messageObject.method=method;if(params)
messageObject.params=params;var wrappedCallback=this._wrap(callback,domain,method);if(InspectorBackendClass.Options.dumpInspectorProtocolMessages)
this._dumpProtocolMessage("frontend: "+JSON.stringify(messageObject));this.sendMessage(messageObject);++this._pendingResponsesCount;this._callbacks[messageId]=wrappedCallback;},_wrap:function(callback,domain,method)
{if(!callback)
callback=function(){};callback.methodName=method;callback.domain=domain;if(InspectorBackendClass.Options.dumpInspectorTimeStats)
callback.sendRequestTime=Date.now();return callback;},sendMessage:function(messageObject)
{throw"Not implemented";},dispatch:function(message)
{if(InspectorBackendClass.Options.dumpInspectorProtocolMessages)
this._dumpProtocolMessage("backend: "+((typeof message==="string")?message:JSON.stringify(message)));var messageObject=((typeof message==="string")?JSON.parse(message):message);if("id"in messageObject){var callback=this._callbacks[messageObject.id];if(!callback){InspectorBackendClass.reportProtocolError("Protocol Error: the message with wrong id",messageObject);return;}
var processingStartTime;if(InspectorBackendClass.Options.dumpInspectorTimeStats)
processingStartTime=Date.now();this.agent(callback.domain).dispatchResponse(messageObject,callback.methodName,callback);--this._pendingResponsesCount;delete this._callbacks[messageObject.id];if(InspectorBackendClass.Options.dumpInspectorTimeStats)
console.log("time-stats: "+callback.methodName+" = "+(processingStartTime-callback.sendRequestTime)+" + "+(Date.now()-processingStartTime));if(this._scripts&&!this._pendingResponsesCount)
this.runAfterPendingDispatches();return;}else{var method=messageObject.method.split(".");var domainName=method[0];if(!(domainName in this._dispatchers)){InspectorBackendClass.reportProtocolError("Protocol Error: the message "+messageObject.method+" is for non-existing domain '"+domainName+"'",messageObject);return;}
this._dispatchers[domainName].dispatch(method[1],messageObject);}},registerDispatcher:function(domain,dispatcher)
{if(!this._dispatchers[domain])
return;this._dispatchers[domain].setDomainDispatcher(dispatcher);},runAfterPendingDispatches:function(script)
{if(!this._scripts)
this._scripts=[];if(script)
this._scripts.push(script);setTimeout(function(){if(!this._pendingResponsesCount)
this._executeAfterPendingDispatches();else
this.runAfterPendingDispatches();}.bind(this),0);},_executeAfterPendingDispatches:function()
{if(!this._pendingResponsesCount){var scripts=this._scripts;this._scripts=[];for(var id=0;id<scripts.length;++id)
scripts[id].call(this);}},_dumpProtocolMessage:function(message)
{console.log(message);},connectionClosed:function(reason)
{this._isConnected=false;this._runPendingCallbacks();this.dispatchEventToListeners(InspectorBackendClass.Connection.Events.Disconnected,{reason:reason});},_runPendingCallbacks:function()
{var keys=Object.keys(this._callbacks).map(function(num){return parseInt(num,10);});for(var i=0;i<keys.length;++i){var callback=this._callbacks[keys[i]];this._dispatchConnectionErrorResponse(callback.domain,callback.methodName,callback);}
this._callbacks={};},_dispatchConnectionErrorResponse:function(domain,methodName,callback)
{var error={message:"Connection is closed, can't dispatch pending "+methodName,code:InspectorBackendClass._DevToolsErrorCode,data:null};var messageObject={error:error};setTimeout(InspectorBackendClass.AgentPrototype.prototype.dispatchResponse.bind(this.agent(domain),messageObject,methodName,callback),0);},isClosed:function()
{return!this._isConnected;},suppressErrorsForDomains:function(domains)
{domains.forEach(function(domain){this._agents[domain].suppressErrorLogging();},this);},__proto__:WebInspector.Object.prototype}
InspectorBackendClass.AgentPrototype=function(domain)
{this._replyArgs={};this._hasErrorData={};this._domain=domain;this._suppressErrorLogging=false;}
InspectorBackendClass.AgentPrototype.prototype={setConnection:function(connection)
{this._connection=connection;},registerCommand:function(methodName,signature,replyArgs,hasErrorData)
{var domainAndMethod=this._domain+"."+methodName;function sendMessagePromise(vararg)
{var params=Array.prototype.slice.call(arguments);return InspectorBackendClass.AgentPrototype.prototype._sendMessageToBackendPromise.call(this,domainAndMethod,signature,params);}
this[methodName]=sendMessagePromise;function invoke(vararg)
{var params=[domainAndMethod].concat(Array.prototype.slice.call(arguments));InspectorBackendClass.AgentPrototype.prototype._invoke.apply(this,params);}
this["invoke_"+methodName]=invoke;this._replyArgs[domainAndMethod]=replyArgs;if(hasErrorData)
this._hasErrorData[domainAndMethod]=true;},_prepareParameters:function(method,signature,args,allowExtraUndefinedArg,errorCallback)
{var params={};var hasParams=false;for(var i=0;i<signature.length;++i){var param=signature[i];var paramName=param["name"];var typeName=param["type"];var optionalFlag=param["optional"];if(!args.length&&!optionalFlag){errorCallback("Protocol Error: Invalid number of arguments for method '"+method+"' call. It must have the following arguments '"+JSON.stringify(signature)+"'.");return null;}
var value=args.shift();if(optionalFlag&&typeof value==="undefined")
continue;if(typeof value!==typeName){errorCallback("Protocol Error: Invalid type of argument '"+paramName+"' for method '"+method+"' call. It must be '"+typeName+"' but it is '"+typeof value+"'.");return null;}
params[paramName]=value;hasParams=true;}
if(args.length===1&&(!allowExtraUndefinedArg||(typeof args[0]!=="undefined"))){errorCallback("Protocol Error: Optional callback argument for method '"+method+"' call must be a function but its type is '"+typeof args[0]+"'.");return null;}
if(args.length>1){errorCallback("Protocol Error: Extra "+args.length+" arguments in a call to method '"+method+"'.");return null;}
return hasParams?params:null},_sendMessageToBackendPromise:function(method,signature,args)
{var errorMessage;function onError(message)
{console.error(message);errorMessage=message;}
var userCallback=(args.length&&typeof args.peekLast()==="function")?args.pop():null;var params=this._prepareParameters(method,signature,args,!userCallback,onError);if(errorMessage)
return Promise.reject(new Error(errorMessage));else
return new Promise(promiseAction.bind(this));function promiseAction(resolve,reject)
{function callback(vararg)
{var result=userCallback?userCallback.apply(null,arguments):undefined;resolve(result);}
this._connection._wrapCallbackAndSendMessageObject(this._domain,method,params,callback);}},_invoke:function(method,args,callback)
{this._connection._wrapCallbackAndSendMessageObject(this._domain,method,args,callback);},dispatchResponse:function(messageObject,methodName,callback)
{if(messageObject.error&&messageObject.error.code!==InspectorBackendClass._DevToolsErrorCode&&messageObject.error.code!==InspectorBackendClass.DevToolsStubErrorCode&&!InspectorBackendClass.Options.suppressRequestErrors&&!this._suppressErrorLogging){var id=InspectorBackendClass.Options.dumpInspectorProtocolMessages?" with id = "+messageObject.id:"";console.error("Request "+methodName+id+" failed. "+JSON.stringify(messageObject.error));}
var argumentsArray=[];argumentsArray[0]=messageObject.error?messageObject.error.message:null;if(this._hasErrorData[methodName])
argumentsArray[1]=messageObject.error?messageObject.error.data:null;if(messageObject.result){var paramNames=this._replyArgs[methodName]||[];for(var i=0;i<paramNames.length;++i)
argumentsArray.push(messageObject.result[paramNames[i]]);}
callback.apply(null,argumentsArray);},suppressErrorLogging:function()
{this._suppressErrorLogging=true;}}
InspectorBackendClass.DispatcherPrototype=function()
{this._eventArgs={};this._dispatcher=null;}
InspectorBackendClass.DispatcherPrototype.prototype={registerEvent:function(eventName,params)
{this._eventArgs[eventName]=params;},setDomainDispatcher:function(dispatcher)
{this._dispatcher=dispatcher;},dispatch:function(functionName,messageObject)
{if(!this._dispatcher)
return;if(!(functionName in this._dispatcher)){InspectorBackendClass.reportProtocolError("Protocol Error: Attempted to dispatch an unimplemented method '"+messageObject.method+"'",messageObject);return;}
if(!this._eventArgs[messageObject.method]){InspectorBackendClass.reportProtocolError("Protocol Error: Attempted to dispatch an unspecified method '"+messageObject.method+"'",messageObject);return;}
var params=[];if(messageObject.params){var paramNames=this._eventArgs[messageObject.method];for(var i=0;i<paramNames.length;++i)
params.push(messageObject.params[paramNames[i]]);}
var processingStartTime;if(InspectorBackendClass.Options.dumpInspectorTimeStats)
processingStartTime=Date.now();this._dispatcher[functionName].apply(this._dispatcher,params);if(InspectorBackendClass.Options.dumpInspectorTimeStats)
console.log("time-stats: "+messageObject.method+" = "+(Date.now()-processingStartTime));}}
InspectorBackendClass.Options={dumpInspectorTimeStats:false,dumpInspectorProtocolMessages:false,suppressRequestErrors:false}
InspectorBackend=new InspectorBackendClass();;InspectorBackend.registerEvent("Inspector.evaluateForTestInFrontend",["testCallId","script"]);InspectorBackend.registerEvent("Inspector.inspect",["object","hints"]);InspectorBackend.registerEvent("Inspector.detached",["reason"]);InspectorBackend.registerEvent("Inspector.targetCrashed",[]);InspectorBackend.registerCommand("Inspector.enable",[],[],false);InspectorBackend.registerCommand("Inspector.disable",[],[],false);InspectorBackend.registerEnum("Memory.PressureLevel",{Moderate:"moderate",Critical:"critical"});InspectorBackend.registerCommand("Memory.getDOMCounters",[],["documents","nodes","jsEventListeners"],false);InspectorBackend.registerCommand("Memory.setPressureNotificationsSuppressed",[{"name":"suppressed","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Memory.simulatePressureNotification",[{"name":"level","type":"string","optional":false}],[],false);InspectorBackend.registerEnum("Page.ResourceType",{Document:"Document",Stylesheet:"Stylesheet",Image:"Image",Media:"Media",Font:"Font",Script:"Script",TextTrack:"TextTrack",XHR:"XHR",Fetch:"Fetch",EventSource:"EventSource",WebSocket:"WebSocket",Manifest:"Manifest",Other:"Other"});InspectorBackend.registerEnum("Page.DialogType",{Alert:"alert",Confirm:"confirm",Prompt:"prompt",Beforeunload:"beforeunload"});InspectorBackend.registerEvent("Page.domContentEventFired",["timestamp"]);InspectorBackend.registerEvent("Page.loadEventFired",["timestamp"]);InspectorBackend.registerEvent("Page.frameAttached",["frameId","parentFrameId"]);InspectorBackend.registerEvent("Page.frameNavigated",["frame"]);InspectorBackend.registerEvent("Page.frameDetached",["frameId"]);InspectorBackend.registerEvent("Page.frameStartedLoading",["frameId"]);InspectorBackend.registerEvent("Page.frameStoppedLoading",["frameId"]);InspectorBackend.registerEvent("Page.frameScheduledNavigation",["frameId","delay"]);InspectorBackend.registerEvent("Page.frameClearedScheduledNavigation",["frameId"]);InspectorBackend.registerEvent("Page.frameResized",[]);InspectorBackend.registerEvent("Page.javascriptDialogOpening",["message","type"]);InspectorBackend.registerEvent("Page.javascriptDialogClosed",["result"]);InspectorBackend.registerEvent("Page.screencastFrame",["data","metadata","sessionId"]);InspectorBackend.registerEvent("Page.screencastVisibilityChanged",["visible"]);InspectorBackend.registerEvent("Page.colorPicked",["color"]);InspectorBackend.registerEvent("Page.interstitialShown",[]);InspectorBackend.registerEvent("Page.interstitialHidden",[]);InspectorBackend.registerCommand("Page.enable",[],[],false);InspectorBackend.registerCommand("Page.disable",[],[],false);InspectorBackend.registerCommand("Page.addScriptToEvaluateOnLoad",[{"name":"scriptSource","type":"string","optional":false}],["identifier"],false);InspectorBackend.registerCommand("Page.removeScriptToEvaluateOnLoad",[{"name":"identifier","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Page.reload",[{"name":"ignoreCache","type":"boolean","optional":true},{"name":"scriptToEvaluateOnLoad","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("Page.navigate",[{"name":"url","type":"string","optional":false}],["frameId"],false);InspectorBackend.registerCommand("Page.getNavigationHistory",[],["currentIndex","entries"],false);InspectorBackend.registerCommand("Page.navigateToHistoryEntry",[{"name":"entryId","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Page.getCookies",[],["cookies"],false);InspectorBackend.registerCommand("Page.deleteCookie",[{"name":"cookieName","type":"string","optional":false},{"name":"url","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Page.getResourceTree",[],["frameTree"],false);InspectorBackend.registerCommand("Page.getResourceContent",[{"name":"frameId","type":"string","optional":false},{"name":"url","type":"string","optional":false}],["content","base64Encoded"],false);InspectorBackend.registerCommand("Page.searchInResource",[{"name":"frameId","type":"string","optional":false},{"name":"url","type":"string","optional":false},{"name":"query","type":"string","optional":false},{"name":"caseSensitive","type":"boolean","optional":true},{"name":"isRegex","type":"boolean","optional":true}],["result"],false);InspectorBackend.registerCommand("Page.setDocumentContent",[{"name":"frameId","type":"string","optional":false},{"name":"html","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Page.setDeviceMetricsOverride",[{"name":"width","type":"number","optional":false},{"name":"height","type":"number","optional":false},{"name":"deviceScaleFactor","type":"number","optional":false},{"name":"mobile","type":"boolean","optional":false},{"name":"fitWindow","type":"boolean","optional":false},{"name":"scale","type":"number","optional":true},{"name":"offsetX","type":"number","optional":true},{"name":"offsetY","type":"number","optional":true},{"name":"screenWidth","type":"number","optional":true},{"name":"screenHeight","type":"number","optional":true},{"name":"positionX","type":"number","optional":true},{"name":"positionY","type":"number","optional":true}],[],false);InspectorBackend.registerCommand("Page.clearDeviceMetricsOverride",[],[],false);InspectorBackend.registerCommand("Page.setGeolocationOverride",[{"name":"latitude","type":"number","optional":true},{"name":"longitude","type":"number","optional":true},{"name":"accuracy","type":"number","optional":true}],[],false);InspectorBackend.registerCommand("Page.clearGeolocationOverride",[],[],false);InspectorBackend.registerCommand("Page.setDeviceOrientationOverride",[{"name":"alpha","type":"number","optional":false},{"name":"beta","type":"number","optional":false},{"name":"gamma","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Page.clearDeviceOrientationOverride",[],[],false);InspectorBackend.registerCommand("Page.setTouchEmulationEnabled",[{"name":"enabled","type":"boolean","optional":false},{"name":"configuration","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("Page.captureScreenshot",[],["data"],false);InspectorBackend.registerCommand("Page.startScreencast",[{"name":"format","type":"string","optional":true},{"name":"quality","type":"number","optional":true},{"name":"maxWidth","type":"number","optional":true},{"name":"maxHeight","type":"number","optional":true},{"name":"everyNthFrame","type":"number","optional":true}],[],false);InspectorBackend.registerCommand("Page.stopScreencast",[],[],false);InspectorBackend.registerCommand("Page.screencastFrameAck",[{"name":"sessionId","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Page.handleJavaScriptDialog",[{"name":"accept","type":"boolean","optional":false},{"name":"promptText","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("Page.setColorPickerEnabled",[{"name":"enabled","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Page.setOverlayMessage",[{"name":"message","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("Rendering.setShowPaintRects",[{"name":"result","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Rendering.setShowDebugBorders",[{"name":"show","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Rendering.setShowFPSCounter",[{"name":"show","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Rendering.setShowScrollBottleneckRects",[{"name":"show","type":"boolean","optional":false}],[],false);InspectorBackend.registerEvent("Emulation.viewportChanged",["viewport"]);InspectorBackend.registerCommand("Emulation.setDeviceMetricsOverride",[{"name":"width","type":"number","optional":false},{"name":"height","type":"number","optional":false},{"name":"deviceScaleFactor","type":"number","optional":false},{"name":"mobile","type":"boolean","optional":false},{"name":"fitWindow","type":"boolean","optional":false},{"name":"scale","type":"number","optional":true},{"name":"offsetX","type":"number","optional":true},{"name":"offsetY","type":"number","optional":true},{"name":"screenWidth","type":"number","optional":true},{"name":"screenHeight","type":"number","optional":true},{"name":"positionX","type":"number","optional":true},{"name":"positionY","type":"number","optional":true}],[],false);InspectorBackend.registerCommand("Emulation.clearDeviceMetricsOverride",[],[],false);InspectorBackend.registerCommand("Emulation.resetScrollAndPageScaleFactor",[],[],false);InspectorBackend.registerCommand("Emulation.setPageScaleFactor",[{"name":"pageScaleFactor","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Emulation.setScriptExecutionDisabled",[{"name":"value","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Emulation.setGeolocationOverride",[{"name":"latitude","type":"number","optional":true},{"name":"longitude","type":"number","optional":true},{"name":"accuracy","type":"number","optional":true}],[],false);InspectorBackend.registerCommand("Emulation.clearGeolocationOverride",[],[],false);InspectorBackend.registerCommand("Emulation.setTouchEmulationEnabled",[{"name":"enabled","type":"boolean","optional":false},{"name":"configuration","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("Emulation.setEmulatedMedia",[{"name":"media","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Emulation.setCPUThrottlingRate",[{"name":"rate","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Emulation.canEmulate",[],["result"],false);InspectorBackend.registerEnum("Runtime.RemoteObjectType",{Object:"object",Function:"function",Undefined:"undefined",String:"string",Number:"number",Boolean:"boolean",Symbol:"symbol"});InspectorBackend.registerEnum("Runtime.RemoteObjectSubtype",{Array:"array",Null:"null",Node:"node",Regexp:"regexp",Date:"date",Map:"map",Set:"set",Iterator:"iterator",Generator:"generator",Error:"error"});InspectorBackend.registerEnum("Runtime.ObjectPreviewType",{Object:"object",Function:"function",Undefined:"undefined",String:"string",Number:"number",Boolean:"boolean",Symbol:"symbol"});InspectorBackend.registerEnum("Runtime.ObjectPreviewSubtype",{Array:"array",Null:"null",Node:"node",Regexp:"regexp",Date:"date",Map:"map",Set:"set",Iterator:"iterator",Generator:"generator",Error:"error"});InspectorBackend.registerEnum("Runtime.PropertyPreviewType",{Object:"object",Function:"function",Undefined:"undefined",String:"string",Number:"number",Boolean:"boolean",Symbol:"symbol",Accessor:"accessor"});InspectorBackend.registerEnum("Runtime.PropertyPreviewSubtype",{Array:"array",Null:"null",Node:"node",Regexp:"regexp",Date:"date",Map:"map",Set:"set",Iterator:"iterator",Generator:"generator",Error:"error"});InspectorBackend.registerEnum("Runtime.CallArgumentType",{Object:"object",Function:"function",Undefined:"undefined",String:"string",Number:"number",Boolean:"boolean",Symbol:"symbol"});InspectorBackend.registerEvent("Runtime.executionContextCreated",["context"]);InspectorBackend.registerEvent("Runtime.executionContextDestroyed",["executionContextId"]);InspectorBackend.registerEvent("Runtime.executionContextsCleared",[]);InspectorBackend.registerCommand("Runtime.evaluate",[{"name":"expression","type":"string","optional":false},{"name":"objectGroup","type":"string","optional":true},{"name":"includeCommandLineAPI","type":"boolean","optional":true},{"name":"doNotPauseOnExceptionsAndMuteConsole","type":"boolean","optional":true},{"name":"contextId","type":"number","optional":true},{"name":"returnByValue","type":"boolean","optional":true},{"name":"generatePreview","type":"boolean","optional":true}],["result","wasThrown","exceptionDetails"],false);InspectorBackend.registerCommand("Runtime.callFunctionOn",[{"name":"objectId","type":"string","optional":false},{"name":"functionDeclaration","type":"string","optional":false},{"name":"arguments","type":"object","optional":true},{"name":"doNotPauseOnExceptionsAndMuteConsole","type":"boolean","optional":true},{"name":"returnByValue","type":"boolean","optional":true},{"name":"generatePreview","type":"boolean","optional":true}],["result","wasThrown"],false);InspectorBackend.registerCommand("Runtime.getProperties",[{"name":"objectId","type":"string","optional":false},{"name":"ownProperties","type":"boolean","optional":true},{"name":"accessorPropertiesOnly","type":"boolean","optional":true},{"name":"generatePreview","type":"boolean","optional":true}],["result","internalProperties","exceptionDetails"],false);InspectorBackend.registerCommand("Runtime.releaseObject",[{"name":"objectId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Runtime.releaseObjectGroup",[{"name":"objectGroup","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Runtime.run",[],[],false);InspectorBackend.registerCommand("Runtime.enable",[],[],false);InspectorBackend.registerCommand("Runtime.disable",[],[],false);InspectorBackend.registerCommand("Runtime.isRunRequired",[],["result"],false);InspectorBackend.registerCommand("Runtime.setCustomObjectFormatterEnabled",[{"name":"enabled","type":"boolean","optional":false}],[],false);InspectorBackend.registerEnum("Console.ConsoleMessageSource",{XML:"xml",Javascript:"javascript",Network:"network",ConsoleAPI:"console-api",Storage:"storage",Appcache:"appcache",Rendering:"rendering",Security:"security",Other:"other",Deprecation:"deprecation"});InspectorBackend.registerEnum("Console.ConsoleMessageLevel",{Log:"log",Warning:"warning",Error:"error",Debug:"debug",Info:"info",RevokedError:"revokedError"});InspectorBackend.registerEnum("Console.ConsoleMessageType",{Log:"log",Dir:"dir",DirXML:"dirxml",Table:"table",Trace:"trace",Clear:"clear",StartGroup:"startGroup",StartGroupCollapsed:"startGroupCollapsed",EndGroup:"endGroup",Assert:"assert",Profile:"profile",ProfileEnd:"profileEnd"});InspectorBackend.registerEvent("Console.messageAdded",["message"]);InspectorBackend.registerEvent("Console.messageRepeatCountUpdated",["count","timestamp"]);InspectorBackend.registerEvent("Console.messagesCleared",[]);InspectorBackend.registerCommand("Console.enable",[],[],false);InspectorBackend.registerCommand("Console.disable",[],[],false);InspectorBackend.registerCommand("Console.clearMessages",[],[],false);InspectorBackend.registerEnum("Security.SecurityState",{Unknown:"unknown",Neutral:"neutral",Insecure:"insecure",Warning:"warning",Secure:"secure",Info:"info"});InspectorBackend.registerEvent("Security.securityStateChanged",["securityState","explanations","mixedContentStatus","schemeIsCryptographic"]);InspectorBackend.registerCommand("Security.enable",[],[],false);InspectorBackend.registerCommand("Security.disable",[],[],false);InspectorBackend.registerEnum("Network.ResourcePriority",{VeryLow:"VeryLow",Low:"Low",Medium:"Medium",High:"High",VeryHigh:"VeryHigh"});InspectorBackend.registerEnum("Network.RequestMixedContentType",{Blockable:"blockable",OptionallyBlockable:"optionally-blockable",None:"none"});InspectorBackend.registerEnum("Network.BlockedReason",{Csp:"csp",MixedContent:"mixed-content",Origin:"origin",Inspector:"inspector",Other:"other"});InspectorBackend.registerEnum("Network.InitiatorType",{Parser:"parser",Script:"script",Other:"other"});InspectorBackend.registerEvent("Network.requestWillBeSent",["requestId","frameId","loaderId","documentURL","request","timestamp","wallTime","initiator","redirectResponse","type"]);InspectorBackend.registerEvent("Network.requestServedFromCache",["requestId"]);InspectorBackend.registerEvent("Network.responseReceived",["requestId","frameId","loaderId","timestamp","type","response"]);InspectorBackend.registerEvent("Network.dataReceived",["requestId","timestamp","dataLength","encodedDataLength"]);InspectorBackend.registerEvent("Network.loadingFinished",["requestId","timestamp","encodedDataLength"]);InspectorBackend.registerEvent("Network.loadingFailed",["requestId","timestamp","type","errorText","canceled","blockedReason"]);InspectorBackend.registerEvent("Network.webSocketWillSendHandshakeRequest",["requestId","timestamp","wallTime","request"]);InspectorBackend.registerEvent("Network.webSocketHandshakeResponseReceived",["requestId","timestamp","response"]);InspectorBackend.registerEvent("Network.webSocketCreated",["requestId","url"]);InspectorBackend.registerEvent("Network.webSocketClosed",["requestId","timestamp"]);InspectorBackend.registerEvent("Network.webSocketFrameReceived",["requestId","timestamp","response"]);InspectorBackend.registerEvent("Network.webSocketFrameError",["requestId","timestamp","errorMessage"]);InspectorBackend.registerEvent("Network.webSocketFrameSent",["requestId","timestamp","response"]);InspectorBackend.registerEvent("Network.eventSourceMessageReceived",["requestId","timestamp","eventName","eventId","data"]);InspectorBackend.registerCommand("Network.enable",[],[],false);InspectorBackend.registerCommand("Network.disable",[],[],false);InspectorBackend.registerCommand("Network.setUserAgentOverride",[{"name":"userAgent","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Network.setExtraHTTPHeaders",[{"name":"headers","type":"object","optional":false}],[],false);InspectorBackend.registerCommand("Network.getResponseBody",[{"name":"requestId","type":"string","optional":false}],["body","base64Encoded"],false);InspectorBackend.registerCommand("Network.addBlockedURL",[{"name":"url","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Network.removeBlockedURL",[{"name":"url","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Network.replayXHR",[{"name":"requestId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Network.setMonitoringXHREnabled",[{"name":"enabled","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Network.canClearBrowserCache",[],["result"],false);InspectorBackend.registerCommand("Network.clearBrowserCache",[],[],false);InspectorBackend.registerCommand("Network.canClearBrowserCookies",[],["result"],false);InspectorBackend.registerCommand("Network.clearBrowserCookies",[],[],false);InspectorBackend.registerCommand("Network.getCookies",[],["cookies"],false);InspectorBackend.registerCommand("Network.deleteCookie",[{"name":"cookieName","type":"string","optional":false},{"name":"url","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Network.canEmulateNetworkConditions",[],["result"],false);InspectorBackend.registerCommand("Network.emulateNetworkConditions",[{"name":"offline","type":"boolean","optional":false},{"name":"latency","type":"number","optional":false},{"name":"downloadThroughput","type":"number","optional":false},{"name":"uploadThroughput","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Network.setCacheDisabled",[{"name":"cacheDisabled","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Network.setDataSizeLimitsForTest",[{"name":"maxTotalSize","type":"number","optional":false},{"name":"maxResourceSize","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Network.getCertificateDetails",[{"name":"certificateId","type":"number","optional":false}],["result"],false);InspectorBackend.registerCommand("Network.showCertificateViewer",[{"name":"certificateId","type":"number","optional":false}],[],false);InspectorBackend.registerEvent("Database.addDatabase",["database"]);InspectorBackend.registerCommand("Database.enable",[],[],false);InspectorBackend.registerCommand("Database.disable",[],[],false);InspectorBackend.registerCommand("Database.getDatabaseTableNames",[{"name":"databaseId","type":"string","optional":false}],["tableNames"],false);InspectorBackend.registerCommand("Database.executeSQL",[{"name":"databaseId","type":"string","optional":false},{"name":"query","type":"string","optional":false}],["columnNames","values","sqlError"],false);InspectorBackend.registerEnum("IndexedDB.KeyType",{Number:"number",String:"string",Date:"date",Array:"array"});InspectorBackend.registerEnum("IndexedDB.KeyPathType",{Null:"null",String:"string",Array:"array"});InspectorBackend.registerCommand("IndexedDB.enable",[],[],false);InspectorBackend.registerCommand("IndexedDB.disable",[],[],false);InspectorBackend.registerCommand("IndexedDB.requestDatabaseNames",[{"name":"securityOrigin","type":"string","optional":false}],["databaseNames"],false);InspectorBackend.registerCommand("IndexedDB.requestDatabase",[{"name":"securityOrigin","type":"string","optional":false},{"name":"databaseName","type":"string","optional":false}],["databaseWithObjectStores"],false);InspectorBackend.registerCommand("IndexedDB.requestData",[{"name":"securityOrigin","type":"string","optional":false},{"name":"databaseName","type":"string","optional":false},{"name":"objectStoreName","type":"string","optional":false},{"name":"indexName","type":"string","optional":false},{"name":"skipCount","type":"number","optional":false},{"name":"pageSize","type":"number","optional":false},{"name":"keyRange","type":"object","optional":true}],["objectStoreDataEntries","hasMore"],false);InspectorBackend.registerCommand("IndexedDB.clearObjectStore",[{"name":"securityOrigin","type":"string","optional":false},{"name":"databaseName","type":"string","optional":false},{"name":"objectStoreName","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("CacheStorage.requestCacheNames",[{"name":"securityOrigin","type":"string","optional":false}],["caches"],false);InspectorBackend.registerCommand("CacheStorage.requestEntries",[{"name":"cacheId","type":"string","optional":false},{"name":"skipCount","type":"number","optional":false},{"name":"pageSize","type":"number","optional":false}],["cacheDataEntries","hasMore"],false);InspectorBackend.registerCommand("CacheStorage.deleteCache",[{"name":"cacheId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("CacheStorage.deleteEntry",[{"name":"cacheId","type":"string","optional":false},{"name":"request","type":"string","optional":false}],[],false);InspectorBackend.registerEvent("DOMStorage.domStorageItemsCleared",["storageId"]);InspectorBackend.registerEvent("DOMStorage.domStorageItemRemoved",["storageId","key"]);InspectorBackend.registerEvent("DOMStorage.domStorageItemAdded",["storageId","key","newValue"]);InspectorBackend.registerEvent("DOMStorage.domStorageItemUpdated",["storageId","key","oldValue","newValue"]);InspectorBackend.registerCommand("DOMStorage.enable",[],[],false);InspectorBackend.registerCommand("DOMStorage.disable",[],[],false);InspectorBackend.registerCommand("DOMStorage.getDOMStorageItems",[{"name":"storageId","type":"object","optional":false}],["entries"],false);InspectorBackend.registerCommand("DOMStorage.setDOMStorageItem",[{"name":"storageId","type":"object","optional":false},{"name":"key","type":"string","optional":false},{"name":"value","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOMStorage.removeDOMStorageItem",[{"name":"storageId","type":"object","optional":false},{"name":"key","type":"string","optional":false}],[],false);InspectorBackend.registerEvent("ApplicationCache.applicationCacheStatusUpdated",["frameId","manifestURL","status"]);InspectorBackend.registerEvent("ApplicationCache.networkStateUpdated",["isNowOnline"]);InspectorBackend.registerCommand("ApplicationCache.getFramesWithManifests",[],["frameIds"],false);InspectorBackend.registerCommand("ApplicationCache.enable",[],[],false);InspectorBackend.registerCommand("ApplicationCache.getManifestForFrame",[{"name":"frameId","type":"string","optional":false}],["manifestURL"],false);InspectorBackend.registerCommand("ApplicationCache.getApplicationCacheForFrame",[{"name":"frameId","type":"string","optional":false}],["applicationCache"],false);InspectorBackend.registerCommand("FileSystem.enable",[],[],false);InspectorBackend.registerCommand("FileSystem.disable",[],[],false);InspectorBackend.registerCommand("FileSystem.requestFileSystemRoot",[{"name":"origin","type":"string","optional":false},{"name":"type","type":"string","optional":false}],["errorCode","root"],false);InspectorBackend.registerCommand("FileSystem.requestDirectoryContent",[{"name":"url","type":"string","optional":false}],["errorCode","entries"],false);InspectorBackend.registerCommand("FileSystem.requestMetadata",[{"name":"url","type":"string","optional":false}],["errorCode","metadata"],false);InspectorBackend.registerCommand("FileSystem.requestFileContent",[{"name":"url","type":"string","optional":false},{"name":"readAsText","type":"boolean","optional":false},{"name":"start","type":"number","optional":true},{"name":"end","type":"number","optional":true},{"name":"charset","type":"string","optional":true}],["errorCode","content","charset"],false);InspectorBackend.registerCommand("FileSystem.deleteEntry",[{"name":"url","type":"string","optional":false}],["errorCode"],false);InspectorBackend.registerEnum("DOM.PseudoType",{FirstLine:"first-line",FirstLetter:"first-letter",Before:"before",After:"after",Backdrop:"backdrop",Selection:"selection",FirstLineInherited:"first-line-inherited",Scrollbar:"scrollbar",ScrollbarThumb:"scrollbar-thumb",ScrollbarButton:"scrollbar-button",ScrollbarTrack:"scrollbar-track",ScrollbarTrackPiece:"scrollbar-track-piece",ScrollbarCorner:"scrollbar-corner",Resizer:"resizer",InputListButton:"input-list-button"});InspectorBackend.registerEnum("DOM.ShadowRootType",{UserAgent:"user-agent",Open:"open",Closed:"closed"});InspectorBackend.registerEnum("DOM.InspectMode",{SearchForNode:"searchForNode",SearchForUAShadowDOM:"searchForUAShadowDOM",ShowLayoutEditor:"showLayoutEditor",None:"none"});InspectorBackend.registerEvent("DOM.documentUpdated",[]);InspectorBackend.registerEvent("DOM.inspectNodeRequested",["backendNodeId"]);InspectorBackend.registerEvent("DOM.setChildNodes",["parentId","nodes"]);InspectorBackend.registerEvent("DOM.attributeModified",["nodeId","name","value"]);InspectorBackend.registerEvent("DOM.attributeRemoved",["nodeId","name"]);InspectorBackend.registerEvent("DOM.inlineStyleInvalidated",["nodeIds"]);InspectorBackend.registerEvent("DOM.characterDataModified",["nodeId","characterData"]);InspectorBackend.registerEvent("DOM.childNodeCountUpdated",["nodeId","childNodeCount"]);InspectorBackend.registerEvent("DOM.childNodeInserted",["parentNodeId","previousNodeId","node"]);InspectorBackend.registerEvent("DOM.childNodeRemoved",["parentNodeId","nodeId"]);InspectorBackend.registerEvent("DOM.shadowRootPushed",["hostId","root"]);InspectorBackend.registerEvent("DOM.shadowRootPopped",["hostId","rootId"]);InspectorBackend.registerEvent("DOM.pseudoElementAdded",["parentId","pseudoElement"]);InspectorBackend.registerEvent("DOM.pseudoElementRemoved",["parentId","pseudoElementId"]);InspectorBackend.registerEvent("DOM.distributedNodesUpdated",["insertionPointId","distributedNodes"]);InspectorBackend.registerEvent("DOM.nodeHighlightRequested",["nodeId"]);InspectorBackend.registerCommand("DOM.enable",[],[],false);InspectorBackend.registerCommand("DOM.disable",[],[],false);InspectorBackend.registerCommand("DOM.getDocument",[],["root"],false);InspectorBackend.registerCommand("DOM.requestChildNodes",[{"name":"nodeId","type":"number","optional":false},{"name":"depth","type":"number","optional":true}],[],false);InspectorBackend.registerCommand("DOM.querySelector",[{"name":"nodeId","type":"number","optional":false},{"name":"selector","type":"string","optional":false}],["nodeId"],false);InspectorBackend.registerCommand("DOM.querySelectorAll",[{"name":"nodeId","type":"number","optional":false},{"name":"selector","type":"string","optional":false}],["nodeIds"],false);InspectorBackend.registerCommand("DOM.setNodeName",[{"name":"nodeId","type":"number","optional":false},{"name":"name","type":"string","optional":false}],["nodeId"],false);InspectorBackend.registerCommand("DOM.setNodeValue",[{"name":"nodeId","type":"number","optional":false},{"name":"value","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOM.removeNode",[{"name":"nodeId","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("DOM.setAttributeValue",[{"name":"nodeId","type":"number","optional":false},{"name":"name","type":"string","optional":false},{"name":"value","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOM.setAttributesAsText",[{"name":"nodeId","type":"number","optional":false},{"name":"text","type":"string","optional":false},{"name":"name","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("DOM.removeAttribute",[{"name":"nodeId","type":"number","optional":false},{"name":"name","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOM.getOuterHTML",[{"name":"nodeId","type":"number","optional":false}],["outerHTML"],false);InspectorBackend.registerCommand("DOM.setOuterHTML",[{"name":"nodeId","type":"number","optional":false},{"name":"outerHTML","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOM.performSearch",[{"name":"query","type":"string","optional":false},{"name":"includeUserAgentShadowDOM","type":"boolean","optional":true}],["searchId","resultCount"],false);InspectorBackend.registerCommand("DOM.getSearchResults",[{"name":"searchId","type":"string","optional":false},{"name":"fromIndex","type":"number","optional":false},{"name":"toIndex","type":"number","optional":false}],["nodeIds"],false);InspectorBackend.registerCommand("DOM.discardSearchResults",[{"name":"searchId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOM.requestNode",[{"name":"objectId","type":"string","optional":false}],["nodeId"],false);InspectorBackend.registerCommand("DOM.setInspectMode",[{"name":"mode","type":"string","optional":false},{"name":"highlightConfig","type":"object","optional":true}],[],false);InspectorBackend.registerCommand("DOM.highlightRect",[{"name":"x","type":"number","optional":false},{"name":"y","type":"number","optional":false},{"name":"width","type":"number","optional":false},{"name":"height","type":"number","optional":false},{"name":"color","type":"object","optional":true},{"name":"outlineColor","type":"object","optional":true}],[],false);InspectorBackend.registerCommand("DOM.highlightQuad",[{"name":"quad","type":"object","optional":false},{"name":"color","type":"object","optional":true},{"name":"outlineColor","type":"object","optional":true}],[],false);InspectorBackend.registerCommand("DOM.highlightNode",[{"name":"highlightConfig","type":"object","optional":false},{"name":"nodeId","type":"number","optional":true},{"name":"backendNodeId","type":"number","optional":true},{"name":"objectId","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("DOM.hideHighlight",[],[],false);InspectorBackend.registerCommand("DOM.highlightFrame",[{"name":"frameId","type":"string","optional":false},{"name":"contentColor","type":"object","optional":true},{"name":"contentOutlineColor","type":"object","optional":true}],[],false);InspectorBackend.registerCommand("DOM.pushNodeByPathToFrontend",[{"name":"path","type":"string","optional":false}],["nodeId"],false);InspectorBackend.registerCommand("DOM.pushNodesByBackendIdsToFrontend",[{"name":"backendNodeIds","type":"object","optional":false}],["nodeIds"],false);InspectorBackend.registerCommand("DOM.setInspectedNode",[{"name":"nodeId","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("DOM.resolveNode",[{"name":"nodeId","type":"number","optional":false},{"name":"objectGroup","type":"string","optional":true}],["object"],false);InspectorBackend.registerCommand("DOM.getAttributes",[{"name":"nodeId","type":"number","optional":false}],["attributes"],false);InspectorBackend.registerCommand("DOM.copyTo",[{"name":"nodeId","type":"number","optional":false},{"name":"targetNodeId","type":"number","optional":false},{"name":"insertBeforeNodeId","type":"number","optional":true}],["nodeId"],false);InspectorBackend.registerCommand("DOM.moveTo",[{"name":"nodeId","type":"number","optional":false},{"name":"targetNodeId","type":"number","optional":false},{"name":"insertBeforeNodeId","type":"number","optional":true}],["nodeId"],false);InspectorBackend.registerCommand("DOM.undo",[],[],false);InspectorBackend.registerCommand("DOM.redo",[],[],false);InspectorBackend.registerCommand("DOM.markUndoableState",[],[],false);InspectorBackend.registerCommand("DOM.focus",[{"name":"nodeId","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("DOM.setFileInputFiles",[{"name":"nodeId","type":"number","optional":false},{"name":"files","type":"object","optional":false}],[],false);InspectorBackend.registerCommand("DOM.getBoxModel",[{"name":"nodeId","type":"number","optional":false}],["model"],false);InspectorBackend.registerCommand("DOM.getNodeForLocation",[{"name":"x","type":"number","optional":false},{"name":"y","type":"number","optional":false}],["nodeId"],false);InspectorBackend.registerCommand("DOM.getRelayoutBoundary",[{"name":"nodeId","type":"number","optional":false}],["nodeId"],false);InspectorBackend.registerCommand("DOM.getHighlightObjectForTest",[{"name":"nodeId","type":"number","optional":false}],["highlight"],false);InspectorBackend.registerEnum("CSS.StyleSheetOrigin",{Injected:"injected",UserAgent:"user-agent",Inspector:"inspector",Regular:"regular"});InspectorBackend.registerEnum("CSS.CSSMediaSource",{MediaRule:"mediaRule",ImportRule:"importRule",LinkedSheet:"linkedSheet",InlineSheet:"inlineSheet"});InspectorBackend.registerEvent("CSS.mediaQueryResultChanged",[]);InspectorBackend.registerEvent("CSS.styleSheetChanged",["styleSheetId"]);InspectorBackend.registerEvent("CSS.styleSheetAdded",["header"]);InspectorBackend.registerEvent("CSS.styleSheetRemoved",["styleSheetId"]);InspectorBackend.registerEvent("CSS.layoutEditorChange",["styleSheetId","changeRange"]);InspectorBackend.registerCommand("CSS.enable",[],[],false);InspectorBackend.registerCommand("CSS.disable",[],[],false);InspectorBackend.registerCommand("CSS.getMatchedStylesForNode",[{"name":"nodeId","type":"number","optional":false}],["inlineStyle","attributesStyle","matchedCSSRules","pseudoElements","inherited"],false);InspectorBackend.registerCommand("CSS.getInlineStylesForNode",[{"name":"nodeId","type":"number","optional":false}],["inlineStyle","attributesStyle"],false);InspectorBackend.registerCommand("CSS.getComputedStyleForNode",[{"name":"nodeId","type":"number","optional":false}],["computedStyle"],false);InspectorBackend.registerCommand("CSS.getPlatformFontsForNode",[{"name":"nodeId","type":"number","optional":false}],["fonts"],false);InspectorBackend.registerCommand("CSS.getCSSAnimationsForNode",[{"name":"nodeId","type":"number","optional":false}],["cssKeyframesRules"],false);InspectorBackend.registerCommand("CSS.getStyleSheetText",[{"name":"styleSheetId","type":"string","optional":false}],["text"],false);InspectorBackend.registerCommand("CSS.setStyleSheetText",[{"name":"styleSheetId","type":"string","optional":false},{"name":"text","type":"string","optional":false}],["sourceMapURL"],false);InspectorBackend.registerCommand("CSS.setRuleSelector",[{"name":"styleSheetId","type":"string","optional":false},{"name":"range","type":"object","optional":false},{"name":"selector","type":"string","optional":false}],["selectorList"],false);InspectorBackend.registerCommand("CSS.setStyleText",[{"name":"styleSheetId","type":"string","optional":false},{"name":"range","type":"object","optional":false},{"name":"text","type":"string","optional":false}],["style"],false);InspectorBackend.registerCommand("CSS.setMediaText",[{"name":"styleSheetId","type":"string","optional":false},{"name":"range","type":"object","optional":false},{"name":"text","type":"string","optional":false}],["media"],false);InspectorBackend.registerCommand("CSS.createStyleSheet",[{"name":"frameId","type":"string","optional":false}],["styleSheetId"],false);InspectorBackend.registerCommand("CSS.addRule",[{"name":"styleSheetId","type":"string","optional":false},{"name":"ruleText","type":"string","optional":false},{"name":"location","type":"object","optional":false}],["rule"],false);InspectorBackend.registerCommand("CSS.forcePseudoState",[{"name":"nodeId","type":"number","optional":false},{"name":"forcedPseudoClasses","type":"object","optional":false}],[],false);InspectorBackend.registerCommand("CSS.getMediaQueries",[],["medias"],false);InspectorBackend.registerCommand("CSS.setEffectivePropertyValueForNode",[{"name":"nodeId","type":"number","optional":false},{"name":"propertyName","type":"string","optional":false},{"name":"value","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("CSS.getBackgroundColors",[{"name":"nodeId","type":"number","optional":false}],["backgroundColors"],false);InspectorBackend.registerCommand("IO.read",[{"name":"handle","type":"string","optional":false},{"name":"offset","type":"number","optional":true},{"name":"size","type":"number","optional":true}],["data","eof"],false);InspectorBackend.registerCommand("IO.close",[{"name":"handle","type":"string","optional":false}],[],false);InspectorBackend.registerEvent("Timeline.eventRecorded",["record"]);InspectorBackend.registerCommand("Timeline.enable",[],[],false);InspectorBackend.registerCommand("Timeline.disable",[],[],false);InspectorBackend.registerCommand("Timeline.start",[{"name":"maxCallStackDepth","type":"number","optional":true},{"name":"bufferEvents","type":"boolean","optional":true},{"name":"liveEvents","type":"string","optional":true},{"name":"includeCounters","type":"boolean","optional":true},{"name":"includeGPUEvents","type":"boolean","optional":true}],[],false);InspectorBackend.registerCommand("Timeline.stop",[],[],false);InspectorBackend.registerEnum("Debugger.GeneratorObjectDetailsStatus",{Running:"running",Suspended:"suspended",Closed:"closed"});InspectorBackend.registerEnum("Debugger.ScopeType",{Global:"global",Local:"local",With:"with",Closure:"closure",Catch:"catch",Block:"block",Script:"script"});InspectorBackend.registerEnum("Debugger.PromiseDetailsStatus",{Pending:"pending",Resolved:"resolved",Rejected:"rejected"});InspectorBackend.registerEvent("Debugger.globalObjectCleared",[]);InspectorBackend.registerEvent("Debugger.scriptParsed",["scriptId","url","startLine","startColumn","endLine","endColumn","executionContextId","isContentScript","isInternalScript","isLiveEdit","sourceMapURL","hasSourceURL"]);InspectorBackend.registerEvent("Debugger.scriptFailedToParse",["scriptId","url","startLine","startColumn","endLine","endColumn","executionContextId","isContentScript","isInternalScript","sourceMapURL","hasSourceURL"]);InspectorBackend.registerEvent("Debugger.breakpointResolved",["breakpointId","location"]);InspectorBackend.registerEvent("Debugger.paused",["callFrames","reason","data","hitBreakpoints","asyncStackTrace"]);InspectorBackend.registerEvent("Debugger.resumed",[]);InspectorBackend.registerEvent("Debugger.promiseUpdated",["eventType","promise"]);InspectorBackend.registerEvent("Debugger.asyncOperationStarted",["operation"]);InspectorBackend.registerEvent("Debugger.asyncOperationCompleted",["id"]);InspectorBackend.registerCommand("Debugger.enable",[],[],false);InspectorBackend.registerCommand("Debugger.disable",[],[],false);InspectorBackend.registerCommand("Debugger.setBreakpointsActive",[{"name":"active","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Debugger.setSkipAllPauses",[{"name":"skipped","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Debugger.setBreakpointByUrl",[{"name":"lineNumber","type":"number","optional":false},{"name":"url","type":"string","optional":true},{"name":"urlRegex","type":"string","optional":true},{"name":"columnNumber","type":"number","optional":true},{"name":"condition","type":"string","optional":true}],["breakpointId","locations"],false);InspectorBackend.registerCommand("Debugger.setBreakpoint",[{"name":"location","type":"object","optional":false},{"name":"condition","type":"string","optional":true}],["breakpointId","actualLocation"],false);InspectorBackend.registerCommand("Debugger.removeBreakpoint",[{"name":"breakpointId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Debugger.continueToLocation",[{"name":"location","type":"object","optional":false},{"name":"interstatementLocation","type":"boolean","optional":true}],[],false);InspectorBackend.registerCommand("Debugger.stepOver",[],[],false);InspectorBackend.registerCommand("Debugger.stepInto",[],[],false);InspectorBackend.registerCommand("Debugger.stepOut",[],[],false);InspectorBackend.registerCommand("Debugger.pause",[],[],false);InspectorBackend.registerCommand("Debugger.resume",[],[],false);InspectorBackend.registerCommand("Debugger.stepIntoAsync",[],[],false);InspectorBackend.registerCommand("Debugger.searchInContent",[{"name":"scriptId","type":"string","optional":false},{"name":"query","type":"string","optional":false},{"name":"caseSensitive","type":"boolean","optional":true},{"name":"isRegex","type":"boolean","optional":true}],["result"],false);InspectorBackend.registerCommand("Debugger.canSetScriptSource",[],["result"],false);InspectorBackend.registerCommand("Debugger.setScriptSource",[{"name":"scriptId","type":"string","optional":false},{"name":"scriptSource","type":"string","optional":false},{"name":"preview","type":"boolean","optional":true}],["callFrames","stackChanged","asyncStackTrace"],true);InspectorBackend.registerCommand("Debugger.restartFrame",[{"name":"callFrameId","type":"string","optional":false}],["callFrames","asyncStackTrace"],false);InspectorBackend.registerCommand("Debugger.getScriptSource",[{"name":"scriptId","type":"string","optional":false}],["scriptSource"],false);InspectorBackend.registerCommand("Debugger.getFunctionDetails",[{"name":"functionId","type":"string","optional":false}],["details"],false);InspectorBackend.registerCommand("Debugger.getGeneratorObjectDetails",[{"name":"objectId","type":"string","optional":false}],["details"],false);InspectorBackend.registerCommand("Debugger.getCollectionEntries",[{"name":"objectId","type":"string","optional":false}],["entries"],false);InspectorBackend.registerCommand("Debugger.setPauseOnExceptions",[{"name":"state","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Debugger.evaluateOnCallFrame",[{"name":"callFrameId","type":"string","optional":false},{"name":"expression","type":"string","optional":false},{"name":"objectGroup","type":"string","optional":true},{"name":"includeCommandLineAPI","type":"boolean","optional":true},{"name":"doNotPauseOnExceptionsAndMuteConsole","type":"boolean","optional":true},{"name":"returnByValue","type":"boolean","optional":true},{"name":"generatePreview","type":"boolean","optional":true}],["result","wasThrown","exceptionDetails"],false);InspectorBackend.registerCommand("Debugger.compileScript",[{"name":"expression","type":"string","optional":false},{"name":"sourceURL","type":"string","optional":false},{"name":"persistScript","type":"boolean","optional":false},{"name":"executionContextId","type":"number","optional":false}],["scriptId","exceptionDetails"],false);InspectorBackend.registerCommand("Debugger.runScript",[{"name":"scriptId","type":"string","optional":false},{"name":"executionContextId","type":"number","optional":false},{"name":"objectGroup","type":"string","optional":true},{"name":"doNotPauseOnExceptionsAndMuteConsole","type":"boolean","optional":true}],["result","exceptionDetails"],false);InspectorBackend.registerCommand("Debugger.setVariableValue",[{"name":"scopeNumber","type":"number","optional":false},{"name":"variableName","type":"string","optional":false},{"name":"newValue","type":"object","optional":false},{"name":"callFrameId","type":"string","optional":true},{"name":"functionObjectId","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("Debugger.getStepInPositions",[{"name":"callFrameId","type":"string","optional":false}],["stepInPositions"],false);InspectorBackend.registerCommand("Debugger.getBacktrace",[],["callFrames","asyncStackTrace"],false);InspectorBackend.registerCommand("Debugger.skipStackFrames",[{"name":"script","type":"string","optional":true},{"name":"skipContentScripts","type":"boolean","optional":true}],[],false);InspectorBackend.registerCommand("Debugger.setAsyncCallStackDepth",[{"name":"maxDepth","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Debugger.enablePromiseTracker",[{"name":"captureStacks","type":"boolean","optional":true}],[],false);InspectorBackend.registerCommand("Debugger.disablePromiseTracker",[],[],false);InspectorBackend.registerCommand("Debugger.getPromiseById",[{"name":"promiseId","type":"number","optional":false},{"name":"objectGroup","type":"string","optional":true}],["promise"],false);InspectorBackend.registerCommand("Debugger.flushAsyncOperationEvents",[],[],false);InspectorBackend.registerCommand("Debugger.setAsyncOperationBreakpoint",[{"name":"operationId","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Debugger.removeAsyncOperationBreakpoint",[{"name":"operationId","type":"number","optional":false}],[],false);InspectorBackend.registerEnum("DOMDebugger.DOMBreakpointType",{SubtreeModified:"subtree-modified",AttributeModified:"attribute-modified",NodeRemoved:"node-removed"});InspectorBackend.registerCommand("DOMDebugger.setDOMBreakpoint",[{"name":"nodeId","type":"number","optional":false},{"name":"type","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOMDebugger.removeDOMBreakpoint",[{"name":"nodeId","type":"number","optional":false},{"name":"type","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOMDebugger.setEventListenerBreakpoint",[{"name":"eventName","type":"string","optional":false},{"name":"targetName","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("DOMDebugger.removeEventListenerBreakpoint",[{"name":"eventName","type":"string","optional":false},{"name":"targetName","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("DOMDebugger.setInstrumentationBreakpoint",[{"name":"eventName","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOMDebugger.removeInstrumentationBreakpoint",[{"name":"eventName","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOMDebugger.setXHRBreakpoint",[{"name":"url","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOMDebugger.removeXHRBreakpoint",[{"name":"url","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("DOMDebugger.getEventListeners",[{"name":"objectId","type":"string","optional":false}],["listeners"],false);InspectorBackend.registerEvent("Profiler.consoleProfileStarted",["id","location","title"]);InspectorBackend.registerEvent("Profiler.consoleProfileFinished",["id","location","profile","title"]);InspectorBackend.registerCommand("Profiler.enable",[],[],false);InspectorBackend.registerCommand("Profiler.disable",[],[],false);InspectorBackend.registerCommand("Profiler.setSamplingInterval",[{"name":"interval","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Profiler.start",[],[],false);InspectorBackend.registerCommand("Profiler.stop",[],["profile"],false);InspectorBackend.registerEvent("HeapProfiler.addHeapSnapshotChunk",["chunk"]);InspectorBackend.registerEvent("HeapProfiler.resetProfiles",[]);InspectorBackend.registerEvent("HeapProfiler.reportHeapSnapshotProgress",["done","total","finished"]);InspectorBackend.registerEvent("HeapProfiler.lastSeenObjectId",["lastSeenObjectId","timestamp"]);InspectorBackend.registerEvent("HeapProfiler.heapStatsUpdate",["statsUpdate"]);InspectorBackend.registerCommand("HeapProfiler.enable",[],[],false);InspectorBackend.registerCommand("HeapProfiler.disable",[],[],false);InspectorBackend.registerCommand("HeapProfiler.startTrackingHeapObjects",[{"name":"trackAllocations","type":"boolean","optional":true}],[],false);InspectorBackend.registerCommand("HeapProfiler.stopTrackingHeapObjects",[{"name":"reportProgress","type":"boolean","optional":true}],[],false);InspectorBackend.registerCommand("HeapProfiler.takeHeapSnapshot",[{"name":"reportProgress","type":"boolean","optional":true}],[],false);InspectorBackend.registerCommand("HeapProfiler.collectGarbage",[],[],false);InspectorBackend.registerCommand("HeapProfiler.getObjectByHeapObjectId",[{"name":"objectId","type":"string","optional":false},{"name":"objectGroup","type":"string","optional":true}],["result"],false);InspectorBackend.registerCommand("HeapProfiler.addInspectedHeapObject",[{"name":"heapObjectId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("HeapProfiler.getHeapObjectId",[{"name":"objectId","type":"string","optional":false}],["heapSnapshotObjectId"],false);InspectorBackend.registerEvent("Worker.workerCreated",["workerId","url","inspectorConnected"]);InspectorBackend.registerEvent("Worker.workerTerminated",["workerId"]);InspectorBackend.registerEvent("Worker.dispatchMessageFromWorker",["workerId","message"]);InspectorBackend.registerCommand("Worker.enable",[],[],false);InspectorBackend.registerCommand("Worker.disable",[],[],false);InspectorBackend.registerCommand("Worker.sendMessageToWorker",[{"name":"workerId","type":"string","optional":false},{"name":"message","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Worker.connectToWorker",[{"name":"workerId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Worker.disconnectFromWorker",[{"name":"workerId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("Worker.setAutoconnectToWorkers",[{"name":"value","type":"boolean","optional":false}],[],false);InspectorBackend.registerEnum("ServiceWorker.ServiceWorkerVersionRunningStatus",{Stopped:"stopped",Starting:"starting",Running:"running",Stopping:"stopping"});InspectorBackend.registerEnum("ServiceWorker.ServiceWorkerVersionStatus",{New:"new",Installing:"installing",Installed:"installed",Activating:"activating",Activated:"activated",Redundant:"redundant"});InspectorBackend.registerEvent("ServiceWorker.workerCreated",["workerId","url","versionId"]);InspectorBackend.registerEvent("ServiceWorker.workerTerminated",["workerId"]);InspectorBackend.registerEvent("ServiceWorker.dispatchMessage",["workerId","message"]);InspectorBackend.registerEvent("ServiceWorker.workerRegistrationUpdated",["registrations"]);InspectorBackend.registerEvent("ServiceWorker.workerVersionUpdated",["versions"]);InspectorBackend.registerEvent("ServiceWorker.workerErrorReported",["errorMessage"]);InspectorBackend.registerEvent("ServiceWorker.debugOnStartUpdated",["debugOnStart"]);InspectorBackend.registerCommand("ServiceWorker.enable",[],[],false);InspectorBackend.registerCommand("ServiceWorker.disable",[],[],false);InspectorBackend.registerCommand("ServiceWorker.sendMessage",[{"name":"workerId","type":"string","optional":false},{"name":"message","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.stop",[{"name":"workerId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.unregister",[{"name":"scopeURL","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.updateRegistration",[{"name":"scopeURL","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.startWorker",[{"name":"scopeURL","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.stopWorker",[{"name":"versionId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.inspectWorker",[{"name":"versionId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.setDebugOnStart",[{"name":"debugOnStart","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.setForceUpdateOnPageLoad",[{"name":"registrationId","type":"string","optional":false},{"name":"forceUpdateOnPageLoad","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.deliverPushMessage",[{"name":"origin","type":"string","optional":false},{"name":"registrationId","type":"string","optional":false},{"name":"data","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("ServiceWorker.getTargetInfo",[{"name":"targetId","type":"string","optional":false}],["targetInfo"],false);InspectorBackend.registerCommand("ServiceWorker.activateTarget",[{"name":"targetId","type":"string","optional":false}],[],false);InspectorBackend.registerEnum("Input.TouchPointState",{TouchPressed:"touchPressed",TouchReleased:"touchReleased",TouchMoved:"touchMoved",TouchStationary:"touchStationary",TouchCancelled:"touchCancelled"});InspectorBackend.registerEnum("Input.GestureSourceType",{Default:"default",Touch:"touch",Mouse:"mouse"});InspectorBackend.registerCommand("Input.dispatchKeyEvent",[{"name":"type","type":"string","optional":false},{"name":"modifiers","type":"number","optional":true},{"name":"timestamp","type":"number","optional":true},{"name":"text","type":"string","optional":true},{"name":"unmodifiedText","type":"string","optional":true},{"name":"keyIdentifier","type":"string","optional":true},{"name":"code","type":"string","optional":true},{"name":"key","type":"string","optional":true},{"name":"windowsVirtualKeyCode","type":"number","optional":true},{"name":"nativeVirtualKeyCode","type":"number","optional":true},{"name":"autoRepeat","type":"boolean","optional":true},{"name":"isKeypad","type":"boolean","optional":true},{"name":"isSystemKey","type":"boolean","optional":true}],[],false);InspectorBackend.registerCommand("Input.dispatchMouseEvent",[{"name":"type","type":"string","optional":false},{"name":"x","type":"number","optional":false},{"name":"y","type":"number","optional":false},{"name":"modifiers","type":"number","optional":true},{"name":"timestamp","type":"number","optional":true},{"name":"button","type":"string","optional":true},{"name":"clickCount","type":"number","optional":true}],[],false);InspectorBackend.registerCommand("Input.dispatchTouchEvent",[{"name":"type","type":"string","optional":false},{"name":"touchPoints","type":"object","optional":false},{"name":"modifiers","type":"number","optional":true},{"name":"timestamp","type":"number","optional":true}],[],false);InspectorBackend.registerCommand("Input.emulateTouchFromMouseEvent",[{"name":"type","type":"string","optional":false},{"name":"x","type":"number","optional":false},{"name":"y","type":"number","optional":false},{"name":"timestamp","type":"number","optional":false},{"name":"button","type":"string","optional":false},{"name":"deltaX","type":"number","optional":true},{"name":"deltaY","type":"number","optional":true},{"name":"modifiers","type":"number","optional":true},{"name":"clickCount","type":"number","optional":true}],[],false);InspectorBackend.registerCommand("Input.synthesizePinchGesture",[{"name":"x","type":"number","optional":false},{"name":"y","type":"number","optional":false},{"name":"scaleFactor","type":"number","optional":false},{"name":"relativeSpeed","type":"number","optional":true},{"name":"gestureSourceType","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("Input.synthesizeScrollGesture",[{"name":"x","type":"number","optional":false},{"name":"y","type":"number","optional":false},{"name":"xDistance","type":"number","optional":true},{"name":"yDistance","type":"number","optional":true},{"name":"xOverscroll","type":"number","optional":true},{"name":"yOverscroll","type":"number","optional":true},{"name":"preventFling","type":"boolean","optional":true},{"name":"speed","type":"number","optional":true},{"name":"gestureSourceType","type":"string","optional":true},{"name":"repeatCount","type":"number","optional":true},{"name":"repeatDelayMs","type":"number","optional":true},{"name":"interactionMarkerName","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("Input.synthesizeTapGesture",[{"name":"x","type":"number","optional":false},{"name":"y","type":"number","optional":false},{"name":"duration","type":"number","optional":true},{"name":"tapCount","type":"number","optional":true},{"name":"gestureSourceType","type":"string","optional":true}],[],false);InspectorBackend.registerEnum("LayerTree.ScrollRectType",{RepaintsOnScroll:"RepaintsOnScroll",TouchEventHandler:"TouchEventHandler",WheelEventHandler:"WheelEventHandler"});InspectorBackend.registerEvent("LayerTree.layerTreeDidChange",["layers"]);InspectorBackend.registerEvent("LayerTree.layerPainted",["layerId","clip"]);InspectorBackend.registerCommand("LayerTree.enable",[],[],false);InspectorBackend.registerCommand("LayerTree.disable",[],[],false);InspectorBackend.registerCommand("LayerTree.compositingReasons",[{"name":"layerId","type":"string","optional":false}],["compositingReasons"],false);InspectorBackend.registerCommand("LayerTree.makeSnapshot",[{"name":"layerId","type":"string","optional":false}],["snapshotId"],false);InspectorBackend.registerCommand("LayerTree.loadSnapshot",[{"name":"tiles","type":"object","optional":false}],["snapshotId"],false);InspectorBackend.registerCommand("LayerTree.releaseSnapshot",[{"name":"snapshotId","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("LayerTree.profileSnapshot",[{"name":"snapshotId","type":"string","optional":false},{"name":"minRepeatCount","type":"number","optional":true},{"name":"minDuration","type":"number","optional":true},{"name":"clipRect","type":"object","optional":true}],["timings"],false);InspectorBackend.registerCommand("LayerTree.replaySnapshot",[{"name":"snapshotId","type":"string","optional":false},{"name":"fromStep","type":"number","optional":true},{"name":"toStep","type":"number","optional":true},{"name":"scale","type":"number","optional":true}],["dataURL"],false);InspectorBackend.registerCommand("LayerTree.snapshotCommandLog",[{"name":"snapshotId","type":"string","optional":false}],["commandLog"],false);InspectorBackend.registerCommand("DeviceOrientation.setDeviceOrientationOverride",[{"name":"alpha","type":"number","optional":false},{"name":"beta","type":"number","optional":false},{"name":"gamma","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("DeviceOrientation.clearDeviceOrientationOverride",[],[],false);InspectorBackend.registerEnum("ScreenOrientation.OrientationType",{PortraitPrimary:"portraitPrimary",PortraitSecondary:"portraitSecondary",LandscapePrimary:"landscapePrimary",LandscapeSecondary:"landscapeSecondary"});InspectorBackend.registerCommand("ScreenOrientation.setScreenOrientationOverride",[{"name":"angle","type":"number","optional":false},{"name":"type","type":"string","optional":false}],[],false);InspectorBackend.registerCommand("ScreenOrientation.clearScreenOrientationOverride",[],[],false);InspectorBackend.registerEvent("Tracing.dataCollected",["value"]);InspectorBackend.registerEvent("Tracing.tracingComplete",["stream"]);InspectorBackend.registerEvent("Tracing.bufferUsage",["percentFull","eventCount","value"]);InspectorBackend.registerCommand("Tracing.start",[{"name":"categories","type":"string","optional":true},{"name":"options","type":"string","optional":true},{"name":"bufferUsageReportingInterval","type":"number","optional":true},{"name":"transferMode","type":"string","optional":true}],[],false);InspectorBackend.registerCommand("Tracing.end",[],[],false);InspectorBackend.registerCommand("Tracing.getCategories",[],["categories"],false);InspectorBackend.registerCommand("Tracing.requestMemoryDump",[],["dumpGuid","success"],false);InspectorBackend.registerEnum("Animation.AnimationType",{CSSTransition:"CSSTransition",CSSAnimation:"CSSAnimation",WebAnimation:"WebAnimation"});InspectorBackend.registerEvent("Animation.animationCreated",["id"]);InspectorBackend.registerEvent("Animation.animationStarted",["animation"]);InspectorBackend.registerEvent("Animation.animationCanceled",["id"]);InspectorBackend.registerCommand("Animation.enable",[],[],false);InspectorBackend.registerCommand("Animation.disable",[],[],false);InspectorBackend.registerCommand("Animation.getPlaybackRate",[],["playbackRate"],false);InspectorBackend.registerCommand("Animation.setPlaybackRate",[{"name":"playbackRate","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Animation.getCurrentTime",[{"name":"id","type":"string","optional":false}],["currentTime"],false);InspectorBackend.registerCommand("Animation.setPaused",[{"name":"animations","type":"object","optional":false},{"name":"paused","type":"boolean","optional":false}],[],false);InspectorBackend.registerCommand("Animation.setTiming",[{"name":"animationId","type":"string","optional":false},{"name":"duration","type":"number","optional":false},{"name":"delay","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Animation.seekAnimations",[{"name":"animations","type":"object","optional":false},{"name":"currentTime","type":"number","optional":false}],[],false);InspectorBackend.registerCommand("Animation.releaseAnimations",[{"name":"animations","type":"object","optional":false}],[],false);InspectorBackend.registerCommand("Animation.resolveAnimation",[{"name":"animationId","type":"string","optional":false}],["remoteObject"],false);InspectorBackend.registerEnum("Accessibility.AXValueType",{Boolean:"boolean",Tristate:"tristate",BooleanOrUndefined:"booleanOrUndefined",Idref:"idref",IdrefList:"idrefList",Integer:"integer",Node:"node",NodeList:"nodeList",Number:"number",String:"string",ComputedString:"computedString",Token:"token",TokenList:"tokenList",DomRelation:"domRelation",Role:"role",InternalRole:"internalRole",ValueUndefined:"valueUndefined"});InspectorBackend.registerEnum("Accessibility.AXValueSourceType",{Attribute:"attribute",Implicit:"implicit",Style:"style",Contents:"contents",Placeholder:"placeholder",RelatedElement:"relatedElement"});InspectorBackend.registerEnum("Accessibility.AXValueNativeSourceType",{Figcaption:"figcaption",Label:"label",Labelfor:"labelfor",Labelwrapped:"labelwrapped",Legend:"legend",Tablecaption:"tablecaption",Title:"title",Other:"other"});InspectorBackend.registerEnum("Accessibility.AXGlobalStates",{Disabled:"disabled",Hidden:"hidden",HiddenRoot:"hiddenRoot",Invalid:"invalid"});InspectorBackend.registerEnum("Accessibility.AXLiveRegionAttributes",{Live:"live",Atomic:"atomic",Relevant:"relevant",Busy:"busy",Root:"root"});InspectorBackend.registerEnum("Accessibility.AXWidgetAttributes",{Autocomplete:"autocomplete",Haspopup:"haspopup",Level:"level",Multiselectable:"multiselectable",Orientation:"orientation",Multiline:"multiline",Readonly:"readonly",Required:"required",Valuemin:"valuemin",Valuemax:"valuemax",Valuetext:"valuetext"});InspectorBackend.registerEnum("Accessibility.AXWidgetStates",{Checked:"checked",Expanded:"expanded",Pressed:"pressed",Selected:"selected"});InspectorBackend.registerEnum("Accessibility.AXRelationshipAttributes",{Activedescendant:"activedescendant",Flowto:"flowto",Controls:"controls",Describedby:"describedby",Labelledby:"labelledby",Owns:"owns"});InspectorBackend.registerCommand("Accessibility.getAXNode",[{"name":"nodeId","type":"number","optional":false}],["accessibilityNode"],false);;WebInspector.InspectorBackendHostedMode={};WebInspector.InspectorBackendHostedMode.loadFromJSONIfNeeded=function(jsonUrl)
{if(InspectorBackend.isInitialized())
return;var xhr=new XMLHttpRequest();xhr.open("GET",jsonUrl,false);xhr.send(null);var schema=JSON.parse(xhr.responseText);var code=WebInspector.InspectorBackendHostedMode.generateCommands(schema);eval(code);}
WebInspector.InspectorBackendHostedMode.generateCommands=function(schema)
{var jsTypes={integer:"number",array:"object"};var rawTypes={};var result=[];var domains=schema["domains"]||[];for(var i=0;i<domains.length;++i){var domain=domains[i];for(var j=0;domain.types&&j<domain.types.length;++j){var type=domain.types[j];rawTypes[domain.domain+"."+type.id]=jsTypes[type.type]||type.type;}}
function toUpperCase(groupIndex,group0,group1)
{return[group0,group1][groupIndex].toUpperCase();}
function generateEnum(enumName,items)
{var members=[];for(var m=0;m<items.length;++m){var value=items[m];var name=value.replace(/-(\w)/g,toUpperCase.bind(null,1)).toTitleCase();name=name.replace(/HTML|XML|WML|API/ig,toUpperCase.bind(null,0));members.push(name+": \""+value+"\"");}
return"InspectorBackend.registerEnum(\""+enumName+"\", {"+members.join(", ")+"});";}
for(var i=0;i<domains.length;++i){var domain=domains[i];var types=domain["types"]||[];for(var j=0;j<types.length;++j){var type=types[j];if((type["type"]==="string")&&type["enum"])
result.push(generateEnum(domain.domain+"."+type.id,type["enum"]));else if(type["type"]==="object"){var properties=type["properties"]||[];for(var k=0;k<properties.length;++k){var property=properties[k];if((property["type"]==="string")&&property["enum"])
result.push(generateEnum(domain.domain+"."+type.id+property["name"].toTitleCase(),property["enum"]));}}}
var commands=domain["commands"]||[];for(var j=0;j<commands.length;++j){var command=commands[j];var parameters=command["parameters"];var paramsText=[];for(var k=0;parameters&&k<parameters.length;++k){var parameter=parameters[k];var type;if(parameter.type)
type=jsTypes[parameter.type]||parameter.type;else{var ref=parameter["$ref"];if(ref.indexOf(".")!==-1)
type=rawTypes[ref];else
type=rawTypes[domain.domain+"."+ref];}
var text="{\"name\": \""+parameter.name+"\", \"type\": \""+type+"\", \"optional\": "+(parameter.optional?"true":"false")+"}";paramsText.push(text);}
var returnsText=[];var returns=command["returns"]||[];for(var k=0;k<returns.length;++k){var parameter=returns[k];returnsText.push("\""+parameter.name+"\"");}
var hasErrorData=String(Boolean(command.error));result.push("InspectorBackend.registerCommand(\""+domain.domain+"."+command.name+"\", ["+paramsText.join(", ")+"], ["+returnsText.join(", ")+"], "+hasErrorData+");");}
for(var j=0;domain.events&&j<domain.events.length;++j){var event=domain.events[j];var paramsText=[];for(var k=0;event.parameters&&k<event.parameters.length;++k){var parameter=event.parameters[k];paramsText.push("\""+parameter.name+"\"");}
result.push("InspectorBackend.registerEvent(\""+domain.domain+"."+event.name+"\", ["+paramsText.join(", ")+"]);");}}
return result.join("\n");}
WebInspector.InspectorBackendHostedMode.loadFromJSONIfNeeded("../protocol.json");;WebInspector.Target=function(targetManager,name,type,connection,parentTarget)
{Protocol.Agents.call(this,connection.agentsMap());this._targetManager=targetManager;this._name=name;this._type=type;this._connection=connection;this._parentTarget=parentTarget;connection.addEventListener(InspectorBackendClass.Connection.Events.Disconnected,this._onDisconnect,this);this._id=WebInspector.Target._nextId++;this._modelByConstructor=new Map();this.consoleModel=new WebInspector.ConsoleModel(this);this.networkManager=new WebInspector.NetworkManager(this);this.resourceTreeModel=new WebInspector.ResourceTreeModel(this);this.networkLog=new WebInspector.NetworkLog(this);this.runtimeModel=new WebInspector.RuntimeModel(this);if(this.hasJSContext())
new WebInspector.DebuggerModel(this);if(this._type===WebInspector.Target.Type.Page){new WebInspector.DOMModel(this);new WebInspector.CSSStyleModel(this);}
this.workerManager=!this.isDedicatedWorker()?new WebInspector.WorkerManager(this):null;this.cpuProfilerModel=new WebInspector.CPUProfilerModel(this);this.heapProfilerModel=new WebInspector.HeapProfilerModel(this);this.tracingManager=new WebInspector.TracingManager(this);if(this.isPage())
this.serviceWorkerManager=new WebInspector.ServiceWorkerManager(this);}
WebInspector.Target.Type={Page:1,DedicatedWorker:2,ServiceWorker:4}
WebInspector.Target._nextId=1;WebInspector.Target.prototype={id:function()
{return this._id;},name:function()
{return this._name;},targetManager:function()
{return this._targetManager;},decorateLabel:function(label)
{return this.isWorker()?"\u2699 "+label:label;},registerDispatcher:function(domain,dispatcher)
{this._connection.registerDispatcher(domain,dispatcher);},isPage:function()
{return this._type===WebInspector.Target.Type.Page;},isWorker:function()
{return this.isDedicatedWorker()||this.isServiceWorker();},isDedicatedWorker:function()
{return this._type===WebInspector.Target.Type.DedicatedWorker;},isServiceWorker:function()
{return this._type===WebInspector.Target.Type.ServiceWorker;},hasJSContext:function()
{return!this.isServiceWorker();},parentTarget:function()
{return this._parentTarget;},_onDisconnect:function()
{this._targetManager.removeTarget(this);this._dispose();},_dispose:function()
{this._targetManager.dispatchEventToListeners(WebInspector.TargetManager.Events.TargetDisposed,this);this.networkManager.dispose();this.cpuProfilerModel.dispose();WebInspector.ServiceWorkerCacheModel.fromTarget(this).dispose();if(this.workerManager)
this.workerManager.dispose();},isDetached:function()
{return this._connection.isClosed();},model:function(modelClass)
{return this._modelByConstructor.get(modelClass)||null;},__proto__:Protocol.Agents.prototype}
WebInspector.SDKObject=function(target)
{WebInspector.Object.call(this);this._target=target;}
WebInspector.SDKObject.prototype={target:function()
{return this._target;},__proto__:WebInspector.Object.prototype}
WebInspector.SDKModel=function(modelClass,target)
{WebInspector.SDKObject.call(this,target);target._modelByConstructor.set(modelClass,this);}
WebInspector.SDKModel.prototype={suspendModel:function()
{return Promise.resolve();},resumeModel:function()
{return Promise.resolve();},__proto__:WebInspector.SDKObject.prototype}
WebInspector.TargetManager=function()
{WebInspector.Object.call(this);this._targets=[];this._observers=[];this._observerTypeSymbol=Symbol("observerType");this._modelListeners={};this._isSuspended=false;}
WebInspector.TargetManager.Events={InspectedURLChanged:"InspectedURLChanged",MainFrameNavigated:"MainFrameNavigated",Load:"Load",PageReloadRequested:"PageReloadRequested",WillReloadPage:"WillReloadPage",TargetDisposed:"TargetDisposed",SuspendStateChanged:"SuspendStateChanged"}
WebInspector.TargetManager.prototype={suspendAllTargets:function()
{if(this._isSuspended)
return;this._isSuspended=true;this.dispatchEventToListeners(WebInspector.TargetManager.Events.SuspendStateChanged);for(var i=0;i<this._targets.length;++i){for(var model of this._targets[i]._modelByConstructor.values())
model.suspendModel();}},resumeAllTargets:function()
{if(!this._isSuspended)
throw new Error("Not suspended");this._isSuspended=false;this.dispatchEventToListeners(WebInspector.TargetManager.Events.SuspendStateChanged);var promises=[];for(var i=0;i<this._targets.length;++i){for(var model of this._targets[i]._modelByConstructor.values())
promises.push(model.resumeModel());}
return Promise.all(promises);},suspendAndResumeAllTargets:function()
{this.suspendAllTargets();this.resumeAllTargets();},allTargetsSuspended:function()
{return this._isSuspended;},inspectedPageURL:function()
{if(!this._targets.length)
return"";return this._targets[0].resourceTreeModel.inspectedPageURL();},inspectedPageDomain:function()
{if(!this._targets.length)
return"";return this._targets[0].resourceTreeModel.inspectedPageDomain();},_redispatchEvent:function(event)
{this.dispatchEventToListeners(event.type,event.data);},reloadPage:function(ignoreCache,injectedScript)
{if(this._targets.length)
this._targets[0].resourceTreeModel.reloadPage(ignoreCache,injectedScript);},addModelListener:function(modelClass,eventType,listener,thisObject)
{for(var i=0;i<this._targets.length;++i){var model=this._targets[i]._modelByConstructor.get(modelClass);if(model)
model.addEventListener(eventType,listener,thisObject);}
if(!this._modelListeners[eventType])
this._modelListeners[eventType]=[];this._modelListeners[eventType].push({modelClass:modelClass,thisObject:thisObject,listener:listener});},removeModelListener:function(modelClass,eventType,listener,thisObject)
{if(!this._modelListeners[eventType])
return;for(var i=0;i<this._targets.length;++i){var model=this._targets[i]._modelByConstructor.get(modelClass);if(model)
model.removeEventListener(eventType,listener,thisObject);}
var listeners=this._modelListeners[eventType];for(var i=0;i<listeners.length;++i){if(listeners[i].modelClass===modelClass&&listeners[i].listener===listener&&listeners[i].thisObject===thisObject)
listeners.splice(i--,1);}
if(!listeners.length)
delete this._modelListeners[eventType];},observeTargets:function(targetObserver,type)
{if(this._observerTypeSymbol in targetObserver)
throw new Error("Observer can only be registered once");targetObserver[this._observerTypeSymbol]=type||0x7fff;this.targets(type).forEach(targetObserver.targetAdded.bind(targetObserver));this._observers.push(targetObserver);},unobserveTargets:function(targetObserver)
{delete targetObserver[this._observerTypeSymbol];this._observers.remove(targetObserver);},createTarget:function(name,type,connection,parentTarget)
{var target=new WebInspector.Target(this,name,type,connection,parentTarget);this.addTarget(target);return target;},_observersByType:function(type)
{var result=[];for(var observer of this._observers){if(observer[this._observerTypeSymbol]&type)
result.push(observer);}
return result;},addTarget:function(target)
{this._targets.push(target);if(this._targets.length===1){target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged,this._redispatchEvent,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._redispatchEvent,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.Load,this._redispatchEvent,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.PageReloadRequested,this._redispatchEvent,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.WillReloadPage,this._redispatchEvent,this);}
var copy=this._observersByType(target._type);for(var i=0;i<copy.length;++i)
copy[i].targetAdded(target);for(var eventType in this._modelListeners){var listeners=this._modelListeners[eventType];for(var i=0;i<listeners.length;++i){var model=target._modelByConstructor.get(listeners[i].modelClass);if(model)
model.addEventListener(eventType,listeners[i].listener,listeners[i].thisObject);}}},removeTarget:function(target)
{this._targets.remove(target);if(this._targets.length===0){target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged,this._redispatchEvent,this);target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._redispatchEvent,this);target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.Load,this._redispatchEvent,this);target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.WillReloadPage,this._redispatchEvent,this);}
var copy=this._observersByType(target._type);for(var i=0;i<copy.length;++i)
copy[i].targetRemoved(target);for(var eventType in this._modelListeners){var listeners=this._modelListeners[eventType];for(var i=0;i<listeners.length;++i){var model=target._modelByConstructor.get(listeners[i].modelClass);if(model)
model.removeEventListener(eventType,listeners[i].listener,listeners[i].thisObject);}}},hasTargets:function(type)
{return!!this.targets(type).length;},targets:function(type)
{if(!type)
return this._targets.slice();var result=[];for(var target of this._targets){if(target._type&type)
result.push(target);}
return result;},targetsWithJSContext:function()
{var result=[];for(var target of this._targets){if(target.hasJSContext())
result.push(target);}
return result;},targetById:function(id)
{for(var i=0;i<this._targets.length;++i){if(this._targets[i].id()===id)
return this._targets[i];}
return null;},mainTarget:function()
{return this._targets[0]||null;},__proto__:WebInspector.Object.prototype}
WebInspector.TargetManager.Observer=function()
{}
WebInspector.TargetManager.Observer.prototype={targetAdded:function(target){},targetRemoved:function(target){},}
WebInspector.targetManager=new WebInspector.TargetManager();;WebInspector.ApplicationCacheModel=function(target)
{WebInspector.SDKObject.call(this,target);target.registerApplicationCacheDispatcher(new WebInspector.ApplicationCacheDispatcher(this));this._agent=target.applicationCacheAgent();this._agent.enable();target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated,this._frameNavigated,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameDetached,this._frameDetached,this);this._statuses={};this._manifestURLsByFrame={};this._mainFrameNavigated();this._onLine=true;}
WebInspector.ApplicationCacheModel.EventTypes={FrameManifestStatusUpdated:"FrameManifestStatusUpdated",FrameManifestAdded:"FrameManifestAdded",FrameManifestRemoved:"FrameManifestRemoved",NetworkStateChanged:"NetworkStateChanged"}
WebInspector.ApplicationCacheModel.prototype={_frameNavigated:function(event)
{var frame=(event.data);if(frame.isMainFrame()){this._mainFrameNavigated();return;}
this._agent.getManifestForFrame(frame.id,this._manifestForFrameLoaded.bind(this,frame.id));},_frameDetached:function(event)
{var frame=(event.data);this._frameManifestRemoved(frame.id);},_mainFrameNavigated:function()
{this._agent.getFramesWithManifests(this._framesWithManifestsLoaded.bind(this));},_manifestForFrameLoaded:function(frameId,error,manifestURL)
{if(error){console.error(error);return;}
if(!manifestURL)
this._frameManifestRemoved(frameId);},_framesWithManifestsLoaded:function(error,framesWithManifests)
{if(error){console.error(error);return;}
for(var i=0;i<framesWithManifests.length;++i)
this._frameManifestUpdated(framesWithManifests[i].frameId,framesWithManifests[i].manifestURL,framesWithManifests[i].status);},_frameManifestUpdated:function(frameId,manifestURL,status)
{if(status===applicationCache.UNCACHED){this._frameManifestRemoved(frameId);return;}
if(!manifestURL)
return;if(this._manifestURLsByFrame[frameId]&&manifestURL!==this._manifestURLsByFrame[frameId])
this._frameManifestRemoved(frameId);var statusChanged=this._statuses[frameId]!==status;this._statuses[frameId]=status;if(!this._manifestURLsByFrame[frameId]){this._manifestURLsByFrame[frameId]=manifestURL;this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.FrameManifestAdded,frameId);}
if(statusChanged)
this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.FrameManifestStatusUpdated,frameId);},_frameManifestRemoved:function(frameId)
{if(!this._manifestURLsByFrame[frameId])
return;delete this._manifestURLsByFrame[frameId];delete this._statuses[frameId];this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.FrameManifestRemoved,frameId);},frameManifestURL:function(frameId)
{return this._manifestURLsByFrame[frameId]||"";},frameManifestStatus:function(frameId)
{return this._statuses[frameId]||applicationCache.UNCACHED;},get onLine()
{return this._onLine;},_statusUpdated:function(frameId,manifestURL,status)
{this._frameManifestUpdated(frameId,manifestURL,status);},requestApplicationCache:function(frameId,callback)
{function callbackWrapper(error,applicationCache)
{if(error){console.error(error);callback(null);return;}
callback(applicationCache);}
this._agent.getApplicationCacheForFrame(frameId,callbackWrapper);},_networkStateUpdated:function(isNowOnline)
{this._onLine=isNowOnline;this.dispatchEventToListeners(WebInspector.ApplicationCacheModel.EventTypes.NetworkStateChanged,isNowOnline);},__proto__:WebInspector.SDKObject.prototype}
WebInspector.ApplicationCacheDispatcher=function(applicationCacheModel)
{this._applicationCacheModel=applicationCacheModel;}
WebInspector.ApplicationCacheDispatcher.prototype={applicationCacheStatusUpdated:function(frameId,manifestURL,status)
{this._applicationCacheModel._statusUpdated(frameId,manifestURL,status);},networkStateUpdated:function(isNowOnline)
{this._applicationCacheModel._networkStateUpdated(isNowOnline);}};WebInspector.ConsoleModel=function(target)
{WebInspector.SDKModel.call(this,WebInspector.ConsoleModel,target);this._messages=[];this._messageById=new Map();this._warnings=0;this._errors=0;this._revokedErrors=0;this._consoleAgent=target.consoleAgent();target.registerConsoleDispatcher(new WebInspector.ConsoleDispatcher(this));this._enableAgent();}
WebInspector.ConsoleModel.Events={ConsoleCleared:"ConsoleCleared",MessageAdded:"MessageAdded",MessageUpdated:"MessageUpdated",CommandEvaluated:"CommandEvaluated",}
WebInspector.ConsoleModel.prototype={_enableAgent:function()
{this._enablingConsole=true;function callback()
{delete this._enablingConsole;}
this._consoleAgent.enable(callback.bind(this));},addMessage:function(msg)
{if(this._isBlacklisted(msg))
return;if(msg.level===WebInspector.ConsoleMessage.MessageLevel.RevokedError&&msg._relatedMessageId){var relatedMessage=this._messageById.get(msg._relatedMessageId);if(!relatedMessage)
return;this._errors--;this._revokedErrors++;relatedMessage.level=WebInspector.ConsoleMessage.MessageLevel.RevokedError;this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.MessageUpdated,relatedMessage);return;}
this._messages.push(msg);if(msg._messageId)
this._messageById.set(msg._messageId,msg);this._incrementErrorWarningCount(msg);this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.MessageAdded,msg);},_incrementErrorWarningCount:function(msg)
{switch(msg.level){case WebInspector.ConsoleMessage.MessageLevel.Warning:this._warnings++;break;case WebInspector.ConsoleMessage.MessageLevel.Error:this._errors++;break;case WebInspector.ConsoleMessage.MessageLevel.RevokedError:this._revokedErrors++;break;}},_isBlacklisted:function(msg)
{if(msg.source!=WebInspector.ConsoleMessage.MessageSource.Network||msg.level!=WebInspector.ConsoleMessage.MessageLevel.Error||!msg.url||!msg.url.startsWith("chrome-extension"))
return false;if(msg.url.includes("://boadgeojelhgndaghljhdicfkmllpafd")||msg.url.includes("://dliochdbjfkdbacpmhlcpmleaejidimm")||msg.url.includes("://pkedcjkdefgpdelpbcmbmeomcjbeemfm")||msg.url.includes("://ekpaaapppgpmolpcldedioblbkmijaca"))
return true;return false;},messages:function()
{return this._messages;},requestClearMessages:function()
{this._consoleAgent.clearMessages();this._messagesCleared();},_messagesCleared:function()
{this._messages=[];this._messageById.clear();this._errors=0;this._revokedErrors=0;this._warnings=0;this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.ConsoleCleared);},errors:function()
{return this._errors;},revokedErrors:function()
{return this._revokedErrors;},warnings:function()
{return this._warnings;},__proto__:WebInspector.SDKModel.prototype}
WebInspector.ConsoleModel.evaluateCommandInConsole=function(executionContext,text,useCommandLineAPI)
{var target=executionContext.target();var commandMessage=new WebInspector.ConsoleMessage(target,WebInspector.ConsoleMessage.MessageSource.JS,null,text,WebInspector.ConsoleMessage.MessageType.Command);commandMessage.setExecutionContextId(executionContext.id);target.consoleModel.addMessage(commandMessage);function printResult(result,wasThrown,valueResult,exceptionDetails)
{if(!result)
return;WebInspector.console.showPromise().then(reportUponEvaluation);function reportUponEvaluation()
{target.consoleModel.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEvaluated,{result:result,wasThrown:wasThrown,text:text,commandMessage:commandMessage,exceptionDetails:exceptionDetails});}}
if(/^\s*\{/.test(text)&&/\}\s*$/.test(text))
text='('+text+')';executionContext.evaluate(text,"console",!!useCommandLineAPI,false,false,true,printResult);WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ConsoleEvaluated);}
WebInspector.ConsoleModel.clearConsole=function()
{var targets=WebInspector.targetManager.targets();for(var i=0;i<targets.length;++i)
targets[i].consoleModel.requestClearMessages();}
WebInspector.ConsoleMessage=function(target,source,level,messageText,type,url,line,column,requestId,parameters,stackTrace,timestamp,executionContextId,asyncStackTrace,scriptId,messageId,relatedMessageId)
{this._target=target;this.source=source;this.level=level;this.messageText=messageText;this.type=type||WebInspector.ConsoleMessage.MessageType.Log;this.url=url||undefined;this.line=line||0;this.column=column||0;this.parameters=parameters;this.stackTrace=stackTrace;this.timestamp=timestamp||Date.now();this.executionContextId=executionContextId||0;this.asyncStackTrace=asyncStackTrace;this.scriptId=scriptId||null;this._messageId=messageId||0;this._relatedMessageId=relatedMessageId||0;this.request=requestId?target.networkLog.requestForId(requestId):null;if(this.request){var initiator=this.request.initiator();if(initiator){this.stackTrace=initiator.stackTrace||undefined;this.asyncStackTrace=initiator.asyncStackTrace;if(initiator.url){this.url=initiator.url;this.line=initiator.lineNumber||0;}}}}
WebInspector.ConsoleMessage.prototype={target:function()
{return this._target;},setOriginatingMessage:function(originatingMessage)
{this._originatingConsoleMessage=originatingMessage;this.executionContextId=originatingMessage.executionContextId;},setExecutionContextId:function(executionContextId)
{this.executionContextId=executionContextId;},originatingMessage:function()
{return this._originatingConsoleMessage;},isGroupMessage:function()
{return this.type===WebInspector.ConsoleMessage.MessageType.StartGroup||this.type===WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed||this.type===WebInspector.ConsoleMessage.MessageType.EndGroup;},isGroupStartMessage:function()
{return this.type===WebInspector.ConsoleMessage.MessageType.StartGroup||this.type===WebInspector.ConsoleMessage.MessageType.StartGroupCollapsed;},isErrorOrWarning:function()
{return(this.level===WebInspector.ConsoleMessage.MessageLevel.Warning||this.level===WebInspector.ConsoleMessage.MessageLevel.Error);},isEqual:function(msg)
{if(!msg)
return false;if(this._messageId||msg._messageId)
return false;if(this._relatedMessageId||msg._relatedMessageId)
return false;if(!this._isEqualStackTraces(this.stackTrace,msg.stackTrace))
return false;var asyncTrace1=this.asyncStackTrace;var asyncTrace2=msg.asyncStackTrace;while(asyncTrace1||asyncTrace2){if(!asyncTrace1||!asyncTrace2)
return false;if(asyncTrace1.description!==asyncTrace2.description)
return false;if(!this._isEqualStackTraces(asyncTrace1.callFrames,asyncTrace2.callFrames))
return false;asyncTrace1=asyncTrace1.asyncStackTrace;asyncTrace2=asyncTrace2.asyncStackTrace;}
if(this.parameters){if(!msg.parameters||this.parameters.length!==msg.parameters.length)
return false;for(var i=0;i<msg.parameters.length;++i){if(this.parameters[i].type!==msg.parameters[i].type||msg.parameters[i].type==="object"||this.parameters[i].value!==msg.parameters[i].value)
return false;}}
return(this.target()===msg.target())&&(this.source===msg.source)&&(this.type===msg.type)&&(this.level===msg.level)&&(this.line===msg.line)&&(this.url===msg.url)&&(this.messageText===msg.messageText)&&(this.request===msg.request)&&(this.executionContextId===msg.executionContextId)&&(this.scriptId===msg.scriptId);},_isEqualStackTraces:function(stackTrace1,stackTrace2)
{stackTrace1=stackTrace1||[];stackTrace2=stackTrace2||[];if(stackTrace1.length!==stackTrace2.length)
return false;for(var i=0,n=stackTrace1.length;i<n;++i){if(stackTrace1[i].url!==stackTrace2[i].url||stackTrace1[i].functionName!==stackTrace2[i].functionName||stackTrace1[i].lineNumber!==stackTrace2[i].lineNumber||stackTrace1[i].columnNumber!==stackTrace2[i].columnNumber)
return false;}
return true;}}
WebInspector.ConsoleMessage.MessageSource={XML:"xml",JS:"javascript",Network:"network",ConsoleAPI:"console-api",Storage:"storage",AppCache:"appcache",Rendering:"rendering",CSS:"css",Security:"security",Other:"other",Deprecation:"deprecation"}
WebInspector.ConsoleMessage.MessageType={Log:"log",Dir:"dir",DirXML:"dirxml",Table:"table",Trace:"trace",Clear:"clear",StartGroup:"startGroup",StartGroupCollapsed:"startGroupCollapsed",EndGroup:"endGroup",Assert:"assert",Result:"result",Profile:"profile",ProfileEnd:"profileEnd",Command:"command"}
WebInspector.ConsoleMessage.MessageLevel={Log:"log",Info:"info",Warning:"warning",Error:"error",Debug:"debug",RevokedError:"revokedError"};WebInspector.ConsoleMessage.timestampComparator=function(a,b)
{return a.timestamp-b.timestamp;}
WebInspector.ConsoleDispatcher=function(console)
{this._console=console;}
WebInspector.ConsoleDispatcher.prototype={messageAdded:function(payload)
{var consoleMessage=new WebInspector.ConsoleMessage(this._console.target(),payload.source,payload.level,payload.text,payload.type,payload.url,payload.line,payload.column,payload.networkRequestId,payload.parameters,payload.stackTrace,payload.timestamp*1000,payload.executionContextId,payload.asyncStackTrace,payload.scriptId,payload.messageId,payload.relatedMessageId);this._console.addMessage(consoleMessage);},messageRepeatCountUpdated:function(count)
{},messagesCleared:function()
{if(!WebInspector.moduleSetting("preserveConsoleLog").get())
this._console._messagesCleared();}}
WebInspector.MultitargetConsoleModel=function()
{WebInspector.targetManager.observeTargets(this);WebInspector.targetManager.addModelListener(WebInspector.ConsoleModel,WebInspector.ConsoleModel.Events.MessageAdded,this._consoleMessageAdded,this);WebInspector.targetManager.addModelListener(WebInspector.ConsoleModel,WebInspector.ConsoleModel.Events.MessageUpdated,this._consoleMessageUpdated,this);WebInspector.targetManager.addModelListener(WebInspector.ConsoleModel,WebInspector.ConsoleModel.Events.CommandEvaluated,this._commandEvaluated,this);}
WebInspector.MultitargetConsoleModel.prototype={targetAdded:function(target)
{if(!this._mainTarget){this._mainTarget=target;target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared,this._consoleCleared,this);}},targetRemoved:function(target)
{if(this._mainTarget===target){delete this._mainTarget;target.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared,this._consoleCleared,this);}},messages:function()
{var targets=WebInspector.targetManager.targets();var result=[];for(var i=0;i<targets.length;++i)
result=result.concat(targets[i].consoleModel.messages());return result;},_consoleCleared:function()
{this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.ConsoleCleared);},_consoleMessageAdded:function(event)
{this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.MessageAdded,event.data);},_consoleMessageUpdated:function(event)
{this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.MessageUpdated,event.data);},_commandEvaluated:function(event)
{this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEvaluated,event.data);},__proto__:WebInspector.Object.prototype}
WebInspector.multitargetConsoleModel;;WebInspector.CompilerSourceMappingContentProvider=function(sourceURL,contentType)
{this._sourceURL=sourceURL;this._contentType=contentType;}
WebInspector.CompilerSourceMappingContentProvider.prototype={contentURL:function()
{return this._sourceURL;},contentType:function()
{return this._contentType;},requestContent:function(callback)
{WebInspector.multitargetNetworkManager.loadResource(this._sourceURL,contentLoaded.bind(this));function contentLoaded(statusCode,headers,content)
{if(statusCode>=400){console.error("Could not load content for "+this._sourceURL+" : "+"HTTP status code: "+statusCode);callback(null);return;}
callback(content);}},searchInContent:function(query,caseSensitive,isRegex,callback)
{this.requestContent(contentLoaded);function contentLoaded(content)
{if(typeof content!=="string"){callback([]);return;}
callback(WebInspector.ContentProvider.performSearchInContent(content,query,caseSensitive,isRegex));}}};WebInspector.CookieParser=function(target)
{this._target=target;}
WebInspector.CookieParser.KeyValue=function(key,value,position)
{this.key=key;this.value=value;this.position=position;}
WebInspector.CookieParser.prototype={cookies:function()
{return this._cookies;},parseCookie:function(cookieHeader)
{if(!this._initialize(cookieHeader))
return null;for(var kv=this._extractKeyValue();kv;kv=this._extractKeyValue()){if(kv.key.charAt(0)==="$"&&this._lastCookie)
this._lastCookie.addAttribute(kv.key.slice(1),kv.value);else if(kv.key.toLowerCase()!=="$version"&&typeof kv.value==="string")
this._addCookie(kv,WebInspector.Cookie.Type.Request);this._advanceAndCheckCookieDelimiter();}
this._flushCookie();return this._cookies;},parseSetCookie:function(setCookieHeader)
{if(!this._initialize(setCookieHeader))
return null;for(var kv=this._extractKeyValue();kv;kv=this._extractKeyValue()){if(this._lastCookie)
this._lastCookie.addAttribute(kv.key,kv.value);else
this._addCookie(kv,WebInspector.Cookie.Type.Response);if(this._advanceAndCheckCookieDelimiter())
this._flushCookie();}
this._flushCookie();return this._cookies;},_initialize:function(headerValue)
{this._input=headerValue;if(typeof headerValue!=="string")
return false;this._cookies=[];this._lastCookie=null;this._originalInputLength=this._input.length;return true;},_flushCookie:function()
{if(this._lastCookie)
this._lastCookie.setSize(this._originalInputLength-this._input.length-this._lastCookiePosition);this._lastCookie=null;},_extractKeyValue:function()
{if(!this._input||!this._input.length)
return null;var keyValueMatch=/^[ \t]*([^\s=;]+)[ \t]*(?:=[ \t]*([^;\n]*))?/.exec(this._input);if(!keyValueMatch){console.log("Failed parsing cookie header before: "+this._input);return null;}
var result=new WebInspector.CookieParser.KeyValue(keyValueMatch[1],keyValueMatch[2]&&keyValueMatch[2].trim(),this._originalInputLength-this._input.length);this._input=this._input.slice(keyValueMatch[0].length);return result;},_advanceAndCheckCookieDelimiter:function()
{var match=/^\s*[\n;]\s*/.exec(this._input);if(!match)
return false;this._input=this._input.slice(match[0].length);return match[0].match("\n")!==null;},_addCookie:function(keyValue,type)
{if(this._lastCookie)
this._lastCookie.setSize(keyValue.position-this._lastCookiePosition);this._lastCookie=typeof keyValue.value==="string"?new WebInspector.Cookie(this._target,keyValue.key,keyValue.value,type):new WebInspector.Cookie(this._target,"",keyValue.key,type);this._lastCookiePosition=keyValue.position;this._cookies.push(this._lastCookie);}};WebInspector.CookieParser.parseCookie=function(target,header)
{return(new WebInspector.CookieParser(target)).parseCookie(header);}
WebInspector.CookieParser.parseSetCookie=function(target,header)
{return(new WebInspector.CookieParser(target)).parseSetCookie(header);}
WebInspector.Cookie=function(target,name,value,type)
{this._target=target;this._name=name;this._value=value;this._type=type;this._attributes={};}
WebInspector.Cookie.prototype={name:function()
{return this._name;},value:function()
{return this._value;},type:function()
{return this._type;},httpOnly:function()
{return"httponly"in this._attributes;},secure:function()
{return"secure"in this._attributes;},firstPartyOnly:function()
{return"first-party-only"in this._attributes;},session:function()
{return!("expires"in this._attributes||"max-age"in this._attributes);},path:function()
{return this._attributes["path"];},port:function()
{return this._attributes["port"];},domain:function()
{return this._attributes["domain"];},expires:function()
{return this._attributes["expires"];},maxAge:function()
{return this._attributes["max-age"];},size:function()
{return this._size;},setSize:function(size)
{this._size=size;},expiresDate:function(requestDate)
{if(this.maxAge()){var targetDate=requestDate===null?new Date():requestDate;return new Date(targetDate.getTime()+1000*this.maxAge());}
if(this.expires())
return new Date(this.expires());return null;},attributes:function()
{return this._attributes;},addAttribute:function(key,value)
{this._attributes[key.toLowerCase()]=value;},remove:function(callback)
{this._target.networkAgent().deleteCookie(this.name(),(this.secure()?"https://":"http://")+this.domain()+this.path(),callback);}}
WebInspector.Cookie.Type={Request:0,Response:1};WebInspector.Cookies={}
WebInspector.Cookies.getCookiesAsync=function(callback)
{var allCookies=[];function mycallback(target,error,cookies)
{if(error){console.error(error);return;}
for(var i=0;i<cookies.length;++i)
allCookies.push(WebInspector.Cookies._parseProtocolCookie(target,cookies[i]));}
var barrier=new CallbackBarrier();for(var target of WebInspector.targetManager.targets(WebInspector.Target.Type.Page))
target.networkAgent().getCookies(barrier.createCallback(mycallback.bind(null,target)));barrier.callWhenDone(callback.bind(null,allCookies));}
WebInspector.Cookies._parseProtocolCookie=function(target,protocolCookie)
{var cookie=new WebInspector.Cookie(target,protocolCookie.name,protocolCookie.value,null);cookie.addAttribute("domain",protocolCookie["domain"]);cookie.addAttribute("path",protocolCookie["path"]);cookie.addAttribute("port",protocolCookie["port"]);if(protocolCookie["expires"])
cookie.addAttribute("expires",protocolCookie["expires"]);if(protocolCookie["httpOnly"])
cookie.addAttribute("httpOnly");if(protocolCookie["secure"])
cookie.addAttribute("secure");if(protocolCookie["firstPartyOnly"])
cookie.addAttribute("first-party-only");cookie.setSize(protocolCookie["size"]);return cookie;}
WebInspector.Cookies.cookieMatchesResourceURL=function(cookie,resourceURL)
{var url=resourceURL.asParsedURL();if(!url||!WebInspector.Cookies.cookieDomainMatchesResourceDomain(cookie.domain(),url.host))
return false;return(url.path.startsWith(cookie.path())&&(!cookie.port()||url.port==cookie.port())&&(!cookie.secure()||url.scheme==="https"));}
WebInspector.Cookies.cookieDomainMatchesResourceDomain=function(cookieDomain,resourceDomain)
{if(cookieDomain.charAt(0)!=='.')
return resourceDomain===cookieDomain;return!!resourceDomain.match(new RegExp("^([^\\.]+\\.)*"+cookieDomain.substring(1).escapeForRegExp()+"$","i"));};WebInspector.CPUProfileDataModel=function(profile)
{this.profileHead=profile.head;this.samples=profile.samples;this.timestamps=profile.timestamps;this.profileStartTime=profile.startTime*1000;this.profileEndTime=profile.endTime*1000;this._assignParentsInProfile();if(this.samples){this._normalizeTimestamps();this._buildIdToNodeMap();this._fixMissingSamples();}
if(!WebInspector.moduleSetting("showNativeFunctionsInJSProfile").get())
this._filterNativeFrames();this._assignDepthsInProfile();this._calculateTimes(profile);}
WebInspector.CPUProfileDataModel.prototype={_calculateTimes:function(profile)
{function totalHitCount(node){var result=node.hitCount;for(var i=0;i<node.children.length;i++)
result+=totalHitCount(node.children[i]);return result;}
profile.totalHitCount=totalHitCount(profile.head);var duration=this.profileEndTime-this.profileStartTime;var samplingInterval=duration/profile.totalHitCount;this.samplingInterval=samplingInterval;function calculateTimesForNode(node){node.selfTime=node.hitCount*samplingInterval;var totalHitCount=node.hitCount;for(var i=0;i<node.children.length;i++)
totalHitCount+=calculateTimesForNode(node.children[i]);node.totalTime=totalHitCount*samplingInterval;return totalHitCount;}
calculateTimesForNode(profile.head);},_filterNativeFrames:function()
{if(this.samples){for(var i=0;i<this.samples.length;++i){var node=this.nodeByIndex(i);while(isNativeNode(node))
node=node.parent;this.samples[i]=node.id;}}
processSubtree(this.profileHead);function isNativeNode(node)
{return!!node.url&&node.url.startsWith("native ");}
function processSubtree(node)
{var nativeChildren=[];var children=node.children;for(var i=0,j=0;i<children.length;++i){var child=children[i];if(isNativeNode(child)){nativeChildren.push(child);}else{children[j++]=child;processSubtree(child);}}
children.length=j;nativeChildren.forEach(mergeChildren.bind(null,node));}
function mergeChildren(node,nativeNode)
{node.hitCount+=nativeNode.hitCount;for(var i=0;i<nativeNode.children.length;++i){var child=nativeNode.children[i];if(isNativeNode(child)){mergeChildren(node,child);}else{node.children.push(child);child.parent=node;processSubtree(child);}}}},_assignParentsInProfile:function()
{var head=this.profileHead;head.parent=null;var nodesToTraverse=[head];while(nodesToTraverse.length){var parent=nodesToTraverse.pop();var children=parent.children;var length=children.length;for(var i=0;i<length;++i){var child=children[i];child.parent=parent;if(child.children.length)
nodesToTraverse.push(child);}}},_assignDepthsInProfile:function()
{var head=this.profileHead;head.depth=-1;this.maxDepth=0;var nodesToTraverse=[head];while(nodesToTraverse.length){var parent=nodesToTraverse.pop();var depth=parent.depth+1;if(depth>this.maxDepth)
this.maxDepth=depth;var children=parent.children;var length=children.length;for(var i=0;i<length;++i){var child=children[i];child.depth=depth;if(child.children.length)
nodesToTraverse.push(child);}}},_normalizeTimestamps:function()
{var timestamps=this.timestamps;if(!timestamps){var profileStartTime=this.profileStartTime;var interval=(this.profileEndTime-profileStartTime)/this.samples.length;timestamps=new Float64Array(this.samples.length+1);for(var i=0;i<timestamps.length;++i)
timestamps[i]=profileStartTime+i*interval;this.timestamps=timestamps;return;}
for(var i=0;i<timestamps.length;++i)
timestamps[i]/=1000;var averageSample=(timestamps.peekLast()-timestamps[0])/(timestamps.length-1);this.timestamps.push(timestamps.peekLast()+averageSample);this.profileStartTime=timestamps[0];this.profileEndTime=timestamps.peekLast();},_buildIdToNodeMap:function()
{this._idToNode={};var idToNode=this._idToNode;var stack=[this.profileHead];while(stack.length){var node=stack.pop();idToNode[node.id]=node;for(var i=0;i<node.children.length;i++)
stack.push(node.children[i]);}
var topLevelNodes=this.profileHead.children;for(var i=0;i<topLevelNodes.length&&!(this.gcNode&&this.programNode&&this.idleNode);i++){var node=topLevelNodes[i];if(node.functionName==="(garbage collector)")
this.gcNode=node;else if(node.functionName==="(program)")
this.programNode=node;else if(node.functionName==="(idle)")
this.idleNode=node;}},_fixMissingSamples:function()
{var samples=this.samples;var samplesCount=samples.length;if(!this.programNode||samplesCount<3)
return;var idToNode=this._idToNode;var programNodeId=this.programNode.id;var gcNodeId=this.gcNode?this.gcNode.id:-1;var idleNodeId=this.idleNode?this.idleNode.id:-1;var prevNodeId=samples[0];var nodeId=samples[1];for(var sampleIndex=1;sampleIndex<samplesCount-1;sampleIndex++){var nextNodeId=samples[sampleIndex+1];if(nodeId===programNodeId&&!isSystemNode(prevNodeId)&&!isSystemNode(nextNodeId)&&bottomNode(idToNode[prevNodeId])===bottomNode(idToNode[nextNodeId])){samples[sampleIndex]=prevNodeId;}
prevNodeId=nodeId;nodeId=nextNodeId;}
function bottomNode(node)
{while(node.parent)
node=node.parent;return node;}
function isSystemNode(nodeId)
{return nodeId===programNodeId||nodeId===gcNodeId||nodeId===idleNodeId;}},forEachFrame:function(openFrameCallback,closeFrameCallback,startTime,stopTime)
{if(!this.profileHead)
return;startTime=startTime||0;stopTime=stopTime||Infinity;var samples=this.samples;var timestamps=this.timestamps;var idToNode=this._idToNode;var gcNode=this.gcNode;var samplesCount=samples.length;var startIndex=timestamps.lowerBound(startTime);var stackTop=0;var stackNodes=[];var prevId=this.profileHead.id;var sampleTime=timestamps[samplesCount];var gcParentNode=null;if(!this._stackStartTimes)
this._stackStartTimes=new Float64Array(this.maxDepth+2);var stackStartTimes=this._stackStartTimes;if(!this._stackChildrenDuration)
this._stackChildrenDuration=new Float64Array(this.maxDepth+2);var stackChildrenDuration=this._stackChildrenDuration;for(var sampleIndex=startIndex;sampleIndex<samplesCount;sampleIndex++){sampleTime=timestamps[sampleIndex];if(sampleTime>=stopTime)
break;var id=samples[sampleIndex];if(id===prevId)
continue;var node=idToNode[id];var prevNode=idToNode[prevId];if(node===gcNode){gcParentNode=prevNode;openFrameCallback(gcParentNode.depth+1,gcNode,sampleTime);stackStartTimes[++stackTop]=sampleTime;stackChildrenDuration[stackTop]=0;prevId=id;continue;}
if(prevNode===gcNode){var start=stackStartTimes[stackTop];var duration=sampleTime-start;stackChildrenDuration[stackTop-1]+=duration;closeFrameCallback(gcParentNode.depth+1,gcNode,start,duration,duration-stackChildrenDuration[stackTop]);--stackTop;prevNode=gcParentNode;prevId=prevNode.id;gcParentNode=null;}
while(node.depth>prevNode.depth){stackNodes.push(node);node=node.parent;}
while(prevNode!==node){var start=stackStartTimes[stackTop];var duration=sampleTime-start;stackChildrenDuration[stackTop-1]+=duration;closeFrameCallback(prevNode.depth,prevNode,start,duration,duration-stackChildrenDuration[stackTop]);--stackTop;if(node.depth===prevNode.depth){stackNodes.push(node);node=node.parent;}
prevNode=prevNode.parent;}
while(stackNodes.length){node=stackNodes.pop();openFrameCallback(node.depth,node,sampleTime);stackStartTimes[++stackTop]=sampleTime;stackChildrenDuration[stackTop]=0;}
prevId=id;}
if(idToNode[prevId]===gcNode){var start=stackStartTimes[stackTop];var duration=sampleTime-start;stackChildrenDuration[stackTop-1]+=duration;closeFrameCallback(gcParentNode.depth+1,node,start,duration,duration-stackChildrenDuration[stackTop]);--stackTop;}
for(var node=idToNode[prevId];node.parent;node=node.parent){var start=stackStartTimes[stackTop];var duration=sampleTime-start;stackChildrenDuration[stackTop-1]+=duration;closeFrameCallback(node.depth,node,start,duration,duration-stackChildrenDuration[stackTop]);--stackTop;}},nodeByIndex:function(index)
{return this._idToNode[this.samples[index]];}};WebInspector.CPUProfilerModel=function(target)
{WebInspector.SDKModel.call(this,WebInspector.CPUProfilerModel,target);this._isRecording=false;target.registerProfilerDispatcher(this);target.profilerAgent().enable();this._configureCpuProfilerSamplingInterval();WebInspector.moduleSetting("highResolutionCpuProfiling").addChangeListener(this._configureCpuProfilerSamplingInterval,this);}
WebInspector.CPUProfilerModel.EventTypes={ConsoleProfileStarted:Symbol("ConsoleProfileStarted"),ConsoleProfileFinished:Symbol("ConsoleProfileFinished")};WebInspector.CPUProfilerModel.EventData;WebInspector.CPUProfilerModel.prototype={_configureCpuProfilerSamplingInterval:function()
{var intervalUs=WebInspector.moduleSetting("highResolutionCpuProfiling").get()?100:1000;this.target().profilerAgent().setSamplingInterval(intervalUs);},consoleProfileStarted:function(id,scriptLocation,title)
{this._dispatchProfileEvent(WebInspector.CPUProfilerModel.EventTypes.ConsoleProfileStarted,id,scriptLocation,title);},consoleProfileFinished:function(id,scriptLocation,cpuProfile,title)
{this._dispatchProfileEvent(WebInspector.CPUProfilerModel.EventTypes.ConsoleProfileFinished,id,scriptLocation,title,cpuProfile);},_dispatchProfileEvent:function(eventName,id,scriptLocation,title,cpuProfile)
{self.runtime.loadModulePromise("profiler").then(_=>{var debuggerModel=(WebInspector.DebuggerModel.fromTarget(this.target()));var debuggerLocation=WebInspector.DebuggerModel.Location.fromPayload(debuggerModel,scriptLocation);var globalId=this.target().id()+"."+id;var data=({id:globalId,scriptLocation:debuggerLocation,cpuProfile:cpuProfile,title:title});this.dispatchEventToListeners(eventName,data);});},isRecordingProfile:function()
{return this._isRecording;},startRecording:function()
{this._isRecording=true;this.target().profilerAgent().start();WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ProfilesCPUProfileTaken);},stopRecording:function()
{function extractProfile(error,profile)
{return!error&&profile?profile:null;}
this._isRecording=false;return this.target().profilerAgent().stop(extractProfile);},dispose:function()
{WebInspector.moduleSetting("highResolutionCpuProfiling").removeChangeListener(this._configureCpuProfilerSamplingInterval,this);},__proto__:WebInspector.SDKModel.prototype};WebInspector.CSSMetadata=function(properties)
{this._values=([]);this._longhands={};this._shorthands={};for(var i=0;i<properties.length;++i){var property=properties[i];if(typeof property==="string"){this._values.push(property);continue;}
var propertyName=property.name;if(!CSS.supports(propertyName,"initial"))
continue;this._values.push(propertyName);var longhands=properties[i].longhands;if(longhands){this._longhands[propertyName]=longhands;for(var j=0;j<longhands.length;++j){var longhandName=longhands[j];var shorthands=this._shorthands[longhandName];if(!shorthands){shorthands=[];this._shorthands[longhandName]=shorthands;}
shorthands.push(propertyName);}}}
this._values.sort();}
WebInspector.CSSMetadata.cssPropertiesMetainfo=new WebInspector.CSSMetadata([]);WebInspector.CSSMetadata.isColorAwareProperty=function(propertyName)
{return!!WebInspector.CSSMetadata._colorAwareProperties[propertyName.toLowerCase()];}
WebInspector.CSSMetadata.isLengthProperty=function(propertyName)
{if(propertyName==="line-height")
return false;if(!WebInspector.CSSMetadata._distancePropertiesKeySet)
WebInspector.CSSMetadata._distancePropertiesKeySet=WebInspector.CSSMetadata._distanceProperties.keySet();return WebInspector.CSSMetadata._distancePropertiesKeySet[propertyName]||propertyName.startsWith("margin")||propertyName.startsWith("padding")||propertyName.indexOf("width")!==-1||propertyName.indexOf("height")!==-1;}
WebInspector.CSSMetadata.isBezierAwareProperty=function(propertyName)
{return!!WebInspector.CSSMetadata._bezierAwareProperties[propertyName.toLowerCase()];}
WebInspector.CSSMetadata.InheritedProperties=["azimuth","border-collapse","border-spacing","caption-side","color","cursor","direction","elevation","empty-cells","font-family","font-size","font-style","font-variant","font-weight","font","letter-spacing","line-height","list-style-image","list-style-position","list-style-type","list-style","orphans","overflow-wrap","pitch-range","pitch","quotes","resize","richness","speak-header","speak-numeral","speak-punctuation","speak","speech-rate","stress","text-align","text-indent","text-transform","text-shadow","-webkit-user-select","visibility","voice-family","volume","white-space","widows","word-spacing","word-wrap","zoom"].keySet();WebInspector.CSSMetadata.NonStandardInheritedProperties=["-webkit-font-smoothing"].keySet();WebInspector.CSSMetadata.canonicalPropertyName=function(name)
{if(!name||name.length<9||name.charAt(0)!=="-")
return name.toLowerCase();var match=name.match(/(?:-webkit-)(.+)/);var propertiesSet=WebInspector.CSSMetadata.cssPropertiesMetainfoKeySet();var hasSupportedProperties=WebInspector.CSSMetadata.cssPropertiesMetainfo._values.length>0;if(!match||(hasSupportedProperties&&!propertiesSet.hasOwnProperty(match[1].toLowerCase())))
return name.toLowerCase();return match[1].toLowerCase();}
WebInspector.CSSMetadata.isPropertyInherited=function(propertyName)
{return!!(WebInspector.CSSMetadata.InheritedProperties[WebInspector.CSSMetadata.canonicalPropertyName(propertyName)]||WebInspector.CSSMetadata.NonStandardInheritedProperties[propertyName.toLowerCase()]);}
WebInspector.CSSMetadata._distanceProperties=['background-position','border-spacing','bottom','font-size','height','left','letter-spacing','max-height','max-width','min-height','min-width','right','text-indent','top','width','word-spacing'];WebInspector.CSSMetadata._bezierAwareProperties=["animation","animation-timing-function","transition","transition-timing-function","-webkit-animation","-webkit-animation-timing-function","-webkit-transition","-webkit-transition-timing-function"].keySet();WebInspector.CSSMetadata._colorAwareProperties=["background","background-color","background-image","border","border-color","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","box-shadow","color","fill","outline","outline-color","stroke","text-shadow","-webkit-box-shadow","-webkit-column-rule-color","-webkit-text-decoration-color","-webkit-text-emphasis","-webkit-text-emphasis-color"].keySet();WebInspector.CSSMetadata._propertyDataMap={"table-layout":{values:["auto","fixed"]},"visibility":{values:["hidden","visible","collapse"]},"background-repeat":{values:["repeat","repeat-x","repeat-y","no-repeat","space","round"]},"content":{values:["list-item","close-quote","no-close-quote","no-open-quote","open-quote"]},"list-style-image":{values:["none"]},"clear":{values:["none","left","right","both"]},"overflow-x":{values:["hidden","auto","visible","overlay","scroll"]},"stroke-linejoin":{values:["round","miter","bevel"]},"baseline-shift":{values:["baseline","sub","super"]},"border-bottom-width":{values:["medium","thick","thin"]},"margin-top-collapse":{values:["collapse","separate","discard"]},"max-height":{values:["none"]},"box-orient":{values:["horizontal","vertical","inline-axis","block-axis"],},"font-stretch":{values:["normal","wider","narrower","ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"]},"-webkit-background-composite":{values:["highlight","clear","copy","source-over","source-in","source-out","source-atop","destination-over","destination-in","destination-out","destination-atop","xor","plus-darker","plus-lighter"]},"border-left-width":{values:["medium","thick","thin"]},"box-shadow":{values:["inset","none"]},"writing-mode":{values:["horizontal-tb","vertical-rl","vertical-lr"]},"-webkit-writing-mode":{values:["lr","rl","tb","lr-tb","rl-tb","tb-rl","horizontal-tb","vertical-rl","vertical-lr","horizontal-bt"]},"border-collapse":{values:["collapse","separate"]},"page-break-inside":{values:["auto","avoid"]},"border-top-width":{values:["medium","thick","thin"]},"outline-color":{values:["invert"]},"outline-style":{values:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"]},"cursor":{values:["none","copy","auto","crosshair","default","pointer","move","vertical-text","cell","context-menu","alias","progress","no-drop","not-allowed","-webkit-zoom-in","-webkit-zoom-out","e-resize","ne-resize","nw-resize","n-resize","se-resize","sw-resize","s-resize","w-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","col-resize","row-resize","text","wait","help","all-scroll","-webkit-grab","-webkit-grabbing"]},"border-width":{values:["medium","thick","thin"]},"border-style":{values:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"]},"size":{values:["a3","a4","a5","b4","b5","landscape","ledger","legal","letter","portrait"]},"background-size":{values:["contain","cover"]},"direction":{values:["ltr","rtl"]},"enable-background":{values:["accumulate","new"]},"float":{values:["none","left","right"]},"overflow-y":{values:["hidden","auto","visible","overlay","scroll"]},"margin-bottom-collapse":{values:["collapse","separate","discard"]},"box-reflect":{values:["left","right","above","below"]},"overflow":{values:["hidden","auto","visible","overlay","scroll"]},"text-rendering":{values:["auto","optimizeSpeed","optimizeLegibility","geometricPrecision"]},"text-align":{values:["-webkit-auto","start","end","left","right","center","justify","-webkit-left","-webkit-right","-webkit-center"]},"list-style-position":{values:["outside","inside","hanging"]},"margin-bottom":{values:["auto"]},"color-interpolation":{values:["linearrgb"]},"background-origin":{values:["border-box","content-box","padding-box"]},"word-wrap":{values:["normal","break-word"]},"font-weight":{values:["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"]},"margin-before-collapse":{values:["collapse","separate","discard"]},"text-transform":{values:["none","capitalize","uppercase","lowercase"]},"border-right-style":{values:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"]},"border-left-style":{values:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"]},"-webkit-text-emphasis":{values:["circle","filled","open","dot","double-circle","triangle","sesame"]},"font-style":{values:["italic","oblique","normal"]},"speak":{values:["none","normal","spell-out","digits","literal-punctuation","no-punctuation"]},"color-rendering":{values:["auto","optimizeSpeed","optimizeQuality"]},"list-style-type":{values:["none","inline","disc","circle","square","decimal","decimal-leading-zero","arabic-indic","binary","bengali","cambodian","khmer","devanagari","gujarati","gurmukhi","kannada","lower-hexadecimal","lao","malayalam","mongolian","myanmar","octal","oriya","persian","urdu","telugu","tibetan","thai","upper-hexadecimal","lower-roman","upper-roman","lower-greek","lower-alpha","lower-latin","upper-alpha","upper-latin","afar","ethiopic-halehame-aa-et","ethiopic-halehame-aa-er","amharic","ethiopic-halehame-am-et","amharic-abegede","ethiopic-abegede-am-et","cjk-earthly-branch","cjk-heavenly-stem","ethiopic","ethiopic-halehame-gez","ethiopic-abegede","ethiopic-abegede-gez","hangul-consonant","hangul","lower-norwegian","oromo","ethiopic-halehame-om-et","sidama","ethiopic-halehame-sid-et","somali","ethiopic-halehame-so-et","tigre","ethiopic-halehame-tig","tigrinya-er","ethiopic-halehame-ti-er","tigrinya-er-abegede","ethiopic-abegede-ti-er","tigrinya-et","ethiopic-halehame-ti-et","tigrinya-et-abegede","ethiopic-abegede-ti-et","upper-greek","upper-norwegian","asterisks","footnotes","hebrew","armenian","lower-armenian","upper-armenian","georgian","cjk-ideographic","hiragana","katakana","hiragana-iroha","katakana-iroha"]},"text-combine-upright":{values:["none","all"]},"-webkit-text-combine":{values:["none","horizontal"]},"text-orientation":{values:["mixed","upright","sideways"]},"outline":{values:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"]},"font":{values:["caption","icon","menu","message-box","small-caption","-webkit-mini-control","-webkit-small-control","-webkit-control","status-bar","italic","oblique","small-caps","normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900","xx-small","x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large","smaller","larger","serif","sans-serif","cursive","fantasy","monospace","-webkit-body","-webkit-pictograph"]},"dominant-baseline":{values:["middle","auto","central","text-before-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical","use-script","no-change","reset-size"]},"display":{values:["none","inline","block","list-item","run-in","inline-block","table","inline-table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption","-webkit-box","-webkit-inline-box","flex","inline-flex","grid","inline-grid"]},"-webkit-text-emphasis-position":{values:["over","under"]},"image-rendering":{values:["auto","optimizeSpeed","optimizeQuality","pixelated"]},"alignment-baseline":{values:["baseline","middle","auto","before-edge","after-edge","central","text-before-edge","text-after-edge","ideographic","alphabetic","hanging","mathematical"]},"outline-width":{values:["medium","thick","thin"]},"box-align":{values:["baseline","center","stretch","start","end"]},"border-right-width":{values:["medium","thick","thin"]},"border-top-style":{values:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"]},"line-height":{values:["normal"]},"text-overflow":{values:["clip","ellipsis"]},"overflow-wrap":{values:["normal","break-word"]},"box-direction":{values:["normal","reverse"]},"margin-after-collapse":{values:["collapse","separate","discard"]},"page-break-before":{values:["left","right","auto","always","avoid"]},"border-image":{values:["repeat","stretch"]},"text-decoration":{values:["blink","line-through","overline","underline"]},"position":{values:["absolute","fixed","relative","static"]},"font-family":{values:["serif","sans-serif","cursive","fantasy","monospace","-webkit-body","-webkit-pictograph"]},"text-overflow-mode":{values:["clip","ellipsis"]},"border-bottom-style":{values:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"]},"unicode-bidi":{values:["normal","bidi-override","embed","isolate","isolate-override","plaintext"]},"clip-rule":{values:["nonzero","evenodd"]},"margin-left":{values:["auto"]},"margin-top":{values:["auto"]},"zoom":{values:["normal","document","reset"]},"max-width":{values:["none"]},"caption-side":{values:["top","bottom"]},"empty-cells":{values:["hide","show"]},"pointer-events":{values:["none","all","auto","visible","visiblepainted","visiblefill","visiblestroke","painted","fill","stroke","bounding-box"]},"letter-spacing":{values:["normal"]},"background-clip":{values:["border-box","content-box","padding-box"]},"-webkit-font-smoothing":{values:["none","auto","antialiased","subpixel-antialiased"]},"border":{values:["none","hidden","inset","groove","ridge","outset","dotted","dashed","solid","double"]},"font-size":{values:["xx-small","x-small","small","medium","large","x-large","xx-large","-webkit-xxx-large","smaller","larger"]},"font-variant":{values:["small-caps","normal"]},"vertical-align":{values:["baseline","middle","sub","super","text-top","text-bottom","top","bottom","-webkit-baseline-middle"]},"white-space":{values:["normal","nowrap","pre","pre-line","pre-wrap"]},"box-lines":{values:["single","multiple"]},"page-break-after":{values:["left","right","auto","always","avoid"]},"clip-path":{values:["none"]},"margin":{values:["auto"]},"margin-right":{values:["auto"]},"word-break":{values:["normal","break-all","break-word"]},"word-spacing":{values:["normal"]},"-webkit-text-emphasis-style":{values:["circle","filled","open","dot","double-circle","triangle","sesame"]},"transform":{values:["scale","scaleX","scaleY","scale3d","rotate","rotateX","rotateY","rotateZ","rotate3d","skew","skewX","skewY","translate","translateX","translateY","translateZ","translate3d","matrix","matrix3d","perspective"]},"image-resolution":{values:["from-image","snap"]},"box-sizing":{values:["content-box","border-box"]},"clip":{values:["auto"]},"resize":{values:["none","both","horizontal","vertical"]},"align-content":{values:["flex-start","flex-end","center","space-between","space-around","stretch"]},"align-items":{values:["flex-start","flex-end","center","baseline","stretch"]},"align-self":{values:["auto","flex-start","flex-end","center","baseline","stretch"]},"flex-direction":{values:["row","row-reverse","column","column-reverse"]},"justify-content":{values:["flex-start","flex-end","center","space-between","space-around"]},"flex-wrap":{values:["nowrap","wrap","wrap-reverse"]},"perspective":{values:["none"]},"perspective-origin":{values:["left","center","right","top","bottom"]},"transform-origin":{values:["left","center","right","top","bottom"]},"transform-style":{values:["flat","preserve-3d"]},"transition-timing-function":{values:["ease","linear","ease-in","ease-out","ease-in-out","step-start","step-end","steps","cubic-bezier"]},"animation-timing-function":{values:["ease","linear","ease-in","ease-out","ease-in-out","step-start","step-end","steps","cubic-bezier"]},"animation-direction":{values:["normal","reverse","alternate","alternate-reverse"]},"animation-play-state":{values:["running","paused"]},"animation-fill-mode":{values:["none","forwards","backwards","both"]},"-webkit-backface-visibility":{values:["visible","hidden"]},"-webkit-box-decoration-break":{values:["slice","clone"]},"-webkit-column-break-after":{values:["auto","always","avoid","left","right","page","column","avoid-page","avoid-column"]},"-webkit-column-break-before":{values:["auto","always","avoid","left","right","page","column","avoid-page","avoid-column"]},"-webkit-column-break-inside":{values:["auto","avoid","avoid-page","avoid-column"]},"-webkit-column-span":{values:["none","all"]},"-webkit-column-count":{values:["auto"]},"-webkit-column-gap":{values:["normal"]},"-webkit-filter":{values:["url","blur","brightness","contrast","drop-shadow","grayscale","hue-rotate","invert","opacity","saturate","sepia"]},"-webkit-line-break":{values:["auto","loose","normal","strict"]},"text-align-last":{values:["auto","start","end","left","right","center","justify"]},"-webkit-text-decoration-line":{values:["none","underline","overline","line-through","blink"]},"-webkit-text-decoration-style":{values:["solid","double","dotted","dashed","wavy"]},"-webkit-text-decoration-skip":{values:["none","objects","spaces","ink","edges","box-decoration"]},"mix-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","unset"]},"background-blend-mode":{values:["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","unset"]},}
WebInspector.CSSMetadata.keywordsForProperty=function(propertyName)
{var acceptedKeywords=["inherit","initial"];var descriptor=WebInspector.CSSMetadata.descriptor(propertyName);if(descriptor&&descriptor.values)
acceptedKeywords.push.apply(acceptedKeywords,descriptor.values);if(WebInspector.CSSMetadata.isColorAwareProperty(propertyName)){acceptedKeywords.push("currentColor");for(var color in WebInspector.Color.Nicknames)
acceptedKeywords.push(color);}
return new WebInspector.CSSMetadata(acceptedKeywords);}
WebInspector.CSSMetadata.descriptor=function(propertyName)
{if(!propertyName)
return null;var unprefixedName=propertyName.replace(/^-webkit-/,"");propertyName=propertyName.toLowerCase();var entry=WebInspector.CSSMetadata._propertyDataMap[propertyName];if(!entry&&unprefixedName!==propertyName)
entry=WebInspector.CSSMetadata._propertyDataMap[unprefixedName];return entry||null;}
WebInspector.CSSMetadata.initializeWithSupportedProperties=function(properties)
{WebInspector.CSSMetadata.cssPropertiesMetainfo=new WebInspector.CSSMetadata(properties);}
WebInspector.CSSMetadata.cssPropertiesMetainfoKeySet=function()
{if(!WebInspector.CSSMetadata._cssPropertiesMetainfoKeySet)
WebInspector.CSSMetadata._cssPropertiesMetainfoKeySet=WebInspector.CSSMetadata.cssPropertiesMetainfo.keySet();return WebInspector.CSSMetadata._cssPropertiesMetainfoKeySet;}
WebInspector.CSSMetadata.Weight={"align-content":57,"align-items":129,"align-self":55,"animation":175,"animation-delay":114,"animation-direction":113,"animation-duration":137,"animation-fill-mode":132,"animation-iteration-count":124,"animation-name":139,"animation-play-state":104,"animation-timing-function":141,"backface-visibility":123,"background":260,"background-attachment":119,"background-clip":165,"background-color":259,"background-image":246,"background-origin":107,"background-position":237,"background-position-x":108,"background-position-y":93,"background-repeat":234,"background-size":203,"border":263,"border-bottom":233,"border-bottom-color":190,"border-bottom-left-radius":186,"border-bottom-right-radius":185,"border-bottom-style":150,"border-bottom-width":179,"border-collapse":209,"border-color":226,"border-image":89,"border-image-outset":50,"border-image-repeat":49,"border-image-slice":58,"border-image-source":32,"border-image-width":52,"border-left":221,"border-left-color":174,"border-left-style":142,"border-left-width":172,"border-radius":224,"border-right":223,"border-right-color":182,"border-right-style":130,"border-right-width":178,"border-spacing":198,"border-style":206,"border-top":231,"border-top-color":192,"border-top-left-radius":187,"border-top-right-radius":189,"border-top-style":152,"border-top-width":180,"border-width":214,"bottom":227,"box-shadow":213,"box-sizing":216,"caption-side":96,"clear":229,"clip":173,"clip-rule":5,"color":256,"content":219,"counter-increment":111,"counter-reset":110,"cursor":250,"direction":176,"display":262,"empty-cells":99,"fill":140,"fill-opacity":82,"fill-rule":22,"filter":160,"flex":133,"flex-basis":66,"flex-direction":85,"flex-flow":94,"flex-grow":112,"flex-shrink":61,"flex-wrap":68,"float":252,"font":211,"font-family":254,"font-kerning":18,"font-size":264,"font-stretch":77,"font-style":220,"font-variant":161,"font-weight":257,"height":266,"image-rendering":90,"justify-content":127,"left":248,"letter-spacing":188,"line-height":244,"list-style":215,"list-style-image":145,"list-style-position":149,"list-style-type":199,"margin":267,"margin-bottom":241,"margin-left":243,"margin-right":238,"margin-top":253,"mask":20,"max-height":205,"max-width":225,"min-height":217,"min-width":218,"object-fit":33,"opacity":251,"order":117,"orphans":146,"outline":222,"outline-color":153,"outline-offset":147,"outline-style":151,"outline-width":148,"overflow":255,"overflow-wrap":105,"overflow-x":184,"overflow-y":196,"padding":265,"padding-bottom":230,"padding-left":235,"padding-right":232,"padding-top":240,"page":8,"page-break-after":120,"page-break-before":69,"page-break-inside":121,"perspective":92,"perspective-origin":103,"pointer-events":183,"position":261,"quotes":158,"resize":168,"right":245,"shape-rendering":38,"size":64,"speak":118,"src":170,"stop-color":42,"stop-opacity":31,"stroke":98,"stroke-dasharray":36,"stroke-dashoffset":3,"stroke-linecap":30,"stroke-linejoin":21,"stroke-miterlimit":12,"stroke-opacity":34,"stroke-width":87,"table-layout":171,"tab-size":46,"text-align":260,"text-anchor":35,"text-decoration":247,"text-indent":207,"text-overflow":204,"text-rendering":155,"text-shadow":208,"text-transform":202,"top":258,"touch-action":80,"transform":181,"transform-origin":162,"transform-style":86,"transition":193,"transition-delay":134,"transition-duration":135,"transition-property":131,"transition-timing-function":122,"unicode-bidi":156,"unicode-range":136,"vertical-align":236,"visibility":242,"-webkit-appearance":191,"-webkit-backface-visibility":154,"-webkit-background-clip":164,"-webkit-background-origin":40,"-webkit-background-size":163,"-webkit-border-end":9,"-webkit-border-horizontal-spacing":81,"-webkit-border-image":75,"-webkit-border-radius":212,"-webkit-border-start":10,"-webkit-border-start-color":16,"-webkit-border-start-width":13,"-webkit-border-vertical-spacing":43,"-webkit-box-align":101,"-webkit-box-direction":51,"-webkit-box-flex":128,"-webkit-box-lines":2,"-webkit-box-ordinal-group":91,"-webkit-box-orient":144,"-webkit-box-pack":106,"-webkit-box-reflect":39,"-webkit-box-shadow":210,"-webkit-column-break-inside":60,"-webkit-column-count":84,"-webkit-column-gap":76,"-webkit-column-rule":25,"-webkit-column-rule-color":23,"-webkit-columns":44,"-webkit-column-span":29,"-webkit-column-width":47,"-webkit-filter":159,"-webkit-font-feature-settings":59,"-webkit-font-smoothing":177,"-webkit-highlight":1,"-webkit-line-break":45,"-webkit-line-clamp":126,"-webkit-margin-after":67,"-webkit-margin-before":70,"-webkit-margin-collapse":14,"-webkit-margin-end":65,"-webkit-margin-start":100,"-webkit-margin-top-collapse":78,"-webkit-mask":19,"-webkit-mask-box-image":72,"-webkit-mask-image":88,"-webkit-mask-position":54,"-webkit-mask-repeat":63,"-webkit-mask-size":79,"-webkit-padding-after":15,"-webkit-padding-before":28,"-webkit-padding-end":48,"-webkit-padding-start":73,"-webkit-print-color-adjust":83,"-webkit-rtl-ordering":7,"-webkit-tap-highlight-color":169,"-webkit-text-emphasis-color":11,"-webkit-text-fill-color":71,"-webkit-text-security":17,"-webkit-text-stroke":56,"-webkit-text-stroke-color":37,"-webkit-text-stroke-width":53,"-webkit-user-drag":95,"-webkit-user-modify":62,"-webkit-user-select":194,"-webkit-writing-mode":4,"white-space":228,"widows":115,"width":268,"will-change":74,"word-break":166,"word-spacing":157,"word-wrap":197,"writing-mode":41,"z-index":239,"zoom":200};WebInspector.CSSMetadata.prototype={startsWith:function(prefix)
{var firstIndex=this._firstIndexOfPrefix(prefix);if(firstIndex===-1)
return[];var results=[];while(firstIndex<this._values.length&&this._values[firstIndex].startsWith(prefix))
results.push(this._values[firstIndex++]);return results;},mostUsedOf:function(properties)
{var maxWeight=0;var index=0;for(var i=0;i<properties.length;i++){var weight=WebInspector.CSSMetadata.Weight[properties[i]];if(!weight)
weight=WebInspector.CSSMetadata.Weight[WebInspector.CSSMetadata.canonicalPropertyName(properties[i])];if(weight>maxWeight){maxWeight=weight;index=i;}}
return index;},_firstIndexOfPrefix:function(prefix)
{if(!this._values.length)
return-1;if(!prefix)
return 0;var maxIndex=this._values.length-1;var minIndex=0;var foundIndex;do{var middleIndex=(maxIndex+minIndex)>>1;if(this._values[middleIndex].startsWith(prefix)){foundIndex=middleIndex;break;}
if(this._values[middleIndex]<prefix)
minIndex=middleIndex+1;else
maxIndex=middleIndex-1;}while(minIndex<=maxIndex);if(foundIndex===undefined)
return-1;while(foundIndex&&this._values[foundIndex-1].startsWith(prefix))
foundIndex--;return foundIndex;},keySet:function()
{if(!this._keySet)
this._keySet=this._values.keySet();return this._keySet;},next:function(str,prefix)
{return this._closest(str,prefix,1);},previous:function(str,prefix)
{return this._closest(str,prefix,-1);},_closest:function(str,prefix,shift)
{if(!str)
return"";var index=this._values.indexOf(str);if(index===-1)
return"";if(!prefix){index=(index+this._values.length+shift)%this._values.length;return this._values[index];}
var propertiesWithPrefix=this.startsWith(prefix);var j=propertiesWithPrefix.indexOf(str);j=(j+propertiesWithPrefix.length+shift)%propertiesWithPrefix.length;return propertiesWithPrefix[j];},longhands:function(shorthand)
{return this._longhands[shorthand];},shorthands:function(longhand)
{return this._shorthands[longhand];}}
WebInspector.CSSMetadata.initializeWithSupportedProperties([]);;WebInspector.CSSParser=function()
{this._worker=new WorkerRuntime.Worker("script_formatter_worker");this._worker.onmessage=this._onRuleChunk.bind(this);this._rules=[];}
WebInspector.CSSParser.Events={RulesParsed:"RulesParsed"}
WebInspector.CSSParser.prototype={fetchAndParse:function(styleSheetHeader,callback)
{this._lock();this._finishedCallback=callback;styleSheetHeader.requestContent(this._innerParse.bind(this));},parse:function(text,callback)
{this._lock();this._finishedCallback=callback;this._innerParse(text);},parsePromise:function(text)
{return new Promise(promiseConstructor.bind(this));function promiseConstructor(succ,fail)
{this.parse(text,succ);}},dispose:function()
{if(this._worker){this._worker.terminate();delete this._worker;}},rules:function()
{return this._rules;},_lock:function()
{console.assert(!this._parsingStyleSheet,"Received request to parse stylesheet before previous was completed.");this._parsingStyleSheet=true;},_unlock:function()
{delete this._parsingStyleSheet;},_innerParse:function(text)
{this._rules=[];this._worker.postMessage({method:"parseCSS",params:{content:text}});},_onRuleChunk:function(event)
{var data=(event.data);var chunk=data.chunk;for(var i=0;i<chunk.length;++i)
this._rules.push(chunk[i]);if(data.isLastChunk)
this._onFinishedParsing();this.dispatchEventToListeners(WebInspector.CSSParser.Events.RulesParsed);},_onFinishedParsing:function()
{this._unlock();if(this._finishedCallback)
this._finishedCallback(this._rules);},__proto__:WebInspector.Object.prototype,}
WebInspector.CSSParser.DataChunk;WebInspector.CSSParser.StyleRule;WebInspector.CSSParser.AtRule;WebInspector.CSSParser.Rule;WebInspector.CSSParser.Range;WebInspector.CSSParser.Property=function()
{this.name;this.nameRange;this.value;this.valueRange;this.range;this.disabled;};WebInspector.CSSStyleModel=function(target)
{WebInspector.SDKModel.call(this,WebInspector.CSSStyleModel,target);this._domModel=WebInspector.DOMModel.fromTarget(target);this._agent=target.cssAgent();this._styleLoader=new WebInspector.CSSStyleModel.ComputedStyleLoader(this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._mainFrameNavigated,this);target.registerCSSDispatcher(new WebInspector.CSSDispatcher(this));this._agent.enable().then(this._wasEnabled.bind(this));this._styleSheetIdToHeader=new Map();this._styleSheetIdsForURL=new Map();}
WebInspector.CSSStyleModel.parseRuleMatchArrayPayload=function(cssModel,matchArray)
{if(!matchArray)
return[];var result=[];for(var i=0;i<matchArray.length;++i)
result.push(new WebInspector.CSSRule(cssModel,matchArray[i].rule,matchArray[i].matchingSelectors));return result;}
WebInspector.CSSStyleModel.Events={LayoutEditorChange:"LayoutEditorChange",MediaQueryResultChanged:"MediaQueryResultChanged",ModelWasEnabled:"ModelWasEnabled",PseudoStateForced:"PseudoStateForced",StyleSheetAdded:"StyleSheetAdded",StyleSheetChanged:"StyleSheetChanged",StyleSheetRemoved:"StyleSheetRemoved"}
WebInspector.CSSStyleModel.MediaTypes=["all","braille","embossed","handheld","print","projection","screen","speech","tty","tv"];WebInspector.CSSStyleModel.PseudoStateMarker="pseudo-state-marker";WebInspector.CSSStyleModel.prototype={mediaQueriesPromise:function()
{function parsePayload(error,payload)
{return!error&&payload?WebInspector.CSSMedia.parseMediaArrayPayload(this,payload):[];}
return this._agent.getMediaQueries(parsePayload.bind(this));},isEnabled:function()
{return this._isEnabled;},_wasEnabled:function(error)
{if(error){console.error("Failed to enabled CSS agent: "+error);return;}
this._isEnabled=true;this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.ModelWasEnabled);},matchedStylesPromise:function(nodeId)
{function callback(error,inlinePayload,attributesPayload,matchedPayload,pseudoPayload,inheritedPayload)
{if(error)
return null;var node=this._domModel.nodeForId(nodeId);if(!node)
return null;return new WebInspector.CSSStyleModel.MatchedStyleResult(this,node,inlinePayload,attributesPayload,matchedPayload,pseudoPayload,inheritedPayload);}
return this._agent.getMatchedStylesForNode(nodeId,callback.bind(this));},computedStylePromise:function(nodeId)
{return this._styleLoader.computedStylePromise(nodeId);},backgroundColorsPromise:function(nodeId)
{function backgroundColorsCallback(error,backgroundColors){return!error&&backgroundColors?backgroundColors:null;}
return this._agent.getBackgroundColors(nodeId,backgroundColorsCallback);},platformFontsPromise:function(nodeId)
{function platformFontsCallback(error,fonts)
{return!error&&fonts?fonts:null;}
return this._agent.getPlatformFontsForNode(nodeId,platformFontsCallback);},allStyleSheets:function()
{var values=this._styleSheetIdToHeader.valuesArray();function styleSheetComparator(a,b)
{if(a.sourceURL<b.sourceURL)
return-1;else if(a.sourceURL>b.sourceURL)
return 1;return a.startLine-b.startLine||a.startColumn-b.startColumn;}
values.sort(styleSheetComparator);return values;},inlineStylesPromise:function(nodeId)
{function callback(error,inlinePayload,attributesStylePayload)
{if(error||!inlinePayload)
return null;var inlineStyle=inlinePayload?new WebInspector.CSSStyleDeclaration(this,null,inlinePayload,WebInspector.CSSStyleDeclaration.Type.Inline):null;var attributesStyle=attributesStylePayload?new WebInspector.CSSStyleDeclaration(this,null,attributesStylePayload,WebInspector.CSSStyleDeclaration.Type.Attributes):null;return new WebInspector.CSSStyleModel.InlineStyleResult(inlineStyle,attributesStyle);}
return this._agent.getInlineStylesForNode(nodeId,callback.bind(this));},forcePseudoState:function(node,pseudoClass,enable)
{var pseudoClasses=node.marker(WebInspector.CSSStyleModel.PseudoStateMarker)||[];if(enable){if(pseudoClasses.indexOf(pseudoClass)>=0)
return false;pseudoClasses.push(pseudoClass);node.setMarker(WebInspector.CSSStyleModel.PseudoStateMarker,pseudoClasses);}else{if(pseudoClasses.indexOf(pseudoClass)<0)
return false;pseudoClasses.remove(pseudoClass);if(!pseudoClasses.length)
node.setMarker(WebInspector.CSSStyleModel.PseudoStateMarker,null);}
this._agent.forcePseudoState(node.id,pseudoClasses);this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.PseudoStateForced,{node:node,pseudoClass:pseudoClass,enable:enable});return true;},pseudoState:function(node)
{return node.marker(WebInspector.CSSStyleModel.PseudoStateMarker)||[];},setMediaText:function(media,newMediaText,userCallback)
{function parsePayload(error,mediaPayload)
{if(!mediaPayload)
return null;this._domModel.markUndoableState();this._fireStyleSheetChanged(media.parentStyleSheetId);return WebInspector.CSSMedia.parsePayload(this,mediaPayload);}
console.assert(!!media.parentStyleSheetId);WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.StyleRuleEdited);this._agent.setMediaText(media.parentStyleSheetId,media.range,newMediaText,parsePayload.bind(this)).catchException(null).then(userCallback);},_computeMatchingSelectors:function(nodeId,selectors)
{var ownerDocumentId=this._ownerDocumentId(nodeId);if(!ownerDocumentId||!selectors)
return Promise.resolve((null));var matchingSelectors=[];var allSelectorsBarrier=new CallbackBarrier();for(var i=0;i<selectors.length;++i){var boundCallback=allSelectorsBarrier.createCallback(selectorQueried.bind(null,i,nodeId,matchingSelectors));this._domModel.querySelectorAll(ownerDocumentId,selectors[i].text,boundCallback);}
return new Promise(promiseConstructor);function promiseConstructor(resolve)
{allSelectorsBarrier.callWhenDone(function(){resolve(matchingSelectors);});}
function selectorQueried(index,nodeId,matchingSelectors,matchingNodeIds)
{if(!matchingNodeIds)
return;if(matchingNodeIds.indexOf(nodeId)!==-1)
matchingSelectors.push(index);}},addRule:function(styleSheetId,node,ruleText,ruleLocation,userCallback)
{this._agent.addRule(styleSheetId,ruleText,ruleLocation,parsePayload.bind(this)).then(onRuleParsed.bind(this)).catchException(null).then(userCallback);function parsePayload(error,rulePayload)
{if(error||!rulePayload)
return null;this._domModel.markUndoableState();this._fireStyleSheetChanged(styleSheetId);return new WebInspector.CSSRule(this,rulePayload);}
function onRuleParsed(rule)
{if(!rule)
return Promise.resolve((null));return this._computeMatchingSelectors(node.id,rule.selectors).then(updateMatchingSelectors.bind(null,rule));}
function updateMatchingSelectors(rule,matchingSelectors)
{if(!matchingSelectors)
return null;rule.matchingSelectors=matchingSelectors;return rule;}},requestViaInspectorStylesheet:function(node,userCallback)
{var frameId=node.frameId()||this.target().resourceTreeModel.mainFrame.id;var headers=this._styleSheetIdToHeader.valuesArray();for(var i=0;i<headers.length;++i){var styleSheetHeader=headers[i];if(styleSheetHeader.frameId===frameId&&styleSheetHeader.isViaInspector()){userCallback(styleSheetHeader);return;}}
function innerCallback(error,styleSheetId)
{return!error&&styleSheetId?this._styleSheetIdToHeader.get(styleSheetId)||null:null;}
this._agent.createStyleSheet(frameId,innerCallback.bind(this)).catchException(null).then(userCallback)},mediaQueryResultChanged:function()
{this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged);},styleSheetHeaderForId:function(id)
{return this._styleSheetIdToHeader.get(id)||null;},styleSheetHeaders:function()
{return this._styleSheetIdToHeader.valuesArray();},_ownerDocumentId:function(nodeId)
{var node=this._domModel.nodeForId(nodeId);if(!node)
return null;return node.ownerDocument?node.ownerDocument.id:null;},_fireStyleSheetChanged:function(styleSheetId)
{this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleSheetChanged,{styleSheetId:styleSheetId});},_styleSheetAdded:function(header)
{console.assert(!this._styleSheetIdToHeader.get(header.styleSheetId));var styleSheetHeader=new WebInspector.CSSStyleSheetHeader(this,header);this._styleSheetIdToHeader.set(header.styleSheetId,styleSheetHeader);var url=styleSheetHeader.resourceURL();if(!this._styleSheetIdsForURL.get(url))
this._styleSheetIdsForURL.set(url,{});var frameIdToStyleSheetIds=this._styleSheetIdsForURL.get(url);var styleSheetIds=frameIdToStyleSheetIds[styleSheetHeader.frameId];if(!styleSheetIds){styleSheetIds=[];frameIdToStyleSheetIds[styleSheetHeader.frameId]=styleSheetIds;}
styleSheetIds.push(styleSheetHeader.id);this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleSheetAdded,styleSheetHeader);},_styleSheetRemoved:function(id)
{var header=this._styleSheetIdToHeader.get(id);console.assert(header);if(!header)
return;this._styleSheetIdToHeader.remove(id);var url=header.resourceURL();var frameIdToStyleSheetIds=(this._styleSheetIdsForURL.get(url));console.assert(frameIdToStyleSheetIds,"No frameId to styleSheetId map is available for given style sheet URL.");frameIdToStyleSheetIds[header.frameId].remove(id);if(!frameIdToStyleSheetIds[header.frameId].length){delete frameIdToStyleSheetIds[header.frameId];if(!Object.keys(frameIdToStyleSheetIds).length)
this._styleSheetIdsForURL.remove(url);}
this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,header);},styleSheetIdsForURL:function(url)
{var frameIdToStyleSheetIds=this._styleSheetIdsForURL.get(url);if(!frameIdToStyleSheetIds)
return[];var result=[];for(var frameId in frameIdToStyleSheetIds)
result=result.concat(frameIdToStyleSheetIds[frameId]);return result;},setStyleSheetText:function(styleSheetId,newText,majorChange)
{var header=this._styleSheetIdToHeader.get(styleSheetId);console.assert(header);return header._setContentPromise(newText).then(callback.bind(this));function callback(error)
{if(error)
return error;if(majorChange)
this._domModel.markUndoableState();this._fireStyleSheetChanged(styleSheetId);return null;}},_mainFrameNavigated:function()
{this._resetStyleSheets();},_resetStyleSheets:function()
{var headers=this._styleSheetIdToHeader.valuesArray();this._styleSheetIdsForURL.clear();this._styleSheetIdToHeader.clear();for(var i=0;i<headers.length;++i)
this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,headers[i]);},suspendModel:function()
{this._isEnabled=false;return this._agent.disable().then(this._resetStyleSheets.bind(this));},resumeModel:function()
{return this._agent.enable().then(this._wasEnabled.bind(this));},_layoutEditorChange:function(id,range)
{this.dispatchEventToListeners(WebInspector.CSSStyleModel.Events.LayoutEditorChange,{id:id,range:range});},setEffectivePropertyValueForNode:function(nodeId,name,value)
{this._agent.setEffectivePropertyValueForNode(nodeId,name,value);},__proto__:WebInspector.SDKModel.prototype}
WebInspector.CSSLocation=function(header,lineNumber,columnNumber)
{WebInspector.SDKObject.call(this,header.target());this._header=header;this.styleSheetId=header.id;this.url=header.resourceURL();this.lineNumber=lineNumber;this.columnNumber=columnNumber||0;}
WebInspector.CSSLocation.prototype={cssModel:function()
{return this._header.cssModel();},header:function()
{return this._header;},__proto__:WebInspector.SDKObject.prototype}
WebInspector.CSSStyleDeclaration=function(cssModel,parentRule,payload,type)
{this._cssModel=cssModel;this.parentRule=parentRule;this._reinitialize(payload);this.type=type;}
WebInspector.CSSStyleDeclaration.Type={Regular:"Regular",Inline:"Inline",Attributes:"Attributes"}
WebInspector.CSSStyleDeclaration.prototype={_reinitialize:function(payload)
{this.styleSheetId=payload.styleSheetId;this.range=payload.range?WebInspector.TextRange.fromObject(payload.range):null;var shorthandEntries=payload.shorthandEntries;this._shorthandValues=new Map();this._shorthandIsImportant=new Set();for(var i=0;i<shorthandEntries.length;++i){this._shorthandValues.set(shorthandEntries[i].name,shorthandEntries[i].value);if(shorthandEntries[i].important)
this._shorthandIsImportant.add(shorthandEntries[i].name);}
this._allProperties=[];for(var i=0;i<payload.cssProperties.length;++i){var property=WebInspector.CSSProperty.parsePayload(this,i,payload.cssProperties[i]);this._allProperties.push(property);}
this._generateSyntheticPropertiesIfNeeded();this._computeInactiveProperties();this._activePropertyMap=new Map();for(var property of this._allProperties){if(!property.activeInStyle())
continue;this._activePropertyMap.set(property.name,property);}
this.cssText=payload.cssText;this._leadingProperties=null;},_generateSyntheticPropertiesIfNeeded:function()
{if(this.range)
return;if(!this._shorthandValues.size)
return;var propertiesSet=new Set();for(var property of this._allProperties)
propertiesSet.add(property.name);var generatedProperties=[];for(var property of this._allProperties){var shorthands=WebInspector.CSSMetadata.cssPropertiesMetainfo.shorthands(property.name)||[];for(var shorthand of shorthands){if(propertiesSet.has(shorthand))
continue;var shorthandValue=this._shorthandValues.get(shorthand);if(!shorthandValue)
continue;var shorthandImportance=!!this._shorthandIsImportant.has(shorthand);var shorthandProperty=new WebInspector.CSSProperty(this,this.allProperties.length,shorthand,shorthandValue,shorthandImportance,false,true,false);generatedProperties.push(shorthandProperty);propertiesSet.add(shorthand);}}
this._allProperties=this._allProperties.concat(generatedProperties);},_computeLeadingProperties:function()
{function propertyHasRange(property)
{return!!property.range;}
if(this.range)
return this._allProperties.filter(propertyHasRange);var leadingProperties=[];for(var property of this._allProperties){var shorthands=WebInspector.CSSMetadata.cssPropertiesMetainfo.shorthands(property.name)||[];var belongToAnyShorthand=false;for(var shorthand of shorthands){if(this._shorthandValues.get(shorthand)){belongToAnyShorthand=true;break;}}
if(!belongToAnyShorthand)
leadingProperties.push(property);}
return leadingProperties;},leadingProperties:function()
{if(!this._leadingProperties)
this._leadingProperties=this._computeLeadingProperties();return this._leadingProperties;},target:function()
{return this._cssModel.target();},cssModel:function()
{return this._cssModel;},sourceStyleSheetEdited:function(styleSheetId,oldRange,newRange)
{if(this.styleSheetId!==styleSheetId)
return;if(this.range)
this.range=this.range.rebaseAfterTextEdit(oldRange,newRange);for(var i=0;i<this._allProperties.length;++i)
this._allProperties[i].sourceStyleSheetEdited(styleSheetId,oldRange,newRange);},_computeInactiveProperties:function()
{var activeProperties={};for(var i=0;i<this._allProperties.length;++i){var property=this._allProperties[i];if(property.disabled||!property.parsedOk){property._setActive(false);continue;}
var canonicalName=WebInspector.CSSMetadata.canonicalPropertyName(property.name);var activeProperty=activeProperties[canonicalName];if(!activeProperty){activeProperties[canonicalName]=property;}else if(!activeProperty.important||property.important){activeProperty._setActive(false);activeProperties[canonicalName]=property;}else{property._setActive(false);}}},get allProperties()
{return this._allProperties;},getPropertyValue:function(name)
{var property=this._activePropertyMap.get(name);return property?property.value:"";},isPropertyImplicit:function(name)
{var property=this._activePropertyMap.get(name);return property?property.implicit:"";},longhandProperties:function(name)
{var longhands=WebInspector.CSSMetadata.cssPropertiesMetainfo.longhands(name);var result=[];for(var i=0;longhands&&i<longhands.length;++i){var property=this._activePropertyMap.get(longhands[i]);if(property)
result.push(property);}
return result;},propertyAt:function(index)
{return(index<this.allProperties.length)?this.allProperties[index]:null;},pastLastSourcePropertyIndex:function()
{for(var i=this.allProperties.length-1;i>=0;--i){if(this.allProperties[i].range)
return i+1;}
return 0;},_insertionRange:function(index)
{var property=this.propertyAt(index);return property&&property.range?property.range.collapseToStart():this.range.collapseToEnd();},newBlankProperty:function(index)
{index=(typeof index==="undefined")?this.pastLastSourcePropertyIndex():index;var property=new WebInspector.CSSProperty(this,index,"","",false,false,true,false,"",this._insertionRange(index));return property;},setText:function(text,majorChange)
{if(!this.styleSheetId)
return Promise.resolve(false);function parsePayload(error,stylePayload)
{if(error||!stylePayload)
return false;if(majorChange)
this._cssModel._domModel.markUndoableState();this._reinitialize(stylePayload);this._cssModel._fireStyleSheetChanged(this.styleSheetId);return true;}
return this._cssModel._agent.setStyleText(this.styleSheetId,this.range.serializeToObject(),text,parsePayload.bind(this)).catchException(false);},insertPropertyAt:function(index,name,value,userCallback)
{this.newBlankProperty(index).setText(name+": "+value+";",false,true).then(userCallback);},appendProperty:function(name,value,userCallback)
{this.insertPropertyAt(this.allProperties.length,name,value,userCallback);}}
WebInspector.CSSRuleSelector=function(payload)
{this.text=payload.text;if(payload.range)
this.range=WebInspector.TextRange.fromObject(payload.range);}
WebInspector.CSSRuleSelector.parseSelectorListPayload=function(selectorList)
{var selectors=[];for(var i=0;i<selectorList.selectors.length;++i){var selectorPayload=selectorList.selectors[i];selectors.push(new WebInspector.CSSRuleSelector(selectorPayload));}
return selectors;}
WebInspector.CSSRuleSelector.prototype={sourceStyleRuleEdited:function(oldRange,newRange)
{if(!this.range)
return;this.range=this.range.rebaseAfterTextEdit(oldRange,newRange);}}
WebInspector.CSSRule=function(cssModel,payload,matchingSelectors)
{this._cssModel=cssModel;this.styleSheetId=payload.styleSheetId;if(matchingSelectors)
this.matchingSelectors=matchingSelectors;this.selectors=WebInspector.CSSRuleSelector.parseSelectorListPayload(payload.selectorList);if(this.styleSheetId){var styleSheetHeader=cssModel.styleSheetHeaderForId(this.styleSheetId);this.sourceURL=styleSheetHeader.sourceURL;}
this.origin=payload.origin;this.style=new WebInspector.CSSStyleDeclaration(this._cssModel,this,payload.style,WebInspector.CSSStyleDeclaration.Type.Regular);if(payload.media)
this.media=WebInspector.CSSMedia.parseMediaArrayPayload(cssModel,payload.media);}
WebInspector.CSSRule.createDummyRule=function(cssModel,selectorText)
{var dummyPayload={selectorList:{selectors:[{text:selectorText}],},style:{styleSheetId:"0",range:new WebInspector.TextRange(0,0,0,0),shorthandEntries:[],cssProperties:[]}};return new WebInspector.CSSRule(cssModel,(dummyPayload));}
WebInspector.CSSRule.prototype={setSelectorText:function(nodeId,newSelector,userCallback)
{function callback(error,selectorPayload)
{if(error||!selectorPayload)
return null;this._cssModel._domModel.markUndoableState();this._cssModel._fireStyleSheetChanged((this.styleSheetId));return WebInspector.CSSRuleSelector.parseSelectorListPayload(selectorPayload);}
if(!this.styleSheetId)
throw"No rule stylesheet id";var range=this.selectorRange();if(!range)
throw"Rule selector is not editable";WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.StyleRuleEdited);this._cssModel._agent.setRuleSelector(this.styleSheetId,range,newSelector,callback.bind(this)).then(onNewSelectors.bind(this)).catchException(false).then(userCallback);function onNewSelectors(selectors)
{if(!selectors)
return Promise.resolve(false);return this._cssModel._computeMatchingSelectors(nodeId,selectors).then(onMatchingSelectors.bind(this,selectors));}
function onMatchingSelectors(selectors,matchingSelectors)
{if(!matchingSelectors)
return false;this.selectors=selectors;this.matchingSelectors=matchingSelectors;return true;}},selectorText:function()
{return this.selectors.select("text").join(", ");},selectorRange:function()
{var firstRange=this.selectors[0].range;if(!firstRange)
return null;var lastRange=this.selectors.peekLast().range;return new WebInspector.TextRange(firstRange.startLine,firstRange.startColumn,lastRange.endLine,lastRange.endColumn);},sourceStyleSheetEdited:function(styleSheetId,oldRange,newRange)
{this._sourceStyleSheetEditedWithMedia(styleSheetId,oldRange,newRange,null,null);},_sourceStyleSheetEditedWithMedia:function(styleSheetId,oldRange,newRange,oldMedia,newMedia)
{if(this.styleSheetId===styleSheetId){for(var i=0;i<this.selectors.length;++i)
this.selectors[i].sourceStyleRuleEdited(oldRange,newRange);}
if(this.media){for(var i=0;i<this.media.length;++i){if(oldMedia&&newMedia&&oldMedia.equal(this.media[i])){this.media[i]=newMedia;}else{this.media[i].sourceStyleSheetEdited(styleSheetId,oldRange,newRange);}}}
this.style.sourceStyleSheetEdited(styleSheetId,oldRange,newRange);},mediaEdited:function(oldMedia,newMedia)
{this._sourceStyleSheetEditedWithMedia((oldMedia.parentStyleSheetId),oldMedia.range,newMedia.range,oldMedia,newMedia);},resourceURL:function()
{if(!this.styleSheetId)
return"";var styleSheetHeader=this._cssModel.styleSheetHeaderForId(this.styleSheetId);return styleSheetHeader.resourceURL();},lineNumberInSource:function(selectorIndex)
{var selector=this.selectors[selectorIndex];if(!selector||!selector.range||!this.styleSheetId)
return 0;var styleSheetHeader=this._cssModel.styleSheetHeaderForId(this.styleSheetId);return styleSheetHeader.lineNumberInSource(selector.range.startLine);},columnNumberInSource:function(selectorIndex)
{var selector=this.selectors[selectorIndex];if(!selector||!selector.range||!this.styleSheetId)
return undefined;var styleSheetHeader=this._cssModel.styleSheetHeaderForId(this.styleSheetId);console.assert(styleSheetHeader);return styleSheetHeader.columnNumberInSource(selector.range.startLine,selector.range.startColumn);},isUserAgent:function()
{return this.origin===CSSAgent.StyleSheetOrigin.UserAgent;},isInjected:function()
{return this.origin===CSSAgent.StyleSheetOrigin.Injected;},isViaInspector:function()
{return this.origin===CSSAgent.StyleSheetOrigin.Inspector;},isRegular:function()
{return this.origin===CSSAgent.StyleSheetOrigin.Regular;}}
WebInspector.CSSProperty=function(ownerStyle,index,name,value,important,disabled,parsedOk,implicit,text,range)
{this.ownerStyle=ownerStyle;this.index=index;this.name=name;this.value=value;this.important=important;this.disabled=disabled;this.parsedOk=parsedOk;this.implicit=implicit;this.text=text;this.range=range?WebInspector.TextRange.fromObject(range):null;this._active=true;}
WebInspector.CSSProperty.parsePayload=function(ownerStyle,index,payload)
{var result=new WebInspector.CSSProperty(ownerStyle,index,payload.name,payload.value,payload.important||false,payload.disabled||false,("parsedOk"in payload)?!!payload.parsedOk:true,!!payload.implicit,payload.text,payload.range);return result;}
WebInspector.CSSProperty.prototype={sourceStyleSheetEdited:function(styleSheetId,oldRange,newRange)
{if(this.ownerStyle.styleSheetId!==styleSheetId)
return;if(this.range)
this.range=this.range.rebaseAfterTextEdit(oldRange,newRange);},_setActive:function(active)
{this._active=active;},get propertyText()
{if(this.text!==undefined)
return this.text;if(this.name==="")
return"";return this.name+": "+this.value+(this.important?" !important":"")+";";},activeInStyle:function()
{return this._active;},setText:function(propertyText,majorChange,overwrite)
{if(!this.ownerStyle)
return Promise.reject(new Error("No ownerStyle for property"));if(!this.ownerStyle.styleSheetId)
return Promise.reject(new Error("No owner style id"));if(!this.range||!this.ownerStyle.range)
return Promise.reject(new Error("Style not editable"));if(majorChange)
WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.StyleRuleEdited);if(overwrite&&propertyText===this.propertyText){if(majorChange)
this.ownerStyle._cssModel._domModel.markUndoableState();return Promise.resolve(true);}
var range=this.range.relativeTo(this.ownerStyle.range.startLine,this.ownerStyle.range.startColumn);var indentation=this.ownerStyle.cssText?this._detectIndentation(this.ownerStyle.cssText):WebInspector.moduleSetting("textEditorIndent").get();var endIndentation=this.ownerStyle.cssText?indentation.substring(0,this.ownerStyle.range.endColumn):"";var newStyleText=range.replaceInText(this.ownerStyle.cssText||"",String.sprintf(";%s;",propertyText));return self.runtime.instancePromise(WebInspector.TokenizerFactory).then(this._formatStyle.bind(this,newStyleText,indentation,endIndentation)).then(setStyleText.bind(this));function setStyleText(styleText)
{return this.ownerStyle.setText(styleText,majorChange);}},_formatStyle:function(styleText,indentation,endIndentation,tokenizerFactory)
{if(indentation)
indentation="\n"+indentation;var result="";var propertyText;var insideProperty=false;var tokenize=tokenizerFactory.createTokenizer("text/css");tokenize("*{"+styleText+"}",processToken);if(insideProperty)
result+=propertyText;result=result.substring(2,result.length-1).trimRight();return result+(indentation?"\n"+endIndentation:"");function processToken(token,tokenType,column,newColumn)
{if(!insideProperty){var isDisabledProperty=tokenType&&tokenType.includes("css-comment")&&token.includes(":");var isPropertyStart=tokenType&&(tokenType.includes("css-meta")||tokenType.includes("css-property")||tokenType.includes("css-variable-2"));if(isDisabledProperty){result=result.trimRight()+indentation+token;}else if(isPropertyStart){insideProperty=true;propertyText=token;}else if(token!==";"){result+=token;}
return;}
if(token==="}"||token===";"){result=result.trimRight()+indentation+propertyText.trim()+";";insideProperty=false;if(token==="}")
result+="}";}else{propertyText+=token;}}},_detectIndentation:function(text)
{var lines=text.split("\n");if(lines.length<2)
return"";return WebInspector.TextUtils.lineIndent(lines[1]);},setValue:function(newValue,majorChange,overwrite,userCallback)
{var text=this.name+": "+newValue+(this.important?" !important":"")+";";this.setText(text,majorChange,overwrite).then(userCallback);},setDisabled:function(disabled)
{if(!this.ownerStyle)
return Promise.resolve(false);if(disabled===this.disabled)
return Promise.resolve(true);var propertyText=this.text.trim();var text=disabled?"/* "+propertyText+" */":this.text.substring(2,propertyText.length-2).trim();return this.setText(text,true,true);}}
WebInspector.CSSMediaQuery=function(payload)
{this._active=payload.active;this._expressions=[];for(var j=0;j<payload.expressions.length;++j)
this._expressions.push(WebInspector.CSSMediaQueryExpression.parsePayload(payload.expressions[j]));}
WebInspector.CSSMediaQuery.parsePayload=function(payload)
{return new WebInspector.CSSMediaQuery(payload);}
WebInspector.CSSMediaQuery.prototype={active:function()
{return this._active;},expressions:function()
{return this._expressions;}}
WebInspector.CSSMediaQueryExpression=function(payload)
{this._value=payload.value;this._unit=payload.unit;this._feature=payload.feature;this._valueRange=payload.valueRange?WebInspector.TextRange.fromObject(payload.valueRange):null;this._computedLength=payload.computedLength||null;}
WebInspector.CSSMediaQueryExpression.parsePayload=function(payload)
{return new WebInspector.CSSMediaQueryExpression(payload);}
WebInspector.CSSMediaQueryExpression.prototype={value:function()
{return this._value;},unit:function()
{return this._unit;},feature:function()
{return this._feature;},valueRange:function()
{return this._valueRange;},computedLength:function()
{return this._computedLength;}}
WebInspector.CSSMedia=function(cssModel,payload)
{this._cssModel=cssModel;this.text=payload.text;this.source=payload.source;this.sourceURL=payload.sourceURL||"";this.range=payload.range?WebInspector.TextRange.fromObject(payload.range):null;this.parentStyleSheetId=payload.parentStyleSheetId;this.mediaList=null;if(payload.mediaList){this.mediaList=[];for(var i=0;i<payload.mediaList.length;++i)
this.mediaList.push(WebInspector.CSSMediaQuery.parsePayload(payload.mediaList[i]));}}
WebInspector.CSSMedia.Source={LINKED_SHEET:"linkedSheet",INLINE_SHEET:"inlineSheet",MEDIA_RULE:"mediaRule",IMPORT_RULE:"importRule"};WebInspector.CSSMedia.parsePayload=function(cssModel,payload)
{return new WebInspector.CSSMedia(cssModel,payload);}
WebInspector.CSSMedia.parseMediaArrayPayload=function(cssModel,payload)
{var result=[];for(var i=0;i<payload.length;++i)
result.push(WebInspector.CSSMedia.parsePayload(cssModel,payload[i]));return result;}
WebInspector.CSSMedia.prototype={sourceStyleSheetEdited:function(styleSheetId,oldRange,newRange)
{if(this.parentStyleSheetId!==styleSheetId)
return;if(this.range)
this.range=this.range.rebaseAfterTextEdit(oldRange,newRange);},equal:function(other)
{if(!this.parentStyleSheetId||!this.range||!other.range)
return false;return this.parentStyleSheetId===other.parentStyleSheetId&&this.range.equal(other.range);},active:function()
{if(!this.mediaList)
return true;for(var i=0;i<this.mediaList.length;++i){if(this.mediaList[i].active())
return true;}
return false;},lineNumberInSource:function()
{if(!this.range)
return undefined;var header=this.header();if(!header)
return undefined;return header.lineNumberInSource(this.range.startLine);},columnNumberInSource:function()
{if(!this.range)
return undefined;var header=this.header();if(!header)
return undefined;return header.columnNumberInSource(this.range.startLine,this.range.startColumn);},header:function()
{return this.parentStyleSheetId?this._cssModel.styleSheetHeaderForId(this.parentStyleSheetId):null;},rawLocation:function()
{var header=this.header();if(!header||this.lineNumberInSource()===undefined)
return null;var lineNumber=Number(this.lineNumberInSource());return new WebInspector.CSSLocation(header,lineNumber,this.columnNumberInSource());}}
WebInspector.CSSStyleSheetHeader=function(cssModel,payload)
{this._cssModel=cssModel;this.id=payload.styleSheetId;this.frameId=payload.frameId;this.sourceURL=payload.sourceURL;this.hasSourceURL=!!payload.hasSourceURL;this.sourceMapURL=payload.sourceMapURL;this.origin=payload.origin;this.title=payload.title;this.disabled=payload.disabled;this.isInline=payload.isInline;this.startLine=payload.startLine;this.startColumn=payload.startColumn;if(payload.ownerNode)
this.ownerNode=new WebInspector.DeferredDOMNode(cssModel.target(),payload.ownerNode);}
WebInspector.CSSStyleSheetHeader.prototype={target:function()
{return this._cssModel.target();},cssModel:function()
{return this._cssModel;},resourceURL:function()
{return this.isViaInspector()?this._viaInspectorResourceURL():this.sourceURL;},_viaInspectorResourceURL:function()
{var frame=this._cssModel.target().resourceTreeModel.frameForId(this.frameId);console.assert(frame);var parsedURL=new WebInspector.ParsedURL(frame.url);var fakeURL="inspector://"+parsedURL.host+parsedURL.folderPathComponents;if(!fakeURL.endsWith("/"))
fakeURL+="/";fakeURL+="inspector-stylesheet";return fakeURL;},lineNumberInSource:function(lineNumberInStyleSheet)
{return this.startLine+lineNumberInStyleSheet;},columnNumberInSource:function(lineNumberInStyleSheet,columnNumberInStyleSheet)
{return(lineNumberInStyleSheet?0:this.startColumn)+columnNumberInStyleSheet;},contentURL:function()
{return this.resourceURL();},contentType:function()
{return WebInspector.resourceTypes.Stylesheet;},_trimSourceURL:function(text)
{var sourceURLIndex=text.lastIndexOf("/*# sourceURL=");if(sourceURLIndex===-1)
return text;var sourceURLLineIndex=text.lastIndexOf("\n",sourceURLIndex);if(sourceURLLineIndex===-1)
return text;var sourceURLLine=text.substr(sourceURLLineIndex+1).split("\n",1)[0];var sourceURLRegex=/[\040\t]*\/\*# sourceURL=[\040\t]*([^\s]*)[\040\t]*\*\/[\040\t]*$/;if(sourceURLLine.search(sourceURLRegex)===-1)
return text;return text.substr(0,sourceURLLineIndex)+text.substr(sourceURLLineIndex+sourceURLLine.length+1);},requestContent:function(userCallback)
{this._cssModel._agent.getStyleSheetText(this.id,textCallback.bind(this)).catchException("").then(userCallback)
function textCallback(error,text)
{if(error||text===null){WebInspector.console.error("Failed to get text for stylesheet "+this.id+": "+error)
text="";}
return this._trimSourceURL(text);}},searchInContent:function(query,caseSensitive,isRegex,callback)
{function performSearch(content)
{callback(WebInspector.ContentProvider.performSearchInContent(content,query,caseSensitive,isRegex));}
this.requestContent(performSearch);},_setContentPromise:function(newText)
{newText=this._trimSourceURL(newText);if(this.hasSourceURL)
newText+="\n/*# sourceURL="+this.sourceURL+" */";return this._cssModel._agent.setStyleSheetText(this.id,newText,callback.bind(this));function callback(error,sourceMapURL)
{this.sourceMapURL=sourceMapURL;return error||null;}},setContent:function(newText,callback)
{this._setContentPromise(newText).catchException(null).then(callback);},isViaInspector:function()
{return this.origin==="inspector";}}
WebInspector.CSSDispatcher=function(cssModel)
{this._cssModel=cssModel;}
WebInspector.CSSDispatcher.prototype={mediaQueryResultChanged:function()
{this._cssModel.mediaQueryResultChanged();},styleSheetChanged:function(styleSheetId)
{this._cssModel._fireStyleSheetChanged(styleSheetId);},styleSheetAdded:function(header)
{this._cssModel._styleSheetAdded(header);},styleSheetRemoved:function(id)
{this._cssModel._styleSheetRemoved(id);},layoutEditorChange:function(id,range)
{this._cssModel._layoutEditorChange(id,range);},}
WebInspector.CSSStyleModel.ComputedStyleLoader=function(cssModel)
{this._cssModel=cssModel;this._nodeIdToPromise=new Map();}
WebInspector.CSSStyleModel.ComputedStyleLoader.prototype={computedStylePromise:function(nodeId)
{if(!this._nodeIdToPromise[nodeId])
this._nodeIdToPromise[nodeId]=this._cssModel._agent.getComputedStyleForNode(nodeId,parsePayload).then(cleanUp.bind(this));return this._nodeIdToPromise[nodeId];function parsePayload(error,computedPayload)
{if(error||!computedPayload||!computedPayload.length)
return null;var result=new Map();for(var property of computedPayload)
result.set(property.name,property.value);return result;}
function cleanUp(computedStyle)
{delete this._nodeIdToPromise[nodeId];return computedStyle;}}}
WebInspector.CSSStyleModel.fromTarget=function(target)
{if(!target.isPage())
return null;return(target.model(WebInspector.CSSStyleModel));}
WebInspector.CSSStyleModel.fromNode=function(node)
{return(WebInspector.CSSStyleModel.fromTarget(node.target()));}
WebInspector.CSSStyleModel.MatchedStyleResult=function(cssModel,node,inlinePayload,attributesPayload,matchedPayload,pseudoPayload,inheritedPayload)
{this._cssModel=cssModel;this._node=node;this._nodeStyles=[];this._nodeForStyle=new Map();this._inheritedStyles=new Set();function addAttributesStyle()
{if(!attributesPayload)
return;var style=new WebInspector.CSSStyleDeclaration(cssModel,null,attributesPayload,WebInspector.CSSStyleDeclaration.Type.Attributes);this._nodeForStyle.set(style,this._node);this._nodeStyles.push(style);}
if(inlinePayload&&this._node.nodeType()===Node.ELEMENT_NODE){var style=new WebInspector.CSSStyleDeclaration(cssModel,null,inlinePayload,WebInspector.CSSStyleDeclaration.Type.Inline);this._nodeForStyle.set(style,this._node);this._nodeStyles.push(style);}
var addedAttributesStyle;var matchedRules=WebInspector.CSSStyleModel.parseRuleMatchArrayPayload(cssModel,matchedPayload);for(var i=matchedRules.length-1;i>=0;--i){var rule=matchedRules[i];if((rule.isInjected()||rule.isUserAgent())&&!addedAttributesStyle){addedAttributesStyle=true;addAttributesStyle.call(this);}
this._nodeForStyle.set(rule.style,this._node);this._nodeStyles.push(rule.style);}
if(!addedAttributesStyle)
addAttributesStyle.call(this);var parentNode=this._node.parentNode;for(var i=0;inheritedPayload&&i<inheritedPayload.length;++i){var entryPayload=inheritedPayload[i];var inheritedInlineStyle=entryPayload.inlineStyle?new WebInspector.CSSStyleDeclaration(cssModel,null,entryPayload.inlineStyle,WebInspector.CSSStyleDeclaration.Type.Inline):null;var inheritedMatchedCSSRules=entryPayload.matchedCSSRules?WebInspector.CSSStyleModel.parseRuleMatchArrayPayload(cssModel,entryPayload.matchedCSSRules):null;if(inheritedInlineStyle&&this._containsInherited(inheritedInlineStyle)){this._nodeForStyle.set(inheritedInlineStyle,parentNode);this._nodeStyles.push(inheritedInlineStyle);this._inheritedStyles.add(inheritedInlineStyle);}
for(var j=inheritedMatchedCSSRules.length-1;j>=0;--j){var inheritedRule=inheritedMatchedCSSRules[j];if(!this._containsInherited(inheritedRule.style))
continue;this._nodeForStyle.set(inheritedRule.style,parentNode);this._nodeStyles.push(inheritedRule.style);this._inheritedStyles.add(inheritedRule.style);}
parentNode=parentNode.parentNode;}
this._pseudoStyles=new Map();if(pseudoPayload){for(var i=0;i<pseudoPayload.length;++i){var entryPayload=pseudoPayload[i];var pseudoElement=this._node.pseudoElements().get(entryPayload.pseudoType);var pseudoStyles=[];var rules=WebInspector.CSSStyleModel.parseRuleMatchArrayPayload(cssModel,entryPayload.matches);for(var j=rules.length-1;j>=0;--j){var pseudoRule=rules[j];pseudoStyles.push(pseudoRule.style);this._nodeForStyle.set(pseudoRule.style,pseudoElement);}
this._pseudoStyles.set(entryPayload.pseudoType,pseudoStyles);}}
this.resetActiveProperties();}
WebInspector.CSSStyleModel.MatchedStyleResult.prototype={node:function()
{return this._node;},hasMatchingSelectors:function(style)
{return style.parentRule?style.parentRule.matchingSelectors&&style.parentRule.matchingSelectors.length>0&&this.mediaMatches(style):true;},mediaMatches:function(style)
{var media=style.parentRule?style.parentRule.media:[];for(var i=0;media&&i<media.length;++i){if(!media[i].active())
return false;}
return true;},nodeStyles:function()
{return this._nodeStyles;},pseudoStyles:function()
{return this._pseudoStyles;},_containsInherited:function(style)
{var properties=style.allProperties;for(var i=0;i<properties.length;++i){var property=properties[i];if(property.activeInStyle()&&WebInspector.CSSMetadata.isPropertyInherited(property.name))
return true;}
return false;},nodeForStyle:function(style)
{return this._nodeForStyle.get(style)||null;},isInherited:function(style)
{return this._inheritedStyles.has(style);},propertyState:function(property)
{if(this._propertiesState.size===0){this._computeActiveProperties(this._nodeStyles,this._propertiesState);for(var pseudoElementStyles of this._pseudoStyles.valuesArray())
this._computeActiveProperties(pseudoElementStyles,this._propertiesState);}
return this._propertiesState.get(property)||null;},resetActiveProperties:function()
{this._propertiesState=new Map();},_computeActiveProperties:function(styles,result)
{var foundImportantProperties=new Set();var propertyToEffectiveRule=new Map();var inheritedPropertyToNode=new Map();var allUsedProperties=new Set();for(var i=0;i<styles.length;++i){var style=styles[i];if(!this.hasMatchingSelectors(style))
continue;var styleActiveProperties=new Map();var allProperties=style.allProperties;for(var j=0;j<allProperties.length;++j){var property=allProperties[j];var inherited=this.isInherited(style);if(inherited&&!WebInspector.CSSMetadata.isPropertyInherited(property.name))
continue;if(!property.activeInStyle()){result.set(property,WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Overloaded);continue;}
var canonicalName=WebInspector.CSSMetadata.canonicalPropertyName(property.name);if(foundImportantProperties.has(canonicalName)){result.set(property,WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Overloaded);continue;}
if(!property.important&&allUsedProperties.has(canonicalName)){result.set(property,WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Overloaded);continue;}
var isKnownProperty=propertyToEffectiveRule.has(canonicalName);var inheritedFromNode=inherited?this.nodeForStyle(style):null;if(!isKnownProperty&&inheritedFromNode&&!inheritedPropertyToNode.has(canonicalName))
inheritedPropertyToNode.set(canonicalName,inheritedFromNode);if(property.important){if(inherited&&isKnownProperty&&inheritedFromNode!==inheritedPropertyToNode.get(canonicalName)){result.set(property,WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Overloaded);continue;}
foundImportantProperties.add(canonicalName);if(isKnownProperty){var overloaded=(propertyToEffectiveRule.get(canonicalName).get(canonicalName));result.set(overloaded,WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Overloaded);propertyToEffectiveRule.get(canonicalName).delete(canonicalName);}}
styleActiveProperties.set(canonicalName,property);allUsedProperties.add(canonicalName);propertyToEffectiveRule.set(canonicalName,styleActiveProperties);result.set(property,WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Active);}
for(var property of style.leadingProperties()){var canonicalName=WebInspector.CSSMetadata.canonicalPropertyName(property.name);if(!styleActiveProperties.has(canonicalName))
continue;var longhands=style.longhandProperties(property.name);if(!longhands.length)
continue;var notUsed=true;for(var longhand of longhands){var longhandCanonicalName=WebInspector.CSSMetadata.canonicalPropertyName(longhand.name);notUsed=notUsed&&!styleActiveProperties.has(longhandCanonicalName);}
if(!notUsed)
continue;styleActiveProperties.delete(canonicalName);allUsedProperties.delete(canonicalName);result.set(property,WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState.Overloaded);}}}}
WebInspector.CSSStyleModel.MatchedStyleResult.PropertyState={Active:"Active",Overloaded:"Overloaded"}
WebInspector.CSSStyleModel.InlineStyleResult=function(inlineStyle,attributesStyle)
{this.inlineStyle=inlineStyle;this.attributesStyle=attributesStyle;};WebInspector.DOMNode=function(domModel,doc,isInShadowTree,payload)
{WebInspector.SDKObject.call(this,domModel.target());this._domModel=domModel;this._agent=domModel._agent;this.ownerDocument=doc;this._isInShadowTree=isInShadowTree;this.id=payload.nodeId;domModel._idToDOMNode[this.id]=this;this._nodeType=payload.nodeType;this._nodeName=payload.nodeName;this._localName=payload.localName;this._nodeValue=payload.nodeValue;this._pseudoType=payload.pseudoType;this._shadowRootType=payload.shadowRootType;this._frameId=payload.frameId||null;this._xmlVersion=payload.xmlVersion;this._shadowRoots=[];this._attributes=[];this._attributesMap={};if(payload.attributes)
this._setAttributesPayload(payload.attributes);this._markers={};this._subtreeMarkerCount=0;this._childNodeCount=payload.childNodeCount||0;this._children=null;this.nextSibling=null;this.previousSibling=null;this.firstChild=null;this.lastChild=null;this.parentNode=null;if(payload.shadowRoots){for(var i=0;i<payload.shadowRoots.length;++i){var root=payload.shadowRoots[i];var node=new WebInspector.DOMNode(this._domModel,this.ownerDocument,true,root);this._shadowRoots.push(node);node.parentNode=this;}}
if(payload.templateContent){this._templateContent=new WebInspector.DOMNode(this._domModel,this.ownerDocument,true,payload.templateContent);this._templateContent.parentNode=this;}
if(payload.importedDocument){this._importedDocument=new WebInspector.DOMNode(this._domModel,this.ownerDocument,true,payload.importedDocument);this._importedDocument.parentNode=this;}
if(payload.distributedNodes)
this._setDistributedNodePayloads(payload.distributedNodes);if(payload.children)
this._setChildrenPayload(payload.children);this._setPseudoElements(payload.pseudoElements);if(payload.contentDocument){this._contentDocument=new WebInspector.DOMDocument(domModel,payload.contentDocument);this._children=[this._contentDocument];this._renumber();}
if(this._nodeType===Node.ELEMENT_NODE){if(this.ownerDocument&&!this.ownerDocument.documentElement&&this._nodeName==="HTML")
this.ownerDocument.documentElement=this;if(this.ownerDocument&&!this.ownerDocument.body&&this._nodeName==="BODY")
this.ownerDocument.body=this;}else if(this._nodeType===Node.DOCUMENT_TYPE_NODE){this.publicId=payload.publicId;this.systemId=payload.systemId;this.internalSubset=payload.internalSubset;}else if(this._nodeType===Node.ATTRIBUTE_NODE){this.name=payload.name;this.value=payload.value;}}
WebInspector.DOMNode.PseudoElementNames={Before:"before",After:"after"}
WebInspector.DOMNode.ShadowRootTypes={UserAgent:"user-agent",Open:"open",Closed:"closed"}
WebInspector.DOMNode.prototype={domModel:function()
{return this._domModel;},children:function()
{return this._children?this._children.slice():null;},hasAttributes:function()
{return this._attributes.length>0;},childNodeCount:function()
{return this._childNodeCount;},hasShadowRoots:function()
{return!!this._shadowRoots.length;},shadowRoots:function()
{return this._shadowRoots.slice();},templateContent:function()
{return this._templateContent||null;},importedDocument:function()
{return this._importedDocument||null;},nodeType:function()
{return this._nodeType;},nodeName:function()
{return this._nodeName;},pseudoType:function()
{return this._pseudoType;},hasPseudoElements:function()
{return this._pseudoElements.size>0;},pseudoElements:function()
{return this._pseudoElements;},beforePseudoElement:function()
{if(!this._pseudoElements)
return null;return this._pseudoElements.get(WebInspector.DOMNode.PseudoElementNames.Before);},afterPseudoElement:function()
{if(!this._pseudoElements)
return null;return this._pseudoElements.get(WebInspector.DOMNode.PseudoElementNames.After);},isInsertionPoint:function()
{return!this.isXMLNode()&&(this._nodeName==="SHADOW"||this._nodeName==="CONTENT");},distributedNodes:function()
{return this._distributedNodes||[];},isInShadowTree:function()
{return this._isInShadowTree;},ancestorShadowHost:function()
{var ancestorShadowRoot=this.ancestorShadowRoot();return ancestorShadowRoot?ancestorShadowRoot.parentNode:null;},ancestorShadowRoot:function()
{if(!this._isInShadowTree)
return null;var current=this;while(current&&!current.isShadowRoot())
current=current.parentNode;return current;},ancestorUserAgentShadowRoot:function()
{var ancestorShadowRoot=this.ancestorShadowRoot();if(!ancestorShadowRoot)
return null;return ancestorShadowRoot.shadowRootType()===WebInspector.DOMNode.ShadowRootTypes.UserAgent?ancestorShadowRoot:null;},isShadowRoot:function()
{return!!this._shadowRootType;},shadowRootType:function()
{return this._shadowRootType||null;},nodeNameInCorrectCase:function()
{var shadowRootType=this.shadowRootType();if(shadowRootType)
return"#shadow-root ("+shadowRootType+")";return this.isXMLNode()?this.nodeName():this.nodeName().toLowerCase();},setNodeName:function(name,callback)
{this._agent.setNodeName(this.id,name,this._domModel._markRevision(this,callback));},localName:function()
{return this._localName;},nodeValue:function()
{return this._nodeValue;},setNodeValue:function(value,callback)
{this._agent.setNodeValue(this.id,value,this._domModel._markRevision(this,callback));},getAttribute:function(name)
{var attr=this._attributesMap[name];return attr?attr.value:undefined;},setAttribute:function(name,text,callback)
{this._agent.setAttributesAsText(this.id,text,name,this._domModel._markRevision(this,callback));},setAttributeValue:function(name,value,callback)
{this._agent.setAttributeValue(this.id,name,value,this._domModel._markRevision(this,callback));},attributes:function()
{return this._attributes;},removeAttribute:function(name,callback)
{function mycallback(error)
{if(!error){delete this._attributesMap[name];for(var i=0;i<this._attributes.length;++i){if(this._attributes[i].name===name){this._attributes.splice(i,1);break;}}}
this._domModel._markRevision(this,callback)(error);}
this._agent.removeAttribute(this.id,name,mycallback.bind(this));},getChildNodes:function(callback)
{if(this._children){if(callback)
callback(this.children());return;}
function mycallback(error)
{if(callback)
callback(error?null:this.children());}
this._agent.requestChildNodes(this.id,undefined,mycallback.bind(this));},getSubtree:function(depth,callback)
{function mycallback(error)
{if(callback)
callback(error?null:this._children);}
this._agent.requestChildNodes(this.id,depth,mycallback.bind(this));},getOuterHTML:function(callback)
{this._agent.getOuterHTML(this.id,callback);},setOuterHTML:function(html,callback)
{this._agent.setOuterHTML(this.id,html,this._domModel._markRevision(this,callback));},removeNode:function(callback)
{this._agent.removeNode(this.id,this._domModel._markRevision(this,callback));},copyNode:function(callback)
{function copy(error,text)
{if(!error)
InspectorFrontendHost.copyText(text);if(callback)
callback(error?null:text);}
this._agent.getOuterHTML(this.id,copy);},path:function()
{function canPush(node)
{return node&&("index"in node||(node.isShadowRoot()&&node.parentNode))&&node._nodeName.length;}
var path=[];var node=this;while(canPush(node)){var index=typeof node.index==="number"?node.index:(node.shadowRootType()===WebInspector.DOMNode.ShadowRootTypes.UserAgent?"u":"a");path.push([index,node._nodeName]);node=node.parentNode;}
path.reverse();return path.join(",");},isAncestor:function(node)
{if(!node)
return false;var currentNode=node.parentNode;while(currentNode){if(this===currentNode)
return true;currentNode=currentNode.parentNode;}
return false;},isDescendant:function(descendant)
{return descendant!==null&&descendant.isAncestor(this);},frameId:function()
{var node=this;while(!node._frameId&&node.parentNode)
node=node.parentNode;return node._frameId;},_setAttributesPayload:function(attrs)
{var attributesChanged=!this._attributes||attrs.length!==this._attributes.length*2;var oldAttributesMap=this._attributesMap||{};this._attributes=[];this._attributesMap={};for(var i=0;i<attrs.length;i+=2){var name=attrs[i];var value=attrs[i+1];this._addAttribute(name,value);if(attributesChanged)
continue;if(!oldAttributesMap[name]||oldAttributesMap[name].value!==value)
attributesChanged=true;}
return attributesChanged;},_insertChild:function(prev,payload)
{var node=new WebInspector.DOMNode(this._domModel,this.ownerDocument,this._isInShadowTree,payload);this._children.splice(this._children.indexOf(prev)+1,0,node);this._renumber();return node;},_removeChild:function(node)
{if(node.pseudoType()){this._pseudoElements.delete(node.pseudoType());}else{var shadowRootIndex=this._shadowRoots.indexOf(node);if(shadowRootIndex!==-1){this._shadowRoots.splice(shadowRootIndex,1);}else{console.assert(this._children.indexOf(node)!==-1);this._children.splice(this._children.indexOf(node),1);}}
node.parentNode=null;this._subtreeMarkerCount-=node._subtreeMarkerCount;if(node._subtreeMarkerCount)
this._domModel.dispatchEventToListeners(WebInspector.DOMModel.Events.MarkersChanged,this);this._renumber();},_setChildrenPayload:function(payloads)
{if(this._contentDocument)
return;this._children=[];for(var i=0;i<payloads.length;++i){var payload=payloads[i];var node=new WebInspector.DOMNode(this._domModel,this.ownerDocument,this._isInShadowTree,payload);this._children.push(node);}
this._renumber();},_setPseudoElements:function(payloads)
{this._pseudoElements=new Map();if(!payloads)
return;for(var i=0;i<payloads.length;++i){var node=new WebInspector.DOMNode(this._domModel,this.ownerDocument,this._isInShadowTree,payloads[i]);node.parentNode=this;this._pseudoElements.set(node.pseudoType(),node);}},_setDistributedNodePayloads:function(payloads)
{this._distributedNodes=[];for(var payload of payloads)
this._distributedNodes.push(new WebInspector.DOMNodeShortcut(this._domModel.target(),payload.backendNodeId,payload.nodeType,payload.nodeName));},_renumber:function()
{this._childNodeCount=this._children.length;if(this._childNodeCount==0){this.firstChild=null;this.lastChild=null;return;}
this.firstChild=this._children[0];this.lastChild=this._children[this._childNodeCount-1];for(var i=0;i<this._childNodeCount;++i){var child=this._children[i];child.index=i;child.nextSibling=i+1<this._childNodeCount?this._children[i+1]:null;child.previousSibling=i-1>=0?this._children[i-1]:null;child.parentNode=this;}},_addAttribute:function(name,value)
{var attr={name:name,value:value,_node:this};this._attributesMap[name]=attr;this._attributes.push(attr);},_setAttribute:function(name,value)
{var attr=this._attributesMap[name];if(attr)
attr.value=value;else
this._addAttribute(name,value);},_removeAttribute:function(name)
{var attr=this._attributesMap[name];if(attr){this._attributes.remove(attr);delete this._attributesMap[name];}},copyTo:function(targetNode,anchorNode,callback)
{this._agent.copyTo(this.id,targetNode.id,anchorNode?anchorNode.id:undefined,this._domModel._markRevision(this,callback));},moveTo:function(targetNode,anchorNode,callback)
{this._agent.moveTo(this.id,targetNode.id,anchorNode?anchorNode.id:undefined,this._domModel._markRevision(this,callback));},isXMLNode:function()
{return!!this._xmlVersion;},setMarker:function(name,value)
{if(value===null){if(!this._markers.hasOwnProperty(name))
return;delete this._markers[name];for(var node=this;node;node=node.parentNode)
--node._subtreeMarkerCount;for(var node=this;node;node=node.parentNode)
this._domModel.dispatchEventToListeners(WebInspector.DOMModel.Events.MarkersChanged,node);return;}
if(this.parentNode&&!this._markers.hasOwnProperty(name)){for(var node=this;node;node=node.parentNode)
++node._subtreeMarkerCount;}
this._markers[name]=value;for(var node=this;node;node=node.parentNode)
this._domModel.dispatchEventToListeners(WebInspector.DOMModel.Events.MarkersChanged,node);},marker:function(name)
{return this._markers[name]||null;},markers:function()
{return Object.values(this._markers);},traverseMarkers:function(visitor)
{function traverse(node)
{if(!node._subtreeMarkerCount)
return;for(var marker in node._markers)
visitor(node,marker);if(!node._children)
return;for(var child of node._children)
traverse(child);}
traverse(this);},resolveURL:function(url)
{if(!url)
return url;for(var frameOwnerCandidate=this;frameOwnerCandidate;frameOwnerCandidate=frameOwnerCandidate.parentNode){if(frameOwnerCandidate.baseURL)
return WebInspector.ParsedURL.completeURL(frameOwnerCandidate.baseURL,url);}
return null;},highlight:function(mode,objectId)
{this._domModel.highlightDOMNode(this.id,mode,undefined,objectId);},highlightForTwoSeconds:function()
{this._domModel.highlightDOMNodeForTwoSeconds(this.id);},resolveToObject:function(objectGroup,callback)
{this._agent.resolveNode(this.id,objectGroup,mycallback.bind(this));function mycallback(error,object)
{if(!callback)
return;if(error||!object)
callback(null);else
callback(this.target().runtimeModel.createRemoteObject(object));}},resolveToObjectPromise:function(objectGroup)
{return new Promise(resolveToObject.bind(this));function resolveToObject(fulfill,reject)
{this.resolveToObject(objectGroup,mycallback);function mycallback(object)
{if(object)
fulfill(object)
else
reject(null);}}},boxModel:function(callback)
{this._agent.getBoxModel(this.id,this._domModel._wrapClientCallback(callback));},setAsInspectedNode:function()
{var node=this;while(true){var ancestor=node.ancestorUserAgentShadowRoot();if(!ancestor)
break;ancestor=node.ancestorShadowHost();if(!ancestor)
break
node=ancestor;}
this._agent.setInspectedNode(node.id);},__proto__:WebInspector.SDKObject.prototype}
WebInspector.DeferredDOMNode=function(target,backendNodeId)
{this._domModel=WebInspector.DOMModel.fromTarget(target);this._backendNodeId=backendNodeId;}
WebInspector.DeferredDOMNode.prototype={resolve:function(callback)
{if(!this._domModel){callback(null);return;}
this._domModel.pushNodesByBackendIdsToFrontend(new Set([this._backendNodeId]),onGotNode.bind(this));function onGotNode(nodeIds)
{callback(nodeIds&&(nodeIds.get(this._backendNodeId)||null));}},resolvePromise:function()
{function resolveNode(fulfill,reject)
{function mycallback(node)
{fulfill(node)}
this.resolve(mycallback);}
return new Promise(resolveNode.bind(this));},backendNodeId:function()
{return this._backendNodeId;},highlight:function()
{if(this._domModel)
this._domModel.highlightDOMNode(undefined,undefined,this._backendNodeId);}}
WebInspector.DOMNodeShortcut=function(target,backendNodeId,nodeType,nodeName)
{this.nodeType=nodeType;this.nodeName=nodeName;this.deferredNode=new WebInspector.DeferredDOMNode(target,backendNodeId);}
WebInspector.DOMDocument=function(domModel,payload)
{WebInspector.DOMNode.call(this,domModel,this,false,payload);this.documentURL=payload.documentURL||"";this.baseURL=payload.baseURL||"";this._listeners={};}
WebInspector.DOMDocument.prototype={__proto__:WebInspector.DOMNode.prototype}
WebInspector.DOMModel=function(target){WebInspector.SDKModel.call(this,WebInspector.DOMModel,target);this._agent=target.domAgent();this._idToDOMNode={};this._document=null;this._attributeLoadNodeIds={};target.registerDOMDispatcher(new WebInspector.DOMDispatcher(this));this._showRulers=false;this._showExtensionLines=false;this._defaultHighlighter=new WebInspector.DefaultDOMNodeHighlighter(this._agent);this._highlighter=this._defaultHighlighter;this._agent.enable();}
WebInspector.DOMModel.Events={AttrModified:"AttrModified",AttrRemoved:"AttrRemoved",CharacterDataModified:"CharacterDataModified",DOMMutated:"DOMMutated",NodeInserted:"NodeInserted",NodeInspected:"NodeInspected",NodeHighlightedInOverlay:"NodeHighlightedInOverlay",NodeRemoved:"NodeRemoved",DocumentUpdated:"DocumentUpdated",ChildNodeCountUpdated:"ChildNodeCountUpdated",UndoRedoRequested:"UndoRedoRequested",UndoRedoCompleted:"UndoRedoCompleted",DistributedNodesChanged:"DistributedNodesChanged",ModelSuspended:"ModelSuspended",InspectModeWillBeToggled:"InspectModeWillBeToggled",MarkersChanged:"MarkersChanged"}
WebInspector.DOMModel.highlightObjectAsDOMNode=function(object)
{var domModel=WebInspector.DOMModel.fromTarget(object.target());if(domModel)
domModel.highlightDOMNode(undefined,undefined,undefined,object.objectId);}
WebInspector.DOMModel.instances=function()
{var result=[];for(var target of WebInspector.targetManager.targets()){var domModel=WebInspector.DOMModel.fromTarget(target);if(domModel)
result.push(domModel);}
return result;}
WebInspector.DOMModel.hideDOMNodeHighlight=function()
{for(var domModel of WebInspector.DOMModel.instances())
domModel.highlightDOMNode(0);}
WebInspector.DOMModel.cancelSearch=function()
{for(var domModel of WebInspector.DOMModel.instances())
domModel._cancelSearch();}
WebInspector.DOMModel.prototype={_scheduleMutationEvent:function(node)
{if(!this.hasEventListeners(WebInspector.DOMModel.Events.DOMMutated))
return;this._lastMutationId=(this._lastMutationId||0)+1;Promise.resolve().then(callObserve.bind(this,node,this._lastMutationId));function callObserve(node,mutationId)
{if(!this.hasEventListeners(WebInspector.DOMModel.Events.DOMMutated)||this._lastMutationId!==mutationId)
return;this.dispatchEventToListeners(WebInspector.DOMModel.Events.DOMMutated,node);}},requestDocument:function(callback)
{if(this._document){if(callback)
callback(this._document);return;}
if(this._pendingDocumentRequestCallbacks){this._pendingDocumentRequestCallbacks.push(callback);return;}
this._pendingDocumentRequestCallbacks=[callback];function onDocumentAvailable(error,root)
{if(!error)
this._setDocument(root);for(var i=0;i<this._pendingDocumentRequestCallbacks.length;++i){var callback=this._pendingDocumentRequestCallbacks[i];if(callback)
callback(this._document);}
delete this._pendingDocumentRequestCallbacks;}
this._agent.getDocument(onDocumentAvailable.bind(this));},existingDocument:function()
{return this._document;},pushNodeToFrontend:function(objectId,callback)
{function mycallback(nodeId)
{callback(nodeId?this.nodeForId(nodeId):null);}
this._dispatchWhenDocumentAvailable(this._agent.requestNode.bind(this._agent,objectId),mycallback.bind(this));},pushNodeByPathToFrontend:function(path,callback)
{this._dispatchWhenDocumentAvailable(this._agent.pushNodeByPathToFrontend.bind(this._agent,path),callback);},pushNodesByBackendIdsToFrontend:function(backendNodeIds,callback)
{var backendNodeIdsArray=Array.from(backendNodeIds.values());function mycallback(nodeIds)
{if(!nodeIds){callback(null);return;}
var map=new Map();for(var i=0;i<nodeIds.length;++i){if(nodeIds[i])
map.set(backendNodeIdsArray[i],this.nodeForId(nodeIds[i]));}
callback(map);}
this._dispatchWhenDocumentAvailable(this._agent.pushNodesByBackendIdsToFrontend.bind(this._agent,backendNodeIdsArray),mycallback.bind(this));},_wrapClientCallback:function(callback)
{if(!callback)
return;var wrapper=function(error,result)
{callback(error?null:result);};return wrapper;},_dispatchWhenDocumentAvailable:function(func,callback)
{var callbackWrapper=this._wrapClientCallback(callback);function onDocumentAvailable()
{if(this._document)
func(callbackWrapper);else{if(callbackWrapper)
callbackWrapper("No document");}}
this.requestDocument(onDocumentAvailable.bind(this));},_attributeModified:function(nodeId,name,value)
{var node=this._idToDOMNode[nodeId];if(!node)
return;node._setAttribute(name,value);this.dispatchEventToListeners(WebInspector.DOMModel.Events.AttrModified,{node:node,name:name});this._scheduleMutationEvent(node);},_attributeRemoved:function(nodeId,name)
{var node=this._idToDOMNode[nodeId];if(!node)
return;node._removeAttribute(name);this.dispatchEventToListeners(WebInspector.DOMModel.Events.AttrRemoved,{node:node,name:name});this._scheduleMutationEvent(node);},_inlineStyleInvalidated:function(nodeIds)
{for(var i=0;i<nodeIds.length;++i)
this._attributeLoadNodeIds[nodeIds[i]]=true;if("_loadNodeAttributesTimeout"in this)
return;this._loadNodeAttributesTimeout=setTimeout(this._loadNodeAttributes.bind(this),20);},_loadNodeAttributes:function()
{function callback(nodeId,error,attributes)
{if(error){return;}
var node=this._idToDOMNode[nodeId];if(node){if(node._setAttributesPayload(attributes)){this.dispatchEventToListeners(WebInspector.DOMModel.Events.AttrModified,{node:node,name:"style"});this._scheduleMutationEvent(node);}}}
delete this._loadNodeAttributesTimeout;for(var nodeId in this._attributeLoadNodeIds){var nodeIdAsNumber=parseInt(nodeId,10);this._agent.getAttributes(nodeIdAsNumber,callback.bind(this,nodeIdAsNumber));}
this._attributeLoadNodeIds={};},_characterDataModified:function(nodeId,newValue)
{var node=this._idToDOMNode[nodeId];node._nodeValue=newValue;this.dispatchEventToListeners(WebInspector.DOMModel.Events.CharacterDataModified,node);this._scheduleMutationEvent(node);},nodeForId:function(nodeId)
{return this._idToDOMNode[nodeId]||null;},_documentUpdated:function()
{this._setDocument(null);},_setDocument:function(payload)
{this._idToDOMNode={};if(payload&&"nodeId"in payload)
this._document=new WebInspector.DOMDocument(this,payload);else
this._document=null;this.dispatchEventToListeners(WebInspector.DOMModel.Events.DocumentUpdated,this._document);},_setDetachedRoot:function(payload)
{if(payload.nodeName==="#document")
new WebInspector.DOMDocument(this,payload);else
new WebInspector.DOMNode(this,null,false,payload);},_setChildNodes:function(parentId,payloads)
{if(!parentId&&payloads.length){this._setDetachedRoot(payloads[0]);return;}
var parent=this._idToDOMNode[parentId];parent._setChildrenPayload(payloads);},_childNodeCountUpdated:function(nodeId,newValue)
{var node=this._idToDOMNode[nodeId];node._childNodeCount=newValue;this.dispatchEventToListeners(WebInspector.DOMModel.Events.ChildNodeCountUpdated,node);this._scheduleMutationEvent(node);},_childNodeInserted:function(parentId,prevId,payload)
{var parent=this._idToDOMNode[parentId];var prev=this._idToDOMNode[prevId];var node=parent._insertChild(prev,payload);this._idToDOMNode[node.id]=node;this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeInserted,node);this._scheduleMutationEvent(node);},_childNodeRemoved:function(parentId,nodeId)
{var parent=this._idToDOMNode[parentId];var node=this._idToDOMNode[nodeId];parent._removeChild(node);this._unbind(node);this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeRemoved,{node:node,parent:parent});this._scheduleMutationEvent(node);},_shadowRootPushed:function(hostId,root)
{var host=this._idToDOMNode[hostId];if(!host)
return;var node=new WebInspector.DOMNode(this,host.ownerDocument,true,root);node.parentNode=host;this._idToDOMNode[node.id]=node;host._shadowRoots.unshift(node);this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeInserted,node);this._scheduleMutationEvent(node);},_shadowRootPopped:function(hostId,rootId)
{var host=this._idToDOMNode[hostId];if(!host)
return;var root=this._idToDOMNode[rootId];if(!root)
return;host._removeChild(root);this._unbind(root);this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeRemoved,{node:root,parent:host});this._scheduleMutationEvent(root);},_pseudoElementAdded:function(parentId,pseudoElement)
{var parent=this._idToDOMNode[parentId];if(!parent)
return;var node=new WebInspector.DOMNode(this,parent.ownerDocument,false,pseudoElement);node.parentNode=parent;this._idToDOMNode[node.id]=node;console.assert(!parent._pseudoElements.get(node.pseudoType()));parent._pseudoElements.set(node.pseudoType(),node);this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeInserted,node);this._scheduleMutationEvent(node);},_pseudoElementRemoved:function(parentId,pseudoElementId)
{var parent=this._idToDOMNode[parentId];if(!parent)
return;var pseudoElement=this._idToDOMNode[pseudoElementId];if(!pseudoElement)
return;parent._removeChild(pseudoElement);this._unbind(pseudoElement);this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeRemoved,{node:pseudoElement,parent:parent});this._scheduleMutationEvent(pseudoElement);},_distributedNodesUpdated:function(insertionPointId,distributedNodes)
{var insertionPoint=this._idToDOMNode[insertionPointId];if(!insertionPoint)
return;insertionPoint._setDistributedNodePayloads(distributedNodes);this.dispatchEventToListeners(WebInspector.DOMModel.Events.DistributedNodesChanged,insertionPoint);this._scheduleMutationEvent(insertionPoint);},_unbind:function(node)
{delete this._idToDOMNode[node.id];for(var i=0;node._children&&i<node._children.length;++i)
this._unbind(node._children[i]);for(var i=0;i<node._shadowRoots.length;++i)
this._unbind(node._shadowRoots[i]);var pseudoElements=node.pseudoElements();for(var value of pseudoElements.values())
this._unbind(value);if(node._templateContent)
this._unbind(node._templateContent);},_inspectNodeRequested:function(backendNodeId)
{var deferredNode=new WebInspector.DeferredDOMNode(this.target(),backendNodeId);this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeInspected,deferredNode);},performSearch:function(query,includeUserAgentShadowDOM,searchCallback)
{WebInspector.DOMModel.cancelSearch();function callback(error,searchId,resultsCount)
{this._searchId=searchId;searchCallback(resultsCount);}
this._agent.performSearch(query,includeUserAgentShadowDOM,callback.bind(this));},performSearchPromise:function(query,includeUserAgentShadowDOM)
{return new Promise(performSearch.bind(this));function performSearch(resolve)
{this._agent.performSearch(query,includeUserAgentShadowDOM,callback.bind(this));function callback(error,searchId,resultsCount)
{if(!error)
this._searchId=searchId;resolve(error?0:resultsCount);}}},searchResult:function(index,callback)
{if(this._searchId)
this._agent.getSearchResults(this._searchId,index,index+1,searchResultsCallback.bind(this));else
callback(null);function searchResultsCallback(error,nodeIds)
{if(error){console.error(error);callback(null);return;}
if(nodeIds.length!=1)
return;callback(this.nodeForId(nodeIds[0]));}},_cancelSearch:function()
{if(this._searchId){this._agent.discardSearchResults(this._searchId);delete this._searchId;}},querySelector:function(nodeId,selectors,callback)
{this._agent.querySelector(nodeId,selectors,this._wrapClientCallback(callback));},querySelectorAll:function(nodeId,selectors,callback)
{this._agent.querySelectorAll(nodeId,selectors,this._wrapClientCallback(callback));},highlightDOMNode:function(nodeId,mode,backendNodeId,objectId)
{this.highlightDOMNodeWithConfig(nodeId,{mode:mode},backendNodeId,objectId);},highlightDOMNodeWithConfig:function(nodeId,config,backendNodeId,objectId)
{config=config||{mode:"all",showInfo:undefined,selectors:undefined};if(this._hideDOMNodeHighlightTimeout){clearTimeout(this._hideDOMNodeHighlightTimeout);delete this._hideDOMNodeHighlightTimeout;}
var highlightConfig=this._buildHighlightConfig(config.mode);if(typeof config.showInfo!=="undefined")
highlightConfig.showInfo=config.showInfo;if(typeof config.selectors!=="undefined")
highlightConfig.selectorList=config.selectors;this._highlighter.highlightDOMNode(this.nodeForId(nodeId||0),highlightConfig,backendNodeId,objectId);},highlightDOMNodeForTwoSeconds:function(nodeId)
{this.highlightDOMNode(nodeId);this._hideDOMNodeHighlightTimeout=setTimeout(WebInspector.DOMModel.hideDOMNodeHighlight.bind(WebInspector.DOMModel),2000);},highlightFrame:function(frameId)
{this._highlighter.highlightFrame(frameId);},setInspectMode:function(mode,callback)
{function onDocumentAvailable()
{this.dispatchEventToListeners(WebInspector.DOMModel.Events.InspectModeWillBeToggled,mode!==DOMAgent.InspectMode.None);this._highlighter.setInspectMode(mode,this._buildHighlightConfig(),callback);}
this.requestDocument(onDocumentAvailable.bind(this));},setHighlightSettings:function(showRulers,showExtensionLines)
{this._showRulers=showRulers;this._showExtensionLines=showExtensionLines;},_buildHighlightConfig:function(mode)
{mode=mode||"all";var highlightConfig={showInfo:mode==="all",showRulers:this._showRulers,showExtensionLines:this._showExtensionLines};if(mode==="all"||mode==="content")
highlightConfig.contentColor=WebInspector.Color.PageHighlight.Content.toProtocolRGBA();if(mode==="all"||mode==="padding")
highlightConfig.paddingColor=WebInspector.Color.PageHighlight.Padding.toProtocolRGBA();if(mode==="all"||mode==="border")
highlightConfig.borderColor=WebInspector.Color.PageHighlight.Border.toProtocolRGBA();if(mode==="all"||mode==="margin")
highlightConfig.marginColor=WebInspector.Color.PageHighlight.Margin.toProtocolRGBA();if(mode==="all"){highlightConfig.eventTargetColor=WebInspector.Color.PageHighlight.EventTarget.toProtocolRGBA();highlightConfig.shapeColor=WebInspector.Color.PageHighlight.Shape.toProtocolRGBA();highlightConfig.shapeMarginColor=WebInspector.Color.PageHighlight.ShapeMargin.toProtocolRGBA();highlightConfig.displayAsMaterial=Runtime.experiments.isEnabled("materialDesign");}
return highlightConfig;},_markRevision:function(node,callback)
{function wrapperFunction(error)
{if(!error)
this.markUndoableState();if(callback)
callback.apply(this,arguments);}
return wrapperFunction.bind(this);},markUndoableState:function()
{this._agent.markUndoableState();},undo:function(callback)
{function mycallback(error)
{this.dispatchEventToListeners(WebInspector.DOMModel.Events.UndoRedoCompleted);callback(error);}
this.dispatchEventToListeners(WebInspector.DOMModel.Events.UndoRedoRequested);this._agent.undo(callback);},redo:function(callback)
{function mycallback(error)
{this.dispatchEventToListeners(WebInspector.DOMModel.Events.UndoRedoCompleted);callback(error);}
this.dispatchEventToListeners(WebInspector.DOMModel.Events.UndoRedoRequested);this._agent.redo(callback);},setHighlighter:function(highlighter)
{this._highlighter=highlighter||this._defaultHighlighter;},nodeForLocation:function(x,y,callback)
{this._agent.getNodeForLocation(x,y,mycallback.bind(this));function mycallback(error,nodeId)
{if(error){callback(null);return;}
callback(this.nodeForId(nodeId));}},pushObjectAsNodeToFrontend:function(object,callback)
{if(object.isNode())
this.pushNodeToFrontend(object.objectId,callback);else
callback(null);},suspendModel:function()
{return new Promise(promiseBody.bind(this));function promiseBody(fulfill)
{this._agent.disable(callback.bind(this));function callback()
{this._setDocument(null);fulfill();}}},resumeModel:function()
{return new Promise(promiseBody.bind(this));function promiseBody(fulfill)
{this._agent.enable(fulfill);}},nodeHighlightRequested:function(nodeId)
{var node=this.nodeForId(nodeId);if(!node)
return;this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeHighlightedInOverlay,node);},__proto__:WebInspector.SDKModel.prototype}
WebInspector.DOMDispatcher=function(domModel)
{this._domModel=domModel;}
WebInspector.DOMDispatcher.prototype={documentUpdated:function()
{this._domModel._documentUpdated();},inspectNodeRequested:function(nodeId)
{this._domModel._inspectNodeRequested(nodeId);},attributeModified:function(nodeId,name,value)
{this._domModel._attributeModified(nodeId,name,value);},attributeRemoved:function(nodeId,name)
{this._domModel._attributeRemoved(nodeId,name);},inlineStyleInvalidated:function(nodeIds)
{this._domModel._inlineStyleInvalidated(nodeIds);},characterDataModified:function(nodeId,characterData)
{this._domModel._characterDataModified(nodeId,characterData);},setChildNodes:function(parentId,payloads)
{this._domModel._setChildNodes(parentId,payloads);},childNodeCountUpdated:function(nodeId,childNodeCount)
{this._domModel._childNodeCountUpdated(nodeId,childNodeCount);},childNodeInserted:function(parentNodeId,previousNodeId,payload)
{this._domModel._childNodeInserted(parentNodeId,previousNodeId,payload);},childNodeRemoved:function(parentNodeId,nodeId)
{this._domModel._childNodeRemoved(parentNodeId,nodeId);},shadowRootPushed:function(hostId,root)
{this._domModel._shadowRootPushed(hostId,root);},shadowRootPopped:function(hostId,rootId)
{this._domModel._shadowRootPopped(hostId,rootId);},pseudoElementAdded:function(parentId,pseudoElement)
{this._domModel._pseudoElementAdded(parentId,pseudoElement);},pseudoElementRemoved:function(parentId,pseudoElementId)
{this._domModel._pseudoElementRemoved(parentId,pseudoElementId);},distributedNodesUpdated:function(insertionPointId,distributedNodes)
{this._domModel._distributedNodesUpdated(insertionPointId,distributedNodes);},nodeHighlightRequested:function(nodeId)
{this._domModel.nodeHighlightRequested(nodeId);}}
WebInspector.DOMNodeHighlighter=function(){}
WebInspector.DOMNodeHighlighter.prototype={highlightDOMNode:function(node,config,backendNodeId,objectId){},setInspectMode:function(mode,config,callback){},highlightFrame:function(frameId){}}
WebInspector.DefaultDOMNodeHighlighter=function(agent)
{this._agent=agent;}
WebInspector.DefaultDOMNodeHighlighter.prototype={highlightDOMNode:function(node,config,backendNodeId,objectId)
{if(objectId||node||backendNodeId)
this._agent.highlightNode(config,(objectId||backendNodeId)?undefined:node.id,backendNodeId,objectId);else
this._agent.hideHighlight();},setInspectMode:function(mode,config,callback)
{this._agent.setInspectMode(mode,config,callback);},highlightFrame:function(frameId)
{this._agent.highlightFrame(frameId,WebInspector.Color.PageHighlight.Content.toProtocolRGBA(),WebInspector.Color.PageHighlight.ContentOutline.toProtocolRGBA());}}
WebInspector.DOMModel.fromTarget=function(target)
{return(target.model(WebInspector.DOMModel));};WebInspector.DebuggerModel=function(target)
{WebInspector.SDKModel.call(this,WebInspector.DebuggerModel,target);target.registerDebuggerDispatcher(new WebInspector.DebuggerDispatcher(this));this._agent=target.debuggerAgent();WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.TargetDisposed,this._targetDisposed,this);this._debuggerPausedDetails=null;this._scripts={};this._scriptsBySourceURL=new Map();this._breakpointResolvedEventTarget=new WebInspector.Object();this._isPausing=false;WebInspector.moduleSetting("pauseOnExceptionEnabled").addChangeListener(this._pauseOnExceptionStateChanged,this);WebInspector.moduleSetting("pauseOnCaughtException").addChangeListener(this._pauseOnExceptionStateChanged,this);WebInspector.moduleSetting("enableAsyncStackTraces").addChangeListener(this.asyncStackTracesStateChanged,this);WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this._applySkipStackFrameSettings,this);WebInspector.moduleSetting("skipContentScripts").addChangeListener(this._applySkipStackFrameSettings,this);this.enableDebugger();this._applySkipStackFrameSettings();}
WebInspector.DebuggerModel.FunctionDetails;WebInspector.DebuggerModel.GeneratorObjectDetails;WebInspector.DebuggerModel.PauseOnExceptionsState={DontPauseOnExceptions:"none",PauseOnAllExceptions:"all",PauseOnUncaughtExceptions:"uncaught"};WebInspector.DebuggerModel.Events={AsyncOperationStarted:"AsyncOperationStarted",AsyncOperationCompleted:"AsyncOperationCompleted",DebuggerWasEnabled:"DebuggerWasEnabled",DebuggerWasDisabled:"DebuggerWasDisabled",BeforeDebuggerPaused:"BeforeDebuggerPaused",DebuggerPaused:"DebuggerPaused",DebuggerResumed:"DebuggerResumed",ParsedScriptSource:"ParsedScriptSource",FailedToParseScriptSource:"FailedToParseScriptSource",GlobalObjectCleared:"GlobalObjectCleared",CallFrameSelected:"CallFrameSelected",ConsoleCommandEvaluatedInSelectedCallFrame:"ConsoleCommandEvaluatedInSelectedCallFrame",PromiseUpdated:"PromiseUpdated",}
WebInspector.DebuggerModel.BreakReason={AsyncOperation:"AsyncOperation",DOM:"DOM",EventListener:"EventListener",XHR:"XHR",Exception:"exception",PromiseRejection:"promiseRejection",Assert:"assert",CSPViolation:"CSPViolation",DebugCommand:"debugCommand",Other:"other"}
WebInspector.DebuggerModel.prototype={debuggerEnabled:function()
{return!!this._debuggerEnabled;},enableDebugger:function(callback)
{if(this._debuggerEnabled){if(callback)
callback();return;}
this._agent.enable(callback);this._debuggerEnabled=true;this._pauseOnExceptionStateChanged();this.asyncStackTracesStateChanged();this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasEnabled);},disableDebugger:function(callback)
{if(!this._debuggerEnabled){if(callback)
callback();return;}
this._agent.disable(callback);this._debuggerEnabled=false;this._isPausing=false;this.asyncStackTracesStateChanged();this._globalObjectCleared();this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasDisabled);},_skipAllPauses:function(skip)
{if(this._skipAllPausesTimeout){clearTimeout(this._skipAllPausesTimeout);delete this._skipAllPausesTimeout;}
this._agent.setSkipAllPauses(skip);},skipAllPausesUntilReloadOrTimeout:function(timeout)
{if(this._skipAllPausesTimeout)
clearTimeout(this._skipAllPausesTimeout);this._agent.setSkipAllPauses(true);this._skipAllPausesTimeout=setTimeout(this._skipAllPauses.bind(this,false),timeout);},_pauseOnExceptionStateChanged:function()
{var state;if(!WebInspector.moduleSetting("pauseOnExceptionEnabled").get()){state=WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions;}else if(WebInspector.moduleSetting("pauseOnCaughtException").get()){state=WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions;}else{state=WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions;}
this._agent.setPauseOnExceptions(state);},asyncStackTracesStateChanged:function()
{const maxAsyncStackChainDepth=4;var enabled=WebInspector.moduleSetting("enableAsyncStackTraces").get()&&this._debuggerEnabled;this._agent.setAsyncCallStackDepth(enabled?maxAsyncStackChainDepth:0);},stepInto:function()
{this._agent.stepInto();},stepIntoAsync:function()
{this._agent.stepIntoAsync();},stepOver:function()
{this._agent.stepOver();},stepOut:function()
{this._agent.stepOut();},resume:function()
{this._agent.resume();this._isPausing=false;},pause:function()
{this._isPausing=true;this._skipAllPauses(false);this._agent.pause();},setBreakpointsActive:function(active)
{this._agent.setBreakpointsActive(active);},setBreakpointByURL:function(url,lineNumber,columnNumber,condition,callback)
{var minColumnNumber=0;var scripts=this._scriptsBySourceURL.get(url)||[];for(var i=0,l=scripts.length;i<l;++i){var script=scripts[i];if(lineNumber===script.lineOffset)
minColumnNumber=minColumnNumber?Math.min(minColumnNumber,script.columnOffset):script.columnOffset;}
columnNumber=Math.max(columnNumber,minColumnNumber);var target=this.target();function didSetBreakpoint(error,breakpointId,locations)
{if(callback){var rawLocations=locations?locations.map(WebInspector.DebuggerModel.Location.fromPayload.bind(WebInspector.DebuggerModel.Location,this)):[];callback(error?null:breakpointId,rawLocations);}}
this._agent.setBreakpointByUrl(lineNumber,url,undefined,columnNumber,condition,didSetBreakpoint.bind(this));},setBreakpointBySourceId:function(rawLocation,condition,callback)
{var target=this.target();function didSetBreakpoint(error,breakpointId,actualLocation)
{if(callback){var location=WebInspector.DebuggerModel.Location.fromPayload(this,actualLocation);callback(error?null:breakpointId,[location]);}}
this._agent.setBreakpoint(rawLocation.payload(),condition,didSetBreakpoint.bind(this));},removeBreakpoint:function(breakpointId,callback)
{this._agent.removeBreakpoint(breakpointId,innerCallback);function innerCallback(error)
{if(error)
console.error("Failed to remove breakpoint: "+error);if(callback)
callback();}},getCollectionEntries:function(objectId,callback)
{this._agent.getCollectionEntries(objectId,innerCallback);function innerCallback(error,response)
{if(error){console.error(error);callback(null);return;}
callback(response);}},enablePromiseTracker:function(captureStacks)
{this._agent.enablePromiseTracker(captureStacks);},disablePromiseTracker:function()
{this._agent.disablePromiseTracker();},getPromiseById:function(promiseId,objectGroup,callback)
{this._agent.getPromiseById(promiseId,objectGroup,innerCallback);function innerCallback(error,promise)
{if(error){console.error(error);callback(null);return;}
callback(promise);}},flushAsyncOperationEvents:function()
{this._agent.flushAsyncOperationEvents();},setAsyncOperationBreakpoint:function(operationId)
{this._agent.setAsyncOperationBreakpoint(operationId);},removeAsyncOperationBreakpoint:function(operationId)
{this._agent.removeAsyncOperationBreakpoint(operationId);},_breakpointResolved:function(breakpointId,location)
{this._breakpointResolvedEventTarget.dispatchEventToListeners(breakpointId,WebInspector.DebuggerModel.Location.fromPayload(this,location));},_globalObjectCleared:function()
{this._setDebuggerPausedDetails(null);this._reset();this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.GlobalObjectCleared);},_promiseUpdated:function(eventType,promise)
{this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.PromiseUpdated,{eventType:eventType,promise:promise});},_asyncOperationStarted:function(operation)
{this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.AsyncOperationStarted,operation);},_asyncOperationCompleted:function(operationId)
{this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.AsyncOperationCompleted,operationId);},_reset:function()
{this._scripts={};this._scriptsBySourceURL.clear();},get scripts()
{return this._scripts;},scriptForId:function(scriptId)
{return this._scripts[scriptId]||null;},scriptsForSourceURL:function(sourceURL)
{if(!sourceURL)
return[];return this._scriptsBySourceURL.get(sourceURL)||[];},setScriptSource:function(scriptId,newSource,callback)
{this._scripts[scriptId].editSource(newSource,this._didEditScriptSource.bind(this,scriptId,newSource,callback));},_didEditScriptSource:function(scriptId,newSource,callback,error,errorData,callFrames,asyncStackTrace,needsStepIn)
{if(needsStepIn){this.stepInto();this._pendingLiveEditCallback=callback.bind(this,error,errorData);return;}
if(!error&&callFrames&&callFrames.length)
this._pausedScript(callFrames,this._debuggerPausedDetails.reason,this._debuggerPausedDetails.auxData,this._debuggerPausedDetails.breakpointIds,asyncStackTrace);callback(error,errorData);},get callFrames()
{return this._debuggerPausedDetails?this._debuggerPausedDetails.callFrames:null;},debuggerPausedDetails:function()
{return this._debuggerPausedDetails;},_setDebuggerPausedDetails:function(debuggerPausedDetails)
{this._isPausing=false;this._debuggerPausedDetails=debuggerPausedDetails;if(this._debuggerPausedDetails){if(Runtime.experiments.isEnabled("emptySourceMapAutoStepping")){if(this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BeforeDebuggerPaused,this._debuggerPausedDetails)){return false;}}
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerPaused,this._debuggerPausedDetails);}
if(debuggerPausedDetails)
this.setSelectedCallFrame(debuggerPausedDetails.callFrames[0]);else
this.setSelectedCallFrame(null);return true;},_pausedScript:function(callFrames,reason,auxData,breakpointIds,asyncStackTrace)
{var pausedDetails=new WebInspector.DebuggerPausedDetails(this,callFrames,reason,auxData,breakpointIds,asyncStackTrace);if(this._setDebuggerPausedDetails(pausedDetails)){if(this._pendingLiveEditCallback){var callback=this._pendingLiveEditCallback;delete this._pendingLiveEditCallback;callback();}}else{this._agent.stepInto();}},_resumedScript:function()
{this._setDebuggerPausedDetails(null);this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerResumed);},_parsedScriptSource:function(scriptId,sourceURL,startLine,startColumn,endLine,endColumn,executionContextId,isContentScript,isInternalScript,isLiveEdit,sourceMapURL,hasSourceURL,hasSyntaxError)
{var script=new WebInspector.Script(this,scriptId,sourceURL,startLine,startColumn,endLine,endColumn,executionContextId,isContentScript,isInternalScript,isLiveEdit,sourceMapURL,hasSourceURL);this._registerScript(script);if(!hasSyntaxError)
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource,script);else
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.FailedToParseScriptSource,script);return script;},_registerScript:function(script)
{this._scripts[script.scriptId]=script;if(script.isAnonymousScript())
return;var scripts=this._scriptsBySourceURL.get(script.sourceURL);if(!scripts){scripts=[];this._scriptsBySourceURL.set(script.sourceURL,scripts);}
scripts.push(script);},createRawLocation:function(script,lineNumber,columnNumber)
{if(script.sourceURL)
return this.createRawLocationByURL(script.sourceURL,lineNumber,columnNumber);return new WebInspector.DebuggerModel.Location(this,script.scriptId,lineNumber,columnNumber);},createRawLocationByURL:function(sourceURL,lineNumber,columnNumber)
{var closestScript=null;var scripts=this._scriptsBySourceURL.get(sourceURL)||[];for(var i=0,l=scripts.length;i<l;++i){var script=scripts[i];if(!closestScript)
closestScript=script;if(script.lineOffset>lineNumber||(script.lineOffset===lineNumber&&script.columnOffset>columnNumber))
continue;if(script.endLine<lineNumber||(script.endLine===lineNumber&&script.endColumn<=columnNumber))
continue;closestScript=script;break;}
return closestScript?new WebInspector.DebuggerModel.Location(this,closestScript.scriptId,lineNumber,columnNumber):null;},createRawLocationByScriptId:function(scriptId,lineNumber,columnNumber)
{var script=this.scriptForId(scriptId);return script?this.createRawLocation(script,lineNumber,columnNumber):null;},isPaused:function()
{return!!this.debuggerPausedDetails();},isPausing:function()
{return this._isPausing;},setSelectedCallFrame:function(callFrame)
{this._selectedCallFrame=callFrame;if(!this._selectedCallFrame)
return;this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.CallFrameSelected,callFrame);},selectedCallFrame:function()
{return this._selectedCallFrame;},evaluateOnSelectedCallFrame:function(code,objectGroup,includeCommandLineAPI,doNotPauseOnExceptionsAndMuteConsole,returnByValue,generatePreview,callback)
{function didEvaluate(result,wasThrown,exceptionDetails)
{if(!result)
callback(null,false);else if(returnByValue)
callback(null,!!wasThrown,wasThrown?null:result,exceptionDetails);else
callback(this.target().runtimeModel.createRemoteObject(result),!!wasThrown,undefined,exceptionDetails);if(objectGroup==="console")
this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ConsoleCommandEvaluatedInSelectedCallFrame);}
this.selectedCallFrame().evaluate(code,objectGroup,includeCommandLineAPI,doNotPauseOnExceptionsAndMuteConsole,returnByValue,generatePreview,didEvaluate.bind(this));},_applySkipStackFrameSettings:function()
{this._agent.skipStackFrames(WebInspector.moduleSetting("skipStackFramesPattern").get(),WebInspector.moduleSetting("skipContentScripts").get());},functionDetails:function(remoteObject,callback)
{this._agent.getFunctionDetails(remoteObject.objectId,didGetDetails.bind(this));function didGetDetails(error,response)
{if(error){callback(null);return;}
var location=response.location;var script=this.scriptForId(location.scriptId);var rawLocation=script?this.createRawLocation(script,location.lineNumber,location.columnNumber||0):null;var sourceURL=script?script.contentURL():null;callback({location:rawLocation,sourceURL:sourceURL,functionName:response.functionName,scopeChain:response.scopeChain||null});}},compileScript:function(expression,sourceURL,persistScript,executionContextId,callback)
{this._agent.compileScript(expression,sourceURL,persistScript,executionContextId,innerCallback);function innerCallback(error,scriptId,exceptionDetails)
{if(error){console.error(error);return;}
if(callback)
callback(scriptId,exceptionDetails);}},runScript:function(scriptId,executionContextId,objectGroup,doNotPauseOnExceptionsAndMuteConsole,callback)
{this._agent.runScript(scriptId,executionContextId,objectGroup,doNotPauseOnExceptionsAndMuteConsole,innerCallback);function innerCallback(error,result,exceptionDetails)
{if(error){console.error(error);return;}
if(callback)
callback(result,exceptionDetails);}},setVariableValue:function(scopeNumber,variableName,newValue,callFrameId,functionObjectId,callback)
{this._agent.setVariableValue(scopeNumber,variableName,newValue,callFrameId,functionObjectId,innerCallback);function innerCallback(error)
{if(error){console.error(error);if(callback)
callback(error);return;}
if(callback)
callback();}},generatorObjectDetails:function(remoteObject,callback)
{this._agent.getGeneratorObjectDetails(remoteObject.objectId,didGetDetails.bind(this));function didGetDetails(error,response)
{if(error){console.error(error);callback(null);return;}
var location=response.location;var script=location&&this.scriptForId(location.scriptId);var rawLocation=script?this.createRawLocation(script,location.lineNumber,location.columnNumber||0):null;var sourceURL=script?script.contentURL():null;callback({location:rawLocation,sourceURL:sourceURL,functionName:response.functionName,status:response.status});}},addBreakpointListener:function(breakpointId,listener,thisObject)
{this._breakpointResolvedEventTarget.addEventListener(breakpointId,listener,thisObject)},removeBreakpointListener:function(breakpointId,listener,thisObject)
{this._breakpointResolvedEventTarget.removeEventListener(breakpointId,listener,thisObject);},_targetDisposed:function(event)
{var target=(event.data);if(target!=this.target())
return;WebInspector.moduleSetting("pauseOnExceptionEnabled").removeChangeListener(this._pauseOnExceptionStateChanged,this);WebInspector.moduleSetting("pauseOnCaughtException").removeChangeListener(this._pauseOnExceptionStateChanged,this);WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListener(this._applySkipStackFrameSettings,this);WebInspector.moduleSetting("skipContentScripts").removeChangeListener(this._applySkipStackFrameSettings,this);WebInspector.moduleSetting("enableAsyncStackTraces").removeChangeListener(this.asyncStackTracesStateChanged,this);},suspendModel:function()
{return new Promise(promiseBody.bind(this));function promiseBody(fulfill)
{this.disableDebugger(fulfill);}},resumeModel:function()
{return new Promise(promiseBody.bind(this));function promiseBody(fulfill)
{this.enableDebugger(fulfill);}},__proto__:WebInspector.SDKModel.prototype}
WebInspector.DebuggerEventTypes={JavaScriptPause:0,JavaScriptBreakpoint:1,NativeBreakpoint:2};WebInspector.DebuggerDispatcher=function(debuggerModel)
{this._debuggerModel=debuggerModel;}
WebInspector.DebuggerDispatcher.prototype={paused:function(callFrames,reason,auxData,breakpointIds,asyncStackTrace)
{this._debuggerModel._pausedScript(callFrames,reason,auxData,breakpointIds||[],asyncStackTrace);},resumed:function()
{this._debuggerModel._resumedScript();},globalObjectCleared:function()
{this._debuggerModel._globalObjectCleared();},scriptParsed:function(scriptId,sourceURL,startLine,startColumn,endLine,endColumn,executionContextId,isContentScript,isInternalScript,isLiveEdit,sourceMapURL,hasSourceURL)
{this._debuggerModel._parsedScriptSource(scriptId,sourceURL,startLine,startColumn,endLine,endColumn,executionContextId,!!isContentScript,!!isInternalScript,!!isLiveEdit,sourceMapURL,hasSourceURL,false);},scriptFailedToParse:function(scriptId,sourceURL,startLine,startColumn,endLine,endColumn,executionContextId,isContentScript,isInternalScript,sourceMapURL,hasSourceURL)
{this._debuggerModel._parsedScriptSource(scriptId,sourceURL,startLine,startColumn,endLine,endColumn,executionContextId,!!isContentScript,!!isInternalScript,false,sourceMapURL,hasSourceURL,true);},breakpointResolved:function(breakpointId,location)
{this._debuggerModel._breakpointResolved(breakpointId,location);},promiseUpdated:function(eventType,promise)
{this._debuggerModel._promiseUpdated(eventType,promise);},asyncOperationStarted:function(operation)
{this._debuggerModel._asyncOperationStarted(operation);},asyncOperationCompleted:function(operationId)
{this._debuggerModel._asyncOperationCompleted(operationId);}}
WebInspector.DebuggerModel.Location=function(debuggerModel,scriptId,lineNumber,columnNumber)
{WebInspector.SDKObject.call(this,debuggerModel.target());this._debuggerModel=debuggerModel;this.scriptId=scriptId;this.lineNumber=lineNumber;this.columnNumber=columnNumber||0;}
WebInspector.DebuggerModel.Location.fromPayload=function(debuggerModel,payload)
{return new WebInspector.DebuggerModel.Location(debuggerModel,payload.scriptId,payload.lineNumber,payload.columnNumber);}
WebInspector.DebuggerModel.Location.prototype={payload:function()
{return{scriptId:this.scriptId,lineNumber:this.lineNumber,columnNumber:this.columnNumber};},script:function()
{return this._debuggerModel.scriptForId(this.scriptId);},continueToLocation:function()
{this._debuggerModel._agent.continueToLocation(this.payload());},id:function()
{return this.target().id()+":"+this.scriptId+":"+this.lineNumber+":"+this.columnNumber;},__proto__:WebInspector.SDKObject.prototype}
WebInspector.DebuggerModel.CallFrame=function(debuggerModel,script,payload,isAsync)
{var target=debuggerModel.target();WebInspector.SDKObject.call(this,target);this.debuggerModel=debuggerModel;this._debuggerAgent=debuggerModel._agent;this._script=script;this._payload=payload;this._isAsync=isAsync;this._location=WebInspector.DebuggerModel.Location.fromPayload(debuggerModel,payload.location);this._scopeChain=[];this._localScope=null;for(var i=0;i<payload.scopeChain.length;++i){var scope=new WebInspector.DebuggerModel.Scope(this,i);this._scopeChain.push(scope);if(scope.type()===DebuggerAgent.ScopeType.Local)
this._localScope=scope;}
if(payload.functionLocation)
this._functionLocation=WebInspector.DebuggerModel.Location.fromPayload(debuggerModel,payload.functionLocation);}
WebInspector.DebuggerModel.CallFrame.fromPayloadArray=function(debuggerModel,callFrames,isAsync)
{var result=[];for(var i=0;i<callFrames.length;++i){var callFrame=callFrames[i];var script=debuggerModel.scriptForId(callFrame.location.scriptId);if(script)
result.push(new WebInspector.DebuggerModel.CallFrame(debuggerModel,script,callFrame,isAsync));}
return result;}
WebInspector.DebuggerModel.CallFrame.prototype={get script()
{return this._script;},get id()
{return this._payload.callFrameId;},scopeChain:function()
{return this._scopeChain;},localScope:function()
{return this._localScope;},thisObject:function()
{return this._payload.this?this.target().runtimeModel.createRemoteObject(this._payload.this):null;},returnValue:function()
{return this._payload.returnValue?this.target().runtimeModel.createRemoteObject(this._payload.returnValue):null;},get functionName()
{return this._payload.functionName;},location:function()
{return this._location;},functionLocation:function()
{return this._functionLocation||null;},isAsync:function()
{return!!this._isAsync;},evaluate:function(code,objectGroup,includeCommandLineAPI,doNotPauseOnExceptionsAndMuteConsole,returnByValue,generatePreview,callback)
{function didEvaluateOnCallFrame(error,result,wasThrown,exceptionDetails)
{if(error){console.error(error);callback(null,false);return;}
callback(result,wasThrown,exceptionDetails);}
this._debuggerAgent.evaluateOnCallFrame(this._payload.callFrameId,code,objectGroup,includeCommandLineAPI,doNotPauseOnExceptionsAndMuteConsole,returnByValue,generatePreview,didEvaluateOnCallFrame);},restart:function(callback)
{function protocolCallback(error,callFrames,asyncStackTrace)
{if(!error)
this.debuggerModel.stepInto();if(callback)
callback(error);}
this._debuggerAgent.restartFrame(this._payload.callFrameId,protocolCallback.bind(this));},variableNames:function(callback)
{var result={this:true};function propertiesCollected(properties)
{for(var i=0;properties&&i<properties.length;++i)
result[properties[i].name]=true;if(--pendingRequests==0)
callback(result);}
var scopeChain=this.scopeChain();var pendingRequests=scopeChain.length;for(var i=0;i<scopeChain.length;++i){var scope=scopeChain[i];var object=scope.object();object.getAllProperties(false,propertiesCollected);}},__proto__:WebInspector.SDKObject.prototype}
WebInspector.DebuggerModel.Scope=function(callFrame,ordinal)
{this._callFrame=callFrame;this._payload=callFrame._payload.scopeChain[ordinal];this._type=this._payload.type;this._name=this._payload.name;this._ordinal=ordinal;}
WebInspector.DebuggerModel.Scope.prototype={type:function()
{return this._type;},name:function()
{return this._name;},object:function()
{if(this._object)
return this._object;var runtimeModel=this._callFrame.target().runtimeModel;var declarativeScope=this._type!==DebuggerAgent.ScopeType.With&&this._type!==DebuggerAgent.ScopeType.Global;if(declarativeScope)
this._object=runtimeModel.createScopeRemoteObject(this._payload.object,new WebInspector.ScopeRef(this._ordinal,this._callFrame.id,undefined));else
this._object=runtimeModel.createRemoteObject(this._payload.object);return this._callFrame.target().runtimeModel.createRemoteObject(this._payload.object);},description:function()
{var declarativeScope=this._type!==DebuggerAgent.ScopeType.With&&this._type!==DebuggerAgent.ScopeType.Global;return declarativeScope?"":(this._payload.object.description||"");}}
WebInspector.DebuggerModel.StackTrace=function(callFrames,asyncStackTrace,description)
{this.callFrames=callFrames;this.asyncStackTrace=asyncStackTrace;this.description=description;}
WebInspector.DebuggerModel.StackTrace.fromPayload=function(debuggerModel,payload,isAsync)
{if(!payload)
return null;var callFrames=WebInspector.DebuggerModel.CallFrame.fromPayloadArray(debuggerModel,payload.callFrames,isAsync);if(!callFrames.length)
return null;var asyncStackTrace=WebInspector.DebuggerModel.StackTrace.fromPayload(debuggerModel,payload.asyncStackTrace,true);return new WebInspector.DebuggerModel.StackTrace(callFrames,asyncStackTrace,payload.description);}
WebInspector.DebuggerPausedDetails=function(debuggerModel,callFrames,reason,auxData,breakpointIds,asyncStackTrace)
{WebInspector.SDKObject.call(this,debuggerModel.target());this.debuggerModel=debuggerModel;this.callFrames=WebInspector.DebuggerModel.CallFrame.fromPayloadArray(debuggerModel,callFrames);this.reason=reason;this.auxData=auxData;this.breakpointIds=breakpointIds;this.asyncStackTrace=WebInspector.DebuggerModel.StackTrace.fromPayload(debuggerModel,asyncStackTrace,true);}
WebInspector.DebuggerPausedDetails.prototype={exception:function()
{if(this.reason!==WebInspector.DebuggerModel.BreakReason.Exception&&this.reason!==WebInspector.DebuggerModel.BreakReason.PromiseRejection)
return null;return this.target().runtimeModel.createRemoteObject((this.auxData));},__proto__:WebInspector.SDKObject.prototype}
WebInspector.DebuggerModel.instances=function()
{var result=[];for(var target of WebInspector.targetManager.targets()){var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(debuggerModel)
result.push(debuggerModel);}
return result;}
WebInspector.DebuggerModel.fromTarget=function(target)
{if(!target||!target.hasJSContext())
return null;return(target.model(WebInspector.DebuggerModel));};WebInspector.HAREntry=function(request)
{this._request=request;}
WebInspector.HAREntry.prototype={build:function()
{var entry={startedDateTime:WebInspector.HARLog.pseudoWallTime(this._request,this._request.startTime),time:this._request.timing?WebInspector.HAREntry._toMilliseconds(this._request.duration):0,request:this._buildRequest(),response:this._buildResponse(),cache:{},timings:this._buildTimings()};if(this._request.connectionId!=="0")
entry.connection=this._request.connectionId;var page=this._request.target().networkLog.pageLoadForRequest(this._request);if(page)
entry.pageref="page_"+page.id;return entry;},_buildRequest:function()
{var headersText=this._request.requestHeadersText();var res={method:this._request.requestMethod,url:this._buildRequestURL(this._request.url),httpVersion:this._request.requestHttpVersion(),headers:this._request.requestHeaders(),queryString:this._buildParameters(this._request.queryParameters||[]),cookies:this._buildCookies(this._request.requestCookies||[]),headersSize:headersText?headersText.length:-1,bodySize:this.requestBodySize};if(this._request.requestFormData)
res.postData=this._buildPostData();return res;},_buildResponse:function()
{var headersText=this._request.responseHeadersText;return{status:this._request.statusCode,statusText:this._request.statusText,httpVersion:this._request.responseHttpVersion(),headers:this._request.responseHeaders,cookies:this._buildCookies(this._request.responseCookies||[]),content:this._buildContent(),redirectURL:this._request.responseHeaderValue("Location")||"",headersSize:headersText?headersText.length:-1,bodySize:this.responseBodySize,_transferSize:this._request.transferSize,_error:this._request.localizedFailDescription};},_buildContent:function()
{var content={size:this._request.resourceSize,mimeType:this._request.mimeType||"x-unknown",};var compression=this.responseCompression;if(typeof compression==="number")
content.compression=compression;return content;},_buildTimings:function()
{var timing=this._request.timing;if(!timing)
return{blocked:-1,dns:-1,connect:-1,send:0,wait:0,receive:0,ssl:-1};function firstNonNegative(values)
{for(var i=0;i<values.length;++i){if(values[i]>=0)
return values[i];}
console.assert(false,"Incomplete request timing information.");}
var blocked=firstNonNegative([timing.dnsStart,timing.connectStart,timing.sendStart]);var dns=-1;if(timing.dnsStart>=0)
dns=firstNonNegative([timing.connectStart,timing.sendStart])-timing.dnsStart;var connect=-1;if(timing.connectStart>=0)
connect=timing.sendStart-timing.connectStart;var send=timing.sendEnd-timing.sendStart;var wait=timing.receiveHeadersEnd-timing.sendEnd;var receive=WebInspector.HAREntry._toMilliseconds(this._request.duration)-timing.receiveHeadersEnd;var ssl=-1;if(timing.sslStart>=0&&timing.sslEnd>=0)
ssl=timing.sslEnd-timing.sslStart;return{blocked:blocked,dns:dns,connect:connect,send:send,wait:wait,receive:receive,ssl:ssl};},_buildPostData:function()
{var res={mimeType:this._request.requestContentType(),text:this._request.requestFormData};if(this._request.formParameters)
res.params=this._buildParameters(this._request.formParameters);return res;},_buildParameters:function(parameters)
{return parameters.slice();},_buildRequestURL:function(url)
{return url.split("#",2)[0];},_buildCookies:function(cookies)
{return cookies.map(this._buildCookie.bind(this));},_buildCookie:function(cookie)
{return{name:cookie.name(),value:cookie.value(),path:cookie.path(),domain:cookie.domain(),expires:cookie.expiresDate(WebInspector.HARLog.pseudoWallTime(this._request,this._request.startTime)),httpOnly:cookie.httpOnly(),secure:cookie.secure()};},get requestBodySize()
{return!this._request.requestFormData?0:this._request.requestFormData.length;},get responseBodySize()
{if(this._request.cached()||this._request.statusCode===304)
return 0;if(!this._request.responseHeadersText)
return-1;return this._request.transferSize-this._request.responseHeadersText.length;},get responseCompression()
{if(this._request.cached()||this._request.statusCode===304||this._request.statusCode===206)
return;if(!this._request.responseHeadersText)
return;return this._request.resourceSize-this.responseBodySize;}}
WebInspector.HAREntry._toMilliseconds=function(time)
{return time===-1?-1:time*1000;}
WebInspector.HARLog=function(requests)
{this._requests=requests;}
WebInspector.HARLog.pseudoWallTime=function(request,monotonicTime)
{return new Date(request.pseudoWallTime(monotonicTime)*1000);}
WebInspector.HARLog.prototype={build:function()
{return{version:"1.2",creator:this._creator(),pages:this._buildPages(),entries:this._requests.map(this._convertResource.bind(this))}},_creator:function()
{var webKitVersion=/AppleWebKit\/([^ ]+)/.exec(window.navigator.userAgent);return{name:"WebInspector",version:webKitVersion?webKitVersion[1]:"n/a"};},_buildPages:function()
{var seenIdentifiers={};var pages=[];for(var i=0;i<this._requests.length;++i){var request=this._requests[i];var page=request.target().networkLog.pageLoadForRequest(request);if(!page||seenIdentifiers[page.id])
continue;seenIdentifiers[page.id]=true;pages.push(this._convertPage(page,request));}
return pages;},_convertPage:function(page,request)
{return{startedDateTime:WebInspector.HARLog.pseudoWallTime(request,page.startTime),id:"page_"+page.id,title:page.url,pageTimings:{onContentLoad:this._pageEventTime(page,page.contentLoadTime),onLoad:this._pageEventTime(page,page.loadTime)}}},_convertResource:function(request)
{return(new WebInspector.HAREntry(request)).build();},_pageEventTime:function(page,time)
{var startTime=page.startTime;if(time===-1||startTime===-1)
return-1;return WebInspector.HAREntry._toMilliseconds(time-startTime);}};WebInspector.NetworkLog=function(target)
{WebInspector.SDKObject.call(this,target);this._requests=[];this._requestForId={};target.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestStarted,this._onRequestStarted,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._onMainFrameNavigated,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.Load,this._onLoad,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.DOMContentLoaded,this._onDOMContentLoaded,this);}
WebInspector.NetworkLog.requestForURL=function(url)
{for(var target of WebInspector.targetManager.targets()){var result=target.networkLog.requestForURL(url);if(result)
return result;}
return null;}
WebInspector.NetworkLog.requests=function()
{var result=[];for(var target of WebInspector.targetManager.targets()){result=result.concat(target.networkLog.requests());}
return result;}
WebInspector.NetworkLog.prototype={requests:function()
{return this._requests;},requestForURL:function(url)
{for(var i=0;i<this._requests.length;++i){if(this._requests[i].url===url)
return this._requests[i];}
return null;},pageLoadForRequest:function(request)
{return request.__page;},_onMainFrameNavigated:function(event)
{var mainFrame=event.data;this._currentPageLoad=null;var oldRequests=this._requests.splice(0,this._requests.length);this._requestForId={};for(var i=0;i<oldRequests.length;++i){var request=oldRequests[i];if(request.loaderId===mainFrame.loaderId){if(!this._currentPageLoad)
this._currentPageLoad=new WebInspector.PageLoad(request);this._requests.push(request);this._requestForId[request.requestId]=request;request.__page=this._currentPageLoad;}}},_onRequestStarted:function(event)
{var request=(event.data);this._requests.push(request);this._requestForId[request.requestId]=request;request.__page=this._currentPageLoad;},_onDOMContentLoaded:function(event)
{if(this._currentPageLoad)
this._currentPageLoad.contentLoadTime=event.data;},_onLoad:function(event)
{if(this._currentPageLoad)
this._currentPageLoad.loadTime=event.data;},requestForId:function(requestId)
{return this._requestForId[requestId];},__proto__:WebInspector.SDKObject.prototype}
WebInspector.PageLoad=function(mainRequest)
{this.id=++WebInspector.PageLoad._lastIdentifier;this.url=mainRequest.url;this.startTime=mainRequest.startTime;}
WebInspector.PageLoad._lastIdentifier=0;;WebInspector.ServiceWorkerManager=function(target)
{WebInspector.SDKObject.call(this,target);target.registerServiceWorkerDispatcher(new WebInspector.ServiceWorkerDispatcher(this));this._lastAnonymousTargetId=0;this._agent=target.serviceWorkerAgent();this._workers=new Map();this._registrations=new Map();this.enable();}
WebInspector.ServiceWorkerManager.Events={WorkersUpdated:"WorkersUpdated",RegistrationUpdated:"RegistrationUpdated",RegistrationDeleted:"RegistrationDeleted",DebugOnStartUpdated:"DebugOnStartUpdated"}
WebInspector.ServiceWorkerManager.prototype={enable:function()
{if(this._enabled)
return;this._enabled=true;this._agent.enable();WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.MainFrameNavigated,this._mainFrameNavigated,this);},disable:function()
{if(!this._enabled)
return;this._enabled=false;for(var worker of this._workers.values())
worker._connection.close();this._workers.clear();this._registrations.clear();this._agent.disable();WebInspector.targetManager.removeEventListener(WebInspector.TargetManager.Events.MainFrameNavigated,this._mainFrameNavigated,this);},workers:function()
{return this._workers.values();},hasWorkers:function()
{return!!this._workers.size;},debugOnStart:function()
{return!!this._debugOnStart;},setDebugOnStart:function(flag)
{this._agent.setDebugOnStart(flag);},setForceUpdateOnPageLoad:function(registrationId,flag)
{this._agent.setForceUpdateOnPageLoad(registrationId,flag);},registrations:function()
{return this._registrations;},findVersion:function(versionId)
{for(var registration of this.registrations().values()){var version=registration.versions.get(versionId);if(version)
return version;}
return null;},deleteRegistration:function(registrationId)
{var registration=this._registrations.get(registrationId);if(!registration)
return;if(registration._isRedundant()){this._registrations.delete(registrationId);this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationDeleted,registration);return;}
registration._deleting=true;for(var version of registration.versions.values())
this.stopWorker(version.id);this._unregister(registration.scopeURL);},updateRegistration:function(registrationId)
{var registration=this._registrations.get(registrationId);if(!registration)
return;this._agent.updateRegistration(registration.scopeURL);},deliverPushMessage:function(registrationId,data)
{var registration=this._registrations.get(registrationId);if(!registration)
return;var origin=WebInspector.ParsedURL.splitURLIntoPathComponents(registration.scopeURL)[0];this._agent.deliverPushMessage(origin,registrationId,data);},activateTarget:function(targetId)
{this._agent.activateTarget(targetId);},_unregister:function(scope)
{this._agent.unregister(scope);},startWorker:function(scope)
{this._agent.startWorker(scope);},stopWorker:function(versionId)
{this._agent.stopWorker(versionId);},inspectWorker:function(versionId)
{this._agent.inspectWorker(versionId);},getTargetInfo:function(targetId,callback)
{function innerCallback(error,targetInfo)
{if(error){console.error(error);callback(null);return;}
if(targetInfo)
callback(new WebInspector.TargetInfo(targetInfo));else
callback(null)}
this._agent.getTargetInfo(targetId,innerCallback);},_workerCreated:function(workerId,url,versionId)
{new WebInspector.ServiceWorker(this,workerId,url,versionId);},_workerTerminated:function(workerId)
{var worker=this._workers.get(workerId);if(!worker)
return;worker._closeConnection();this._workers.delete(workerId);this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.WorkersUpdated);},_dispatchMessage:function(workerId,message)
{var worker=this._workers.get(workerId);if(worker)
worker._connection.dispatch(message);},_workerRegistrationUpdated:function(registrations)
{for(var payload of registrations){var registration=this._registrations.get(payload.registrationId);if(!registration){registration=new WebInspector.ServiceWorkerRegistration(payload);this._registrations.set(payload.registrationId,registration);this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationUpdated,registration);continue;}
registration._update(payload);if(registration._shouldBeRemoved()){this._registrations.delete(registration.id);this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationDeleted,registration);}else{this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationUpdated,registration);}}},_workerVersionUpdated:function(versions)
{var registrations=new Set();for(var payload of versions){var registration=this._registrations.get(payload.registrationId);if(!registration)
continue;registration._updateVersion(payload);registrations.add(registration);}
for(var registration of registrations){if(registration._shouldBeRemoved()){this._registrations.delete(registration.id);this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationDeleted,registration);}else{this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationUpdated,registration);}}},_workerErrorReported:function(payload)
{var registration=this._registrations.get(payload.registrationId);if(!registration)
return;registration._addError(payload);this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.RegistrationUpdated,registration);},_debugOnStartUpdated:function(flag)
{this._debugOnStart=flag;this.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.DebugOnStartUpdated,flag);},_mainFrameNavigated:function(event)
{},__proto__:WebInspector.SDKObject.prototype}
WebInspector.ServiceWorker=function(manager,workerId,url,versionId)
{this._manager=manager;this._agent=manager.target().serviceWorkerAgent();this._workerId=workerId;this._connection=new WebInspector.ServiceWorkerConnection(this._agent,workerId);this._url=url;this._versionId=versionId;var parsedURL=url.asParsedURL();this._name=parsedURL?parsedURL.lastPathComponentWithFragment():"#"+(++WebInspector.ServiceWorker._lastAnonymousTargetId);this._scope=parsedURL.host+parsedURL.folderPathComponents;this._manager._workers.set(workerId,this);this._target=WebInspector.targetManager.createTarget(this._name,WebInspector.Target.Type.ServiceWorker,this._connection,manager.target());this._manager.dispatchEventToListeners(WebInspector.ServiceWorkerManager.Events.WorkersUpdated);this._target.runtimeAgent().run();}
WebInspector.ServiceWorker._lastAnonymousTargetId=0;WebInspector.ServiceWorker.prototype={name:function()
{return this._name;},url:function()
{return this._url;},versionId:function()
{return this._versionId;},scope:function()
{return this._scope;},stop:function()
{this._agent.stop(this._workerId);},_closeConnection:function()
{this._connection._close();delete this._connection;}}
WebInspector.ServiceWorkerDispatcher=function(manager)
{this._manager=manager;}
WebInspector.ServiceWorkerDispatcher.prototype={workerCreated:function(workerId,url,versionId)
{this._manager._workerCreated(workerId,url,versionId);},workerTerminated:function(workerId)
{this._manager._workerTerminated(workerId);},dispatchMessage:function(workerId,message)
{this._manager._dispatchMessage(workerId,message);},workerRegistrationUpdated:function(registrations)
{this._manager._workerRegistrationUpdated(registrations);},workerVersionUpdated:function(versions)
{this._manager._workerVersionUpdated(versions);},workerErrorReported:function(errorMessage)
{this._manager._workerErrorReported(errorMessage);},debugOnStartUpdated:function(flag)
{this._manager._debugOnStartUpdated(flag);}}
WebInspector.ServiceWorkerConnection=function(agent,workerId)
{InspectorBackendClass.Connection.call(this);this.suppressErrorsForDomains(["Worker","Page","CSS","DOM","DOMStorage","Database","Network","IndexedDB"]);this._agent=agent;this._workerId=workerId;}
WebInspector.ServiceWorkerConnection.prototype={sendMessage:function(messageObject)
{this._agent.sendMessage(this._workerId,JSON.stringify(messageObject));},_close:function()
{this.connectionClosed("worker_terminated");},__proto__:InspectorBackendClass.Connection.prototype}
WebInspector.TargetInfo=function(payload)
{this.id=payload.id;this.type=payload.type;this.title=payload.title;this.url=payload.url;}
WebInspector.TargetInfo.prototype={isWebContents:function()
{return this.type=="web_contents";},isFrame:function()
{return this.type=="frame";},}
WebInspector.ServiceWorkerErrorMessage=function(payload)
{this.errorMessage=payload.errorMessage;this.sourceURL=payload.sourceURL;this.lineNumber=payload.lineNumber;this.columnNumber=payload.columnNumber;}
WebInspector.ServiceWorkerVersion=function(registration,payload)
{this.registration=registration;this._update(payload);this.errorMessages=[];}
WebInspector.ServiceWorkerVersion.Modes={Installing:"installing",Waiting:"waiting",Active:"active",Redundant:"redundant"}
WebInspector.ServiceWorkerVersion.prototype={_update:function(payload)
{this.id=payload.versionId;this.scriptURL=payload.scriptURL;this.runningStatus=payload.runningStatus;this.status=payload.status;this.scriptLastModified=payload.scriptLastModified;this.scriptResponseTime=payload.scriptResponseTime;this.controlledClients=[]
for(var i=0;i<payload.controlledClients.length;++i){this.controlledClients.push(payload.controlledClients[i]);}},isStartable:function()
{return!this.registration.isDeleted&&this.isActivated()&&this.isStopped();},isStoppedAndRedundant:function()
{return this.runningStatus==ServiceWorkerAgent.ServiceWorkerVersionRunningStatus.Stopped&&this.status==ServiceWorkerAgent.ServiceWorkerVersionStatus.Redundant;},isStopped:function()
{return this.runningStatus==ServiceWorkerAgent.ServiceWorkerVersionRunningStatus.Stopped;},isStarting:function()
{return this.runningStatus==ServiceWorkerAgent.ServiceWorkerVersionRunningStatus.Starting;},isRunning:function()
{return this.runningStatus==ServiceWorkerAgent.ServiceWorkerVersionRunningStatus.Running;},isStopping:function()
{return this.runningStatus==ServiceWorkerAgent.ServiceWorkerVersionRunningStatus.Stopping;},isNew:function()
{return this.status==ServiceWorkerAgent.ServiceWorkerVersionStatus.New;},isInstalling:function()
{return this.status==ServiceWorkerAgent.ServiceWorkerVersionStatus.Installing;},isInstalled:function()
{return this.status==ServiceWorkerAgent.ServiceWorkerVersionStatus.Installed;},isActivating:function()
{return this.status==ServiceWorkerAgent.ServiceWorkerVersionStatus.Activating;},isActivated:function()
{return this.status==ServiceWorkerAgent.ServiceWorkerVersionStatus.Activated;},isRedundant:function()
{return this.status==ServiceWorkerAgent.ServiceWorkerVersionStatus.Redundant;},mode:function()
{if(this.isNew()||this.isInstalling())
return WebInspector.ServiceWorkerVersion.Modes.Installing;else if(this.isInstalled())
return WebInspector.ServiceWorkerVersion.Modes.Waiting;else if(this.isActivating()||this.isActivated())
return WebInspector.ServiceWorkerVersion.Modes.Active;return WebInspector.ServiceWorkerVersion.Modes.Redundant;},_addError:function(payload)
{this.errorMessages.push(new WebInspector.ServiceWorkerErrorMessage(payload));}}
WebInspector.ServiceWorkerRegistration=function(payload)
{this._update(payload);this.versions=new Map();this._deleting=false;}
WebInspector.ServiceWorkerRegistration.prototype={_update:function(payload)
{this.id=payload.registrationId;this.scopeURL=payload.scopeURL;this.isDeleted=payload.isDeleted;this.forceUpdateOnPageLoad=payload.forceUpdateOnPageLoad;},_updateVersion:function(payload)
{var version=this.versions.get(payload.versionId);if(!version){version=new WebInspector.ServiceWorkerVersion(this,payload);this.versions.set(payload.versionId,version);return version;}
version._update(payload);return version;},_addError:function(payload)
{var version=this.versions.get(payload.versionId);if(version)
version._addError(payload);},_isRedundant:function()
{for(var version of this.versions.values()){if(!version.isStoppedAndRedundant())
return false;}
return true;},_hasErrorLog:function()
{for(var version of this.versions.values()){if(version.errorMessages.length)
return true;}
return false;},_shouldBeRemoved:function()
{return this._isRedundant()&&(!this._hasErrorLog()||this._deleting);}};WebInspector.TracingManagerClient=function()
{}
WebInspector.TracingManagerClient.prototype={tracingStarted:function(){},traceEventsCollected:function(events){},tracingComplete:function(){},tracingBufferUsage:function(usage){},eventsRetrievalProgress:function(progress){}}
WebInspector.TracingManager=function(target)
{this._target=target;target.registerTracingDispatcher(new WebInspector.TracingDispatcher(this));this._activeClient=null;this._eventBufferSize=0;this._eventsRetrieved=0;}
WebInspector.TracingManager.EventPayload;WebInspector.TracingManager.TransferMode={ReportEvents:"ReportEvents",ReturnAsStream:"ReturnAsStream"};WebInspector.TracingManager.prototype={target:function()
{return this._target;},_bufferUsage:function(usage,eventCount,percentFull)
{this._eventBufferSize=eventCount;this._activeClient.tracingBufferUsage(usage||percentFull||0);},_eventsCollected:function(events)
{this._activeClient.traceEventsCollected(events);this._eventsRetrieved+=events.length;if(!this._eventBufferSize)
return;if(this._eventsRetrieved>this._eventBufferSize)
this._eventsRetrieved=this._eventBufferSize;this._activeClient.eventsRetrievalProgress(this._eventsRetrieved/this._eventBufferSize);},_tracingComplete:function()
{this._eventBufferSize=0;this._eventsRetrieved=0;this._activeClient.tracingComplete();this._activeClient=null;this._finishing=false;},start:function(client,categoryFilter,options,callback)
{if(this._activeClient)
throw new Error("Tracing is already started");var bufferUsageReportingIntervalMs=500;this._activeClient=client;this._target.tracingAgent().start(categoryFilter,options,bufferUsageReportingIntervalMs,WebInspector.TracingManager.TransferMode.ReportEvents,callback);this._activeClient.tracingStarted();},stop:function()
{if(!this._activeClient)
throw new Error("Tracing is not started");if(this._finishing)
throw new Error("Tracing is already being stopped");this._finishing=true;this._target.tracingAgent().end();}}
WebInspector.TracingDispatcher=function(tracingManager)
{this._tracingManager=tracingManager;}
WebInspector.TracingDispatcher.prototype={bufferUsage:function(usage,eventCount,percentFull)
{this._tracingManager._bufferUsage(usage,eventCount,percentFull);},dataCollected:function(data)
{this._tracingManager._eventsCollected(data);},tracingComplete:function()
{this._tracingManager._tracingComplete();}};WebInspector.TracingModel=function(backingStorage)
{this.reset();this._backingStorage=backingStorage;}
WebInspector.TracingModel.Phase={Begin:"B",End:"E",Complete:"X",Instant:"I",AsyncBegin:"S",AsyncStepInto:"T",AsyncStepPast:"p",AsyncEnd:"F",NestableAsyncBegin:"b",NestableAsyncEnd:"e",NestableAsyncInstant:"n",FlowBegin:"s",FlowStep:"t",FlowEnd:"f",Metadata:"M",Counter:"C",Sample:"P",CreateObject:"N",SnapshotObject:"O",DeleteObject:"D"};WebInspector.TracingModel.MetadataEvent={ProcessSortIndex:"process_sort_index",ProcessName:"process_name",ThreadSortIndex:"thread_sort_index",ThreadName:"thread_name"}
WebInspector.TracingModel.TopLevelEventCategory="toplevel";WebInspector.TracingModel.DevToolsMetadataEventCategory="disabled-by-default-devtools.timeline";WebInspector.TracingModel.DevToolsTimelineEventCategory="disabled-by-default-devtools.timeline";WebInspector.TracingModel.FrameLifecycleEventCategory="cc,devtools";WebInspector.TracingModel._nestableAsyncEventsString=WebInspector.TracingModel.Phase.NestableAsyncBegin+
WebInspector.TracingModel.Phase.NestableAsyncEnd+
WebInspector.TracingModel.Phase.NestableAsyncInstant;WebInspector.TracingModel._legacyAsyncEventsString=WebInspector.TracingModel.Phase.AsyncBegin+
WebInspector.TracingModel.Phase.AsyncEnd+
WebInspector.TracingModel.Phase.AsyncStepInto+
WebInspector.TracingModel.Phase.AsyncStepPast;WebInspector.TracingModel._flowEventsString=WebInspector.TracingModel.Phase.FlowBegin+
WebInspector.TracingModel.Phase.FlowStep+
WebInspector.TracingModel.Phase.FlowEnd;WebInspector.TracingModel._asyncEventsString=WebInspector.TracingModel._nestableAsyncEventsString+WebInspector.TracingModel._legacyAsyncEventsString;WebInspector.TracingModel.isNestableAsyncPhase=function(phase)
{return WebInspector.TracingModel._nestableAsyncEventsString.indexOf(phase)>=0;}
WebInspector.TracingModel.isAsyncBeginPhase=function(phase)
{return phase===WebInspector.TracingModel.Phase.AsyncBegin||phase===WebInspector.TracingModel.Phase.NestableAsyncBegin;}
WebInspector.TracingModel.isAsyncPhase=function(phase)
{return WebInspector.TracingModel._asyncEventsString.indexOf(phase)>=0;}
WebInspector.TracingModel.isFlowPhase=function(phase)
{return WebInspector.TracingModel._flowEventsString.indexOf(phase)>=0;}
WebInspector.TracingModel.isTopLevelEvent=function(event)
{return event.hasCategory(WebInspector.TracingModel.TopLevelEventCategory)||event.hasCategory(WebInspector.TracingModel.DevToolsMetadataEventCategory)&&event.name==="Program";}
WebInspector.BackingStorage=function()
{}
WebInspector.BackingStorage.prototype={appendString:function(string){},appendAccessibleString:function(string){},finishWriting:function(){},reset:function(){},}
WebInspector.TracingModel.prototype={devToolsMetadataEvents:function()
{return this._devToolsMetadataEvents;},setEventsForTest:function(events)
{this.reset();this.addEvents(events);this.tracingComplete();},addEvents:function(events)
{for(var i=0;i<events.length;++i)
this._addEvent(events[i]);},tracingComplete:function()
{this._processPendingAsyncEvents();this._backingStorage.finishWriting();for(var process of Object.values(this._processById)){for(var thread of Object.values(process._threads))
thread.tracingComplete();}},reset:function()
{this._processById={};this._processByName=new Map();this._minimumRecordTime=0;this._maximumRecordTime=0;this._devToolsMetadataEvents=[];if(this._backingStorage)
this._backingStorage.reset();this._appendDelimiter=false;this._asyncEvents=[];this._openAsyncEvents=new Map();this._openNestableAsyncEvents=new Map();this._parsedCategories=new Map();},_addEvent:function(payload)
{var process=this._processById[payload.pid];if(!process){process=new WebInspector.TracingModel.Process(this,payload.pid);this._processById[payload.pid]=process;}
var eventsDelimiter=",\n";if(this._appendDelimiter)
this._backingStorage.appendString(eventsDelimiter);this._appendDelimiter=true;var stringPayload=JSON.stringify(payload);var isAccessible=payload.ph===WebInspector.TracingModel.Phase.SnapshotObject;var backingStorage=null;var keepStringsLessThan=10000;if(isAccessible&&stringPayload.length>keepStringsLessThan)
backingStorage=this._backingStorage.appendAccessibleString(stringPayload);else
this._backingStorage.appendString(stringPayload);if(payload.ph!==WebInspector.TracingModel.Phase.Metadata){var timestamp=payload.ts/1000;if(timestamp&&(!this._minimumRecordTime||timestamp<this._minimumRecordTime))
this._minimumRecordTime=timestamp;var endTimeStamp=(payload.ts+(payload.dur||0))/1000;this._maximumRecordTime=Math.max(this._maximumRecordTime,endTimeStamp);var event=process._addEvent(payload);if(!event)
return;if(WebInspector.TracingModel.isAsyncPhase(payload.ph))
this._asyncEvents.push(event);event._setBackingStorage(backingStorage);if(event.hasCategory(WebInspector.TracingModel.DevToolsMetadataEventCategory))
this._devToolsMetadataEvents.push(event);return;}
switch(payload.name){case WebInspector.TracingModel.MetadataEvent.ProcessSortIndex:process._setSortIndex(payload.args["sort_index"]);break;case WebInspector.TracingModel.MetadataEvent.ProcessName:var processName=payload.args["name"];process._setName(processName);this._processByName.set(processName,process);break;case WebInspector.TracingModel.MetadataEvent.ThreadSortIndex:process.threadById(payload.tid)._setSortIndex(payload.args["sort_index"]);break;case WebInspector.TracingModel.MetadataEvent.ThreadName:process.threadById(payload.tid)._setName(payload.args["name"]);break;}},minimumRecordTime:function()
{return this._minimumRecordTime;},maximumRecordTime:function()
{return this._maximumRecordTime;},sortedProcesses:function()
{return WebInspector.TracingModel.NamedObject._sort(Object.values(this._processById));},processByName:function(name)
{return this._processByName.get(name);},threadByName:function(processName,threadName)
{var process=this.processByName(processName);return process&&process.threadByName(threadName);},_processPendingAsyncEvents:function()
{this._asyncEvents.sort(WebInspector.TracingModel.Event.compareStartTime);for(var i=0;i<this._asyncEvents.length;++i){var event=this._asyncEvents[i];if(WebInspector.TracingModel.isNestableAsyncPhase(event.phase))
this._addNestableAsyncEvent(event);else
this._addAsyncEvent(event);}
this._asyncEvents=[];this._closeOpenAsyncEvents();},_closeOpenAsyncEvents:function()
{for(var event of this._openAsyncEvents.values()){event.setEndTime(this._maximumRecordTime);event.steps[0].setEndTime(this._maximumRecordTime);}
this._openAsyncEvents.clear();for(var eventStack of this._openNestableAsyncEvents.values()){while(eventStack.length)
eventStack.pop().setEndTime(this._maximumRecordTime);}
this._openNestableAsyncEvents.clear();},_addNestableAsyncEvent:function(event)
{var phase=WebInspector.TracingModel.Phase;var key=event.categoriesString+"."+event.id;var openEventsStack=this._openNestableAsyncEvents.get(key);switch(event.phase){case phase.NestableAsyncBegin:if(!openEventsStack){openEventsStack=[];this._openNestableAsyncEvents.set(key,openEventsStack);}
var asyncEvent=new WebInspector.TracingModel.AsyncEvent(event);openEventsStack.push(asyncEvent);event.thread._addAsyncEvent(asyncEvent);break;case phase.NestableAsyncInstant:if(openEventsStack&&openEventsStack.length)
openEventsStack.peekLast()._addStep(event);break;case phase.NestableAsyncEnd:if(!openEventsStack||!openEventsStack.length)
break;var top=openEventsStack.pop();if(top.name!==event.name){console.error("Begin/end event mismatch for nestable async event, "+top.name+" vs. "+event.name);break;}
top._addStep(event);}},_addAsyncEvent:function(event)
{var phase=WebInspector.TracingModel.Phase;var key=event.categoriesString+"."+event.name+"."+event.id;var asyncEvent=this._openAsyncEvents.get(key);if(event.phase===phase.AsyncBegin){if(asyncEvent){console.error("Event "+event.name+" has already been started");return;}
asyncEvent=new WebInspector.TracingModel.AsyncEvent(event);this._openAsyncEvents.set(key,asyncEvent);event.thread._addAsyncEvent(asyncEvent);return;}
if(!asyncEvent){return;}
if(event.phase===phase.AsyncEnd){asyncEvent._addStep(event);this._openAsyncEvents.delete(key);return;}
if(event.phase===phase.AsyncStepInto||event.phase===phase.AsyncStepPast){var lastStep=asyncEvent.steps.peekLast();if(lastStep.phase!==phase.AsyncBegin&&lastStep.phase!==event.phase){console.assert(false,"Async event step phase mismatch: "+lastStep.phase+" at "+lastStep.startTime+" vs. "+event.phase+" at "+event.startTime);return;}
asyncEvent._addStep(event);return;}
console.assert(false,"Invalid async event phase");},_parsedCategoriesForString:function(str)
{var parsedCategories=this._parsedCategories.get(str);if(!parsedCategories){parsedCategories=new Set(str.split(","));this._parsedCategories.set(str,parsedCategories);}
return parsedCategories;}}
WebInspector.TracingModel.Event=function(categories,name,phase,startTime,thread)
{this.categoriesString=categories;this._parsedCategories=thread._model._parsedCategoriesForString(categories);this.name=name;this.phase=phase;this.startTime=startTime;this.thread=thread;this.args={};this.warning=null;this.initiator=null;this.stackTrace=null;this.previewElement=null;this.url=null;this.backendNodeId=0;this.selfTime=0;}
WebInspector.TracingModel.Event.fromPayload=function(payload,thread)
{var event=new WebInspector.TracingModel.Event(payload.cat,payload.name,(payload.ph),payload.ts/1000,thread);if(payload.args)
event.addArgs(payload.args);else
console.error("Missing mandatory event argument 'args' at "+payload.ts/1000);if(typeof payload.dur==="number")
event.setEndTime((payload.ts+payload.dur)/1000);if(payload.id)
event.id=payload.id;return event;}
WebInspector.TracingModel.Event.prototype={hasCategory:function(categoryName)
{return this._parsedCategories.has(categoryName);},setEndTime:function(endTime)
{if(endTime<this.startTime){console.assert(false,"Event out of order: "+this.name);return;}
this.endTime=endTime;this.duration=endTime-this.startTime;},addArgs:function(args)
{for(var name in args){if(name in this.args)
console.error("Same argument name ("+name+") is used for begin and end phases of "+this.name);this.args[name]=args[name];}},_complete:function(endEvent)
{if(endEvent.args)
this.addArgs(endEvent.args);else
console.error("Missing mandatory event argument 'args' at "+endEvent.startTime);this.setEndTime(endEvent.startTime);},_setBackingStorage:function(backingStorage)
{}}
WebInspector.TracingModel.Event.compareStartTime=function(a,b)
{return a.startTime-b.startTime;}
WebInspector.TracingModel.Event.orderedCompareStartTime=function(a,b)
{return a.startTime-b.startTime||a.ordinal-b.ordinal||-1;}
WebInspector.TracingModel.ObjectSnapshot=function(category,name,startTime,thread)
{WebInspector.TracingModel.Event.call(this,category,name,WebInspector.TracingModel.Phase.SnapshotObject,startTime,thread);}
WebInspector.TracingModel.ObjectSnapshot.fromPayload=function(payload,thread)
{var snapshot=new WebInspector.TracingModel.ObjectSnapshot(payload.cat,payload.name,payload.ts/1000,thread);if(payload.id)
snapshot.id=payload.id;if(!payload.args||!payload.args["snapshot"]){console.error("Missing mandatory 'snapshot' argument at "+payload.ts/1000);return snapshot;}
if(payload.args)
snapshot.addArgs(payload.args);return snapshot;}
WebInspector.TracingModel.ObjectSnapshot.prototype={requestObject:function(callback)
{var snapshot=this.args["snapshot"];if(snapshot){callback(snapshot);return;}
this._backingStorage().then(onRead,callback.bind(null,null));function onRead(result)
{if(!result){callback(null);return;}
try{var payload=JSON.parse(result);callback(payload["args"]["snapshot"]);}catch(e){WebInspector.console.error("Malformed event data in backing storage");callback(null);}}},objectPromise:function()
{if(!this._objectPromise)
this._objectPromise=new Promise(this.requestObject.bind(this));return this._objectPromise;},_setBackingStorage:function(backingStorage)
{if(!backingStorage)
return;this._backingStorage=backingStorage;this.args={};},__proto__:WebInspector.TracingModel.Event.prototype}
WebInspector.TracingModel.AsyncEvent=function(startEvent)
{WebInspector.TracingModel.Event.call(this,startEvent.categoriesString,startEvent.name,startEvent.phase,startEvent.startTime,startEvent.thread)
this.addArgs(startEvent.args);this.steps=[startEvent];}
WebInspector.TracingModel.AsyncEvent.prototype={_addStep:function(event)
{this.steps.push(event)
if(event.phase===WebInspector.TracingModel.Phase.AsyncEnd||event.phase===WebInspector.TracingModel.Phase.NestableAsyncEnd){this.setEndTime(event.startTime);this.steps[0].setEndTime(event.startTime);}},__proto__:WebInspector.TracingModel.Event.prototype}
WebInspector.TracingModel.NamedObject=function()
{}
WebInspector.TracingModel.NamedObject.prototype={_setName:function(name)
{this._name=name;},name:function()
{return this._name;},_setSortIndex:function(sortIndex)
{this._sortIndex=sortIndex;},}
WebInspector.TracingModel.NamedObject._sort=function(array)
{function comparator(a,b)
{return a._sortIndex!==b._sortIndex?a._sortIndex-b._sortIndex:a.name().localeCompare(b.name());}
return array.sort(comparator);}
WebInspector.TracingModel.Process=function(model,id)
{WebInspector.TracingModel.NamedObject.call(this);this._setName("Process "+id);this._id=id;this._threads={};this._threadByName=new Map();this._model=model;}
WebInspector.TracingModel.Process.prototype={id:function()
{return this._id;},threadById:function(id)
{var thread=this._threads[id];if(!thread){thread=new WebInspector.TracingModel.Thread(this,id);this._threads[id]=thread;}
return thread;},threadByName:function(name)
{return this._threadByName.get(name)||null;},_setThreadByName:function(name,thread)
{this._threadByName.set(name,thread);},_addEvent:function(payload)
{return this.threadById(payload.tid)._addEvent(payload);},sortedThreads:function()
{return WebInspector.TracingModel.NamedObject._sort(Object.values(this._threads));},__proto__:WebInspector.TracingModel.NamedObject.prototype}
WebInspector.TracingModel.Thread=function(process,id)
{WebInspector.TracingModel.NamedObject.call(this);this._process=process;this._setName("Thread "+id);this._events=[];this._asyncEvents=[];this._id=id;this._model=process._model;}
WebInspector.TracingModel.Thread.prototype={tracingComplete:function()
{this._asyncEvents.stableSort(WebInspector.TracingModel.Event.compareStartTime);this._events.stableSort(WebInspector.TracingModel.Event.compareStartTime);var phases=WebInspector.TracingModel.Phase;var stack=[];for(var i=0;i<this._events.length;++i){var e=this._events[i];e.ordinal=i;switch(e.phase){case phases.End:this._events[i]=null;if(!stack.length)
continue;var top=stack.pop();if(top.name!==e.name||top.categoriesString!==e.categoriesString)
console.error("B/E events mismatch at "+top.startTime+" ("+top.name+") vs. "+e.startTime+" ("+e.name+")");else
top._complete(e);break;case phases.Begin:stack.push(e);break;}}
this._events.remove(null,false);},_addEvent:function(payload)
{var event=payload.ph===WebInspector.TracingModel.Phase.SnapshotObject?WebInspector.TracingModel.ObjectSnapshot.fromPayload(payload,this):WebInspector.TracingModel.Event.fromPayload(payload,this);if(WebInspector.TracingModel.isTopLevelEvent(event)){if(this._lastTopLevelEvent&&this._lastTopLevelEvent.endTime>event.startTime)
return null;this._lastTopLevelEvent=event;}
this._events.push(event);return event;},_addAsyncEvent:function(asyncEvent)
{this._asyncEvents.push(asyncEvent);},_setName:function(name)
{WebInspector.TracingModel.NamedObject.prototype._setName.call(this,name);this._process._setThreadByName(name,this);},id:function()
{return this._id;},process:function()
{return this._process;},events:function()
{return this._events;},asyncEvents:function()
{return this._asyncEvents;},__proto__:WebInspector.TracingModel.NamedObject.prototype};WebInspector.WorkerManager=function(target)
{WebInspector.SDKObject.call(this,target);target.registerWorkerDispatcher(new WebInspector.WorkerDispatcher(this));this._lastAnonymousTargetId=0;this._connections=new Map();this._targetsByWorkerId=new Map();WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.SuspendStateChanged,this._onSuspendStateChanged,this);this._onSuspendStateChanged();this.enable();}
WebInspector.WorkerManager.prototype={enable:function()
{if(this._enabled)
return;this._enabled=true;this.target().workerAgent().enable();this.target().resourceTreeModel.addEventListener(WebInspector.TargetManager.Events.MainFrameNavigated,this._mainFrameNavigated,this);},disable:function()
{if(!this._enabled)
return;this._enabled=false;this._reset();this.target().workerAgent().disable();this.target().resourceTreeModel.removeEventListener(WebInspector.TargetManager.Events.MainFrameNavigated,this._mainFrameNavigated,this);},dispose:function()
{this._reset();},_reset:function()
{for(var connection of this._connections.values())
connection._close();this._connections.clear();this._targetsByWorkerId.clear();},_onSuspendStateChanged:function()
{var suspended=WebInspector.targetManager.allTargetsSuspended();this.target().workerAgent().setAutoconnectToWorkers(!suspended);},_workerCreated:function(workerId,url,inspectorConnected)
{var connection=new WebInspector.WorkerConnection(this,workerId,inspectorConnected,onConnectionReady.bind(this));this._connections.set(workerId,connection);function onConnectionReady(connection)
{var parsedURL=url.asParsedURL();var workerName=parsedURL?parsedURL.lastPathComponentWithFragment():"#"+(++this._lastAnonymousTargetId);var target=WebInspector.targetManager.createTarget(workerName,WebInspector.Target.Type.DedicatedWorker,connection,this.target());this._targetsByWorkerId.set(workerId,target);if(inspectorConnected)
target.runtimeAgent().isRunRequired(pauseInDebuggerAndRunIfRequired.bind(null,target));}
function pauseInDebuggerAndRunIfRequired(target,error,required)
{var mainIsServiceWorker=WebInspector.targetManager.mainTarget().isServiceWorker();if(mainIsServiceWorker&&required)
target.debuggerAgent().pause();target.runtimeAgent().run();}},_workerTerminated:function(workerId)
{var connection=this._connections.get(workerId);if(connection)
connection._close();this._connections.delete(workerId);this._targetsByWorkerId.delete(workerId);},_dispatchMessageFromWorker:function(workerId,message)
{var connection=this._connections.get(workerId);if(connection)
connection.dispatch(message);},_mainFrameNavigated:function(event)
{this._reset();},targetByWorkerId:function(workerId)
{return this._targetsByWorkerId.get(workerId)||null;},__proto__:WebInspector.SDKObject.prototype}
WebInspector.WorkerDispatcher=function(workerManager)
{this._workerManager=workerManager;}
WebInspector.WorkerDispatcher.prototype={workerCreated:function(workerId,url,inspectorConnected)
{this._workerManager._workerCreated(workerId,url,inspectorConnected);},workerTerminated:function(workerId)
{this._workerManager._workerTerminated(workerId);},dispatchMessageFromWorker:function(workerId,message)
{this._workerManager._dispatchMessageFromWorker(workerId,message);}}
WebInspector.WorkerConnection=function(workerManager,workerId,inspectorConnected,onConnectionReady)
{InspectorBackendClass.Connection.call(this);this.suppressErrorsForDomains(["Worker","Page","CSS","DOM","DOMStorage","Database","Network","IndexedDB"]);this._agent=workerManager.target().workerAgent();this._workerId=workerId;if(!inspectorConnected)
this._agent.connectToWorker(workerId,onConnectionReady.bind(null,this));else
onConnectionReady.call(null,this);}
WebInspector.WorkerConnection.prototype={sendMessage:function(messageObject)
{this._agent.sendMessageToWorker(this._workerId,JSON.stringify(messageObject));},_close:function()
{this.connectionClosed("worker_terminated");},__proto__:InspectorBackendClass.Connection.prototype};WebInspector.RuntimeModel=function(target)
{WebInspector.SDKModel.call(this,WebInspector.RuntimeModel,target);this._agent=target.runtimeAgent();this.target().registerRuntimeDispatcher(new WebInspector.RuntimeDispatcher(this));if(target.hasJSContext())
this._agent.enable();this._executionContextById={};if(WebInspector.moduleSetting("customFormatters").get())
this._agent.setCustomObjectFormatterEnabled(true);WebInspector.moduleSetting("customFormatters").addChangeListener(this._customFormattersStateChanged.bind(this));}
WebInspector.RuntimeModel.Events={ExecutionContextCreated:"ExecutionContextCreated",ExecutionContextDestroyed:"ExecutionContextDestroyed",}
WebInspector.RuntimeModel._privateScript="private script";WebInspector.RuntimeModel.prototype={executionContexts:function()
{return Object.values(this._executionContextById);},executionContext:function(id)
{return this._executionContextById[id]||null;},_executionContextCreated:function(context)
{if(context.name==WebInspector.RuntimeModel._privateScript&&!context.origin&&!Runtime.experiments.isEnabled("privateScriptInspection")){return;}
var executionContext=new WebInspector.ExecutionContext(this.target(),context.id,context.name,context.origin,!context.type,context.frameId);this._executionContextById[executionContext.id]=executionContext;this.dispatchEventToListeners(WebInspector.RuntimeModel.Events.ExecutionContextCreated,executionContext);},_executionContextDestroyed:function(executionContextId)
{var executionContext=this._executionContextById[executionContextId];if(!executionContext)
return;delete this._executionContextById[executionContextId];this.dispatchEventToListeners(WebInspector.RuntimeModel.Events.ExecutionContextDestroyed,executionContext);},_executionContextsCleared:function()
{var contexts=this.executionContexts();this._executionContextById={};for(var i=0;i<contexts.length;++i)
this.dispatchEventToListeners(WebInspector.RuntimeModel.Events.ExecutionContextDestroyed,contexts[i]);},createRemoteObject:function(payload)
{console.assert(typeof payload==="object","Remote object payload should only be an object");return new WebInspector.RemoteObjectImpl(this.target(),payload.objectId,payload.type,payload.subtype,payload.value,payload.description,payload.preview,payload.customPreview);},createScopeRemoteObject:function(payload,scopeRef)
{return new WebInspector.ScopeRemoteObject(this.target(),payload.objectId,scopeRef,payload.type,payload.subtype,payload.value,payload.description,payload.preview);},createRemoteObjectFromPrimitiveValue:function(value)
{return new WebInspector.RemoteObjectImpl(this.target(),undefined,typeof value,undefined,value);},createRemotePropertyFromPrimitiveValue:function(name,value)
{return new WebInspector.RemoteObjectProperty(name,this.createRemoteObjectFromPrimitiveValue(value));},_customFormattersStateChanged:function(event)
{var enabled=(event.data);this._agent.setCustomObjectFormatterEnabled(enabled);},__proto__:WebInspector.SDKModel.prototype}
WebInspector.RuntimeDispatcher=function(runtimeModel)
{this._runtimeModel=runtimeModel;}
WebInspector.RuntimeDispatcher.prototype={executionContextCreated:function(context)
{this._runtimeModel._executionContextCreated(context);},executionContextDestroyed:function(executionContextId)
{this._runtimeModel._executionContextDestroyed(executionContextId);},executionContextsCleared:function()
{this._runtimeModel._executionContextsCleared();}}
WebInspector.ExecutionContext=function(target,id,name,origin,isPageContext,frameId)
{WebInspector.SDKObject.call(this,target);this.id=id;this.name=name;this.origin=origin;this.isMainWorldContext=isPageContext;this.runtimeModel=target.runtimeModel;this.debuggerModel=WebInspector.DebuggerModel.fromTarget(target);this.frameId=frameId;}
WebInspector.ExecutionContext.comparator=function(a,b)
{function targetWeight(target)
{if(target.isPage())
return 3;if(target.isDedicatedWorker())
return 2;return 1;}
var weightDiff=targetWeight(a.target())-targetWeight(b.target());if(weightDiff)
return-weightDiff;var frameIdDiff=String.hashCode(a.frameId)-String.hashCode(b.frameId);if(frameIdDiff)
return frameIdDiff;if(a.isMainWorldContext)
return-1;if(b.isMainWorldContext)
return+1;return a.name.localeCompare(b.name);}
WebInspector.ExecutionContext.prototype={evaluate:function(expression,objectGroup,includeCommandLineAPI,doNotPauseOnExceptionsAndMuteConsole,returnByValue,generatePreview,callback)
{if(this.debuggerModel.selectedCallFrame()){this.debuggerModel.evaluateOnSelectedCallFrame(expression,objectGroup,includeCommandLineAPI,doNotPauseOnExceptionsAndMuteConsole,returnByValue,generatePreview,callback);return;}
this._evaluateGlobal.apply(this,arguments);},globalObject:function(objectGroup,returnByValue,generatePreview,callback)
{this._evaluateGlobal("this",objectGroup,false,true,returnByValue,generatePreview,callback);},_evaluateGlobal:function(expression,objectGroup,includeCommandLineAPI,doNotPauseOnExceptionsAndMuteConsole,returnByValue,generatePreview,callback)
{if(!expression){expression="this";}
function evalCallback(error,result,wasThrown,exceptionDetails)
{if(error){callback(null,false);return;}
if(returnByValue)
callback(null,!!wasThrown,wasThrown?null:result,exceptionDetails);else
callback(this.runtimeModel.createRemoteObject(result),!!wasThrown,undefined,exceptionDetails);}
this.target().runtimeAgent().evaluate(expression,objectGroup,includeCommandLineAPI,doNotPauseOnExceptionsAndMuteConsole,this.id,returnByValue,generatePreview,evalCallback.bind(this));},completionsForExpression:function(expressionString,text,cursorOffset,prefix,force,completionsReadyCallback)
{var lastIndex=expressionString.length-1;var dotNotation=(expressionString[lastIndex]===".");var bracketNotation=(expressionString[lastIndex]==="[");if(dotNotation||bracketNotation)
expressionString=expressionString.substr(0,lastIndex);if(expressionString&&parseInt(expressionString,10)==expressionString){completionsReadyCallback([]);return;}
if(!prefix&&!expressionString&&!force){completionsReadyCallback([]);return;}
if(!expressionString&&this.debuggerModel.selectedCallFrame())
this.debuggerModel.selectedCallFrame().variableNames(receivedPropertyNames.bind(this));else
this.evaluate(expressionString,"completion",true,true,false,false,evaluated.bind(this));function evaluated(result,wasThrown)
{if(!result||wasThrown){completionsReadyCallback([]);return;}
function getCompletions(type)
{var object;if(type==="string")
object=new String("");else if(type==="number")
object=new Number(0);else if(type==="boolean")
object=new Boolean(false);else
object=this;var resultSet={};for(var o=object;o;o=o.__proto__){try{if(type==="array"&&o===object&&ArrayBuffer.isView(o)&&o.length>9999)
continue;var names=Object.getOwnPropertyNames(o);for(var i=0;i<names.length;++i)
resultSet[names[i]]=true;}catch(e){}}
return resultSet;}
if(result.type==="object"||result.type==="function")
result.callFunctionJSON(getCompletions,[WebInspector.RemoteObject.toCallArgument(result.subtype)],receivedPropertyNames.bind(this));else if(result.type==="string"||result.type==="number"||result.type==="boolean")
this.evaluate("("+getCompletions+")(\""+result.type+"\")","completion",false,true,true,false,receivedPropertyNamesFromEval.bind(this));}
function receivedPropertyNamesFromEval(notRelevant,wasThrown,result)
{if(result&&!wasThrown)
receivedPropertyNames.call(this,result.value);else
completionsReadyCallback([]);}
function receivedPropertyNames(propertyNames)
{this.target().runtimeAgent().releaseObjectGroup("completion");if(!propertyNames){completionsReadyCallback([]);return;}
var includeCommandLineAPI=(!dotNotation&&!bracketNotation);if(includeCommandLineAPI){const commandLineAPI=["dir","dirxml","keys","values","profile","profileEnd","monitorEvents","unmonitorEvents","inspect","copy","clear","getEventListeners","debug","undebug","monitor","unmonitor","table","$","$$","$x"];for(var i=0;i<commandLineAPI.length;++i)
propertyNames[commandLineAPI[i]]=true;}
this._reportCompletions(completionsReadyCallback,dotNotation,bracketNotation,expressionString,prefix,Object.keys(propertyNames));}},_reportCompletions:function(completionsReadyCallback,dotNotation,bracketNotation,expressionString,prefix,properties){if(bracketNotation){if(prefix.length&&prefix[0]==="'")
var quoteUsed="'";else
var quoteUsed="\"";}
var results=[];if(!expressionString){const keywords=["break","case","catch","continue","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","this","throw","try","typeof","var","void","while","with"];properties=properties.concat(keywords);}
properties.sort();for(var i=0;i<properties.length;++i){var property=properties[i];if(dotNotation&&!/^[a-zA-Z_$\u008F-\uFFFF][a-zA-Z0-9_$\u008F-\uFFFF]*$/.test(property))
continue;if(bracketNotation){if(!/^[0-9]+$/.test(property))
property=quoteUsed+property.escapeCharacters(quoteUsed+"\\")+quoteUsed;property+="]";}
if(property.length<prefix.length)
continue;if(prefix.length&&!property.startsWith(prefix))
continue;results.push(property.split("\n").join("\\n"));}
completionsReadyCallback(results);},__proto__:WebInspector.SDKObject.prototype}
WebInspector.EventListener=function(target,type,useCapture,handler,originalHandler,location,removeFunction,listenerType)
{WebInspector.SDKObject.call(this,target);this._type=type;this._useCapture=useCapture;this._handler=handler;this._originalHandler=originalHandler||handler;this._location=location;this._sourceURL=location.script().contentURL();this._removeFunction=removeFunction;this._listenerType=listenerType||"normal";}
WebInspector.EventListener.prototype={type:function()
{return this._type;},useCapture:function()
{return this._useCapture;},handler:function()
{return this._handler;},location:function()
{return this._location;},sourceURL:function()
{return this._sourceURL;},originalHandler:function()
{return this._originalHandler;},removeFunction:function()
{return this._removeFunction;},remove:function()
{if(!this._removeFunction)
return Promise.resolve();return new Promise(promiseConstructor.bind(this));function promiseConstructor(success)
{this._removeFunction.callFunction(callCustomRemove,[WebInspector.RemoteObject.toCallArgument(this._removeFunction),WebInspector.RemoteObject.toCallArgument(this._type),WebInspector.RemoteObject.toCallArgument(this._originalHandler),WebInspector.RemoteObject.toCallArgument(this._useCapture)],success);function callCustomRemove(func,type,listener,useCapture)
{func.call(null,type,listener,useCapture);}}},listenerType:function()
{return this._listenerType;},setListenerType:function(listenerType)
{this._listenerType=listenerType;},__proto__:WebInspector.SDKObject.prototype};WebInspector.Script=function(debuggerModel,scriptId,sourceURL,startLine,startColumn,endLine,endColumn,executionContextId,isContentScript,isInternalScript,isLiveEdit,sourceMapURL,hasSourceURL)
{WebInspector.SDKObject.call(this,debuggerModel.target());this.debuggerModel=debuggerModel;this.scriptId=scriptId;this.sourceURL=sourceURL;this.lineOffset=startLine;this.columnOffset=startColumn;this.endLine=endLine;this.endColumn=endColumn;this._executionContextId=executionContextId;this._isContentScript=isContentScript;this._isInternalScript=isInternalScript;this._isLiveEdit=isLiveEdit;this.sourceMapURL=sourceMapURL;this.hasSourceURL=hasSourceURL;}
WebInspector.Script.Events={ScriptEdited:"ScriptEdited",SourceMapURLAdded:"SourceMapURLAdded",}
WebInspector.Script.sourceURLRegex=/^[\040\t]*\/\/# sourceURL=\s*(\S*?)\s*$/m;WebInspector.Script._trimSourceURLComment=function(source)
{var sourceURLIndex=source.lastIndexOf("//# sourceURL=");if(sourceURLIndex===-1)
return source;var sourceURLLineIndex=source.lastIndexOf("\n",sourceURLIndex);if(sourceURLLineIndex===-1)
return source;var sourceURLLine=source.substr(sourceURLLineIndex+1).split("\n",1)[0];if(sourceURLLine.search(WebInspector.Script.sourceURLRegex)===-1)
return source;return source.substr(0,sourceURLLineIndex)+source.substr(sourceURLLineIndex+sourceURLLine.length+1);}
WebInspector.Script.prototype={isContentScript:function()
{return this._isContentScript;},isInternalScript:function()
{return this._isInternalScript;},executionContext:function()
{return this.target().runtimeModel.executionContext(this._executionContextId);},isLiveEdit:function()
{return this._isLiveEdit;},contentURL:function()
{return this.sourceURL;},contentType:function()
{return WebInspector.resourceTypes.Script;},requestContent:function(callback)
{if(this._source){callback(this._source);return;}
function didGetScriptSource(error,source)
{this._source=WebInspector.Script._trimSourceURLComment(error?"":source);callback(this._source);}
if(this.scriptId){this.target().debuggerAgent().getScriptSource(this.scriptId,didGetScriptSource.bind(this));}else
callback("");},searchInContent:function(query,caseSensitive,isRegex,callback)
{function innerCallback(error,searchMatches)
{if(error){console.error(error);callback([]);return;}
var result=[];for(var i=0;i<searchMatches.length;++i){var searchMatch=new WebInspector.ContentProvider.SearchMatch(searchMatches[i].lineNumber,searchMatches[i].lineContent);result.push(searchMatch);}
callback(result||[]);}
if(this.scriptId){this.target().debuggerAgent().searchInContent(this.scriptId,query,caseSensitive,isRegex,innerCallback);}else{callback([]);}},_appendSourceURLCommentIfNeeded:function(source)
{if(!this.hasSourceURL)
return source;return source+"\n //# sourceURL="+this.sourceURL;},editSource:function(newSource,callback)
{function didEditScriptSource(error,errorData,callFrames,stackChanged,asyncStackTrace)
{if(!error)
this._source=newSource;var needsStepIn=!!stackChanged;callback(error,errorData,callFrames,asyncStackTrace,needsStepIn);}
newSource=WebInspector.Script._trimSourceURLComment(newSource);newSource=this._appendSourceURLCommentIfNeeded(newSource);if(this.scriptId)
this.target().debuggerAgent().setScriptSource(this.scriptId,newSource,undefined,didEditScriptSource.bind(this));else
callback("Script failed to parse");},rawLocation:function(lineNumber,columnNumber)
{return new WebInspector.DebuggerModel.Location(this.debuggerModel,this.scriptId,lineNumber,columnNumber||0);},isInlineScript:function()
{var startsAtZero=!this.lineOffset&&!this.columnOffset;return!!this.sourceURL&&!startsAtZero;},addSourceMapURL:function(sourceMapURL)
{if(this.sourceMapURL)
return;this.sourceMapURL=sourceMapURL;this.dispatchEventToListeners(WebInspector.Script.Events.SourceMapURLAdded,this.sourceMapURL);},isAnonymousScript:function()
{return!this.sourceURL;},isInlineScriptWithSourceURL:function()
{return!!this.hasSourceURL&&this.isInlineScript();},__proto__:WebInspector.SDKObject.prototype};WebInspector.ServiceWorkerCacheModel=function(target)
{WebInspector.SDKModel.call(this,WebInspector.ServiceWorkerCacheModel,target);this._caches=new Map();this._agent=target.cacheStorageAgent();this._enabled=false;}
WebInspector.ServiceWorkerCacheModel.EventTypes={CacheAdded:"CacheAdded",CacheRemoved:"CacheRemoved"}
WebInspector.ServiceWorkerCacheModel.prototype={enable:function()
{if(this._enabled)
return;this.target().resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.SecurityOriginAdded,this._securityOriginAdded,this);this.target().resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.SecurityOriginRemoved,this._securityOriginRemoved,this);var securityOrigins=this.target().resourceTreeModel.securityOrigins();for(var i=0;i<securityOrigins.length;++i)
this._addOrigin(securityOrigins[i]);this._enabled=true;},refreshCacheNames:function()
{var securityOrigins=this.target().resourceTreeModel.securityOrigins();for(var securityOrigin of securityOrigins)
this._loadCacheNames(securityOrigin);},deleteCache:function(cache)
{function callback(error)
{if(error){console.error("ServiceWorkerCacheAgent error deleting cache ",cache.toString(),": ",error);return;}
this._caches.delete(cache.cacheId);this._cacheRemoved(cache);}
this._agent.deleteCache(cache.cacheId,callback.bind(this));},deleteCacheEntry:function(cache,request,callback)
{function myCallback(error)
{if(error){WebInspector.console.error(WebInspector.UIString("ServiceWorkerCacheAgent error deleting cache entry %s in cache: %s",cache.toString(),error));return;}
callback();}
this._agent.deleteEntry(cache.cacheId,request,myCallback);},loadCacheData:function(cache,skipCount,pageSize,callback)
{this._requestEntries(cache,skipCount,pageSize,callback);},caches:function()
{var caches=new Array();for(var cache of this._caches.values())
caches.push(cache);return caches;},dispose:function()
{for(var cache of this._caches.values())
this._cacheRemoved(cache);this._caches.clear();if(this._enabled){this.target().resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.SecurityOriginAdded,this._securityOriginAdded,this);this.target().resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.SecurityOriginRemoved,this._securityOriginRemoved,this);}},_addOrigin:function(securityOrigin)
{this._loadCacheNames(securityOrigin);},_removeOrigin:function(securityOrigin)
{for(var opaqueId of this._caches.keys()){var cache=this._caches.get(opaqueId);if(cache.securityOrigin==securityOrigin){this._caches.delete(opaqueId);this._cacheRemoved(cache);}}},_loadCacheNames:function(securityOrigin)
{function callback(error,caches)
{if(error){console.error("ServiceWorkerCacheAgent error while loading caches: ",error);return;}
this._updateCacheNames(securityOrigin,caches);}
this._agent.requestCacheNames(securityOrigin,callback.bind(this));},_updateCacheNames:function(securityOrigin,cachesJson)
{function deleteAndSaveOldCaches(cache)
{if(cache.securityOrigin==securityOrigin&&!updatingCachesIds.has(cache.cacheId)){oldCaches.set(cache.cacheId,cache);this._caches.delete(cache.cacheId);}}
var updatingCachesIds=new Set();var newCaches=new Map();var oldCaches=new Map();for(var cacheJson of cachesJson){var cache=new WebInspector.ServiceWorkerCacheModel.Cache(cacheJson.securityOrigin,cacheJson.cacheName,cacheJson.cacheId);updatingCachesIds.add(cache.cacheId);if(this._caches.has(cache.cacheId))
continue;newCaches.set(cache.cacheId,cache);this._caches.set(cache.cacheId,cache);}
this._caches.forEach(deleteAndSaveOldCaches,this);newCaches.forEach(this._cacheAdded,this);oldCaches.forEach(this._cacheRemoved,this);},_securityOriginAdded:function(event)
{var securityOrigin=(event.data);this._addOrigin(securityOrigin);},_securityOriginRemoved:function(event)
{var securityOrigin=(event.data);this._removeOrigin(securityOrigin);},_cacheAdded:function(cache)
{this.dispatchEventToListeners(WebInspector.ServiceWorkerCacheModel.EventTypes.CacheAdded,cache);},_cacheRemoved:function(cache)
{this.dispatchEventToListeners(WebInspector.ServiceWorkerCacheModel.EventTypes.CacheRemoved,cache);},_requestEntries:function(cache,skipCount,pageSize,callback)
{function innerCallback(error,dataEntries,hasMore)
{if(error){console.error("ServiceWorkerCacheAgent error while requesting entries: ",error);return;}
var entries=[];for(var i=0;i<dataEntries.length;++i){entries.push(new WebInspector.ServiceWorkerCacheModel.Entry(dataEntries[i].request,dataEntries[i].response));}
callback(entries,hasMore);}
this._agent.requestEntries(cache.cacheId,skipCount,pageSize,innerCallback);},__proto__:WebInspector.SDKModel.prototype}
WebInspector.ServiceWorkerCacheModel.Entry=function(request,response)
{this.request=request;this.response=response;}
WebInspector.ServiceWorkerCacheModel.Cache=function(securityOrigin,cacheName,cacheId)
{this.securityOrigin=securityOrigin;this.cacheName=cacheName;this.cacheId=cacheId;}
WebInspector.ServiceWorkerCacheModel.Cache.prototype={equals:function(cache)
{return this.cacheId==cache.cacheId;},toString:function()
{return this.securityOrigin+this.cacheName;}}
WebInspector.ServiceWorkerCacheModel._symbol=Symbol("CacheStorageModel");WebInspector.ServiceWorkerCacheModel.fromTarget=function(target)
{if(!target[WebInspector.ServiceWorkerCacheModel._symbol])
target[WebInspector.ServiceWorkerCacheModel._symbol]=new WebInspector.ServiceWorkerCacheModel(target);return target[WebInspector.ServiceWorkerCacheModel._symbol];};WebInspector.CallFunctionResult;WebInspector.RemoteObject=function(){}
WebInspector.RemoteObject.prototype={customPreview:function()
{return null;},get type()
{throw"Not implemented";},get subtype()
{throw"Not implemented";},get description()
{throw"Not implemented";},get hasChildren()
{throw"Not implemented";},arrayLength:function()
{throw"Not implemented";},getOwnProperties:function(callback)
{throw"Not implemented";},getOwnPropertiesPromise:function()
{return new Promise(promiseConstructor.bind(this));function promiseConstructor(success)
{this.getOwnProperties(getOwnPropertiesCallback.bind(null,success));}
function getOwnPropertiesCallback(callback,properties,internalProperties)
{callback({properties:properties,internalProperties:internalProperties});}},getAllProperties:function(accessorPropertiesOnly,callback)
{throw"Not implemented";},getAllPropertiesPromise:function(accessorPropertiesOnly)
{return new Promise(promiseConstructor.bind(this));function promiseConstructor(success)
{this.getAllProperties(accessorPropertiesOnly,getAllPropertiesCallback.bind(null,success));}
function getAllPropertiesCallback(callback,properties,internalProperties)
{callback({properties:properties,internalProperties:internalProperties});}},eventListeners:function()
{throw"Not implemented";},deleteProperty:function(name,callback)
{throw"Not implemented";},callFunction:function(functionDeclaration,args,callback)
{throw"Not implemented";},callFunctionPromise:function(functionDeclaration,args)
{return new Promise(promiseConstructor.bind(this));function promiseConstructor(success)
{this.callFunction(functionDeclaration,args,callFunctionCallback.bind(null,success));}
function callFunctionCallback(callback,object,wasThrown)
{callback({object:object,wasThrown:wasThrown});}},callFunctionJSON:function(functionDeclaration,args,callback)
{throw"Not implemented";},callFunctionJSONPromise:function(functionDeclaration,args)
{return new Promise(promiseConstructor.bind(this));function promiseConstructor(success)
{this.callFunctionJSON(functionDeclaration,args,success);}},target:function()
{throw new Error("Target-less object");},debuggerModel:function()
{throw new Error("DebuggerModel-less object");},isNode:function()
{return false;},functionDetails:function(callback)
{callback(null);},functionDetailsPromise:function()
{return new Promise(promiseConstructor.bind(this));function promiseConstructor(success)
{this.functionDetails(success);}},generatorObjectDetails:function(callback)
{callback(null);},collectionEntries:function(callback)
{callback(null);}}
WebInspector.RemoteObject.fromLocalObject=function(value)
{return new WebInspector.LocalJSONObject(value);}
WebInspector.RemoteObject.type=function(remoteObject)
{if(remoteObject===null)
return"null";var type=typeof remoteObject;if(type!=="object"&&type!=="function")
return type;return remoteObject.type;}
WebInspector.RemoteObject.arrayLength=function(object)
{if(object.subtype!=="array")
return 0;var matches=object.description.match(/\[([0-9]+)\]/);if(!matches)
return 0;return parseInt(matches[1],10);}
WebInspector.RemoteObject.toCallArgument=function(object)
{var type=typeof object;var value=object;var objectId=undefined;var description=String(object);if(type==="number"&&value===0&&1/value<0)
description="-0";switch(type){case"number":case"string":case"boolean":case"undefined":break;default:if(object){type=object.type;value=object.value;objectId=object.objectId;description=object.description;}
break;}
if(type==="number"){switch(description){case"NaN":case"Infinity":case"-Infinity":case"-0":value=description;break;}}
return{value:value,objectId:objectId,type:(type)};}
WebInspector.RemoteObjectImpl=function(target,objectId,type,subtype,value,description,preview,customPreview)
{WebInspector.RemoteObject.call(this);this._target=target;this._runtimeAgent=target.runtimeAgent();this._debuggerModel=WebInspector.DebuggerModel.fromTarget(target);this._type=type;this._subtype=subtype;if(objectId){this._objectId=objectId;this._description=description;this._hasChildren=(type!=="symbol");this._preview=preview;}else{this._description=description||(value+"");this._hasChildren=false;if(type==="number"&&typeof value!=="number")
this.value=Number(value);else
this.value=value;}
this._customPreview=customPreview||null;}
WebInspector.RemoteObjectImpl.prototype={customPreview:function()
{return this._customPreview;},get objectId()
{return this._objectId;},get type()
{return this._type;},get subtype()
{return this._subtype;},get description()
{return this._description;},get hasChildren()
{return this._hasChildren;},get preview()
{return this._preview;},getOwnProperties:function(callback)
{this.doGetProperties(true,false,false,callback);},getAllProperties:function(accessorPropertiesOnly,callback)
{this.doGetProperties(false,accessorPropertiesOnly,false,callback);},eventListeners:function()
{return new Promise(eventListeners.bind(this));function eventListeners(fulfill,reject)
{if(!this.target().isPage()){fulfill([]);return;}
if(!this._objectId){reject(null);return;}
var removeFunction=null;this.callFunctionPromise(nodeRemoveEventListener).then(storeRemoveFunction.bind(this));function storeRemoveFunction(result)
{if(!result.wasThrown&&result.object)
removeFunction=result.object;this.target().domdebuggerAgent().getEventListeners(this._objectId,mycallback.bind(this));}
function mycallback(error,payloads)
{if(error){reject(null);return;}
fulfill(payloads.map(createEventListener.bind(this)));}
function nodeRemoveEventListener()
{return removeEventListenerWrapper.bind(this);function removeEventListenerWrapper(type,handler,useCapture)
{this.removeEventListener(type,handler,useCapture);if(this["on"+type])
this["on"+type]=null;}}
function createEventListener(payload)
{return new WebInspector.EventListener(this._target,payload.type,payload.useCapture,payload.handler?this.target().runtimeModel.createRemoteObject(payload.handler):null,payload.originalHandler?this.target().runtimeModel.createRemoteObject(payload.originalHandler):null,WebInspector.DebuggerModel.Location.fromPayload(this._debuggerModel,payload.location),removeFunction);}}},getProperty:function(propertyPath,callback)
{function remoteFunction(arrayStr)
{var result=this;var properties=JSON.parse(arrayStr);for(var i=0,n=properties.length;i<n;++i)
result=result[properties[i]];return result;}
var args=[{value:JSON.stringify(propertyPath)}];this.callFunction(remoteFunction,args,callback);},doGetProperties:function(ownProperties,accessorPropertiesOnly,generatePreview,callback)
{if(!this._objectId){callback(null,null);return;}
function remoteObjectBinder(error,properties,internalProperties,exceptionDetails)
{if(error){callback(null,null);return;}
if(exceptionDetails){var msg=new WebInspector.ConsoleMessage(this._target,WebInspector.ConsoleMessage.MessageSource.JS,WebInspector.ConsoleMessage.MessageLevel.Error,exceptionDetails.text);this._target.consoleModel.addMessage(msg);callback(null,null);return;}
var result=[];for(var i=0;properties&&i<properties.length;++i){var property=properties[i];var propertyValue=property.value?this._target.runtimeModel.createRemoteObject(property.value):null;var propertySymbol=property.symbol?this._target.runtimeModel.createRemoteObject(property.symbol):null;var remoteProperty=new WebInspector.RemoteObjectProperty(property.name,propertyValue,!!property.enumerable,!!property.writable,!!property.isOwn,!!property.wasThrown,propertySymbol);if(typeof property.value==="undefined"){if(property.get&&property.get.type!=="undefined")
remoteProperty.getter=this._target.runtimeModel.createRemoteObject(property.get);if(property.set&&property.set.type!=="undefined")
remoteProperty.setter=this._target.runtimeModel.createRemoteObject(property.set);}
result.push(remoteProperty);}
var internalPropertiesResult=null;if(internalProperties){internalPropertiesResult=[];for(var i=0;i<internalProperties.length;i++){var property=internalProperties[i];if(!property.value)
continue;var propertyValue=this._target.runtimeModel.createRemoteObject(property.value);internalPropertiesResult.push(new WebInspector.RemoteObjectProperty(property.name,propertyValue,true,false));}}
callback(result,internalPropertiesResult);}
this._runtimeAgent.getProperties(this._objectId,ownProperties,accessorPropertiesOnly,generatePreview,remoteObjectBinder.bind(this));},setPropertyValue:function(name,value,callback)
{if(!this._objectId){callback("Can't set a property of non-object.");return;}
this._runtimeAgent.invoke_evaluate({expression:value,doNotPauseOnExceptionsAndMuteConsole:true},evaluatedCallback.bind(this));function evaluatedCallback(error,result,wasThrown)
{if(error||wasThrown){callback(error||result.description);return;}
if(typeof name==="string")
name=WebInspector.RemoteObject.toCallArgument(name);this.doSetObjectPropertyValue(result,name,callback);if(result.objectId)
this._runtimeAgent.releaseObject(result.objectId);}},doSetObjectPropertyValue:function(result,name,callback)
{var setPropertyValueFunction="function(a, b) { this[a] = b; }";var argv=[name,WebInspector.RemoteObject.toCallArgument(result)];this._runtimeAgent.callFunctionOn(this._objectId,setPropertyValueFunction,argv,true,undefined,undefined,propertySetCallback);function propertySetCallback(error,result,wasThrown)
{if(error||wasThrown){callback(error||result.description);return;}
callback();}},deleteProperty:function(name,callback)
{if(!this._objectId){callback("Can't delete a property of non-object.");return;}
var deletePropertyFunction="function(a) { delete this[a]; return !(a in this); }";this._runtimeAgent.callFunctionOn(this._objectId,deletePropertyFunction,[name],true,undefined,undefined,deletePropertyCallback);function deletePropertyCallback(error,result,wasThrown)
{if(error||wasThrown){callback(error||result.description);return;}
if(!result.value)
callback("Failed to delete property.");else
callback();}},callFunction:function(functionDeclaration,args,callback)
{function mycallback(error,result,wasThrown)
{if(!callback)
return;if(error)
callback(null,false);else
callback(this.target().runtimeModel.createRemoteObject(result),wasThrown);}
this._runtimeAgent.callFunctionOn(this._objectId,functionDeclaration.toString(),args,true,undefined,undefined,mycallback.bind(this));},callFunctionJSON:function(functionDeclaration,args,callback)
{function mycallback(error,result,wasThrown)
{callback((error||wasThrown)?null:result.value);}
this._runtimeAgent.callFunctionOn(this._objectId,functionDeclaration.toString(),args,true,true,false,mycallback);},release:function()
{if(!this._objectId)
return;this._runtimeAgent.releaseObject(this._objectId);},arrayLength:function()
{return WebInspector.RemoteObject.arrayLength(this);},target:function()
{return this._target;},debuggerModel:function()
{return this._debuggerModel;},isNode:function()
{return!!this._objectId&&this.type==="object"&&this.subtype==="node";},functionDetails:function(callback)
{this._debuggerModel.functionDetails(this,callback);},generatorObjectDetails:function(callback)
{this._debuggerModel.generatorObjectDetails(this,callback);},collectionEntries:function(callback)
{if(!this._objectId){callback(null);return;}
this._debuggerModel.getCollectionEntries(this._objectId,callback);},__proto__:WebInspector.RemoteObject.prototype};WebInspector.RemoteObject.loadFromObjectPerProto=function(object,callback)
{var savedOwnProperties;var savedAccessorProperties;var savedInternalProperties;var resultCounter=2;function processCallback()
{if(--resultCounter)
return;if(savedOwnProperties&&savedAccessorProperties){var combinedList=savedAccessorProperties.slice(0);for(var i=0;i<savedOwnProperties.length;i++){var property=savedOwnProperties[i];if(!property.isAccessorProperty())
combinedList.push(property);}
return callback(combinedList,savedInternalProperties?savedInternalProperties:null);}else{callback(null,null);}}
function allAccessorPropertiesCallback(properties,internalProperties)
{savedAccessorProperties=properties;processCallback();}
function ownPropertiesCallback(properties,internalProperties)
{savedOwnProperties=properties;savedInternalProperties=internalProperties;processCallback();}
object.getAllProperties(true,allAccessorPropertiesCallback);object.getOwnProperties(ownPropertiesCallback);};WebInspector.ScopeRemoteObject=function(target,objectId,scopeRef,type,subtype,value,description,preview)
{WebInspector.RemoteObjectImpl.call(this,target,objectId,type,subtype,value,description,preview);this._scopeRef=scopeRef;this._savedScopeProperties=undefined;};WebInspector.ScopeRemoteObject.prototype={doGetProperties:function(ownProperties,accessorPropertiesOnly,generatePreview,callback)
{if(accessorPropertiesOnly){callback([],[]);return;}
if(this._savedScopeProperties){callback(this._savedScopeProperties.slice(),[]);return;}
function wrappedCallback(properties,internalProperties)
{if(this._scopeRef&&Array.isArray(properties))
this._savedScopeProperties=properties.slice();callback(properties,internalProperties);}
generatePreview=true;WebInspector.RemoteObjectImpl.prototype.doGetProperties.call(this,ownProperties,accessorPropertiesOnly,generatePreview,wrappedCallback.bind(this));},doSetObjectPropertyValue:function(result,name,callback)
{this._debuggerModel.setVariableValue(this._scopeRef.number,(name.value),WebInspector.RemoteObject.toCallArgument(result),this._scopeRef.callFrameId,this._scopeRef.functionId,setVariableValueCallback.bind(this));function setVariableValueCallback(error)
{if(error){callback(error);return;}
if(this._savedScopeProperties){for(var i=0;i<this._savedScopeProperties.length;i++){if(this._savedScopeProperties[i].name===name)
this._savedScopeProperties[i].value=this._target.runtimeModel.createRemoteObject(result);}}
callback();}},__proto__:WebInspector.RemoteObjectImpl.prototype};WebInspector.ScopeRef=function(number,callFrameId,functionId)
{this.number=number;this.callFrameId=callFrameId;this.functionId=functionId;}
WebInspector.RemoteObjectProperty=function(name,value,enumerable,writable,isOwn,wasThrown,symbol,synthetic)
{this.name=name;if(value!==null)
this.value=value;this.enumerable=typeof enumerable!=="undefined"?enumerable:true;this.writable=typeof writable!=="undefined"?writable:true;this.isOwn=!!isOwn;this.wasThrown=!!wasThrown;if(symbol)
this.symbol=symbol;this.synthetic=!!synthetic;}
WebInspector.RemoteObjectProperty.prototype={isAccessorProperty:function()
{return!!(this.getter||this.setter);}};WebInspector.LocalJSONObject=function(value)
{WebInspector.RemoteObject.call(this);this._value=value;}
WebInspector.LocalJSONObject.prototype={get description()
{if(this._cachedDescription)
return this._cachedDescription;function formatArrayItem(property)
{return this._formatValue(property.value);}
function formatObjectItem(property)
{var name=property.name;if(/^\s|\s$|^$|\n/.test(name))
name="\""+name.replace(/\n/g,"\u21B5")+"\"";return name+": "+this._formatValue(property.value);}
if(this.type==="object"){switch(this.subtype){case"array":this._cachedDescription=this._concatenate("[","]",formatArrayItem.bind(this));break;case"date":this._cachedDescription=""+this._value;break;case"null":this._cachedDescription="null";break;default:this._cachedDescription=this._concatenate("{","}",formatObjectItem.bind(this));}}else{this._cachedDescription=String(this._value);}
return this._cachedDescription;},_formatValue:function(value)
{if(!value)
return"undefined";var description=value.description||"";if(value.type==="string")
return"\""+description.replace(/\n/g,"\u21B5")+"\"";return description;},_concatenate:function(prefix,suffix,formatProperty)
{var previewChars=100;var buffer=prefix;var children=this._children();for(var i=0;i<children.length;++i){var itemDescription=formatProperty(children[i]);if(buffer.length+itemDescription.length>previewChars){buffer+=",\u2026";break;}
if(i)
buffer+=", ";buffer+=itemDescription;}
buffer+=suffix;return buffer;},get type()
{return typeof this._value;},get subtype()
{if(this._value===null)
return"null";if(Array.isArray(this._value))
return"array";if(this._value instanceof Date)
return"date";return undefined;},get hasChildren()
{if((typeof this._value!=="object")||(this._value===null))
return false;return!!Object.keys((this._value)).length;},getOwnProperties:function(callback)
{callback(this._children(),null);},getAllProperties:function(accessorPropertiesOnly,callback)
{if(accessorPropertiesOnly)
callback([],null);else
callback(this._children(),null);},_children:function()
{if(!this.hasChildren)
return[];var value=(this._value);function buildProperty(propName)
{var propValue=value[propName];if(!(propValue instanceof WebInspector.RemoteObject))
propValue=WebInspector.RemoteObject.fromLocalObject(propValue);return new WebInspector.RemoteObjectProperty(propName,propValue);}
if(!this._cachedChildren)
this._cachedChildren=Object.keys(value).map(buildProperty);return this._cachedChildren;},isError:function()
{return false;},arrayLength:function()
{return Array.isArray(this._value)?this._value.length:0;},callFunction:function(functionDeclaration,args,callback)
{var target=(this._value);var rawArgs=args?args.map(function(arg){return arg.value;}):[];var result;var wasThrown=false;try{result=functionDeclaration.apply(target,rawArgs);}catch(e){wasThrown=true;}
if(!callback)
return;callback(WebInspector.RemoteObject.fromLocalObject(result),wasThrown);},callFunctionJSON:function(functionDeclaration,args,callback)
{var target=(this._value);var rawArgs=args?args.map(function(arg){return arg.value;}):[];var result;try{result=functionDeclaration.apply(target,rawArgs);}catch(e){result=null;}
callback(result);},__proto__:WebInspector.RemoteObject.prototype}
WebInspector.RemoteArray=function(object)
{this._object=object;};WebInspector.RemoteArray.objectAsArray=function(object)
{if(!object||object.type!=="object"||object.subtype!=="array")
throw new Error("Object is empty or not an array");return new WebInspector.RemoteArray(object);}
WebInspector.RemoteArray.createFromRemoteObjects=function(objects)
{if(!objects.length)
throw new Error("Input array is empty");var objectArguments=[];for(var i=0;i<objects.length;++i)
objectArguments.push(WebInspector.RemoteObject.toCallArgument(objects[i]))
return objects[0].callFunctionPromise(createArray,objectArguments).then(returnRemoteArray);function createArray()
{if(arguments.length>1)
return new Array(arguments);return[arguments[0]];}
function returnRemoteArray(result)
{if(result.wasThrown||!result.object)
throw new Error("Call function throws exceptions or returns empty value");return WebInspector.RemoteArray.objectAsArray(result.object);}}
WebInspector.RemoteArray.prototype={at:function(index)
{if(index<0||index>this._object.arrayLength())
throw new Error("Out of range");return this._object.callFunctionPromise(at,[WebInspector.RemoteObject.toCallArgument(index)]).then(assertCallFunctionResult);function at(index)
{return this[index];}
function assertCallFunctionResult(result)
{if(result.wasThrown||!result.object)
throw new Error("Exception in callFunction or result value is empty");return result.object;}},length:function()
{return this._object.arrayLength();},map:function(func)
{var promises=[];for(var i=0;i<this.length();++i)
promises.push(this.at(i).then(func));return Promise.all(promises);},object:function()
{return this._object;}}
WebInspector.RemoteFunction=function(object)
{this._object=object;}
WebInspector.RemoteFunction.objectAsFunction=function(object)
{if(!object||object.type!=="function")
throw new Error("Object is empty or not a function");return new WebInspector.RemoteFunction(object);}
WebInspector.RemoteFunction.prototype={targetFunction:function()
{return this._object.getOwnPropertiesPromise().then(targetFunction.bind(this));function targetFunction(ownProperties)
{if(!ownProperties.internalProperties)
return this._object;var internalProperties=ownProperties.internalProperties;for(var property of internalProperties){if(property.name==="[[TargetFunction]]")
return property.value;}
return this._object;}},targetFunctionDetails:function()
{return this.targetFunction().then(functionDetails.bind(this));function functionDetails(targetFunction)
{var boundReleaseFunctionDetails=releaseTargetFunction.bind(null,this._object!==targetFunction?targetFunction:null);return targetFunction.functionDetailsPromise().then(boundReleaseFunctionDetails);}
function releaseTargetFunction(targetFunction,functionDetails)
{if(targetFunction)
targetFunction.release();return functionDetails;}},object:function()
{return this._object;}}
WebInspector.MapEntryLocalJSONObject=function(value)
{WebInspector.LocalJSONObject.call(this,value);}
WebInspector.MapEntryLocalJSONObject.prototype={get description()
{if(!this._cachedDescription){var children=this._children();this._cachedDescription="{"+this._formatValue(children[0].value)+" => "+this._formatValue(children[1].value)+"}";}
return this._cachedDescription;},__proto__:WebInspector.LocalJSONObject.prototype};WebInspector.Resource=function(target,request,url,documentURL,frameId,loaderId,type,mimeType,isHidden)
{WebInspector.SDKObject.call(this,target);this._request=request;this.url=url;this._documentURL=documentURL;this._frameId=frameId;this._loaderId=loaderId;this._type=type||WebInspector.resourceTypes.Other;this._mimeType=mimeType;this._isHidden=isHidden;this._content;this._contentEncoded;this._pendingContentCallbacks=[];if(this._request&&!this._request.finished)
this._request.addEventListener(WebInspector.NetworkRequest.Events.FinishedLoading,this._requestFinished,this);}
WebInspector.Resource.contentAsDataURL=function(content,mimeType,contentEncoded,charset)
{const maxDataUrlSize=1024*1024;if(content===null||content.length>maxDataUrlSize)
return null;return"data:"+mimeType+(charset?";charset="+charset:"")+(contentEncoded?";base64":"")+","+content;}
WebInspector.Resource.populateImageSource=function(url,mimeType,contentProvider,image)
{function onResourceContent(content)
{var imageSrc=WebInspector.Resource.contentAsDataURL(content,mimeType,true);if(imageSrc===null)
imageSrc=url;image.src=imageSrc;}
contentProvider.requestContent(onResourceContent);}
WebInspector.Resource.prototype={get request()
{return this._request;},get url()
{return this._url;},set url(x)
{this._url=x;this._parsedURL=new WebInspector.ParsedURL(x);},get parsedURL()
{return this._parsedURL;},get documentURL()
{return this._documentURL;},get frameId()
{return this._frameId;},get loaderId()
{return this._loaderId;},get displayName()
{return this._parsedURL.displayName;},resourceType:function()
{return this._request?this._request.resourceType():this._type;},get mimeType()
{return this._request?this._request.mimeType:this._mimeType;},get content()
{return this._content;},get contentEncoded()
{return this._contentEncoded;},contentURL:function()
{return this._url;},contentType:function()
{if(this.resourceType()===WebInspector.resourceTypes.Document&&this.mimeType.indexOf("javascript")!==-1)
return WebInspector.resourceTypes.Script;return this.resourceType();},requestContent:function(callback)
{if(typeof this._content!=="undefined"){callback(this._content);return;}
this._pendingContentCallbacks.push(callback);if(!this._request||this._request.finished)
this._innerRequestContent();},canonicalMimeType:function()
{return this.contentType().canonicalMimeType()||this.mimeType;},searchInContent:function(query,caseSensitive,isRegex,callback)
{function callbackWrapper(error,searchMatches)
{callback(searchMatches||[]);}
if(this.frameId)
this.target().pageAgent().searchInResource(this.frameId,this.url,query,caseSensitive,isRegex,callbackWrapper);else
callback([]);},populateImageSource:function(image)
{WebInspector.Resource.populateImageSource(this._url,this._mimeType,this,image);},_requestFinished:function()
{this._request.removeEventListener(WebInspector.NetworkRequest.Events.FinishedLoading,this._requestFinished,this);if(this._pendingContentCallbacks.length)
this._innerRequestContent();},_innerRequestContent:function()
{if(this._contentRequested)
return;this._contentRequested=true;function contentLoaded(error,content,contentEncoded)
{if(error||content===null){replyWithContent.call(this,null,false);return;}
replyWithContent.call(this,content,contentEncoded);}
function replyWithContent(content,contentEncoded)
{this._content=content;this._contentEncoded=contentEncoded;var callbacks=this._pendingContentCallbacks.slice();for(var i=0;i<callbacks.length;++i)
callbacks[i](this._content);this._pendingContentCallbacks.length=0;delete this._contentRequested;}
function resourceContentLoaded(error,content,contentEncoded)
{contentLoaded.call(this,error,content,contentEncoded);}
if(this.request){this.request.requestContent(requestContentLoaded.bind(this));return;}
function requestContentLoaded(content)
{contentLoaded.call(this,null,content,this.request.contentEncoded);}
this.target().pageAgent().getResourceContent(this.frameId,this.url,resourceContentLoaded.bind(this));},isHidden:function()
{return!!this._isHidden;},hasTextContent:function()
{if(this._type.isTextType())
return true;if(this._type===WebInspector.resourceTypes.Other)
return!!this._content&&!this._contentEncoded;return false;},__proto__:WebInspector.SDKObject.prototype};WebInspector.ResourceTreeModel=function(target)
{WebInspector.SDKModel.call(this,WebInspector.ResourceTreeModel,target);target.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestFinished,this._onRequestFinished,this);target.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.RequestUpdateDropped,this._onRequestUpdateDropped,this);this._agent=target.pageAgent();this._agent.enable();this._fetchResourceTree();target.registerPageDispatcher(new WebInspector.PageDispatcher(this));this._securityOriginFrameCount={};this._inspectedPageURL="";this._pendingReloadOptions=null;this._reloadSuspensionCount=0;}
WebInspector.ResourceTreeModel.EventTypes={FrameAdded:"FrameAdded",FrameNavigated:"FrameNavigated",FrameDetached:"FrameDetached",FrameResized:"FrameResized",FrameWillNavigate:"FrameWillNavigate",MainFrameNavigated:"MainFrameNavigated",ResourceAdded:"ResourceAdded",WillLoadCachedResources:"WillLoadCachedResources",CachedResourcesLoaded:"CachedResourcesLoaded",DOMContentLoaded:"DOMContentLoaded",Load:"Load",PageReloadRequested:"PageReloadRequested",WillReloadPage:"WillReloadPage",InspectedURLChanged:"InspectedURLChanged",SecurityOriginAdded:"SecurityOriginAdded",SecurityOriginRemoved:"SecurityOriginRemoved",ScreencastFrame:"ScreencastFrame",ScreencastVisibilityChanged:"ScreencastVisibilityChanged",ColorPicked:"ColorPicked"}
WebInspector.ResourceTreeModel.frames=function()
{var result=[];for(var target of WebInspector.targetManager.targets())
result=result.concat(Object.values(target.resourceTreeModel._frames));return result;}
WebInspector.ResourceTreeModel.resourceForURL=function(url)
{for(var target of WebInspector.targetManager.targets()){var mainFrame=target.resourceTreeModel.mainFrame;var result=mainFrame?mainFrame.resourceForURL(url):null;if(result)
return result;}
return null;}
WebInspector.ResourceTreeModel.prototype={_fetchResourceTree:function()
{this._frames={};this._cachedResourcesProcessed=false;this._agent.getResourceTree(this._processCachedResources.bind(this));},_processCachedResources:function(error,mainFramePayload)
{if(error){this._cachedResourcesProcessed=true;return;}
this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources);this._inspectedPageURL=mainFramePayload.frame.url;if(this.target().isPage())
this._addFramesRecursively(null,mainFramePayload);else
this._addSecurityOrigin(mainFramePayload.frame.securityOrigin);this._dispatchInspectedURLChanged();this._cachedResourcesProcessed=true;this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded);},inspectedPageURL:function()
{return this._inspectedPageURL;},inspectedPageDomain:function()
{var parsedURL=this._inspectedPageURL?this._inspectedPageURL.asParsedURL():null;return parsedURL?parsedURL.host:"";},cachedResourcesLoaded:function()
{return this._cachedResourcesProcessed;},_dispatchInspectedURLChanged:function()
{InspectorFrontendHost.inspectedURLChanged(this._inspectedPageURL);this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.InspectedURLChanged,this._inspectedPageURL);},_addFrame:function(frame,aboutToNavigate)
{this._frames[frame.id]=frame;if(frame.isMainFrame())
this.mainFrame=frame;this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.FrameAdded,frame);if(!aboutToNavigate)
this._addSecurityOrigin(frame.securityOrigin);},_addSecurityOrigin:function(securityOrigin)
{if(!this._securityOriginFrameCount[securityOrigin]){this._securityOriginFrameCount[securityOrigin]=1;this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.SecurityOriginAdded,securityOrigin);return;}
this._securityOriginFrameCount[securityOrigin]+=1;},_removeSecurityOrigin:function(securityOrigin)
{if(typeof securityOrigin==="undefined")
return;if(this._securityOriginFrameCount[securityOrigin]===1){delete this._securityOriginFrameCount[securityOrigin];this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.SecurityOriginRemoved,securityOrigin);return;}
this._securityOriginFrameCount[securityOrigin]-=1;},securityOrigins:function()
{return Object.keys(this._securityOriginFrameCount);},_handleMainFrameDetached:function(mainFrame)
{function removeOriginForFrame(frame)
{for(var i=0;i<frame.childFrames.length;++i)
removeOriginForFrame.call(this,frame.childFrames[i]);if(!frame.isMainFrame())
this._removeSecurityOrigin(frame.securityOrigin);}
removeOriginForFrame.call(this,mainFrame);},_frameAttached:function(frameId,parentFrameId)
{if(!this._cachedResourcesProcessed&&parentFrameId)
return null;if(this._frames[frameId])
return null;var parentFrame=parentFrameId?this._frames[parentFrameId]:null;var frame=new WebInspector.ResourceTreeFrame(this,parentFrame,frameId);if(frame.isMainFrame()&&this.mainFrame){this._handleMainFrameDetached(this.mainFrame);this._frameDetached(this.mainFrame.id);}
this._addFrame(frame,true);return frame;},_frameNavigated:function(framePayload)
{if(!this._cachedResourcesProcessed&&framePayload.parentId)
return;var frame=this._frames[framePayload.id];if(!frame){console.assert(!framePayload.parentId,"Main frame shouldn't have parent frame id.");frame=this._frameAttached(framePayload.id,framePayload.parentId||"");console.assert(frame);}
this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.FrameWillNavigate,frame);this._removeSecurityOrigin(frame.securityOrigin);frame._navigate(framePayload);var addedOrigin=frame.securityOrigin;if(frame.isMainFrame())
this._inspectedPageURL=frame.url;this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated,frame);if(frame.isMainFrame())
this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,frame);if(addedOrigin)
this._addSecurityOrigin(addedOrigin);var resources=frame.resources();for(var i=0;i<resources.length;++i)
this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded,resources[i]);if(frame.isMainFrame())
this._dispatchInspectedURLChanged();},_frameDetached:function(frameId)
{if(!this._cachedResourcesProcessed)
return;var frame=this._frames[frameId];if(!frame)
return;this._removeSecurityOrigin(frame.securityOrigin);if(frame.parentFrame)
frame.parentFrame._removeChildFrame(frame);else
frame._remove();},_onRequestFinished:function(event)
{if(!this._cachedResourcesProcessed)
return;var request=(event.data);if(request.failed||request.resourceType()===WebInspector.resourceTypes.XHR)
return;var frame=this._frames[request.frameId];if(frame)
frame._addRequest(request);},_onRequestUpdateDropped:function(event)
{if(!this._cachedResourcesProcessed)
return;var frameId=event.data.frameId;var frame=this._frames[frameId];if(!frame)
return;var url=event.data.url;if(frame._resourcesMap[url])
return;var resource=new WebInspector.Resource(this.target(),null,url,frame.url,frameId,event.data.loaderId,WebInspector.resourceTypes[event.data.resourceType],event.data.mimeType);frame.addResource(resource);},frameForId:function(frameId)
{return this._frames[frameId];},forAllResources:function(callback)
{if(this.mainFrame)
return this.mainFrame._callForFrameResources(callback);return false;},frames:function()
{return Object.values(this._frames);},resourceForURL:function(url)
{return this.mainFrame?this.mainFrame.resourceForURL(url):null;},_addFramesRecursively:function(parentFrame,frameTreePayload)
{var framePayload=frameTreePayload.frame;var frame=new WebInspector.ResourceTreeFrame(this,parentFrame,framePayload.id,framePayload);this._addFrame(frame);var frameResource=this._createResourceFromFramePayload(framePayload,framePayload.url,WebInspector.resourceTypes.Document,framePayload.mimeType);if(frame.isMainFrame())
this._inspectedPageURL=frameResource.url;frame.addResource(frameResource);for(var i=0;frameTreePayload.childFrames&&i<frameTreePayload.childFrames.length;++i)
this._addFramesRecursively(frame,frameTreePayload.childFrames[i]);for(var i=0;i<frameTreePayload.resources.length;++i){var subresource=frameTreePayload.resources[i];var resource=this._createResourceFromFramePayload(framePayload,subresource.url,WebInspector.resourceTypes[subresource.type],subresource.mimeType);frame.addResource(resource);}},_createResourceFromFramePayload:function(frame,url,type,mimeType)
{return new WebInspector.Resource(this.target(),null,url,frame.url,frame.id,frame.loaderId,type,mimeType);},suspendReload:function()
{this._reloadSuspensionCount++;},resumeReload:function()
{this._reloadSuspensionCount--;console.assert(this._reloadSuspensionCount>=0,"Unbalanced call to ResourceTreeModel.resumeReload()");if(!this._reloadSuspensionCount&&this._pendingReloadOptions)
this.reloadPage.apply(this,this._pendingReloadOptions);},reloadPage:function(ignoreCache,scriptToEvaluateOnLoad)
{if(!this._pendingReloadOptions)
this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.PageReloadRequested);if(this._reloadSuspensionCount){this._pendingReloadOptions=[ignoreCache,scriptToEvaluateOnLoad];return;}
this._pendingReloadOptions=null;this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.WillReloadPage);this._agent.reload(ignoreCache,scriptToEvaluateOnLoad);},__proto__:WebInspector.SDKModel.prototype}
WebInspector.ResourceTreeFrame=function(model,parentFrame,frameId,payload)
{this._model=model;this._parentFrame=parentFrame;this._id=frameId;this._url="";if(payload){this._loaderId=payload.loaderId;this._name=payload.name;this._url=payload.url;this._securityOrigin=payload.securityOrigin;this._mimeType=payload.mimeType;}
this._childFrames=[];this._resourcesMap={};if(this._parentFrame)
this._parentFrame._childFrames.push(this);}
WebInspector.ResourceTreeFrame.fromScript=function(script)
{var executionContext=script.executionContext();if(!executionContext||!executionContext.frameId)
return null;return script.target().resourceTreeModel.frameForId(executionContext.frameId);}
WebInspector.ResourceTreeFrame.fromStyleSheet=function(header)
{return header.target().resourceTreeModel.frameForId(header.frameId);}
WebInspector.ResourceTreeFrame.fromResource=function(resource)
{return resource.target().resourceTreeModel.frameForId(resource.frameId);}
WebInspector.ResourceTreeFrame.prototype={target:function()
{return this._model.target();},get id()
{return this._id;},get name()
{return this._name||"";},get url()
{return this._url;},get securityOrigin()
{return this._securityOrigin;},get loaderId()
{return this._loaderId;},get parentFrame()
{return this._parentFrame;},get childFrames()
{return this._childFrames;},isMainFrame:function()
{return!this._parentFrame;},_navigate:function(framePayload)
{this._loaderId=framePayload.loaderId;this._name=framePayload.name;this._url=framePayload.url;this._securityOrigin=framePayload.securityOrigin;this._mimeType=framePayload.mimeType;var mainResource=this._resourcesMap[this._url];this._resourcesMap={};this._removeChildFrames();if(mainResource&&mainResource.loaderId===this._loaderId)
this.addResource(mainResource);},get mainResource()
{return this._resourcesMap[this._url];},_removeChildFrame:function(frame)
{this._childFrames.remove(frame);frame._remove();},_removeChildFrames:function()
{var frames=this._childFrames;this._childFrames=[];for(var i=0;i<frames.length;++i)
frames[i]._remove();},_remove:function()
{this._removeChildFrames();delete this._model._frames[this.id];this._model.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.FrameDetached,this);},addResource:function(resource)
{if(this._resourcesMap[resource.url]===resource){return;}
this._resourcesMap[resource.url]=resource;this._model.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded,resource);},_addRequest:function(request)
{var resource=this._resourcesMap[request.url];if(resource&&resource.request===request){return resource;}
resource=new WebInspector.Resource(this.target(),request,request.url,request.documentURL,request.frameId,request.loaderId,request.resourceType(),request.mimeType);this._resourcesMap[resource.url]=resource;this._model.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded,resource);return resource;},resources:function()
{var result=[];for(var url in this._resourcesMap)
result.push(this._resourcesMap[url]);return result;},resourceForURL:function(url)
{var result;function filter(resource)
{if(resource.url===url){result=resource;return true;}}
this._callForFrameResources(filter);return result||null;},_callForFrameResources:function(callback)
{for(var url in this._resourcesMap){if(callback(this._resourcesMap[url]))
return true;}
for(var i=0;i<this._childFrames.length;++i){if(this._childFrames[i]._callForFrameResources(callback))
return true;}
return false;},displayName:function()
{if(!this._parentFrame)
return WebInspector.UIString("top");var subtitle=new WebInspector.ParsedURL(this._url).displayName;if(subtitle){if(!this._name)
return subtitle;return this._name+" ("+subtitle+")";}
return WebInspector.UIString("<iframe>");}}
WebInspector.PageDispatcher=function(resourceTreeModel)
{this._resourceTreeModel=resourceTreeModel;}
WebInspector.PageDispatcher.prototype={domContentEventFired:function(time)
{this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.DOMContentLoaded,time);},loadEventFired:function(time)
{this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.Load,time);},frameAttached:function(frameId,parentFrameId)
{this._resourceTreeModel._frameAttached(frameId,parentFrameId);},frameNavigated:function(frame)
{this._resourceTreeModel._frameNavigated(frame);},frameDetached:function(frameId)
{this._resourceTreeModel._frameDetached(frameId);},frameStartedLoading:function(frameId)
{},frameStoppedLoading:function(frameId)
{},frameScheduledNavigation:function(frameId,delay)
{},frameClearedScheduledNavigation:function(frameId)
{},frameResized:function()
{this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.FrameResized,null);},javascriptDialogOpening:function(message,dialogType)
{},javascriptDialogClosed:function(result)
{},screencastFrame:function(data,metadata,sessionId)
{this._resourceTreeModel._agent.screencastFrameAck(sessionId);this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.ScreencastFrame,{data:data,metadata:metadata});},screencastVisibilityChanged:function(visible)
{this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.ScreencastVisibilityChanged,{visible:visible});},colorPicked:function(color)
{this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.ColorPicked,color);},interstitialShown:function()
{},interstitialHidden:function()
{}};function SourceMapV3()
{this.version;this.file;this.sources;this.sections;this.mappings;this.sourceRoot;}
SourceMapV3.Section=function()
{this.map;this.offset;}
SourceMapV3.Offset=function()
{this.line;this.column;}
WebInspector.SourceMap=function(compiledURL,sourceMappingURL,payload)
{if(!WebInspector.SourceMap.prototype._base64Map){const base64Digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";WebInspector.SourceMap.prototype._base64Map={};for(var i=0;i<base64Digits.length;++i)
WebInspector.SourceMap.prototype._base64Map[base64Digits.charAt(i)]=i;}
this._compiledURL=compiledURL;this._sourceMappingURL=sourceMappingURL;this._reverseMappingsBySourceURL=new Map();this._mappings=[];this._sources={};this._sourceContentByURL={};this._parseMappingPayload(payload);}
WebInspector.SourceMap.load=function(sourceMapURL,compiledURL,callback)
{var parsedURL=new WebInspector.ParsedURL(sourceMapURL);if(parsedURL.isDataURL()){var xhr=new XMLHttpRequest();xhr.open("GET",sourceMapURL,false);xhr.send(null);contentLoaded(xhr.status,{},xhr.responseText);return;}
WebInspector.multitargetNetworkManager.loadResource(sourceMapURL,contentLoaded);function contentLoaded(statusCode,headers,content)
{if(!content||statusCode>=400){callback(null);return;}
if(content.slice(0,3)===")]}")
content=content.substring(content.indexOf('\n'));try{var payload=(JSON.parse(content));var baseURL=sourceMapURL.startsWith("data:")?compiledURL:sourceMapURL;callback(new WebInspector.SourceMap(compiledURL,baseURL,payload));}catch(e){console.error(e.message);WebInspector.console.error("Failed to parse SourceMap: "+sourceMapURL);callback(null);}}}
WebInspector.SourceMap.prototype={url:function()
{return this._sourceMappingURL;},sources:function()
{return Object.keys(this._sources);},sourceContent:function(sourceURL)
{return this._sourceContentByURL[sourceURL];},sourceContentProvider:function(sourceURL,contentType)
{var sourceContent=this.sourceContent(sourceURL);if(sourceContent)
return new WebInspector.StaticContentProvider(contentType,sourceContent);return new WebInspector.CompilerSourceMappingContentProvider(sourceURL,contentType);},_parseMappingPayload:function(mappingPayload)
{if(mappingPayload.sections)
this._parseSections(mappingPayload.sections);else
this._parseMap(mappingPayload,0,0);},_parseSections:function(sections)
{for(var i=0;i<sections.length;++i){var section=sections[i];this._parseMap(section.map,section.offset.line,section.offset.column);}},findEntry:function(lineNumber,columnNumber)
{var first=0;var count=this._mappings.length;while(count>1){var step=count>>1;var middle=first+step;var mapping=this._mappings[middle];if(lineNumber<mapping.lineNumber||(lineNumber===mapping.lineNumber&&columnNumber<mapping.columnNumber))
count=step;else{first=middle;count-=step;}}
var entry=this._mappings[first];if(!first&&entry&&(lineNumber<entry.lineNumber||(lineNumber===entry.lineNumber&&columnNumber<entry.columnNumber)))
return null;return entry;},firstSourceLineMapping:function(sourceURL,lineNumber)
{var mappings=this._reversedMappings(sourceURL);var index=mappings.lowerBound(lineNumber,lineComparator);if(index>=mappings.length||mappings[index].sourceLineNumber!==lineNumber)
return null;return mappings[index];function lineComparator(lineNumber,mapping)
{return lineNumber-mapping.sourceLineNumber;}},_reversedMappings:function(sourceURL)
{var mappings=this._reverseMappingsBySourceURL.get(sourceURL);if(!mappings)
return[];if(!mappings._sorted){mappings.sort(sourceMappingComparator);mappings._sorted=true;}
return mappings;function sourceMappingComparator(a,b)
{if(a.sourceLineNumber!==b.sourceLineNumber)
return a.sourceLineNumber-b.sourceLineNumber;return a.sourceColumnNumber-b.sourceColumnNumber;}},_parseMap:function(map,lineNumber,columnNumber)
{var sourceIndex=0;var sourceLineNumber=0;var sourceColumnNumber=0;var nameIndex=0;var sources=[];var sourceRoot=map.sourceRoot||"";if(sourceRoot&&!sourceRoot.endsWith("/"))
sourceRoot+="/";for(var i=0;i<map.sources.length;++i){var href=sourceRoot+map.sources[i];var url=WebInspector.ParsedURL.completeURL(this._sourceMappingURL,href)||href;var hasSource=map.sourcesContent&&map.sourcesContent[i];if(url===this._compiledURL&&hasSource)
url+=WebInspector.UIString(" [sm]");sources.push(url);this._sources[url]=true;if(hasSource)
this._sourceContentByURL[url]=map.sourcesContent[i];}
var stringCharIterator=new WebInspector.SourceMap.StringCharIterator(map.mappings);var sourceURL=sources[sourceIndex];while(true){if(stringCharIterator.peek()===",")
stringCharIterator.next();else{while(stringCharIterator.peek()===";"){lineNumber+=1;columnNumber=0;stringCharIterator.next();}
if(!stringCharIterator.hasNext())
break;}
columnNumber+=this._decodeVLQ(stringCharIterator);if(!stringCharIterator.hasNext()||this._isSeparator(stringCharIterator.peek())){this._mappings.push(new WebInspector.SourceMap.Entry(lineNumber,columnNumber));continue;}
var sourceIndexDelta=this._decodeVLQ(stringCharIterator);if(sourceIndexDelta){sourceIndex+=sourceIndexDelta;sourceURL=sources[sourceIndex];}
sourceLineNumber+=this._decodeVLQ(stringCharIterator);sourceColumnNumber+=this._decodeVLQ(stringCharIterator);if(!this._isSeparator(stringCharIterator.peek()))
nameIndex+=this._decodeVLQ(stringCharIterator);this._mappings.push(new WebInspector.SourceMap.Entry(lineNumber,columnNumber,sourceURL,sourceLineNumber,sourceColumnNumber));}
for(var i=0;i<this._mappings.length;++i){var mapping=this._mappings[i];var url=mapping.sourceURL;if(!url)
continue;if(!this._reverseMappingsBySourceURL.has(url))
this._reverseMappingsBySourceURL.set(url,[]);var reverseMappings=this._reverseMappingsBySourceURL.get(url);reverseMappings.push(mapping);}},_isSeparator:function(char)
{return char===","||char===";";},_decodeVLQ:function(stringCharIterator)
{var result=0;var shift=0;do{var digit=this._base64Map[stringCharIterator.next()];result+=(digit&this._VLQ_BASE_MASK)<<shift;shift+=this._VLQ_BASE_SHIFT;}while(digit&this._VLQ_CONTINUATION_MASK);var negative=result&1;result>>=1;return negative?-result:result;},_VLQ_BASE_SHIFT:5,_VLQ_BASE_MASK:(1<<5)-1,_VLQ_CONTINUATION_MASK:1<<5}
WebInspector.SourceMap.StringCharIterator=function(string)
{this._string=string;this._position=0;}
WebInspector.SourceMap.StringCharIterator.prototype={next:function()
{return this._string.charAt(this._position++);},peek:function()
{return this._string.charAt(this._position);},hasNext:function()
{return this._position<this._string.length;}}
WebInspector.SourceMap.Entry=function(lineNumber,columnNumber,sourceURL,sourceLineNumber,sourceColumnNumber)
{this.lineNumber=lineNumber;this.columnNumber=columnNumber;this.sourceURL=sourceURL;this.sourceLineNumber=sourceLineNumber;this.sourceColumnNumber=sourceColumnNumber;};WebInspector.NetworkManager=function(target)
{WebInspector.SDKModel.call(this,WebInspector.NetworkManager,target);this._dispatcher=new WebInspector.NetworkDispatcher(this);this._target=target;this._networkAgent=target.networkAgent();target.registerNetworkDispatcher(this._dispatcher);if(WebInspector.moduleSetting("cacheDisabled").get())
this._networkAgent.setCacheDisabled(true);if(WebInspector.moduleSetting("monitoringXHREnabled").get())
this._networkAgent.setMonitoringXHREnabled(true);this._networkAgent.enable();this._certificateDetailsCache=new Map();WebInspector.moduleSetting("cacheDisabled").addChangeListener(this._cacheDisabledSettingChanged,this);}
WebInspector.NetworkManager.EventTypes={RequestStarted:"RequestStarted",RequestUpdated:"RequestUpdated",RequestFinished:"RequestFinished",RequestUpdateDropped:"RequestUpdateDropped",ResponseReceived:"ResponseReceived"}
WebInspector.NetworkManager._MIMETypes={"text/html":{"document":true},"text/xml":{"document":true},"text/plain":{"document":true},"application/xhtml+xml":{"document":true},"image/svg+xml":{"document":true},"text/css":{"stylesheet":true},"text/xsl":{"stylesheet":true},"text/vtt":{"texttrack":true},}
WebInspector.NetworkManager.Conditions;WebInspector.NetworkManager.prototype={inflightRequestForURL:function(url)
{return this._dispatcher._inflightRequestsByURL[url];},_cacheDisabledSettingChanged:function(event)
{var enabled=(event.data);this._networkAgent.setCacheDisabled(enabled);},dispose:function()
{WebInspector.moduleSetting("cacheDisabled").removeChangeListener(this._cacheDisabledSettingChanged,this);},certificateDetailsPromise:function(certificateId)
{var cachedPromise=this._certificateDetailsCache.get(certificateId);if(cachedPromise)
return cachedPromise;function executor(resolve,reject){function innerCallback(error,certificateDetails)
{if(error){console.error("Unable to get certificate details from the browser (for certificate ID ",certificateId,"): ",error);reject();}else{resolve(certificateDetails);}}
this._networkAgent.getCertificateDetails(certificateId,innerCallback);}
var promise=new Promise(executor.bind(this));this._certificateDetailsCache.set(certificateId,promise);return promise;},__proto__:WebInspector.SDKModel.prototype}
WebInspector.NetworkDispatcher=function(manager)
{this._manager=manager;this._inflightRequestsById={};this._inflightRequestsByURL={};}
WebInspector.NetworkDispatcher.prototype={_headersMapToHeadersArray:function(headersMap)
{var result=[];for(var name in headersMap){var values=headersMap[name].split("\n");for(var i=0;i<values.length;++i)
result.push({name:name,value:values[i]});}
return result;},_updateNetworkRequestWithRequest:function(networkRequest,request)
{networkRequest.requestMethod=request.method;networkRequest.setRequestHeaders(this._headersMapToHeadersArray(request.headers));networkRequest.requestFormData=request.postData;networkRequest.setInitialPriority(request.initialPriority);networkRequest.mixedContentType=request.mixedContentType||NetworkAgent.RequestMixedContentType.None;},_updateNetworkRequestWithResponse:function(networkRequest,response)
{if(response.url&&networkRequest.url!==response.url)
networkRequest.url=response.url;networkRequest.mimeType=response.mimeType;networkRequest.statusCode=response.status;networkRequest.statusText=response.statusText;networkRequest.responseHeaders=this._headersMapToHeadersArray(response.headers);if(response.encodedDataLength>=0)
networkRequest.setTransferSize(response.encodedDataLength);if(response.headersText)
networkRequest.responseHeadersText=response.headersText;if(response.requestHeaders){networkRequest.setRequestHeaders(this._headersMapToHeadersArray(response.requestHeaders));networkRequest.setRequestHeadersText(response.requestHeadersText||"");}
networkRequest.connectionReused=response.connectionReused;networkRequest.connectionId=String(response.connectionId);if(response.remoteIPAddress)
networkRequest.setRemoteAddress(response.remoteIPAddress,response.remotePort||-1);if(response.fromServiceWorker)
networkRequest.fetchedViaServiceWorker=true;if(response.fromDiskCache)
networkRequest.setFromDiskCache();networkRequest.timing=response.timing;networkRequest.protocol=response.protocol;networkRequest.setSecurityState(response.securityState);if(!this._mimeTypeIsConsistentWithType(networkRequest)){var consoleModel=this._manager._target.consoleModel;consoleModel.addMessage(new WebInspector.ConsoleMessage(consoleModel.target(),WebInspector.ConsoleMessage.MessageSource.Network,WebInspector.ConsoleMessage.MessageLevel.Log,WebInspector.UIString("Resource interpreted as %s but transferred with MIME type %s: \"%s\".",networkRequest.resourceType().title(),networkRequest.mimeType,networkRequest.url),WebInspector.ConsoleMessage.MessageType.Log,"",0,0,networkRequest.requestId));}
if(response.securityDetails)
networkRequest.setSecurityDetails(response.securityDetails);},_mimeTypeIsConsistentWithType:function(networkRequest)
{if(networkRequest.hasErrorStatusCode()||networkRequest.statusCode===304||networkRequest.statusCode===204)
return true;var resourceType=networkRequest.resourceType();if(resourceType!==WebInspector.resourceTypes.Stylesheet&&resourceType!==WebInspector.resourceTypes.Document&&resourceType!==WebInspector.resourceTypes.TextTrack){return true;}
if(!networkRequest.mimeType)
return true;if(networkRequest.mimeType in WebInspector.NetworkManager._MIMETypes)
return resourceType.name()in WebInspector.NetworkManager._MIMETypes[networkRequest.mimeType];return false;},requestWillBeSent:function(requestId,frameId,loaderId,documentURL,request,time,wallTime,initiator,redirectResponse,resourceType)
{var networkRequest=this._inflightRequestsById[requestId];if(networkRequest){if(!redirectResponse)
return;this.responseReceived(requestId,frameId,loaderId,time,PageAgent.ResourceType.Other,redirectResponse);networkRequest=this._appendRedirect(requestId,time,request.url);}else
networkRequest=this._createNetworkRequest(requestId,frameId,loaderId,request.url,documentURL,initiator);networkRequest.hasNetworkData=true;this._updateNetworkRequestWithRequest(networkRequest,request);networkRequest.setIssueTime(time,wallTime);networkRequest.setResourceType(WebInspector.resourceTypes[resourceType]);this._startNetworkRequest(networkRequest);},requestServedFromCache:function(requestId)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;networkRequest.setFromMemoryCache();},responseReceived:function(requestId,frameId,loaderId,time,resourceType,response)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest){var eventData={};eventData.url=response.url;eventData.frameId=frameId;eventData.loaderId=loaderId;eventData.resourceType=resourceType;eventData.mimeType=response.mimeType;this._manager.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.RequestUpdateDropped,eventData);return;}
networkRequest.responseReceivedTime=time;networkRequest.setResourceType(WebInspector.resourceTypes[resourceType]);this._updateNetworkRequestWithResponse(networkRequest,response);this._updateNetworkRequest(networkRequest);this._manager.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.ResponseReceived,networkRequest);},dataReceived:function(requestId,time,dataLength,encodedDataLength)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;networkRequest.resourceSize+=dataLength;if(encodedDataLength!=-1)
networkRequest.increaseTransferSize(encodedDataLength);networkRequest.endTime=time;this._updateNetworkRequest(networkRequest);},loadingFinished:function(requestId,finishTime,encodedDataLength)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;this._finishNetworkRequest(networkRequest,finishTime,encodedDataLength);},loadingFailed:function(requestId,time,resourceType,localizedDescription,canceled,blockedReason)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;networkRequest.failed=true;networkRequest.setResourceType(WebInspector.resourceTypes[resourceType]);networkRequest.canceled=canceled;if(blockedReason){networkRequest.setBlockedReason(blockedReason);if(blockedReason===NetworkAgent.BlockedReason.Inspector){var consoleModel=this._manager._target.consoleModel;consoleModel.addMessage(new WebInspector.ConsoleMessage(consoleModel.target(),WebInspector.ConsoleMessage.MessageSource.Network,WebInspector.ConsoleMessage.MessageLevel.Warning,WebInspector.UIString("Request was blocked by DevTools: \"%s\".",networkRequest.url),WebInspector.ConsoleMessage.MessageType.Log,"",0,0,networkRequest.requestId));}}
networkRequest.localizedFailDescription=localizedDescription;this._finishNetworkRequest(networkRequest,time,-1);},webSocketCreated:function(requestId,requestURL)
{var networkRequest=new WebInspector.NetworkRequest(this._manager._target,requestId,requestURL,"","","",null);networkRequest.setResourceType(WebInspector.resourceTypes.WebSocket);this._startNetworkRequest(networkRequest);},webSocketWillSendHandshakeRequest:function(requestId,time,wallTime,request)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;networkRequest.requestMethod="GET";networkRequest.setRequestHeaders(this._headersMapToHeadersArray(request.headers));networkRequest.setIssueTime(time,wallTime);this._updateNetworkRequest(networkRequest);},webSocketHandshakeResponseReceived:function(requestId,time,response)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;networkRequest.statusCode=response.status;networkRequest.statusText=response.statusText;networkRequest.responseHeaders=this._headersMapToHeadersArray(response.headers);networkRequest.responseHeadersText=response.headersText;if(response.requestHeaders)
networkRequest.setRequestHeaders(this._headersMapToHeadersArray(response.requestHeaders));if(response.requestHeadersText)
networkRequest.setRequestHeadersText(response.requestHeadersText);networkRequest.responseReceivedTime=time;networkRequest.protocol="websocket";this._updateNetworkRequest(networkRequest);},webSocketFrameReceived:function(requestId,time,response)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;networkRequest.addFrame(response,time);networkRequest.responseReceivedTime=time;this._updateNetworkRequest(networkRequest);},webSocketFrameSent:function(requestId,time,response)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;networkRequest.addFrame(response,time,true);networkRequest.responseReceivedTime=time;this._updateNetworkRequest(networkRequest);},webSocketFrameError:function(requestId,time,errorMessage)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;networkRequest.addFrameError(errorMessage,time);networkRequest.responseReceivedTime=time;this._updateNetworkRequest(networkRequest);},webSocketClosed:function(requestId,time)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;this._finishNetworkRequest(networkRequest,time,-1);},eventSourceMessageReceived:function(requestId,time,eventName,eventId,data)
{var networkRequest=this._inflightRequestsById[requestId];if(!networkRequest)
return;networkRequest.addEventSourceMessage(time,eventName,eventId,data);},_appendRedirect:function(requestId,time,redirectURL)
{var originalNetworkRequest=this._inflightRequestsById[requestId];var previousRedirects=originalNetworkRequest.redirects||[];originalNetworkRequest.requestId=requestId+":redirected."+previousRedirects.length;delete originalNetworkRequest.redirects;if(previousRedirects.length>0)
originalNetworkRequest.redirectSource=previousRedirects[previousRedirects.length-1];this._finishNetworkRequest(originalNetworkRequest,time,-1);var newNetworkRequest=this._createNetworkRequest(requestId,originalNetworkRequest.frameId,originalNetworkRequest.loaderId,redirectURL,originalNetworkRequest.documentURL,originalNetworkRequest.initiator());newNetworkRequest.redirects=previousRedirects.concat(originalNetworkRequest);return newNetworkRequest;},_startNetworkRequest:function(networkRequest)
{this._inflightRequestsById[networkRequest.requestId]=networkRequest;this._inflightRequestsByURL[networkRequest.url]=networkRequest;this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.RequestStarted,networkRequest);},_updateNetworkRequest:function(networkRequest)
{this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.RequestUpdated,networkRequest);},_finishNetworkRequest:function(networkRequest,finishTime,encodedDataLength)
{networkRequest.endTime=finishTime;networkRequest.finished=true;if(encodedDataLength>=0)
networkRequest.setTransferSize(encodedDataLength);this._dispatchEventToListeners(WebInspector.NetworkManager.EventTypes.RequestFinished,networkRequest);delete this._inflightRequestsById[networkRequest.requestId];delete this._inflightRequestsByURL[networkRequest.url];},_dispatchEventToListeners:function(eventType,networkRequest)
{this._manager.dispatchEventToListeners(eventType,networkRequest);},_createNetworkRequest:function(requestId,frameId,loaderId,url,documentURL,initiator)
{return new WebInspector.NetworkRequest(this._manager._target,requestId,url,documentURL,frameId,loaderId,initiator);}}
WebInspector.MultitargetNetworkManager=function()
{WebInspector.Object.call(this);WebInspector.targetManager.observeTargets(this);this._blockedURLs=new Set();this._blockedSetting=WebInspector.moduleSetting("blockedURLs");this._blockedSetting.addChangeListener(this._updateBlockedURLs,this);this._blockedSetting.set([]);this._updateBlockedURLs();this._userAgentOverride="";this._agentsCapableOfEmulation=new Set();this._networkConditions={download:-1,upload:-1,latency:0};}
WebInspector.MultitargetNetworkManager.Events={ConditionsChanged:"ConditionsChanged",UserAgentChanged:"UserAgentChanged"}
WebInspector.MultitargetNetworkManager.prototype={targetAdded:function(target)
{var networkAgent=target.networkAgent();if(this._extraHeaders)
networkAgent.setExtraHTTPHeaders(this._extraHeaders);if(this._currentUserAgent())
networkAgent.setUserAgentOverride(this._currentUserAgent());for(var url of this._blockedURLs)
networkAgent.addBlockedURL(url);networkAgent.canEmulateNetworkConditions(callback.bind(this));function callback(error,canEmulate)
{if(error||!canEmulate)
return;this._agentsCapableOfEmulation.add(networkAgent);if(this.isThrottling())
this._updateNetworkConditions(networkAgent);}},targetRemoved:function(target)
{this._agentsCapableOfEmulation.delete(target.networkAgent());},isThrottling:function()
{return this._networkConditions.download>=0||this._networkConditions.upload>=0||this._networkConditions.latency>0;},isOffline:function()
{return!this._networkConditions.download&&!this._networkConditions.upload;},setNetworkConditions:function(conditions)
{this._networkConditions=conditions;for(var agent of this._agentsCapableOfEmulation)
this._updateNetworkConditions(agent);this.dispatchEventToListeners(WebInspector.MultitargetNetworkManager.Events.ConditionsChanged);},networkConditions:function()
{return this._networkConditions;},_updateNetworkConditions:function(networkAgent)
{var conditions=this._networkConditions;if(!this.isThrottling()){networkAgent.emulateNetworkConditions(false,0,0,0);}else{networkAgent.emulateNetworkConditions(this.isOffline(),conditions.latency,conditions.download<0?0:conditions.download,conditions.upload<0?0:conditions.upload);}},setExtraHTTPHeaders:function(headers)
{this._extraHeaders=headers;for(var target of WebInspector.targetManager.targets())
target.networkAgent().setExtraHTTPHeaders(this._extraHeaders);},_currentUserAgent:function()
{return this._customUserAgent?this._customUserAgent:this._userAgentOverride;},_updateUserAgentOverride:function()
{var userAgent=this._currentUserAgent();WebInspector.ResourceLoader.targetUserAgent=userAgent;for(var target of WebInspector.targetManager.targets())
target.networkAgent().setUserAgentOverride(userAgent);},setUserAgentOverride:function(userAgent)
{if(this._userAgentOverride===userAgent)
return;this._userAgentOverride=userAgent;if(!this._customUserAgent)
this._updateUserAgentOverride();this.dispatchEventToListeners(WebInspector.MultitargetNetworkManager.Events.UserAgentChanged);},userAgentOverride:function()
{return this._userAgentOverride;},setCustomUserAgentOverride:function(userAgent)
{this._customUserAgent=userAgent;this._updateUserAgentOverride();},_updateBlockedURLs:function()
{var blocked=this._blockedSetting.get();for(var url of blocked){if(!this._blockedURLs.has(url))
this._addBlockedURL(url);}
for(var url of this._blockedURLs){if(blocked.indexOf(url)===-1)
this._removeBlockedURL(url);}},_addBlockedURL:function(url)
{this._blockedURLs.add(url);for(var target of WebInspector.targetManager.targets())
target.networkAgent().addBlockedURL(url);},_removeBlockedURL:function(url)
{this._blockedURLs.delete(url);for(var target of WebInspector.targetManager.targets())
target.networkAgent().removeBlockedURL(url);},clearBrowserCache:function()
{for(var target of WebInspector.targetManager.targets())
target.networkAgent().clearBrowserCache();},clearBrowserCookies:function()
{for(var target of WebInspector.targetManager.targets())
target.networkAgent().clearBrowserCookies();},showCertificateViewer:function(certificateId)
{var target=WebInspector.targetManager.mainTarget();if(target)
target.networkAgent().showCertificateViewer(certificateId);},loadResource:function(url,callback)
{var headers={};var currentUserAgent=this._currentUserAgent();if(currentUserAgent)
headers["User-Agent"]=currentUserAgent;if(WebInspector.moduleSetting("cacheDisabled").get())
headers["Cache-Control"]="no-cache";WebInspector.ResourceLoader.load(url,headers,callback);},__proto__:WebInspector.Object.prototype}
WebInspector.multitargetNetworkManager;;WebInspector.NetworkRequest=function(target,requestId,url,documentURL,frameId,loaderId,initiator)
{WebInspector.SDKObject.call(this,target);this._requestId=requestId;this.url=url;this._documentURL=documentURL;this._frameId=frameId;this._loaderId=loaderId;this._initiator=initiator;this._issueTime=-1;this._startTime=-1;this._endTime=-1;this._blockedReason=undefined;this.statusCode=0;this.statusText="";this.requestMethod="";this.requestTime=0;this.protocol="";this.mixedContentType=NetworkAgent.RequestMixedContentType.None;this._initialPriority=null;this._resourceType=WebInspector.resourceTypes.Other;this._contentEncoded=false;this._pendingContentCallbacks=[];this._frames=[];this._eventSourceMessages=[];this._responseHeaderValues={};this._remoteAddress="";this._securityState=SecurityAgent.SecurityState.Unknown;this._securityDetails=null;this.connectionId="0";}
WebInspector.NetworkRequest.Events={FinishedLoading:"FinishedLoading",TimingChanged:"TimingChanged",RemoteAddressChanged:"RemoteAddressChanged",RequestHeadersChanged:"RequestHeadersChanged",ResponseHeadersChanged:"ResponseHeadersChanged",WebsocketFrameAdded:"WebsocketFrameAdded",EventSourceMessageAdded:"EventSourceMessageAdded",}
WebInspector.NetworkRequest.InitiatorType={Other:"other",Parser:"parser",Redirect:"redirect",Script:"script"}
WebInspector.NetworkRequest.NameValue;WebInspector.NetworkRequest.WebSocketFrameType={Send:"send",Receive:"receive",Error:"error"}
WebInspector.NetworkRequest.WebSocketFrame;WebInspector.NetworkRequest.EventSourceMessage;WebInspector.NetworkRequest.prototype={indentityCompare:function(other)
{if(this._requestId>other._requestId)
return 1;if(this._requestId<other._requestId)
return-1;return 0;},get requestId()
{return this._requestId;},set requestId(requestId)
{this._requestId=requestId;},get url()
{return this._url;},set url(x)
{if(this._url===x)
return;this._url=x;this._parsedURL=new WebInspector.ParsedURL(x);delete this._queryString;delete this._parsedQueryParameters;delete this._name;delete this._path;},get documentURL()
{return this._documentURL;},get parsedURL()
{return this._parsedURL;},get frameId()
{return this._frameId;},get loaderId()
{return this._loaderId;},setRemoteAddress:function(ip,port)
{if(ip.indexOf(":")!==-1)
ip="["+ip+"]";this._remoteAddress=ip+":"+port;this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.RemoteAddressChanged,this);},remoteAddress:function()
{return this._remoteAddress;},securityState:function()
{return this._securityState;},setSecurityState:function(securityState)
{this._securityState=securityState;},securityDetails:function()
{return this._securityDetails;},setSecurityDetails:function(securityDetails)
{this._securityDetails=securityDetails;},get startTime()
{return this._startTime||-1;},setIssueTime:function(monotonicTime,wallTime)
{this._issueTime=monotonicTime;this._wallIssueTime=wallTime;this._startTime=monotonicTime;},issueTime:function()
{return this._issueTime;},pseudoWallTime:function(monotonicTime)
{return this._wallIssueTime?this._wallIssueTime-this._issueTime+monotonicTime:monotonicTime;},get responseReceivedTime()
{return this._responseReceivedTime||-1;},set responseReceivedTime(x)
{this._responseReceivedTime=x;},get endTime()
{return this._endTime||-1;},set endTime(x)
{if(this.timing&&this.timing.requestTime){this._endTime=Math.max(x,this.responseReceivedTime);}else{this._endTime=x;if(this._responseReceivedTime>x)
this._responseReceivedTime=x;}
this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.TimingChanged,this);},get duration()
{if(this._endTime===-1||this._startTime===-1)
return-1;return this._endTime-this._startTime;},get latency()
{if(this._responseReceivedTime===-1||this._startTime===-1)
return-1;return this._responseReceivedTime-this._startTime;},get resourceSize()
{return this._resourceSize||0;},set resourceSize(x)
{this._resourceSize=x;},get transferSize()
{return this._transferSize||0;},increaseTransferSize:function(x)
{this._transferSize=(this._transferSize||0)+x;},setTransferSize:function(x)
{this._transferSize=x;},get finished()
{return this._finished;},set finished(x)
{if(this._finished===x)
return;this._finished=x;if(x){this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.FinishedLoading,this);if(this._pendingContentCallbacks.length)
this._innerRequestContent();}},get failed()
{return this._failed;},set failed(x)
{this._failed=x;},get canceled()
{return this._canceled;},set canceled(x)
{this._canceled=x;},blockedReason:function()
{return this._blockedReason;},setBlockedReason:function(reason)
{this._blockedReason=reason;},wasBlocked:function()
{return!!this._blockedReason;},cached:function()
{return(!!this._fromMemoryCache||!!this._fromDiskCache)&&!this._transferSize;},setFromMemoryCache:function()
{this._fromMemoryCache=true;delete this._timing;},setFromDiskCache:function()
{this._fromDiskCache=true;},get fetchedViaServiceWorker()
{return this._fetchedViaServiceWorker;},set fetchedViaServiceWorker(x)
{this._fetchedViaServiceWorker=x;},get timing()
{return this._timing;},set timing(x)
{if(x&&!this._fromMemoryCache){this._startTime=x.requestTime;this._responseReceivedTime=x.requestTime+x.receiveHeadersEnd/1000.0;this._timing=x;this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.TimingChanged,this);}},get mimeType()
{return this._mimeType;},set mimeType(x)
{this._mimeType=x;},get displayName()
{return this._parsedURL.displayName;},name:function()
{if(this._name)
return this._name;this._parseNameAndPathFromURL();return this._name;},path:function()
{if(this._path)
return this._path;this._parseNameAndPathFromURL();return this._path;},_parseNameAndPathFromURL:function()
{if(this._parsedURL.isDataURL()){this._name=this._parsedURL.dataURLDisplayName();this._path="";}else if(this._parsedURL.isAboutBlank()){this._name=this._parsedURL.url;this._path="";}else{this._path=this._parsedURL.host+this._parsedURL.folderPathComponents;this._path=this._path.trimURL(this.target().resourceTreeModel.inspectedPageDomain());if(this._parsedURL.lastPathComponent||this._parsedURL.queryParams)
this._name=this._parsedURL.lastPathComponent+(this._parsedURL.queryParams?"?"+this._parsedURL.queryParams:"");else if(this._parsedURL.folderPathComponents){this._name=this._parsedURL.folderPathComponents.substring(this._parsedURL.folderPathComponents.lastIndexOf("/")+1)+"/";this._path=this._path.substring(0,this._path.lastIndexOf("/"));}else{this._name=this._parsedURL.host;this._path="";}}},get folder()
{var path=this._parsedURL.path;var indexOfQuery=path.indexOf("?");if(indexOfQuery!==-1)
path=path.substring(0,indexOfQuery);var lastSlashIndex=path.lastIndexOf("/");return lastSlashIndex!==-1?path.substring(0,lastSlashIndex):"";},resourceType:function()
{return this._resourceType;},setResourceType:function(resourceType)
{this._resourceType=resourceType;},get domain()
{return this._parsedURL.host;},get scheme()
{return this._parsedURL.scheme;},get redirectSource()
{if(this.redirects&&this.redirects.length>0)
return this.redirects[this.redirects.length-1];return this._redirectSource;},set redirectSource(x)
{this._redirectSource=x;delete this._initiatorInfo;},requestHeaders:function()
{return this._requestHeaders||[];},setRequestHeaders:function(headers)
{this._requestHeaders=headers;delete this._requestCookies;this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.RequestHeadersChanged);},requestHeadersText:function()
{return this._requestHeadersText;},setRequestHeadersText:function(text)
{this._requestHeadersText=text;this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.RequestHeadersChanged);},requestHeaderValue:function(headerName)
{return this._headerValue(this.requestHeaders(),headerName);},get requestCookies()
{if(!this._requestCookies)
this._requestCookies=WebInspector.CookieParser.parseCookie(this.target(),this.requestHeaderValue("Cookie"));return this._requestCookies;},get requestFormData()
{return this._requestFormData;},set requestFormData(x)
{this._requestFormData=x;delete this._parsedFormParameters;},requestHttpVersion:function()
{var headersText=this.requestHeadersText();if(!headersText)
return this.requestHeaderValue("version")||this.requestHeaderValue(":version")||"unknown";var firstLine=headersText.split(/\r\n/)[0];var match=firstLine.match(/(HTTP\/\d+\.\d+)$/);return match?match[1]:"HTTP/0.9";},get responseHeaders()
{return this._responseHeaders||[];},set responseHeaders(x)
{this._responseHeaders=x;delete this._sortedResponseHeaders;delete this._responseCookies;this._responseHeaderValues={};this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.ResponseHeadersChanged);},get responseHeadersText()
{return this._responseHeadersText;},set responseHeadersText(x)
{this._responseHeadersText=x;this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.ResponseHeadersChanged);},get sortedResponseHeaders()
{if(this._sortedResponseHeaders!==undefined)
return this._sortedResponseHeaders;this._sortedResponseHeaders=this.responseHeaders.slice();this._sortedResponseHeaders.sort(function(a,b){return a.name.toLowerCase().compareTo(b.name.toLowerCase());});return this._sortedResponseHeaders;},responseHeaderValue:function(headerName)
{var value=this._responseHeaderValues[headerName];if(value===undefined){value=this._headerValue(this.responseHeaders,headerName);this._responseHeaderValues[headerName]=(value!==undefined)?value:null;}
return(value!==null)?value:undefined;},get responseCookies()
{if(!this._responseCookies)
this._responseCookies=WebInspector.CookieParser.parseSetCookie(this.target(),this.responseHeaderValue("Set-Cookie"));return this._responseCookies;},queryString:function()
{if(this._queryString!==undefined)
return this._queryString;var queryString=null;var url=this.url;var questionMarkPosition=url.indexOf("?");if(questionMarkPosition!==-1){queryString=url.substring(questionMarkPosition+1);var hashSignPosition=queryString.indexOf("#");if(hashSignPosition!==-1)
queryString=queryString.substring(0,hashSignPosition);}
this._queryString=queryString;return this._queryString;},get queryParameters()
{if(this._parsedQueryParameters)
return this._parsedQueryParameters;var queryString=this.queryString();if(!queryString)
return null;this._parsedQueryParameters=this._parseParameters(queryString);return this._parsedQueryParameters;},get formParameters()
{if(this._parsedFormParameters)
return this._parsedFormParameters;if(!this.requestFormData)
return null;var requestContentType=this.requestContentType();if(!requestContentType||!requestContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i))
return null;this._parsedFormParameters=this._parseParameters(this.requestFormData);return this._parsedFormParameters;},responseHttpVersion:function()
{var headersText=this._responseHeadersText;if(!headersText)
return this.responseHeaderValue("version")||this.responseHeaderValue(":version")||"unknown";var firstLine=headersText.split(/\r\n/)[0];var match=firstLine.match(/^(HTTP\/\d+\.\d+)/);return match?match[1]:"HTTP/0.9";},_parseParameters:function(queryString)
{function parseNameValue(pair)
{var position=pair.indexOf("=");if(position===-1)
return{name:pair,value:""};else
return{name:pair.substring(0,position),value:pair.substring(position+1)};}
return queryString.split("&").map(parseNameValue);},_headerValue:function(headers,headerName)
{headerName=headerName.toLowerCase();var values=[];for(var i=0;i<headers.length;++i){if(headers[i].name.toLowerCase()===headerName)
values.push(headers[i].value);}
if(!values.length)
return undefined;if(headerName==="set-cookie")
return values.join("\n");return values.join(", ");},get content()
{return this._content;},contentError:function()
{return this._contentError;},get contentEncoded()
{return this._contentEncoded;},contentURL:function()
{return this._url;},contentType:function()
{return this._resourceType;},requestContent:function(callback)
{if(this._resourceType===WebInspector.resourceTypes.WebSocket){callback(null);return;}
if(typeof this._content!=="undefined"){callback(this.content||null);return;}
this._pendingContentCallbacks.push(callback);if(this.finished)
this._innerRequestContent();},searchInContent:function(query,caseSensitive,isRegex,callback)
{callback([]);},isHttpFamily:function()
{return!!this.url.match(/^https?:/i);},requestContentType:function()
{return this.requestHeaderValue("Content-Type");},hasErrorStatusCode:function()
{return this.statusCode>=400;},setInitialPriority:function(priority)
{this._initialPriority=priority;},initialPriority:function()
{return this._initialPriority;},populateImageSource:function(image)
{WebInspector.Resource.populateImageSource(this._url,this._mimeType,this,image);},asDataURL:function()
{var content=this._content;var charset=null;if(!this._contentEncoded){content=content.toBase64();charset="utf-8";}
return WebInspector.Resource.contentAsDataURL(content,this.mimeType,true,charset);},_innerRequestContent:function()
{if(this._contentRequested)
return;this._contentRequested=true;function onResourceContent(error,content,contentEncoded)
{this._content=error?null:content;this._contentError=error;this._contentEncoded=contentEncoded;var callbacks=this._pendingContentCallbacks.slice();for(var i=0;i<callbacks.length;++i)
callbacks[i](this._content);this._pendingContentCallbacks.length=0;delete this._contentRequested;}
this.target().networkAgent().getResponseBody(this._requestId,onResourceContent.bind(this));},initiator:function()
{return this._initiator;},initiatorInfo:function()
{if(this._initiatorInfo)
return this._initiatorInfo;var type=WebInspector.NetworkRequest.InitiatorType.Other;var url="";var lineNumber=-Infinity;var columnNumber=-Infinity;var initiator=this._initiator;if(this.redirectSource){type=WebInspector.NetworkRequest.InitiatorType.Redirect;url=this.redirectSource.url;}else if(initiator){if(initiator.type===NetworkAgent.InitiatorType.Parser){type=WebInspector.NetworkRequest.InitiatorType.Parser;url=initiator.url?initiator.url:url;lineNumber=initiator.lineNumber?initiator.lineNumber:lineNumber;}else if(initiator.type===NetworkAgent.InitiatorType.Script){var topFrame=initiator.stackTrace?initiator.stackTrace[0]:null;if(topFrame&&topFrame.url){type=WebInspector.NetworkRequest.InitiatorType.Script;url=topFrame.url;lineNumber=topFrame.lineNumber;columnNumber=topFrame.columnNumber;}}}
this._initiatorInfo={type:type,url:url,lineNumber:lineNumber,columnNumber:columnNumber};return this._initiatorInfo;},initiatorRequest:function()
{if(this._initiatorRequest===undefined)
this._initiatorRequest=this.target().networkLog.requestForURL(this.initiatorInfo().url);return this._initiatorRequest;},initiatorChain:function()
{if(this._initiatorChain)
return this._initiatorChain;this._initiatorChain=new Set();var request=this;while(request){this._initiatorChain.add(request);request=request.initiatorRequest();}
return this._initiatorChain;},frames:function()
{return this._frames;},addFrameError:function(errorMessage,time)
{this._addFrame({type:WebInspector.NetworkRequest.WebSocketFrameType.Error,text:errorMessage,time:this.pseudoWallTime(time),opCode:-1,mask:false});},addFrame:function(response,time,sent)
{var type=sent?WebInspector.NetworkRequest.WebSocketFrameType.Send:WebInspector.NetworkRequest.WebSocketFrameType.Receive;this._addFrame({type:type,text:response.payloadData,time:this.pseudoWallTime(time),opCode:response.opcode,mask:response.mask});},_addFrame:function(frame)
{this._frames.push(frame);this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.WebsocketFrameAdded,frame);},eventSourceMessages:function()
{return this._eventSourceMessages;},addEventSourceMessage:function(time,eventName,eventId,data)
{var message={time:this.pseudoWallTime(time),eventName:eventName,eventId:eventId,data:data};this._eventSourceMessages.push(message);this.dispatchEventToListeners(WebInspector.NetworkRequest.Events.EventSourceMessageAdded,message);},replayXHR:function()
{this.target().networkAgent().replayXHR(this.requestId);},__proto__:WebInspector.SDKObject.prototype};WebInspector.PictureFragment;WebInspector.PaintProfilerSnapshot=function(target,snapshotId)
{this._target=target;this._id=snapshotId;}
WebInspector.PaintProfilerSnapshot.loadFromFragments=function(target,fragments,callback)
{var wrappedCallback=InspectorBackend.wrapClientCallback(callback,"LayerTreeAgent.loadSnapshot(): ",WebInspector.PaintProfilerSnapshot.bind(null,target));target.layerTreeAgent().loadSnapshot(fragments,wrappedCallback);}
WebInspector.PaintProfilerSnapshot.load=function(target,encodedPicture,callback)
{var fragment={x:0,y:0,picture:encodedPicture};WebInspector.PaintProfilerSnapshot.loadFromFragments(target,[fragment],callback);}
WebInspector.PaintProfilerSnapshot._processAnnotations=function(log)
{var result=[];var commentGroupStack=[];for(var i=0;i<log.length;++i){var method=log[i].method;switch(method){case"beginCommentGroup":commentGroupStack.push({});break;case"addComment":var group=commentGroupStack.peekLast();if(!group){console.assert(false,"Stray comment without a group");break;}
var key=String(log[i].params["key"]);var value=String(log[i].params["value"]);if(!key||typeof value==="undefined"){console.assert(false,"Missing key or value in addComment() params");break;}
if(key in group){console.assert(false,"Duplicate key in comment group");break;}
group[key]=value;break;case"endCommentGroup":if(!commentGroupStack.length)
console.assert(false,"Unbalanced commentGroupEnd call");else
commentGroupStack.pop();break;default:result.push(new WebInspector.PaintProfilerLogItem(log[i],i,commentGroupStack.peekLast()));}}
return result;}
WebInspector.PaintProfilerSnapshot.prototype={dispose:function()
{this._target.layerTreeAgent().releaseSnapshot(this._id);},target:function()
{return this._target;},requestImage:function(firstStep,lastStep,scale,callback)
{var wrappedCallback=InspectorBackend.wrapClientCallback(callback,"LayerTreeAgent.replaySnapshot(): ");this._target.layerTreeAgent().replaySnapshot(this._id,firstStep||undefined,lastStep||undefined,scale||1.0,wrappedCallback);},profile:function(clipRect,callback)
{var wrappedCallback=InspectorBackend.wrapClientCallback(callback,"LayerTreeAgent.profileSnapshot(): ");this._target.layerTreeAgent().profileSnapshot(this._id,5,1,clipRect||undefined,wrappedCallback);},commandLog:function(callback)
{function callbackWrapper(error,log)
{if(error){console.error("LayerTreeAgent.snapshotCommandLog(): "+error);callback();return;}
callback(WebInspector.PaintProfilerSnapshot._processAnnotations(log));}
this._target.layerTreeAgent().snapshotCommandLog(this._id,callbackWrapper);}};WebInspector.RawPaintProfilerLogItem;WebInspector.PaintProfilerLogItem=function(rawEntry,commandIndex,annotations)
{this.method=rawEntry.method;this.params=rawEntry.params;this.annotations=annotations;this.commandIndex=commandIndex;}
WebInspector.PaintProfilerLogItem.prototype={nodeId:function()
{if(!this.annotations)
return 0;var inspectorId=this.annotations["INSPECTOR_ID"];return Number(inspectorId);}};WebInspector.HeapProfilerModel=function(target)
{WebInspector.SDKModel.call(this,WebInspector.HeapProfilerModel,target);target.registerHeapProfilerDispatcher(new WebInspector.HeapProfilerDispatcher(this));this._enabled=false;this._heapProfilerAgent=target.heapProfilerAgent();}
WebInspector.HeapProfilerModel.Events={HeapStatsUpdate:"HeapStatsUpdate",LastSeenObjectId:"LastSeenObjectId",AddHeapSnapshotChunk:"AddHeapSnapshotChunk",ReportHeapSnapshotProgress:"ReportHeapSnapshotProgress",ResetProfiles:"ResetProfiles"}
WebInspector.HeapProfilerModel.prototype={enable:function()
{if(this._enabled)
return;this._enabled=true;this._heapProfilerAgent.enable();},heapStatsUpdate:function(samples)
{this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.HeapStatsUpdate,samples);},lastSeenObjectId:function(lastSeenObjectId,timestamp)
{this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.LastSeenObjectId,{lastSeenObjectId:lastSeenObjectId,timestamp:timestamp});},addHeapSnapshotChunk:function(chunk)
{this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.AddHeapSnapshotChunk,chunk);},reportHeapSnapshotProgress:function(done,total,finished)
{this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.ReportHeapSnapshotProgress,{done:done,total:total,finished:finished});},resetProfiles:function()
{this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.ResetProfiles);},__proto__:WebInspector.SDKModel.prototype}
WebInspector.HeapProfilerDispatcher=function(model)
{this._heapProfilerModel=model;}
WebInspector.HeapProfilerDispatcher.prototype={heapStatsUpdate:function(samples)
{this._heapProfilerModel.heapStatsUpdate(samples);},lastSeenObjectId:function(lastSeenObjectId,timestamp)
{this._heapProfilerModel.lastSeenObjectId(lastSeenObjectId,timestamp);},addHeapSnapshotChunk:function(chunk)
{this._heapProfilerModel.addHeapSnapshotChunk(chunk);},reportHeapSnapshotProgress:function(done,total,finished)
{this._heapProfilerModel.reportHeapSnapshotProgress(done,total,finished);},resetProfiles:function()
{this._heapProfilerModel.resetProfiles();}};WebInspector.CSSMetadata.initializeWithSupportedProperties([{"name":"color"},{"name":"direction"},{"name":"font-family"},{"name":"font-kerning"},{"name":"font-size"},{"name":"font-size-adjust"},{"name":"font-stretch"},{"name":"font-style"},{"name":"font-variant"},{"name":"font-variant-ligatures"},{"name":"font-weight"},{"name":"font-feature-settings"},{"name":"-webkit-font-smoothing"},{"name":"-webkit-locale"},{"name":"text-orientation"},{"name":"-webkit-text-orientation"},{"name":"writing-mode"},{"name":"-webkit-writing-mode"},{"name":"text-rendering"},{"name":"zoom"},{"name":"align-content"},{"name":"align-items"},{"name":"alignment-baseline"},{"name":"align-self"},{"name":"animation-delay"},{"name":"animation-direction"},{"name":"animation-duration"},{"name":"animation-fill-mode"},{"name":"animation-iteration-count"},{"name":"animation-name"},{"name":"animation-play-state"},{"name":"animation-timing-function"},{"name":"backdrop-filter"},{"name":"backface-visibility"},{"name":"background-attachment"},{"name":"background-blend-mode"},{"name":"background-clip"},{"name":"background-color"},{"name":"background-image"},{"name":"background-origin"},{"name":"background-position-x"},{"name":"background-position-y"},{"name":"background-repeat-x"},{"name":"background-repeat-y"},{"name":"background-size"},{"name":"baseline-shift"},{"name":"border-bottom-color"},{"name":"border-bottom-left-radius"},{"name":"border-bottom-right-radius"},{"name":"border-bottom-style"},{"name":"border-bottom-width"},{"name":"border-collapse"},{"name":"border-image-outset"},{"name":"border-image-repeat"},{"name":"border-image-slice"},{"name":"border-image-source"},{"name":"border-image-width"},{"name":"border-left-color"},{"name":"border-left-style"},{"name":"border-left-width"},{"name":"border-right-color"},{"name":"border-right-style"},{"name":"border-right-width"},{"name":"border-top-color"},{"name":"border-top-left-radius"},{"name":"border-top-right-radius"},{"name":"border-top-style"},{"name":"border-top-width"},{"name":"bottom"},{"name":"box-shadow"},{"name":"box-sizing"},{"name":"buffered-rendering"},{"name":"caption-side"},{"name":"clear"},{"name":"clip"},{"name":"clip-path"},{"name":"clip-rule"},{"name":"color-interpolation"},{"name":"color-interpolation-filters"},{"name":"color-rendering"},{"name":"column-fill"},{"name":"contain"},{"name":"content"},{"name":"counter-increment"},{"name":"counter-reset"},{"name":"cursor"},{"name":"cx"},{"name":"cy"},{"name":"d"},{"name":"display"},{"name":"dominant-baseline"},{"name":"empty-cells"},{"name":"fill"},{"name":"fill-opacity"},{"name":"fill-rule"},{"name":"filter"},{"name":"flex-basis"},{"name":"flex-direction"},{"name":"flex-grow"},{"name":"flex-shrink"},{"name":"flex-wrap"},{"name":"float"},{"name":"flood-color"},{"name":"flood-opacity"},{"name":"grid-auto-columns"},{"name":"grid-auto-flow"},{"name":"grid-auto-rows"},{"name":"grid-column-end"},{"name":"grid-column-gap"},{"name":"grid-column-start"},{"name":"grid-row-end"},{"name":"grid-row-gap"},{"name":"grid-row-start"},{"name":"grid-template-areas"},{"name":"grid-template-columns"},{"name":"grid-template-rows"},{"name":"height"},{"name":"image-rendering"},{"name":"image-orientation"},{"name":"isolation"},{"name":"justify-content"},{"name":"justify-items"},{"name":"justify-self"},{"name":"left"},{"name":"letter-spacing"},{"name":"lighting-color"},{"name":"line-height"},{"name":"list-style-image"},{"name":"list-style-position"},{"name":"list-style-type"},{"name":"margin-bottom"},{"name":"margin-left"},{"name":"margin-right"},{"name":"margin-top"},{"name":"marker-end"},{"name":"marker-mid"},{"name":"marker-start"},{"name":"mask"},{"name":"mask-source-type"},{"name":"mask-type"},{"name":"max-height"},{"name":"max-width"},{"name":"min-height"},{"name":"min-width"},{"name":"mix-blend-mode"},{"name":"motion-offset"},{"name":"motion-path"},{"name":"motion-rotation"},{"name":"object-fit"},{"name":"object-position"},{"name":"opacity"},{"name":"order"},{"name":"orphans"},{"name":"outline-color"},{"name":"outline-offset"},{"name":"outline-style"},{"name":"outline-width"},{"name":"overflow-wrap"},{"name":"overflow-x"},{"name":"overflow-y"},{"name":"padding-bottom"},{"name":"padding-left"},{"name":"padding-right"},{"name":"padding-top"},{"name":"page-break-after"},{"name":"page-break-before"},{"name":"page-break-inside"},{"name":"paint-order"},{"name":"perspective"},{"name":"perspective-origin"},{"name":"pointer-events"},{"name":"position"},{"name":"quotes"},{"name":"resize"},{"name":"right"},{"name":"r"},{"name":"rx"},{"name":"ry"},{"name":"scroll-behavior"},{"name":"scroll-snap-type"},{"name":"scroll-snap-points-x"},{"name":"scroll-snap-points-y"},{"name":"scroll-snap-destination"},{"name":"scroll-snap-coordinate"},{"name":"shape-image-threshold"},{"name":"shape-margin"},{"name":"shape-outside"},{"name":"shape-rendering"},{"name":"size"},{"name":"speak"},{"name":"stop-color"},{"name":"stop-opacity"},{"name":"stroke"},{"name":"stroke-dasharray"},{"name":"stroke-dashoffset"},{"name":"stroke-linecap"},{"name":"stroke-linejoin"},{"name":"stroke-miterlimit"},{"name":"stroke-opacity"},{"name":"stroke-width"},{"name":"table-layout"},{"name":"tab-size"},{"name":"text-align"},{"name":"text-align-last"},{"name":"text-anchor"},{"name":"text-combine-upright"},{"longhands":["text-decoration-line","text-decoration-style","text-decoration-color"],"name":"text-decoration"},{"name":"text-decoration-color"},{"name":"text-decoration-line"},{"name":"text-decoration-style"},{"name":"text-indent"},{"name":"text-justify"},{"name":"text-overflow"},{"name":"text-shadow"},{"name":"text-transform"},{"name":"text-underline-position"},{"name":"top"},{"name":"touch-action"},{"name":"transform"},{"name":"transform-origin"},{"name":"transform-style"},{"name":"translate"},{"name":"rotate"},{"name":"scale"},{"name":"transition-delay"},{"name":"transition-duration"},{"name":"transition-property"},{"name":"transition-timing-function"},{"name":"unicode-bidi"},{"name":"vector-effect"},{"name":"vertical-align"},{"name":"visibility"},{"name":"x"},{"name":"y"},{"name":"-webkit-appearance"},{"name":"-webkit-app-region"},{"name":"-webkit-background-clip"},{"name":"-webkit-background-composite"},{"name":"-webkit-background-origin"},{"name":"-webkit-border-horizontal-spacing"},{"name":"-webkit-border-image"},{"name":"-webkit-border-vertical-spacing"},{"name":"-webkit-box-align"},{"name":"-webkit-box-decoration-break"},{"name":"-webkit-box-direction"},{"name":"-webkit-box-flex"},{"name":"-webkit-box-flex-group"},{"name":"-webkit-box-lines"},{"name":"-webkit-box-ordinal-group"},{"name":"-webkit-box-orient"},{"name":"-webkit-box-pack"},{"name":"-webkit-box-reflect"},{"name":"-webkit-clip-path"},{"name":"-webkit-column-break-after"},{"name":"-webkit-column-break-before"},{"name":"-webkit-column-break-inside"},{"name":"-webkit-column-count"},{"name":"-webkit-column-gap"},{"name":"-webkit-column-rule-color"},{"name":"-webkit-column-rule-style"},{"name":"-webkit-column-rule-width"},{"name":"-webkit-column-span"},{"name":"-webkit-column-width"},{"name":"-webkit-filter"},{"name":"-webkit-highlight"},{"name":"-webkit-hyphenate-character"},{"name":"-webkit-line-break"},{"name":"-webkit-line-clamp"},{"name":"-webkit-margin-after-collapse"},{"name":"-webkit-margin-before-collapse"},{"name":"-webkit-margin-bottom-collapse"},{"name":"-webkit-margin-top-collapse"},{"name":"-webkit-mask-box-image-outset"},{"name":"-webkit-mask-box-image-repeat"},{"name":"-webkit-mask-box-image-slice"},{"name":"-webkit-mask-box-image-source"},{"name":"-webkit-mask-box-image-width"},{"name":"-webkit-mask-clip"},{"name":"-webkit-mask-composite"},{"name":"-webkit-mask-image"},{"name":"-webkit-mask-origin"},{"name":"-webkit-mask-position-x"},{"name":"-webkit-mask-position-y"},{"name":"-webkit-mask-repeat-x"},{"name":"-webkit-mask-repeat-y"},{"name":"-webkit-mask-size"},{"name":"-webkit-perspective-origin-x"},{"name":"-webkit-perspective-origin-y"},{"name":"-webkit-print-color-adjust"},{"name":"-webkit-rtl-ordering"},{"name":"-webkit-ruby-position"},{"name":"-webkit-tap-highlight-color"},{"name":"-webkit-text-combine"},{"name":"-webkit-text-emphasis-color"},{"name":"-webkit-text-emphasis-position"},{"name":"-webkit-text-emphasis-style"},{"name":"-webkit-text-fill-color"},{"name":"-webkit-text-security"},{"name":"-webkit-text-stroke-color"},{"name":"-webkit-text-stroke-width"},{"name":"-webkit-transform-origin-x"},{"name":"-webkit-transform-origin-y"},{"name":"-webkit-transform-origin-z"},{"name":"-webkit-user-drag"},{"name":"-webkit-user-modify"},{"name":"-webkit-user-select"},{"name":"white-space"},{"name":"widows"},{"name":"width"},{"name":"will-change"},{"name":"word-break"},{"name":"word-spacing"},{"name":"word-wrap"},{"name":"z-index"},{"name":"-webkit-border-end-color"},{"name":"-webkit-border-end-style"},{"name":"-webkit-border-end-width"},{"name":"-webkit-border-start-color"},{"name":"-webkit-border-start-style"},{"name":"-webkit-border-start-width"},{"name":"-webkit-border-before-color"},{"name":"-webkit-border-before-style"},{"name":"-webkit-border-before-width"},{"name":"-webkit-border-after-color"},{"name":"-webkit-border-after-style"},{"name":"-webkit-border-after-width"},{"name":"-webkit-margin-end"},{"name":"-webkit-margin-start"},{"name":"-webkit-margin-before"},{"name":"-webkit-margin-after"},{"name":"-webkit-padding-end"},{"name":"-webkit-padding-start"},{"name":"-webkit-padding-before"},{"name":"-webkit-padding-after"},{"name":"-webkit-logical-width"},{"name":"-webkit-logical-height"},{"name":"-webkit-min-logical-width"},{"name":"-webkit-min-logical-height"},{"name":"-webkit-max-logical-width"},{"name":"-webkit-max-logical-height"},{"name":"all"},{"name":"font-display"},{"name":"max-zoom"},{"name":"min-zoom"},{"name":"orientation"},{"name":"page"},{"name":"src"},{"name":"unicode-range"},{"name":"user-zoom"},{"name":"-webkit-font-size-delta"},{"name":"-webkit-text-decorations-in-effect"},{"longhands":["animation-name","animation-duration","animation-timing-function","animation-delay","animation-iteration-count","animation-direction","animation-fill-mode","animation-play-state"],"name":"animation"},{"longhands":["background-image","background-position-x","background-position-y","background-size","background-repeat-x","background-repeat-y","background-attachment","background-origin","background-clip","background-color"],"name":"background"},{"longhands":["background-position-x","background-position-y"],"name":"background-position"},{"longhands":["background-repeat-x","background-repeat-y"],"name":"background-repeat"},{"longhands":["border-top-color","border-top-style","border-top-width","border-right-color","border-right-style","border-right-width","border-bottom-color","border-bottom-style","border-bottom-width","border-left-color","border-left-style","border-left-width","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],"name":"border"},{"longhands":["border-bottom-width","border-bottom-style","border-bottom-color"],"name":"border-bottom"},{"longhands":["border-top-color","border-right-color","border-bottom-color","border-left-color"],"name":"border-color"},{"longhands":["border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat"],"name":"border-image"},{"longhands":["border-left-width","border-left-style","border-left-color"],"name":"border-left"},{"longhands":["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius"],"name":"border-radius"},{"longhands":["border-right-width","border-right-style","border-right-color"],"name":"border-right"},{"longhands":["-webkit-border-horizontal-spacing","-webkit-border-vertical-spacing"],"name":"border-spacing"},{"longhands":["border-top-style","border-right-style","border-bottom-style","border-left-style"],"name":"border-style"},{"longhands":["border-top-width","border-top-style","border-top-color"],"name":"border-top"},{"longhands":["border-top-width","border-right-width","border-bottom-width","border-left-width"],"name":"border-width"},{"longhands":["flex-grow","flex-shrink","flex-basis"],"name":"flex"},{"longhands":["flex-direction","flex-wrap"],"name":"flex-flow"},{"longhands":["font-style","font-variant","font-weight","font-stretch","font-size","line-height","font-family"],"name":"font"},{"longhands":["grid-template-columns","grid-template-rows","grid-template-areas","grid-auto-flow","grid-auto-columns","grid-auto-rows"],"name":"grid"},{"longhands":["grid-row-start","grid-column-start","grid-row-end","grid-column-end"],"name":"grid-area"},{"longhands":["grid-column-start","grid-column-end"],"name":"grid-column"},{"longhands":["grid-column-gap","grid-row-gap"],"name":"grid-gap"},{"longhands":["grid-row-start","grid-row-end"],"name":"grid-row"},{"longhands":["grid-template-columns","grid-template-rows","grid-template-areas"],"name":"grid-template"},{"longhands":["list-style-type","list-style-position","list-style-image"],"name":"list-style"},{"longhands":["margin-top","margin-right","margin-bottom","margin-left"],"name":"margin"},{"longhands":["marker-start","marker-mid","marker-end"],"name":"marker"},{"longhands":["motion-path","motion-offset","motion-rotation"],"name":"motion"},{"longhands":["outline-color","outline-style","outline-width"],"name":"outline"},{"longhands":["overflow-x","overflow-y"],"name":"overflow"},{"longhands":["padding-top","padding-right","padding-bottom","padding-left"],"name":"padding"},{"longhands":["transition-property","transition-duration","transition-timing-function","transition-delay"],"name":"transition"},{"longhands":["-webkit-border-after-width","-webkit-border-after-style","-webkit-border-after-color"],"name":"-webkit-border-after"},{"longhands":["-webkit-border-before-width","-webkit-border-before-style","-webkit-border-before-color"],"name":"-webkit-border-before"},{"longhands":["-webkit-border-end-width","-webkit-border-end-style","-webkit-border-end-color"],"name":"-webkit-border-end"},{"longhands":["-webkit-border-start-width","-webkit-border-start-style","-webkit-border-start-color"],"name":"-webkit-border-start"},{"longhands":["-webkit-column-rule-width","-webkit-column-rule-style","-webkit-column-rule-color"],"name":"-webkit-column-rule"},{"longhands":["-webkit-column-width","-webkit-column-count"],"name":"-webkit-columns"},{"longhands":["-webkit-margin-before-collapse","-webkit-margin-after-collapse"],"name":"-webkit-margin-collapse"},{"longhands":["-webkit-mask-image","-webkit-mask-position-x","-webkit-mask-position-y","-webkit-mask-size","-webkit-mask-repeat-x","-webkit-mask-repeat-y","-webkit-mask-origin","-webkit-mask-clip"],"name":"-webkit-mask"},{"longhands":["-webkit-mask-box-image-source","-webkit-mask-box-image-slice","-webkit-mask-box-image-width","-webkit-mask-box-image-outset","-webkit-mask-box-image-repeat"],"name":"-webkit-mask-box-image"},{"longhands":["-webkit-mask-position-x","-webkit-mask-position-y"],"name":"-webkit-mask-position"},{"longhands":["-webkit-mask-repeat-x","-webkit-mask-repeat-y"],"name":"-webkit-mask-repeat"},{"longhands":["-webkit-text-emphasis-style","-webkit-text-emphasis-color"],"name":"-webkit-text-emphasis"},{"longhands":["-webkit-text-stroke-width","-webkit-text-stroke-color"],"name":"-webkit-text-stroke"}]);;WebInspector.FileManager=function()
{this._savedURLsSetting=WebInspector.settings.createLocalSetting("savedURLs",{});this._saveCallbacks={};InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.SavedURL,this._savedURL,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.CanceledSaveURL,this._canceledSaveURL,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.AppendedToURL,this._appendedToURL,this);}
WebInspector.FileManager.EventTypes={SavedURL:"SavedURL",AppendedToURL:"AppendedToURL"}
WebInspector.FileManager.prototype={save:function(url,content,forceSaveAs,callback)
{var savedURLs=this._savedURLsSetting.get();delete savedURLs[url];this._savedURLsSetting.set(savedURLs);this._saveCallbacks[url]=callback||null;InspectorFrontendHost.save(url,content,forceSaveAs);},_savedURL:function(event)
{var url=(event.data);var savedURLs=this._savedURLsSetting.get();savedURLs[url]=true;this._savedURLsSetting.set(savedURLs);this.dispatchEventToListeners(WebInspector.FileManager.EventTypes.SavedURL,url);this._invokeSaveCallback(url,true);},_invokeSaveCallback:function(url,accepted)
{var callback=this._saveCallbacks[url];delete this._saveCallbacks[url];if(callback)
callback(accepted);},_canceledSaveURL:function(event)
{var url=(event.data);this._invokeSaveCallback(url,false);},isURLSaved:function(url)
{var savedURLs=this._savedURLsSetting.get();return savedURLs[url];},append:function(url,content)
{InspectorFrontendHost.append(url,content);},close:function(url)
{},_appendedToURL:function(event)
{var url=(event.data);this.dispatchEventToListeners(WebInspector.FileManager.EventTypes.AppendedToURL,url);},__proto__:WebInspector.Object.prototype}
WebInspector.fileManager=null;;WebInspector.FileSystemMapping=function()
{WebInspector.Object.call(this);this._fileSystemMappingSetting=WebInspector.settings.createLocalSetting("fileSystemMapping",{});this._fileSystemMappings={};this._loadFromSettings();}
WebInspector.FileSystemMapping.Events={FileMappingAdded:"FileMappingAdded",FileMappingRemoved:"FileMappingRemoved"}
WebInspector.FileSystemMapping.prototype={_loadFromSettings:function()
{var savedMapping=this._fileSystemMappingSetting.get();this._fileSystemMappings={};for(var fileSystemPath in savedMapping){var savedFileSystemMappings=savedMapping[fileSystemPath];fileSystemPath=WebInspector.IsolatedFileSystemManager.normalizePath(fileSystemPath);this._fileSystemMappings[fileSystemPath]=[];var fileSystemMappings=this._fileSystemMappings[fileSystemPath];for(var i=0;i<savedFileSystemMappings.length;++i){var savedEntry=savedFileSystemMappings[i];var entry=new WebInspector.FileSystemMapping.Entry(fileSystemPath,savedEntry.urlPrefix,savedEntry.pathPrefix,true);fileSystemMappings.push(entry);}}
this._rebuildIndexes();},_saveToSettings:function()
{var setting={};for(var fileSystemPath in this._fileSystemMappings){setting[fileSystemPath]=[];var entries=this._fileSystemMappings[fileSystemPath];for(var entry of entries){if(entry.configurable)
setting[fileSystemPath].push(entry);}}
this._fileSystemMappingSetting.set(setting);},_rebuildIndexes:function()
{this._mappingForURLPrefix={};this._urlPrefixes=[];for(var fileSystemPath in this._fileSystemMappings){var fileSystemMapping=this._fileSystemMappings[fileSystemPath];for(var i=0;i<fileSystemMapping.length;++i){var entry=fileSystemMapping[i];if(this._mappingForURLPrefix[entry.urlPrefix]&&!entry.configurable)
continue;this._mappingForURLPrefix[entry.urlPrefix]=entry;if(this._urlPrefixes.indexOf(entry.urlPrefix)===-1)
this._urlPrefixes.push(entry.urlPrefix);}}
this._urlPrefixes.sort();},addFileSystem:function(fileSystemPath)
{if(this._fileSystemMappings[fileSystemPath])
return;this._fileSystemMappings[fileSystemPath]=[];this._saveToSettings();},removeFileSystem:function(fileSystemPath)
{if(!this._fileSystemMappings[fileSystemPath])
return;delete this._fileSystemMappings[fileSystemPath];this._rebuildIndexes();this._saveToSettings();},addFileMapping:function(fileSystemPath,urlPrefix,pathPrefix)
{if(!urlPrefix.endsWith("/"))
urlPrefix+="/";if(!pathPrefix.endsWith("/"))
pathPrefix+="/";if(!pathPrefix.startsWith("/"))
pathPrefix="/"+pathPrefix;this._innerAddFileMapping(fileSystemPath,urlPrefix,pathPrefix,true);this._saveToSettings();},addNonConfigurableFileMapping:function(fileSystemPath,urlPrefix,pathPrefix)
{this._innerAddFileMapping(fileSystemPath,urlPrefix,pathPrefix,false);},_innerAddFileMapping:function(fileSystemPath,urlPrefix,pathPrefix,configurable)
{var entry=new WebInspector.FileSystemMapping.Entry(fileSystemPath,urlPrefix,pathPrefix,configurable);this._fileSystemMappings[fileSystemPath].push(entry);this._rebuildIndexes();this.dispatchEventToListeners(WebInspector.FileSystemMapping.Events.FileMappingAdded,entry);},removeFileMapping:function(fileSystemPath,urlPrefix,pathPrefix)
{var entry=this._configurableMappingEntryForPathPrefix(fileSystemPath,pathPrefix);if(!entry)
return;this._fileSystemMappings[fileSystemPath].remove(entry);this._rebuildIndexes();this._saveToSettings();this.dispatchEventToListeners(WebInspector.FileSystemMapping.Events.FileMappingRemoved,entry);},_mappingEntryForURL:function(url)
{for(var i=this._urlPrefixes.length-1;i>=0;--i){var urlPrefix=this._urlPrefixes[i];if(url.startsWith(urlPrefix))
return this._mappingForURLPrefix[urlPrefix];}
return null;},_mappingEntryForPath:function(fileSystemPath,filePath)
{var entries=this._fileSystemMappings[fileSystemPath];if(!entries)
return null;var entry=null;for(var i=0;i<entries.length;++i){var pathPrefix=entries[i].pathPrefix;if(entry&&entry.configurable&&!entries[i].configurable)
continue;if(entry&&entry.pathPrefix.length>pathPrefix.length)
continue;if(filePath.startsWith(pathPrefix))
entry=entries[i];}
return entry;},_configurableMappingEntryForPathPrefix:function(fileSystemPath,pathPrefix)
{var entries=this._fileSystemMappings[fileSystemPath];for(var i=0;i<entries.length;++i){if(entries[i].configurable&&pathPrefix===entries[i].pathPrefix)
return entries[i];}
return null;},mappingEntries:function(fileSystemPath)
{return this._fileSystemMappings[fileSystemPath].slice();},hasMappingForNetworkURL:function(url)
{return!!this._mappingEntryForURL(url);},fileForURL:function(url)
{var entry=this._mappingEntryForURL(url);if(!entry)
return null;var file={};file.fileSystemPath=entry.fileSystemPath;file.fileURL=entry.fileSystemPath+entry.pathPrefix+url.substr(entry.urlPrefix.length);return file;},networkURLForFileSystemURL:function(fileSystemPath,filePath)
{var relativePath=filePath.substring(fileSystemPath.length);var entry=this._mappingEntryForPath(fileSystemPath,relativePath);if(!entry)
return"";return entry.urlPrefix+relativePath.substring(entry.pathPrefix.length);},removeMappingForURL:function(url)
{var entry=this._mappingEntryForURL(url);if(!entry||!entry.configurable)
return;this._fileSystemMappings[entry.fileSystemPath].remove(entry);this._saveToSettings();},addMappingForResource:function(url,fileSystemPath,filePath)
{var commonPathSuffixLength=0;for(var i=0;i<filePath.length;++i){var filePathCharacter=filePath[filePath.length-1-i];var urlCharacter=url[url.length-1-i];if(filePathCharacter!==urlCharacter)
break;if(filePathCharacter==="/")
commonPathSuffixLength=i;}
var pathPrefix=filePath.substring(fileSystemPath.length,filePath.length-commonPathSuffixLength);var urlPrefix=url.substr(0,url.length-commonPathSuffixLength);this.addFileMapping(fileSystemPath,urlPrefix,pathPrefix);},resetForTesting:function()
{this._fileSystemMappings={};},__proto__:WebInspector.Object.prototype}
WebInspector.FileSystemMapping.Entry=function(fileSystemPath,urlPrefix,pathPrefix,configurable)
{this.fileSystemPath=fileSystemPath;this.urlPrefix=urlPrefix;this.pathPrefix=pathPrefix;this.configurable=configurable;}
WebInspector.fileSystemMapping;;WebInspector.IsolatedFileSystem=function(manager,path,embedderPath,domFileSystem)
{this._manager=manager;this._path=path;this._embedderPath=embedderPath;this._domFileSystem=domFileSystem;this._excludedFoldersSetting=WebInspector.settings.createLocalSetting("workspaceExcludedFolders",{});this._excludedFolders=new Set(this._excludedFoldersSetting.get()[path]||[]);this._nonConfigurableExcludedFolders=new Set();}
WebInspector.IsolatedFileSystem.ImageExtensions=new Set(["jpeg","jpg","svg","gif","webp","png","ico","tiff","tif","bmp"]);WebInspector.IsolatedFileSystem.create=function(manager,path,embedderPath,name,rootURL)
{return new Promise(promiseBody);function promiseBody(resolve,reject)
{var domFileSystem=InspectorFrontendHost.isolatedFileSystem(name,rootURL);if(!domFileSystem){resolve(null);return;}
var fileSystem=new WebInspector.IsolatedFileSystem(manager,path,embedderPath,domFileSystem);fileSystem.requestFileContent(".devtools",onConfigAvailable);function onConfigAvailable(projectText)
{if(projectText){try{var projectObject=JSON.parse(projectText);fileSystem._initializeProject(typeof projectObject==="object"?(projectObject):null);}catch(e){WebInspector.console.error("Invalid project file: "+projectText);}}
resolve(fileSystem);}}}
WebInspector.IsolatedFileSystem.errorMessage=function(error)
{return WebInspector.UIString("File system error: %s",error.message);}
WebInspector.IsolatedFileSystem.prototype={path:function()
{return this._path;},embedderPath:function()
{return this._embedderPath;},_initializeProject:function(projectObject)
{this._projectObject=projectObject;var projectExcludes=this.projectProperty("excludes");if(Array.isArray(projectExcludes)){for(var folder of(projectExcludes)){if(typeof folder==="string")
this._nonConfigurableExcludedFolders.add(folder);}}},projectProperty:function(key)
{return this._projectObject?this._projectObject[key]:null;},requestFilesRecursive:function(path,fileCallback,finishedCallback)
{var pendingRequests=1;this._requestEntries(path,innerCallback.bind(this));function innerCallback(entries)
{for(var i=0;i<entries.length;++i){var entry=entries[i];if(!entry.isDirectory){if(this._isFileExcluded(entry.fullPath))
continue;fileCallback(entry.fullPath.substr(1));}else{if(this._isFileExcluded(entry.fullPath+"/"))
continue;++pendingRequests;this._requestEntries(entry.fullPath,innerCallback.bind(this));}}
if(finishedCallback&&(--pendingRequests===0))
finishedCallback();}},createFile:function(path,name,callback)
{var newFileIndex=1;if(!name)
name="NewFile";var nameCandidate;this._domFileSystem.root.getDirectory(path,null,dirEntryLoaded.bind(this),errorHandler.bind(this));function dirEntryLoaded(dirEntry)
{var nameCandidate=name;if(newFileIndex>1)
nameCandidate+=newFileIndex;++newFileIndex;dirEntry.getFile(nameCandidate,{create:true,exclusive:true},fileCreated,fileCreationError.bind(this));function fileCreated(entry)
{callback(entry.fullPath.substr(1));}
function fileCreationError(error)
{if(error.code===FileError.INVALID_MODIFICATION_ERR){dirEntryLoaded.call(this,dirEntry);return;}
var errorMessage=WebInspector.IsolatedFileSystem.errorMessage(error);console.error(errorMessage+" when testing if file exists '"+(this._path+"/"+path+"/"+nameCandidate)+"'");callback(null);}}
function errorHandler(error)
{var errorMessage=WebInspector.IsolatedFileSystem.errorMessage(error);var filePath=this._path+"/"+path;if(nameCandidate)
filePath+="/"+nameCandidate;console.error(errorMessage+" when getting content for file '"+(filePath)+"'");callback(null);}},deleteFile:function(path)
{this._domFileSystem.root.getFile(path,null,fileEntryLoaded.bind(this),errorHandler.bind(this));function fileEntryLoaded(fileEntry)
{fileEntry.remove(fileEntryRemoved,errorHandler.bind(this));}
function fileEntryRemoved()
{}
function errorHandler(error)
{var errorMessage=WebInspector.IsolatedFileSystem.errorMessage(error);console.error(errorMessage+" when deleting file '"+(this._path+"/"+path)+"'");}},requestFileContent:function(path,callback)
{this._domFileSystem.root.getFile(path,null,fileEntryLoaded.bind(this),errorHandler.bind(this));function fileEntryLoaded(entry)
{entry.file(fileLoaded,errorHandler.bind(this));}
function fileLoaded(file)
{var reader=new FileReader();reader.onloadend=readerLoadEnd;if(WebInspector.IsolatedFileSystem.ImageExtensions.has(WebInspector.TextUtils.extension(path)))
reader.readAsDataURL(file);else
reader.readAsText(file);}
function readerLoadEnd()
{var string=null;try{string=(this.result);}catch(e){console.error("Can't read file: "+path+": "+e);}
callback(string);}
function errorHandler(error)
{if(error.code===FileError.NOT_FOUND_ERR){callback(null);return;}
var errorMessage=WebInspector.IsolatedFileSystem.errorMessage(error);console.error(errorMessage+" when getting content for file '"+(this._path+"/"+path)+"'");callback(null);}},setFileContent:function(path,content,callback)
{WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.FileSavedInWorkspace);this._domFileSystem.root.getFile(path,{create:true},fileEntryLoaded.bind(this),errorHandler.bind(this));function fileEntryLoaded(entry)
{entry.createWriter(fileWriterCreated.bind(this),errorHandler.bind(this));}
function fileWriterCreated(fileWriter)
{fileWriter.onerror=errorHandler.bind(this);fileWriter.onwriteend=fileWritten;var blob=new Blob([content],{type:"text/plain"});fileWriter.write(blob);function fileWritten()
{fileWriter.onwriteend=callback;fileWriter.truncate(blob.size);}}
function errorHandler(error)
{var errorMessage=WebInspector.IsolatedFileSystem.errorMessage(error);console.error(errorMessage+" when setting content for file '"+(this._path+"/"+path)+"'");callback();}},renameFile:function(path,newName,callback)
{newName=newName?newName.trim():newName;if(!newName||newName.indexOf("/")!==-1){callback(false);return;}
var fileEntry;var dirEntry;this._domFileSystem.root.getFile(path,null,fileEntryLoaded.bind(this),errorHandler.bind(this));function fileEntryLoaded(entry)
{if(entry.name===newName){callback(false);return;}
fileEntry=entry;fileEntry.getParent(dirEntryLoaded.bind(this),errorHandler.bind(this));}
function dirEntryLoaded(entry)
{dirEntry=entry;dirEntry.getFile(newName,null,newFileEntryLoaded,newFileEntryLoadErrorHandler.bind(this));}
function newFileEntryLoaded(entry)
{callback(false);}
function newFileEntryLoadErrorHandler(error)
{if(error.code!==FileError.NOT_FOUND_ERR){callback(false);return;}
fileEntry.moveTo(dirEntry,newName,fileRenamed,errorHandler.bind(this));}
function fileRenamed(entry)
{callback(true,entry.name);}
function errorHandler(error)
{var errorMessage=WebInspector.IsolatedFileSystem.errorMessage(error);console.error(errorMessage+" when renaming file '"+(this._path+"/"+path)+"' to '"+newName+"'");callback(false);}},_readDirectory:function(dirEntry,callback)
{var dirReader=dirEntry.createReader();var entries=[];function innerCallback(results)
{if(!results.length){callback(entries.sort());}else{entries=entries.concat(toArray(results));dirReader.readEntries(innerCallback,errorHandler);}}
function toArray(list)
{return Array.prototype.slice.call(list||[],0);}
dirReader.readEntries(innerCallback,errorHandler);function errorHandler(error)
{var errorMessage=WebInspector.IsolatedFileSystem.errorMessage(error);console.error(errorMessage+" when reading directory '"+dirEntry.fullPath+"'");callback([]);}},_requestEntries:function(path,callback)
{this._domFileSystem.root.getDirectory(path,null,innerCallback.bind(this),errorHandler);function innerCallback(dirEntry)
{this._readDirectory(dirEntry,callback);}
function errorHandler(error)
{var errorMessage=WebInspector.IsolatedFileSystem.errorMessage(error);console.error(errorMessage+" when requesting entry '"+path+"'");callback([]);}},_saveExcludedFolders:function()
{var settingValue=this._excludedFoldersSetting.get();settingValue[this._path]=Array.from(this._excludedFolders.values());this._excludedFoldersSetting.set(settingValue);},addExcludedFolder:function(path)
{this._excludedFolders.add(path);this._saveExcludedFolders();this._manager.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.ExcludedFolderAdded,path);},removeExcludedFolder:function(path)
{this._excludedFolders.delete(path);this._saveExcludedFolders();this._manager.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.ExcludedFolderRemoved,path);},fileSystemRemoved:function()
{var settingValue=this._excludedFoldersSetting.get();delete settingValue[this._path];this._excludedFoldersSetting.set(settingValue);},_isFileExcluded:function(folderPath)
{if(this._nonConfigurableExcludedFolders.has(folderPath)||this._excludedFolders.has(folderPath))
return true;var regex=this._manager.workspaceFolderExcludePatternSetting().asRegExp();return!!(regex&&regex.test(folderPath));},excludedFolders:function()
{return this._excludedFolders;},nonConfigurableExcludedFolders:function()
{return this._nonConfigurableExcludedFolders;},searchInPath:function(query,progress,callback)
{var requestId=this._manager.registerCallback(innerCallback);InspectorFrontendHost.searchInPath(requestId,this._embedderPath,query);function innerCallback(files)
{files=files.map(embedderPath=>WebInspector.IsolatedFileSystemManager.normalizePath(embedderPath));progress.worked(1);callback(files);}},indexContent:function(progress)
{progress.setTotalWork(1);var requestId=this._manager.registerProgress(progress);InspectorFrontendHost.indexPath(requestId,this._embedderPath);}};WebInspector.IsolatedFileSystemManager=function()
{this._fileSystems={};this._callbacks={};this._progresses={};InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.FileSystemsLoaded,this._onFileSystemsLoaded,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.FileSystemRemoved,this._onFileSystemRemoved,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.FileSystemAdded,this._onFileSystemAdded,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.FileSystemFilesChanged,this._onFileSystemFilesChanged,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.IndexingTotalWorkCalculated,this._onIndexingTotalWorkCalculated,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.IndexingWorked,this._onIndexingWorked,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.IndexingDone,this._onIndexingDone,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.SearchCompleted,this._onSearchCompleted,this);this._initExcludePatterSetting();}
WebInspector.IsolatedFileSystemManager.FileSystem;WebInspector.IsolatedFileSystemManager.Events={FileSystemAdded:"FileSystemAdded",FileSystemRemoved:"FileSystemRemoved",FileSystemsLoaded:"FileSystemsLoaded",FileSystemFilesChanged:"FileSystemFilesChanged",ExcludedFolderAdded:"ExcludedFolderAdded",ExcludedFolderRemoved:"ExcludedFolderRemoved"}
WebInspector.IsolatedFileSystemManager._lastRequestId=0;WebInspector.IsolatedFileSystemManager.normalizePath=function(fileSystemPath)
{fileSystemPath=fileSystemPath.replace(/\\/g,"/");if(!fileSystemPath.startsWith("file://")){if(fileSystemPath.startsWith("/"))
fileSystemPath="file://"+fileSystemPath;else
fileSystemPath="file:///"+fileSystemPath;}
return fileSystemPath;}
WebInspector.IsolatedFileSystemManager.prototype={initialize:function(callback)
{this._initializeCallback=callback;InspectorFrontendHost.requestFileSystems();},addFileSystem:function()
{InspectorFrontendHost.addFileSystem("");},removeFileSystem:function(fileSystem)
{InspectorFrontendHost.removeFileSystem(fileSystem.embedderPath());},_onFileSystemsLoaded:function(event)
{var fileSystems=(event.data);var promises=[];for(var i=0;i<fileSystems.length;++i)
promises.push(this._innerAddFileSystem(fileSystems[i]));Promise.all(promises).then(fireFileSystemsLoaded.bind(this));function fireFileSystemsLoaded()
{this._initializeCallback();delete this._initializeCallback;this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.FileSystemsLoaded);}},fileSystemsLoaded:function()
{return!this._initializeCallback;},_innerAddFileSystem:function(fileSystem)
{var embedderPath=fileSystem.fileSystemPath;var fileSystemPath=WebInspector.IsolatedFileSystemManager.normalizePath(fileSystem.fileSystemPath);var promise=WebInspector.IsolatedFileSystem.create(this,fileSystemPath,embedderPath,fileSystem.fileSystemName,fileSystem.rootURL);return promise.then(storeFileSystem.bind(this));function storeFileSystem(fileSystem)
{if(!fileSystem)
return;this._fileSystems[fileSystemPath]=fileSystem;this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded,fileSystem);}},_onFileSystemAdded:function(event)
{var errorMessage=(event.data["errorMessage"]);var fileSystem=(event.data["fileSystem"]);if(errorMessage)
WebInspector.console.error(errorMessage);else if(fileSystem)
this._innerAddFileSystem(fileSystem);},_onFileSystemRemoved:function(event)
{this._fileSystemRemoved((event.data));},_onFileSystemFilesChanged:function(event)
{var embedderPaths=(event.data);var paths=embedderPaths.map(embedderPath=>WebInspector.IsolatedFileSystemManager.normalizePath(embedderPath));this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.FileSystemFilesChanged,paths);},_fileSystemRemoved:function(embedderPath)
{var fileSystemPath=WebInspector.IsolatedFileSystemManager.normalizePath(embedderPath);var isolatedFileSystem=this._fileSystems[fileSystemPath];delete this._fileSystems[fileSystemPath];if(isolatedFileSystem){isolatedFileSystem.fileSystemRemoved();this.dispatchEventToListeners(WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved,isolatedFileSystem);}},fileSystemPaths:function()
{return Object.keys(this._fileSystems);},fileSystem:function(fileSystemPath)
{return this._fileSystems[fileSystemPath];},_initExcludePatterSetting:function()
{var defaultCommonExcludedFolders=["/\\.devtools","/\\.git/","/\\.sass-cache/","/\\.hg/","/\\.idea/","/\\.svn/","/\\.cache/","/\\.project/"];var defaultWinExcludedFolders=["/Thumbs.db$","/ehthumbs.db$","/Desktop.ini$","/\\$RECYCLE.BIN/"];var defaultMacExcludedFolders=["/\\.DS_Store$","/\\.Trashes$","/\\.Spotlight-V100$","/\\.AppleDouble$","/\\.LSOverride$","/Icon$","/\\._.*$"];var defaultLinuxExcludedFolders=["/.*~$"];var defaultExcludedFolders=defaultCommonExcludedFolders;if(WebInspector.isWin())
defaultExcludedFolders=defaultExcludedFolders.concat(defaultWinExcludedFolders);else if(WebInspector.isMac())
defaultExcludedFolders=defaultExcludedFolders.concat(defaultMacExcludedFolders);else
defaultExcludedFolders=defaultExcludedFolders.concat(defaultLinuxExcludedFolders);var defaultExcludedFoldersPattern=defaultExcludedFolders.join("|");this._workspaceFolderExcludePatternSetting=WebInspector.settings.createRegExpSetting("workspaceFolderExcludePattern",defaultExcludedFoldersPattern,WebInspector.isWin()?"i":"");},workspaceFolderExcludePatternSetting:function()
{return this._workspaceFolderExcludePatternSetting;},registerCallback:function(callback)
{var requestId=++WebInspector.IsolatedFileSystemManager._lastRequestId;this._callbacks[requestId]=callback;return requestId;},registerProgress:function(progress)
{var requestId=++WebInspector.IsolatedFileSystemManager._lastRequestId;this._progresses[requestId]=progress;return requestId;},_onIndexingTotalWorkCalculated:function(event)
{var requestId=(event.data["requestId"]);var totalWork=(event.data["totalWork"]);var progress=this._progresses[requestId];if(!progress)
return;progress.setTotalWork(totalWork);},_onIndexingWorked:function(event)
{var requestId=(event.data["requestId"]);var worked=(event.data["worked"]);var progress=this._progresses[requestId];if(!progress)
return;progress.worked(worked);if(progress.isCanceled()){InspectorFrontendHost.stopIndexing(requestId);this._onIndexingDone(event);}},_onIndexingDone:function(event)
{var requestId=(event.data["requestId"]);var progress=this._progresses[requestId];if(!progress)
return;progress.done();delete this._progresses[requestId];},_onSearchCompleted:function(event)
{var requestId=(event.data["requestId"]);var files=(event.data["files"]);var callback=this._callbacks[requestId];if(!callback)
return;callback.call(null,files);delete this._callbacks[requestId];},dispose:function()
{InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAPI.Events.IndexingTotalWorkCalculated,this._onIndexingTotalWorkCalculated,this);InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAPI.Events.IndexingWorked,this._onIndexingWorked,this);InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAPI.Events.IndexingDone,this._onIndexingDone,this);InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAPI.Events.SearchCompleted,this._onSearchCompleted,this);},__proto__:WebInspector.Object.prototype}
WebInspector.isolatedFileSystemManager;;WebInspector.SearchConfig=function(query,ignoreCase,isRegex)
{this._query=query;this._ignoreCase=ignoreCase;this._isRegex=isRegex;this._parse();}
WebInspector.SearchConfig.RegexQuery;WebInspector.SearchConfig.fromPlainObject=function(object)
{return new WebInspector.SearchConfig(object.query,object.ignoreCase,object.isRegex);}
WebInspector.SearchConfig.prototype={query:function()
{return this._query;},ignoreCase:function()
{return this._ignoreCase;},isRegex:function()
{return this._isRegex;},toPlainObject:function()
{return{query:this.query(),ignoreCase:this.ignoreCase(),isRegex:this.isRegex()};},_parse:function()
{var filePattern="-?f(ile)?:(([^\\\\ ]|\\\\.)+)";var quotedPattern="\"(([^\\\\\"]|\\\\.)+)\"";var unquotedWordPattern="(\\s*(?!-?f(ile)?:)[^\\\\ ]|\\\\.)+";var unquotedPattern=unquotedWordPattern+"( +"+unquotedWordPattern+")*";var pattern="("+filePattern+")|("+quotedPattern+")|("+unquotedPattern+")";var regexp=new RegExp(pattern,"g");var queryParts=this._query.match(regexp)||[];this._fileQueries=[];this._queries=[];for(var i=0;i<queryParts.length;++i){var queryPart=queryParts[i];if(!queryPart)
continue;var fileQuery=this._parseFileQuery(queryPart);if(fileQuery){this._fileQueries.push(fileQuery);this._fileRegexQueries=this._fileRegexQueries||[];this._fileRegexQueries.push({regex:new RegExp(fileQuery.text,this.ignoreCase?"i":""),isNegative:fileQuery.isNegative});continue;}
if(this._isRegex){this._queries.push(queryPart);continue;}
if(queryPart.startsWith("\"")){if(!queryPart.endsWith("\""))
continue;this._queries.push(this._parseQuotedQuery(queryPart));continue;}
this._queries.push(this._parseUnquotedQuery(queryPart));}},filePathMatchesFileQuery:function(filePath)
{if(!this._fileRegexQueries)
return true;for(var i=0;i<this._fileRegexQueries.length;++i){if(!!filePath.match(this._fileRegexQueries[i].regex)===this._fileRegexQueries[i].isNegative)
return false;}
return true;},queries:function()
{return this._queries;},_parseUnquotedQuery:function(query)
{return query.replace(/\\(.)/g,"$1");},_parseQuotedQuery:function(query)
{return query.substring(1,query.length-1).replace(/\\(.)/g,"$1");},_parseFileQuery:function(query)
{var match=query.match(/^(-)?f(ile)?:/);if(!match)
return null;var isNegative=!!match[1];query=query.substr(match[0].length);var result="";for(var i=0;i<query.length;++i){var char=query[i];if(char==="*"){result+=".*";}else if(char==="\\"){++i;var nextChar=query[i];if(nextChar===" ")
result+=" ";}else{if(String.regexSpecialCharacters().indexOf(query.charAt(i))!==-1)
result+="\\";result+=query.charAt(i);}}
return new WebInspector.SearchConfig.QueryTerm(result,isNegative);}}
WebInspector.SearchConfig.QueryTerm=function(text,isNegative)
{this.text=text;this.isNegative=isNegative;};WebInspector.UISourceCode=function(project,url,contentType)
{this._project=project;this._url=url;var pathComponents=WebInspector.ParsedURL.splitURLIntoPathComponents(url);this._origin=pathComponents[0];this._parentURL=pathComponents.slice(0,-1).join("/");this._name=pathComponents[pathComponents.length-1];this._contentType=contentType;this._requestContentCallbacks=[];this.history=[];this._hasUnsavedCommittedChanges=false;this._messages=[];}
WebInspector.UISourceCode.Events={WorkingCopyChanged:"WorkingCopyChanged",WorkingCopyCommitted:"WorkingCopyCommitted",TitleChanged:"TitleChanged",SourceMappingChanged:"SourceMappingChanged",MessageAdded:"MessageAdded",MessageRemoved:"MessageRemoved",}
WebInspector.UISourceCode.prototype={name:function()
{return this._name;},url:function()
{return this._url;},parentURL:function()
{return this._parentURL;},origin:function()
{return this._origin;},fullDisplayName:function()
{var parentPath=this._parentURL.replace(/^(?:https?|file)\:\/\//,"");try{parentPath=decodeURI(parentPath);}catch(e){}
return parentPath+"/"+this.displayName(true);},displayName:function(skipTrim)
{if(!this._name)
return WebInspector.UIString("(index)");var name=this._name;try{name=decodeURI(name);}catch(e){}
return skipTrim?name:name.trimEnd(100);},isFromServiceProject:function()
{return WebInspector.Project.isServiceProject(this._project);},canRename:function()
{return this._project.canRename();},rename:function(newName,callback)
{this._project.rename(this,newName,innerCallback.bind(this));function innerCallback(success,newName,newURL,newContentType)
{if(success)
this._updateName((newName),(newURL),(newContentType));callback(success);}},remove:function()
{this._project.deleteFile(this.url());},_updateName:function(name,url,contentType)
{var oldURД=this.url();this._url=this._url.substring(0,this._url.length-this._name.length)+name;this._name=name;if(url)
this._url=url;if(contentType)
this._contentType=contentType;this.dispatchEventToListeners(WebInspector.UISourceCode.Events.TitleChanged,oldURД);},contentURL:function()
{return this.url();},contentType:function()
{return this._contentType;},project:function()
{return this._project;},requestContent:function(callback)
{if(this._content||this._contentLoaded){callback(this._content);return;}
this._requestContentCallbacks.push(callback);if(this._requestContentCallbacks.length===1)
this._project.requestFileContent(this,this._fireContentAvailable.bind(this));},requestContentPromise:function()
{return new Promise(succ=>this.requestContent(succ));},_pushCheckContentUpdatedCallback:function(callback)
{if(!this._checkContentUpdatedCallbacks)
this._checkContentUpdatedCallbacks=[];this._checkContentUpdatedCallbacks.push(callback);},_terminateContentCheck:function()
{delete this._checkingContent;if(this._checkContentUpdatedCallbacks){this._checkContentUpdatedCallbacks.forEach(function(callback){callback();});delete this._checkContentUpdatedCallbacks;}},checkContentUpdated:function(forceLoad,callback)
{callback=callback||function(){};forceLoad=forceLoad||this._forceLoadOnCheckContent;if(!this.contentLoaded()&&!forceLoad){callback();return;}
if(!this._project.canSetFileContent()){callback();return;}
this._pushCheckContentUpdatedCallback(callback);if(this._checkingContent)
return;this._checkingContent=true;this._project.requestFileContent(this,contentLoaded.bind(this));function contentLoaded(updatedContent)
{if(updatedContent===null){var workingCopy=this.workingCopy();this._contentCommitted("",true,false);this.setWorkingCopy(workingCopy);this._terminateContentCheck();return;}
if(typeof this._lastAcceptedContent==="string"&&this._lastAcceptedContent===updatedContent){this._terminateContentCheck();return;}
if(this._content===updatedContent){delete this._lastAcceptedContent;this._terminateContentCheck();return;}
if(!this.isDirty()||this._workingCopy===updatedContent){this._contentCommitted(updatedContent,true,false);this._terminateContentCheck();return;}
var shouldUpdate=window.confirm(WebInspector.UIString("This file was changed externally. Would you like to reload it?"));if(shouldUpdate)
this._contentCommitted(updatedContent,true,false);else
this._lastAcceptedContent=updatedContent;this._terminateContentCheck();}},forceLoadOnCheckContent:function()
{this._forceLoadOnCheckContent=true;},requestOriginalContent:function(callback)
{this._project.requestFileContent(this,callback);},_commitContent:function(content)
{var wasPersisted=false;if(this._project.canSetFileContent()){this._project.setFileContent(this,content,function(){});wasPersisted=true;}else if(this._project.workspace().hasResourceContentTrackingExtensions()){wasPersisted=true;}else if(this._url&&WebInspector.fileManager.isURLSaved(this._url)){WebInspector.fileManager.save(this._url,content,false,function(){});WebInspector.fileManager.close(this._url);wasPersisted=true;}
this._contentCommitted(content,wasPersisted,true);},_contentCommitted:function(content,wasPersisted,committedByUser)
{delete this._lastAcceptedContent;this._content=content;this._contentLoaded=true;var lastRevision=this.history.length?this.history[this.history.length-1]:null;if(!lastRevision||lastRevision._content!==this._content){var revision=new WebInspector.Revision(this,this._content,new Date());this.history.push(revision);}
this._innerResetWorkingCopy();this._hasUnsavedCommittedChanges=!wasPersisted;this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyCommitted);this._project.workspace().dispatchEventToListeners(WebInspector.Workspace.Events.WorkingCopyCommitted,{uiSourceCode:this,content:content});if(committedByUser)
this._project.workspace().dispatchEventToListeners(WebInspector.Workspace.Events.WorkingCopyCommittedByUser,{uiSourceCode:this,content:content});},saveAs:function()
{WebInspector.fileManager.save(this._url,this.workingCopy(),true,callback.bind(this));WebInspector.fileManager.close(this._url);function callback(accepted)
{if(accepted)
this._contentCommitted(this.workingCopy(),true,true);}},hasUnsavedCommittedChanges:function()
{return this._hasUnsavedCommittedChanges;},addRevision:function(content)
{this._commitContent(content);},revertToOriginal:function()
{function callback(content)
{if(typeof content!=="string")
return;this.addRevision(content);}
WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.RevisionApplied);this.requestOriginalContent(callback.bind(this));},revertAndClearHistory:function(callback)
{function revert(content)
{if(typeof content!=="string")
return;this.addRevision(content);this.history=[];callback(this);}
WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.RevisionApplied);this.requestOriginalContent(revert.bind(this));},workingCopy:function()
{if(this._workingCopyGetter){this._workingCopy=this._workingCopyGetter();delete this._workingCopyGetter;}
if(this.isDirty())
return this._workingCopy;return this._content;},resetWorkingCopy:function()
{this._innerResetWorkingCopy();this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyChanged);},_innerResetWorkingCopy:function()
{delete this._workingCopy;delete this._workingCopyGetter;},setWorkingCopy:function(newWorkingCopy)
{this._workingCopy=newWorkingCopy;delete this._workingCopyGetter;this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyChanged);this._project.workspace().dispatchEventToListeners(WebInspector.Workspace.Events.WorkingCopyChanged,{uiSourceCode:this});},setWorkingCopyGetter:function(workingCopyGetter)
{this._workingCopyGetter=workingCopyGetter;this.dispatchEventToListeners(WebInspector.UISourceCode.Events.WorkingCopyChanged);this._project.workspace().dispatchEventToListeners(WebInspector.Workspace.Events.WorkingCopyChanged,{uiSourceCode:this});},removeWorkingCopyGetter:function()
{if(!this._workingCopyGetter)
return;this._workingCopy=this._workingCopyGetter();delete this._workingCopyGetter;},commitWorkingCopy:function()
{if(this.isDirty())
this._commitContent(this.workingCopy());},isDirty:function()
{return typeof this._workingCopy!=="undefined"||typeof this._workingCopyGetter!=="undefined";},extension:function()
{return WebInspector.TextUtils.extension(this._name);},content:function()
{return this._content;},searchInContent:function(query,caseSensitive,isRegex,callback)
{var content=this.content();if(content){WebInspector.StaticContentProvider.searchInContent(content,query,caseSensitive,isRegex,callback);return;}
this._project.searchInFileContent(this,query,caseSensitive,isRegex,callback);},_fireContentAvailable:function(content)
{this._contentLoaded=true;this._content=content;var callbacks=this._requestContentCallbacks.slice();this._requestContentCallbacks=[];for(var i=0;i<callbacks.length;++i)
callbacks[i](content);},contentLoaded:function()
{return this._contentLoaded;},uiLocation:function(lineNumber,columnNumber)
{if(typeof columnNumber==="undefined")
columnNumber=0;return new WebInspector.UILocation(this,lineNumber,columnNumber);},messages:function()
{return this._messages.slice();},addLineMessage:function(level,text,lineNumber,columnNumber)
{return this.addMessage(level,text,new WebInspector.TextRange(lineNumber,columnNumber||0,lineNumber,columnNumber||0));},addMessage:function(level,text,range)
{var message=new WebInspector.UISourceCode.Message(this,level,text,range);this._messages.push(message);this.dispatchEventToListeners(WebInspector.UISourceCode.Events.MessageAdded,message);return message;},removeMessage:function(message)
{if(this._messages.remove(message))
this.dispatchEventToListeners(WebInspector.UISourceCode.Events.MessageRemoved,message);},removeAllMessages:function()
{var messages=this._messages;this._messages=[];for(var message of messages)
this.dispatchEventToListeners(WebInspector.UISourceCode.Events.MessageRemoved,message);},__proto__:WebInspector.Object.prototype}
WebInspector.UILocation=function(uiSourceCode,lineNumber,columnNumber)
{this.uiSourceCode=uiSourceCode;this.lineNumber=lineNumber;this.columnNumber=columnNumber;}
WebInspector.UILocation.prototype={linkText:function()
{var linkText=this.uiSourceCode.displayName();if(typeof this.lineNumber==="number")
linkText+=":"+(this.lineNumber+1);return linkText;},id:function()
{return this.uiSourceCode.project().id()+":"+this.uiSourceCode.url()+":"+this.lineNumber+":"+this.columnNumber;},toUIString:function()
{return this.uiSourceCode.url()+":"+(this.lineNumber+1);}}
WebInspector.Revision=function(uiSourceCode,content,timestamp)
{this._uiSourceCode=uiSourceCode;this._content=content;this._timestamp=timestamp;}
WebInspector.Revision.prototype={get uiSourceCode()
{return this._uiSourceCode;},get timestamp()
{return this._timestamp;},get content()
{return this._content||null;},revertToThis:function()
{function revert(content)
{if(this._uiSourceCode._content!==content)
this._uiSourceCode.addRevision(content);}
WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.RevisionApplied);this.requestContent(revert.bind(this));},contentURL:function()
{return this._uiSourceCode.url();},contentType:function()
{return this._uiSourceCode.contentType();},requestContent:function(callback)
{callback(this._content||"");},searchInContent:function(query,caseSensitive,isRegex,callback)
{callback([]);}}
WebInspector.UISourceCode.Message=function(uiSourceCode,level,text,range)
{this._uiSourceCode=uiSourceCode;this._level=level;this._text=text;this._range=range;}
WebInspector.UISourceCode.Message.Level={Error:"Error",Warning:"Warning"}
WebInspector.UISourceCode.Message.prototype={uiSourceCode:function()
{return this._uiSourceCode;},level:function()
{return this._level;},text:function()
{return this._text;},range:function(){return this._range;},lineNumber:function()
{return this._range.startLine;},columnNumber:function()
{return this._range.startColumn;},isEqual:function(another)
{return this._uiSourceCode===another._uiSourceCode&&this.text()===another.text()&&this.level()===another.level()&&this.range().equal(another.range());},remove:function()
{this._uiSourceCode.removeMessage(this);}};WebInspector.ProjectSearchConfig=function(){}
WebInspector.ProjectSearchConfig.prototype={query:function(){},ignoreCase:function(){},isRegex:function(){},queries:function(){},filePathMatchesFileQuery:function(filePath){}}
WebInspector.Project=function(){}
WebInspector.Project.isServiceProject=function(project)
{return project.type()===WebInspector.projectTypes.Debugger||project.type()===WebInspector.projectTypes.Formatter||project.type()===WebInspector.projectTypes.Service;}
WebInspector.Project.prototype={workspace:function(){},id:function(){},type:function(){},displayName:function(){},requestFileContent:function(uiSourceCode,callback){},canSetFileContent:function(){},setFileContent:function(uiSourceCode,newContent,callback){},canRename:function(){},rename:function(uiSourceCode,newName,callback){},refresh:function(path,callback){},excludeFolder:function(path){},createFile:function(path,name,content,callback){},deleteFile:function(path){},remove:function(){},searchInFileContent:function(uiSourceCode,query,caseSensitive,isRegex,callback){},findFilesMatchingSearchRequest:function(searchConfig,filesMathingFileQuery,progress,callback){},indexContent:function(progress){},uiSourceCodeForURL:function(url){},uiSourceCodes:function(){}}
WebInspector.projectTypes={Debugger:"debugger",Formatter:"formatter",Network:"network",Snippets:"snippets",FileSystem:"filesystem",ContentScripts:"contentscripts",Service:"service"}
WebInspector.ProjectStore=function(workspace,id,type,displayName)
{this._workspace=workspace;this._id=id;this._type=type;this._displayName=displayName;this._uiSourceCodesMap=new Map();this._uiSourceCodesList=[];this._project=(this);}
WebInspector.ProjectStore.prototype={id:function()
{return this._id;},type:function()
{return this._type;},displayName:function()
{return this._displayName;},workspace:function()
{return this._workspace;},createUISourceCode:function(url,contentType)
{return new WebInspector.UISourceCode(this._project,url,contentType);},addUISourceCode:function(uiSourceCode,replace)
{var url=uiSourceCode.url();if(this.uiSourceCodeForURL(url)){if(replace)
this.removeUISourceCode(url);else
return false;}
this._uiSourceCodesMap.set(url,{uiSourceCode:uiSourceCode,index:this._uiSourceCodesList.length});this._uiSourceCodesList.push(uiSourceCode);this._workspace.dispatchEventToListeners(WebInspector.Workspace.Events.UISourceCodeAdded,uiSourceCode);return true;},removeUISourceCode:function(url)
{var uiSourceCode=this.uiSourceCodeForURL(url);if(!uiSourceCode)
return;var entry=this._uiSourceCodesMap.get(url);var movedUISourceCode=this._uiSourceCodesList[this._uiSourceCodesList.length-1];this._uiSourceCodesList[entry.index]=movedUISourceCode;var movedEntry=this._uiSourceCodesMap.get(movedUISourceCode.url());movedEntry.index=entry.index;this._uiSourceCodesList.splice(this._uiSourceCodesList.length-1,1);this._uiSourceCodesMap.delete(url);this._workspace.dispatchEventToListeners(WebInspector.Workspace.Events.UISourceCodeRemoved,entry.uiSourceCode);},removeProject:function()
{this._workspace._removeProject(this._project);this._uiSourceCodesMap=new Map();this._uiSourceCodesList=[];},uiSourceCodeForURL:function(url)
{var entry=this._uiSourceCodesMap.get(url);return entry?entry.uiSourceCode:null;},uiSourceCodes:function()
{return this._uiSourceCodesList;},renameUISourceCode:function(uiSourceCode,newName)
{var oldPath=uiSourceCode.url();var newPath=uiSourceCode.parentURL()?uiSourceCode.parentURL()+"/"+newName:newName;var value=(this._uiSourceCodesMap.get(oldPath));this._uiSourceCodesMap.set(newPath,value);this._uiSourceCodesMap.delete(oldPath);}}
WebInspector.Workspace=function()
{this._projects=new Map();this._hasResourceContentTrackingExtensions=false;}
WebInspector.Workspace.Events={UISourceCodeAdded:"UISourceCodeAdded",UISourceCodeRemoved:"UISourceCodeRemoved",WorkingCopyChanged:"WorkingCopyChanged",WorkingCopyCommitted:"WorkingCopyCommitted",WorkingCopyCommittedByUser:"WorkingCopyCommittedByUser",ProjectAdded:"ProjectAdded",ProjectRemoved:"ProjectRemoved"}
WebInspector.Workspace.prototype={unsavedSourceCodes:function()
{function filterUnsaved(sourceCode)
{return sourceCode.isDirty();}
var unsavedSourceCodes=[];var projects=this.projectsForType(WebInspector.projectTypes.FileSystem);for(var i=0;i<projects.length;++i)
unsavedSourceCodes=unsavedSourceCodes.concat(projects[i].uiSourceCodes().filter(filterUnsaved));return unsavedSourceCodes;},uiSourceCode:function(projectId,url)
{var project=this._projects.get(projectId);return project?project.uiSourceCodeForURL(url):null;},uiSourceCodeForURL:function(url)
{for(var project of this._projects.values()){var uiSourceCode=project.uiSourceCodeForURL(url);if(uiSourceCode)
return uiSourceCode;}
return null;},uiSourceCodesForProjectType:function(type)
{var result=[];for(var project of this._projects.values()){if(project.type()===type)
result=result.concat(project.uiSourceCodes());}
return result;},addProject:function(project)
{this._projects.set(project.id(),project);this.dispatchEventToListeners(WebInspector.Workspace.Events.ProjectAdded,project);},_removeProject:function(project)
{this._projects.delete(project.id());this.dispatchEventToListeners(WebInspector.Workspace.Events.ProjectRemoved,project);},project:function(projectId)
{return this._projects.get(projectId)||null;},projects:function()
{return Array.from(this._projects.values());},projectsForType:function(type)
{function filterByType(project)
{return project.type()===type;}
return this.projects().filter(filterByType);},uiSourceCodes:function()
{var result=[];for(var project of this._projects.values())
result=result.concat(project.uiSourceCodes());return result;},setHasResourceContentTrackingExtensions:function(hasExtensions)
{this._hasResourceContentTrackingExtensions=hasExtensions;},hasResourceContentTrackingExtensions:function()
{return this._hasResourceContentTrackingExtensions;},__proto__:WebInspector.Object.prototype}
WebInspector.workspace;;WebInspector.LiveLocation=function(updateDelegate)
{this._updateDelegate=updateDelegate;}
WebInspector.LiveLocation.prototype={update:function()
{var uiLocation=this.uiLocation();if(!uiLocation)
return;if(this._updateDelegate(uiLocation))
this.dispose();},uiLocation:function()
{throw"Not implemented";},dispose:function()
{}};WebInspector.CompilerScriptMapping=function(debuggerModel,workspace,networkMapping,networkProject,debuggerWorkspaceBinding)
{this._target=debuggerModel.target();this._debuggerModel=debuggerModel;this._workspace=workspace;this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAddedToWorkspace,this);this._networkMapping=networkMapping;this._networkProject=networkProject;this._debuggerWorkspaceBinding=debuggerWorkspaceBinding;this._sourceMapForSourceMapURL={};this._pendingSourceMapLoadingCallbacks={};this._sourceMapForScriptId={};this._scriptForSourceMap=new Map();this._sourceMapForURL=new Map();this._stubUISourceCodes=new Map();this._stubProjectID="compiler-script-project";this._stubProject=new WebInspector.ContentProviderBasedProject(this._workspace,this._stubProjectID,WebInspector.projectTypes.Service,"");debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);}
WebInspector.CompilerScriptMapping.StubProjectID="compiler-script-project";WebInspector.CompilerScriptMapping._originSymbol=Symbol("origin");WebInspector.CompilerScriptMapping.uiSourceCodeOrigin=function(uiSourceCode)
{return uiSourceCode[WebInspector.CompilerScriptMapping._originSymbol]||null;}
WebInspector.CompilerScriptMapping.prototype={mapsToSourceCode:function(rawLocation){var sourceMap=this._sourceMapForScriptId[rawLocation.scriptId];if(!sourceMap){return true;}
return!!sourceMap.findEntry(rawLocation.lineNumber,rawLocation.columnNumber);},rawLocationToUILocation:function(rawLocation)
{var debuggerModelLocation=(rawLocation);var stubUISourceCode=this._stubUISourceCodes.get(debuggerModelLocation.scriptId);if(stubUISourceCode)
return new WebInspector.UILocation(stubUISourceCode,rawLocation.lineNumber,rawLocation.columnNumber);var sourceMap=this._sourceMapForScriptId[debuggerModelLocation.scriptId];if(!sourceMap)
return null;var lineNumber=debuggerModelLocation.lineNumber;var columnNumber=debuggerModelLocation.columnNumber||0;var entry=sourceMap.findEntry(lineNumber,columnNumber);if(!entry||!entry.sourceURL)
return null;var uiSourceCode=this._networkMapping.uiSourceCodeForScriptURL((entry.sourceURL),rawLocation.script());if(!uiSourceCode)
return null;return uiSourceCode.uiLocation((entry.sourceLineNumber),(entry.sourceColumnNumber));},uiLocationToRawLocation:function(uiSourceCode,lineNumber,columnNumber)
{if(uiSourceCode.project().type()===WebInspector.projectTypes.Service)
return null;var networkURL=this._networkMapping.networkURL(uiSourceCode);if(!networkURL)
return null;var sourceMap=this._sourceMapForURL.get(networkURL);if(!sourceMap)
return null;var script=(this._scriptForSourceMap.get(sourceMap));console.assert(script);var entry=sourceMap.firstSourceLineMapping(networkURL,lineNumber);if(!entry)
return null;return this._debuggerModel.createRawLocation(script,entry.lineNumber,entry.columnNumber);},addScript:function(script)
{if(!script.sourceMapURL){script.addEventListener(WebInspector.Script.Events.SourceMapURLAdded,this._sourceMapURLAdded.bind(this));return;}
this._processScript(script);},_sourceMapURLAdded:function(event)
{var script=(event.target);if(!script.sourceMapURL)
return;this._processScript(script);},_processScript:function(script)
{var stubUISourceCode=this._stubProject.addContentProvider(script.sourceURL,new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Script,"\n\n\n\n\n// Please wait a bit.\n// Compiled script is not shown while source map is being loaded!",script.sourceURL));this._stubUISourceCodes.set(script.scriptId,stubUISourceCode);this._debuggerWorkspaceBinding.pushSourceMapping(script,this);this._loadSourceMapForScript(script,this._sourceMapLoaded.bind(this,script,stubUISourceCode.url()));},_sourceMapLoaded:function(script,uiSourceCodePath,sourceMap)
{this._stubUISourceCodes.delete(script.scriptId);this._stubProject.removeFile(uiSourceCodePath);if(!sourceMap){this._debuggerWorkspaceBinding.updateLocations(script);return;}
if(this._scriptForSourceMap.get(sourceMap)){this._sourceMapForScriptId[script.scriptId]=sourceMap;this._debuggerWorkspaceBinding.updateLocations(script);return;}
this._sourceMapForScriptId[script.scriptId]=sourceMap;this._scriptForSourceMap.set(sourceMap,script);var sourceURLs=sourceMap.sources();var missingSources=[];for(var i=0;i<sourceURLs.length;++i){var sourceURL=sourceURLs[i];if(this._sourceMapForURL.get(sourceURL))
continue;this._sourceMapForURL.set(sourceURL,sourceMap);var uiSourceCode=this._networkMapping.uiSourceCodeForScriptURL(sourceURL,script);if(!uiSourceCode&&!this._networkMapping.hasMappingForNetworkURL(sourceURL)){var contentProvider=sourceMap.sourceContentProvider(sourceURL,WebInspector.resourceTypes.SourceMapScript);uiSourceCode=this._networkProject.addFileForURL(sourceURL,contentProvider,WebInspector.ResourceTreeFrame.fromScript(script),script.isContentScript());uiSourceCode[WebInspector.CompilerScriptMapping._originSymbol]=script.sourceURL;}
if(uiSourceCode){this._bindUISourceCode(uiSourceCode);}else{if(missingSources.length<3)
missingSources.push(sourceURL);else if(missingSources.peekLast()!=="\u2026")
missingSources.push("\u2026");}}
if(missingSources.length){WebInspector.console.warn(WebInspector.UIString("Source map %s points to the files missing from the workspace: [%s]",sourceMap.url(),missingSources.join(", ")));}
this._debuggerWorkspaceBinding.updateLocations(script);},isIdentity:function()
{return false;},uiLineHasMapping:function(uiSourceCode,lineNumber)
{var networkURL=this._networkMapping.networkURL(uiSourceCode);if(!networkURL)
return true;var sourceMap=this._sourceMapForURL.get(networkURL);if(!sourceMap)
return true;return!!sourceMap.firstSourceLineMapping(networkURL,lineNumber);},_bindUISourceCode:function(uiSourceCode)
{this._debuggerWorkspaceBinding.setSourceMapping(this._target,uiSourceCode,this);},_unbindUISourceCode:function(uiSourceCode)
{this._debuggerWorkspaceBinding.setSourceMapping(this._target,uiSourceCode,null);},_uiSourceCodeAddedToWorkspace:function(event)
{var uiSourceCode=(event.data);var networkURL=this._networkMapping.networkURL(uiSourceCode);if(!networkURL||!this._sourceMapForURL.get(networkURL))
return;this._bindUISourceCode(uiSourceCode);},_loadSourceMapForScript:function(script,callback)
{var scriptURL=WebInspector.ParsedURL.completeURL(this._target.resourceTreeModel.inspectedPageURL(),script.sourceURL);if(!scriptURL){callback(null);return;}
console.assert(script.sourceMapURL);var scriptSourceMapURL=(script.sourceMapURL);var sourceMapURL=WebInspector.ParsedURL.completeURL(scriptURL,scriptSourceMapURL);if(!sourceMapURL){callback(null);return;}
var sourceMap=this._sourceMapForSourceMapURL[sourceMapURL];if(sourceMap){callback(sourceMap);return;}
var pendingCallbacks=this._pendingSourceMapLoadingCallbacks[sourceMapURL];if(pendingCallbacks){pendingCallbacks.push(callback);return;}
pendingCallbacks=[callback];this._pendingSourceMapLoadingCallbacks[sourceMapURL]=pendingCallbacks;WebInspector.SourceMap.load(sourceMapURL,scriptURL,sourceMapLoaded.bind(this));function sourceMapLoaded(sourceMap)
{var url=(sourceMapURL);var callbacks=this._pendingSourceMapLoadingCallbacks[url];delete this._pendingSourceMapLoadingCallbacks[url];if(!callbacks)
return;if(sourceMap)
this._sourceMapForSourceMapURL[url]=sourceMap;for(var i=0;i<callbacks.length;++i)
callbacks[i](sourceMap);}},_debuggerReset:function()
{function unbindSourceMapSources(sourceMap)
{var script=this._scriptForSourceMap.get(sourceMap);if(!script)
return;var sourceURLs=sourceMap.sources();for(var i=0;i<sourceURLs.length;++i){var uiSourceCode=this._networkMapping.uiSourceCodeForScriptURL(sourceURLs[i],script);if(uiSourceCode)
this._unbindUISourceCode(uiSourceCode);}}
this._sourceMapForURL.valuesArray().forEach(unbindSourceMapSources.bind(this));this._sourceMapForSourceMapURL={};this._pendingSourceMapLoadingCallbacks={};this._sourceMapForScriptId={};this._scriptForSourceMap.clear();this._sourceMapForURL.clear();},dispose:function()
{this._workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAddedToWorkspace,this);}};WebInspector.ResourceScriptMapping=function(debuggerModel,workspace,networkMapping,debuggerWorkspaceBinding)
{this._target=debuggerModel.target();this._debuggerModel=debuggerModel;this._workspace=workspace;this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAdded,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);this._networkMapping=networkMapping;this._debuggerWorkspaceBinding=debuggerWorkspaceBinding;this._boundUISourceCodes=[];this._uiSourceCodeToScriptFile=new Map();debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);}
WebInspector.ResourceScriptMapping.prototype={rawLocationToUILocation:function(rawLocation)
{var debuggerModelLocation=(rawLocation);var script=debuggerModelLocation.script();var uiSourceCode=this._workspaceUISourceCodeForScript(script);if(!uiSourceCode)
return null;var scriptFile=this.scriptFile(uiSourceCode);if(scriptFile&&((scriptFile.hasDivergedFromVM()&&!scriptFile.isMergingToVM())||scriptFile.isDivergingFromVM()))
return null;var lineNumber=debuggerModelLocation.lineNumber-(script.isInlineScriptWithSourceURL()?script.lineOffset:0);var columnNumber=debuggerModelLocation.columnNumber||0;if(script.isInlineScriptWithSourceURL()&&!lineNumber&&columnNumber)
columnNumber-=script.columnOffset;return uiSourceCode.uiLocation(lineNumber,columnNumber);},uiLocationToRawLocation:function(uiSourceCode,lineNumber,columnNumber)
{var scripts=this._scriptsForUISourceCode(uiSourceCode);console.assert(scripts.length);var script=scripts[0];if(script.isInlineScriptWithSourceURL())
return this._debuggerModel.createRawLocation(script,lineNumber+script.lineOffset,lineNumber?columnNumber:columnNumber+script.columnOffset);return this._debuggerModel.createRawLocation(script,lineNumber,columnNumber);},addScript:function(script)
{if(script.isAnonymousScript())
return;this._debuggerWorkspaceBinding.pushSourceMapping(script,this);var uiSourceCode=this._workspaceUISourceCodeForScript(script);if(!uiSourceCode)
return;this._bindUISourceCodeToScripts(uiSourceCode,[script]);},isIdentity:function()
{return true;},uiLineHasMapping:function(uiSourceCode,lineNumber)
{return true;},scriptFile:function(uiSourceCode)
{return this._uiSourceCodeToScriptFile.get(uiSourceCode)||null;},_setScriptFile:function(uiSourceCode,scriptFile)
{if(scriptFile)
this._uiSourceCodeToScriptFile.set(uiSourceCode,scriptFile);else
this._uiSourceCodeToScriptFile.remove(uiSourceCode);},_uiSourceCodeAdded:function(event)
{var uiSourceCode=(event.data);if(!this._networkMapping.networkURL(uiSourceCode))
return;if(uiSourceCode.isFromServiceProject())
return;var scripts=this._scriptsForUISourceCode(uiSourceCode);if(!scripts.length)
return;this._bindUISourceCodeToScripts(uiSourceCode,scripts);},_uiSourceCodeRemoved:function(event)
{var uiSourceCode=(event.data);if(!this._networkMapping.networkURL(uiSourceCode))
return;if(uiSourceCode.isFromServiceProject())
return;this._unbindUISourceCode(uiSourceCode);},_updateLocations:function(uiSourceCode)
{var scripts=this._scriptsForUISourceCode(uiSourceCode);if(!scripts.length)
return;for(var i=0;i<scripts.length;++i)
this._debuggerWorkspaceBinding.updateLocations(scripts[i]);},_workspaceUISourceCodeForScript:function(script)
{if(script.isAnonymousScript())
return null;return this._networkMapping.uiSourceCodeForScriptURL(script.sourceURL,script);},_scriptsForUISourceCode:function(uiSourceCode)
{var target=WebInspector.NetworkProject.targetForUISourceCode(uiSourceCode);if(target&&target!==this._debuggerModel.target())
return[];if(!this._networkMapping.networkURL(uiSourceCode))
return[];return this._debuggerModel.scriptsForSourceURL(this._networkMapping.networkURL(uiSourceCode));},_bindUISourceCodeToScripts:function(uiSourceCode,scripts)
{console.assert(scripts.length);var boundScriptFile=this.scriptFile(uiSourceCode);if(boundScriptFile&&boundScriptFile._hasScripts(scripts))
return;var scriptFile=new WebInspector.ResourceScriptFile(this,uiSourceCode,scripts);this._setScriptFile(uiSourceCode,scriptFile);for(var i=0;i<scripts.length;++i)
this._debuggerWorkspaceBinding.updateLocations(scripts[i]);this._debuggerWorkspaceBinding.setSourceMapping(this._target,uiSourceCode,this);this._boundUISourceCodes.push(uiSourceCode);},_unbindUISourceCode:function(uiSourceCode)
{var scriptFile=this.scriptFile(uiSourceCode);if(scriptFile){scriptFile.dispose();this._setScriptFile(uiSourceCode,null);}
this._debuggerWorkspaceBinding.setSourceMapping(this._target,uiSourceCode,null);this._boundUISourceCodes.remove(uiSourceCode);},_debuggerReset:function()
{var sourceCodes=this._boundUISourceCodes;this._boundUISourceCodes=[];sourceCodes.forEach(this._unbindUISourceCode.bind(this));console.assert(!this._uiSourceCodeToScriptFile.size);},dispose:function()
{this._debuggerReset();this._workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAdded,this);this._workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);}}
WebInspector.ResourceScriptFile=function(resourceScriptMapping,uiSourceCode,scripts)
{console.assert(scripts.length);this._resourceScriptMapping=resourceScriptMapping;this._uiSourceCode=uiSourceCode;this._uiSourceCode.forceLoadOnCheckContent();if(this._uiSourceCode.contentType().isScript())
this._script=scripts[0];this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);}
WebInspector.ResourceScriptFile.Events={DidMergeToVM:"DidMergeToVM",DidDivergeFromVM:"DidDivergeFromVM",}
WebInspector.ResourceScriptFile.prototype={_hasScripts:function(scripts)
{return this._script&&this._script===scripts[0];},_isDiverged:function()
{if(this._uiSourceCode.isDirty())
return true;if(!this._script)
return false;if(typeof this._scriptSource==="undefined")
return false;if(!this._uiSourceCode.workingCopy().startsWith(this._scriptSource.trimRight()))
return true;var suffix=this._uiSourceCode.workingCopy().substr(this._scriptSource.length);return!!suffix.length&&!suffix.match(WebInspector.Script.sourceURLRegex);},_workingCopyChanged:function(event)
{this._update();},_workingCopyCommitted:function(event)
{if(this._uiSourceCode.project().type()===WebInspector.projectTypes.Snippets)
return;if(!this._script)
return;var debuggerModel=this._resourceScriptMapping._debuggerModel;var source=this._uiSourceCode.workingCopy();debuggerModel.setScriptSource(this._script.scriptId,source,scriptSourceWasSet.bind(this));function scriptSourceWasSet(error,errorData)
{if(!error)
this._scriptSource=source;this._update();if(!error)
return;var warningLevel=WebInspector.Console.MessageLevel.Warning;if(!errorData){WebInspector.console.addMessage(WebInspector.UIString("LiveEdit failed: %s",error),warningLevel);return;}
var compileError=errorData.compileError;if(compileError){var messageText=WebInspector.UIString("LiveEdit compile failed: %s",compileError.message);this._uiSourceCode.addLineMessage(WebInspector.UISourceCode.Message.Level.Error,messageText,compileError.lineNumber-1,compileError.columnNumber+1);}else{WebInspector.console.addMessage(WebInspector.UIString("Unknown LiveEdit error: %s; %s",JSON.stringify(errorData),error),warningLevel);}}},_update:function()
{if(this._isDiverged()&&!this._hasDivergedFromVM)
this._divergeFromVM();else if(!this._isDiverged()&&this._hasDivergedFromVM)
this._mergeToVM();},_divergeFromVM:function()
{this._isDivergingFromVM=true;this._resourceScriptMapping._updateLocations(this._uiSourceCode);delete this._isDivergingFromVM;this._hasDivergedFromVM=true;this.dispatchEventToListeners(WebInspector.ResourceScriptFile.Events.DidDivergeFromVM,this._uiSourceCode);},_mergeToVM:function()
{delete this._hasDivergedFromVM;this._isMergingToVM=true;this._resourceScriptMapping._updateLocations(this._uiSourceCode);delete this._isMergingToVM;this.dispatchEventToListeners(WebInspector.ResourceScriptFile.Events.DidMergeToVM,this._uiSourceCode);},hasDivergedFromVM:function()
{return this._hasDivergedFromVM;},isDivergingFromVM:function()
{return this._isDivergingFromVM;},isMergingToVM:function()
{return this._isMergingToVM;},checkMapping:function()
{if(!this._script)
return;if(typeof this._scriptSource!=="undefined")
return;this._script.requestContent(callback.bind(this));function callback(source)
{this._scriptSource=source;this._update();}},target:function()
{if(!this._script)
return null;return this._script.target();},dispose:function()
{this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);},addSourceMapURL:function(sourceMapURL)
{if(!this._script)
return;this._script.addSourceMapURL(sourceMapURL);},hasSourceMapURL:function()
{return this._script&&!!this._script.sourceMapURL;},__proto__:WebInspector.Object.prototype};WebInspector.SASSSourceMapping=function(cssModel,networkMapping,networkProject)
{this._cssModel=cssModel;this._networkProject=networkProject;this._reset();WebInspector.moduleSetting("cssSourceMapsEnabled").addChangeListener(this._toggleSourceMapSupport,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this._styleSheetChanged,this);cssModel.target().resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._reset,this);this._networkMapping=networkMapping;}
WebInspector.SASSSourceMapping.prototype={_styleSheetChanged:function(event)
{var id=(event.data.styleSheetId);var header=this._cssModel.styleSheetHeaderForId(id);if(!header)
return;this.removeHeader(header);this.addHeader(header);},_toggleSourceMapSupport:function(event)
{var enabled=(event.data);var headers=this._cssModel.styleSheetHeaders();for(var i=0;i<headers.length;++i){if(enabled)
this.addHeader(headers[i]);else
this.removeHeader(headers[i]);}},addHeader:function(header)
{if(!header.sourceMapURL||!header.sourceURL||!WebInspector.moduleSetting("cssSourceMapsEnabled").get())
return;var completeSourceMapURL=WebInspector.ParsedURL.completeURL(header.sourceURL,header.sourceMapURL);if(!completeSourceMapURL)
return;this._loadSourceMap(completeSourceMapURL,header,sourceMapLoaded.bind(this));function sourceMapLoaded(sourceMap)
{if(sourceMap)
this._sourceMapByStyleSheetURL[header.sourceURL]=sourceMap;else
delete this._sourceMapByStyleSheetURL[header.sourceURL];WebInspector.cssWorkspaceBinding.pushSourceMapping(header,this);}},removeHeader:function(header)
{if(!header.sourceURL)
return;delete this._sourceMapByStyleSheetURL[header.sourceURL];WebInspector.cssWorkspaceBinding.updateLocations(header);},_loadSourceMap:function(completeSourceMapURL,header,callback)
{var sourceMap=this._sourceMapByURL[completeSourceMapURL];if(sourceMap){callback(sourceMap);return;}
var pendingCallbacks=this._pendingSourceMapLoadingCallbacks[completeSourceMapURL];if(pendingCallbacks){pendingCallbacks.push(callback);return;}
pendingCallbacks=[callback];this._pendingSourceMapLoadingCallbacks[completeSourceMapURL]=pendingCallbacks;WebInspector.SourceMap.load(completeSourceMapURL,header.sourceURL,sourceMapLoaded.bind(this));function sourceMapLoaded(sourceMap)
{var callbacks=this._pendingSourceMapLoadingCallbacks[completeSourceMapURL];delete this._pendingSourceMapLoadingCallbacks[completeSourceMapURL];if(sourceMap)
this._sourceMapByURL[completeSourceMapURL]=sourceMap;else
delete this._sourceMapByURL[completeSourceMapURL];var sources=sourceMap?sourceMap.sources():[];for(var i=0;i<sources.length;++i){var sassURL=sources[i];if(!this._networkMapping.hasMappingForNetworkURL(sassURL)){var contentProvider=sourceMap.sourceContentProvider(sassURL,WebInspector.resourceTypes.SourceMapStyleSheet);this._networkProject.addFileForURL(sassURL,contentProvider,WebInspector.ResourceTreeFrame.fromStyleSheet(header));}}
for(var i=0;callbacks&&i<callbacks.length;++i)
callbacks[i](sourceMap);}},rawLocationToUILocation:function(rawLocation)
{var sourceMap=this._sourceMapByStyleSheetURL[rawLocation.url];if(!sourceMap)
return null;var entry=sourceMap.findEntry(rawLocation.lineNumber,rawLocation.columnNumber);if(!entry||!entry.sourceURL)
return null;var uiSourceCode=this._networkMapping.uiSourceCodeForStyleURL(entry.sourceURL,rawLocation.header());if(!uiSourceCode)
return null;return uiSourceCode.uiLocation(entry.sourceLineNumber,entry.sourceColumnNumber);},uiLocationToRawLocation:function(uiSourceCode,lineNumber,columnNumber)
{return null;},isIdentity:function()
{return false;},uiLineHasMapping:function(uiSourceCode,lineNumber)
{return true;},target:function()
{return this._cssModel.target();},_reset:function()
{this._pendingSourceMapLoadingCallbacks={};this._sourceMapByURL={};this._sourceMapByStyleSheetURL={};}};WebInspector.StylesSourceMapping=function(cssModel,workspace,networkMapping)
{this._cssModel=cssModel;this._workspace=workspace;this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved,this._projectRemoved,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAddedToWorkspace,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);this._networkMapping=networkMapping;cssModel.target().resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._unbindAllUISourceCodes,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this._styleSheetChanged,this);this._urlToHeadersByFrameId={};this._styleFiles=new Map();}
WebInspector.StylesSourceMapping.ChangeUpdateTimeoutMs=200;WebInspector.StylesSourceMapping.prototype={rawLocationToUILocation:function(rawLocation)
{var uiSourceCode=this._networkMapping.uiSourceCodeForStyleURL(rawLocation.url,rawLocation.header());if(!uiSourceCode)
return null;var lineNumber=rawLocation.lineNumber;var columnNumber=rawLocation.columnNumber;var header=this._cssModel.styleSheetHeaderForId(rawLocation.styleSheetId);if(header&&header.isInline&&header.hasSourceURL){lineNumber-=header.lineNumberInSource(0);columnNumber-=header.columnNumberInSource(lineNumber,0);}
return uiSourceCode.uiLocation(lineNumber,columnNumber);},uiLocationToRawLocation:function(uiSourceCode,lineNumber,columnNumber)
{return null;},isIdentity:function()
{return true;},uiLineHasMapping:function(uiSourceCode,lineNumber)
{return true;},target:function()
{return this._cssModel.target();},addHeader:function(header)
{var url=header.resourceURL();if(!url)
return;WebInspector.cssWorkspaceBinding.pushSourceMapping(header,this);var map=this._urlToHeadersByFrameId[url];if(!map){map=(new Map());this._urlToHeadersByFrameId[url]=map;}
var headersById=map.get(header.frameId);if(!headersById){headersById=(new Map());map.set(header.frameId,headersById);}
headersById.set(header.id,header);var uiSourceCode=this._networkMapping.uiSourceCodeForStyleURL(url,header);if(uiSourceCode)
this._bindUISourceCode(uiSourceCode,header);},removeHeader:function(header)
{var url=header.resourceURL();if(!url)
return;var map=this._urlToHeadersByFrameId[url];console.assert(map);var headersById=map.get(header.frameId);console.assert(headersById);headersById.remove(header.id);if(!headersById.size){map.remove(header.frameId);if(!map.size){delete this._urlToHeadersByFrameId[url];var uiSourceCode=this._networkMapping.uiSourceCodeForStyleURL(url,header);if(uiSourceCode)
this._unbindUISourceCode(uiSourceCode);}}},_unbindUISourceCode:function(uiSourceCode)
{var styleFile=this._styleFiles.get(uiSourceCode);if(!styleFile)
return;styleFile.dispose();this._styleFiles.remove(uiSourceCode);},_unbindAllUISourceCodes:function()
{for(var styleFile of this._styleFiles.keys())
styleFile.dispose();this._styleFiles.clear();this._urlToHeadersByFrameId={};},_uiSourceCodeAddedToWorkspace:function(event)
{var uiSourceCode=(event.data);var networkURL=this._networkMapping.networkURL(uiSourceCode);if(!networkURL||!this._urlToHeadersByFrameId[networkURL])
return;this._bindUISourceCode(uiSourceCode,this._urlToHeadersByFrameId[networkURL].valuesArray()[0].valuesArray()[0]);},_bindUISourceCode:function(uiSourceCode,header)
{if(this._styleFiles.get(uiSourceCode)||(header.isInline&&!header.hasSourceURL))
return;this._styleFiles.set(uiSourceCode,new WebInspector.StyleFile(uiSourceCode,this));WebInspector.cssWorkspaceBinding.updateLocations(header);},_projectRemoved:function(event)
{var project=(event.data);var uiSourceCodes=project.uiSourceCodes();for(var i=0;i<uiSourceCodes.length;++i)
this._unbindUISourceCode(uiSourceCodes[i]);},_uiSourceCodeRemoved:function(event)
{var uiSourceCode=(event.data);this._unbindUISourceCode(uiSourceCode);},_initialize:function()
{},_setStyleContent:function(uiSourceCode,content,majorChange)
{var networkURL=this._networkMapping.networkURL(uiSourceCode);var styleSheetIds=this._cssModel.styleSheetIdsForURL(networkURL);if(!styleSheetIds.length)
return Promise.resolve(("No stylesheet found: "+networkURL));this._isSettingContent=true;function callback(error)
{delete this._isSettingContent;return error||null;}
var promises=[];for(var i=0;i<styleSheetIds.length;++i)
promises.push(this._cssModel.setStyleSheetText(styleSheetIds[i],content,majorChange));return Promise.all(promises).spread(callback.bind(this));},_styleSheetChanged:function(event)
{if(this._isSettingContent)
return;this._updateStyleSheetTextSoon(event.data.styleSheetId);},_updateStyleSheetTextSoon:function(styleSheetId)
{if(this._updateStyleSheetTextTimer)
clearTimeout(this._updateStyleSheetTextTimer);this._updateStyleSheetTextTimer=setTimeout(this._updateStyleSheetText.bind(this,styleSheetId),WebInspector.StylesSourceMapping.ChangeUpdateTimeoutMs);},_updateStyleSheetText:function(styleSheetId)
{if(this._updateStyleSheetTextTimer){clearTimeout(this._updateStyleSheetTextTimer);delete this._updateStyleSheetTextTimer;}
var header=this._cssModel.styleSheetHeaderForId(styleSheetId);if(!header)
return;var styleSheetURL=header.resourceURL();if(!styleSheetURL)
return;var uiSourceCode=this._networkMapping.uiSourceCodeForStyleURL(styleSheetURL,header);if(!uiSourceCode)
return;header.requestContent(callback.bind(this,uiSourceCode));function callback(uiSourceCode,content)
{var styleFile=this._styleFiles.get(uiSourceCode);if(styleFile)
styleFile.addRevision(content||"");}}}
WebInspector.StyleFile=function(uiSourceCode,mapping)
{this._uiSourceCode=uiSourceCode;this._mapping=mapping;this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);this._uiSourceCode.forceLoadOnCheckContent();this._commitThrottler=new WebInspector.Throttler(WebInspector.StyleFile.updateTimeout);}
WebInspector.StyleFile.updateTimeout=200;WebInspector.StyleFile.prototype={_workingCopyCommitted:function(event)
{if(this._isAddingRevision)
return;this._isMajorChangePending=true;this._commitThrottler.schedule(this._commitIncrementalEdit.bind(this),true);},_workingCopyChanged:function(event)
{if(this._isAddingRevision)
return;this._commitThrottler.schedule(this._commitIncrementalEdit.bind(this),false);},_commitIncrementalEdit:function()
{var promise=this._mapping._setStyleContent(this._uiSourceCode,this._uiSourceCode.workingCopy(),this._isMajorChangePending).then(this._styleContentSet.bind(this))
this._isMajorChangePending=false;return promise;},_styleContentSet:function(error)
{if(error)
WebInspector.console.error(error);},addRevision:function(content)
{this._isAddingRevision=true;this._uiSourceCode.addRevision(content);delete this._isAddingRevision;},dispose:function()
{this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted,this._workingCopyCommitted,this);this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged,this._workingCopyChanged,this);}};WebInspector.CSSWorkspaceBinding=function(targetManager,workspace,networkMapping)
{this._workspace=workspace;this._networkMapping=networkMapping;this._modelToTargetInfo=new Map();targetManager.observeTargets(this);targetManager.addModelListener(WebInspector.ResourceTreeModel,WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._mainFrameCreatedOrNavigated,this);}
WebInspector.CSSWorkspaceBinding.prototype={targetAdded:function(target)
{var cssModel=WebInspector.CSSStyleModel.fromTarget(target);if(cssModel)
this._modelToTargetInfo.set(cssModel,new WebInspector.CSSWorkspaceBinding.TargetInfo(cssModel,this._workspace,this._networkMapping));},targetRemoved:function(target)
{var cssModel=WebInspector.CSSStyleModel.fromTarget(target);if(cssModel)
this._modelToTargetInfo.remove(cssModel)._dispose();},pushSourceMapping:function(header,mapping)
{this._ensureInfoForHeader(header)._pushSourceMapping(mapping);},_headerInfo:function(header)
{var map=this._modelToTargetInfo.get(header.cssModel());return map._headerInfo(header.id)||null;},_ensureInfoForHeader:function(header)
{var targetInfo=this._modelToTargetInfo.get(header.cssModel());if(!targetInfo){targetInfo=new WebInspector.CSSWorkspaceBinding.TargetInfo(header.cssModel(),this._workspace,this._networkMapping);this._modelToTargetInfo.set(header.cssModel(),targetInfo);}
return targetInfo._ensureInfoForHeader(header);},_mainFrameCreatedOrNavigated:function(event)
{var target=(event.target).target();var cssModel=WebInspector.CSSStyleModel.fromTarget(target);if(cssModel)
this._modelToTargetInfo.get(cssModel)._reset();},updateLocations:function(header)
{var info=this._headerInfo(header);if(info)
info._updateLocations();},createLiveLocation:function(rawLocation,updateDelegate)
{var header=rawLocation.styleSheetId?rawLocation.cssModel().styleSheetHeaderForId(rawLocation.styleSheetId):null;return new WebInspector.CSSWorkspaceBinding.LiveLocation(rawLocation.cssModel(),header,rawLocation,this,updateDelegate);},_addLiveLocation:function(location)
{this._ensureInfoForHeader(location._header)._addLocation(location);},_removeLiveLocation:function(location)
{var info=this._headerInfo(location._header);if(info)
info._removeLocation(location);},propertyUILocation:function(cssProperty,forName)
{var style=cssProperty.ownerStyle;if(!style||!style.parentRule||!style.styleSheetId)
return null;var range=cssProperty.range;if(!range)
return null;var header=style.cssModel().styleSheetHeaderForId(style.styleSheetId);if(!header)
return null;var line=forName?range.startLine:range.endLine;var column=forName?range.startColumn:range.endColumn-(cssProperty.text&&cssProperty.text.endsWith(";")?2:1);var rawLocation=new WebInspector.CSSLocation(header,header.lineNumberInSource(line),header.columnNumberInSource(line,column));return this.rawLocationToUILocation(rawLocation);},rawLocationToUILocation:function(rawLocation)
{if(!rawLocation)
return null;var header=rawLocation.cssModel().styleSheetHeaderForId(rawLocation.styleSheetId);if(!header)
return null;var info=this._headerInfo(header);return info?info._rawLocationToUILocation(rawLocation.lineNumber,rawLocation.columnNumber):null;}}
WebInspector.CSSWorkspaceBinding.TargetInfo=function(cssModel,workspace,networkMapping)
{this._cssModel=cssModel;this._stylesSourceMapping=new WebInspector.StylesSourceMapping(cssModel,workspace,networkMapping);this._sassSourceMapping=new WebInspector.SASSSourceMapping(cssModel,networkMapping,WebInspector.NetworkProject.forTarget(cssModel.target()));this._headerInfoById=new Map();cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetAdded,this);cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._styleSheetRemoved,this);}
WebInspector.CSSWorkspaceBinding.TargetInfo.prototype={_styleSheetAdded:function(event)
{var header=(event.data);this._stylesSourceMapping.addHeader(header);this._sassSourceMapping.addHeader(header);},_styleSheetRemoved:function(event)
{var header=(event.data);this._stylesSourceMapping.removeHeader(header);this._sassSourceMapping.removeHeader(header);this._headerInfoById.remove(header.id);},_headerInfo:function(id)
{return this._headerInfoById.get(id);},_ensureInfoForHeader:function(header)
{var info=this._headerInfoById.get(header.id);if(!info){info=new WebInspector.CSSWorkspaceBinding.HeaderInfo(header);this._headerInfoById.set(header.id,info);}
return info;},_dispose:function()
{this._reset();this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetAdded,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._styleSheetRemoved,this);},_reset:function()
{this._headerInfoById.clear();}}
WebInspector.CSSWorkspaceBinding.HeaderInfo=function(header)
{this._header=header;this._sourceMappings=[];this._locations=new Set();}
WebInspector.CSSWorkspaceBinding.HeaderInfo.prototype={_addLocation:function(location)
{this._locations.add(location);location.update();},_removeLocation:function(location)
{this._locations.delete(location);},_updateLocations:function()
{var items=this._locations.valuesArray();for(var i=0;i<items.length;++i)
items[i].update();},_rawLocationToUILocation:function(lineNumber,columnNumber)
{var uiLocation=null;var rawLocation=new WebInspector.CSSLocation(this._header,lineNumber,columnNumber);for(var i=this._sourceMappings.length-1;!uiLocation&&i>=0;--i)
uiLocation=this._sourceMappings[i].rawLocationToUILocation(rawLocation);return uiLocation;},_pushSourceMapping:function(sourceMapping)
{if(this._sourceMappings.indexOf(sourceMapping)!==-1)
return;this._sourceMappings.push(sourceMapping);this._updateLocations();}}
WebInspector.CSSWorkspaceBinding.LiveLocation=function(cssModel,header,rawLocation,binding,updateDelegate)
{WebInspector.LiveLocation.call(this,updateDelegate);this._cssModel=cssModel;this._rawLocation=rawLocation;this._binding=binding;if(!header)
this._clearStyleSheet();else
this._setStyleSheet(header);}
WebInspector.CSSWorkspaceBinding.LiveLocation.prototype={_styleSheetAdded:function(event)
{console.assert(!this._header);var header=(event.data);if(header.sourceURL&&header.sourceURL===this._rawLocation.url)
this._setStyleSheet(header);},_styleSheetRemoved:function(event)
{console.assert(this._header);var header=(event.data);if(this._header!==header)
return;this._binding._removeLiveLocation(this);this._clearStyleSheet();},_setStyleSheet:function(header)
{this._header=header;this._binding._addLiveLocation(this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetAdded,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._styleSheetRemoved,this);},_clearStyleSheet:function()
{delete this._header;this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._styleSheetRemoved,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetAdded,this);},uiLocation:function()
{var cssLocation=this._rawLocation;if(this._header){var headerInfo=this._binding._headerInfo(this._header);return headerInfo._rawLocationToUILocation(cssLocation.lineNumber,cssLocation.columnNumber);}
var uiSourceCode=this._binding._networkMapping.uiSourceCodeForStyleURL(cssLocation.url,cssLocation.header());if(!uiSourceCode)
return null;return uiSourceCode.uiLocation(cssLocation.lineNumber,cssLocation.columnNumber);},dispose:function()
{WebInspector.LiveLocation.prototype.dispose.call(this);if(this._header)
this._binding._removeLiveLocation(this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetAdded,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._styleSheetRemoved,this);},__proto__:WebInspector.LiveLocation.prototype}
WebInspector.CSSSourceMapping=function()
{}
WebInspector.CSSSourceMapping.prototype={rawLocationToUILocation:function(rawLocation){},uiLocationToRawLocation:function(uiSourceCode,lineNumber,columnNumber){},isIdentity:function(){},uiLineHasMapping:function(uiSourceCode,lineNumber){}}
WebInspector.cssWorkspaceBinding;;WebInspector.DebuggerWorkspaceBinding=function(targetManager,workspace,networkMapping)
{this._workspace=workspace;this._networkMapping=networkMapping;this._targetToData=new Map();targetManager.observeTargets(this);targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._globalObjectCleared,this);targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.BeforeDebuggerPaused,this._beforeDebuggerPaused,this);targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.DebuggerResumed,this._debuggerResumed,this);workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved,this._projectRemoved,this);}
WebInspector.DebuggerWorkspaceBinding.prototype={targetAdded:function(target)
{var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(debuggerModel)
this._targetToData.set(target,new WebInspector.DebuggerWorkspaceBinding.TargetData(debuggerModel,this));},targetRemoved:function(target)
{if(!WebInspector.DebuggerModel.fromTarget(target))
return;var targetData=this._targetToData.get(target);targetData._dispose();this._targetToData.remove(target);},_uiSourceCodeRemoved:function(event)
{var uiSourceCode=(event.data);var targetDatas=this._targetToData.valuesArray();for(var i=0;i<targetDatas.length;++i)
targetDatas[i]._uiSourceCodeRemoved(uiSourceCode);},_projectRemoved:function(event)
{var project=(event.data);var targetDatas=this._targetToData.valuesArray();var uiSourceCodes=project.uiSourceCodes();for(var i=0;i<targetDatas.length;++i){for(var j=0;j<uiSourceCodes.length;++j)
targetDatas[i]._uiSourceCodeRemoved(uiSourceCodes[j]);}},pushSourceMapping:function(script,sourceMapping)
{var info=this._ensureInfoForScript(script);info._pushSourceMapping(sourceMapping);},popSourceMapping:function(script)
{var info=this._infoForScript(script.target(),script.scriptId);console.assert(info);return info._popSourceMapping();},setSourceMapping:function(target,uiSourceCode,sourceMapping)
{var data=this._targetToData.get(target);if(data)
data._setSourceMapping(uiSourceCode,sourceMapping);},updateLocations:function(script)
{var info=this._infoForScript(script.target(),script.scriptId);if(info)
info._updateLocations();},createLiveLocation:function(rawLocation,updateDelegate)
{var info=this._infoForScript(rawLocation.target(),rawLocation.scriptId);console.assert(info);var location=new WebInspector.DebuggerWorkspaceBinding.Location(info._script,rawLocation,this,updateDelegate);info._addLocation(location);return location;},createCallFrameLiveLocation:function(callFrame,updateDelegate)
{var target=callFrame.target();this._ensureInfoForScript(callFrame.script);var location=this.createLiveLocation(callFrame.location(),updateDelegate);this._registerCallFrameLiveLocation(target,location);return location;},rawLocationToUILocation:function(rawLocation)
{var info=this._infoForScript(rawLocation.target(),rawLocation.scriptId);console.assert(info);return info._rawLocationToUILocation(rawLocation);},uiLocationToRawLocation:function(target,uiSourceCode,lineNumber,columnNumber)
{var targetData=this._targetToData.get(target);return targetData?(targetData._uiLocationToRawLocation(uiSourceCode,lineNumber,columnNumber)):null;},uiLocationToRawLocations:function(uiSourceCode,lineNumber,columnNumber)
{var result=[];var targetDatas=this._targetToData.valuesArray();for(var i=0;i<targetDatas.length;++i){var rawLocation=targetDatas[i]._uiLocationToRawLocation(uiSourceCode,lineNumber,columnNumber);if(rawLocation)
result.push(rawLocation);}
return result;},normalizeUILocation:function(uiLocation)
{var target=WebInspector.NetworkProject.targetForUISourceCode(uiLocation.uiSourceCode);if(target){var rawLocation=this.uiLocationToRawLocation(target,uiLocation.uiSourceCode,uiLocation.lineNumber,uiLocation.columnNumber);if(rawLocation)
return this.rawLocationToUILocation(rawLocation);}
return uiLocation;},uiLineHasMapping:function(uiSourceCode,lineNumber)
{var targetDatas=this._targetToData.valuesArray();for(var i=0;i<targetDatas.length;++i){if(!targetDatas[i]._uiLineHasMapping(uiSourceCode,lineNumber))
return false;}
return true;},scriptFile:function(uiSourceCode,target)
{var targetData=this._targetToData.get(target);return targetData?targetData._resourceMapping.scriptFile(uiSourceCode):null;},_globalObjectCleared:function(event)
{var debuggerModel=(event.target);this._reset(debuggerModel.target());},_reset:function(target)
{var targetData=this._targetToData.get(target);targetData.callFrameLocations.valuesArray().forEach(function(location){location.dispose();});targetData.callFrameLocations.clear();},_ensureInfoForScript:function(script)
{var scriptDataMap=this._targetToData.get(script.target()).scriptDataMap;var info=scriptDataMap.get(script.scriptId);if(!info){info=new WebInspector.DebuggerWorkspaceBinding.ScriptInfo(script);scriptDataMap.set(script.scriptId,info);}
return info;},_infoForScript:function(target,scriptId)
{var data=this._targetToData.get(target);if(!data)
return null;return data.scriptDataMap.get(scriptId)||null;},_registerCallFrameLiveLocation:function(target,location)
{var locations=this._targetToData.get(target).callFrameLocations;locations.add(location);},_removeLiveLocation:function(location)
{var info=this._infoForScript(location._script.target(),location._script.scriptId);if(info)
info._removeLocation(location);},_debuggerResumed:function(event)
{var debuggerModel=(event.target);this._reset(debuggerModel.target());},_beforeDebuggerPaused:function(event)
{var rawLocation=event.data.callFrames[0].location();var targetData=this._targetToData.get(rawLocation.target());if(!targetData._compilerMapping.mapsToSourceCode(rawLocation)){event.stopPropagation();event.preventDefault();}}}
WebInspector.DebuggerWorkspaceBinding.TargetData=function(debuggerModel,debuggerWorkspaceBinding)
{this._target=debuggerModel.target();this.scriptDataMap=new Map();this.callFrameLocations=new Set();var workspace=debuggerWorkspaceBinding._workspace;var networkMapping=debuggerWorkspaceBinding._networkMapping;this._defaultMapping=new WebInspector.DefaultScriptMapping(debuggerModel,workspace,debuggerWorkspaceBinding);this._resourceMapping=new WebInspector.ResourceScriptMapping(debuggerModel,workspace,networkMapping,debuggerWorkspaceBinding);this._compilerMapping=new WebInspector.CompilerScriptMapping(debuggerModel,workspace,networkMapping,WebInspector.NetworkProject.forTarget(this._target),debuggerWorkspaceBinding);this._uiSourceCodeToSourceMapping=new Map();debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource,this._parsedScriptSource,this);debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource,this._parsedScriptSource,this);}
WebInspector.DebuggerWorkspaceBinding.TargetData.prototype={_parsedScriptSource:function(event)
{var script=(event.data);this._defaultMapping.addScript(script);this._resourceMapping.addScript(script);if(WebInspector.moduleSetting("jsSourceMapsEnabled").get())
this._compilerMapping.addScript(script);},_setSourceMapping:function(uiSourceCode,sourceMapping)
{if(this._uiSourceCodeToSourceMapping.get(uiSourceCode)===sourceMapping)
return;if(sourceMapping)
this._uiSourceCodeToSourceMapping.set(uiSourceCode,sourceMapping);else
this._uiSourceCodeToSourceMapping.remove(uiSourceCode);uiSourceCode.dispatchEventToListeners(WebInspector.UISourceCode.Events.SourceMappingChanged,{target:this._target,isIdentity:sourceMapping?sourceMapping.isIdentity():false});},_uiLocationToRawLocation:function(uiSourceCode,lineNumber,columnNumber)
{var sourceMapping=this._uiSourceCodeToSourceMapping.get(uiSourceCode);return sourceMapping?sourceMapping.uiLocationToRawLocation(uiSourceCode,lineNumber,columnNumber):null;},_uiLineHasMapping:function(uiSourceCode,lineNumber)
{var sourceMapping=this._uiSourceCodeToSourceMapping.get(uiSourceCode);return sourceMapping?sourceMapping.uiLineHasMapping(uiSourceCode,lineNumber):true;},_uiSourceCodeRemoved:function(uiSourceCode)
{this._uiSourceCodeToSourceMapping.remove(uiSourceCode);},_dispose:function()
{this._compilerMapping.dispose();this._resourceMapping.dispose();this._defaultMapping.dispose();this._uiSourceCodeToSourceMapping.clear();}}
WebInspector.DebuggerWorkspaceBinding.ScriptInfo=function(script)
{this._script=script;this._sourceMappings=[];this._locations=new Set();}
WebInspector.DebuggerWorkspaceBinding.ScriptInfo.prototype={_pushSourceMapping:function(sourceMapping)
{this._sourceMappings.push(sourceMapping);this._updateLocations();},_popSourceMapping:function()
{var sourceMapping=this._sourceMappings.pop();this._updateLocations();return sourceMapping;},_addLocation:function(location)
{this._locations.add(location);location.update();},_removeLocation:function(location)
{this._locations.delete(location);},_updateLocations:function()
{for(var location of this._locations)
location.update();},_rawLocationToUILocation:function(rawLocation)
{var uiLocation;for(var i=this._sourceMappings.length-1;!uiLocation&&i>=0;--i)
uiLocation=this._sourceMappings[i].rawLocationToUILocation(rawLocation);console.assert(uiLocation,"Script raw location cannot be mapped to any UI location.");return(uiLocation);}}
WebInspector.DebuggerWorkspaceBinding.Location=function(script,rawLocation,binding,updateDelegate)
{WebInspector.LiveLocation.call(this,updateDelegate);this._script=script;this._rawLocation=rawLocation;this._binding=binding;}
WebInspector.DebuggerWorkspaceBinding.Location.prototype={uiLocation:function()
{var debuggerModelLocation=this._rawLocation;return this._binding.rawLocationToUILocation(debuggerModelLocation);},dispose:function()
{WebInspector.LiveLocation.prototype.dispose.call(this);this._binding._removeLiveLocation(this);},__proto__:WebInspector.LiveLocation.prototype}
WebInspector.DebuggerSourceMapping=function()
{}
WebInspector.DebuggerSourceMapping.prototype={rawLocationToUILocation:function(rawLocation){},uiLocationToRawLocation:function(uiSourceCode,lineNumber,columnNumber){},isIdentity:function(){},uiLineHasMapping:function(uiSourceCode,lineNumber){}}
WebInspector.debuggerWorkspaceBinding;;WebInspector.BreakpointManager=function(breakpointsSetting,workspace,networkMapping,targetManager,debuggerWorkspaceBinding)
{this._storage=new WebInspector.BreakpointManager.Storage(this,breakpointsSetting);this._workspace=workspace;this._networkMapping=networkMapping;this._targetManager=targetManager;this._debuggerWorkspaceBinding=debuggerWorkspaceBinding;this._breakpointsActive=true;this._breakpointsForUISourceCode=new Map();this._breakpointsForPrimaryUISourceCode=new Map();this._provisionalBreakpoints=new Multimap();this._workspace.addEventListener(WebInspector.Workspace.Events.ProjectRemoved,this._projectRemoved,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,this._uiSourceCodeAdded,this);this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRemoved,this._uiSourceCodeRemoved,this);}
WebInspector.BreakpointManager.Events={BreakpointAdded:"breakpoint-added",BreakpointRemoved:"breakpoint-removed",BreakpointsActiveStateChanged:"BreakpointsActiveStateChanged"}
WebInspector.BreakpointManager._breakpointStorageId=function(sourceFileId,lineNumber,columnNumber)
{if(!sourceFileId)
return"";return sourceFileId+":"+lineNumber+":"+columnNumber;}
WebInspector.BreakpointManager.prototype={_sourceFileId:function(uiSourceCode)
{var networkURL=this._networkMapping.networkURL(uiSourceCode)
if(!networkURL)
return"";return uiSourceCode.url();},targetAdded:function(target)
{var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(debuggerModel&&!this._breakpointsActive)
debuggerModel.setBreakpointsActive(this._breakpointsActive);},targetRemoved:function(target){},_provisionalBreakpointsForSourceFileId:function(sourceFileId)
{var result=new Map();var breakpoints=this._provisionalBreakpoints.get(sourceFileId).valuesArray();for(var i=0;i<breakpoints.length;++i)
result.set(breakpoints[i]._breakpointStorageId(),breakpoints[i]);return result;},removeProvisionalBreakpointsForTest:function()
{var breakpoints=this._provisionalBreakpoints.valuesArray();for(var i=0;i<breakpoints.length;++i)
breakpoints[i].remove();this._provisionalBreakpoints.clear();},_restoreBreakpoints:function(uiSourceCode)
{var sourceFileId=this._sourceFileId(uiSourceCode);if(!sourceFileId)
return;this._storage.mute();var breakpointItems=this._storage.breakpointItems(this._sourceFileId(uiSourceCode));var provisionalBreakpoints=this._provisionalBreakpointsForSourceFileId(sourceFileId);for(var i=0;i<breakpointItems.length;++i){var breakpointItem=breakpointItems[i];var itemStorageId=WebInspector.BreakpointManager._breakpointStorageId(breakpointItem.sourceFileId,breakpointItem.lineNumber,breakpointItem.columnNumber);var provisionalBreakpoint=provisionalBreakpoints.get(itemStorageId);if(provisionalBreakpoint){if(!this._breakpointsForPrimaryUISourceCode.get(uiSourceCode))
this._breakpointsForPrimaryUISourceCode.set(uiSourceCode,[]);this._breakpointsForPrimaryUISourceCode.get(uiSourceCode).push(provisionalBreakpoint);provisionalBreakpoint._updateBreakpoint();}else{this._innerSetBreakpoint(uiSourceCode,breakpointItem.lineNumber,breakpointItem.columnNumber,breakpointItem.condition,breakpointItem.enabled);}}
this._provisionalBreakpoints.removeAll(sourceFileId);this._storage.unmute();},_uiSourceCodeAdded:function(event)
{var uiSourceCode=(event.data);this._restoreBreakpoints(uiSourceCode);if(uiSourceCode.contentType().hasScripts())
uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged,this._uiSourceCodeMappingChanged,this);},_uiSourceCodeRemoved:function(event)
{var uiSourceCode=(event.data);this._removeUISourceCode(uiSourceCode);},_uiSourceCodeMappingChanged:function(event)
{var uiSourceCode=(event.target);var isIdentity=(event.data.isIdentity);var target=(event.data.target);if(isIdentity)
return;var breakpoints=this._breakpointsForPrimaryUISourceCode.get(uiSourceCode)||[];for(var i=0;i<breakpoints.length;++i)
breakpoints[i]._updateInDebuggerForTarget(target);},_removeUISourceCode:function(uiSourceCode)
{var breakpoints=this._breakpointsForPrimaryUISourceCode.get(uiSourceCode)||[];var sourceFileId=this._sourceFileId(uiSourceCode);for(var i=0;i<breakpoints.length;++i){breakpoints[i]._resetLocations();if(breakpoints[i].enabled())
this._provisionalBreakpoints.set(sourceFileId,breakpoints[i]);}
uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged,this._uiSourceCodeMappingChanged,this);this._breakpointsForPrimaryUISourceCode.remove(uiSourceCode);},setBreakpoint:function(uiSourceCode,lineNumber,columnNumber,condition,enabled)
{var uiLocation=new WebInspector.UILocation(uiSourceCode,lineNumber,columnNumber);var normalizedLocation=this._debuggerWorkspaceBinding.normalizeUILocation(uiLocation);if(normalizedLocation.id()!==uiLocation.id()){WebInspector.Revealer.reveal(normalizedLocation);uiLocation=normalizedLocation;}
this.setBreakpointsActive(true);return this._innerSetBreakpoint(uiLocation.uiSourceCode,uiLocation.lineNumber,uiLocation.columnNumber,condition,enabled);},_innerSetBreakpoint:function(uiSourceCode,lineNumber,columnNumber,condition,enabled)
{var breakpoint=this.findBreakpoint(uiSourceCode,lineNumber,columnNumber);if(breakpoint){breakpoint._updateState(condition,enabled);return breakpoint;}
var projectId=uiSourceCode.project().id();var path=uiSourceCode.url();var sourceFileId=this._sourceFileId(uiSourceCode);breakpoint=new WebInspector.BreakpointManager.Breakpoint(this,projectId,path,sourceFileId,lineNumber,columnNumber,condition,enabled);if(!this._breakpointsForPrimaryUISourceCode.get(uiSourceCode))
this._breakpointsForPrimaryUISourceCode.set(uiSourceCode,[]);this._breakpointsForPrimaryUISourceCode.get(uiSourceCode).push(breakpoint);return breakpoint;},findBreakpoint:function(uiSourceCode,lineNumber,columnNumber)
{var breakpoints=this._breakpointsForUISourceCode.get(uiSourceCode);var lineBreakpoints=breakpoints?breakpoints.get(String(lineNumber)):null;var columnBreakpoints=lineBreakpoints?lineBreakpoints.get(String(columnNumber)):null;return columnBreakpoints?columnBreakpoints[0]:null;},findBreakpointOnLine:function(uiSourceCode,lineNumber)
{var breakpoints=this._breakpointsForUISourceCode.get(uiSourceCode);var lineBreakpoints=breakpoints?breakpoints.get(String(lineNumber)):null;return lineBreakpoints?lineBreakpoints.valuesArray()[0][0]:null;},breakpointsForUISourceCode:function(uiSourceCode)
{var result=[];var uiSourceCodeBreakpoints=this._breakpointsForUISourceCode.get(uiSourceCode);var breakpoints=uiSourceCodeBreakpoints?uiSourceCodeBreakpoints.valuesArray():[];for(var i=0;i<breakpoints.length;++i){var lineBreakpoints=breakpoints[i];var columnBreakpointArrays=lineBreakpoints?lineBreakpoints.valuesArray():[];result=result.concat.apply(result,columnBreakpointArrays);}
return result;},allBreakpoints:function()
{var result=[];var uiSourceCodes=this._breakpointsForUISourceCode.keysArray();for(var i=0;i<uiSourceCodes.length;++i)
result=result.concat(this.breakpointsForUISourceCode(uiSourceCodes[i]));return result;},breakpointLocationsForUISourceCode:function(uiSourceCode)
{var uiSourceCodeBreakpoints=this._breakpointsForUISourceCode.get(uiSourceCode);var lineNumbers=uiSourceCodeBreakpoints?uiSourceCodeBreakpoints.keysArray():[];var result=[];for(var i=0;i<lineNumbers.length;++i){var lineBreakpoints=uiSourceCodeBreakpoints.get(lineNumbers[i]);var columnNumbers=lineBreakpoints.keysArray();for(var j=0;j<columnNumbers.length;++j){var columnBreakpoints=lineBreakpoints.get(columnNumbers[j]);var lineNumber=parseInt(lineNumbers[i],10);var columnNumber=parseInt(columnNumbers[j],10);for(var k=0;k<columnBreakpoints.length;++k){var breakpoint=columnBreakpoints[k];var uiLocation=uiSourceCode.uiLocation(lineNumber,columnNumber);result.push({breakpoint:breakpoint,uiLocation:uiLocation});}}}
return result;},allBreakpointLocations:function()
{var result=[];var uiSourceCodes=this._breakpointsForUISourceCode.keysArray();for(var i=0;i<uiSourceCodes.length;++i)
result=result.concat(this.breakpointLocationsForUISourceCode(uiSourceCodes[i]));return result;},toggleAllBreakpoints:function(toggleState)
{var breakpoints=this.allBreakpoints();for(var i=0;i<breakpoints.length;++i)
breakpoints[i].setEnabled(toggleState);},removeAllBreakpoints:function()
{var breakpoints=this.allBreakpoints();for(var i=0;i<breakpoints.length;++i)
breakpoints[i].remove();},_projectRemoved:function(event)
{var project=(event.data);var uiSourceCodes=project.uiSourceCodes();for(var i=0;i<uiSourceCodes.length;++i)
this._removeUISourceCode(uiSourceCodes[i]);},_removeBreakpoint:function(breakpoint,removeFromStorage)
{var uiSourceCode=breakpoint.uiSourceCode();var breakpoints=uiSourceCode?this._breakpointsForPrimaryUISourceCode.get(uiSourceCode)||[]:[];breakpoints.remove(breakpoint);if(removeFromStorage)
this._storage._removeBreakpoint(breakpoint);this._provisionalBreakpoints.remove(breakpoint._sourceFileId,breakpoint);},_uiLocationAdded:function(breakpoint,uiLocation)
{var breakpoints=this._breakpointsForUISourceCode.get(uiLocation.uiSourceCode);if(!breakpoints){breakpoints=new Map();this._breakpointsForUISourceCode.set(uiLocation.uiSourceCode,breakpoints);}
var lineBreakpoints=breakpoints.get(String(uiLocation.lineNumber));if(!lineBreakpoints){lineBreakpoints=new Map();breakpoints.set(String(uiLocation.lineNumber),lineBreakpoints);}
var columnBreakpoints=lineBreakpoints.get(String(uiLocation.columnNumber));if(!columnBreakpoints){columnBreakpoints=[];lineBreakpoints.set(String(uiLocation.columnNumber),columnBreakpoints);}
columnBreakpoints.push(breakpoint);this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.BreakpointAdded,{breakpoint:breakpoint,uiLocation:uiLocation});},_uiLocationRemoved:function(breakpoint,uiLocation)
{var breakpoints=this._breakpointsForUISourceCode.get(uiLocation.uiSourceCode);if(!breakpoints)
return;var lineBreakpoints=breakpoints.get(String(uiLocation.lineNumber));if(!lineBreakpoints)
return;var columnBreakpoints=lineBreakpoints.get(String(uiLocation.columnNumber));if(!columnBreakpoints)
return;columnBreakpoints.remove(breakpoint);if(!columnBreakpoints.length)
lineBreakpoints.remove(String(uiLocation.columnNumber));if(!lineBreakpoints.size)
breakpoints.remove(String(uiLocation.lineNumber));if(!breakpoints.size)
this._breakpointsForUISourceCode.remove(uiLocation.uiSourceCode);this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.BreakpointRemoved,{breakpoint:breakpoint,uiLocation:uiLocation});},setBreakpointsActive:function(active)
{if(this._breakpointsActive===active)
return;this._breakpointsActive=active;var debuggerModels=WebInspector.DebuggerModel.instances();for(var i=0;i<debuggerModels.length;++i)
debuggerModels[i].setBreakpointsActive(active);this.dispatchEventToListeners(WebInspector.BreakpointManager.Events.BreakpointsActiveStateChanged,active);},breakpointsActive:function()
{return this._breakpointsActive;},__proto__:WebInspector.Object.prototype}
WebInspector.BreakpointManager.Breakpoint=function(breakpointManager,projectId,path,sourceFileId,lineNumber,columnNumber,condition,enabled)
{this._breakpointManager=breakpointManager;this._projectId=projectId;this._path=path;this._lineNumber=lineNumber;this._columnNumber=columnNumber;this._sourceFileId=sourceFileId;this._numberOfDebuggerLocationForUILocation={};this._condition;this._enabled;this._isRemoved;this._fakePrimaryLocation;this._currentState=null;this._targetBreakpoints=new Map();this._updateState(condition,enabled);this._breakpointManager._targetManager.observeTargets(this);}
WebInspector.BreakpointManager.Breakpoint.prototype={targetAdded:function(target)
{var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(!debuggerModel)
return;var networkMapping=this._breakpointManager._networkMapping;var debuggerWorkspaceBinding=this._breakpointManager._debuggerWorkspaceBinding;this._targetBreakpoints.set(target,new WebInspector.BreakpointManager.TargetBreakpoint(debuggerModel,this,networkMapping,debuggerWorkspaceBinding));},targetRemoved:function(target)
{var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(!debuggerModel)
return;var targetBreakpoint=this._targetBreakpoints.remove(target);targetBreakpoint._cleanUpAfterDebuggerIsGone();targetBreakpoint._removeEventListeners();},projectId:function()
{return this._projectId;},path:function()
{return this._path;},lineNumber:function()
{return this._lineNumber;},columnNumber:function()
{return this._columnNumber;},uiSourceCode:function()
{return this._breakpointManager._workspace.uiSourceCode(this._projectId,this._path);},_replaceUILocation:function(oldUILocation,newUILocation)
{if(this._isRemoved)
return;this._removeUILocation(oldUILocation,true);this._removeFakeBreakpointAtPrimaryLocation();if(!this._numberOfDebuggerLocationForUILocation[newUILocation.id()])
this._numberOfDebuggerLocationForUILocation[newUILocation.id()]=0;if(++this._numberOfDebuggerLocationForUILocation[newUILocation.id()]===1)
this._breakpointManager._uiLocationAdded(this,newUILocation);},_removeUILocation:function(uiLocation,muteCreationFakeBreakpoint)
{if(!uiLocation||--this._numberOfDebuggerLocationForUILocation[uiLocation.id()]!==0)
return;delete this._numberOfDebuggerLocationForUILocation[uiLocation.id()];this._breakpointManager._uiLocationRemoved(this,uiLocation);if(!muteCreationFakeBreakpoint)
this._fakeBreakpointAtPrimaryLocation();},enabled:function()
{return this._enabled;},setEnabled:function(enabled)
{this._updateState(this._condition,enabled);},condition:function()
{return this._condition;},setCondition:function(condition)
{this._updateState(condition,this._enabled);},_updateState:function(condition,enabled)
{if(this._enabled===enabled&&this._condition===condition)
return;this._enabled=enabled;this._condition=condition;this._breakpointManager._storage._updateBreakpoint(this);this._updateBreakpoint();},_updateBreakpoint:function()
{this._removeFakeBreakpointAtPrimaryLocation();this._fakeBreakpointAtPrimaryLocation();var targetBreakpoints=this._targetBreakpoints.valuesArray();for(var i=0;i<targetBreakpoints.length;++i)
targetBreakpoints[i]._scheduleUpdateInDebugger();},remove:function(keepInStorage)
{this._isRemoved=true;var removeFromStorage=!keepInStorage;this._removeFakeBreakpointAtPrimaryLocation();var targetBreakpoints=this._targetBreakpoints.valuesArray();for(var i=0;i<targetBreakpoints.length;++i){targetBreakpoints[i]._scheduleUpdateInDebugger();targetBreakpoints[i]._removeEventListeners();}
this._breakpointManager._removeBreakpoint(this,removeFromStorage);this._breakpointManager._targetManager.unobserveTargets(this);},_updateInDebuggerForTarget:function(target)
{this._targetBreakpoints.get(target)._scheduleUpdateInDebugger();},_breakpointStorageId:function()
{return WebInspector.BreakpointManager._breakpointStorageId(this._sourceFileId,this._lineNumber,this._columnNumber);},_fakeBreakpointAtPrimaryLocation:function()
{if(this._isRemoved||!Object.isEmpty(this._numberOfDebuggerLocationForUILocation)||this._fakePrimaryLocation)
return;var uiSourceCode=this._breakpointManager._workspace.uiSourceCode(this._projectId,this._path);if(!uiSourceCode)
return;this._fakePrimaryLocation=uiSourceCode.uiLocation(this._lineNumber,this._columnNumber);if(this._fakePrimaryLocation)
this._breakpointManager._uiLocationAdded(this,this._fakePrimaryLocation);},_removeFakeBreakpointAtPrimaryLocation:function()
{if(this._fakePrimaryLocation){this._breakpointManager._uiLocationRemoved(this,this._fakePrimaryLocation);delete this._fakePrimaryLocation;}},_resetLocations:function()
{this._removeFakeBreakpointAtPrimaryLocation();var targetBreakpoints=this._targetBreakpoints.valuesArray();for(var i=0;i<targetBreakpoints.length;++i)
targetBreakpoints[i]._resetLocations();}}
WebInspector.BreakpointManager.TargetBreakpoint=function(debuggerModel,breakpoint,networkMapping,debuggerWorkspaceBinding)
{WebInspector.SDKObject.call(this,debuggerModel.target());this._debuggerModel=debuggerModel;this._breakpoint=breakpoint;this._networkMapping=networkMapping;this._debuggerWorkspaceBinding=debuggerWorkspaceBinding;this._liveLocations=[];this._uiLocations={};this._debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled,this._cleanUpAfterDebuggerIsGone,this);this._debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled,this._scheduleUpdateInDebugger,this);this._hasPendingUpdate=false;this._isUpdating=false;this._cancelCallback=false;this._currentState=null;if(this._debuggerModel.debuggerEnabled())
this._scheduleUpdateInDebugger();}
WebInspector.BreakpointManager.TargetBreakpoint.prototype={_resetLocations:function()
{var uiLocations=Object.values(this._uiLocations);for(var i=0;i<uiLocations.length;++i)
this._breakpoint._removeUILocation(uiLocations[i]);this._uiLocations={};for(var i=0;i<this._liveLocations.length;++i)
this._liveLocations[i].dispose();this._liveLocations=[];},_scheduleUpdateInDebugger:function()
{if(this._isUpdating){this._hasPendingUpdate=true;return;}
this._isUpdating=true;this._updateInDebugger(this._didUpdateInDebugger.bind(this));},_didUpdateInDebugger:function()
{this._isUpdating=false;if(this._hasPendingUpdate){this._hasPendingUpdate=false;this._scheduleUpdateInDebugger();}},_scriptDiverged:function()
{var uiSourceCode=this._breakpoint.uiSourceCode();if(!uiSourceCode)
return false;var scriptFile=this._debuggerWorkspaceBinding.scriptFile(uiSourceCode,this.target());return!!scriptFile&&scriptFile.hasDivergedFromVM();},_updateInDebugger:function(callback)
{if(this.target().isDetached()){this._cleanUpAfterDebuggerIsGone();callback();return;}
var uiSourceCode=this._breakpoint.uiSourceCode();var lineNumber=this._breakpoint._lineNumber;var columnNumber=this._breakpoint._columnNumber;var condition=this._breakpoint.condition();var debuggerLocation=uiSourceCode?this._debuggerWorkspaceBinding.uiLocationToRawLocation(this.target(),uiSourceCode,lineNumber,columnNumber):null;var newState;if(this._breakpoint._isRemoved||!this._breakpoint.enabled()||this._scriptDiverged())
newState=null;else if(debuggerLocation){var script=debuggerLocation.script();if(script.sourceURL)
newState=new WebInspector.BreakpointManager.Breakpoint.State(script.sourceURL,null,debuggerLocation.lineNumber,debuggerLocation.columnNumber,condition);else
newState=new WebInspector.BreakpointManager.Breakpoint.State(null,debuggerLocation.scriptId,debuggerLocation.lineNumber,debuggerLocation.columnNumber,condition);}else if(this._breakpoint._currentState&&this._breakpoint._currentState.url){var position=this._breakpoint._currentState;newState=new WebInspector.BreakpointManager.Breakpoint.State(position.url,null,position.lineNumber,position.columnNumber,condition);}else if(uiSourceCode){var networkURL=this._networkMapping.networkURL(uiSourceCode);if(networkURL)
newState=new WebInspector.BreakpointManager.Breakpoint.State(networkURL,null,lineNumber,columnNumber,condition);}
if(this._debuggerId&&WebInspector.BreakpointManager.Breakpoint.State.equals(newState,this._currentState)){callback();return;}
this._breakpoint._currentState=newState;if(this._debuggerId){this._resetLocations();this._debuggerModel.removeBreakpoint(this._debuggerId,this._didRemoveFromDebugger.bind(this,callback));this._scheduleUpdateInDebugger();this._currentState=null;return;}
if(!newState){callback();return;}
var updateCallback=this._didSetBreakpointInDebugger.bind(this,callback);if(newState.url)
this._debuggerModel.setBreakpointByURL(newState.url,newState.lineNumber,newState.columnNumber,this._breakpoint.condition(),updateCallback);else if(newState.scriptId)
this._debuggerModel.setBreakpointBySourceId((debuggerLocation),condition,updateCallback);this._currentState=newState;},_didSetBreakpointInDebugger:function(callback,breakpointId,locations)
{if(this._cancelCallback){this._cancelCallback=false;callback();return;}
if(!breakpointId){this._breakpoint.remove(true);callback();return;}
this._debuggerId=breakpointId;this._debuggerModel.addBreakpointListener(this._debuggerId,this._breakpointResolved,this);for(var i=0;i<locations.length;++i){if(!this._addResolvedLocation(locations[i]))
break;}
callback();},_didRemoveFromDebugger:function(callback)
{if(this._cancelCallback){this._cancelCallback=false;callback();return;}
this._resetLocations();this._debuggerModel.removeBreakpointListener(this._debuggerId,this._breakpointResolved,this);delete this._debuggerId;callback();},_breakpointResolved:function(event)
{this._addResolvedLocation((event.data));},_locationUpdated:function(location,uiLocation)
{var oldUILocation=this._uiLocations[location.id()]||null;this._uiLocations[location.id()]=uiLocation;this._breakpoint._replaceUILocation(oldUILocation,uiLocation);},_addResolvedLocation:function(location)
{var uiLocation=this._debuggerWorkspaceBinding.rawLocationToUILocation(location);var breakpoint=this._breakpoint._breakpointManager.findBreakpoint(uiLocation.uiSourceCode,uiLocation.lineNumber,uiLocation.columnNumber);if(breakpoint&&breakpoint!==this._breakpoint){this._breakpoint.remove();return false;}
this._liveLocations.push(this._debuggerWorkspaceBinding.createLiveLocation(location,this._locationUpdated.bind(this,location)));return true;},_cleanUpAfterDebuggerIsGone:function()
{if(this._isUpdating)
this._cancelCallback=true;this._resetLocations();this._currentState=null;if(this._debuggerId)
this._didRemoveFromDebugger(function(){});},_removeEventListeners:function()
{this._debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled,this._cleanUpAfterDebuggerIsGone,this);this._debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled,this._scheduleUpdateInDebugger,this);},__proto__:WebInspector.SDKObject.prototype}
WebInspector.BreakpointManager.Breakpoint.State=function(url,scriptId,lineNumber,columnNumber,condition)
{this.url=url;this.scriptId=scriptId;this.lineNumber=lineNumber;this.columnNumber=columnNumber;this.condition=condition;}
WebInspector.BreakpointManager.Breakpoint.State.equals=function(stateA,stateB)
{if(!stateA||!stateB)
return false;if(stateA.scriptId||stateB.scriptId)
return false;return stateA.url===stateB.url&&stateA.lineNumber===stateB.lineNumber&&stateA.columnNumber===stateB.columnNumber&&stateA.condition===stateB.condition;}
WebInspector.BreakpointManager.Storage=function(breakpointManager,setting)
{this._breakpointManager=breakpointManager;this._setting=setting||WebInspector.settings.createLocalSetting("breakpoints",[]);var breakpoints=this._setting.get();this._breakpoints={};for(var i=0;i<breakpoints.length;++i){var breakpoint=(breakpoints[i]);breakpoint.columnNumber=breakpoint.columnNumber||0;this._breakpoints[breakpoint.sourceFileId+":"+breakpoint.lineNumber+":"+breakpoint.columnNumber]=breakpoint;}}
WebInspector.BreakpointManager.Storage.prototype={mute:function()
{this._muted=true;},unmute:function()
{delete this._muted;},breakpointItems:function(sourceFileId)
{var result=[];for(var id in this._breakpoints){var breakpoint=this._breakpoints[id];if(breakpoint.sourceFileId===sourceFileId)
result.push(breakpoint);}
return result;},_updateBreakpoint:function(breakpoint)
{if(this._muted||!breakpoint._breakpointStorageId())
return;this._breakpoints[breakpoint._breakpointStorageId()]=new WebInspector.BreakpointManager.Storage.Item(breakpoint);this._save();},_removeBreakpoint:function(breakpoint)
{if(this._muted)
return;delete this._breakpoints[breakpoint._breakpointStorageId()];this._save();},_save:function()
{var breakpointsArray=[];for(var id in this._breakpoints)
breakpointsArray.push(this._breakpoints[id]);this._setting.set(breakpointsArray);}}
WebInspector.BreakpointManager.Storage.Item=function(breakpoint)
{this.sourceFileId=breakpoint._sourceFileId;this.lineNumber=breakpoint.lineNumber();this.columnNumber=breakpoint.columnNumber();this.condition=breakpoint.condition();this.enabled=breakpoint.enabled();}
WebInspector.breakpointManager;;WebInspector.ContentProviderBasedProject=function(workspace,id,type,displayName)
{WebInspector.ProjectStore.call(this,workspace,id,type,displayName);this._contentProviders={};workspace.addProject(this);}
WebInspector.ContentProviderBasedProject.prototype={requestFileContent:function(uiSourceCode,callback)
{var contentProvider=this._contentProviders[uiSourceCode.url()];contentProvider.requestContent(callback);function innerCallback(content,encoded,mimeType)
{callback(content);}},canSetFileContent:function()
{return false;},setFileContent:function(uiSourceCode,newContent,callback)
{callback(null);},canRename:function()
{return false;},rename:function(uiSourceCode,newName,callback)
{var path=uiSourceCode.url();this.performRename(path,newName,innerCallback.bind(this));function innerCallback(success,newName)
{if(success&&newName){var copyOfPath=path.split("/");copyOfPath[copyOfPath.length-1]=newName;var newPath=copyOfPath.join("/");this._contentProviders[newPath]=this._contentProviders[path];delete this._contentProviders[path];this.renameUISourceCode(uiSourceCode,newName);}
callback(success,newName);}},refresh:function(path,callback)
{if(callback)
callback();},excludeFolder:function(path)
{},createFile:function(path,name,content,callback)
{},deleteFile:function(path)
{},remove:function()
{},performRename:function(path,newName,callback)
{callback(false);},searchInFileContent:function(uiSourceCode,query,caseSensitive,isRegex,callback)
{var contentProvider=this._contentProviders[uiSourceCode.url()];contentProvider.searchInContent(query,caseSensitive,isRegex,callback);},findFilesMatchingSearchRequest:function(searchConfig,filesMathingFileQuery,progress,callback)
{var result=[];var paths=filesMathingFileQuery;var totalCount=paths.length;if(totalCount===0){setTimeout(doneCallback,0);return;}
var barrier=new CallbackBarrier();progress.setTotalWork(paths.length);for(var i=0;i<paths.length;++i)
searchInContent.call(this,paths[i],barrier.createCallback(searchInContentCallback.bind(null,paths[i])));barrier.callWhenDone(doneCallback);function searchInContent(path,callback)
{var queriesToRun=searchConfig.queries().slice();searchNextQuery.call(this);function searchNextQuery()
{if(!queriesToRun.length){callback(true);return;}
var query=queriesToRun.shift();this._contentProviders[path].searchInContent(query,!searchConfig.ignoreCase(),searchConfig.isRegex(),contentCallback.bind(this));}
function contentCallback(searchMatches)
{if(!searchMatches.length){callback(false);return;}
searchNextQuery.call(this);}}
function searchInContentCallback(path,matches)
{if(matches)
result.push(path);progress.worked(1);}
function doneCallback()
{callback(result);progress.done();}},indexContent:function(progress)
{setImmediate(progress.done.bind(progress));},addUISourceCodeWithProvider:function(uiSourceCode,contentProvider)
{this._contentProviders[uiSourceCode.url()]=contentProvider;this.addUISourceCode(uiSourceCode,true);},addContentProvider:function(url,contentProvider)
{var uiSourceCode=this.createUISourceCode(url,contentProvider.contentType());this.addUISourceCodeWithProvider(uiSourceCode,contentProvider);return uiSourceCode;},removeFile:function(path)
{delete this._contentProviders[path];this.removeUISourceCode(path);},reset:function()
{this._contentProviders={};this.removeProject();this.workspace().addProject(this);},dispose:function()
{this._contentProviders={};this.removeProject();},__proto__:WebInspector.ProjectStore.prototype};WebInspector.DefaultScriptMapping=function(debuggerModel,workspace,debuggerWorkspaceBinding)
{this._debuggerModel=debuggerModel;this._debuggerWorkspaceBinding=debuggerWorkspaceBinding;this._workspace=workspace;this._projectId=WebInspector.DefaultScriptMapping.projectIdForTarget(debuggerModel.target());this._project=new WebInspector.ContentProviderBasedProject(this._workspace,this._projectId,WebInspector.projectTypes.Debugger,"");debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);this._debuggerReset();}
WebInspector.DefaultScriptMapping.prototype={rawLocationToUILocation:function(rawLocation)
{var debuggerModelLocation=(rawLocation);var script=debuggerModelLocation.script();var uiSourceCode=this._uiSourceCodeForScriptId.get(script.scriptId);var lineNumber=debuggerModelLocation.lineNumber-(script.isInlineScriptWithSourceURL()?script.lineOffset:0);var columnNumber=debuggerModelLocation.columnNumber||0;if(script.isInlineScriptWithSourceURL()&&!lineNumber&&columnNumber)
columnNumber-=script.columnOffset;return uiSourceCode.uiLocation(lineNumber,columnNumber);},uiLocationToRawLocation:function(uiSourceCode,lineNumber,columnNumber)
{var scriptId=this._scriptIdForUISourceCode.get(uiSourceCode);var script=this._debuggerModel.scriptForId(scriptId);if(script.isInlineScriptWithSourceURL())
return this._debuggerModel.createRawLocation(script,lineNumber+script.lineOffset,lineNumber?columnNumber:columnNumber+script.columnOffset);return this._debuggerModel.createRawLocation(script,lineNumber,columnNumber);},addScript:function(script)
{var splitURL=WebInspector.ParsedURL.splitURLIntoPathComponents(script.sourceURL);var url=splitURL[splitURL.length-1];url="debugger:///VM"+script.scriptId+(url?" "+url:"");var uiSourceCode=this._project.createUISourceCode(url,WebInspector.resourceTypes.Script);this._uiSourceCodeForScriptId.set(script.scriptId,uiSourceCode);this._scriptIdForUISourceCode.set(uiSourceCode,script.scriptId);this._project.addUISourceCodeWithProvider(uiSourceCode,script);this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel.target(),uiSourceCode,this);this._debuggerWorkspaceBinding.pushSourceMapping(script,this);},isIdentity:function()
{return true;},uiLineHasMapping:function(uiSourceCode,lineNumber)
{return true;},_debuggerReset:function()
{this._uiSourceCodeForScriptId=new Map();this._scriptIdForUISourceCode=new Map();this._project.reset();},dispose:function()
{this._project.dispose();}}
WebInspector.DefaultScriptMapping.projectIdForTarget=function(target)
{return"debugger:"+target.id();};WebInspector.FileSystemWorkspaceBinding=function(isolatedFileSystemManager,workspace)
{this._isolatedFileSystemManager=isolatedFileSystemManager;this._workspace=workspace;this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded,this._fileSystemAdded,this);this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved,this._fileSystemRemoved,this);this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemFilesChanged,this._fileSystemFilesChanged,this);this._boundFileSystems=new Map();}
WebInspector.FileSystemWorkspaceBinding._styleSheetExtensions=new Set(["css","scss","sass","less"]);WebInspector.FileSystemWorkspaceBinding._documentExtensions=new Set(["htm","html","asp","aspx","phtml","jsp"]);WebInspector.FileSystemWorkspaceBinding._scriptExtensions=new Set(["asp","aspx","c","cc","cljs","coffee","cpp","cs","dart","java","js","jsp","h","m","mm","py","sh","ts"]);WebInspector.FileSystemWorkspaceBinding._imageExtensions=WebInspector.IsolatedFileSystem.ImageExtensions;WebInspector.FileSystemWorkspaceBinding.projectId=function(fileSystemPath)
{return fileSystemPath;}
WebInspector.FileSystemWorkspaceBinding.relativePath=function(uiSourceCode)
{var baseURL=(uiSourceCode.project())._fileSystemBaseURL;return uiSourceCode.url().substring(baseURL.length).split("/");}
WebInspector.FileSystemWorkspaceBinding.completeURL=function(project,relativePath)
{var fsProject=(project);return fsProject._fileSystemBaseURL+relativePath;}
WebInspector.FileSystemWorkspaceBinding._contentTypeForExtension=function(extension)
{if(WebInspector.FileSystemWorkspaceBinding._styleSheetExtensions.has(extension))
return WebInspector.resourceTypes.Stylesheet;if(WebInspector.FileSystemWorkspaceBinding._documentExtensions.has(extension))
return WebInspector.resourceTypes.Document;if(WebInspector.FileSystemWorkspaceBinding._imageExtensions.has(extension))
return WebInspector.resourceTypes.Image;if(WebInspector.FileSystemWorkspaceBinding._scriptExtensions.has(extension))
return WebInspector.resourceTypes.Script;return WebInspector.resourceTypes.Other;}
WebInspector.FileSystemWorkspaceBinding.prototype={fileSystemManager:function()
{return this._isolatedFileSystemManager;},_fileSystemAdded:function(event)
{var fileSystem=(event.data);var boundFileSystem=new WebInspector.FileSystemWorkspaceBinding.FileSystem(this,fileSystem,this._workspace);this._boundFileSystems.set(fileSystem.path(),boundFileSystem);},_fileSystemRemoved:function(event)
{var fileSystem=(event.data);var boundFileSystem=this._boundFileSystems.get(fileSystem.path());boundFileSystem.dispose();this._boundFileSystems.remove(fileSystem.path());},_fileSystemFilesChanged:function(event)
{var paths=(event.data);for(var path of paths){for(var key of this._boundFileSystems.keys()){if(!path.startsWith(key))
continue;this._boundFileSystems.get(key)._fileChanged(path);}}},fileSystemPath:function(projectId)
{return projectId;},dispose:function()
{this._isolatedFileSystemManager.removeEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded,this._fileSystemAdded,this);this._isolatedFileSystemManager.removeEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved,this._fileSystemRemoved,this);this._isolatedFileSystemManager.dispose();for(var fileSystem of this._boundFileSystems.values()){fileSystem.dispose();this._boundFileSystems.remove(fileSystem._fileSystem.path());}}}
WebInspector.FileSystemWorkspaceBinding.FileSystem=function(fileSystemWorkspaceBinding,isolatedFileSystem,workspace)
{this._fileSystemWorkspaceBinding=fileSystemWorkspaceBinding;this._fileSystem=isolatedFileSystem;this._fileSystemBaseURL=this._fileSystem.path()+"/";this._fileSystemPath=this._fileSystem.path();var id=WebInspector.FileSystemWorkspaceBinding.projectId(this._fileSystemPath);console.assert(!workspace.project(id));var displayName=this._fileSystemPath.substr(this._fileSystemPath.lastIndexOf("/")+1);WebInspector.ProjectStore.call(this,workspace,id,WebInspector.projectTypes.FileSystem,displayName);workspace.addProject(this);this.populate();}
WebInspector.FileSystemWorkspaceBinding.FileSystem.prototype={fileSystemPath:function()
{return this._fileSystemPath;},_filePathForUISourceCode:function(uiSourceCode)
{return uiSourceCode.url().substring(this._fileSystemPath.length);},requestFileContent:function(uiSourceCode,callback)
{var filePath=this._filePathForUISourceCode(uiSourceCode);var isImage=WebInspector.FileSystemWorkspaceBinding._imageExtensions.has(WebInspector.TextUtils.extension(filePath));this._fileSystem.requestFileContent(filePath,isImage?base64CallbackWrapper:callback);function base64CallbackWrapper(result)
{if(!result){callback(result);return;}
var index=result.indexOf(",");callback(result.substring(index+1));}},canSetFileContent:function()
{return true;},setFileContent:function(uiSourceCode,newContent,callback)
{var filePath=this._filePathForUISourceCode(uiSourceCode);this._fileSystem.setFileContent(filePath,newContent,callback.bind(this,""));},canRename:function()
{return true;},rename:function(uiSourceCode,newName,callback)
{if(newName===uiSourceCode.name()){callback(true,uiSourceCode.name(),uiSourceCode.url(),uiSourceCode.contentType());return;}
var filePath=this._filePathForUISourceCode(uiSourceCode);this._fileSystem.renameFile(filePath,newName,innerCallback.bind(this));function innerCallback(success,newName)
{if(!success||!newName){callback(false,newName);return;}
console.assert(newName);var slash=filePath.lastIndexOf("/");var parentPath=filePath.substring(0,slash);filePath=parentPath+"/"+newName;filePath=filePath.substr(1);var extension=this._extensionForPath(newName);var newURL=this._fileSystemBaseURL+filePath;var newContentType=WebInspector.FileSystemWorkspaceBinding._contentTypeForExtension(extension);this.renameUISourceCode(uiSourceCode,newName);callback(true,newName,newURL,newContentType);}},searchInFileContent:function(uiSourceCode,query,caseSensitive,isRegex,callback)
{var filePath=this._filePathForUISourceCode(uiSourceCode);this._fileSystem.requestFileContent(filePath,contentCallback);function contentCallback(content)
{var result=[];if(content!==null)
result=WebInspector.ContentProvider.performSearchInContent(content,query,caseSensitive,isRegex);callback(result);}},findFilesMatchingSearchRequest:function(searchConfig,filesMathingFileQuery,progress,callback)
{var result=filesMathingFileQuery;var queriesToRun=searchConfig.queries().slice();if(!queriesToRun.length)
queriesToRun.push("");progress.setTotalWork(queriesToRun.length);searchNextQuery.call(this);function searchNextQuery()
{if(!queriesToRun.length){progress.done();callback(result);return;}
var query=queriesToRun.shift();this._fileSystem.searchInPath(searchConfig.isRegex()?"":query,progress,innerCallback.bind(this));}
function innerCallback(files)
{files=files.sort();progress.worked(1);result=result.intersectOrdered(files,String.naturalOrderComparator);searchNextQuery.call(this);}},indexContent:function(progress)
{this._fileSystem.indexContent(progress);},_extensionForPath:function(path)
{var extensionIndex=path.lastIndexOf(".");if(extensionIndex===-1)
return"";return path.substring(extensionIndex+1).toLowerCase();},populate:function()
{this._fileSystem.requestFilesRecursive("",this._addFile.bind(this));},refresh:function(path,callback)
{this._fileSystem.requestFilesRecursive(path,this._addFile.bind(this),callback);},excludeFolder:function(url)
{var relativeFolder=url.substring(this._fileSystemBaseURL.length);if(!relativeFolder.startsWith("/"))
relativeFolder="/"+relativeFolder;if(!relativeFolder.endsWith("/"))
relativeFolder+="/";this._fileSystem.addExcludedFolder(relativeFolder);var uiSourceCodes=this.uiSourceCodes().slice();for(var i=0;i<uiSourceCodes.length;++i){var uiSourceCode=uiSourceCodes[i];if(uiSourceCode.url().startsWith(url))
this.removeUISourceCode(uiSourceCode.url());}},createFile:function(path,name,content,callback)
{this._fileSystem.createFile(path,name,innerCallback.bind(this));var createFilePath;function innerCallback(filePath)
{if(!filePath){callback(null);return;}
createFilePath=filePath;if(!content){contentSet.call(this);return;}
this._fileSystem.setFileContent(filePath,content,contentSet.bind(this));}
function contentSet()
{callback(this._addFile(createFilePath));}},deleteFile:function(path)
{this._fileSystem.deleteFile(path);this.removeUISourceCode(path);},remove:function()
{this._fileSystemWorkspaceBinding._isolatedFileSystemManager.removeFileSystem(this._fileSystem);},_addFile:function(filePath)
{if(!filePath)
console.assert(false);var extension=this._extensionForPath(filePath);var contentType=WebInspector.FileSystemWorkspaceBinding._contentTypeForExtension(extension);var uiSourceCode=this.createUISourceCode(this._fileSystemBaseURL+filePath,contentType);this.addUISourceCode(uiSourceCode);return uiSourceCode;},_fileChanged:function(path)
{var uiSourceCode=this.uiSourceCodeForURL(path);if(!uiSourceCode){this._addFile(path);return;}
uiSourceCode.checkContentUpdated();},dispose:function()
{this.removeProject();},__proto__:WebInspector.ProjectStore.prototype};WebInspector.OutputStreamDelegate=function()
{}
WebInspector.OutputStreamDelegate.prototype={onTransferStarted:function(){},onTransferFinished:function(){},onChunkTransferred:function(reader){},onError:function(reader,event){},}
WebInspector.ChunkedReader=function()
{}
WebInspector.ChunkedReader.prototype={fileSize:function(){},loadedSize:function(){},fileName:function(){},cancel:function(){}}
WebInspector.ChunkedFileReader=function(file,chunkSize,delegate)
{this._file=file;this._fileSize=file.size;this._loadedSize=0;this._chunkSize=chunkSize;this._delegate=delegate;this._decoder=new TextDecoder();this._isCanceled=false;}
WebInspector.ChunkedFileReader.prototype={start:function(output)
{this._output=output;this._reader=new FileReader();this._reader.onload=this._onChunkLoaded.bind(this);this._reader.onerror=this._delegate.onError.bind(this._delegate,this);this._delegate.onTransferStarted();this._loadChunk();},cancel:function()
{this._isCanceled=true;},loadedSize:function()
{return this._loadedSize;},fileSize:function()
{return this._fileSize;},fileName:function()
{return this._file.name;},_onChunkLoaded:function(event)
{if(this._isCanceled)
return;if(event.target.readyState!==FileReader.DONE)
return;var buffer=event.target.result;this._loadedSize+=buffer.byteLength;var endOfFile=this._loadedSize===this._fileSize;var decodedString=this._decoder.decode(buffer,{stream:!endOfFile});this._output.write(decodedString);if(this._isCanceled)
return;this._delegate.onChunkTransferred(this);if(endOfFile){this._file=null;this._reader=null;this._output.close();this._delegate.onTransferFinished();return;}
this._loadChunk();},_loadChunk:function()
{var chunkStart=this._loadedSize;var chunkEnd=Math.min(this._fileSize,chunkStart+this._chunkSize);var nextPart=this._file.slice(chunkStart,chunkEnd);this._reader.readAsArrayBuffer(nextPart);}}
WebInspector.createFileSelectorElement=function(callback)
{var fileSelectorElement=createElement("input");fileSelectorElement.type="file";fileSelectorElement.style.display="none";fileSelectorElement.setAttribute("tabindex",-1);fileSelectorElement.onchange=onChange;function onChange(event)
{callback(fileSelectorElement.files[0]);};return fileSelectorElement;}
WebInspector.FileOutputStream=function()
{}
WebInspector.FileOutputStream.prototype={open:function(fileName,callback)
{this._closed=false;this._writeCallbacks=[];this._fileName=fileName;function callbackWrapper(accepted)
{if(accepted)
WebInspector.fileManager.addEventListener(WebInspector.FileManager.EventTypes.AppendedToURL,this._onAppendDone,this);callback(accepted);}
WebInspector.fileManager.save(this._fileName,"",true,callbackWrapper.bind(this));},write:function(data,callback)
{this._writeCallbacks.push(callback);WebInspector.fileManager.append(this._fileName,data);},close:function()
{this._closed=true;if(this._writeCallbacks.length)
return;WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL,this._onAppendDone,this);WebInspector.fileManager.close(this._fileName);},_onAppendDone:function(event)
{if(event.data!==this._fileName)
return;var callback=this._writeCallbacks.shift();if(callback)
callback(this);if(!this._writeCallbacks.length){if(this._closed){WebInspector.fileManager.removeEventListener(WebInspector.FileManager.EventTypes.AppendedToURL,this._onAppendDone,this);WebInspector.fileManager.close(this._fileName);}}}};WebInspector.BlackboxSupport={}
WebInspector.BlackboxSupport._urlToRegExpString=function(url)
{var parsedURL=new WebInspector.ParsedURL(url);if(parsedURL.isAboutBlank()||parsedURL.isDataURL())
return"";if(!parsedURL.isValid)
return"^"+url.escapeForRegExp()+"$";var name=parsedURL.lastPathComponent;if(name)
name="/"+name;else if(parsedURL.folderPathComponents)
name=parsedURL.folderPathComponents+"/";if(!name)
name=parsedURL.host;if(!name)
return"";var scheme=parsedURL.scheme;var prefix="";if(scheme&&scheme!=="http"&&scheme!=="https"){prefix="^"+scheme+"://";if(scheme==="chrome-extension")
prefix+=parsedURL.host+"\\b";prefix+=".*";}
return prefix+name.escapeForRegExp()+(url.endsWith(name)?"$":"\\b");}
WebInspector.BlackboxSupport.canBlackboxURL=function(url)
{return!!WebInspector.BlackboxSupport._urlToRegExpString(url);}
WebInspector.BlackboxSupport.blackboxURL=function(url)
{var regexPatterns=WebInspector.moduleSetting("skipStackFramesPattern").getAsArray();var regexValue=WebInspector.BlackboxSupport._urlToRegExpString(url);if(!regexValue)
return;var found=false;for(var i=0;i<regexPatterns.length;++i){var item=regexPatterns[i];if(item.pattern===regexValue){item.disabled=false;found=true;break;}}
if(!found)
regexPatterns.push({pattern:regexValue});WebInspector.moduleSetting("skipStackFramesPattern").setAsArray(regexPatterns);}
WebInspector.BlackboxSupport.unblackbox=function(url,isContentScript)
{if(isContentScript)
WebInspector.moduleSetting("skipContentScripts").set(false);var regexPatterns=WebInspector.moduleSetting("skipStackFramesPattern").getAsArray();var regexValue=WebInspector.BlackboxSupport._urlToRegExpString(url);if(!regexValue)
return;regexPatterns=regexPatterns.filter(function(item){return item.pattern!==regexValue;});for(var i=0;i<regexPatterns.length;++i){var item=regexPatterns[i];if(item.disabled)
continue;try{var regex=new RegExp(item.pattern);if(regex.test(url))
item.disabled=true;}catch(e){}}
WebInspector.moduleSetting("skipStackFramesPattern").setAsArray(regexPatterns);}
WebInspector.BlackboxSupport.isBlackboxedURL=function(url)
{var regex=WebInspector.moduleSetting("skipStackFramesPattern").asRegExp();return regex&&regex.test(url);}
WebInspector.BlackboxSupport.isBlackboxed=function(url,isContentScript)
{if(isContentScript&&WebInspector.moduleSetting("skipContentScripts").get())
return true;return WebInspector.BlackboxSupport.isBlackboxedURL(url);}
WebInspector.BlackboxSupport.addChangeListener=function(listener,thisObject)
{WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(listener,thisObject);}
WebInspector.BlackboxSupport.removeChangeListener=function(listener,thisObject)
{WebInspector.moduleSetting("skipStackFramesPattern").removeChangeListener(listener,thisObject);};WebInspector.NetworkMapping=function(targetManager,workspace,fileSystemWorkspaceBinding,fileSystemMapping)
{this._targetManager=targetManager;this._workspace=workspace;this._fileSystemWorkspaceBinding=fileSystemWorkspaceBinding;this._fileSystemMapping=fileSystemMapping;InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.RevealSourceLine,this._revealSourceLine,this);var fileSystemManager=fileSystemWorkspaceBinding.fileSystemManager();for(var path of fileSystemManager.fileSystemPaths()){var fileSystem=fileSystemManager.fileSystem(path);this._fileSystemAdded(new WebInspector.Event(fileSystemManager,WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded,fileSystem));}
if(fileSystemManager.fileSystemsLoaded())
this._fileSystemsLoaded();fileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded,this._fileSystemAdded,this);fileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved,this._fileSystemRemoved,this);fileSystemManager.addEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemsLoaded,this._fileSystemsLoaded,this);this._fileSystemMapping.addEventListener(WebInspector.FileSystemMapping.Events.FileMappingAdded,this._fileSystemMappingChanged,this);this._fileSystemMapping.addEventListener(WebInspector.FileSystemMapping.Events.FileMappingRemoved,this._fileSystemMappingChanged,this);}
WebInspector.NetworkMapping.prototype={_fileSystemAdded:function(event)
{this._addingFileSystem=true;var fileSystem=(event.data);this._fileSystemMapping.addFileSystem(fileSystem.path());var mappings=fileSystem.projectProperty("mappings");for(var i=0;Array.isArray(mappings)&&i<mappings.length;++i){var mapping=mappings[i];if(!mapping||typeof mapping!=="object")
continue;var folder=mapping["folder"];var url=mapping["url"];if(typeof folder!=="string"||typeof url!=="string")
continue;this._fileSystemMapping.addNonConfigurableFileMapping(fileSystem.path(),url,folder);}
this._addingFileSystem=false;this._fileSystemMappingChanged();},_fileSystemRemoved:function(event)
{var fileSystem=(event.data);this._fileSystemMapping.removeFileSystem(fileSystem.path());this._fileSystemMappingChanged();},networkURL:function(uiSourceCode)
{if(uiSourceCode.project().type()===WebInspector.projectTypes.FileSystem){var fileSystemPath=this._fileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id());return this._networkURLForFileSystemURL(fileSystemPath,uiSourceCode.url());}
return uiSourceCode.url();},hasMappingForNetworkURL:function(url)
{return this._fileSystemMapping.hasMappingForNetworkURL(url);},_networkUISourceCodeForURL:function(target,frame,url)
{return this._workspace.uiSourceCode(WebInspector.NetworkProject.projectId(target,frame,false),url);},_contentScriptUISourceCodeForURL:function(target,frame,url)
{return this._workspace.uiSourceCode(WebInspector.NetworkProject.projectId(target,frame,true),url);},_fileSystemUISourceCodeForURL:function(url)
{var file=this._fileSystemMapping.fileForURL(url);if(file){var projectId=WebInspector.FileSystemWorkspaceBinding.projectId(file.fileSystemPath);return this._workspace.uiSourceCode(projectId,file.fileURL);}
return null;},_uiSourceCodeForURL:function(target,frame,url)
{return this._fileSystemUISourceCodeForURL(url)||this._networkUISourceCodeForURL(target,frame,url)||this._contentScriptUISourceCodeForURL(target,frame,url);},uiSourceCodeForScriptURL:function(url,script)
{var frame=WebInspector.ResourceTreeFrame.fromScript(script);return this._uiSourceCodeForURL(script.target(),frame,url);},uiSourceCodeForStyleURL:function(url,header)
{var frame=WebInspector.ResourceTreeFrame.fromStyleSheet(header);return this._uiSourceCodeForURL(header.target(),frame,url);},uiSourceCodeForURLForAnyTarget:function(url)
{return this._fileSystemUISourceCodeForURL(url)||WebInspector.workspace.uiSourceCodeForURL(url);},_networkURLForFileSystemURL:function(fileSystemPath,filePath)
{return this._fileSystemMapping.networkURLForFileSystemURL(fileSystemPath,filePath);},addMapping:function(networkUISourceCode,uiSourceCode)
{var url=this.networkURL(networkUISourceCode);var path=uiSourceCode.url();var fileSystemPath=this._fileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id());this._fileSystemMapping.addMappingForResource(url,fileSystemPath,path);},removeMapping:function(uiSourceCode)
{var networkURL=this.networkURL(uiSourceCode);this._fileSystemMapping.removeMappingForURL(networkURL);},_revealSourceLine:function(event)
{var url=(event.data["url"]);var lineNumber=(event.data["lineNumber"]);var columnNumber=(event.data["columnNumber"]);var uiSourceCode=this.uiSourceCodeForURLForAnyTarget(url);if(uiSourceCode){WebInspector.Revealer.reveal(uiSourceCode.uiLocation(lineNumber,columnNumber));return;}
function listener(event)
{var uiSourceCode=(event.data);if(this.networkURL(uiSourceCode)===url){WebInspector.Revealer.reveal(uiSourceCode.uiLocation(lineNumber,columnNumber));this._workspace.removeEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,listener,this);}}
this._workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdded,listener,this);},_fileSystemsLoaded:function()
{this._fileSystemsReady=true;},_fileSystemMappingChanged:function()
{if(!this._fileSystemsReady||this._addingFileSystem)
return;this._targetManager.suspendAndResumeAllTargets();},dispose:function()
{this._fileSystemWorkspaceBinding.fileSystemManager().removeEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemAdded,this._fileSystemAdded,this);this._fileSystemWorkspaceBinding.fileSystemManager().removeEventListener(WebInspector.IsolatedFileSystemManager.Events.FileSystemRemoved,this._fileSystemRemoved,this);this._fileSystemMapping.removeEventListener(WebInspector.FileSystemMapping.Events.FileMappingAdded,this._fileSystemMappingChanged,this);this._fileSystemMapping.removeEventListener(WebInspector.FileSystemMapping.Events.FileMappingRemoved,this._fileSystemMappingChanged,this);}}
WebInspector.networkMapping;;WebInspector.NetworkProjectManager=function(targetManager,workspace,networkMapping)
{this._workspace=workspace;this._networkMapping=networkMapping;targetManager.observeTargets(this);}
WebInspector.NetworkProjectManager.prototype={targetAdded:function(target)
{new WebInspector.NetworkProject(target,this._workspace,this._networkMapping);},targetRemoved:function(target)
{WebInspector.NetworkProject.forTarget(target)._dispose();}}
WebInspector.NetworkProject=function(target,workspace,networkMapping)
{WebInspector.SDKObject.call(this,target);this._workspace=workspace;this._networkMapping=networkMapping;this._workspaceProjects=new Map();target[WebInspector.NetworkProject._networkProjectSymbol]=this;target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded,this._resourceAdded,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameWillNavigate,this._frameWillNavigate,this);target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._mainFrameNavigated,this);var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(debuggerModel){debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource,this._parsedScriptSource,this);debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource,this._parsedScriptSource,this);}
var cssModel=WebInspector.CSSStyleModel.fromTarget(target);if(cssModel){cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetAdded,this);cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._styleSheetRemoved,this);}
target.targetManager().addEventListener(WebInspector.TargetManager.Events.SuspendStateChanged,this._suspendStateChanged,this);}
WebInspector.NetworkProject._networkProjectSymbol=Symbol("networkProject");WebInspector.NetworkProject._resourceSymbol=Symbol("resource");WebInspector.NetworkProject._scriptSymbol=Symbol("script");WebInspector.NetworkProject._styleSheetSymbol=Symbol("styleSheet");WebInspector.NetworkProject._targetSymbol=Symbol("target");WebInspector.NetworkProject._frameSymbol=Symbol("frame");WebInspector.NetworkProject.projectId=function(target,frame,isContentScripts)
{return target.id()+":"+(frame?frame.id:"")+":"+(isContentScripts?"contentscripts":"");}
WebInspector.NetworkProject.forTarget=function(target)
{return target[WebInspector.NetworkProject._networkProjectSymbol];}
WebInspector.NetworkProject.targetForProject=function(project)
{return project[WebInspector.NetworkProject._targetSymbol]||null;}
WebInspector.NetworkProject.frameForProject=function(project)
{return project[WebInspector.NetworkProject._frameSymbol]||null;}
WebInspector.NetworkProject.targetForUISourceCode=function(uiSourceCode)
{return uiSourceCode[WebInspector.NetworkProject._targetSymbol]||null;}
WebInspector.NetworkProject.uiSourceCodeMimeType=function(uiSourceCode)
{if(uiSourceCode[WebInspector.NetworkProject._scriptSymbol]||uiSourceCode[WebInspector.NetworkProject._styleSheetSymbol]){return uiSourceCode.contentType().canonicalMimeType();}
var resource=uiSourceCode[WebInspector.NetworkProject._resourceSymbol];if(resource)
return resource.mimeType;var mimeType=WebInspector.ResourceType.mimeFromURL(uiSourceCode.url());return mimeType||uiSourceCode.contentType().canonicalMimeType();}
WebInspector.NetworkProject.uiSourceCodeFrame=function(uiSourceCode)
{var target=uiSourceCode[WebInspector.NetworkProject._targetSymbol];if(!target)
return null;var frameId;var script=uiSourceCode[WebInspector.NetworkProject._scriptSymbol];if(script){var executionContext=script.executionContext();if(executionContext)
frameId=executionContext.frameId;}
if(!frameId){var header=uiSourceCode[WebInspector.NetworkProject._styleSheetSymbol];if(header)
frameId=header.frameId;}
if(!frameId){var resource=uiSourceCode[WebInspector.NetworkProject._resourceSymbol];if(resource)
frameId=resource.frameId;}
return frameId?target.resourceTreeModel.frameForId(frameId):null;}
WebInspector.NetworkProject.prototype={_workspaceProject:function(frame,isContentScripts)
{var projectId=WebInspector.NetworkProject.projectId(this.target(),frame,isContentScripts);var projectType=isContentScripts?WebInspector.projectTypes.ContentScripts:WebInspector.projectTypes.Network;var project=this._workspaceProjects.get(projectId);if(project)
return project;project=new WebInspector.ContentProviderBasedProject(this._workspace,projectId,projectType,"");project[WebInspector.NetworkProject._targetSymbol]=this.target();project[WebInspector.NetworkProject._frameSymbol]=frame;this._workspaceProjects.set(projectId,project);return project;},addFileForURL:function(url,contentProvider,frame,isContentScript)
{return this._createFile(url,contentProvider,frame,isContentScript||false,true);},_removeFileForURL:function(frame,url)
{var project=this._workspaceProjects.get(WebInspector.NetworkProject.projectId(this.target(),frame,false));if(!project)
return;project.removeFile(url);},_populate:function()
{function populateFrame(frame)
{for(var i=0;i<frame.childFrames.length;++i)
populateFrame.call(this,frame.childFrames[i]);var resources=frame.resources();for(var i=0;i<resources.length;++i)
this._addResource(resources[i]);}
var mainFrame=this.target().resourceTreeModel.mainFrame;if(mainFrame)
populateFrame.call(this,mainFrame);},_addUISourceCodeWithProvider:function(uiSourceCode,contentProvider)
{(uiSourceCode.project()).addUISourceCodeWithProvider(uiSourceCode,contentProvider);},_parsedScriptSource:function(event)
{var script=(event.data);if(!script.sourceURL||script.isLiveEdit()||(script.isInlineScript()&&!script.hasSourceURL))
return;if(script.isContentScript()&&!script.hasSourceURL){var parsedURL=new WebInspector.ParsedURL(script.sourceURL);if(!parsedURL.isValid)
return;}
var uiSourceCode=this._createFile(script.sourceURL,script,WebInspector.ResourceTreeFrame.fromScript(script),script.isContentScript(),false);if(uiSourceCode){uiSourceCode[WebInspector.NetworkProject._scriptSymbol]=script;this._addUISourceCodeWithProvider(uiSourceCode,script);}},_styleSheetAdded:function(event)
{var header=(event.data);if(header.isInline&&!header.hasSourceURL&&header.origin!=="inspector")
return;var uiSourceCode=this._createFile(header.resourceURL(),header,WebInspector.ResourceTreeFrame.fromStyleSheet(header),false,false);if(uiSourceCode){uiSourceCode[WebInspector.NetworkProject._styleSheetSymbol]=header;this._addUISourceCodeWithProvider(uiSourceCode,header);}},_styleSheetRemoved:function(event)
{var header=(event.data);if(header.isInline&&!header.hasSourceURL&&header.origin!=="inspector")
return;this._removeFileForURL(WebInspector.ResourceTreeFrame.fromStyleSheet(header),header.resourceURL());},_resourceAdded:function(event)
{var resource=(event.data);this._addResource(resource);},_addResource:function(resource)
{var resourceType=resource.resourceType();if(resourceType!==WebInspector.resourceTypes.Image&&resourceType!==WebInspector.resourceTypes.Font&&resourceType!==WebInspector.resourceTypes.Document&&resourceType!==WebInspector.resourceTypes.Manifest){return;}
if(resourceType===WebInspector.resourceTypes.Image&&resource.mimeType&&!resource.mimeType.startsWith("image"))
return;if(resourceType===WebInspector.resourceTypes.Font&&resource.mimeType&&!resource.mimeType.includes("font"))
return;if((resourceType===WebInspector.resourceTypes.Image||resourceType===WebInspector.resourceTypes.Font)&&resource.contentURL().startsWith("data:"))
return;if(this._workspace.uiSourceCodeForURL(resource.url))
return;var uiSourceCode=this._createFile(resource.url,resource,WebInspector.ResourceTreeFrame.fromResource(resource),false,false);if(uiSourceCode){uiSourceCode[WebInspector.NetworkProject._resourceSymbol]=resource;this._addUISourceCodeWithProvider(uiSourceCode,resource);}},_frameWillNavigate:function(event)
{var frame=(event.data);var project=this._workspaceProject(frame,false);for(var resource of frame.resources())
project.removeUISourceCode(resource.url);project=this._workspaceProject(frame,true);for(var resource of frame.resources())
project.removeUISourceCode(resource.url);},_mainFrameNavigated:function(event)
{this._reset();this._populate();},_suspendStateChanged:function()
{if(this.target().targetManager().allTargetsSuspended())
this._reset();else
this._populate();},_createFile:function(url,contentProvider,frame,isContentScript,addIntoProject)
{if(this._networkMapping.hasMappingForNetworkURL(url))
return null;var project=this._workspaceProject(frame,isContentScript);var uiSourceCode=project.createUISourceCode(url,contentProvider.contentType());uiSourceCode[WebInspector.NetworkProject._targetSymbol]=this.target();if(addIntoProject)
project.addUISourceCodeWithProvider(uiSourceCode,contentProvider);return uiSourceCode;},_dispose:function()
{this._reset();var target=this.target();target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded,this._resourceAdded,this);target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._mainFrameNavigated,this);var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(debuggerModel){debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource,this._parsedScriptSource,this);debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource,this._parsedScriptSource,this);}
var cssModel=WebInspector.CSSStyleModel.fromTarget(target);if(cssModel){cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._styleSheetAdded,this);cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._styleSheetRemoved,this);}
delete target[WebInspector.NetworkProject._networkProjectSymbol];},_reset:function()
{for(var project of this._workspaceProjects.values())
project.reset();this._workspaceProjects.clear();},__proto__:WebInspector.SDKObject.prototype};WebInspector.PresentationConsoleMessageHelper=function(workspace)
{this._workspace=workspace;this._pendingConsoleMessages={};this._presentationConsoleMessages=[];WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared,this._consoleCleared,this);WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded,this._onConsoleMessageAdded,this);WebInspector.multitargetConsoleModel.messages().forEach(this._consoleMessageAdded,this);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.ParsedScriptSource,this._parsedScriptSource,this);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.FailedToParseScriptSource,this._parsedScriptSource,this);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._debuggerReset,this);}
WebInspector.PresentationConsoleMessageHelper.prototype={_onConsoleMessageAdded:function(event)
{var message=(event.data);this._consoleMessageAdded(message);},_consoleMessageAdded:function(message)
{if(!message.url||!message.isErrorOrWarning())
return;var rawLocation=this._rawLocation(message);if(rawLocation)
this._addConsoleMessageToScript(message,rawLocation);else
this._addPendingConsoleMessage(message);},_rawLocation:function(message)
{var debuggerModel=WebInspector.DebuggerModel.fromTarget(message.target());if(!debuggerModel)
return null;var lineNumber=message.stackTrace?message.stackTrace[0].lineNumber-1:message.line-1;var columnNumber=message.column?message.column-1:0;if(message.stackTrace&&message.stackTrace[0].columnNumber)
columnNumber=message.stackTrace[0].columnNumber-1;if(message.scriptId)
return debuggerModel.createRawLocationByScriptId(message.scriptId,lineNumber,columnNumber);return debuggerModel.createRawLocationByURL(message.url||"",lineNumber,columnNumber);},_addConsoleMessageToScript:function(message,rawLocation)
{this._presentationConsoleMessages.push(new WebInspector.PresentationConsoleMessage(message,rawLocation));},_addPendingConsoleMessage:function(message)
{if(!message.url)
return;if(!this._pendingConsoleMessages[message.url])
this._pendingConsoleMessages[message.url]=[];this._pendingConsoleMessages[message.url].push(message);},_parsedScriptSource:function(event)
{var script=(event.data);var messages=this._pendingConsoleMessages[script.sourceURL];if(!messages)
return;var pendingMessages=[];for(var i=0;i<messages.length;i++){var message=messages[i];var rawLocation=this._rawLocation(message);if(!rawLocation)
continue;if(script.target()===message.target()&&script.scriptId===rawLocation.scriptId)
this._addConsoleMessageToScript(message,rawLocation);else
pendingMessages.push(message);}
if(pendingMessages.length)
this._pendingConsoleMessages[script.sourceURL]=pendingMessages;else
delete this._pendingConsoleMessages[script.sourceURL];},_consoleCleared:function()
{this._pendingConsoleMessages={};for(var i=0;i<this._presentationConsoleMessages.length;++i)
this._presentationConsoleMessages[i].dispose();this._presentationConsoleMessages=[];},_debuggerReset:function()
{this._consoleCleared();}}
WebInspector.PresentationConsoleMessage=function(message,rawLocation)
{this._text=message.messageText;this._level=message.level===WebInspector.ConsoleMessage.MessageLevel.Error?WebInspector.UISourceCode.Message.Level.Error:WebInspector.UISourceCode.Message.Level.Warning;this._liveLocation=WebInspector.debuggerWorkspaceBinding.createLiveLocation(rawLocation,this._updateLocation.bind(this));}
WebInspector.PresentationConsoleMessage.prototype={_updateLocation:function(uiLocation)
{if(this._uiMessage)
this._uiMessage.remove();this._uiMessage=uiLocation.uiSourceCode.addLineMessage(this._level,this._text,uiLocation.lineNumber,uiLocation.columnNumber);},dispose:function()
{this._liveLocation.dispose();if(this._uiMessage)
this._uiMessage.remove();}}
WebInspector.presentationConsoleMessageHelper;;WebInspector.resourceForURL=function(url)
{var targets=WebInspector.targetManager.targets();for(var i=0;i<targets.length;++i){var resource=targets[i].resourceTreeModel.resourceForURL(url);if(resource)
return resource;}
return null;}
WebInspector.forAllResources=function(callback)
{var targets=WebInspector.targetManager.targets();for(var i=0;i<targets.length;++i)
targets[i].resourceTreeModel.forAllResources(callback);}
WebInspector.displayNameForURL=function(url)
{if(!url)
return"";var resource=WebInspector.resourceForURL(url);if(resource)
return resource.displayName;var uiSourceCode=WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(url);if(uiSourceCode)
return uiSourceCode.displayName();if(!WebInspector.targetManager.inspectedPageURL())
return url.trimURL("");var parsedURL=WebInspector.targetManager.inspectedPageURL().asParsedURL();var lastPathComponent=parsedURL?parsedURL.lastPathComponent:parsedURL;var index=WebInspector.targetManager.inspectedPageURL().indexOf(lastPathComponent);if(index!==-1&&index+lastPathComponent.length===WebInspector.targetManager.inspectedPageURL().length){var baseURL=WebInspector.targetManager.inspectedPageURL().substring(0,index);if(url.startsWith(baseURL))
return url.substring(index);}
if(!parsedURL)
return url;var displayName=url.trimURL(parsedURL.host);return displayName==="/"?parsedURL.host+"/":displayName;};window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem;WebInspector.TempFile=function()
{this._fileEntry=null;this._writer=null;}
WebInspector.TempFile.create=function(dirPath,name)
{var file=new WebInspector.TempFile();function requestTempFileSystem()
{return new Promise(window.requestFileSystem.bind(window,window.TEMPORARY,10));}
function getDirectoryEntry(fs)
{return new Promise(fs.root.getDirectory.bind(fs.root,dirPath,{create:true}));}
function getFileEntry(dir)
{return new Promise(dir.getFile.bind(dir,name,{create:true}));}
function createFileWriter(fileEntry)
{file._fileEntry=fileEntry;return new Promise(fileEntry.createWriter.bind(fileEntry));}
function truncateFile(writer)
{if(!writer.length){file._writer=writer;return Promise.resolve(file);}
function truncate(fulfill,reject)
{writer.onwriteend=fulfill;writer.onerror=reject;writer.truncate(0);}
function didTruncate()
{file._writer=writer;writer.onwriteend=null;writer.onerror=null;return Promise.resolve(file);}
function onTruncateError(e)
{writer.onwriteend=null;writer.onerror=null;throw e;}
return new Promise(truncate).then(didTruncate,onTruncateError);}
return WebInspector.TempFile.ensureTempStorageCleared().then(requestTempFileSystem).then(getDirectoryEntry).then(getFileEntry).then(createFileWriter).then(truncateFile);}
WebInspector.TempFile.prototype={write:function(strings,callback)
{var blob=new Blob(strings,{type:'text/plain'});this._writer.onerror=function(e)
{WebInspector.console.error("Failed to write into a temp file: "+e.target.error.message);callback(-1);}
this._writer.onwriteend=function(e)
{callback(e.target.length);}
this._writer.write(blob);},finishWriting:function()
{this._writer=null;},read:function(callback)
{this.readRange(undefined,undefined,callback);},readRange:function(startOffset,endOffset,callback)
{function didGetFile(file)
{var reader=new FileReader();if(typeof startOffset==="number"||typeof endOffset==="number")
file=file.slice((startOffset),(endOffset));reader.onloadend=function(e)
{callback((this.result));};reader.onerror=function(error)
{WebInspector.console.error("Failed to read from temp file: "+error.message);};reader.readAsText(file);}
function didFailToGetFile(error)
{WebInspector.console.error("Failed to load temp file: "+error.message);callback(null);}
this._fileEntry.file(didGetFile,didFailToGetFile);},writeToOutputSteam:function(outputStream,delegate)
{function didGetFile(file)
{var reader=new WebInspector.ChunkedFileReader(file,10*1000*1000,delegate);reader.start(outputStream);}
function didFailToGetFile(error)
{WebInspector.console.error("Failed to load temp file: "+error.message);outputStream.close();}
this._fileEntry.file(didGetFile,didFailToGetFile);},remove:function()
{if(this._fileEntry)
this._fileEntry.remove(function(){});}}
WebInspector.DeferredTempFile=function(dirPath,name)
{this._chunks=[];this._tempFile=null;this._isWriting=false;this._finishCallback=null;this._finishedWriting=false;this._callsPendingOpen=[];this._pendingReads=[];WebInspector.TempFile.create(dirPath,name).then(this._didCreateTempFile.bind(this),this._failedToCreateTempFile.bind(this));}
WebInspector.DeferredTempFile.prototype={write:function(strings,callback)
{if(!this._chunks)
return;if(this._finishCallback)
throw new Error("No writes are allowed after close.");this._chunks.push({strings:strings,callback:callback});if(this._tempFile&&!this._isWriting)
this._writeNextChunk();},finishWriting:function(callback)
{this._finishCallback=callback;if(this._finishedWriting)
callback(this._tempFile);else if(!this._isWriting&&!this._chunks.length)
this._notifyFinished();},_failedToCreateTempFile:function(e)
{WebInspector.console.error("Failed to create temp file "+e.code+" : "+e.message);this._notifyFinished();},_didCreateTempFile:function(tempFile)
{this._tempFile=tempFile;var callsPendingOpen=this._callsPendingOpen;this._callsPendingOpen=null;for(var i=0;i<callsPendingOpen.length;++i)
callsPendingOpen[i]();if(this._chunks.length)
this._writeNextChunk();},_writeNextChunk:function()
{if(!this._tempFile)
return;var chunk=this._chunks.shift();this._isWriting=true;this._tempFile.write((chunk.strings),this._didWriteChunk.bind(this,chunk.callback));},_didWriteChunk:function(callback,size)
{this._isWriting=false;if(size===-1){this._tempFile=null;this._notifyFinished();return;}
if(callback)
callback(size);if(this._chunks.length)
this._writeNextChunk();else if(this._finishCallback)
this._notifyFinished();},_notifyFinished:function()
{this._finishedWriting=true;if(this._tempFile)
this._tempFile.finishWriting();var chunks=this._chunks;this._chunks=[];for(var i=0;i<chunks.length;++i){if(chunks[i].callback)
chunks[i].callback(-1);}
if(this._finishCallback)
this._finishCallback(this._tempFile);var pendingReads=this._pendingReads;this._pendingReads=[];for(var i=0;i<pendingReads.length;++i)
pendingReads[i]();},readRange:function(startOffset,endOffset,callback)
{if(!this._finishedWriting){this._pendingReads.push(this.readRange.bind(this,startOffset,endOffset,callback));return;}
if(!this._tempFile){callback(null);return;}
this._tempFile.readRange(startOffset,endOffset,callback);},writeToOutputStream:function(outputStream,delegate)
{if(this._callsPendingOpen){this._callsPendingOpen.push(this.writeToOutputStream.bind(this,outputStream,delegate));return;}
if(this._tempFile)
this._tempFile.writeToOutputSteam(outputStream,delegate);},remove:function()
{if(this._callsPendingOpen){this._callsPendingOpen.push(this.remove.bind(this));return;}
if(this._tempFile)
this._tempFile.remove();this._tempFile=null;}}
WebInspector.TempFile._clearTempStorage=function(fulfill,reject)
{function handleError(event)
{WebInspector.console.error(WebInspector.UIString("Failed to clear temp storage: %s",event.data));reject(event.data);}
function handleMessage(event)
{if(event.data.type==="tempStorageCleared"){if(event.data.error)
WebInspector.console.error(event.data.error);else
fulfill(undefined);return;}
reject(event.data);}
try{var worker=new WorkerRuntime.Worker("temp_storage_shared_worker","TempStorageCleaner");worker.onerror=handleError;worker.port.onmessage=handleMessage;worker.port.onerror=handleError;}catch(e){if(e.name==="URLMismatchError")
console.log("Shared worker wasn't started due to url difference. "+e);else
throw e;}}
WebInspector.TempFile.ensureTempStorageCleared=function()
{if(!WebInspector.TempFile._storageCleanerPromise)
WebInspector.TempFile._storageCleanerPromise=new Promise(WebInspector.TempFile._clearTempStorage);return WebInspector.TempFile._storageCleanerPromise;}
WebInspector.TempFileBackingStorage=function(dirName)
{this._dirName=dirName;this.reset();}
WebInspector.TempFileBackingStorage.Chunk;WebInspector.TempFileBackingStorage.prototype={appendString:function(string)
{this._strings.push(string);this._stringsLength+=string.length;var flushStringLength=10*1024*1024;if(this._stringsLength>flushStringLength)
this._flush(false);},appendAccessibleString:function(string)
{this._flush(false);this._strings.push(string);var chunk=(this._flush(true));function readString(chunk,file)
{if(chunk.string)
return(Promise.resolve(chunk.string));console.assert(chunk.endOffset);if(!chunk.endOffset)
return Promise.reject("Nor string nor offset to the string in the file were found.");function readRange(fulfill,reject)
{file.readRange(chunk.startOffset,chunk.endOffset,fulfill);}
return new Promise(readRange);}
return readString.bind(null,chunk,this._file);},_flush:function(createChunk)
{if(!this._strings.length)
return null;var chunk=null;if(createChunk){console.assert(this._strings.length===1);chunk={string:this._strings[0],startOffset:0,endOffset:0};}
function didWrite(chunk,fileSize)
{if(fileSize===-1)
return;if(chunk){chunk.startOffset=this._fileSize;chunk.endOffset=fileSize;chunk.string=null;}
this._fileSize=fileSize;}
this._file.write(this._strings,didWrite.bind(this,chunk));this._strings=[];this._stringsLength=0;return chunk;},finishWriting:function()
{this._flush(false);this._file.finishWriting(function(){});},reset:function()
{if(this._file)
this._file.remove();this._file=new WebInspector.DeferredTempFile(this._dirName,String(Date.now()));this._strings=[];this._stringsLength=0;this._fileSize=0;},writeToStream:function(outputStream,delegate)
{this._file.writeToOutputStream(outputStream,delegate);}};WebInspector.BreakpointsSidebarPaneBase=function(title)
{WebInspector.SidebarPane.call(this,title);this.registerRequiredCSS("components/breakpointsList.css");this.listElement=createElement("ol");this.listElement.className="breakpoint-list";this.emptyElement=createElement("div");this.emptyElement.className="info";this.emptyElement.textContent=WebInspector.UIString("No Breakpoints");this.element.appendChild(this.emptyElement);}
WebInspector.BreakpointsSidebarPaneBase.prototype={addListElement:function(element,beforeNode)
{if(beforeNode){this.listElement.insertBefore(element,beforeNode);}else{if(!this.listElement.firstChild){this.element.removeChild(this.emptyElement);this.element.appendChild(this.listElement);}
this.listElement.appendChild(element);}},removeListElement:function(element)
{this.listElement.removeChild(element);if(!this.listElement.firstChild){this.element.removeChild(this.listElement);this.element.appendChild(this.emptyElement);}},reset:function()
{this.listElement.removeChildren();if(this.listElement.parentElement){this.element.removeChild(this.listElement);this.element.appendChild(this.emptyElement);}},__proto__:WebInspector.SidebarPane.prototype};WebInspector.CustomPreviewSection=function(object)
{this._sectionElement=createElementWithClass("span","custom-expandable-section");this._object=object;this._expanded=false;this._cachedContent=null;var customPreview=object.customPreview();try{var headerJSON=JSON.parse(customPreview.header);}catch(e){WebInspector.console.error("Broken formatter: header is invalid json "+e);return;}
this._header=this._renderJSONMLTag(headerJSON);if(this._header.nodeType===Node.TEXT_NODE){WebInspector.console.error("Broken formatter: header should be an element node.");return;}
if(customPreview.hasBody){this._header.classList.add("custom-expandable-section-header");this._header.addEventListener("click",this._onClick.bind(this),false);}
this._sectionElement.appendChild(this._header);}
WebInspector.CustomPreviewComponent=function(object)
{this._object=object;this._customPreviewSection=new WebInspector.CustomPreviewSection(object);this.element=createElementWithClass("span","source-code");var shadowRoot=WebInspector.createShadowRootWithCoreStyles(this.element,"components/customPreviewSection.css");this.element.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),false);shadowRoot.appendChild(this._customPreviewSection.element());}
WebInspector.CustomPreviewComponent.prototype={expandIfPossible:function()
{if(this._object.customPreview().hasBody&&this._customPreviewSection)
this._customPreviewSection._loadBody();},_contextMenuEventFired:function(event)
{var contextMenu=new WebInspector.ContextMenu(event);if(this._customPreviewSection)
contextMenu.appendItem(WebInspector.UIString.capitalize("Show as Javascript ^object"),this._disassemble.bind(this));contextMenu.appendApplicableItems(this._object);contextMenu.show();},_disassemble:function()
{this.element.shadowRoot.textContent="";this._customPreviewSection=null;this.element.shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.defaultObjectPresentation(this._object));}}
WebInspector.CustomPreviewSection._tagsWhiteList=new Set(["span","div","ol","li","table","tr","td"]);WebInspector.CustomPreviewSection.prototype={element:function()
{return this._sectionElement;},_renderJSONMLTag:function(jsonML)
{if(!Array.isArray(jsonML))
return createTextNode(jsonML+"");var array=(jsonML);if(array[0]==="object")
return this._layoutObjectTag(array);else
return this._renderElement(array);},_renderElement:function(object)
{var tagName=object.shift();if(!WebInspector.CustomPreviewSection._tagsWhiteList.has(tagName)){WebInspector.console.error("Broken formatter: element "+tagName+" is not allowed!");return createElement("span");}
var element=createElement((tagName));if((typeof object[0]=="object")&&!Array.isArray(object[0])){var attributes=object.shift();for(var key in attributes){var value=attributes[key];if((key!=="style")||(typeof value!=="string"))
continue;element.setAttribute(key,value);}}
this._appendJsonMLTags(element,object);return element;},_layoutObjectTag:function(objectTag)
{objectTag.shift();var attributes=objectTag.shift();var remoteObject=this._object.target().runtimeModel.createRemoteObject((attributes));if(remoteObject.customPreview())
return(new WebInspector.CustomPreviewSection(remoteObject)).element();var sectionElement=WebInspector.ObjectPropertiesSection.defaultObjectPresentation(remoteObject);sectionElement.classList.toggle("custom-expandable-section-standard-section",remoteObject.hasChildren);return sectionElement;},_appendJsonMLTags:function(parentElement,jsonMLTags)
{for(var i=0;i<jsonMLTags.length;++i)
parentElement.appendChild(this._renderJSONMLTag(jsonMLTags[i]));},_onClick:function(event)
{event.consume(true);if(this._cachedContent)
this._toggleExpand();else
this._loadBody();},_toggleExpand:function()
{this._expanded=!this._expanded;this._header.classList.toggle("expanded",this._expanded);this._cachedContent.classList.toggle("hidden",!this._expanded);},_loadBody:function()
{function load(formatter,config)
{function substituteObjectTagsInCustomPreview(jsonMLObject)
{if(!jsonMLObject||(typeof jsonMLObject!=="object")||(typeof jsonMLObject.splice!=="function"))
return;var obj=jsonMLObject.length;if(!(typeof obj==="number"&&obj>>>0===obj&&(obj>0||1/obj>0)))
return;var startIndex=1;if(jsonMLObject[0]==="object"){var attributes=jsonMLObject[1];var originObject=attributes["object"];var config=attributes["config"];if(typeof originObject==="undefined")
throw"Illegal format: obligatory attribute \"object\" isn't specified";jsonMLObject[1]=bindRemoteObject(originObject,false,false,null,false,config);startIndex=2;}
for(var i=startIndex;i<jsonMLObject.length;++i)
substituteObjectTagsInCustomPreview(jsonMLObject[i]);}
try{var body=formatter.body(this,config);substituteObjectTagsInCustomPreview(body);return body;}catch(e){console.error("Custom Formatter Failed: "+e);return null;}}
var customPreview=this._object.customPreview();var args=[{objectId:customPreview.formatterObjectId}];if(customPreview.configObjectId)
args.push({objectId:customPreview.configObjectId});this._object.callFunctionJSON(load,args,onBodyLoaded.bind(this));function onBodyLoaded(bodyJsonML)
{if(!bodyJsonML)
return;this._cachedContent=this._renderJSONMLTag(bodyJsonML);this._sectionElement.appendChild(this._cachedContent);this._toggleExpand();}}};WebInspector.DataSaverInfobar=function()
{WebInspector.Infobar.call(this,WebInspector.Infobar.Type.Warning,WebInspector.UIString("Data Saver is enabled"),WebInspector.settings.moduleSetting("disableDataSaverInfobar"));var message=this.createDetailsRowMessage();message.createTextChild("Consider disabling ");message.appendChild(WebInspector.linkifyURLAsNode("https://support.google.com/chrome/answer/2392284?hl=en","Chrome Data Saver",undefined,true));message.createTextChild(WebInspector.UIString(" while debugging."));}
WebInspector.DataSaverInfobar._infobars=[];WebInspector.DataSaverInfobar.maybeShowInPanel=function(panel)
{if(Runtime.queryParam("remoteFrontend")){var infobar=new WebInspector.DataSaverInfobar();WebInspector.DataSaverInfobar._infobars.push(infobar);panel.showInfobar(infobar);}}
WebInspector.DataSaverInfobar.prototype={dispose:function()
{for(var infobar of WebInspector.DataSaverInfobar._infobars)
WebInspector.Infobar.prototype.dispose.call(infobar);},__proto__:WebInspector.Infobar.prototype};WebInspector.DebuggerPresentationUtils={}
WebInspector.DebuggerPresentationUtils.callFrameAnchorFromStackTrace=function(debuggerModel,stackTrace,asyncStackTrace,showBlackboxed)
{function innerCallFrameAnchorFromStackTrace(stackTrace)
{if(!stackTrace||!stackTrace.length)
return null;if(showBlackboxed)
return stackTrace[0];for(var i=0;i<stackTrace.length;++i){var script=debuggerModel&&debuggerModel.scriptForId(stackTrace[i].scriptId);var blackboxed=script?WebInspector.BlackboxSupport.isBlackboxed(script.sourceURL,script.isContentScript()):WebInspector.BlackboxSupport.isBlackboxedURL(stackTrace[i].url);if(!blackboxed)
return stackTrace[i];}
return null;}
var callFrame=innerCallFrameAnchorFromStackTrace(stackTrace);if(callFrame)
return callFrame;while(asyncStackTrace){callFrame=innerCallFrameAnchorFromStackTrace(asyncStackTrace.callFrames);if(callFrame)
return callFrame;asyncStackTrace=asyncStackTrace.asyncStackTrace;}
return stackTrace?stackTrace[0]:null;};WebInspector.DOMBreakpointsSidebarPane=function()
{WebInspector.BreakpointsSidebarPaneBase.call(this,WebInspector.UIString("DOM Breakpoints"));this._domBreakpointsSetting=WebInspector.settings.createLocalSetting("domBreakpoints",[]);this.listElement.classList.add("dom-breakpoints-list");this._breakpointElements={};this._breakpointTypes={SubtreeModified:"subtree-modified",AttributeModified:"attribute-modified",NodeRemoved:"node-removed"};this._breakpointTypeLabels={};this._breakpointTypeLabels[this._breakpointTypes.SubtreeModified]=WebInspector.UIString("Subtree Modified");this._breakpointTypeLabels[this._breakpointTypes.AttributeModified]=WebInspector.UIString("Attribute Modified");this._breakpointTypeLabels[this._breakpointTypes.NodeRemoved]=WebInspector.UIString("Node Removed");this._contextMenuLabels={};this._contextMenuLabels[this._breakpointTypes.SubtreeModified]=WebInspector.UIString.capitalize("Subtree ^modifications");this._contextMenuLabels[this._breakpointTypes.AttributeModified]=WebInspector.UIString.capitalize("Attributes ^modifications");this._contextMenuLabels[this._breakpointTypes.NodeRemoved]=WebInspector.UIString.capitalize("Node ^removal");WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.InspectedURLChanged,this._inspectedURLChanged,this);WebInspector.targetManager.addModelListener(WebInspector.DOMModel,WebInspector.DOMModel.Events.NodeRemoved,this._nodeRemoved,this);}
WebInspector.DOMBreakpointsSidebarPane.Marker="breakpoint-marker";WebInspector.DOMBreakpointsSidebarPane.prototype={_inspectedURLChanged:function(event)
{this._breakpointElements={};this.reset();var url=(event.data);this._inspectedURL=url.removeURLFragment();},populateNodeContextMenu:function(node,contextMenu,createSubMenu)
{if(node.pseudoType())
return;var nodeBreakpoints=this._nodeBreakpoints(node);function toggleBreakpoint(type)
{if(!nodeBreakpoints[type])
this._setBreakpoint(node,type,true);else
this._removeBreakpoint(node,type);this._saveBreakpoints();}
var breakpointsMenu=createSubMenu?contextMenu.appendSubMenuItem(WebInspector.UIString("Break on...")):contextMenu;for(var key in this._breakpointTypes){var type=this._breakpointTypes[key];var label=this._contextMenuLabels[type];breakpointsMenu.appendCheckboxItem(label,toggleBreakpoint.bind(this,type),nodeBreakpoints[type]);}},_nodeBreakpoints:function(node)
{var nodeBreakpoints={};for(var id in this._breakpointElements){var element=this._breakpointElements[id];if(element._node===node&&element._checkboxElement.checked)
nodeBreakpoints[element._type]=true;}
return nodeBreakpoints;},hasBreakpoints:function(node)
{for(var id in this._breakpointElements){var element=this._breakpointElements[id];if(element._node===node&&element._checkboxElement.checked)
return true;}
return false;},createBreakpointHitStatusMessage:function(details,callback)
{var auxData=(details.auxData);var domModel=WebInspector.DOMModel.fromTarget(details.target());if(!domModel)
return;if(auxData.type===this._breakpointTypes.SubtreeModified){var targetNodeObject=details.target().runtimeModel.createRemoteObject(auxData["targetNode"]);domModel.pushObjectAsNodeToFrontend(targetNodeObject,didPushNodeToFrontend.bind(this));}else{this._doCreateBreakpointHitStatusMessage(auxData,domModel.nodeForId(auxData.nodeId),null,callback);}
function didPushNodeToFrontend(targetNode)
{if(targetNode)
targetNodeObject.release();this._doCreateBreakpointHitStatusMessage(auxData,domModel.nodeForId(auxData.nodeId),targetNode,callback);}},_doCreateBreakpointHitStatusMessage:function(auxData,node,targetNode,callback)
{var message;var typeLabel=this._breakpointTypeLabels[auxData.type];var linkifiedNode=WebInspector.DOMPresentationUtils.linkifyNodeReference(node);var substitutions=[typeLabel,linkifiedNode];var targetNodeLink="";if(targetNode)
targetNodeLink=WebInspector.DOMPresentationUtils.linkifyNodeReference(targetNode);if(auxData.type===this._breakpointTypes.SubtreeModified){if(auxData.insertion){if(targetNode!==node){message="Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s.";substitutions.push(targetNodeLink);}else
message="Paused on a \"%s\" breakpoint set on %s, because a new child was added to that node.";}else{message="Paused on a \"%s\" breakpoint set on %s, because its descendant %s was removed.";substitutions.push(targetNodeLink);}}else
message="Paused on a \"%s\" breakpoint set on %s.";var element=WebInspector.formatLocalized(message,substitutions);callback(element);},_nodeRemoved:function(event)
{var node=event.data.node;this._removeBreakpointsForNode(event.data.node);var children=node.children();if(!children)
return;for(var i=0;i<children.length;++i)
this._removeBreakpointsForNode(children[i]);this._saveBreakpoints();},_removeBreakpointsForNode:function(node)
{for(var id in this._breakpointElements){var element=this._breakpointElements[id];if(element._node===node)
this._removeBreakpoint(element._node,element._type);}},_setBreakpoint:function(node,type,enabled)
{var breakpointId=this._createBreakpointId(node.id,type);var breakpointElement=this._breakpointElements[breakpointId];if(!breakpointElement){breakpointElement=this._createBreakpointElement(node,type,enabled);this._breakpointElements[breakpointId]=breakpointElement;}else{breakpointElement._checkboxElement.checked=enabled;}
if(enabled)
node.target().domdebuggerAgent().setDOMBreakpoint(node.id,type);node.setMarker(WebInspector.DOMBreakpointsSidebarPane.Marker,true);},_createBreakpointElement:function(node,type,enabled)
{var element=createElement("li");element._node=node;element._type=type;element.addEventListener("contextmenu",this._contextMenu.bind(this,node,type),true);var checkboxLabel=createCheckboxLabel("",enabled);checkboxLabel.addEventListener("click",this._checkboxClicked.bind(this,node,type),false);element._checkboxElement=checkboxLabel.checkboxElement;element.appendChild(checkboxLabel);var labelElement=createElementWithClass("div","dom-breakpoint");element.appendChild(labelElement);var linkifiedNode=WebInspector.DOMPresentationUtils.linkifyNodeReference(node);linkifiedNode.classList.add("monospace");linkifiedNode.style.display="block";labelElement.appendChild(linkifiedNode);var description=createElement("div");description.textContent=this._breakpointTypeLabels[type];labelElement.appendChild(description);var currentElement=this.listElement.firstChild;while(currentElement){if(currentElement._type&&currentElement._type<element._type)
break;currentElement=currentElement.nextSibling;}
this.addListElement(element,currentElement);return element;},_removeAllBreakpoints:function()
{for(var id in this._breakpointElements){var element=this._breakpointElements[id];this._removeBreakpoint(element._node,element._type);}
this._saveBreakpoints();},_removeBreakpoint:function(node,type)
{var breakpointId=this._createBreakpointId(node.id,type);var element=this._breakpointElements[breakpointId];if(!element)
return;this.removeListElement(element);delete this._breakpointElements[breakpointId];if(element._checkboxElement.checked)
node.target().domdebuggerAgent().removeDOMBreakpoint(node.id,type);node.setMarker(WebInspector.DOMBreakpointsSidebarPane.Marker,this.hasBreakpoints(node)?true:null);},_contextMenu:function(node,type,event)
{var contextMenu=new WebInspector.ContextMenu(event);function removeBreakpoint()
{this._removeBreakpoint(node,type);this._saveBreakpoints();}
contextMenu.appendItem(WebInspector.UIString.capitalize("Remove ^breakpoint"),removeBreakpoint.bind(this));contextMenu.appendItem(WebInspector.UIString.capitalize("Remove ^all DOM breakpoints"),this._removeAllBreakpoints.bind(this));contextMenu.show();},_checkboxClicked:function(node,type,event)
{if(event.target.checked)
node.target().domdebuggerAgent().setDOMBreakpoint(node.id,type);else
node.target().domdebuggerAgent().removeDOMBreakpoint(node.id,type);this._saveBreakpoints();},highlightBreakpoint:function(auxData)
{var breakpointId=this._createBreakpointId(auxData.nodeId,auxData.type);var element=this._breakpointElements[breakpointId];if(!element)
return;this.expand();element.classList.add("breakpoint-hit");this._highlightedElement=element;},clearBreakpointHighlight:function()
{if(this._highlightedElement){this._highlightedElement.classList.remove("breakpoint-hit");delete this._highlightedElement;}},_createBreakpointId:function(nodeId,type)
{return nodeId+":"+type;},_saveBreakpoints:function()
{var breakpoints=[];var storedBreakpoints=this._domBreakpointsSetting.get();for(var i=0;i<storedBreakpoints.length;++i){var breakpoint=storedBreakpoints[i];if(breakpoint.url!==this._inspectedURL)
breakpoints.push(breakpoint);}
for(var id in this._breakpointElements){var element=this._breakpointElements[id];breakpoints.push({url:this._inspectedURL,path:element._node.path(),type:element._type,enabled:element._checkboxElement.checked});}
this._domBreakpointsSetting.set(breakpoints);},restoreBreakpoints:function(domModel)
{var pathToBreakpoints={};function didPushNodeByPathToFrontend(path,nodeId)
{var node=nodeId?domModel.nodeForId(nodeId):null;if(!node)
return;var breakpoints=pathToBreakpoints[path];for(var i=0;i<breakpoints.length;++i)
this._setBreakpoint(node,breakpoints[i].type,breakpoints[i].enabled);}
var breakpoints=this._domBreakpointsSetting.get();for(var i=0;i<breakpoints.length;++i){var breakpoint=breakpoints[i];if(breakpoint.url!==this._inspectedURL)
continue;var path=breakpoint.path;if(!pathToBreakpoints[path]){pathToBreakpoints[path]=[];domModel.pushNodeByPathToFrontend(path,didPushNodeByPathToFrontend.bind(this,path));}
pathToBreakpoints[path].push(breakpoint);}},createProxy:function(panel)
{var proxy=new WebInspector.DOMBreakpointsSidebarPane.Proxy(this,panel);if(!this._proxies)
this._proxies=[];this._proxies.push(proxy);return proxy;},onContentReady:function()
{for(var i=0;i!=this._proxies.length;i++)
this._proxies[i].onContentReady();},__proto__:WebInspector.BreakpointsSidebarPaneBase.prototype}
WebInspector.DOMBreakpointsSidebarPane.Proxy=function(pane,panel)
{WebInspector.SidebarPane.call(this,pane.title());this.registerRequiredCSS("components/breakpointsList.css");this._wrappedPane=pane;this._panel=panel;}
WebInspector.DOMBreakpointsSidebarPane.Proxy.prototype={expand:function()
{this._wrappedPane.expand();},onContentReady:function()
{if(this._panel.isShowing())
this._reattachBody();WebInspector.SidebarPane.prototype.onContentReady.call(this);},wasShown:function()
{WebInspector.SidebarPane.prototype.wasShown.call(this);this._reattachBody();},_reattachBody:function()
{if(this._wrappedPane.element.parentNode!==this.element)
this._wrappedPane.show(this.element);},__proto__:WebInspector.SidebarPane.prototype}
WebInspector.domBreakpointsSidebarPane;;WebInspector.DOMPresentationUtils={}
WebInspector.DOMPresentationUtils.decorateNodeLabel=function(node,parentElement)
{var originalNode=node;var isPseudo=node.nodeType()===Node.ELEMENT_NODE&&node.pseudoType();if(isPseudo&&node.parentNode)
node=node.parentNode;var title=node.nodeNameInCorrectCase();var nameElement=parentElement.createChild("span","node-label-name");nameElement.textContent=title;var idAttribute=node.getAttribute("id");if(idAttribute){var idElement=parentElement.createChild("span","node-label-id");var part="#"+idAttribute;title+=part;idElement.createTextChild(part);nameElement.classList.add("extra");}
var classAttribute=node.getAttribute("class");if(classAttribute){var classes=classAttribute.split(/\s+/);var foundClasses={};if(classes.length){var classesElement=parentElement.createChild("span","extra node-label-class");for(var i=0;i<classes.length;++i){var className=classes[i];if(className&&!(className in foundClasses)){var part="."+className;title+=part;classesElement.createTextChild(part);foundClasses[className]=true;}}}}
if(isPseudo){var pseudoElement=parentElement.createChild("span","extra node-label-pseudo");var pseudoText="::"+originalNode.pseudoType();pseudoElement.createTextChild(pseudoText);title+=pseudoText;}
parentElement.title=title;}
WebInspector.DOMPresentationUtils.createSpansForNodeTitle=function(container,nodeTitle)
{var match=nodeTitle.match(/([^#.]+)(#[^.]+)?(\..*)?/);container.createChild("span","webkit-html-tag-name").textContent=match[1];if(match[2])
container.createChild("span","webkit-html-attribute-value").textContent=match[2];if(match[3])
container.createChild("span","webkit-html-attribute-name").textContent=match[3];}
WebInspector.DOMPresentationUtils.linkifyNodeReference=function(node)
{if(!node)
return createTextNode(WebInspector.UIString("<node>"));var root=createElementWithClass("span","monospace");var shadowRoot=WebInspector.createShadowRootWithCoreStyles(root,"components/domUtils.css");var link=shadowRoot.createChild("div","node-link");WebInspector.DOMPresentationUtils.decorateNodeLabel(node,link);link.addEventListener("click",WebInspector.Revealer.reveal.bind(WebInspector.Revealer,node,undefined),false);link.addEventListener("mouseover",node.highlight.bind(node,undefined,undefined),false);link.addEventListener("mouseleave",WebInspector.DOMModel.hideDOMNodeHighlight.bind(WebInspector.DOMModel),false);return root;}
WebInspector.DOMPresentationUtils.linkifyDeferredNodeReference=function(deferredNode)
{var root=createElement("div");var shadowRoot=WebInspector.createShadowRootWithCoreStyles(root,"components/domUtils.css");var link=shadowRoot.createChild("div","node-link");link.createChild("content");link.addEventListener("click",deferredNode.resolve.bind(deferredNode,onDeferredNodeResolved),false);link.addEventListener("mousedown",consumeEvent,false);function onDeferredNodeResolved(node)
{WebInspector.Revealer.reveal(node);}
return root;}
WebInspector.DOMPresentationUtils.buildImagePreviewContents=function(target,originalImageURL,showDimensions,userCallback,precomputedFeatures)
{var resource=target.resourceTreeModel.resourceForURL(originalImageURL);var imageURL=originalImageURL;if(!isImageResource(resource)&&precomputedFeatures&&precomputedFeatures.currentSrc){imageURL=precomputedFeatures.currentSrc;resource=target.resourceTreeModel.resourceForURL(imageURL);}
if(!isImageResource(resource)){userCallback();return;}
var imageElement=createElement("img");imageElement.addEventListener("load",buildContent,false);imageElement.addEventListener("error",errorCallback,false);resource.populateImageSource(imageElement);function errorCallback()
{userCallback();}
function isImageResource(resource)
{return!!resource&&resource.resourceType()===WebInspector.resourceTypes.Image;}
function buildContent()
{var container=createElement("table");container.className="image-preview-container";var naturalWidth=precomputedFeatures?precomputedFeatures.naturalWidth:imageElement.naturalWidth;var naturalHeight=precomputedFeatures?precomputedFeatures.naturalHeight:imageElement.naturalHeight;var offsetWidth=precomputedFeatures?precomputedFeatures.offsetWidth:naturalWidth;var offsetHeight=precomputedFeatures?precomputedFeatures.offsetHeight:naturalHeight;var description;if(showDimensions){if(offsetHeight===naturalHeight&&offsetWidth===naturalWidth)
description=WebInspector.UIString("%d \xd7 %d pixels",offsetWidth,offsetHeight);else
description=WebInspector.UIString("%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)",offsetWidth,offsetHeight,naturalWidth,naturalHeight);}
container.createChild("tr").createChild("td","image-container").appendChild(imageElement);if(description)
container.createChild("tr").createChild("td").createChild("span","description").textContent=description;if(imageURL!==originalImageURL)
container.createChild("tr").createChild("td").createChild("span","description").textContent=String.sprintf("currentSrc: %s",imageURL.trimMiddle(100));userCallback(container);}}
WebInspector.DOMPresentationUtils.buildStackTracePreviewContents=function(target,linkifier,stackTrace,asyncStackTrace)
{var element=createElement("span");element.style.display="inline-block";var shadowRoot=WebInspector.createShadowRootWithCoreStyles(element,"components/domUtils.css");var contentElement=shadowRoot.createChild("table","stack-preview-container");function appendStackTrace(stackTrace)
{for(var stackFrame of stackTrace){var row=createElement("tr");row.createChild("td","function-name").textContent=WebInspector.beautifyFunctionName(stackFrame.functionName);row.createChild("td").textContent=" @ ";row.createChild("td").appendChild(linkifier.linkifyConsoleCallFrame(target,stackFrame));contentElement.appendChild(row);}}
if(stackTrace)
appendStackTrace(stackTrace);while(asyncStackTrace){var callFrames=asyncStackTrace.callFrames;if(!callFrames||!callFrames.length)
break;var row=contentElement.createChild("tr");row.createChild("td","stack-preview-async-description").textContent=WebInspector.asyncStackTraceLabel(asyncStackTrace.description);row.createChild("td");row.createChild("td");appendStackTrace(callFrames);asyncStackTrace=asyncStackTrace.asyncStackTrace;}
return element;}
WebInspector.DOMPresentationUtils.fullQualifiedSelector=function(node,justSelector)
{if(node.nodeType()!==Node.ELEMENT_NODE)
return node.localName()||node.nodeName().toLowerCase();return WebInspector.DOMPresentationUtils.cssPath(node,justSelector);}
WebInspector.DOMPresentationUtils.simpleSelector=function(node)
{var lowerCaseName=node.localName()||node.nodeName().toLowerCase();if(node.nodeType()!==Node.ELEMENT_NODE)
return lowerCaseName;if(lowerCaseName==="input"&&node.getAttribute("type")&&!node.getAttribute("id")&&!node.getAttribute("class"))
return lowerCaseName+"[type=\""+node.getAttribute("type")+"\"]";if(node.getAttribute("id"))
return lowerCaseName+"#"+node.getAttribute("id");if(node.getAttribute("class"))
return(lowerCaseName==="div"?"":lowerCaseName)+"."+node.getAttribute("class").trim().replace(/\s+/g,".");return lowerCaseName;}
WebInspector.DOMPresentationUtils.cssPath=function(node,optimized)
{if(node.nodeType()!==Node.ELEMENT_NODE)
return"";var steps=[];var contextNode=node;while(contextNode){var step=WebInspector.DOMPresentationUtils._cssPathStep(contextNode,!!optimized,contextNode===node);if(!step)
break;steps.push(step);if(step.optimized)
break;contextNode=contextNode.parentNode;}
steps.reverse();return steps.join(" > ");}
WebInspector.DOMPresentationUtils._cssPathStep=function(node,optimized,isTargetNode)
{if(node.nodeType()!==Node.ELEMENT_NODE)
return null;var id=node.getAttribute("id");if(optimized){if(id)
return new WebInspector.DOMNodePathStep(idSelector(id),true);var nodeNameLower=node.nodeName().toLowerCase();if(nodeNameLower==="body"||nodeNameLower==="head"||nodeNameLower==="html")
return new WebInspector.DOMNodePathStep(node.nodeNameInCorrectCase(),true);}
var nodeName=node.nodeNameInCorrectCase();if(id)
return new WebInspector.DOMNodePathStep(nodeName+idSelector(id),true);var parent=node.parentNode;if(!parent||parent.nodeType()===Node.DOCUMENT_NODE)
return new WebInspector.DOMNodePathStep(nodeName,true);function prefixedElementClassNames(node)
{var classAttribute=node.getAttribute("class");if(!classAttribute)
return[];return classAttribute.split(/\s+/g).filter(Boolean).map(function(name){return"$"+name;});}
function idSelector(id)
{return"#"+escapeIdentifierIfNeeded(id);}
function escapeIdentifierIfNeeded(ident)
{if(isCSSIdentifier(ident))
return ident;var shouldEscapeFirst=/^(?:[0-9]|-[0-9-]?)/.test(ident);var lastIndex=ident.length-1;return ident.replace(/./g,function(c,i){return((shouldEscapeFirst&&i===0)||!isCSSIdentChar(c))?escapeAsciiChar(c,i===lastIndex):c;});}
function escapeAsciiChar(c,isLast)
{return"\\"+toHexByte(c)+(isLast?"":" ");}
function toHexByte(c)
{var hexByte=c.charCodeAt(0).toString(16);if(hexByte.length===1)
hexByte="0"+hexByte;return hexByte;}
function isCSSIdentChar(c)
{if(/[a-zA-Z0-9_-]/.test(c))
return true;return c.charCodeAt(0)>=0xA0;}
function isCSSIdentifier(value)
{return/^-?[a-zA-Z_][a-zA-Z0-9_-]*$/.test(value);}
var prefixedOwnClassNamesArray=prefixedElementClassNames(node);var needsClassNames=false;var needsNthChild=false;var ownIndex=-1;var elementIndex=-1;var siblings=parent.children();for(var i=0;(ownIndex===-1||!needsNthChild)&&i<siblings.length;++i){var sibling=siblings[i];if(sibling.nodeType()!==Node.ELEMENT_NODE)
continue;elementIndex+=1;if(sibling===node){ownIndex=elementIndex;continue;}
if(needsNthChild)
continue;if(sibling.nodeNameInCorrectCase()!==nodeName)
continue;needsClassNames=true;var ownClassNames=prefixedOwnClassNamesArray.keySet();var ownClassNameCount=0;for(var name in ownClassNames)
++ownClassNameCount;if(ownClassNameCount===0){needsNthChild=true;continue;}
var siblingClassNamesArray=prefixedElementClassNames(sibling);for(var j=0;j<siblingClassNamesArray.length;++j){var siblingClass=siblingClassNamesArray[j];if(!ownClassNames.hasOwnProperty(siblingClass))
continue;delete ownClassNames[siblingClass];if(!--ownClassNameCount){needsNthChild=true;break;}}}
var result=nodeName;if(isTargetNode&&nodeName.toLowerCase()==="input"&&node.getAttribute("type")&&!node.getAttribute("id")&&!node.getAttribute("class"))
result+="[type=\""+node.getAttribute("type")+"\"]";if(needsNthChild){result+=":nth-child("+(ownIndex+1)+")";}else if(needsClassNames){for(var prefixedName in prefixedOwnClassNamesArray.keySet())
result+="."+escapeIdentifierIfNeeded(prefixedName.substr(1));}
return new WebInspector.DOMNodePathStep(result,false);}
WebInspector.DOMPresentationUtils.xPath=function(node,optimized)
{if(node.nodeType()===Node.DOCUMENT_NODE)
return"/";var steps=[];var contextNode=node;while(contextNode){var step=WebInspector.DOMPresentationUtils._xPathValue(contextNode,optimized);if(!step)
break;steps.push(step);if(step.optimized)
break;contextNode=contextNode.parentNode;}
steps.reverse();return(steps.length&&steps[0].optimized?"":"/")+steps.join("/");}
WebInspector.DOMPresentationUtils._xPathValue=function(node,optimized)
{var ownValue;var ownIndex=WebInspector.DOMPresentationUtils._xPathIndex(node);if(ownIndex===-1)
return null;switch(node.nodeType()){case Node.ELEMENT_NODE:if(optimized&&node.getAttribute("id"))
return new WebInspector.DOMNodePathStep("//*[@id=\""+node.getAttribute("id")+"\"]",true);ownValue=node.localName();break;case Node.ATTRIBUTE_NODE:ownValue="@"+node.nodeName();break;case Node.TEXT_NODE:case Node.CDATA_SECTION_NODE:ownValue="text()";break;case Node.PROCESSING_INSTRUCTION_NODE:ownValue="processing-instruction()";break;case Node.COMMENT_NODE:ownValue="comment()";break;case Node.DOCUMENT_NODE:ownValue="";break;default:ownValue="";break;}
if(ownIndex>0)
ownValue+="["+ownIndex+"]";return new WebInspector.DOMNodePathStep(ownValue,node.nodeType()===Node.DOCUMENT_NODE);}
WebInspector.DOMPresentationUtils._xPathIndex=function(node)
{function areNodesSimilar(left,right)
{if(left===right)
return true;if(left.nodeType()===Node.ELEMENT_NODE&&right.nodeType()===Node.ELEMENT_NODE)
return left.localName()===right.localName();if(left.nodeType()===right.nodeType())
return true;var leftType=left.nodeType()===Node.CDATA_SECTION_NODE?Node.TEXT_NODE:left.nodeType();var rightType=right.nodeType()===Node.CDATA_SECTION_NODE?Node.TEXT_NODE:right.nodeType();return leftType===rightType;}
var siblings=node.parentNode?node.parentNode.children():null;if(!siblings)
return 0;var hasSameNamedElements;for(var i=0;i<siblings.length;++i){if(areNodesSimilar(node,siblings[i])&&siblings[i]!==node){hasSameNamedElements=true;break;}}
if(!hasSameNamedElements)
return 0;var ownIndex=1;for(var i=0;i<siblings.length;++i){if(areNodesSimilar(node,siblings[i])){if(siblings[i]===node)
return ownIndex;++ownIndex;}}
return-1;}
WebInspector.DOMNodePathStep=function(value,optimized)
{this.value=value;this.optimized=optimized||false;}
WebInspector.DOMNodePathStep.prototype={toString:function()
{return this.value;}}
WebInspector.DOMPresentationUtils.MarkerDecorator=function()
{}
WebInspector.DOMPresentationUtils.MarkerDecorator.prototype={decorate:function(node){}}
WebInspector.DOMPresentationUtils.GenericDecorator=function(extension)
{this._title=WebInspector.UIString(extension.title(WebInspector.platform()));this._color=extension.descriptor()['color'];}
WebInspector.DOMPresentationUtils.GenericDecorator.prototype={decorate:function(node)
{return{title:this._title,color:this._color};}};WebInspector.DockController=function(canDock)
{this._canDock=canDock;this._closeButton=new WebInspector.ToolbarButton(WebInspector.UIString("Close"),"delete-toolbar-item");this._closeButton.addEventListener("click",InspectorFrontendHost.closeWindow.bind(InspectorFrontendHost));if(!canDock){this._dockSide=WebInspector.DockController.State.Undocked;this._updateUI();return;}
this._states=[WebInspector.DockController.State.DockedToRight,WebInspector.DockController.State.DockedToBottom,WebInspector.DockController.State.Undocked];this._currentDockStateSetting=WebInspector.settings.createSetting("currentDockState","right");this._lastDockStateSetting=WebInspector.settings.createSetting("lastDockState","bottom");if(this._states.indexOf(this._currentDockStateSetting.get())===-1)
this._currentDockStateSetting.set("right");if(this._states.indexOf(this._lastDockStateSetting.get())===-1)
this._currentDockStateSetting.set("bottom");}
WebInspector.DockController.State={DockedToBottom:"bottom",DockedToRight:"right",Undocked:"undocked"}
WebInspector.DockController.Events={BeforeDockSideChanged:"BeforeDockSideChanged",DockSideChanged:"DockSideChanged",AfterDockSideChanged:"AfterDockSideChanged"}
WebInspector.DockController.prototype={initialize:function()
{if(!this._canDock)
return;this._titles=[WebInspector.UIString("Dock to right"),WebInspector.UIString("Dock to bottom"),WebInspector.UIString("Undock into separate window")];this.setDockSide(this._currentDockStateSetting.get());},dockSide:function()
{return this._dockSide;},canDock:function()
{return this._canDock;},isVertical:function()
{return this._dockSide===WebInspector.DockController.State.DockedToRight;},setDockSide:function(dockSide)
{if(this._states.indexOf(dockSide)===-1)
dockSide=this._states[0];if(this._dockSide===dockSide)
return;if(this._dockSide)
this._lastDockStateSetting.set(this._dockSide);this._currentDockStateSetting.set(dockSide);var eventData={from:this._dockSide,to:dockSide};this.dispatchEventToListeners(WebInspector.DockController.Events.BeforeDockSideChanged,eventData);console.timeStamp("DockController.setIsDocked");InspectorFrontendHost.setIsDocked(dockSide!==WebInspector.DockController.State.Undocked,this._setIsDockedResponse.bind(this,eventData));this._dockSide=dockSide;this._updateUI();this.dispatchEventToListeners(WebInspector.DockController.Events.DockSideChanged,eventData);},_setIsDockedResponse:function(eventData)
{this.dispatchEventToListeners(WebInspector.DockController.Events.AfterDockSideChanged,eventData);},_updateUI:function()
{var body=document.body;switch(this._dockSide){case WebInspector.DockController.State.DockedToBottom:body.classList.remove("undocked");body.classList.remove("dock-to-right");body.classList.add("dock-to-bottom");break;case WebInspector.DockController.State.DockedToRight:body.classList.remove("undocked");body.classList.add("dock-to-right");body.classList.remove("dock-to-bottom");break;case WebInspector.DockController.State.Undocked:body.classList.add("undocked");body.classList.remove("dock-to-right");body.classList.remove("dock-to-bottom");break;}
this._closeButton.setVisible(this._dockSide!==WebInspector.DockController.State.Undocked);},_toggleDockSide:function()
{if(this._lastDockStateSetting.get()===this._currentDockStateSetting.get()){var index=this._states.indexOf(this._currentDockStateSetting.get())||0;this._lastDockStateSetting.set(this._states[(index+1)%this._states.length]);}
this.setDockSide(this._lastDockStateSetting.get());},__proto__:WebInspector.Object.prototype}
WebInspector.DockController.ToggleDockActionDelegate=function()
{}
WebInspector.DockController.ToggleDockActionDelegate.prototype={handleAction:function(context,actionId)
{WebInspector.dockController._toggleDockSide();return true;}}
WebInspector.DockController.CloseButtonProvider=function()
{}
WebInspector.DockController.CloseButtonProvider.prototype={item:function()
{return WebInspector.dockController._closeButton;}}
WebInspector.dockController;;WebInspector.Drawer=function(splitWidget)
{WebInspector.VBox.call(this);this.element.id="drawer-contents";this._splitWidget=splitWidget;splitWidget.hideDefaultResizer();splitWidget.setSidebarWidget(this);this._tabbedPane=new WebInspector.TabbedPane();this._tabbedPane.element.id="drawer-tabbed-pane";this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);var toolbar=new WebInspector.Toolbar("drawer-close-toolbar");var closeButton=new WebInspector.ToolbarButton(WebInspector.UIString("Close drawer"),"delete-toolbar-item");closeButton.addEventListener("click",this.closeDrawer.bind(this));toolbar.appendToolbarItem(closeButton);this._tabbedPane.appendAfterTabStrip(toolbar.element);this._extensibleTabbedPaneController=new WebInspector.ExtensibleTabbedPaneController(this._tabbedPane,"drawer-view");this._extensibleTabbedPaneController.enableMoreTabsButton();splitWidget.installResizer(this._tabbedPane.headerElement());this._lastSelectedViewSetting=WebInspector.settings.createSetting("WebInspector.Drawer.lastSelectedView","console");this._tabbedPane.show(this.element);}
WebInspector.Drawer.prototype={showView:function(id,immediate)
{this._innerShow(immediate);WebInspector.userMetrics.drawerShown(id);return this._extensibleTabbedPaneController.showTab(id);},showDrawer:function()
{this._innerShow();},wasShown:function()
{var id=this._lastSelectedViewSetting.get();if(!this._firstTabSelected&&this._tabbedPane.hasTab(id))
this.showView(id);},willHide:function()
{},_innerShow:function(immediate)
{if(this.isShowing())
return;this._splitWidget.showBoth(!immediate);if(this._visibleView())
this._visibleView().focus();},closeDrawer:function()
{if(!this.isShowing())
return;WebInspector.restoreFocusFromElement(this.element);this._splitWidget.hideSidebar(true);},_visibleView:function()
{return this._tabbedPane.visibleView;},_tabSelected:function(event)
{this._firstTabSelected=true;var tabId=this._tabbedPane.selectedTabId;if(tabId&&event.data["isUserGesture"])
this._lastSelectedViewSetting.set(tabId);},selectedViewId:function()
{return this._tabbedPane.selectedTabId;},initialPanelShown:function()
{this._initialPanelWasShown=true;},__proto__:WebInspector.VBox.prototype};WebInspector.ExecutionContextSelector=function(targetManager,context)
{targetManager.observeTargets(this);context.addFlavorChangeListener(WebInspector.ExecutionContext,this._executionContextChanged,this);context.addFlavorChangeListener(WebInspector.Target,this._targetChanged,this);targetManager.addModelListener(WebInspector.RuntimeModel,WebInspector.RuntimeModel.Events.ExecutionContextCreated,this._onExecutionContextCreated,this);targetManager.addModelListener(WebInspector.RuntimeModel,WebInspector.RuntimeModel.Events.ExecutionContextDestroyed,this._onExecutionContextDestroyed,this);this._targetManager=targetManager;this._context=context;}
WebInspector.ExecutionContextSelector.prototype={targetAdded:function(target)
{if(!target.hasJSContext())
return;setImmediate(deferred.bind(this));function deferred()
{if(!this._context.flavor(WebInspector.Target))
this._context.setFlavor(WebInspector.Target,target);}},targetRemoved:function(target)
{if(!target.hasJSContext())
return;var currentExecutionContext=this._context.flavor(WebInspector.ExecutionContext);if(currentExecutionContext&&currentExecutionContext.target()===target)
this._currentExecutionContextGone();var targets=this._targetManager.targetsWithJSContext();if(this._context.flavor(WebInspector.Target)===target&&targets.length)
this._context.setFlavor(WebInspector.Target,targets[0]);},_executionContextChanged:function(event)
{var newContext=(event.data);if(newContext){this._context.setFlavor(WebInspector.Target,newContext.target());if(!this._contextIsGoingAway)
this._lastSelectedContextId=this._contextPersistentId(newContext);}},_contextPersistentId:function(executionContext)
{return executionContext.isMainWorldContext?executionContext.target().name()+":"+executionContext.frameId:"";},_targetChanged:function(event)
{var newTarget=(event.data);var currentContext=this._context.flavor(WebInspector.ExecutionContext);if(!newTarget||(currentContext&&currentContext.target()===newTarget))
return;var executionContexts=newTarget.runtimeModel.executionContexts();if(!executionContexts.length)
return;var newContext=executionContexts[0];for(var i=1;i<executionContexts.length;++i){if(executionContexts[i].isMainWorldContext)
newContext=executionContexts[i];}
this._context.setFlavor(WebInspector.ExecutionContext,newContext);},_onExecutionContextCreated:function(event)
{var executionContext=(event.data);if(!this._context.flavor(WebInspector.ExecutionContext)||(this._lastSelectedContextId&&this._lastSelectedContextId===this._contextPersistentId(executionContext)))
this._context.setFlavor(WebInspector.ExecutionContext,executionContext);},_onExecutionContextDestroyed:function(event)
{var executionContext=(event.data);if(this._context.flavor(WebInspector.ExecutionContext)===executionContext)
this._currentExecutionContextGone();},_currentExecutionContextGone:function()
{var targets=this._targetManager.targetsWithJSContext();var newContext=null;for(var i=0;i<targets.length;++i){if(targets[i].isServiceWorker())
continue;var executionContexts=targets[i].runtimeModel.executionContexts();if(executionContexts.length){newContext=executionContexts[0];break;}}
this._contextIsGoingAway=true;this._context.setFlavor(WebInspector.ExecutionContext,newContext);this._contextIsGoingAway=false;}}
WebInspector.ExecutionContextSelector.completionsForTextPromptInCurrentContext=function(proxyElement,text,cursorOffset,wordRange,force,completionsReadyCallback)
{var executionContext=WebInspector.context.flavor(WebInspector.ExecutionContext);if(!executionContext){completionsReadyCallback([]);return;}
var expressionRange=wordRange.startContainer.rangeOfWord(wordRange.startOffset," =:({;,!+-*/&|^<>",proxyElement,"backward");var expressionString=expressionRange.toString();var pos=expressionString.lastIndexOf("[",expressionString.length-2);if(pos!==-1)
expressionString=expressionString.substr(pos+1);var prefix=wordRange.toString();executionContext.completionsForExpression(expressionString,text,cursorOffset,prefix,force,completionsReadyCallback);};WebInspector.ExecutionContextModel=function(selectElement)
{this._selectElement=selectElement;this._optionByExecutionContext=new Map();WebInspector.targetManager.observeTargets(this);WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel,WebInspector.RuntimeModel.Events.ExecutionContextCreated,this._onExecutionContextCreated,this);WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel,WebInspector.RuntimeModel.Events.ExecutionContextDestroyed,this._onExecutionContextDestroyed,this);WebInspector.targetManager.addModelListener(WebInspector.ResourceTreeModel,WebInspector.ResourceTreeModel.EventTypes.FrameNavigated,this._onFrameNavigated,this);this._selectElement.addEventListener("change",this._executionContextChanged.bind(this),false);WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext,this._executionContextChangedExternally,this);}
WebInspector.ExecutionContextModel.prototype={_titleFor:function(executionContext)
{var result;if(executionContext.isMainWorldContext){if(executionContext.frameId){var frame=executionContext.target().resourceTreeModel.frameForId(executionContext.frameId);result=frame?frame.displayName():(executionContext.origin||executionContext.name);}else{var parsedUrl=executionContext.origin.asParsedURL();var name=parsedUrl?parsedUrl.lastPathComponentWithFragment():executionContext.name;result=executionContext.target().decorateLabel(name);}}else{result="\u00a0\u00a0\u00a0\u00a0"+(executionContext.name||executionContext.origin);}
var maxLength=50;return result.trimMiddle(maxLength);},_executionContextCreated:function(executionContext)
{if(executionContext.target().isServiceWorker())
return;var newOption=createElement("option");newOption.__executionContext=executionContext;newOption.text=this._titleFor(executionContext);this._optionByExecutionContext.set(executionContext,newOption);var options=this._selectElement.options;var contexts=Array.prototype.map.call(options,mapping);var index=insertionIndexForObjectInListSortedByFunction(executionContext,contexts,WebInspector.ExecutionContext.comparator);this._selectElement.insertBefore(newOption,options[index]);if(executionContext===WebInspector.context.flavor(WebInspector.ExecutionContext))
this._select(newOption);function mapping(option)
{return option.__executionContext;}},_onExecutionContextCreated:function(event)
{var executionContext=(event.data);this._executionContextCreated(executionContext);},_executionContextDestroyed:function(executionContext)
{var option=this._optionByExecutionContext.remove(executionContext);option.remove();},_onExecutionContextDestroyed:function(event)
{var executionContext=(event.data);this._executionContextDestroyed(executionContext);},_onFrameNavigated:function(event)
{var frame=(event.data);var executionContexts=this._optionByExecutionContext.keysArray();for(var i=0;i<executionContexts.length;++i){var context=executionContexts[i];if(context.frameId===frame.id)
this._optionByExecutionContext.get(context).text=this._titleFor(context);}},_executionContextChangedExternally:function(event)
{var executionContext=(event.data);if(!executionContext)
return;var options=this._selectElement.options;for(var i=0;i<options.length;++i){if(options[i].__executionContext===executionContext)
this._select(options[i]);}},_executionContextChanged:function()
{var option=this._selectedOption();var newContext=option?option.__executionContext:null;WebInspector.context.setFlavor(WebInspector.ExecutionContext,newContext);},targetAdded:function(target)
{target.runtimeModel.executionContexts().forEach(this._executionContextCreated,this);},targetRemoved:function(target)
{var executionContexts=this._optionByExecutionContext.keysArray();for(var i=0;i<executionContexts.length;++i){if(executionContexts[i].target()===target)
this._executionContextDestroyed(executionContexts[i]);}},_select:function(option)
{this._selectElement.selectedIndex=Array.prototype.indexOf.call((this._selectElement),option);},_selectedOption:function()
{if(this._selectElement.selectedIndex>=0)
return this._selectElement[this._selectElement.selectedIndex];return null;}};WebInspector.HandlerRegistry=function(setting)
{WebInspector.Object.call(this);this._handlers={};this._setting=setting;this._activeHandler=this._setting.get();}
WebInspector.HandlerRegistry.prototype={get handlerNames()
{return Object.getOwnPropertyNames(this._handlers);},get activeHandler()
{return this._activeHandler;},set activeHandler(value)
{this._activeHandler=value;this._setting.set(value);},dispatch:function(data)
{return this.dispatchToHandler(this._activeHandler,data);},dispatchToHandler:function(name,data)
{var handler=this._handlers[name];var result=handler&&handler(data);return!!result;},registerHandler:function(name,handler)
{this._handlers[name]=handler;this.dispatchEventToListeners(WebInspector.HandlerRegistry.EventTypes.HandlersUpdated);},unregisterHandler:function(name)
{delete this._handlers[name];this.dispatchEventToListeners(WebInspector.HandlerRegistry.EventTypes.HandlersUpdated);},_openInNewTab:function(url)
{InspectorFrontendHost.openInNewTab(url);},_appendContentProviderItems:function(contextMenu,target)
{if(!(target instanceof WebInspector.UISourceCode||target instanceof WebInspector.Resource||target instanceof WebInspector.NetworkRequest))
return;var contentProvider=(target);if(!contentProvider.contentURL())
return;contextMenu.appendItem(WebInspector.openLinkExternallyLabel(),this._openInNewTab.bind(this,contentProvider.contentURL()));for(var i=1;i<this.handlerNames.length;++i){var handler=this.handlerNames[i];contextMenu.appendItem(WebInspector.UIString.capitalize("Open ^using %s",handler),this.dispatchToHandler.bind(this,handler,{url:contentProvider.contentURL()}));}
contextMenu.appendItem(WebInspector.copyLinkAddressLabel(),InspectorFrontendHost.copyText.bind(InspectorFrontendHost,contentProvider.contentURL()));if(!contentProvider.contentURL())
return;if(!contentProvider.contentType().isDocumentOrScriptOrStyleSheet())
return;function doSave(forceSaveAs,content)
{var url=contentProvider.contentURL();WebInspector.fileManager.save(url,(content),forceSaveAs);WebInspector.fileManager.close(url);}
function save(forceSaveAs)
{if(contentProvider instanceof WebInspector.UISourceCode){var uiSourceCode=(contentProvider);if(forceSaveAs)
uiSourceCode.saveAs();else
uiSourceCode.commitWorkingCopy();return;}
contentProvider.requestContent(doSave.bind(null,forceSaveAs));}
contextMenu.appendSeparator();contextMenu.appendItem(WebInspector.UIString("Save"),save.bind(null,false));if(contentProvider instanceof WebInspector.UISourceCode){var uiSourceCode=(contentProvider);if(uiSourceCode.project().type()!==WebInspector.projectTypes.FileSystem&&uiSourceCode.project().type()!==WebInspector.projectTypes.Snippets)
contextMenu.appendItem(WebInspector.UIString.capitalize("Save ^as..."),save.bind(null,true));}},_appendHrefItems:function(contextMenu,target)
{if(!(target instanceof Node))
return;var targetNode=(target);var anchorElement=targetNode.enclosingNodeOrSelfWithClass("webkit-html-resource-link")||targetNode.enclosingNodeOrSelfWithClass("webkit-html-external-link");if(!anchorElement)
return;var uiLocation=WebInspector.Linkifier.uiLocationByAnchor(anchorElement);var resourceURL=uiLocation?uiLocation.uiSourceCode.contentURL():anchorElement.href;var uiSourceCode=uiLocation?uiLocation.uiSourceCode:(resourceURL?WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(resourceURL):null);function open()
{WebInspector.Revealer.reveal(uiSourceCode);}
if(uiSourceCode)
contextMenu.appendItem("Open",open);if(!resourceURL)
return;contextMenu.appendItem(WebInspector.openLinkExternallyLabel(),this._openInNewTab.bind(this,resourceURL));function openInResourcesPanel(resourceURL)
{var resource=WebInspector.resourceForURL(resourceURL);if(resource)
WebInspector.Revealer.reveal(resource);else
InspectorFrontendHost.openInNewTab(resourceURL);}
if(!targetNode.enclosingNodeOrSelfWithClassList(["resources","panel"])&&WebInspector.resourceForURL(resourceURL))
contextMenu.appendItem(WebInspector.UIString.capitalize("Open ^link in Resources ^panel"),openInResourcesPanel.bind(null,resourceURL));contextMenu.appendItem(WebInspector.copyLinkAddressLabel(),InspectorFrontendHost.copyText.bind(InspectorFrontendHost,resourceURL));},__proto__:WebInspector.Object.prototype}
WebInspector.HandlerRegistry.EventTypes={HandlersUpdated:"HandlersUpdated"}
WebInspector.HandlerSelector=function(handlerRegistry)
{this._handlerRegistry=handlerRegistry;this.element=createElementWithClass("select","chrome-select");this.element.addEventListener("change",this._onChange.bind(this),false);this._update();this._handlerRegistry.addEventListener(WebInspector.HandlerRegistry.EventTypes.HandlersUpdated,this._update.bind(this));}
WebInspector.HandlerSelector.prototype={_update:function()
{this.element.removeChildren();var names=this._handlerRegistry.handlerNames;var activeHandler=this._handlerRegistry.activeHandler;for(var i=0;i<names.length;++i){var option=createElement("option");option.textContent=names[i];option.selected=activeHandler===names[i];this.element.appendChild(option);}
this.element.disabled=names.length<=1;},_onChange:function(event)
{var value=event.target.value;this._handlerRegistry.activeHandler=value;}}
WebInspector.HandlerRegistry.ContextMenuProvider=function()
{}
WebInspector.HandlerRegistry.ContextMenuProvider.prototype={appendApplicableItems:function(event,contextMenu,target)
{WebInspector.openAnchorLocationRegistry._appendContentProviderItems(contextMenu,target);WebInspector.openAnchorLocationRegistry._appendHrefItems(contextMenu,target);}}
WebInspector.HandlerRegistry.LinkHandler=function()
{}
WebInspector.HandlerRegistry.LinkHandler.prototype={handleLink:function(url,lineNumber)
{return WebInspector.openAnchorLocationRegistry.dispatch({url:url,lineNumber:lineNumber});}}
WebInspector.HandlerRegistry.OpenAnchorLocationSettingUI=function()
{}
WebInspector.HandlerRegistry.OpenAnchorLocationSettingUI.prototype={settingElement:function()
{if(!WebInspector.openAnchorLocationRegistry.handlerNames.length)
return null;var handlerSelector=new WebInspector.HandlerSelector(WebInspector.openAnchorLocationRegistry);return WebInspector.SettingsUI.createCustomSetting(WebInspector.UIString("Link handling:"),handlerSelector.element);}}
WebInspector.openAnchorLocationRegistry;;WebInspector.InspectorView=function()
{WebInspector.VBox.call(this);WebInspector.Dialog.setModalHostView(this);WebInspector.GlassPane.DefaultFocusedViewStack.push(this);this.setMinimumSize(240,72);this._drawerSplitWidget=new WebInspector.SplitWidget(false,true,"Inspector.drawerSplitViewState",200,200);this._drawerSplitWidget.hideSidebar();this._drawerSplitWidget.enableShowModeSaving();this._drawerSplitWidget.show(this.element);this._tabbedPane=new WebInspector.TabbedPane();this._tabbedPane.registerRequiredCSS("components/inspectorViewTabbedPane.css");this._tabbedPane.element.classList.add("inspector-view-tabbed-pane");this._tabbedPane.setTabSlider(true);this._tabbedPane.setAllowTabReorder(true,false);this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabOrderChanged,this._persistPanelOrder,this);this._tabOrderSetting=WebInspector.settings.createSetting("InspectorView.panelOrder",{});this._drawerSplitWidget.setMainWidget(this._tabbedPane);this._drawer=new WebInspector.Drawer(this._drawerSplitWidget);this._panels={};WebInspector["panels"]=this._panels;this._history=[];this._historyIterator=-1;this._keyDownBound=this._keyDown.bind(this);this._keyPressBound=this._keyPress.bind(this);this._panelDescriptors={};this._panelPromises={};this._openBracketIdentifiers=["U+005B","U+00DB"].keySet();this._closeBracketIdentifiers=["U+005D","U+00DD"].keySet();this._lastActivePanelSetting=WebInspector.settings.createSetting("lastActivePanel","elements");InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.ShowPanel,showPanel.bind(this));this._loadPanelDesciptors();function showPanel(event)
{var panelName=(event.data);this.showPanel(panelName);}
WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.SuspendStateChanged,this._onSuspendStateChanged.bind(this));};WebInspector.InspectorView.prototype={wasShown:function()
{this.element.ownerDocument.addEventListener("keydown",this._keyDownBound,false);this.element.ownerDocument.addEventListener("keypress",this._keyPressBound,false);},willHide:function()
{this.element.ownerDocument.removeEventListener("keydown",this._keyDownBound,false);this.element.ownerDocument.removeEventListener("keypress",this._keyPressBound,false);},_loadPanelDesciptors:function()
{function processPanelExtensions(extension)
{var descriptor=new WebInspector.RuntimeExtensionPanelDescriptor(extension);var weight=this._tabOrderSetting.get()[descriptor.name()];if(weight===undefined)
weight=extension.descriptor()["order"];if(weight===undefined)
weight=10000;panelWeights.set(descriptor,weight);}
function orderComparator(left,right)
{return panelWeights.get(left)>panelWeights.get(right);}
WebInspector.startBatchUpdate();var panelWeights=new Map();self.runtime.extensions(WebInspector.PanelFactory).forEach(processPanelExtensions.bind(this));var sortedPanels=panelWeights.keysArray().sort(orderComparator);for(var panelDescriptor of sortedPanels)
this._innerAddPanel(panelDescriptor);WebInspector.endBatchUpdate();},createToolbars:function()
{this._leftToolbar=new WebInspector.ExtensibleToolbar("main-toolbar-left");this._leftToolbar.element.classList.add("inspector-view-toolbar","inspector-view-toolbar-left");this._tabbedPane.insertBeforeTabStrip(this._leftToolbar.element);var rightToolbarContainer=createElementWithClass("div","hbox flex-none flex-centered");this._tabbedPane.appendAfterTabStrip(rightToolbarContainer);this._rightToolbar=new WebInspector.ExtensibleToolbar("main-toolbar-right");this._rightToolbar.element.classList.add("inspector-view-toolbar","flex-none");rightToolbarContainer.appendChild(this._rightToolbar.element);},_innerAddPanel:function(panelDescriptor,index)
{var panelName=panelDescriptor.name();this._panelDescriptors[panelName]=panelDescriptor;this._tabbedPane.appendTab(panelName,panelDescriptor.title(),new WebInspector.Widget(),undefined,undefined,undefined,index);if(this._lastActivePanelSetting.get()===panelName)
this._tabbedPane.selectTab(panelName);},addPanel:function(panelDescriptor)
{var weight=this._tabOrderSetting.get()[panelDescriptor.name()];if(weight)
weight=Math.max(0,Math.round(weight/10)-1);this._innerAddPanel(panelDescriptor,weight);},hasPanel:function(panelName)
{return!!this._panelDescriptors[panelName];},panel:function(panelName)
{var panelDescriptor=this._panelDescriptors[panelName];if(!panelDescriptor)
return Promise.reject(new Error("Can't load panel without the descriptor: "+panelName));var promise=this._panelPromises[panelName];if(promise)
return promise;promise=panelDescriptor.panel();this._panelPromises[panelName]=promise;promise.then(cachePanel.bind(this));function cachePanel(panel)
{delete this._panelPromises[panelName];this._panels[panelName]=panel;return panel;}
return promise;},_onSuspendStateChanged:function(event)
{this._currentPanelLocked=WebInspector.targetManager.allTargetsSuspended();this._tabbedPane.setCurrentTabLocked(this._currentPanelLocked);if(this._leftToolbar)
this._leftToolbar.setEnabled(!this._currentPanelLocked);if(this._rightToolbar)
this._rightToolbar.setEnabled(!this._currentPanelLocked);},showPanel:function(panelName)
{if(this._currentPanelLocked){if(this._currentPanel!==this._panels[panelName])
return Promise.reject(new Error("Current panel locked"));return Promise.resolve(this._currentPanel);}
this._panelForShowPromise=this.panel(panelName);return this._panelForShowPromise.then(setCurrentPanelIfNecessary.bind(this,this._panelForShowPromise));function setCurrentPanelIfNecessary(panelPromise,panel)
{if(this._panelForShowPromise!==panelPromise)
return null;this.setCurrentPanel(panel);return panel;}},setPanelIcon:function(panelName,iconType,iconTooltip)
{this._tabbedPane.setTabIcon(panelName,iconType,iconTooltip);},currentPanel:function()
{return this._currentPanel;},showInitialPanel:function()
{if(InspectorFrontendHost.isUnderTest())
return;this._showInitialPanel();},_showInitialPanel:function()
{this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);this._tabSelected();this._drawer.initialPanelShown();},showInitialPanelForTest:function(panelName)
{this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);this.setCurrentPanel(this._panels[panelName]);this._drawer.initialPanelShown();},_tabSelected:function()
{var panelName=this._tabbedPane.selectedTabId;if(!panelName)
return;this.showPanel(panelName);},setCurrentPanel:function(panel,suppressBringToFront)
{delete this._panelForShowPromise;if(this._currentPanelLocked)
return this._currentPanel;if(!suppressBringToFront)
InspectorFrontendHost.bringToFront();if(this._currentPanel===panel)
return panel;this._currentPanel=panel;if(!this._panels[panel.name])
this._panels[panel.name]=panel;this._tabbedPane.changeTabView(panel.name,panel);this._tabbedPane.removeEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);this._tabbedPane.selectTab(panel.name);this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected,this._tabSelected,this);this._lastActivePanelSetting.set(panel.name);this._pushToHistory(panel.name);WebInspector.userMetrics.panelShown(panel.name);panel.focus();return panel;},showDrawer:function()
{this._drawer.showDrawer();},drawerVisible:function()
{return this._drawer.isShowing();},showViewInDrawer:function(id,immediate)
{return this._drawer.showView(id,immediate);},selectedViewInDrawer:function()
{return this._drawer.selectedViewId();},closeDrawer:function()
{this._drawer.closeDrawer();},defaultFocusedElement:function()
{return this._currentPanel?this._currentPanel.defaultFocusedElement():null;},_keyPress:function(event)
{if(event.charCode<32&&WebInspector.isWin())
return;clearTimeout(this._keyDownTimer);delete this._keyDownTimer;},_keyDown:function(event)
{if(!WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event))
return;var keyboardEvent=(event);var panelShortcutEnabled=WebInspector.moduleSetting("shortcutPanelSwitch").get();if(panelShortcutEnabled&&!event.shiftKey&&!event.altKey){var panelIndex=-1;if(event.keyCode>0x30&&event.keyCode<0x3A)
panelIndex=event.keyCode-0x31;else if(event.keyCode>0x60&&event.keyCode<0x6A&&keyboardEvent.location===KeyboardEvent.DOM_KEY_LOCATION_NUMPAD)
panelIndex=event.keyCode-0x61;if(panelIndex!==-1){var panelName=this._tabbedPane.allTabs()[panelIndex];if(panelName){if(!WebInspector.Dialog.hasInstance()&&!this._currentPanelLocked)
this.showPanel(panelName);event.consume(true);}
return;}}
if(!WebInspector.isWin()||(!this._openBracketIdentifiers[event.keyIdentifier]&&!this._closeBracketIdentifiers[event.keyIdentifier])){this._keyDownInternal(event);return;}
this._keyDownTimer=setTimeout(this._keyDownInternal.bind(this,event),0);},_keyDownInternal:function(event)
{if(this._currentPanelLocked)
return;var direction=0;if(this._openBracketIdentifiers[event.keyIdentifier])
direction=-1;if(this._closeBracketIdentifiers[event.keyIdentifier])
direction=1;if(!direction)
return;if(!event.shiftKey&&!event.altKey){if(!WebInspector.Dialog.hasInstance())
this._changePanelInDirection(direction);event.consume(true);return;}
if(event.altKey&&this._moveInHistory(direction))
event.consume(true);},_changePanelInDirection:function(direction)
{var panelOrder=this._tabbedPane.allTabs();var index=panelOrder.indexOf(this.currentPanel().name);index=(index+panelOrder.length+direction)%panelOrder.length;this.showPanel(panelOrder[index]);},_moveInHistory:function(move)
{var newIndex=this._historyIterator+move;if(newIndex>=this._history.length||newIndex<0)
return false;this._inHistory=true;this._historyIterator=newIndex;if(!WebInspector.Dialog.hasInstance())
this.setCurrentPanel(this._panels[this._history[this._historyIterator]]);delete this._inHistory;return true;},_pushToHistory:function(panelName)
{if(this._inHistory)
return;this._history.splice(this._historyIterator+1,this._history.length-this._historyIterator-1);if(!this._history.length||this._history[this._history.length-1]!==panelName)
this._history.push(panelName);this._historyIterator=this._history.length-1;},onResize:function()
{WebInspector.Dialog.modalHostRepositioned();},topResizerElement:function()
{return this._tabbedPane.headerElement();},toolbarItemResized:function()
{this._tabbedPane.headerResized();},_persistPanelOrder:function(event)
{var tabs=(event.data);var tabOrders=this._tabOrderSetting.get();for(var i=0;i<tabs.length;i++)
tabOrders[tabs[i].id]=(i+1)*10;this._tabOrderSetting.set(tabOrders);},__proto__:WebInspector.VBox.prototype};WebInspector.inspectorView;WebInspector.InspectorView.DrawerToggleActionDelegate=function()
{}
WebInspector.InspectorView.DrawerToggleActionDelegate.prototype={handleAction:function(context,actionId)
{if(WebInspector.inspectorView.drawerVisible())
WebInspector.inspectorView.closeDrawer();else
WebInspector.inspectorView.showDrawer();return true;}};WebInspector.LinkifierFormatter=function()
{}
WebInspector.LinkifierFormatter.prototype={formatLiveAnchor:function(anchor,uiLocation){}}
WebInspector.Linkifier=function(formatter)
{this._formatter=formatter||new WebInspector.Linkifier.DefaultFormatter(WebInspector.Linkifier.MaxLengthForDisplayedURLs);this._liveLocationsByTarget=new Map();WebInspector.targetManager.observeTargets(this);}
WebInspector.Linkifier.setLinkHandler=function(handler)
{WebInspector.Linkifier._linkHandler=handler;}
WebInspector.Linkifier.handleLink=function(url,lineNumber)
{if(!WebInspector.Linkifier._linkHandler)
return false;return WebInspector.Linkifier._linkHandler.handleLink(url,lineNumber);}
WebInspector.Linkifier.linkifyUsingRevealer=function(revealable,text,fallbackHref,fallbackLineNumber,title,classes)
{var a=createElement("a");a.className=(classes||"")+" webkit-html-resource-link";a.textContent=text.trimMiddle(WebInspector.Linkifier.MaxLengthForDisplayedURLs);a.title=title||text;if(fallbackHref){a.href=fallbackHref;a.lineNumber=fallbackLineNumber;}
function clickHandler(event)
{event.stopImmediatePropagation();event.preventDefault();if(fallbackHref&&WebInspector.Linkifier.handleLink(fallbackHref,fallbackLineNumber))
return;WebInspector.Revealer.reveal(this);}
a.addEventListener("click",clickHandler.bind(revealable),false);return a;}
WebInspector.Linkifier._uiLocationSymbol=Symbol("uiLocation");WebInspector.Linkifier._fallbackAnchorSymbol=Symbol("fallbackAnchor");WebInspector.Linkifier.prototype={targetAdded:function(target)
{this._liveLocationsByTarget.set(target,new Map());},targetRemoved:function(target)
{var liveLocations=this._liveLocationsByTarget.remove(target);var anchors=liveLocations.keysArray();for(var i=0;i<anchors.length;++i){var anchor=anchors[i];var location=liveLocations.get(anchor);delete anchor[WebInspector.Linkifier._uiLocationSymbol];var fallbackAnchor=anchor[WebInspector.Linkifier._fallbackAnchorSymbol];if(fallbackAnchor){anchor.href=fallbackAnchor.href;anchor.lineNumber=fallbackAnchor.lineNumber;anchor.title=fallbackAnchor.title;anchor.className=fallbackAnchor.className;anchor.textContent=fallbackAnchor.textContent;delete anchor[WebInspector.Linkifier._fallbackAnchorSymbol];}
location.dispose();}},linkifyScriptLocation:function(target,scriptId,sourceURL,lineNumber,columnNumber,classes)
{var fallbackAnchor=WebInspector.linkifyResourceAsNode(sourceURL,lineNumber,columnNumber,classes);if(!target||target.isDetached())
return fallbackAnchor;var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(!debuggerModel)
return fallbackAnchor;var rawLocation=scriptId?debuggerModel.createRawLocationByScriptId(scriptId,lineNumber,columnNumber||0):debuggerModel.createRawLocationByURL(sourceURL,lineNumber,columnNumber||0);if(!rawLocation)
return fallbackAnchor;var anchor=this._createAnchor(classes);var liveLocation=WebInspector.debuggerWorkspaceBinding.createLiveLocation(rawLocation,this._updateAnchor.bind(this,anchor));this._liveLocationsByTarget.get(rawLocation.target()).set(anchor,liveLocation);anchor[WebInspector.Linkifier._fallbackAnchorSymbol]=fallbackAnchor;return anchor;},linkifyRawLocation:function(rawLocation,fallbackUrl,classes)
{return this.linkifyScriptLocation(rawLocation.target(),rawLocation.scriptId,fallbackUrl,rawLocation.lineNumber,rawLocation.columnNumber,classes);},linkifyConsoleCallFrame:function(target,callFrame,classes)
{var lineNumber=callFrame.lineNumber?callFrame.lineNumber-1:0;var columnNumber=callFrame.columnNumber?callFrame.columnNumber-1:0;var anchor=this.linkifyScriptLocation(target,callFrame.scriptId,callFrame.url,lineNumber,columnNumber,classes);var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);var script=debuggerModel&&debuggerModel.scriptForId(callFrame.scriptId);var blackboxed=script?WebInspector.BlackboxSupport.isBlackboxed(script.sourceURL,script.isContentScript()):WebInspector.BlackboxSupport.isBlackboxedURL(callFrame.url);if(blackboxed)
anchor.classList.add("webkit-html-blackbox-link");return anchor;},linkifyCSSLocation:function(rawLocation,classes)
{var anchor=this._createAnchor(classes);var liveLocation=WebInspector.cssWorkspaceBinding.createLiveLocation(rawLocation,this._updateAnchor.bind(this,anchor));this._liveLocationsByTarget.get(rawLocation.target()).set(anchor,liveLocation);return anchor;},disposeAnchor:function(target,anchor)
{delete anchor[WebInspector.Linkifier._uiLocationSymbol];delete anchor[WebInspector.Linkifier._fallbackAnchorSymbol];var liveLocations=this._liveLocationsByTarget.get(target);if(!liveLocations)
return;var location=liveLocations.remove(anchor);if(location)
location.dispose();},_createAnchor:function(classes)
{var anchor=createElement("a");anchor.className=(classes||"")+" webkit-html-resource-link";function clickHandler(event)
{var uiLocation=anchor[WebInspector.Linkifier._uiLocationSymbol];if(!uiLocation)
return;event.consume(true);var networkURL=WebInspector.networkMapping.networkURL(uiLocation.uiSourceCode);if(WebInspector.Linkifier.handleLink(networkURL,uiLocation.lineNumber))
return;WebInspector.Revealer.reveal(uiLocation);}
anchor.addEventListener("click",clickHandler,false);return anchor;},reset:function()
{var targets=this._liveLocationsByTarget.keysArray();for(var i=0;i<targets.length;++i){var target=targets[i];this.targetRemoved(target);this.targetAdded(target);}},dispose:function()
{this.reset();WebInspector.targetManager.unobserveTargets(this);this._liveLocationsByTarget.clear();},_updateAnchor:function(anchor,uiLocation)
{anchor[WebInspector.Linkifier._uiLocationSymbol]=uiLocation;this._formatter.formatLiveAnchor(anchor,uiLocation);}}
WebInspector.Linkifier.uiLocationByAnchor=function(anchor)
{return anchor[WebInspector.Linkifier._uiLocationSymbol];}
WebInspector.Linkifier.DefaultFormatter=function(maxLength)
{this._maxLength=maxLength;}
WebInspector.Linkifier.DefaultFormatter.prototype={formatLiveAnchor:function(anchor,uiLocation)
{var text=uiLocation.linkText();text=text.replace(/([a-f0-9]{7})[a-f0-9]{13}[a-f0-9]*/g,"$1\u2026");if(this._maxLength)
text=text.trimMiddle(this._maxLength);anchor.textContent=text;var titleText=uiLocation.uiSourceCode.url();if(typeof uiLocation.lineNumber==="number")
titleText+=":"+(uiLocation.lineNumber+1);anchor.title=titleText;}}
WebInspector.Linkifier.DefaultCSSFormatter=function()
{WebInspector.Linkifier.DefaultFormatter.call(this,WebInspector.Linkifier.DefaultCSSFormatter.MaxLengthForDisplayedURLs);}
WebInspector.Linkifier.DefaultCSSFormatter.MaxLengthForDisplayedURLs=30;WebInspector.Linkifier.DefaultCSSFormatter.prototype={formatLiveAnchor:function(anchor,uiLocation)
{WebInspector.Linkifier.DefaultFormatter.prototype.formatLiveAnchor.call(this,anchor,uiLocation);anchor.classList.add("webkit-html-resource-link");anchor.setAttribute("data-uncopyable",anchor.textContent);anchor.textContent="";},__proto__:WebInspector.Linkifier.DefaultFormatter.prototype}
WebInspector.Linkifier.MaxLengthForDisplayedURLs=150;WebInspector.Linkifier.LinkHandler=function()
{}
WebInspector.Linkifier.LinkHandler.prototype={handleLink:function(url,lineNumber){}}
WebInspector.Linkifier.liveLocationText=function(target,scriptId,lineNumber,columnNumber)
{var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(!debuggerModel)
return"";var script=debuggerModel.scriptForId(scriptId);if(!script)
return"";var location=(debuggerModel.createRawLocation(script,lineNumber,columnNumber||0));var uiLocation=(WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(location));return uiLocation.linkText();}
WebInspector.linkifyStringAsFragmentWithCustomLinkifier=function(string,linkifier)
{var container=createDocumentFragment();var linkStringRegEx=/(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/|data:|www\.)[\w$\-_+*'=\|\/\\(){}[\]^%@&#~,:;.!?]{2,}[\w$\-_+*=\|\/\\({^%@&#~]/;while(string&&string.length<10000){var linkString=linkStringRegEx.exec(string);if(!linkString)
break;linkString=linkString[0];var linkIndex=string.indexOf(linkString);var nonLink=string.substring(0,linkIndex);container.appendChild(createTextNode(nonLink));var title=linkString;var realURL=(linkString.startsWith("www.")?"http://"+linkString:linkString);var splitResult=WebInspector.ParsedURL.splitLineAndColumn(realURL);var linkNode;if(splitResult)
linkNode=linkifier(title,splitResult.url,splitResult.lineNumber,splitResult.columnNumber);else
linkNode=linkifier(title,realURL);container.appendChild(linkNode);string=string.substring(linkIndex+linkString.length,string.length);}
if(string)
container.appendChild(createTextNode(string));return container;}
WebInspector.linkifyStringAsFragment=function(string)
{function linkifier(title,url,lineNumber,columnNumber)
{var isExternal=!WebInspector.resourceForURL(url)&&!WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(url);var urlNode=WebInspector.linkifyURLAsNode(url,title,undefined,isExternal);if(typeof lineNumber!=="undefined"){urlNode.lineNumber=lineNumber;if(typeof columnNumber!=="undefined")
urlNode.columnNumber=columnNumber;}
return urlNode;}
return WebInspector.linkifyStringAsFragmentWithCustomLinkifier(string,linkifier);}
WebInspector.linkifyURLAsNode=function(url,linkText,classes,isExternal,tooltipText)
{if(!linkText)
linkText=url;classes=(classes?classes+" ":"");classes+=isExternal?"webkit-html-external-link":"webkit-html-resource-link";var a=createElement("a");var href=sanitizeHref(url);if(href!==null)
a.href=href;a.className=classes;if(!tooltipText&&linkText!==url)
a.title=url;else if(tooltipText)
a.title=tooltipText;a.textContent=linkText.trimMiddle(WebInspector.Linkifier.MaxLengthForDisplayedURLs);if(isExternal)
a.setAttribute("target","_blank");return a;}
WebInspector.linkifyDocumentationURLAsNode=function(article,title)
{return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tools/chrome-devtools/"+article,title,undefined,true);}
WebInspector.linkifyResourceAsNode=function(url,lineNumber,columnNumber,classes,tooltipText,urlDisplayName)
{var linkText=urlDisplayName?urlDisplayName:url?WebInspector.displayNameForURL(url):WebInspector.UIString("(program)");if(typeof lineNumber==="number")
linkText+=":"+(lineNumber+1);var anchor=WebInspector.linkifyURLAsNode(url,linkText,classes,false,tooltipText);anchor.lineNumber=lineNumber;anchor.columnNumber=columnNumber;return anchor;}
WebInspector.linkifyRequestAsNode=function(request)
{var anchor=WebInspector.linkifyURLAsNode(request.url);anchor.requestId=request.requestId;return anchor;};WebInspector.NetworkConditionsSelector=function(selectElement)
{this._selectElement=selectElement;this._selectElement.addEventListener("change",this._optionSelected.bind(this),false);this._customSetting=WebInspector.moduleSetting("networkConditionsCustomProfiles");this._customSetting.addChangeListener(this._populateOptions,this);this._manager=WebInspector.multitargetNetworkManager;this._manager.addEventListener(WebInspector.MultitargetNetworkManager.Events.ConditionsChanged,this._conditionsChanged,this);this._populateOptions();}
WebInspector.NetworkConditionsProfile;WebInspector.NetworkConditionsSelector.throughputText=function(throughput)
{if(throughput<0)
return"";var throughputInKbps=throughput/(1024/8);return(throughputInKbps<1024)?WebInspector.UIString("%d kb/s",throughputInKbps):WebInspector.UIString("%d Mb/s",(throughputInKbps/1024)|0);}
WebInspector.NetworkConditionsSelector._networkConditionsPresets=[{title:"Offline",value:{download:0*1024/8,upload:0*1024/8,latency:0}},{title:"GPRS",value:{download:50*1024/8,upload:20*1024/8,latency:500}},{title:"Regular 2G",value:{download:250*1024/8,upload:50*1024/8,latency:300}},{title:"Good 2G",value:{download:450*1024/8,upload:150*1024/8,latency:150}},{title:"Regular 3G",value:{download:750*1024/8,upload:250*1024/8,latency:100}},{title:"Good 3G",value:{download:1.5*1024*1024/8,upload:750*1024/8,latency:40}},{title:"Regular 4G",value:{download:4*1024*1024/8,upload:3*1024*1024/8,latency:20}},{title:"DSL",value:{download:2*1024*1024/8,upload:1*1024*1024/8,latency:5}},{title:"WiFi",value:{download:30*1024*1024/8,upload:15*1024*1024/8,latency:2}}];WebInspector.NetworkConditionsSelector._disabledPreset={title:"No throttling",value:{download:-1,upload:-1,latency:0}};WebInspector.NetworkConditionsSelector.prototype={_populateOptions:function()
{this._selectElement.removeChildren();var customGroup=this._addGroup(this._customSetting.get(),WebInspector.UIString("Custom"));customGroup.insertBefore(new Option(WebInspector.UIString("Add\u2026"),WebInspector.UIString("Add\u2026")),customGroup.firstChild);this._addGroup(WebInspector.NetworkConditionsSelector._networkConditionsPresets,WebInspector.UIString("Presets"));this._addGroup([WebInspector.NetworkConditionsSelector._disabledPreset],WebInspector.UIString("Disabled"));this._conditionsChanged();},_addGroup:function(presets,groupName)
{var groupElement=this._selectElement.createChild("optgroup");groupElement.label=groupName;for(var i=0;i<presets.length;++i){var preset=presets[i];var downloadInKbps=preset.value.download/(1024/8);var uploadInKbps=preset.value.upload/(1024/8);var isThrottling=(downloadInKbps>=0)||(uploadInKbps>=0)||(preset.value.latency>0);var option;var presetTitle=WebInspector.UIString(preset.title);if(!isThrottling){option=new Option(presetTitle,presetTitle);}else{var downloadText=WebInspector.NetworkConditionsSelector.throughputText(preset.value.download);var uploadText=WebInspector.NetworkConditionsSelector.throughputText(preset.value.upload);var title=WebInspector.UIString("%s (%s\u2b07 %s\u2b06 %dms RTT)",presetTitle,downloadText,uploadText,preset.value.latency);option=new Option(title,presetTitle);option.title=WebInspector.UIString("Maximum download throughput: %s.\r\nMaximum upload throughput: %s.\r\nMinimum round-trip time: %dms.",downloadText,uploadText,preset.value.latency);}
option.conditions=preset.value;groupElement.appendChild(option);}
return groupElement;},_optionSelected:function()
{if(this._selectElement.selectedIndex===0){WebInspector.Revealer.reveal(this._customSetting);this._conditionsChanged();return;}
this._manager.removeEventListener(WebInspector.MultitargetNetworkManager.Events.ConditionsChanged,this._conditionsChanged,this);this._manager.setNetworkConditions(this._selectElement.options[this._selectElement.selectedIndex].conditions);this._manager.addEventListener(WebInspector.MultitargetNetworkManager.Events.ConditionsChanged,this._conditionsChanged,this);},_conditionsChanged:function()
{var value=this._manager.networkConditions();var options=this._selectElement.options;for(var index=1;index<options.length;++index){var option=options[index];if(option.conditions.download===value.download&&option.conditions.upload===value.upload&&option.conditions.latency===value.latency)
this._selectElement.selectedIndex=index;}}}
WebInspector.NetworkConditionsSettingsTab=function()
{WebInspector.VBox.call(this);this.element.classList.add("settings-tab-container");this.element.classList.add("network-conditions-settings-tab");this.registerRequiredCSS("components/networkConditionsSettingsTab.css");var header=this.element.createChild("header");header.createChild("h3").createTextChild(WebInspector.UIString("Network Throttling Profiles"));this.containerElement=this.element.createChild("div","help-container-wrapper").createChild("div","settings-tab help-content help-container");var buttonsRow=this.containerElement.createChild("div","button-row");var addButton=createTextButton(WebInspector.UIString("Add custom profile..."),this._addButtonClicked.bind(this));buttonsRow.appendChild(addButton);this._list=new WebInspector.ListWidget(this);this._list.registerRequiredCSS("components/networkConditionsSettingsTab.css");this._list.show(this.containerElement);this._customSetting=WebInspector.moduleSetting("networkConditionsCustomProfiles");this._customSetting.addChangeListener(this._conditionsUpdated,this);this.setDefaultFocusedElement(addButton);}
WebInspector.NetworkConditionsSettingsTab.prototype={wasShown:function()
{WebInspector.VBox.prototype.wasShown.call(this);this._conditionsUpdated();},_conditionsUpdated:function()
{this._list.clear();var conditions=this._customSetting.get();for(var i=0;i<conditions.length;++i)
this._list.appendItem(conditions[i],true);this._list.appendSeparator();conditions=WebInspector.NetworkConditionsSelector._networkConditionsPresets;for(var i=0;i<conditions.length;++i)
this._list.appendItem(conditions[i],false);},_addButtonClicked:function()
{this._list.addNewItem(this._customSetting.get().length,{title:"",value:{download:-1,upload:-1,latency:0}});},renderItem:function(item,editable)
{var conditions=(item);var element=createElementWithClass("div","conditions-list-item");var title=element.createChild("div","conditions-list-text conditions-list-title");var titleText=title.createChild("div","conditions-list-title-text");titleText.textContent=conditions.title;titleText.title=conditions.title;element.createChild("div","conditions-list-separator");element.createChild("div","conditions-list-text").textContent=WebInspector.NetworkConditionsSelector.throughputText(conditions.value.download);element.createChild("div","conditions-list-separator");element.createChild("div","conditions-list-text").textContent=WebInspector.NetworkConditionsSelector.throughputText(conditions.value.upload);element.createChild("div","conditions-list-separator");element.createChild("div","conditions-list-text").textContent=WebInspector.UIString("%dms",conditions.value.latency);return element;},removeItemRequested:function(item,index)
{var list=this._customSetting.get();list.splice(index,1);this._customSetting.set(list);},commitEdit:function(item,editor,isNew)
{var conditions=(item);conditions.title=editor.control("title").value.trim();var download=editor.control("download").value.trim();conditions.value.download=download?parseInt(download,10)*(1024/8):-1;var upload=editor.control("upload").value.trim();conditions.value.upload=upload?parseInt(upload,10)*(1024/8):-1;var latency=editor.control("latency").value.trim();conditions.value.latency=latency?parseInt(latency,10):0;var list=this._customSetting.get();if(isNew)
list.push(conditions);this._customSetting.set(list);},beginEdit:function(item)
{var conditions=(item);var editor=this._createEditor();editor.control("title").value=conditions.title;editor.control("download").value=conditions.value.download<=0?"":String(conditions.value.download/(1024/8));editor.control("upload").value=conditions.value.upload<=0?"":String(conditions.value.upload/(1024/8));editor.control("latency").value=conditions.value.latency?String(conditions.value.latency):"";return editor;},_createEditor:function()
{if(this._editor)
return this._editor;var editor=new WebInspector.ListWidget.Editor();this._editor=editor;var content=editor.contentElement();var titles=content.createChild("div","conditions-edit-row");titles.createChild("div","conditions-list-text conditions-list-title").textContent=WebInspector.UIString("Profile Name");titles.createChild("div","conditions-list-separator conditions-list-separator-invisible");titles.createChild("div","conditions-list-text").textContent=WebInspector.UIString("Download");titles.createChild("div","conditions-list-separator conditions-list-separator-invisible");titles.createChild("div","conditions-list-text").textContent=WebInspector.UIString("Upload");titles.createChild("div","conditions-list-separator conditions-list-separator-invisible");titles.createChild("div","conditions-list-text").textContent=WebInspector.UIString("Latency");var fields=content.createChild("div","conditions-edit-row");fields.createChild("div","conditions-list-text conditions-list-title").appendChild(editor.createInput("title","text","",titleValidator));fields.createChild("div","conditions-list-separator conditions-list-separator-invisible");var cell=fields.createChild("div","conditions-list-text");cell.appendChild(editor.createInput("download","text",WebInspector.UIString("kb/s"),throughputValidator));cell.createChild("div","conditions-edit-optional").textContent=WebInspector.UIString("optional");fields.createChild("div","conditions-list-separator conditions-list-separator-invisible");cell=fields.createChild("div","conditions-list-text");cell.appendChild(editor.createInput("upload","text",WebInspector.UIString("kb/s"),throughputValidator));cell.createChild("div","conditions-edit-optional").textContent=WebInspector.UIString("optional");fields.createChild("div","conditions-list-separator conditions-list-separator-invisible");cell=fields.createChild("div","conditions-list-text");cell.appendChild(editor.createInput("latency","text",WebInspector.UIString("ms"),latencyValidator));cell.createChild("div","conditions-edit-optional").textContent=WebInspector.UIString("optional");return editor;function titleValidator(item,index,input)
{var value=input.value.trim();return value.length>0&&value.length<50;}
function throughputValidator(item,index,input)
{var value=input.value.trim();return!value||(/^[\d]+(\.\d+)?|\.\d+$/.test(value)&&value>=0&&value<=10000000);}
function latencyValidator(item,index,input)
{var value=input.value.trim();return!value||(/^[\d]+$/.test(value)&&value>=0&&value<=1000000);}},__proto__:WebInspector.VBox.prototype};WebInspector.ObjectPopoverHelper=function(panelElement,getAnchor,queryObject,onHide,disableOnClick)
{WebInspector.PopoverHelper.call(this,panelElement,getAnchor,this._showObjectPopover.bind(this),this._onHideObjectPopover.bind(this),disableOnClick);this._queryObject=queryObject;this._onHideCallback=onHide;this._popoverObjectGroup="popover";panelElement.addEventListener("scroll",this.hidePopover.bind(this),true);};WebInspector.ObjectPopoverHelper.MaxPopoverTextLength=10000;WebInspector.ObjectPopoverHelper.prototype={_showObjectPopover:function(element,popover)
{function didGetFunctionProperties(funcObject,popoverContentElement,popoverValueElement,anchorElement,properties,internalProperties)
{if(internalProperties){for(var i=0;i<internalProperties.length;i++){if(internalProperties[i].name==="[[TargetFunction]]"){funcObject=internalProperties[i].value;break;}}}
WebInspector.ObjectPropertiesSection.formatObjectAsFunction(funcObject,popoverValueElement,true);funcObject.functionDetails(didGetFunctionDetails.bind(this,popoverContentElement,anchorElement));}
function didGetFunctionDetails(popoverContentElement,anchorElement,response)
{if(!response||popover.disposed)
return;var container=createElementWithClass("div","object-popover-container");var title=container.createChild("div","function-popover-title source-code");var functionName=title.createChild("span","function-name");functionName.textContent=WebInspector.beautifyFunctionName(response.functionName);var rawLocation=response.location;var sourceURL=response.sourceURL;if(rawLocation&&sourceURL){var link=this._lazyLinkifier().linkifyRawLocation(rawLocation,sourceURL,"function-location-link");title.appendChild(link);}
container.appendChild(popoverContentElement);popover.showForAnchor(container,anchorElement);}
function didGetGeneratorObjectDetails(response)
{if(!response||popover.disposed)
return;var rawLocation=response.location;var sourceURL=response.sourceURL;if(rawLocation&&sourceURL){var link=this._lazyLinkifier().linkifyRawLocation(rawLocation,sourceURL,"function-location-link");this._titleElement.appendChild(link);}}
function didQueryObject(result,wasThrown,anchorOverride)
{if(popover.disposed)
return;if(wasThrown){this.hidePopover();return;}
this._objectTarget=result.target();var anchorElement=anchorOverride||element;var description=result.description.trimEnd(WebInspector.ObjectPopoverHelper.MaxPopoverTextLength);var popoverContentElement=null;if(result.type!=="object"){popoverContentElement=createElement("span");WebInspector.appendStyle(popoverContentElement,"components/objectValue.css");var valueElement=popoverContentElement.createChild("span","monospace object-value-"+result.type);valueElement.style.whiteSpace="pre";if(result.type==="string")
valueElement.createTextChildren("\"",description,"\"");else if(result.type!=="function")
valueElement.textContent=description;if(result.type==="function"){result.getOwnProperties(didGetFunctionProperties.bind(this,result,popoverContentElement,valueElement,anchorElement));return;}
popover.showForAnchor(popoverContentElement,anchorElement);}else{if(result.subtype==="node"){WebInspector.DOMModel.highlightObjectAsDOMNode(result);this._resultHighlightedAsDOM=true;}
if(result.customPreview()){var customPreviewComponent=new WebInspector.CustomPreviewComponent(result);customPreviewComponent.expandIfPossible();popoverContentElement=customPreviewComponent.element;}else{popoverContentElement=createElement("div");this._titleElement=popoverContentElement.createChild("div","monospace");this._titleElement.createChild("span","source-frame-popover-title").textContent=description;var section=new WebInspector.ObjectPropertiesSection(result,"");section.element.classList.add("source-frame-popover-tree");section.titleLessMode();popoverContentElement.appendChild(section.element);if(result.subtype==="generator")
result.generatorObjectDetails(didGetGeneratorObjectDetails.bind(this));}
var popoverWidth=300;var popoverHeight=250;popover.showForAnchor(popoverContentElement,anchorElement,popoverWidth,popoverHeight);}}
this._queryObject(element,didQueryObject.bind(this),this._popoverObjectGroup);},_onHideObjectPopover:function()
{if(this._resultHighlightedAsDOM){WebInspector.DOMModel.hideDOMNodeHighlight();delete this._resultHighlightedAsDOM;}
if(this._linkifier){this._linkifier.dispose();delete this._linkifier;}
if(this._onHideCallback)
this._onHideCallback();if(this._objectTarget){this._objectTarget.runtimeAgent().releaseObjectGroup(this._popoverObjectGroup);delete this._objectTarget;}},_lazyLinkifier:function()
{if(!this._linkifier)
this._linkifier=new WebInspector.Linkifier();return this._linkifier;},__proto__:WebInspector.PopoverHelper.prototype};WebInspector.ObjectPropertiesSection=function(object,title,emptyPlaceholder,ignoreHasOwnProperty,extraProperties)
{this._object=object;this._editable=true;TreeOutlineInShadow.call(this);this.setFocusable(false);this._objectTreeElement=new WebInspector.ObjectPropertiesSection.RootElement(object,emptyPlaceholder,ignoreHasOwnProperty,extraProperties);this.appendChild(this._objectTreeElement);if(typeof title==="string"||!title)
this.element.createChild("span").textContent=title||"";else
this.element.appendChild(title);this.element._section=this;this.registerRequiredCSS("components/objectValue.css");this.registerRequiredCSS("components/objectPropertiesSection.css");this.rootElement().childrenListElement.classList.add("source-code","object-properties-section");}
WebInspector.ObjectPropertiesSection._arrayLoadThreshold=100;WebInspector.ObjectPropertiesSection.defaultObjectPresentation=function(object,skipProto)
{var componentRoot=createElementWithClass("span","source-code");var shadowRoot=WebInspector.createShadowRootWithCoreStyles(componentRoot,"components/objectValue.css");shadowRoot.appendChild(WebInspector.ObjectPropertiesSection.createValueElement(object,false));if(!object.hasChildren)
return componentRoot;var objectPropertiesSection=new WebInspector.ObjectPropertiesSection(object,componentRoot);objectPropertiesSection.editable=false;if(skipProto)
objectPropertiesSection.skipProto();return objectPropertiesSection.element;}
WebInspector.ObjectPropertiesSection.prototype={skipProto:function()
{this._skipProto=true;},expand:function()
{this._objectTreeElement.expand();},objectTreeElement:function()
{return this._objectTreeElement;},enableContextMenu:function()
{this.element.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),false);},_contextMenuEventFired:function(event)
{var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendApplicableItems(this._object);contextMenu.show();},titleLessMode:function()
{this._objectTreeElement.listItemElement.classList.add("hidden");this._objectTreeElement.childrenListElement.classList.add("title-less-mode");this._objectTreeElement.expand();},__proto__:TreeOutlineInShadow.prototype}
WebInspector.ObjectPropertiesSection.CompareProperties=function(propertyA,propertyB)
{var a=propertyA.name;var b=propertyB.name;if(a==="__proto__")
return 1;if(b==="__proto__")
return-1;if(propertyA.symbol&&!propertyB.symbol)
return 1;if(propertyB.symbol&&!propertyA.symbol)
return-1;return String.naturalOrderComparator(a,b);}
WebInspector.ObjectPropertiesSection.RootElement=function(object,emptyPlaceholder,ignoreHasOwnProperty,extraProperties)
{this._object=object;this._extraProperties=extraProperties||[];this._ignoreHasOwnProperty=!!ignoreHasOwnProperty;this._emptyPlaceholder=emptyPlaceholder;var contentElement=createElement("content");TreeElement.call(this,contentElement);this.setExpandable(true);this.selectable=false;this.toggleOnClick=true;this.listItemElement.classList.add("object-properties-section-root-element");}
WebInspector.ObjectPropertiesSection.RootElement.prototype={onexpand:function()
{if(this.treeOutline)
this.treeOutline.element.classList.add("expanded");},oncollapse:function()
{if(this.treeOutline)
this.treeOutline.element.classList.remove("expanded");},ondblclick:function(e)
{return true;},onpopulate:function()
{WebInspector.ObjectPropertyTreeElement._populate(this,this._object,!!this.treeOutline._skipProto,this._emptyPlaceholder,this._ignoreHasOwnProperty,this._extraProperties);},__proto__:TreeElement.prototype}
WebInspector.ObjectPropertyTreeElement=function(property)
{this.property=property;TreeElement.call(this);this.toggleOnClick=true;this.selectable=false;}
WebInspector.ObjectPropertyTreeElement.prototype={onpopulate:function()
{var propertyValue=(this.property.value);console.assert(propertyValue);var skipProto=this.treeOutline?this.treeOutline._skipProto:true;var targetValue=this.property.name!=='__proto__'?propertyValue:this.property.parentObject;WebInspector.ObjectPropertyTreeElement._populate(this,propertyValue,skipProto,undefined,undefined,undefined,targetValue);},ondblclick:function(event)
{var editableElement=this.valueElement;if(!this.property.value.customPreview()&&(this.property.writable||this.property.setter)&&event.target.isSelfOrDescendant(editableElement))
this._startEditing();return false;},onattach:function()
{this.update();this._updateExpandable();},update:function()
{this.nameElement=WebInspector.ObjectPropertiesSection.createNameElement(this.property.name);if(!this.property.enumerable)
this.nameElement.classList.add("object-properties-section-dimmed");if(this.property.isAccessorProperty())
this.nameElement.classList.add("properties-accessor-property-name");if(this.property.synthetic)
this.nameElement.classList.add("synthetic-property");if(this.property.symbol)
this.nameElement.addEventListener("contextmenu",this._contextMenuFired.bind(this,this.property.symbol),false);var separatorElement=createElementWithClass("span","object-properties-section-separator");separatorElement.textContent=": ";if(this.property.value){this.valueElement=WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport(this.property.value,this.property.wasThrown,this.listItemElement);this.valueElement.addEventListener("contextmenu",this._contextMenuFired.bind(this,this.property.value),false);}else if(this.property.getter){this.valueElement=WebInspector.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan(this.property.parentObject,[this.property.name],this._onInvokeGetterClick.bind(this));}else{this.valueElement=createElementWithClass("span","object-value-undefined");this.valueElement.textContent=WebInspector.UIString("<unreadable>");this.valueElement.title=WebInspector.UIString("No property getter");}
this.listItemElement.removeChildren();this.listItemElement.appendChildren(this.nameElement,separatorElement,this.valueElement);},_contextMenuFired:function(value,event)
{var contextMenu=new WebInspector.ContextMenu(event);contextMenu.appendApplicableItems(value);contextMenu.show();},_startEditing:function()
{if(this._prompt||!this.treeOutline._editable||this._readOnly)
return;this._editableDiv=this.listItemElement.createChild("span");var text=this.property.value.description;if(this.property.value.type==="string"&&typeof text==="string")
text="\""+text+"\"";this._editableDiv.setTextContentTruncatedIfNeeded(text,WebInspector.UIString("<string is too large to edit>"));var originalContent=this._editableDiv.textContent;this.valueElement.classList.add("hidden");this.setExpandable(false);this.listItemElement.classList.add("editing-sub-part");this._prompt=new WebInspector.ObjectPropertyPrompt();var proxyElement=this._prompt.attachAndStartEditing(this._editableDiv,this._editingCommitted.bind(this,originalContent));this.listItemElement.getComponentSelection().setBaseAndExtent(this._editableDiv,0,this._editableDiv,1);proxyElement.addEventListener("keydown",this._promptKeyDown.bind(this,originalContent),false);},_editingEnded:function()
{this._prompt.detach();delete this._prompt;this._editableDiv.remove();this._updateExpandable();this.listItemElement.scrollLeft=0;this.listItemElement.classList.remove("editing-sub-part");},_editingCancelled:function()
{this.valueElement.classList.remove("hidden");this._editingEnded();},_editingCommitted:function(originalContent)
{var userInput=this._prompt.text();if(userInput===originalContent){this._editingCancelled();return;}
this._editingEnded();this._applyExpression(userInput);},_promptKeyDown:function(originalContent,event)
{if(isEnterKey(event)){event.consume(true);this._editingCommitted(originalContent);return;}
if(event.keyIdentifier==="U+001B"){event.consume();this._editingCancelled();return;}},_applyExpression:function(expression)
{var property=WebInspector.RemoteObject.toCallArgument(this.property.symbol||this.property.name);expression=expression.trim();if(expression)
this.property.parentObject.setPropertyValue(property,expression,callback.bind(this));else
this.property.parentObject.deleteProperty(property,callback.bind(this));function callback(error)
{if(error){this.update();return;}
if(!expression){this.parent.removeChild(this);}else{var parent=this.parent;parent.invalidateChildren();parent.expand();}};},_onInvokeGetterClick:function(result,wasThrown)
{if(!result)
return;this.property.value=result;this.property.wasThrown=wasThrown;this.update();this.invalidateChildren();this._updateExpandable();},_updateExpandable:function()
{if(this.property.value)
this.setExpandable(!this.property.value.customPreview()&&this.property.value.hasChildren&&!this.property.wasThrown);else
this.setExpandable(false);},__proto__:TreeElement.prototype}
WebInspector.ObjectPropertyTreeElement._populate=function(treeElement,value,skipProto,emptyPlaceholder,flattenProtoChain,extraProperties,targetValue)
{if(value.arrayLength()>WebInspector.ObjectPropertiesSection._arrayLoadThreshold){treeElement.removeChildren();WebInspector.ArrayGroupingTreeElement._populateArray(treeElement,value,0,value.arrayLength()-1);return;}
function callback(properties,internalProperties)
{treeElement.removeChildren();if(!properties)
return;extraProperties=extraProperties||[];for(var i=0;i<extraProperties.length;++i)
properties.push(extraProperties[i]);WebInspector.ObjectPropertyTreeElement.populateWithProperties(treeElement,properties,internalProperties,skipProto,targetValue||value,emptyPlaceholder);}
if(flattenProtoChain)
value.getAllProperties(false,callback);else
WebInspector.RemoteObject.loadFromObjectPerProto(value,callback);}
WebInspector.ObjectPropertyTreeElement.populateWithProperties=function(treeNode,properties,internalProperties,skipProto,value,emptyPlaceholder){properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties);for(var i=0;i<properties.length;++i){var property=properties[i];if(skipProto&&property.name==="__proto__")
continue;if(property.isAccessorProperty()){if(property.name!=="__proto__"&&property.getter){property.parentObject=value;treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(property));}
if(property.isOwn){if(property.getter){var getterProperty=new WebInspector.RemoteObjectProperty("get "+property.name,property.getter);getterProperty.parentObject=value;treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(getterProperty));}
if(property.setter){var setterProperty=new WebInspector.RemoteObjectProperty("set "+property.name,property.setter);setterProperty.parentObject=value;treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(setterProperty));}}}else{property.parentObject=value;treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(property));}}
if(internalProperties){for(var i=0;i<internalProperties.length;i++){internalProperties[i].parentObject=value;treeNode.appendChild(new WebInspector.ObjectPropertyTreeElement(internalProperties[i]));}}
if(value&&value.type==="function"){var hasTargetFunction=false;if(internalProperties){for(var i=0;i<internalProperties.length;i++){if(internalProperties[i].name=="[[TargetFunction]]"){hasTargetFunction=true;break;}}}
if(!hasTargetFunction)
treeNode.appendChild(new WebInspector.FunctionScopeMainTreeElement(value));}
if(value&&value.type==="object"&&(value.subtype==="map"||value.subtype==="set"||value.subtype==="iterator"))
treeNode.appendChild(new WebInspector.CollectionEntriesMainTreeElement(value));WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded(treeNode,emptyPlaceholder);}
WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded=function(treeNode,emptyPlaceholder)
{if(treeNode.childCount())
return;var title=createElementWithClass("div","info");title.textContent=emptyPlaceholder||WebInspector.UIString("No Properties");var infoElement=new TreeElement(title);treeNode.appendChild(infoElement);}
WebInspector.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan=function(object,propertyPath,callback)
{var rootElement=createElement("span");var element=rootElement.createChild("span");element.textContent=WebInspector.UIString("(...)");if(!object)
return rootElement;element.classList.add("object-value-calculate-value-button");element.title=WebInspector.UIString("Invoke property getter");element.addEventListener("click",onInvokeGetterClick,false);function onInvokeGetterClick(event)
{event.consume();object.getProperty(propertyPath,callback);}
return rootElement;}
WebInspector.FunctionScopeMainTreeElement=function(remoteObject)
{TreeElement.call(this,"<function scope>",true);this.toggleOnClick=true;this.selectable=false;this._remoteObject=remoteObject;}
WebInspector.FunctionScopeMainTreeElement.prototype={onpopulate:function()
{function didGetDetails(response)
{if(!response)
return;this.removeChildren();var scopeChain=response.scopeChain||[];for(var i=0;i<scopeChain.length;++i){var scope=scopeChain[i];var title=null;var isTrueObject=false;switch(scope.type){case DebuggerAgent.ScopeType.Local:title=WebInspector.UIString("Local");break;case DebuggerAgent.ScopeType.Closure:title=WebInspector.UIString("Closure");break;case DebuggerAgent.ScopeType.Catch:title=WebInspector.UIString("Catch");break;case DebuggerAgent.ScopeType.Block:title=WebInspector.UIString("Block");break;case DebuggerAgent.ScopeType.Script:title=WebInspector.UIString("Script");break;case DebuggerAgent.ScopeType.With:title=WebInspector.UIString("With Block");isTrueObject=true;break;case DebuggerAgent.ScopeType.Global:title=WebInspector.UIString("Global");isTrueObject=true;break;default:console.error("Unknown scope type: "+scope.type);continue;}
var runtimeModel=this._remoteObject.target().runtimeModel;if(isTrueObject){var remoteObject=runtimeModel.createRemoteObject(scope.object);var property=new WebInspector.RemoteObjectProperty(title,remoteObject);property.writable=false;property.parentObject=null;this.appendChild(new WebInspector.ObjectPropertyTreeElement(property));}else{var scopeRef=new WebInspector.ScopeRef(i,undefined,this._remoteObject.objectId);var remoteObject=runtimeModel.createScopeRemoteObject(scope.object,scopeRef);var scopeTreeElement=new WebInspector.ScopeTreeElement(title,remoteObject);this.appendChild(scopeTreeElement);}}
WebInspector.ObjectPropertyTreeElement._appendEmptyPlaceholderIfNeeded(this,WebInspector.UIString("No Scopes"));}
this._remoteObject.functionDetails(didGetDetails.bind(this));},__proto__:TreeElement.prototype}
WebInspector.CollectionEntriesMainTreeElement=function(remoteObject)
{TreeElement.call(this,"<entries>",true);this.toggleOnClick=true;this.selectable=false;this._remoteObject=remoteObject;this.expand();}
WebInspector.CollectionEntriesMainTreeElement.prototype={onpopulate:function()
{function didGetCollectionEntries(entries)
{if(!entries)
return;this.removeChildren();var entriesLocalObject=[];var runtimeModel=this._remoteObject.target().runtimeModel;for(var i=0;i<entries.length;++i){var entry=entries[i];if(entry.key){entriesLocalObject.push(new WebInspector.MapEntryLocalJSONObject({key:runtimeModel.createRemoteObject(entry.key),value:runtimeModel.createRemoteObject(entry.value)}));}else{entriesLocalObject.push(runtimeModel.createRemoteObject(entry.value));}}
WebInspector.ObjectPropertyTreeElement._populate(this,WebInspector.RemoteObject.fromLocalObject(entriesLocalObject),true,WebInspector.UIString("No Entries"));this.title="<entries>["+entriesLocalObject.length+"]";}
this._remoteObject.collectionEntries(didGetCollectionEntries.bind(this));},__proto__:TreeElement.prototype}
WebInspector.ScopeTreeElement=function(title,remoteObject)
{TreeElement.call(this,title,true);this.toggleOnClick=true;this.selectable=false;this._remoteObject=remoteObject;}
WebInspector.ScopeTreeElement.prototype={onpopulate:function()
{WebInspector.ObjectPropertyTreeElement._populate(this,this._remoteObject,false);},__proto__:TreeElement.prototype}
WebInspector.ArrayGroupingTreeElement=function(object,fromIndex,toIndex,propertyCount)
{TreeElement.call(this,String.sprintf("[%d \u2026 %d]",fromIndex,toIndex),true);this.toggleOnClick=true;this.selectable=false;this._fromIndex=fromIndex;this._toIndex=toIndex;this._object=object;this._readOnly=true;this._propertyCount=propertyCount;}
WebInspector.ArrayGroupingTreeElement._bucketThreshold=100;WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold=250000;WebInspector.ArrayGroupingTreeElement._getOwnPropertyNamesThreshold=500000;WebInspector.ArrayGroupingTreeElement._populateArray=function(treeNode,object,fromIndex,toIndex)
{WebInspector.ArrayGroupingTreeElement._populateRanges(treeNode,object,fromIndex,toIndex,true);}
WebInspector.ArrayGroupingTreeElement._populateRanges=function(treeNode,object,fromIndex,toIndex,topLevel)
{object.callFunctionJSON(packRanges,[{value:fromIndex},{value:toIndex},{value:WebInspector.ArrayGroupingTreeElement._bucketThreshold},{value:WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold},{value:WebInspector.ArrayGroupingTreeElement._getOwnPropertyNamesThreshold}],callback);function packRanges(fromIndex,toIndex,bucketThreshold,sparseIterationThreshold,getOwnPropertyNamesThreshold)
{var ownPropertyNames=null;var consecutiveRange=(toIndex-fromIndex>=sparseIterationThreshold)&&ArrayBuffer.isView(this);var skipGetOwnPropertyNames=consecutiveRange&&(toIndex-fromIndex>=getOwnPropertyNamesThreshold);function*arrayIndexes(object)
{if(toIndex-fromIndex<sparseIterationThreshold){for(var i=fromIndex;i<=toIndex;++i){if(i in object)
yield i;}}else{ownPropertyNames=ownPropertyNames||Object.getOwnPropertyNames(object);for(var i=0;i<ownPropertyNames.length;++i){var name=ownPropertyNames[i];var index=name>>>0;if((""+index)===name&&fromIndex<=index&&index<=toIndex)
yield index;}}}
var count=0;if(consecutiveRange){count=toIndex-fromIndex+1;}else{for(var i of arrayIndexes(this))
++count;}
var bucketSize=count;if(count<=bucketThreshold)
bucketSize=count;else
bucketSize=Math.pow(bucketThreshold,Math.ceil(Math.log(count)/Math.log(bucketThreshold))-1);var ranges=[];if(consecutiveRange){for(var i=fromIndex;i<=toIndex;i+=bucketSize){var groupStart=i;var groupEnd=groupStart+bucketSize-1;if(groupEnd>toIndex)
groupEnd=toIndex;ranges.push([groupStart,groupEnd,groupEnd-groupStart+1]);}}else{count=0;var groupStart=-1;var groupEnd=0;for(var i of arrayIndexes(this)){if(groupStart===-1)
groupStart=i;groupEnd=i;if(++count===bucketSize){ranges.push([groupStart,groupEnd,count]);count=0;groupStart=-1;}}
if(count>0)
ranges.push([groupStart,groupEnd,count]);}
return{ranges:ranges,skipGetOwnPropertyNames:skipGetOwnPropertyNames};}
function callback(result)
{if(!result)
return;var ranges=(result.ranges);if(ranges.length==1){WebInspector.ArrayGroupingTreeElement._populateAsFragment(treeNode,object,ranges[0][0],ranges[0][1]);}else{for(var i=0;i<ranges.length;++i){var fromIndex=ranges[i][0];var toIndex=ranges[i][1];var count=ranges[i][2];if(fromIndex==toIndex)
WebInspector.ArrayGroupingTreeElement._populateAsFragment(treeNode,object,fromIndex,toIndex);else
treeNode.appendChild(new WebInspector.ArrayGroupingTreeElement(object,fromIndex,toIndex,count));}}
if(topLevel)
WebInspector.ArrayGroupingTreeElement._populateNonIndexProperties(treeNode,object,result.skipGetOwnPropertyNames);}}
WebInspector.ArrayGroupingTreeElement._populateAsFragment=function(treeNode,object,fromIndex,toIndex)
{object.callFunction(buildArrayFragment,[{value:fromIndex},{value:toIndex},{value:WebInspector.ArrayGroupingTreeElement._sparseIterationThreshold}],processArrayFragment.bind(this));function buildArrayFragment(fromIndex,toIndex,sparseIterationThreshold)
{var result=Object.create(null);if(toIndex-fromIndex<sparseIterationThreshold){for(var i=fromIndex;i<=toIndex;++i){if(i in this)
result[i]=this[i];}}else{var ownPropertyNames=Object.getOwnPropertyNames(this);for(var i=0;i<ownPropertyNames.length;++i){var name=ownPropertyNames[i];var index=name>>>0;if(String(index)===name&&fromIndex<=index&&index<=toIndex)
result[index]=this[index];}}
return result;}
function processArrayFragment(arrayFragment,wasThrown)
{if(!arrayFragment||wasThrown)
return;arrayFragment.getAllProperties(false,processProperties.bind(this));}
function processProperties(properties,internalProperties)
{if(!properties)
return;properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties);for(var i=0;i<properties.length;++i){properties[i].parentObject=this._object;var childTreeElement=new WebInspector.ObjectPropertyTreeElement(properties[i]);childTreeElement._readOnly=true;treeNode.appendChild(childTreeElement);}}}
WebInspector.ArrayGroupingTreeElement._populateNonIndexProperties=function(treeNode,object,skipGetOwnPropertyNames)
{object.callFunction(buildObjectFragment,[{value:skipGetOwnPropertyNames}],processObjectFragment.bind(this));function buildObjectFragment(skipGetOwnPropertyNames)
{var result={__proto__:this.__proto__};if(skipGetOwnPropertyNames)
return result;var names=Object.getOwnPropertyNames(this);for(var i=0;i<names.length;++i){var name=names[i];if(String(name>>>0)===name&&name>>>0!==0xffffffff)
continue;var descriptor=Object.getOwnPropertyDescriptor(this,name);if(descriptor)
Object.defineProperty(result,name,descriptor);}
return result;}
function processObjectFragment(arrayFragment,wasThrown)
{if(!arrayFragment||wasThrown)
return;arrayFragment.getOwnProperties(processProperties.bind(this));}
function processProperties(properties,internalProperties)
{if(!properties)
return;properties.sort(WebInspector.ObjectPropertiesSection.CompareProperties);for(var i=0;i<properties.length;++i){properties[i].parentObject=this._object;var childTreeElement=new WebInspector.ObjectPropertyTreeElement(properties[i]);childTreeElement._readOnly=true;treeNode.appendChild(childTreeElement);}}}
WebInspector.ArrayGroupingTreeElement.prototype={onpopulate:function()
{if(this._propertyCount>=WebInspector.ArrayGroupingTreeElement._bucketThreshold){WebInspector.ArrayGroupingTreeElement._populateRanges(this,this._object,this._fromIndex,this._toIndex,false);return;}
WebInspector.ArrayGroupingTreeElement._populateAsFragment(this,this._object,this._fromIndex,this._toIndex);},onattach:function()
{this.listItemElement.classList.add("object-properties-section-name");},__proto__:TreeElement.prototype}
WebInspector.ObjectPropertyPrompt=function()
{WebInspector.TextPrompt.call(this,WebInspector.ExecutionContextSelector.completionsForTextPromptInCurrentContext);this.setSuggestBoxEnabled(true);}
WebInspector.ObjectPropertyPrompt.prototype={__proto__:WebInspector.TextPrompt.prototype}
WebInspector.ObjectPropertiesSection.createNameElement=function(name)
{var nameElement=createElementWithClass("span","name");if(/^\s|\s$|^$|\n/.test(name))
nameElement.createTextChildren("\"",name.replace(/\n/g,"\u21B5"),"\"");else
nameElement.textContent=name;return nameElement;}
WebInspector.ObjectPropertiesSection.valueTextForFunctionDescription=function(description)
{var matches=/function\s([^)]*)/.exec(description);if(!matches){matches=/[^(]*(\([^)]*)/.exec(description);}
var match=matches?matches[1]:null;return match?match.replace(/\n/g," ")+")":(description||"");}
WebInspector.ObjectPropertiesSection.createValueElementWithCustomSupport=function(value,wasThrown,parentElement)
{if(value.customPreview()){var result=(new WebInspector.CustomPreviewComponent(value)).element;result.classList.add("object-properties-section-custom-section");return result}
return WebInspector.ObjectPropertiesSection.createValueElement(value,wasThrown,parentElement);}
WebInspector.ObjectPropertiesSection.createValueElement=function(value,wasThrown,parentElement)
{var valueElement=createElementWithClass("span","value");var type=value.type;var subtype=value.subtype;var description=value.description;var prefix;var valueText;var suffix;if(wasThrown){prefix="[Exception: ";valueText=description;suffix="]";}else if(type==="string"&&typeof description==="string"){prefix="\"";valueText=description.replace(/\n/g,"\u21B5");suffix="\"";}else if(type==="function"){valueText=WebInspector.ObjectPropertiesSection.valueTextForFunctionDescription(description);}else if(type!=="object"||subtype!=="node"){valueText=description;}
if(type!=="number"||valueText.indexOf("e")===-1){valueElement.setTextContentTruncatedIfNeeded(valueText||"");if(prefix)
valueElement.insertBefore(createTextNode(prefix),valueElement.firstChild);if(suffix)
valueElement.createTextChild(suffix);}else{var numberParts=valueText.split("e");var mantissa=valueElement.createChild("span","object-value-scientific-notation-mantissa");mantissa.textContent=numberParts[0];var exponent=valueElement.createChild("span","object-value-scientific-notation-exponent");exponent.textContent="e"+numberParts[1];valueElement.classList.add("object-value-scientific-notation-number");if(parentElement)
parentElement.classList.add("hbox");}
if(wasThrown)
valueElement.classList.add("error");if(subtype||type)
valueElement.classList.add("object-value-"+(subtype||type));if(type==="object"&&subtype==="node"&&description){WebInspector.DOMPresentationUtils.createSpansForNodeTitle(valueElement,description);valueElement.addEventListener("click",mouseClick,false);valueElement.addEventListener("mousemove",mouseMove,false);valueElement.addEventListener("mouseleave",mouseLeave,false);}else{valueElement.title=description||"";}
function mouseMove()
{WebInspector.DOMModel.highlightObjectAsDOMNode(value);}
function mouseLeave()
{WebInspector.DOMModel.hideDOMNodeHighlight();}
function mouseClick(event)
{WebInspector.Revealer.reveal(value);event.consume(true);}
return valueElement;}
WebInspector.ObjectPropertiesSection.formatObjectAsFunction=function(func,element,linkify,includePreview)
{func.functionDetails(didGetDetails);function didGetDetails(response)
{if(!response){var valueText=WebInspector.ObjectPropertiesSection.valueTextForFunctionDescription(func.description);element.createTextChild(valueText);return;}
if(linkify&&response&&response.location){var anchor=createElement("span");element.classList.add("linkified");element.appendChild(anchor);element.addEventListener("click",WebInspector.Revealer.reveal.bind(WebInspector.Revealer,response.location,undefined));element=anchor;}
var text=func.description.substring(0,200);if(includePreview){element.textContent=text.replace(/^function /,"")+(func.description.length>200?"\u2026":"");return;}
self.runtime.instancePromise(WebInspector.TokenizerFactory).then(processTokens);var params=null;var functionName=response?response.functionName:"";function processTokens(tokenizerFactory)
{var tokenize=tokenizerFactory.createTokenizer("text/javascript");tokenize(text,processToken);element.textContent=(functionName||"anonymous")+"("+(params||[]).join(", ")+")";}
var doneProcessing=false;function processToken(token,tokenType,column,newColumn)
{if(!params&&tokenType==="js-def"&&!functionName)
functionName=token;doneProcessing=doneProcessing||token===")";if(doneProcessing)
return;if(token==="("){params=[];return;}
if(params&&tokenType==="js-def")
params.push(token);}}}
WebInspector.ObjectPropertiesSectionExpandController=function()
{this._expandedProperties=new Set();}
WebInspector.ObjectPropertiesSectionExpandController._cachedPathSymbol=Symbol("cachedPath");WebInspector.ObjectPropertiesSectionExpandController._treeOutlineId=Symbol("treeOutlineId");WebInspector.ObjectPropertiesSectionExpandController.prototype={watchSection:function(id,section)
{section.addEventListener(TreeOutline.Events.ElementAttached,this._elementAttached,this);section.addEventListener(TreeOutline.Events.ElementExpanded,this._elementExpanded,this);section.addEventListener(TreeOutline.Events.ElementCollapsed,this._elementCollapsed,this);section[WebInspector.ObjectPropertiesSectionExpandController._treeOutlineId]=id;if(this._expandedProperties.has(id))
section.expand();},stopWatchSectionsWithId:function(id)
{for(var property of this._expandedProperties){if(property.startsWith(id+":"))
this._expandedProperties.delete(property);}},_elementAttached:function(event)
{var element=(event.data);if(element.isExpandable()&&this._expandedProperties.has(this._propertyPath(element)))
element.expand();},_elementExpanded:function(event)
{var element=(event.data);this._expandedProperties.add(this._propertyPath(element));},_elementCollapsed:function(event)
{var element=(event.data);this._expandedProperties.delete(this._propertyPath(element));},_propertyPath:function(treeElement)
{var cachedPropertyPath=treeElement[WebInspector.ObjectPropertiesSectionExpandController._cachedPathSymbol];if(cachedPropertyPath)
return cachedPropertyPath;var current=treeElement;var rootElement=treeElement.treeOutline.objectTreeElement();var result;while(current!==rootElement){result=current.property.name+(result?"."+result:"");current=current.parent;}
var treeOutlineId=treeElement.treeOutline[WebInspector.ObjectPropertiesSectionExpandController._treeOutlineId];result=treeOutlineId+(result?":"+result:"");treeElement[WebInspector.ObjectPropertiesSectionExpandController._cachedPathSymbol]=result;return result;}};WebInspector.RemoteObjectPreviewFormatter=function()
{}
WebInspector.RemoteObjectPreviewFormatter.prototype={appendObjectPreview:function(parentElement,preview)
{var description=preview.description;if(preview.type!=="object"||preview.subtype==="null"){parentElement.appendChild(this.renderPropertyPreview(preview.type,preview.subtype,description));return true;}
if(description&&preview.subtype!=="array"){var text=preview.subtype?description:this._abbreviateFullQualifiedClassName(description);parentElement.createTextChildren(text," ");}
if(preview.entries)
return this._appendEntriesPreview(parentElement,preview);return this._appendPropertiesPreview(parentElement,preview);},_abbreviateFullQualifiedClassName:function(description)
{var abbreviatedDescription=description.split(".");for(var i=0;i<abbreviatedDescription.length-1;++i)
abbreviatedDescription[i]=abbreviatedDescription[i].trimMiddle(3);return abbreviatedDescription.join(".");},_appendPropertiesPreview:function(parentElement,preview)
{var isArray=preview.subtype==="array";var arrayLength=WebInspector.RemoteObject.arrayLength(preview);var properties=preview.properties;if(isArray)
properties=properties.slice().stableSort(compareIndexesFirst);function compareIndexesFirst(a,b)
{var index1=toArrayIndex(a.name);var index2=toArrayIndex(b.name);if(index1<0)
return index2<0?0:1;return index2<0?-1:index1-index2;}
function toArrayIndex(name)
{var index=name>>>0;if(String(index)===name&&index<arrayLength)
return index;return-1;}
parentElement.createTextChild(isArray?"[":"{");for(var i=0;i<properties.length;++i){if(i>0)
parentElement.createTextChild(", ");var property=properties[i];var name=property.name;if(!isArray||name!=i||i>=arrayLength){if(/^\s|\s$|^$|\n/.test(name))
parentElement.createChild("span","name").createTextChildren("\"",name.replace(/\n/g,"\u21B5"),"\"");else
parentElement.createChild("span","name").textContent=name;parentElement.createTextChild(": ");}
parentElement.appendChild(this._renderPropertyPreviewOrAccessor([property]));}
if(preview.overflow)
parentElement.createChild("span").textContent="\u2026";parentElement.createTextChild(isArray?"]":"}");return preview.lossless;},_appendEntriesPreview:function(parentElement,preview)
{var lossless=preview.lossless&&!preview.properties.length;parentElement.createTextChild("{");for(var i=0;i<preview.entries.length;++i){if(i>0)
parentElement.createTextChild(", ");var entry=preview.entries[i];if(entry.key){this.appendObjectPreview(parentElement,entry.key);parentElement.createTextChild(" => ");}
this.appendObjectPreview(parentElement,entry.value);}
if(preview.overflow)
parentElement.createChild("span").textContent="\u2026";parentElement.createTextChild("}");return lossless;},_renderPropertyPreviewOrAccessor:function(propertyPath)
{var property=propertyPath.peekLast();return this.renderPropertyPreview(property.type,(property.subtype),property.value);},renderPropertyPreview:function(type,subtype,description)
{var span=createElementWithClass("span","object-value-"+(subtype||type));description=description||"";if(type==="function"){span.textContent="function";return span;}
if(type==="object"&&subtype==="node"&&description){span.classList.add("object-value-preview-node");WebInspector.DOMPresentationUtils.createSpansForNodeTitle(span,description);return span;}
if(type==="string"){span.createTextChildren("\"",description.replace(/\n/g,"\u21B5"),"\"");return span;}
if(type==="object"&&!subtype){span.textContent=this._abbreviateFullQualifiedClassName(description);return span;}
span.textContent=description;return span;}};WebInspector.ShortcutsScreen=function()
{this._sections={};}
WebInspector.ShortcutsScreen.prototype={section:function(name)
{var section=this._sections[name];if(!section)
this._sections[name]=section=new WebInspector.ShortcutsSection(name);return section;},createShortcutsTabView:function()
{var orderedSections=[];for(var section in this._sections)
orderedSections.push(this._sections[section]);function compareSections(a,b)
{return a.order-b.order;}
orderedSections.sort(compareSections);var widget=new WebInspector.Widget();widget.element.className="settings-tab-container";widget.element.createChild("header").createChild("h3").createTextChild(WebInspector.UIString("Shortcuts"));var scrollPane=widget.element.createChild("div","help-container-wrapper");var container=scrollPane.createChild("div");container.className="help-content help-container";for(var i=0;i<orderedSections.length;++i)
orderedSections[i].renderSection(container);var note=scrollPane.createChild("p","help-footnote");note.appendChild(WebInspector.linkifyDocumentationURLAsNode("iterate/inspect-styles/shortcuts",WebInspector.UIString("Full list of DevTools keyboard shortcuts and gestures")));return widget;}}
WebInspector.shortcutsScreen;WebInspector.ShortcutsSection=function(name)
{this.name=name;this._lines=([]);this.order=++WebInspector.ShortcutsSection._sequenceNumber;};WebInspector.ShortcutsSection._sequenceNumber=0;WebInspector.ShortcutsSection.prototype={addKey:function(key,description)
{this._addLine(this._renderKey(key),description);},addRelatedKeys:function(keys,description)
{this._addLine(this._renderSequence(keys,"/"),description);},addAlternateKeys:function(keys,description)
{this._addLine(this._renderSequence(keys,WebInspector.UIString("or")),description);},_addLine:function(keyElement,description)
{this._lines.push({key:keyElement,text:description});},renderSection:function(container)
{var parent=container.createChild("div","help-block");var headLine=parent.createChild("div","help-line");headLine.createChild("div","help-key-cell");headLine.createChild("div","help-section-title help-cell").textContent=this.name;for(var i=0;i<this._lines.length;++i){var line=parent.createChild("div","help-line");var keyCell=line.createChild("div","help-key-cell");keyCell.appendChild(this._lines[i].key);keyCell.appendChild(this._createSpan("help-key-delimiter",":"));line.createChild("div","help-cell").textContent=this._lines[i].text;}},_renderSequence:function(sequence,delimiter)
{var delimiterSpan=this._createSpan("help-key-delimiter",delimiter);return this._joinNodes(sequence.map(this._renderKey.bind(this)),delimiterSpan);},_renderKey:function(key)
{var keyName=key.name;var plus=this._createSpan("help-combine-keys","+");return this._joinNodes(keyName.split(" + ").map(this._createSpan.bind(this,"help-key")),plus);},_createSpan:function(className,textContent)
{var node=createElement("span");node.className=className;node.textContent=textContent;return node;},_joinNodes:function(nodes,delimiter)
{var result=createDocumentFragment();for(var i=0;i<nodes.length;++i){if(i>0)
result.appendChild(delimiter.cloneNode(true));result.appendChild(nodes[i]);}
return result;}}
WebInspector.ShortcutsScreen.registerShortcuts=function()
{var elementsSection=WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Panel"));var navigate=WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateUp.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateDown);elementsSection.addRelatedKeys(navigate,WebInspector.UIString("Navigate elements"));var expandCollapse=WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Expand.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Collapse);elementsSection.addRelatedKeys(expandCollapse,WebInspector.UIString("Expand/collapse"));elementsSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.EditAttribute,WebInspector.UIString("Edit attribute"));elementsSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.HideElement,WebInspector.UIString("Hide element"));elementsSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.ToggleEditAsHTML,WebInspector.UIString("Toggle edit as HTML"));var stylesPaneSection=WebInspector.shortcutsScreen.section(WebInspector.UIString("Styles Pane"));var nextPreviousProperty=WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NextProperty.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.PreviousProperty);stylesPaneSection.addRelatedKeys(nextPreviousProperty,WebInspector.UIString("Next/previous property"));stylesPaneSection.addRelatedKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementValue,WebInspector.UIString("Increment value"));stylesPaneSection.addRelatedKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementValue,WebInspector.UIString("Decrement value"));stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy10,WebInspector.UIString("Increment by %f",10));stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy10,WebInspector.UIString("Decrement by %f",10));stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy100,WebInspector.UIString("Increment by %f",100));stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy100,WebInspector.UIString("Decrement by %f",100));stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy01,WebInspector.UIString("Increment by %f",0.1));stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy01,WebInspector.UIString("Decrement by %f",0.1));var section=WebInspector.shortcutsScreen.section(WebInspector.UIString("Debugger"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("debugger.toggle-pause"),WebInspector.UIString("Pause/ Continue"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("debugger.step-over"),WebInspector.UIString("Step over"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("debugger.step-into"),WebInspector.UIString("Step into"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("debugger.step-out"),WebInspector.UIString("Step out"));if(Runtime.experiments.isEnabled("stepIntoAsync"))
section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("debugger.step-into"),WebInspector.UIString("Step into"));var nextAndPrevFrameKeys=WebInspector.ShortcutsScreen.SourcesPanelShortcuts.NextCallFrame.concat(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame);section.addRelatedKeys(nextAndPrevFrameKeys,WebInspector.UIString("Next/previous call frame"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.EvaluateSelectionInConsole,WebInspector.UIString("Evaluate selection in console"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.AddSelectionToWatch,WebInspector.UIString("Add selection to watch"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint,WebInspector.UIString("Toggle breakpoint"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("debugger.toggle-breakpoints-active"),WebInspector.UIString("Toggle all breakpoints"));section=WebInspector.shortcutsScreen.section(WebInspector.UIString("Text Editor"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToMember,WebInspector.UIString("Go to member"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleAutocompletion,WebInspector.UIString("Autocompletion"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToLine,WebInspector.UIString("Go to line"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation,WebInspector.UIString("Jump to previous editing location"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation,WebInspector.UIString("Jump to next editing location"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleComment,WebInspector.UIString("Toggle comment"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByOne,WebInspector.UIString("Increment CSS unit by 1"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByOne,WebInspector.UIString("Decrement CSS unit by 1"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByTen,WebInspector.UIString("Increment CSS unit by 10"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByTen,WebInspector.UIString("Decrement CSS unit by 10"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.SelectNextOccurrence,WebInspector.UIString("Select next occurrence"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.SoftUndo,WebInspector.UIString("Soft undo"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GotoMatchingBracket,WebInspector.UIString("Go to matching bracket"));section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab,WebInspector.UIString("Close editor tab"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("sources.switch-file"),WebInspector.UIString("Switch between files with the same name and different extensions."));section=WebInspector.shortcutsScreen.section(WebInspector.UIString("Timeline Panel"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("timeline.toggle-recording"),WebInspector.UIString("Start/stop recording"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("main.reload"),WebInspector.UIString("Record page reload"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("timeline.save-to-file"),WebInspector.UIString("Save timeline data"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("timeline.load-from-file"),WebInspector.UIString("Load timeline data"));section.addRelatedKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("timeline.jump-to-previous-frame").concat(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("timeline.jump-to-next-frame")),WebInspector.UIString("Jump to previous/next frame"));section=WebInspector.shortcutsScreen.section(WebInspector.UIString("Profiles Panel"));section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForAction("profiler.toggle-recording"),WebInspector.UIString("Start/stop recording"));if(Runtime.experiments.isEnabled("layersPanel")){section=WebInspector.shortcutsScreen.section(WebInspector.UIString("Layers Panel"));section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts.ResetView,WebInspector.UIString("Reset view"));section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts.PanMode,WebInspector.UIString("Switch to pan mode"));section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts.RotateMode,WebInspector.UIString("Switch to rotate mode"));section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts.TogglePanRotate,WebInspector.UIString("Temporarily toggle pan/rotate mode while held"));section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts.ZoomIn,WebInspector.UIString("Zoom in"));section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts.ZoomOut,WebInspector.UIString("Zoom out"));section.addRelatedKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts.Up.concat(WebInspector.ShortcutsScreen.LayersPanelShortcuts.Down),WebInspector.UIString("Pan or rotate up/down"));section.addRelatedKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts.Left.concat(WebInspector.ShortcutsScreen.LayersPanelShortcuts.Right),WebInspector.UIString("Pan or rotate left/right"));}}
WebInspector.ShortcutsScreen.ElementsPanelShortcuts={NavigateUp:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Up)],NavigateDown:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Down)],Expand:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Right)],Collapse:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Left)],EditAttribute:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Enter)],HideElement:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.H)],ToggleEditAsHTML:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F2)],NextProperty:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Tab)],PreviousProperty:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Tab,WebInspector.KeyboardShortcut.Modifiers.Shift)],IncrementValue:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Up)],DecrementValue:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Down)],IncrementBy10:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.PageUp),WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Up,WebInspector.KeyboardShortcut.Modifiers.Shift)],DecrementBy10:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.PageDown),WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Down,WebInspector.KeyboardShortcut.Modifiers.Shift)],IncrementBy100:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.PageUp,WebInspector.KeyboardShortcut.Modifiers.Shift)],DecrementBy100:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.PageDown,WebInspector.KeyboardShortcut.Modifiers.Shift)],IncrementBy01:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Up,WebInspector.KeyboardShortcut.Modifiers.Alt)],DecrementBy01:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Down,WebInspector.KeyboardShortcut.Modifiers.Alt)]};WebInspector.ShortcutsScreen.SourcesPanelShortcuts={SelectNextOccurrence:[WebInspector.KeyboardShortcut.makeDescriptor("d",WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)],SoftUndo:[WebInspector.KeyboardShortcut.makeDescriptor("u",WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)],GotoMatchingBracket:[WebInspector.KeyboardShortcut.makeDescriptor("m",WebInspector.KeyboardShortcut.Modifiers.Ctrl)],ToggleAutocompletion:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Space,WebInspector.KeyboardShortcut.Modifiers.Ctrl)],IncreaseCSSUnitByOne:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Up,WebInspector.KeyboardShortcut.Modifiers.Alt)],DecreaseCSSUnitByOne:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Down,WebInspector.KeyboardShortcut.Modifiers.Alt)],IncreaseCSSUnitByTen:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.PageUp,WebInspector.KeyboardShortcut.Modifiers.Alt)],DecreaseCSSUnitByTen:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.PageDown,WebInspector.KeyboardShortcut.Modifiers.Alt)],EvaluateSelectionInConsole:[WebInspector.KeyboardShortcut.makeDescriptor("e",WebInspector.KeyboardShortcut.Modifiers.Shift|WebInspector.KeyboardShortcut.Modifiers.Ctrl)],AddSelectionToWatch:[WebInspector.KeyboardShortcut.makeDescriptor("a",WebInspector.KeyboardShortcut.Modifiers.Shift|WebInspector.KeyboardShortcut.Modifiers.Ctrl)],GoToMember:[WebInspector.KeyboardShortcut.makeDescriptor("p",WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta|WebInspector.KeyboardShortcut.Modifiers.Shift)],GoToLine:[WebInspector.KeyboardShortcut.makeDescriptor("g",WebInspector.KeyboardShortcut.Modifiers.Ctrl)],ToggleBreakpoint:[WebInspector.KeyboardShortcut.makeDescriptor("b",WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)],NextCallFrame:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Period,WebInspector.KeyboardShortcut.Modifiers.Ctrl)],PrevCallFrame:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Comma,WebInspector.KeyboardShortcut.Modifiers.Ctrl)],ToggleComment:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Slash,WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)],JumpToPreviousLocation:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Minus,WebInspector.KeyboardShortcut.Modifiers.Alt)],JumpToNextLocation:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Plus,WebInspector.KeyboardShortcut.Modifiers.Alt)],CloseEditorTab:[WebInspector.KeyboardShortcut.makeDescriptor("w",WebInspector.KeyboardShortcut.Modifiers.Alt)],Save:[WebInspector.KeyboardShortcut.makeDescriptor("s",WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)],SaveAll:[WebInspector.KeyboardShortcut.makeDescriptor("s",WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta|WebInspector.KeyboardShortcut.Modifiers.ShiftOrOption)],};WebInspector.ShortcutsScreen.LayersPanelShortcuts={ResetView:[WebInspector.KeyboardShortcut.makeDescriptor("0")],PanMode:[WebInspector.KeyboardShortcut.makeDescriptor("x")],RotateMode:[WebInspector.KeyboardShortcut.makeDescriptor("v")],TogglePanRotate:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Shift)],ZoomIn:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Plus,WebInspector.KeyboardShortcut.Modifiers.Shift),WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.NumpadPlus)],ZoomOut:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Minus,WebInspector.KeyboardShortcut.Modifiers.Shift),WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.NumpadMinus)],Up:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Up),WebInspector.KeyboardShortcut.makeDescriptor("w")],Down:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Down),WebInspector.KeyboardShortcut.makeDescriptor("s")],Left:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Left),WebInspector.KeyboardShortcut.makeDescriptor("a")],Right:[WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.Right),WebInspector.KeyboardShortcut.makeDescriptor("d")]};WebInspector.FrameworkEventListenersObject;WebInspector.EventListenerObjectInInspectedPage;WebInspector.EventListener.frameworkEventListeners=function(object)
{if(!object.target().isPage()){return Promise.resolve(({eventListeners:[],internalHandlers:null}));}
var listenersResult=({eventListeners:[]});return object.callFunctionPromise(frameworkEventListeners,undefined).then(assertCallFunctionResult).then(getOwnProperties).then(createEventListeners).then(returnResult).catchException(listenersResult);function getOwnProperties(object)
{return object.getOwnPropertiesPromise();}
function createEventListeners(result)
{if(!result.properties)
throw new Error("Object properties is empty");var promises=[];for(var property of result.properties){if(property.name==="eventListeners"&&property.value)
promises.push(convertToEventListeners(property.value).then(storeEventListeners));if(property.name==="internalHandlers"&&property.value)
promises.push(convertToInternalHandlers(property.value).then(storeInternalHandlers));if(property.name==="errorString"&&property.value)
printErrorString(property.value);}
return(Promise.all(promises));}
function convertToEventListeners(pageEventListenersObject)
{return WebInspector.RemoteArray.objectAsArray(pageEventListenersObject).map(toEventListener).then(filterOutEmptyObjects);function toEventListener(listenerObject)
{var type;var useCapture;var handler=null;var originalHandler=null;var location=null;var removeFunctionObject=null;var promises=[];promises.push(listenerObject.callFunctionJSONPromise(truncatePageEventListener,undefined).then(storeTruncatedListener));function truncatePageEventListener()
{return{type:this.type,useCapture:this.useCapture};}
function storeTruncatedListener(truncatedListener)
{type=truncatedListener.type;useCapture=truncatedListener.useCapture;}
promises.push(listenerObject.callFunctionPromise(handlerFunction).then(assertCallFunctionResult).then(storeOriginalHandler).then(toTargetFunction).then(storeFunctionWithDetails));function handlerFunction()
{return this.handler;}
function storeOriginalHandler(functionObject)
{originalHandler=functionObject;return originalHandler;}
function storeFunctionWithDetails(functionObject)
{handler=functionObject;return(functionObject.functionDetailsPromise().then(storeFunctionDetails));}
function storeFunctionDetails(functionDetails)
{location=functionDetails?functionDetails.location:null;}
promises.push(listenerObject.callFunctionPromise(getRemoveFunction).then(assertCallFunctionResult).then(storeRemoveFunction));function getRemoveFunction()
{return this.remove;}
function storeRemoveFunction(functionObject)
{if(functionObject.type!=="function")
return;removeFunctionObject=functionObject;}
return Promise.all(promises).then(createEventListener).catchException((null));function createEventListener()
{if(!location)
throw new Error("Empty event listener's location");return new WebInspector.EventListener(handler._target,type,useCapture,handler,originalHandler,location,removeFunctionObject,"frameworkUser");}}}
function convertToInternalHandlers(pageInternalHandlersObject)
{return WebInspector.RemoteArray.objectAsArray(pageInternalHandlersObject).map(toTargetFunction).then(WebInspector.RemoteArray.createFromRemoteObjects);}
function toTargetFunction(functionObject)
{return WebInspector.RemoteFunction.objectAsFunction(functionObject).targetFunction();}
function storeEventListeners(eventListeners)
{listenersResult.eventListeners=eventListeners;}
function storeInternalHandlers(internalHandlers)
{listenersResult.internalHandlers=internalHandlers;}
function printErrorString(errorString)
{WebInspector.console.error(errorString.value);}
function returnResult()
{return listenersResult;}
function assertCallFunctionResult(result)
{if(result.wasThrown||!result.object)
throw new Error("Exception in callFunction or empty result");return result.object;}
function filterOutEmptyObjects(objects)
{return objects.filter(filterOutEmpty);function filterOutEmpty(object)
{return!!object;}}
function frameworkEventListeners()
{var errorLines=[];var eventListeners=[];var internalHandlers=[];var fetchers=[jQueryFetcher];try{if(self.devtoolsFrameworkEventListeners&&isArrayLike(self.devtoolsFrameworkEventListeners))
fetchers=fetchers.concat(self.devtoolsFrameworkEventListeners);}catch(e){errorLines.push("devtoolsFrameworkEventListeners call produced error: "+toString(e));}
for(var i=0;i<fetchers.length;++i){try{var fetcherResult=fetchers[i](this);if(fetcherResult.eventListeners&&isArrayLike(fetcherResult.eventListeners)){eventListeners=eventListeners.concat(fetcherResult.eventListeners.map(checkEventListener).filter(nonEmptyObject));}
if(fetcherResult.internalHandlers&&isArrayLike(fetcherResult.internalHandlers))
internalHandlers=internalHandlers.concat(fetcherResult.internalHandlers.map(checkInternalHandler).filter(nonEmptyObject));}catch(e){errorLines.push("fetcher call produced error: "+toString(e));}}
var result={eventListeners:eventListeners};if(internalHandlers.length)
result.internalHandlers=internalHandlers;if(errorLines.length){var errorString="Framework Event Listeners API Errors:\n\t"+errorLines.join("\n\t");errorString=errorString.substr(0,errorString.length-1);result.errorString=errorString;}
return result;function isArrayLike(obj)
{if(!obj||typeof obj!=="object")
return false;try{if(typeof obj.splice==="function"){var len=obj.length;return typeof len==="number"&&(len>>>0===len&&(len>0||1/len>0));}}catch(e){}
return false;}
function checkEventListener(eventListener)
{try{var errorString="";if(!eventListener)
errorString+="empty event listener, ";var type=eventListener.type;if(!type||(typeof type!=="string"))
errorString+="event listener's type isn't string or empty, ";var useCapture=eventListener.useCapture;if(typeof useCapture!=="boolean")
errorString+="event listener's useCapture isn't boolean or undefined, ";var handler=eventListener.handler;if(!handler||(typeof handler!=="function"))
errorString+="event listener's handler isn't a function or empty, ";var remove=eventListener.remove;if(remove&&(typeof remove!=="function"))
errorString+="event listener's remove isn't a function, ";if(!errorString){return{type:type,useCapture:useCapture,handler:handler,remove:remove};}else{errorLines.push(errorString.substr(0,errorString.length-2));return null;}}catch(e){errorLines.push(toString(e));return null;}}
function checkInternalHandler(handler)
{if(handler&&(typeof handler==="function"))
return handler;errorLines.push("internal handler isn't a function or empty");return null;}
function toString(obj)
{try{return""+obj;}catch(e){return"<error>";}}
function nonEmptyObject(obj)
{return!!obj;}
function jQueryFetcher(node)
{if(!node||!(node instanceof Node))
return{eventListeners:[]};var jQuery=(window["jQuery"]);if(!jQuery||!jQuery.fn)
return{eventListeners:[]};var jQueryFunction=(jQuery);var data=jQuery._data||jQuery.data;var eventListeners=[];var internalHandlers=[];if(typeof data==="function"){var events=data(node,"events");for(var type in events){for(var key in events[type]){var frameworkListener=events[type][key];if(typeof frameworkListener==="object"||typeof frameworkListener==="function"){var listener={handler:frameworkListener.handler||frameworkListener,useCapture:true,type:type};listener.remove=jQueryRemove.bind(node,frameworkListener.selector);eventListeners.push(listener);}}}
var nodeData=data(node);if(nodeData&&typeof nodeData.handle==="function")
internalHandlers.push(nodeData.handle);}
var entry=jQueryFunction(node)[0];if(entry){var entryEvents=entry["$events"];for(var type in entryEvents){var events=entryEvents[type];for(var key in events){if(typeof events[key]==="function"){var listener={handler:events[key],useCapture:true,type:type};eventListeners.push(listener);}}}
if(entry&&entry["$handle"])
internalHandlers.push(entry["$handle"]);}
return{eventListeners:eventListeners,internalHandlers:internalHandlers};}
function jQueryRemove(selector,type,handler)
{if(!this||!(this instanceof Node))
return;var node=(this);var jQuery=(window["jQuery"]);if(!jQuery||!jQuery.fn)
return;var jQueryFunction=(jQuery);jQueryFunction(node).off(type,selector,handler);}}};WebInspector.EventListenersResult;WebInspector.EventListenersView=function(element)
{this._element=element;this._treeOutline=new TreeOutlineInShadow("event-listener-tree");this._treeOutline.registerRequiredCSS("components/objectValue.css");this._treeOutline.registerRequiredCSS("components/eventListenersView.css");this._treeOutline.setComparator(WebInspector.EventListenersTreeElement.comparator);this._treeOutline.element.classList.add("monospace");this._element.appendChild(this._treeOutline.element)
this._emptyHolder=createElementWithClass("div","info");this._emptyHolder.textContent=WebInspector.UIString("No Event Listeners");this._linkifier=new WebInspector.Linkifier();this._treeItemMap=new Map();}
WebInspector.EventListenersView.prototype={addObjects:function(objects)
{this.reset();var promises=[];for(var object of objects)
promises.push(this._addObject(object));return Promise.all(promises).then(this.addEmptyHolderIfNeeded.bind(this)).then(this._eventListenersArrivedForTest.bind(this));},_addObject:function(object)
{var eventListeners=null;var frameworkEventListenersObject=null;var promises=[];promises.push(object.eventListeners().then(storeEventListeners));promises.push(WebInspector.EventListener.frameworkEventListeners(object).then(storeFrameworkEventListenersObject));return Promise.all(promises).then(markInternalEventListeners).then(addEventListeners.bind(this));function storeEventListeners(result)
{eventListeners=result;}
function storeFrameworkEventListenersObject(result)
{frameworkEventListenersObject=result;}
function markInternalEventListeners()
{if(!eventListeners||!frameworkEventListenersObject.internalHandlers)
return Promise.resolve(undefined);return frameworkEventListenersObject.internalHandlers.object().callFunctionJSONPromise(isInternalEventListener,eventListeners.map(handlerArgument)).then(setIsInternal);function handlerArgument(listener)
{return WebInspector.RemoteObject.toCallArgument(listener.handler());}
function isInternalEventListener()
{var isInternal=[];var internalHandlersSet=new Set(this);for(var handler of arguments)
isInternal.push(internalHandlersSet.has(handler));return isInternal;}
function setIsInternal(isInternal)
{for(var i=0;i<eventListeners.length;++i){if(isInternal[i])
eventListeners[i].setListenerType("frameworkInternal");}}}
function addEventListeners()
{this._addObjectEventListeners(object,eventListeners);this._addObjectEventListeners(object,frameworkEventListenersObject.eventListeners);}},_addObjectEventListeners:function(object,eventListeners)
{if(!eventListeners)
return;for(var eventListener of eventListeners){var treeItem=this._getOrCreateTreeElementForType(eventListener.type());treeItem.addObjectEventListener(eventListener,object);}},showFrameworkListeners:function(showFramework)
{var eventTypes=this._treeOutline.rootElement().children();for(var eventType of eventTypes){var hiddenEventType=true;for(var listenerElement of eventType.children()){var listenerType=listenerElement.eventListener().listenerType();var hidden=false;if(listenerType==="frameworkUser"&&!showFramework)
hidden=true;if(listenerType==="frameworkInternal"&&showFramework)
hidden=true;listenerElement.hidden=hidden;hiddenEventType=hiddenEventType&&hidden;}
eventType.hidden=hiddenEventType;}},_getOrCreateTreeElementForType:function(type)
{var treeItem=this._treeItemMap.get(type);if(!treeItem){treeItem=new WebInspector.EventListenersTreeElement(type,this._linkifier);this._treeItemMap.set(type,treeItem);treeItem.hidden=true;this._treeOutline.appendChild(treeItem);}
this._emptyHolder.remove();return treeItem;},addEmptyHolderIfNeeded:function()
{var allHidden=true;for(var eventType of this._treeOutline.rootElement().children()){eventType.hidden=!eventType.firstChild();allHidden=allHidden&&eventType.hidden;}
if(allHidden&&!this._emptyHolder.parentNode)
this._element.appendChild(this._emptyHolder);},reset:function()
{var eventTypes=this._treeOutline.rootElement().children();for(var eventType of eventTypes)
eventType.removeChildren();this._linkifier.reset();},_eventListenersArrivedForTest:function()
{}}
WebInspector.EventListenersTreeElement=function(type,linkifier)
{TreeElement.call(this,type);this.toggleOnClick=true;this.selectable=false;this._linkifier=linkifier;}
WebInspector.EventListenersTreeElement.comparator=function(element1,element2){if(element1.title===element2.title)
return 0;return element1.title>element2.title?1:-1;}
WebInspector.EventListenersTreeElement.prototype={addObjectEventListener:function(eventListener,object)
{var treeElement=new WebInspector.ObjectEventListenerBar(eventListener,object,this._linkifier);this.appendChild((treeElement));},__proto__:TreeElement.prototype}
WebInspector.ObjectEventListenerBar=function(eventListener,object,linkifier)
{TreeElement.call(this,"",true);this._eventListener=eventListener;this.editable=false;this.selectable=false;this._setTitle(object,linkifier);}
WebInspector.ObjectEventListenerBar.prototype={onpopulate:function()
{var properties=[];var eventListener=this._eventListener;var runtimeModel=eventListener.target().runtimeModel;properties.push(runtimeModel.createRemotePropertyFromPrimitiveValue("useCapture",eventListener.useCapture()));if(typeof eventListener.handler()!=="undefined")
properties.push(new WebInspector.RemoteObjectProperty("handler",eventListener.handler()));WebInspector.ObjectPropertyTreeElement.populateWithProperties(this,properties,[],true,null);},_setTitle:function(object,linkifier)
{var title=this.listItemElement.createChild("span");var subtitle=this.listItemElement.createChild("span","event-listener-tree-subtitle");subtitle.appendChild(linkifier.linkifyRawLocation(this._eventListener.location(),this._eventListener.sourceURL()));title.appendChild(WebInspector.ObjectPropertiesSection.createValueElement(object,false));if(this._eventListener.removeFunction()){var deleteButton=title.createChild("span","event-listener-delete-button");deleteButton.textContent=WebInspector.UIString("Remove");deleteButton.title=WebInspector.UIString("Delete event listener");deleteButton.addEventListener("click",removeListener.bind(this),false);title.appendChild(deleteButton);}
function removeListener(event)
{event.consume();this._removeListenerBar();this._eventListener.remove();}},_removeListenerBar:function()
{var parent=this.parent;parent.removeChild(this);if(!parent.childCount()){parent.parent.removeChild(parent);return;}
var allHidden=true;for(var i=0;i<parent.childCount();++i)
if(!parent.childAt(i).hidden)
allHidden=false;parent.hidden=allHidden;},eventListener:function()
{return this._eventListener;},__proto__:TreeElement.prototype};WebInspector.reload=function()
{if(WebInspector.dockController.canDock()&&WebInspector.dockController.dockSide()===WebInspector.DockController.State.Undocked)
InspectorFrontendHost.setIsDocked(true,function(){});window.location.reload();};function defineCommonExtensionSymbols(apiPrivate)
{if(!apiPrivate.audits)
apiPrivate.audits={};apiPrivate.audits.Severity={Info:"info",Warning:"warning",Severe:"severe"};if(!apiPrivate.panels)
apiPrivate.panels={};apiPrivate.panels.SearchAction={CancelSearch:"cancelSearch",PerformSearch:"performSearch",NextSearchResult:"nextSearchResult",PreviousSearchResult:"previousSearchResult"};apiPrivate.Events={AuditStarted:"audit-started-",ButtonClicked:"button-clicked-",PanelObjectSelected:"panel-objectSelected-",NetworkRequestFinished:"network-request-finished",OpenResource:"open-resource",PanelSearch:"panel-search-",ResourceAdded:"resource-added",ResourceContentCommitted:"resource-content-committed",ViewShown:"view-shown-",ViewHidden:"view-hidden-"};apiPrivate.Commands={AddAuditCategory:"addAuditCategory",AddAuditResult:"addAuditResult",AddRequestHeaders:"addRequestHeaders",ApplyStyleSheet:"applyStyleSheet",CreatePanel:"createPanel",CreateSidebarPane:"createSidebarPane",CreateToolbarButton:"createToolbarButton",EvaluateOnInspectedPage:"evaluateOnInspectedPage",ForwardKeyboardEvent:"_forwardKeyboardEvent",GetHAR:"getHAR",GetPageResources:"getPageResources",GetRequestContent:"getRequestContent",GetResourceContent:"getResourceContent",InspectedURLChanged:"inspectedURLChanged",OpenResource:"openResource",Reload:"Reload",Subscribe:"subscribe",SetOpenResourceHandler:"setOpenResourceHandler",SetResourceContent:"setResourceContent",SetSidebarContent:"setSidebarContent",SetSidebarHeight:"setSidebarHeight",SetSidebarPage:"setSidebarPage",ShowPanel:"showPanel",StopAuditCategoryRun:"stopAuditCategoryRun",Unsubscribe:"unsubscribe",UpdateAuditProgress:"updateAuditProgress",UpdateButton:"updateButton"};}
function injectedExtensionAPI(injectedScriptId)
{var apiPrivate={};defineCommonExtensionSymbols(apiPrivate);var commands=apiPrivate.Commands;var events=apiPrivate.Events;var userAction=false;function EventSinkImpl(type,customDispatch)
{this._type=type;this._listeners=[];this._customDispatch=customDispatch;}
EventSinkImpl.prototype={addListener:function(callback)
{if(typeof callback!=="function")
throw"addListener: callback is not a function";if(this._listeners.length===0)
extensionServer.sendRequest({command:commands.Subscribe,type:this._type});this._listeners.push(callback);extensionServer.registerHandler("notify-"+this._type,this._dispatch.bind(this));},removeListener:function(callback)
{var listeners=this._listeners;for(var i=0;i<listeners.length;++i){if(listeners[i]===callback){listeners.splice(i,1);break;}}
if(this._listeners.length===0)
extensionServer.sendRequest({command:commands.Unsubscribe,type:this._type});},_fire:function(vararg)
{var listeners=this._listeners.slice();for(var i=0;i<listeners.length;++i)
listeners[i].apply(null,arguments);},_dispatch:function(request)
{if(this._customDispatch)
this._customDispatch.call(this,request);else
this._fire.apply(this,request.arguments);}}
function InspectorExtensionAPI()
{this.audits=new Audits();this.inspectedWindow=new InspectedWindow();this.panels=new Panels();this.network=new Network();defineDeprecatedProperty(this,"webInspector","resources","network");}
function Network()
{function dispatchRequestEvent(message)
{var request=message.arguments[1];request.__proto__=new Request(message.arguments[0]);this._fire(request);}
this.onRequestFinished=new EventSink(events.NetworkRequestFinished,dispatchRequestEvent);defineDeprecatedProperty(this,"network","onFinished","onRequestFinished");this.onNavigated=new EventSink(events.InspectedURLChanged);}
Network.prototype={getHAR:function(callback)
{function callbackWrapper(result)
{var entries=(result&&result.entries)||[];for(var i=0;i<entries.length;++i){entries[i].__proto__=new Request(entries[i]._requestId);delete entries[i]._requestId;}
callback(result);}
extensionServer.sendRequest({command:commands.GetHAR},callback&&callbackWrapper);},addRequestHeaders:function(headers)
{extensionServer.sendRequest({command:commands.AddRequestHeaders,headers:headers,extensionId:window.location.hostname});}}
function RequestImpl(id)
{this._id=id;}
RequestImpl.prototype={getContent:function(callback)
{function callbackWrapper(response)
{callback(response.content,response.encoding);}
extensionServer.sendRequest({command:commands.GetRequestContent,id:this._id},callback&&callbackWrapper);}}
function Panels()
{var panels={elements:new ElementsPanel(),sources:new SourcesPanel(),};function panelGetter(name)
{return panels[name];}
for(var panel in panels)
this.__defineGetter__(panel,panelGetter.bind(null,panel));this.applyStyleSheet=function(styleSheet){extensionServer.sendRequest({command:commands.ApplyStyleSheet,styleSheet:styleSheet});};}
Panels.prototype={create:function(title,icon,page,callback)
{var id="extension-panel-"+extensionServer.nextObjectId();var request={command:commands.CreatePanel,id:id,title:title,icon:icon,page:page};extensionServer.sendRequest(request,callback&&callback.bind(this,new ExtensionPanel(id)));},setOpenResourceHandler:function(callback)
{var hadHandler=extensionServer.hasHandler(events.OpenResource);function callbackWrapper(message)
{userAction=true;try{callback.call(null,new Resource(message.resource),message.lineNumber);}finally{userAction=false;}}
if(!callback)
extensionServer.unregisterHandler(events.OpenResource);else
extensionServer.registerHandler(events.OpenResource,callbackWrapper);if(hadHandler===!callback)
extensionServer.sendRequest({command:commands.SetOpenResourceHandler,"handlerPresent":!!callback});},openResource:function(url,lineNumber,callback)
{extensionServer.sendRequest({command:commands.OpenResource,"url":url,"lineNumber":lineNumber},callback);},get SearchAction()
{return apiPrivate.panels.SearchAction;}}
function ExtensionViewImpl(id)
{this._id=id;function dispatchShowEvent(message)
{var frameIndex=message.arguments[0];if(typeof frameIndex==="number")
this._fire(window.parent.frames[frameIndex]);else
this._fire();}
if(id){this.onShown=new EventSink(events.ViewShown+id,dispatchShowEvent);this.onHidden=new EventSink(events.ViewHidden+id);}}
function PanelWithSidebarImpl(hostPanelName)
{ExtensionViewImpl.call(this,null);this._hostPanelName=hostPanelName;this.onSelectionChanged=new EventSink(events.PanelObjectSelected+hostPanelName);}
PanelWithSidebarImpl.prototype={createSidebarPane:function(title,callback)
{var id="extension-sidebar-"+extensionServer.nextObjectId();var request={command:commands.CreateSidebarPane,panel:this._hostPanelName,id:id,title:title};function callbackWrapper()
{callback(new ExtensionSidebarPane(id));}
extensionServer.sendRequest(request,callback&&callbackWrapper);},__proto__:ExtensionViewImpl.prototype}
function declareInterfaceClass(implConstructor)
{return function()
{var impl={__proto__:implConstructor.prototype};implConstructor.apply(impl,arguments);populateInterfaceClass(this,impl);};}
function defineDeprecatedProperty(object,className,oldName,newName)
{var warningGiven=false;function getter()
{if(!warningGiven){console.warn(className+"."+oldName+" is deprecated. Use "+className+"."+newName+" instead");warningGiven=true;}
return object[newName];}
object.__defineGetter__(oldName,getter);}
function extractCallbackArgument(args)
{var lastArgument=args[args.length-1];return typeof lastArgument==="function"?lastArgument:undefined;}
var AuditCategory=declareInterfaceClass(AuditCategoryImpl);var AuditResult=declareInterfaceClass(AuditResultImpl);var Button=declareInterfaceClass(ButtonImpl);var EventSink=declareInterfaceClass(EventSinkImpl);var ExtensionPanel=declareInterfaceClass(ExtensionPanelImpl);var ExtensionSidebarPane=declareInterfaceClass(ExtensionSidebarPaneImpl);var PanelWithSidebar=declareInterfaceClass(PanelWithSidebarImpl);var Request=declareInterfaceClass(RequestImpl);var Resource=declareInterfaceClass(ResourceImpl);function ElementsPanel()
{PanelWithSidebar.call(this,"elements");}
ElementsPanel.prototype={__proto__:PanelWithSidebar.prototype}
function SourcesPanel()
{PanelWithSidebar.call(this,"sources");}
SourcesPanel.prototype={__proto__:PanelWithSidebar.prototype}
function ExtensionPanelImpl(id)
{ExtensionViewImpl.call(this,id);this.onSearch=new EventSink(events.PanelSearch+id);}
ExtensionPanelImpl.prototype={createStatusBarButton:function(iconPath,tooltipText,disabled)
{var id="button-"+extensionServer.nextObjectId();var request={command:commands.CreateToolbarButton,panel:this._id,id:id,icon:iconPath,tooltip:tooltipText,disabled:!!disabled};extensionServer.sendRequest(request);return new Button(id);},show:function()
{if(!userAction)
return;var request={command:commands.ShowPanel,id:this._id};extensionServer.sendRequest(request);},__proto__:ExtensionViewImpl.prototype}
function ExtensionSidebarPaneImpl(id)
{ExtensionViewImpl.call(this,id);}
ExtensionSidebarPaneImpl.prototype={setHeight:function(height)
{extensionServer.sendRequest({command:commands.SetSidebarHeight,id:this._id,height:height});},setExpression:function(expression,rootTitle,evaluateOptions)
{var request={command:commands.SetSidebarContent,id:this._id,expression:expression,rootTitle:rootTitle,evaluateOnPage:true,};if(typeof evaluateOptions==="object")
request.evaluateOptions=evaluateOptions;extensionServer.sendRequest(request,extractCallbackArgument(arguments));},setObject:function(jsonObject,rootTitle,callback)
{extensionServer.sendRequest({command:commands.SetSidebarContent,id:this._id,expression:jsonObject,rootTitle:rootTitle},callback);},setPage:function(page)
{extensionServer.sendRequest({command:commands.SetSidebarPage,id:this._id,page:page});},__proto__:ExtensionViewImpl.prototype}
function ButtonImpl(id)
{this._id=id;this.onClicked=new EventSink(events.ButtonClicked+id);}
ButtonImpl.prototype={update:function(iconPath,tooltipText,disabled)
{var request={command:commands.UpdateButton,id:this._id,icon:iconPath,tooltip:tooltipText,disabled:!!disabled};extensionServer.sendRequest(request);}};function Audits()
{}
Audits.prototype={addCategory:function(displayName,resultCount)
{var id="extension-audit-category-"+extensionServer.nextObjectId();if(typeof resultCount!=="undefined")
console.warn("Passing resultCount to audits.addCategory() is deprecated. Use AuditResult.updateProgress() instead.");extensionServer.sendRequest({command:commands.AddAuditCategory,id:id,displayName:displayName,resultCount:resultCount});return new AuditCategory(id);}}
function AuditCategoryImpl(id)
{function dispatchAuditEvent(request)
{var auditResult=new AuditResult(request.arguments[0]);try{this._fire(auditResult);}catch(e){console.error("Uncaught exception in extension audit event handler: "+e);auditResult.done();}}
this._id=id;this.onAuditStarted=new EventSink(events.AuditStarted+id,dispatchAuditEvent);}
function AuditResultImpl(id)
{this._id=id;this.createURL=this._nodeFactory.bind(this,"url");this.createSnippet=this._nodeFactory.bind(this,"snippet");this.createText=this._nodeFactory.bind(this,"text");this.createObject=this._nodeFactory.bind(this,"object");this.createNode=this._nodeFactory.bind(this,"node");}
AuditResultImpl.prototype={addResult:function(displayName,description,severity,details)
{if(details&&!(details instanceof AuditResultNode))
details=new AuditResultNode(Array.isArray(details)?details:[details]);var request={command:commands.AddAuditResult,resultId:this._id,displayName:displayName,description:description,severity:severity,details:details};extensionServer.sendRequest(request);},createResult:function()
{return new AuditResultNode(Array.prototype.slice.call(arguments));},updateProgress:function(worked,totalWork)
{extensionServer.sendRequest({command:commands.UpdateAuditProgress,resultId:this._id,progress:worked/totalWork});},done:function()
{extensionServer.sendRequest({command:commands.StopAuditCategoryRun,resultId:this._id});},get Severity()
{return apiPrivate.audits.Severity;},createResourceLink:function(url,lineNumber)
{return{type:"resourceLink",arguments:[url,lineNumber&&lineNumber-1]};},_nodeFactory:function(type)
{return{type:type,arguments:Array.prototype.slice.call(arguments,1)};}}
function AuditResultNode(contents)
{this.contents=contents;this.children=[];this.expanded=false;}
AuditResultNode.prototype={addChild:function()
{var node=new AuditResultNode(Array.prototype.slice.call(arguments));this.children.push(node);return node;}};function InspectedWindow()
{function dispatchResourceEvent(message)
{this._fire(new Resource(message.arguments[0]));}
function dispatchResourceContentEvent(message)
{this._fire(new Resource(message.arguments[0]),message.arguments[1]);}
this.onResourceAdded=new EventSink(events.ResourceAdded,dispatchResourceEvent);this.onResourceContentCommitted=new EventSink(events.ResourceContentCommitted,dispatchResourceContentEvent);}
InspectedWindow.prototype={reload:function(optionsOrUserAgent)
{var options=null;if(typeof optionsOrUserAgent==="object"){options=optionsOrUserAgent;}else if(typeof optionsOrUserAgent==="string"){options={userAgent:optionsOrUserAgent};console.warn("Passing userAgent as string parameter to inspectedWindow.reload() is deprecated. "+"Use inspectedWindow.reload({ userAgent: value}) instead.");}
extensionServer.sendRequest({command:commands.Reload,options:options});},eval:function(expression,evaluateOptions)
{var callback=extractCallbackArgument(arguments);function callbackWrapper(result)
{if(result.isError||result.isException)
callback(undefined,result);else
callback(result.value);}
var request={command:commands.EvaluateOnInspectedPage,expression:expression};if(typeof evaluateOptions==="object")
request.evaluateOptions=evaluateOptions;extensionServer.sendRequest(request,callback&&callbackWrapper);return null;},getResources:function(callback)
{function wrapResource(resourceData)
{return new Resource(resourceData);}
function callbackWrapper(resources)
{callback(resources.map(wrapResource));}
extensionServer.sendRequest({command:commands.GetPageResources},callback&&callbackWrapper);}}
function ResourceImpl(resourceData)
{this._url=resourceData.url;this._type=resourceData.type;}
ResourceImpl.prototype={get url()
{return this._url;},get type()
{return this._type;},getContent:function(callback)
{function callbackWrapper(response)
{callback(response.content,response.encoding);}
extensionServer.sendRequest({command:commands.GetResourceContent,url:this._url},callback&&callbackWrapper);},setContent:function(content,commit,callback)
{extensionServer.sendRequest({command:commands.SetResourceContent,url:this._url,content:content,commit:commit},callback);}}
var keyboardEventRequestQueue=[];var forwardTimer=null;function forwardKeyboardEvent(event)
{const Esc="U+001B";if(!event.ctrlKey&&!event.altKey&&!event.metaKey&&!/^F\d+$/.test(event.keyIdentifier)&&event.keyIdentifier!==Esc)
return;var requestPayload={eventType:event.type,ctrlKey:event.ctrlKey,altKey:event.altKey,metaKey:event.metaKey,keyIdentifier:event.keyIdentifier,location:event.location,keyCode:event.keyCode};keyboardEventRequestQueue.push(requestPayload);if(!forwardTimer)
forwardTimer=setTimeout(forwardEventQueue,0);}
function forwardEventQueue()
{forwardTimer=null;var request={command:commands.ForwardKeyboardEvent,entries:keyboardEventRequestQueue};extensionServer.sendRequest(request);keyboardEventRequestQueue=[];}
document.addEventListener("keydown",forwardKeyboardEvent,false);document.addEventListener("keypress",forwardKeyboardEvent,false);function ExtensionServerClient()
{this._callbacks={};this._handlers={};this._lastRequestId=0;this._lastObjectId=0;this.registerHandler("callback",this._onCallback.bind(this));var channel=new MessageChannel();this._port=channel.port1;this._port.addEventListener("message",this._onMessage.bind(this),false);this._port.start();window.parent.postMessage("registerExtension",[channel.port2],"*");}
ExtensionServerClient.prototype={sendRequest:function(message,callback)
{if(typeof callback==="function")
message.requestId=this._registerCallback(callback);this._port.postMessage(message);},hasHandler:function(command)
{return!!this._handlers[command];},registerHandler:function(command,handler)
{this._handlers[command]=handler;},unregisterHandler:function(command)
{delete this._handlers[command];},nextObjectId:function()
{return injectedScriptId.toString()+"_"+ ++this._lastObjectId;},_registerCallback:function(callback)
{var id=++this._lastRequestId;this._callbacks[id]=callback;return id;},_onCallback:function(request)
{if(request.requestId in this._callbacks){var callback=this._callbacks[request.requestId];delete this._callbacks[request.requestId];callback(request.result);}},_onMessage:function(event)
{var request=event.data;var handler=this._handlers[request.command];if(handler)
handler.call(this,request);}}
function populateInterfaceClass(interfaze,implementation)
{for(var member in implementation){if(member.charAt(0)==="_")
continue;var descriptor=null;for(var owner=implementation;owner&&!descriptor;owner=owner.__proto__)
descriptor=Object.getOwnPropertyDescriptor(owner,member);if(!descriptor)
continue;if(typeof descriptor.value==="function")
interfaze[member]=descriptor.value.bind(implementation);else if(typeof descriptor.get==="function")
interfaze.__defineGetter__(member,descriptor.get.bind(implementation));else
Object.defineProperty(interfaze,member,descriptor);}}
if(!extensionServer)
extensionServer=new ExtensionServerClient();return new InspectorExtensionAPI();}
function platformExtensionAPI(coreAPI)
{function getTabId()
{return tabId;}
chrome=window.chrome||{};var devtools_descriptor=Object.getOwnPropertyDescriptor(chrome,"devtools");if(!devtools_descriptor||devtools_descriptor.get)
Object.defineProperty(chrome,"devtools",{value:{},enumerable:true});chrome.devtools.inspectedWindow={};chrome.devtools.inspectedWindow.__defineGetter__("tabId",getTabId);chrome.devtools.inspectedWindow.__proto__=coreAPI.inspectedWindow;chrome.devtools.network=coreAPI.network;chrome.devtools.panels=coreAPI.panels;if(extensionInfo.exposeExperimentalAPIs!==false){chrome.experimental=chrome.experimental||{};chrome.experimental.devtools=chrome.experimental.devtools||{};var properties=Object.getOwnPropertyNames(coreAPI);for(var i=0;i<properties.length;++i){var descriptor=Object.getOwnPropertyDescriptor(coreAPI,properties[i]);Object.defineProperty(chrome.experimental.devtools,properties[i],descriptor);}
chrome.experimental.devtools.inspectedWindow=chrome.devtools.inspectedWindow;}
if(extensionInfo.exposeWebInspectorNamespace)
window.webInspector=coreAPI;}
function buildPlatformExtensionAPI(extensionInfo,inspectedTabId)
{return"var extensionInfo = "+JSON.stringify(extensionInfo)+";"+"var tabId = "+inspectedTabId+";"+
platformExtensionAPI.toString();}
function buildExtensionAPIInjectedScript(extensionInfo,inspectedTabId)
{return"(function(injectedScriptId){ "+"var extensionServer;"+
defineCommonExtensionSymbols.toString()+";"+
injectedExtensionAPI.toString()+";"+
buildPlatformExtensionAPI(extensionInfo,inspectedTabId)+";"+"platformExtensionAPI(injectedExtensionAPI(injectedScriptId));"+"return {};"+"})";};WebInspector.ExtensionAuditCategory=function(extensionOrigin,id,displayName,ruleCount)
{this.extensionOrigin=extensionOrigin;this.id=id;this.displayName=displayName;this.ruleCount=ruleCount;}
WebInspector.ExtensionAuditCategoryResults=function()
{}
WebInspector.ExtensionAuditCategoryResults.prototype={id:function(){},addResult:function(displayName,description,severity,details){},updateProgress:function(progress){},done:function(){}};if(!window.InspectorExtensionRegistry){WebInspector.InspectorExtensionRegistryStub=function()
{}
WebInspector.InspectorExtensionRegistryStub.prototype={getExtensionsAsync:function()
{}}
var InspectorExtensionRegistry=new WebInspector.InspectorExtensionRegistryStub();};WebInspector.ExtensionServer=function()
{this._clientObjects={};this._handlers={};this._subscribers={};this._subscriptionStartHandlers={};this._subscriptionStopHandlers={};this._extraHeaders={};this._requests={};this._lastRequestId=0;this._registeredExtensions={};this._status=new WebInspector.ExtensionStatus();this._sidebarPanes=[];this._auditCategories=[];var commands=WebInspector.extensionAPI.Commands;this._registerHandler(commands.AddAuditCategory,this._onAddAuditCategory.bind(this));this._registerHandler(commands.AddAuditResult,this._onAddAuditResult.bind(this));this._registerHandler(commands.AddRequestHeaders,this._onAddRequestHeaders.bind(this));this._registerHandler(commands.ApplyStyleSheet,this._onApplyStyleSheet.bind(this));this._registerHandler(commands.CreatePanel,this._onCreatePanel.bind(this));this._registerHandler(commands.CreateSidebarPane,this._onCreateSidebarPane.bind(this));this._registerHandler(commands.CreateToolbarButton,this._onCreateToolbarButton.bind(this));this._registerHandler(commands.EvaluateOnInspectedPage,this._onEvaluateOnInspectedPage.bind(this));this._registerHandler(commands.ForwardKeyboardEvent,this._onForwardKeyboardEvent.bind(this));this._registerHandler(commands.GetHAR,this._onGetHAR.bind(this));this._registerHandler(commands.GetPageResources,this._onGetPageResources.bind(this));this._registerHandler(commands.GetRequestContent,this._onGetRequestContent.bind(this));this._registerHandler(commands.GetResourceContent,this._onGetResourceContent.bind(this));this._registerHandler(commands.Reload,this._onReload.bind(this));this._registerHandler(commands.SetOpenResourceHandler,this._onSetOpenResourceHandler.bind(this));this._registerHandler(commands.SetResourceContent,this._onSetResourceContent.bind(this));this._registerHandler(commands.SetSidebarHeight,this._onSetSidebarHeight.bind(this));this._registerHandler(commands.SetSidebarContent,this._onSetSidebarContent.bind(this));this._registerHandler(commands.SetSidebarPage,this._onSetSidebarPage.bind(this));this._registerHandler(commands.ShowPanel,this._onShowPanel.bind(this));this._registerHandler(commands.StopAuditCategoryRun,this._onStopAuditCategoryRun.bind(this));this._registerHandler(commands.Subscribe,this._onSubscribe.bind(this));this._registerHandler(commands.OpenResource,this._onOpenResource.bind(this));this._registerHandler(commands.Unsubscribe,this._onUnsubscribe.bind(this));this._registerHandler(commands.UpdateButton,this._onUpdateButton.bind(this));this._registerHandler(commands.UpdateAuditProgress,this._onUpdateAuditProgress.bind(this));window.addEventListener("message",this._onWindowMessage.bind(this),false);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.AddExtensions,this._addExtensions,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.SetInspectedTabId,this._setInspectedTabId,this);this._initExtensions();}
WebInspector.ExtensionServer.Events={SidebarPaneAdded:"SidebarPaneAdded",AuditCategoryAdded:"AuditCategoryAdded"}
WebInspector.ExtensionServer.prototype={initializeExtensions:function()
{this._initializeCommandIssued=true;if(this._pendingExtensionInfos){this._pendingExtensionInfos.forEach(this._addExtension,this);delete this._pendingExtensionInfos;}},hasExtensions:function()
{return!!Object.keys(this._registeredExtensions).length;},notifySearchAction:function(panelId,action,searchString)
{this._postNotification(WebInspector.extensionAPI.Events.PanelSearch+panelId,action,searchString);},notifyViewShown:function(identifier,frameIndex)
{this._postNotification(WebInspector.extensionAPI.Events.ViewShown+identifier,frameIndex);},notifyViewHidden:function(identifier)
{this._postNotification(WebInspector.extensionAPI.Events.ViewHidden+identifier);},notifyButtonClicked:function(identifier)
{this._postNotification(WebInspector.extensionAPI.Events.ButtonClicked+identifier);},_inspectedURLChanged:function(event)
{this._requests={};var url=event.data;this._postNotification(WebInspector.extensionAPI.Events.InspectedURLChanged,url);},startAuditRun:function(categoryId,auditResults)
{this._clientObjects[auditResults.id()]=auditResults;this._postNotification("audit-started-"+categoryId,auditResults.id());},stopAuditRun:function(auditResults)
{delete this._clientObjects[auditResults.id()];},hasSubscribers:function(type)
{return!!this._subscribers[type];},_postNotification:function(type,vararg)
{var subscribers=this._subscribers[type];if(!subscribers)
return;var message={command:"notify-"+type,arguments:Array.prototype.slice.call(arguments,1)};for(var i=0;i<subscribers.length;++i)
subscribers[i].postMessage(message);},_onSubscribe:function(message,port)
{var subscribers=this._subscribers[message.type];if(subscribers)
subscribers.push(port);else{this._subscribers[message.type]=[port];if(this._subscriptionStartHandlers[message.type])
this._subscriptionStartHandlers[message.type]();}},_onUnsubscribe:function(message,port)
{var subscribers=this._subscribers[message.type];if(!subscribers)
return;subscribers.remove(port);if(!subscribers.length){delete this._subscribers[message.type];if(this._subscriptionStopHandlers[message.type])
this._subscriptionStopHandlers[message.type]();}},_onAddRequestHeaders:function(message)
{var id=message.extensionId;if(typeof id!=="string")
return this._status.E_BADARGTYPE("extensionId",typeof id,"string");var extensionHeaders=this._extraHeaders[id];if(!extensionHeaders){extensionHeaders={};this._extraHeaders[id]=extensionHeaders;}
for(var name in message.headers)
extensionHeaders[name]=message.headers[name];var allHeaders=({});for(var extension in this._extraHeaders){var headers=this._extraHeaders[extension];for(name in headers){if(typeof headers[name]==="string")
allHeaders[name]=headers[name];}}
WebInspector.multitargetNetworkManager.setExtraHTTPHeaders(allHeaders);},_onApplyStyleSheet:function(message)
{if(!Runtime.experiments.isEnabled("applyCustomStylesheet"))
return;var styleSheet=createElement("style");styleSheet.textContent=message.styleSheet;document.head.appendChild(styleSheet);},_onCreatePanel:function(message,port)
{var id=message.id;if(id in this._clientObjects||WebInspector.inspectorView.hasPanel(id))
return this._status.E_EXISTS(id);var page=this._expandResourcePath(port._extensionOrigin,message.page);var persistentId=port._extensionOrigin+message.title;persistentId=persistentId.replace(/\s/g,"");var panelDescriptor=new WebInspector.ExtensionServerPanelDescriptor(persistentId,message.title,new WebInspector.ExtensionPanel(this,persistentId,id,page));this._clientObjects[id]=panelDescriptor;WebInspector.inspectorView.addPanel(panelDescriptor);return this._status.OK();},_onShowPanel:function(message)
{var panelName=message.id;var panelDescriptor=this._clientObjects[message.id];if(panelDescriptor&&panelDescriptor instanceof WebInspector.ExtensionServerPanelDescriptor)
panelName=panelDescriptor.name();WebInspector.inspectorView.showPanel(panelName);},_onCreateToolbarButton:function(message,port)
{var panelDescriptor=this._clientObjects[message.panel];if(!panelDescriptor||!(panelDescriptor instanceof WebInspector.ExtensionServerPanelDescriptor))
return this._status.E_NOTFOUND(message.panel);var button=new WebInspector.ExtensionButton(this,message.id,this._expandResourcePath(port._extensionOrigin,message.icon),message.tooltip,message.disabled);this._clientObjects[message.id]=button;panelDescriptor.panel().then(appendButton);function appendButton(panel)
{(panel).addToolbarItem(button.toolbarButton());}
return this._status.OK();},_onUpdateButton:function(message,port)
{var button=this._clientObjects[message.id];if(!button||!(button instanceof WebInspector.ExtensionButton))
return this._status.E_NOTFOUND(message.id);button.update(this._expandResourcePath(port._extensionOrigin,message.icon),message.tooltip,message.disabled);return this._status.OK();},_onCreateSidebarPane:function(message)
{if(message.panel!=="elements"&&message.panel!=="sources")
return this._status.E_NOTFOUND(message.panel);var id=message.id;var sidebar=new WebInspector.ExtensionSidebarPane(this,message.panel,message.title,id);this._sidebarPanes.push(sidebar);this._clientObjects[id]=sidebar;this.dispatchEventToListeners(WebInspector.ExtensionServer.Events.SidebarPaneAdded,sidebar);return this._status.OK();},sidebarPanes:function()
{return this._sidebarPanes;},_onSetSidebarHeight:function(message)
{var sidebar=this._clientObjects[message.id];if(!sidebar)
return this._status.E_NOTFOUND(message.id);sidebar.setHeight(message.height);return this._status.OK();},_onSetSidebarContent:function(message,port)
{var sidebar=this._clientObjects[message.id];if(!sidebar)
return this._status.E_NOTFOUND(message.id);function callback(error)
{var result=error?this._status.E_FAILED(error):this._status.OK();this._dispatchCallback(message.requestId,port,result);}
if(message.evaluateOnPage)
return sidebar.setExpression(message.expression,message.rootTitle,message.evaluateOptions,port._extensionOrigin,callback.bind(this));sidebar.setObject(message.expression,message.rootTitle,callback.bind(this));},_onSetSidebarPage:function(message,port)
{var sidebar=this._clientObjects[message.id];if(!sidebar)
return this._status.E_NOTFOUND(message.id);sidebar.setPage(this._expandResourcePath(port._extensionOrigin,message.page));},_onOpenResource:function(message)
{var uiSourceCode=WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(message.url);if(uiSourceCode){WebInspector.Revealer.reveal(uiSourceCode.uiLocation(message.lineNumber,0));return this._status.OK();}
var resource=WebInspector.resourceForURL(message.url);if(resource){WebInspector.Revealer.reveal(resource,message.lineNumber);return this._status.OK();}
var request=WebInspector.NetworkLog.requestForURL(message.url);if(request){WebInspector.Revealer.reveal(request);return this._status.OK();}
return this._status.E_NOTFOUND(message.url);},_onSetOpenResourceHandler:function(message,port)
{var name=this._registeredExtensions[port._extensionOrigin].name||("Extension "+port._extensionOrigin);if(message.handlerPresent)
WebInspector.openAnchorLocationRegistry.registerHandler(name,this._handleOpenURL.bind(this,port));else
WebInspector.openAnchorLocationRegistry.unregisterHandler(name);},_handleOpenURL:function(port,details)
{var url=(details.url);var contentProvider=WebInspector.workspace.uiSourceCodeForURL(url)||WebInspector.resourceForURL(url);if(!contentProvider)
return false;var lineNumber=details.lineNumber;if(typeof lineNumber==="number")
lineNumber+=1;port.postMessage({command:"open-resource",resource:this._makeResource(contentProvider),lineNumber:lineNumber});return true;},_onReload:function(message)
{var options=(message.options||{});WebInspector.multitargetNetworkManager.setUserAgentOverride(typeof options.userAgent==="string"?options.userAgent:"");var injectedScript;if(options.injectedScript)
injectedScript="(function(){"+options.injectedScript+"})()";WebInspector.targetManager.reloadPage(!!options.ignoreCache,injectedScript);return this._status.OK();},_onEvaluateOnInspectedPage:function(message,port)
{function callback(error,remoteObject,wasThrown)
{var result;if(error||!remoteObject)
result=this._status.E_PROTOCOLERROR(error.toString());else if(wasThrown)
result={isException:true,value:remoteObject.description};else
result={value:remoteObject.value};this._dispatchCallback(message.requestId,port,result);}
return this.evaluate(message.expression,true,true,message.evaluateOptions,port._extensionOrigin,callback.bind(this));},_onGetHAR:function()
{var requests=WebInspector.NetworkLog.requests();var harLog=(new WebInspector.HARLog(requests)).build();for(var i=0;i<harLog.entries.length;++i)
harLog.entries[i]._requestId=this._requestId(requests[i]);return harLog;},_makeResource:function(contentProvider)
{return{url:contentProvider.contentURL(),type:contentProvider.contentType().name()};},_onGetPageResources:function()
{var resources={};function pushResourceData(contentProvider)
{if(!resources[contentProvider.contentURL()])
resources[contentProvider.contentURL()]=this._makeResource(contentProvider);}
var uiSourceCodes=WebInspector.workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.Network);uiSourceCodes=uiSourceCodes.concat(WebInspector.workspace.uiSourceCodesForProjectType(WebInspector.projectTypes.ContentScripts));uiSourceCodes.forEach(pushResourceData.bind(this));for(var target of WebInspector.targetManager.targets())
target.resourceTreeModel.forAllResources(pushResourceData.bind(this));return Object.values(resources);},_getResourceContent:function(contentProvider,message,port)
{function onContentAvailable(content)
{var contentEncoded=false;if(contentProvider instanceof WebInspector.Resource)
contentEncoded=contentProvider.contentEncoded;if(contentProvider instanceof WebInspector.NetworkRequest)
contentEncoded=contentProvider.contentEncoded;var response={encoding:contentEncoded&&content?"base64":"",content:content};this._dispatchCallback(message.requestId,port,response);}
contentProvider.requestContent(onContentAvailable.bind(this));},_onGetRequestContent:function(message,port)
{var request=this._requestById(message.id);if(!request)
return this._status.E_NOTFOUND(message.id);this._getResourceContent(request,message,port);},_onGetResourceContent:function(message,port)
{var url=(message.url);var contentProvider=WebInspector.workspace.uiSourceCodeForURL(url)||WebInspector.resourceForURL(url);if(!contentProvider)
return this._status.E_NOTFOUND(url);this._getResourceContent(contentProvider,message,port);},_onSetResourceContent:function(message,port)
{function callbackWrapper(error)
{var response=error?this._status.E_FAILED(error):this._status.OK();this._dispatchCallback(message.requestId,port,response);}
var url=(message.url);var uiSourceCode=WebInspector.workspace.uiSourceCodeForURL(url);if(!uiSourceCode||!uiSourceCode.contentType().isDocumentOrScriptOrStyleSheet()){var resource=WebInspector.ResourceTreeModel.resourceForURL(url);if(!resource)
return this._status.E_NOTFOUND(url);return this._status.E_NOTSUPPORTED("Resource is not editable");}
uiSourceCode.setWorkingCopy(message.content);if(message.commit)
uiSourceCode.commitWorkingCopy();callbackWrapper.call(this,null);},_requestId:function(request)
{if(!request._extensionRequestId){request._extensionRequestId=++this._lastRequestId;this._requests[request._extensionRequestId]=request;}
return request._extensionRequestId;},_requestById:function(id)
{return this._requests[id];},_onAddAuditCategory:function(message,port)
{var category=new WebInspector.ExtensionAuditCategory(port._extensionOrigin,message.id,message.displayName,message.resultCount);this._clientObjects[message.id]=category;this._auditCategories.push(category);this.dispatchEventToListeners(WebInspector.ExtensionServer.Events.AuditCategoryAdded,category);},auditCategories:function()
{return this._auditCategories;},_onAddAuditResult:function(message)
{var auditResult=(this._clientObjects[message.resultId]);if(!auditResult)
return this._status.E_NOTFOUND(message.resultId);try{auditResult.addResult(message.displayName,message.description,message.severity,message.details);}catch(e){return e;}
return this._status.OK();},_onUpdateAuditProgress:function(message)
{var auditResult=(this._clientObjects[message.resultId]);if(!auditResult)
return this._status.E_NOTFOUND(message.resultId);auditResult.updateProgress(Math.min(Math.max(0,message.progress),1));},_onStopAuditCategoryRun:function(message)
{var auditRun=(this._clientObjects[message.resultId]);if(!auditRun)
return this._status.E_NOTFOUND(message.resultId);auditRun.done();},_onForwardKeyboardEvent:function(message)
{const Esc="U+001B";message.entries.forEach(handleEventEntry);function handleEventEntry(entry)
{if(!entry.ctrlKey&&!entry.altKey&&!entry.metaKey&&!/^F\d+$/.test(entry.keyIdentifier)&&entry.keyIdentifier!==Esc)
return;var event=new window.KeyboardEvent(entry.eventType,{keyIdentifier:entry.keyIdentifier,location:entry.location,ctrlKey:entry.ctrlKey,altKey:entry.altKey,shiftKey:entry.shiftKey,metaKey:entry.metaKey});event.__keyCode=keyCodeForEntry(entry);document.dispatchEvent(event);}
function keyCodeForEntry(entry)
{var keyCode=entry.keyCode;if(!keyCode){var match=entry.keyIdentifier.match(/^U\+([\dA-Fa-f]+)$/);if(match)
keyCode=parseInt(match[1],16);}
return keyCode||0;}},_dispatchCallback:function(requestId,port,result)
{if(requestId)
port.postMessage({command:"callback",requestId:requestId,result:result});},_initExtensions:function()
{this._registerAutosubscriptionHandler(WebInspector.extensionAPI.Events.ResourceAdded,WebInspector.workspace,WebInspector.Workspace.Events.UISourceCodeAdded,this._notifyResourceAdded);this._registerAutosubscriptionTargetManagerHandler(WebInspector.extensionAPI.Events.NetworkRequestFinished,WebInspector.NetworkManager,WebInspector.NetworkManager.EventTypes.RequestFinished,this._notifyRequestFinished);function onElementsSubscriptionStarted()
{WebInspector.notifications.addEventListener(WebInspector.NotificationService.Events.SelectedNodeChanged,this._notifyElementsSelectionChanged,this);}
function onElementsSubscriptionStopped()
{WebInspector.notifications.removeEventListener(WebInspector.NotificationService.Events.SelectedNodeChanged,this._notifyElementsSelectionChanged,this);}
this._registerSubscriptionHandler(WebInspector.extensionAPI.Events.PanelObjectSelected+"elements",onElementsSubscriptionStarted.bind(this),onElementsSubscriptionStopped.bind(this));this._registerResourceContentCommittedHandler(this._notifyUISourceCodeContentCommitted);WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.InspectedURLChanged,this._inspectedURLChanged,this);InspectorExtensionRegistry.getExtensionsAsync();},_notifyResourceAdded:function(event)
{var uiSourceCode=(event.data);this._postNotification(WebInspector.extensionAPI.Events.ResourceAdded,this._makeResource(uiSourceCode));},_notifyUISourceCodeContentCommitted:function(event)
{var uiSourceCode=(event.data.uiSourceCode);var content=(event.data.content);this._postNotification(WebInspector.extensionAPI.Events.ResourceContentCommitted,this._makeResource(uiSourceCode),content);},_notifyRequestFinished:function(event)
{var request=(event.data);this._postNotification(WebInspector.extensionAPI.Events.NetworkRequestFinished,this._requestId(request),(new WebInspector.HAREntry(request)).build());},_notifyElementsSelectionChanged:function()
{this._postNotification(WebInspector.extensionAPI.Events.PanelObjectSelected+"elements");},_addExtensions:function(event)
{if(WebInspector.extensionServer._overridePlatformExtensionAPIForTest)
window.buildPlatformExtensionAPI=WebInspector.extensionServer._overridePlatformExtensionAPIForTest;var extensionInfos=(event.data);if(this._initializeCommandIssued)
extensionInfos.forEach(this._addExtension,this);else
this._pendingExtensionInfos=extensionInfos;},_setInspectedTabId:function(event)
{this._inspectedTabId=(event.data);},_addExtension:function(extensionInfo)
{const urlOriginRegExp=new RegExp("([^:]+:\/\/[^/]*)\/");var startPage=extensionInfo.startPage;var name=extensionInfo.name;try{var originMatch=urlOriginRegExp.exec(startPage);if(!originMatch){console.error("Skipping extension with invalid URL: "+startPage);return false;}
var extensionOrigin=originMatch[1];if(!this._registeredExtensions[extensionOrigin]){InspectorFrontendHost.setInjectedScriptForOrigin(extensionOrigin,buildExtensionAPIInjectedScript(extensionInfo,this._inspectedTabId));this._registeredExtensions[extensionOrigin]={name:name};}
var iframe=createElement("iframe");iframe.src=startPage;iframe.style.display="none";document.body.appendChild(iframe);}catch(e){console.error("Failed to initialize extension "+startPage+":"+e);return false;}
return true;},_registerExtension:function(origin,port)
{if(!this._registeredExtensions.hasOwnProperty(origin)){if(origin!==window.location.origin)
console.error("Ignoring unauthorized client request from "+origin);return;}
port._extensionOrigin=origin;port.addEventListener("message",this._onmessage.bind(this),false);port.start();},_onWindowMessage:function(event)
{if(event.data==="registerExtension")
this._registerExtension(event.origin,event.ports[0]);},_onmessage:function(event)
{var message=event.data;var result;if(message.command in this._handlers)
result=this._handlers[message.command](message,event.target);else
result=this._status.E_NOTSUPPORTED(message.command);if(result&&message.requestId)
this._dispatchCallback(message.requestId,event.target,result);},_registerHandler:function(command,callback)
{console.assert(command);this._handlers[command]=callback;},_registerSubscriptionHandler:function(eventTopic,onSubscribeFirst,onUnsubscribeLast)
{this._subscriptionStartHandlers[eventTopic]=onSubscribeFirst;this._subscriptionStopHandlers[eventTopic]=onUnsubscribeLast;},_registerAutosubscriptionHandler:function(eventTopic,eventTarget,frontendEventType,handler)
{this._registerSubscriptionHandler(eventTopic,eventTarget.addEventListener.bind(eventTarget,frontendEventType,handler,this),eventTarget.removeEventListener.bind(eventTarget,frontendEventType,handler,this));},_registerAutosubscriptionTargetManagerHandler:function(eventTopic,modelClass,frontendEventType,handler)
{this._registerSubscriptionHandler(eventTopic,WebInspector.targetManager.addModelListener.bind(WebInspector.targetManager,modelClass,frontendEventType,handler,this),WebInspector.targetManager.removeModelListener.bind(WebInspector.targetManager,modelClass,frontendEventType,handler,this));},_registerResourceContentCommittedHandler:function(handler)
{function addFirstEventListener()
{WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.WorkingCopyCommittedByUser,handler,this);WebInspector.workspace.setHasResourceContentTrackingExtensions(true);}
function removeLastEventListener()
{WebInspector.workspace.setHasResourceContentTrackingExtensions(false);WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.WorkingCopyCommittedByUser,handler,this);}
this._registerSubscriptionHandler(WebInspector.extensionAPI.Events.ResourceContentCommitted,addFirstEventListener.bind(this),removeLastEventListener.bind(this));},_expandResourcePath:function(extensionPath,resourcePath)
{if(!resourcePath)
return;return extensionPath+this._normalizePath(resourcePath);},_normalizePath:function(path)
{var source=path.split("/");var result=[];for(var i=0;i<source.length;++i){if(source[i]===".")
continue;if(source[i]==="")
continue;if(source[i]==="..")
result.pop();else
result.push(source[i]);}
return"/"+result.join("/");},evaluate:function(expression,exposeCommandLineAPI,returnByValue,options,securityOrigin,callback)
{var contextId;function resolveURLToFrame(url)
{var found;function hasMatchingURL(frame)
{found=(frame.url===url)?frame:null;return found;}
WebInspector.ResourceTreeModel.frames().some(hasMatchingURL);return found;}
if(typeof options==="object"){var frame=options.frameURL?resolveURLToFrame(options.frameURL):WebInspector.targetManager.mainTarget().resourceTreeModel.mainFrame;if(!frame){if(options.frameURL)
console.warn("evaluate: there is no frame with URL "+options.frameURL);else
console.warn("evaluate: the main frame is not yet available");return this._status.E_NOTFOUND(options.frameURL||"<top>");}
var contextSecurityOrigin;if(options.useContentScriptContext)
contextSecurityOrigin=securityOrigin;else if(options.scriptExecutionContext)
contextSecurityOrigin=options.scriptExecutionContext;var context;var executionContexts=frame.target().runtimeModel.executionContexts();if(contextSecurityOrigin){for(var i=0;i<executionContexts.length;++i){var executionContext=executionContexts[i];if(executionContext.frameId===frame.id&&executionContext.origin===contextSecurityOrigin&&!executionContext.isMainWorldContext)
context=executionContext;}
if(!context){console.warn("The JavaScript context "+contextSecurityOrigin+" was not found in the frame "+frame.url)
return this._status.E_NOTFOUND(contextSecurityOrigin)}}else{for(var i=0;i<executionContexts.length;++i){var executionContext=executionContexts[i];if(executionContext.frameId===frame.id&&executionContext.isMainWorldContext)
context=executionContext;}
if(!context)
return this._status.E_FAILED(frame.url+" has no execution context");}
contextId=context.id;}
var target=target?target:WebInspector.targetManager.mainTarget();if(!target)
return;target.runtimeAgent().evaluate(expression,"extension",exposeCommandLineAPI,true,contextId,returnByValue,false,onEvalute);function onEvalute(error,result,wasThrown)
{if(error){callback(error,null,wasThrown);return;}
callback(error,target.runtimeModel.createRemoteObject(result),wasThrown);}},__proto__:WebInspector.Object.prototype}
WebInspector.ExtensionServerPanelDescriptor=function(name,title,panel)
{this._name=name;this._title=title;this._panel=panel;}
WebInspector.ExtensionServerPanelDescriptor.prototype={name:function()
{return this._name;},title:function()
{return this._title;},panel:function()
{return Promise.resolve(this._panel);}}
WebInspector.ExtensionStatus=function()
{function makeStatus(code,description)
{var details=Array.prototype.slice.call(arguments,2);var status={code:code,description:description,details:details};if(code!=="OK"){status.isError=true;console.log("Extension server error: "+String.vsprintf(description,details));}
return status;}
this.OK=makeStatus.bind(null,"OK","OK");this.E_EXISTS=makeStatus.bind(null,"E_EXISTS","Object already exists: %s");this.E_BADARG=makeStatus.bind(null,"E_BADARG","Invalid argument %s: %s");this.E_BADARGTYPE=makeStatus.bind(null,"E_BADARGTYPE","Invalid type for argument %s: got %s, expected %s");this.E_NOTFOUND=makeStatus.bind(null,"E_NOTFOUND","Object not found: %s");this.E_NOTSUPPORTED=makeStatus.bind(null,"E_NOTSUPPORTED","Object does not support requested operation: %s");this.E_PROTOCOLERROR=makeStatus.bind(null,"E_PROTOCOLERROR","Inspector protocol error: %s");this.E_FAILED=makeStatus.bind(null,"E_FAILED","Operation failed: %s");}
WebInspector.ExtensionStatus.Record;WebInspector.extensionAPI={};defineCommonExtensionSymbols(WebInspector.extensionAPI);WebInspector.extensionServer;;WebInspector.ExtensionPanel=function(server,panelName,id,pageURL)
{WebInspector.Panel.call(this,panelName);this._server=server;this._id=id;this.setHideOnDetach();this._panelToolbar=new WebInspector.Toolbar("hidden",this.element);this._searchableView=new WebInspector.SearchableView(this);this._searchableView.show(this.element);var extensionView=new WebInspector.ExtensionView(server,this._id,pageURL,"extension");extensionView.show(this._searchableView.element);this.setDefaultFocusedElement(extensionView.defaultFocusedElement());}
WebInspector.ExtensionPanel.prototype={defaultFocusedElement:function()
{return WebInspector.Widget.prototype.defaultFocusedElement.call(this);},addToolbarItem:function(item)
{this._panelToolbar.element.classList.remove("hidden");this._panelToolbar.appendToolbarItem(item);},searchCanceled:function()
{this._server.notifySearchAction(this._id,WebInspector.extensionAPI.panels.SearchAction.CancelSearch);this._searchableView.updateSearchMatchesCount(0);},searchableView:function()
{return this._searchableView;},performSearch:function(searchConfig,shouldJump,jumpBackwards)
{var query=searchConfig.query;this._server.notifySearchAction(this._id,WebInspector.extensionAPI.panels.SearchAction.PerformSearch,query);},jumpToNextSearchResult:function()
{this._server.notifySearchAction(this._id,WebInspector.extensionAPI.panels.SearchAction.NextSearchResult);},jumpToPreviousSearchResult:function()
{this._server.notifySearchAction(this._id,WebInspector.extensionAPI.panels.SearchAction.PreviousSearchResult);},supportsCaseSensitiveSearch:function()
{return false;},supportsRegexSearch:function()
{return false;},__proto__:WebInspector.Panel.prototype}
WebInspector.ExtensionButton=function(server,id,iconURL,tooltip,disabled)
{this._id=id;this._toolbarButton=new WebInspector.ToolbarButton("","");this._toolbarButton.addEventListener("click",server.notifyButtonClicked.bind(server,this._id));this.update(iconURL,tooltip,disabled);}
WebInspector.ExtensionButton.prototype={update:function(iconURL,tooltip,disabled)
{if(typeof iconURL==="string")
this._toolbarButton.setBackgroundImage(iconURL);if(typeof tooltip==="string")
this._toolbarButton.setTitle(tooltip);if(typeof disabled==="boolean")
this._toolbarButton.setEnabled(!disabled);},toolbarButton:function()
{return this._toolbarButton;}}
WebInspector.ExtensionSidebarPane=function(server,panelName,title,id)
{WebInspector.SidebarPane.call(this,title);this._panelName=panelName;this._server=server;this._id=id;}
WebInspector.ExtensionSidebarPane.prototype={id:function()
{return this._id;},panelName:function()
{return this._panelName;},setObject:function(object,title,callback)
{this._createObjectPropertiesView();this._setObject(WebInspector.RemoteObject.fromLocalObject(object),title,callback);},setExpression:function(expression,title,evaluateOptions,securityOrigin,callback)
{this._createObjectPropertiesView();this._server.evaluate(expression,true,false,evaluateOptions,securityOrigin,this._onEvaluate.bind(this,title,callback));},setPage:function(url)
{if(this._objectPropertiesView){this._objectPropertiesView.detach();delete this._objectPropertiesView;}
if(this._extensionView)
this._extensionView.detach(true);this._extensionView=new WebInspector.ExtensionView(this._server,this._id,url,"extension fill");this._extensionView.show(this.element);if(!this.element.style.height)
this.setHeight("150px");},setHeight:function(height)
{this.element.style.height=height;},_onEvaluate:function(title,callback,error,result,wasThrown)
{if(error)
callback(error.toString());else
this._setObject((result),title,callback);},_createObjectPropertiesView:function()
{if(this._objectPropertiesView)
return;if(this._extensionView){this._extensionView.detach(true);delete this._extensionView;}
this._objectPropertiesView=new WebInspector.ExtensionNotifierView(this._server,this._id);this._objectPropertiesView.show(this.element);},_setObject:function(object,title,callback)
{if(!this._objectPropertiesView){callback("operation cancelled");return;}
this._objectPropertiesView.element.removeChildren();var section=new WebInspector.ObjectPropertiesSection(object,title);if(!title)
section.titleLessMode();section.expand();section.editable=false;this._objectPropertiesView.element.appendChild(section.element);callback();},__proto__:WebInspector.SidebarPane.prototype};WebInspector.ExtensionView=function(server,id,src,className)
{WebInspector.Widget.call(this);this.setHideOnDetach();this.element.className="vbox flex-auto";this._server=server;this._id=id;this._iframe=createElement("iframe");this._iframe.addEventListener("load",this._onLoad.bind(this),false);this._iframe.src=src;this._iframe.className=className;this.setDefaultFocusedElement(this._iframe);this.element.appendChild(this._iframe);}
WebInspector.ExtensionView.prototype={wasShown:function()
{if(typeof this._frameIndex==="number")
this._server.notifyViewShown(this._id,this._frameIndex);},willHide:function()
{if(typeof this._frameIndex==="number")
this._server.notifyViewHidden(this._id);},_onLoad:function()
{var frames=(window.frames);this._frameIndex=Array.prototype.indexOf.call(frames,this._iframe.contentWindow);if(this.isShowing())
this._server.notifyViewShown(this._id,this._frameIndex);},__proto__:WebInspector.Widget.prototype}
WebInspector.ExtensionNotifierView=function(server,id)
{WebInspector.VBox.call(this);this._server=server;this._id=id;}
WebInspector.ExtensionNotifierView.prototype={wasShown:function()
{this._server.notifyViewShown(this._id);},willHide:function()
{this._server.notifyViewHidden(this._id);},__proto__:WebInspector.VBox.prototype};WebInspector.OverridesSupport=function()
{this._touchEmulationSuspended=false;this._emulateMobileEnabled=false;this._userAgent="";this._pageResizer=null;this._deviceScale=1;this._fixedDeviceScale=false;this._initialized=false;this._deviceMetricsThrottler=new WebInspector.Throttler(0);this.settings={};this.settings._emulationEnabled=WebInspector.settings.createSetting("emulationEnabled",false);if(Runtime.experiments.isEnabled("deviceMode"))
this.settings._emulationEnabled.set(false);this.settings.userAgent=WebInspector.settings.createSetting("userAgent","");this.settings.emulateResolution=WebInspector.settings.createSetting("emulateResolution",true);this.settings.deviceWidth=WebInspector.settings.createSetting("deviceWidth",360);this.settings.deviceHeight=WebInspector.settings.createSetting("deviceHeight",640);this.settings.deviceScaleFactor=WebInspector.settings.createSetting("deviceScaleFactor",0);this.settings.deviceFitWindow=WebInspector.settings.createSetting("deviceFitWindow",true);this.settings.emulateMobile=WebInspector.settings.createSetting("emulateMobile",false);this.settings.emulateTouch=WebInspector.settings.createSetting("emulateTouch",false);this.settings.geolocationOverride=WebInspector.settings.createSetting("geolocationOverride","");this.settings.deviceOrientationOverride=WebInspector.settings.createSetting("deviceOrientationOverride","");this.settings.screenOrientationOverride=WebInspector.settings.createSetting("screenOrientationOverride","");this.settings.javaScriptDisabled=WebInspector.moduleSetting("javaScriptDisabled");}
WebInspector.OverridesSupport.Events={OverridesWarningUpdated:"OverridesWarningUpdated",EmulationStateChanged:"EmulationStateChanged"}
WebInspector.OverridesSupport.MaxDeviceSize=9999;WebInspector.OverridesSupport.PageResizer=function()
{};WebInspector.OverridesSupport.PageResizer.Events={AvailableSizeChanged:"AvailableSizeChanged",ResizeRequested:"ResizeRequested",FixedScaleRequested:"FixedScaleRequested",InsetsChanged:"InsetsChanged"};WebInspector.OverridesSupport.PageResizer.prototype={update:function(dipWidth,dipHeight,scale,pageWidth,pageHeight){}};WebInspector.OverridesSupport.Device={};WebInspector.OverridesSupport.GeolocationPosition=function(latitude,longitude,error)
{this.latitude=latitude;this.longitude=longitude;this.error=error;}
WebInspector.OverridesSupport.GeolocationPosition.prototype={toSetting:function()
{return(typeof this.latitude==="number"&&typeof this.longitude==="number"&&typeof this.error==="string")?this.latitude+"@"+this.longitude+":"+this.error:"";}}
WebInspector.OverridesSupport.GeolocationPosition.parseSetting=function(value)
{if(value){var splitError=value.split(":");if(splitError.length===2){var splitPosition=splitError[0].split("@");if(splitPosition.length===2)
return new WebInspector.OverridesSupport.GeolocationPosition(parseFloat(splitPosition[0]),parseFloat(splitPosition[1]),splitError[1]);}}
return new WebInspector.OverridesSupport.GeolocationPosition(0,0,"");}
WebInspector.OverridesSupport.GeolocationPosition.parseUserInput=function(latitudeString,longitudeString,errorStatus)
{function isUserInputValid(value)
{if(!value)
return true;return/^[-]?[0-9]*[.]?[0-9]*$/.test(value);}
if(!latitudeString&&!longitudeString)
return null;var isLatitudeValid=isUserInputValid(latitudeString);var isLongitudeValid=isUserInputValid(longitudeString);if(!isLatitudeValid&&!isLongitudeValid)
return null;var latitude=isLatitudeValid?parseFloat(latitudeString):-1;var longitude=isLongitudeValid?parseFloat(longitudeString):-1;return new WebInspector.OverridesSupport.GeolocationPosition(latitude,longitude,errorStatus?"PositionUnavailable":"");}
WebInspector.OverridesSupport.DeviceOrientation=function(alpha,beta,gamma)
{this.alpha=alpha;this.beta=beta;this.gamma=gamma;}
WebInspector.OverridesSupport.DeviceOrientation.prototype={toSetting:function()
{return JSON.stringify(this);}}
WebInspector.OverridesSupport.DeviceOrientation.parseSetting=function(value)
{if(value){var jsonObject=JSON.parse(value);return new WebInspector.OverridesSupport.DeviceOrientation(jsonObject.alpha,jsonObject.beta,jsonObject.gamma);}
return new WebInspector.OverridesSupport.DeviceOrientation(0,0,0);}
WebInspector.OverridesSupport.DeviceOrientation.parseUserInput=function(alphaString,betaString,gammaString)
{function isUserInputValid(value)
{if(!value)
return true;return/^[-]?[0-9]*[.]?[0-9]*$/.test(value);}
if(!alphaString&&!betaString&&!gammaString)
return null;var isAlphaValid=isUserInputValid(alphaString);var isBetaValid=isUserInputValid(betaString);var isGammaValid=isUserInputValid(gammaString);if(!isAlphaValid&&!isBetaValid&&!isGammaValid)
return null;var alpha=isAlphaValid?parseFloat(alphaString):-1;var beta=isBetaValid?parseFloat(betaString):-1;var gamma=isGammaValid?parseFloat(gammaString):-1;return new WebInspector.OverridesSupport.DeviceOrientation(alpha,beta,gamma);}
WebInspector.OverridesSupport.deviceSizeValidator=function(value)
{if(!value||(/^[\d]+$/.test(value)&&value>=0&&value<=WebInspector.OverridesSupport.MaxDeviceSize))
return"";return WebInspector.UIString("Value must be non-negative integer");}
WebInspector.OverridesSupport.deviceScaleFactorValidator=function(value)
{if(!value||(/^[\d]+(\.\d+)?|\.\d+$/.test(value)&&value>=0&&value<=10))
return"";return WebInspector.UIString("Value must be non-negative float");}
WebInspector.OverridesSupport._touchEventsScriptIdSymbol=Symbol("OverridesSupport.touchEventsScriptIdSymbol");WebInspector.OverridesSupport.prototype={canEmulate:function()
{return!!this._target&&this._targetCanEmulate;},emulationEnabled:function()
{return this.canEmulate()&&this.settings._emulationEnabled.get();},setEmulationEnabled:function(enabled)
{if(this.canEmulate()){this.settings._emulationEnabled.set(enabled);this.dispatchEventToListeners(WebInspector.OverridesSupport.Events.EmulationStateChanged);if(enabled&&this.settings.emulateResolution.get())
this._target.emulationAgent().resetScrollAndPageScaleFactor();}},init:function(target,callback)
{if(target.isPage())
target.emulationAgent().canEmulate(canEmulateCallback.bind(this));else
canEmulateCallback.call(this,null,false);function canEmulateCallback(error,canEmulate)
{this._target=target;this._targetCanEmulate=!error&&canEmulate;this._initialized=true;if(this.canEmulate()){target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated,this._onMainFrameNavigated,this);if(!Runtime.experiments.isEnabled("deviceMode")){var domModel=WebInspector.DOMModel.fromTarget(this._target);if(domModel)
domModel.addEventListener(WebInspector.DOMModel.Events.InspectModeWillBeToggled,this._inspectModeWillBeToggled,this);}
this._applyInitialOverrides();}
this.dispatchEventToListeners(WebInspector.OverridesSupport.Events.EmulationStateChanged);callback();}},setPageResizer:function(pageResizer,availableSize,insets)
{if(pageResizer===this._pageResizer)
return;if(this._pageResizer){this._pageResizer.removeEventListener(WebInspector.OverridesSupport.PageResizer.Events.AvailableSizeChanged,this._onPageResizerAvailableSizeChanged,this);this._pageResizer.removeEventListener(WebInspector.OverridesSupport.PageResizer.Events.ResizeRequested,this._onPageResizerResizeRequested,this);this._pageResizer.removeEventListener(WebInspector.OverridesSupport.PageResizer.Events.FixedScaleRequested,this._onPageResizerFixedScaleRequested,this);this._pageResizer.removeEventListener(WebInspector.OverridesSupport.PageResizer.Events.InsetsChanged,this._onPageResizerInsetsChanged,this);}
this._pageResizer=pageResizer;this._pageResizerAvailableSize=availableSize;this._pageResizerInsets=insets;if(this._pageResizer){this._pageResizer.addEventListener(WebInspector.OverridesSupport.PageResizer.Events.AvailableSizeChanged,this._onPageResizerAvailableSizeChanged,this);this._pageResizer.addEventListener(WebInspector.OverridesSupport.PageResizer.Events.ResizeRequested,this._onPageResizerResizeRequested,this);this._pageResizer.addEventListener(WebInspector.OverridesSupport.PageResizer.Events.FixedScaleRequested,this._onPageResizerFixedScaleRequested,this);this._pageResizer.addEventListener(WebInspector.OverridesSupport.PageResizer.Events.InsetsChanged,this._onPageResizerInsetsChanged,this);}
this._deviceMetricsChanged(false);},emulateDevice:function(device)
{this._deviceMetricsChangedListenerMuted=true;this._userAgentChangedListenerMuted=true;this.settings.userAgent.set(device.userAgent);this.settings.emulateResolution.set(true);this.settings.deviceWidth.set(device.width);this.settings.deviceHeight.set(device.height);this.settings.deviceScaleFactor.set(device.deviceScaleFactor);this.settings.emulateTouch.set(device.touch);this.settings.emulateMobile.set(device.mobile);delete this._deviceMetricsChangedListenerMuted;delete this._userAgentChangedListenerMuted;if(this._initialized){this._deviceMetricsChanged(true);this._userAgentChanged();}},reset:function()
{this._deviceMetricsChangedListenerMuted=true;this._userAgentChangedListenerMuted=true;this.settings.userAgent.set("");this.settings.emulateResolution.set(false);this.settings.deviceScaleFactor.set(0);this.settings.emulateTouch.set(false);this.settings.emulateMobile.set(false);this.settings.screenOrientationOverride.set("");delete this._deviceMetricsChangedListenerMuted;delete this._userAgentChangedListenerMuted;if(this._initialized){this._deviceMetricsChanged(false);this._userAgentChanged();}},isEmulatingDevice:function(device)
{var sameResolution=this.settings.emulateResolution.get()?(this.settings.deviceWidth.get()===device.width&&this.settings.deviceHeight.get()===device.height&&this.settings.deviceScaleFactor.get()===device.deviceScaleFactor):(!device.width&&!device.height&&!device.deviceScaleFactor);return this.settings.userAgent.get()===device.userAgent&&this.settings.emulateTouch.get()===device.touch&&this.settings.emulateMobile.get()===device.mobile&&sameResolution;},_inspectModeWillBeToggled:function(event)
{var inspectModeEnabled=(event.data);this._touchEmulationSuspended=inspectModeEnabled;this._emulateTouchEventsChanged();},_applyInitialOverrides:function()
{this.settings._emulationEnabled.addChangeListener(this._userAgentChanged,this);this.settings.userAgent.addChangeListener(this._userAgentChanged,this);this.settings._emulationEnabled.addChangeListener(this._deviceMetricsChanged.bind(this,false));this.settings.emulateResolution.addChangeListener(this._deviceMetricsChanged.bind(this,false));this.settings.deviceWidth.addChangeListener(this._deviceMetricsChanged.bind(this,false));this.settings.deviceHeight.addChangeListener(this._deviceMetricsChanged.bind(this,false));this.settings.deviceScaleFactor.addChangeListener(this._deviceMetricsChanged.bind(this,false));this.settings.emulateMobile.addChangeListener(this._deviceMetricsChanged.bind(this,false));this.settings.deviceFitWindow.addChangeListener(this._deviceMetricsChanged.bind(this,false));this.settings.geolocationOverride.addChangeListener(this._geolocationPositionChanged,this);this.settings.deviceOrientationOverride.addChangeListener(this._deviceOrientationChanged,this);this.settings._emulationEnabled.addChangeListener(this._screenOrientationChanged,this);this.settings.screenOrientationOverride.addChangeListener(this._screenOrientationChanged,this);this.settings._emulationEnabled.addChangeListener(this._emulateTouchEventsChanged,this);this.settings.emulateTouch.addChangeListener(this._emulateTouchEventsChanged,this);this.settings.javaScriptDisabled.addChangeListener(this._javaScriptDisabledChanged,this);this._javaScriptDisabledChanged();this.settings._emulationEnabled.addChangeListener(this._showRulersChanged,this);WebInspector.moduleSetting("showMetricsRulers").addChangeListener(this._showRulersChanged,this);this._showRulersChanged();if(this.emulationEnabled()){if(this.settings.screenOrientationOverride.get())
this._screenOrientationChanged();if(this.settings.emulateTouch.get())
this._emulateTouchEventsChanged();this._deviceMetricsChanged(true);this._userAgentChanged();}},_userAgentChanged:function()
{if(this._userAgentChangedListenerMuted)
return;var userAgent=this.emulationEnabled()?this.settings.userAgent.get():"";WebInspector.multitargetNetworkManager.setUserAgentOverride(userAgent);if(this._userAgent!==userAgent)
this._updateUserAgentWarningMessage(WebInspector.UIString("You might need to reload the page for proper user agent spoofing and viewport rendering."));this._userAgent=userAgent;},_onPageResizerAvailableSizeChanged:function(event)
{this._pageResizerAvailableSize=(event.data.size);this._pageResizerInsets=(event.data.insets);this._deviceMetricsChanged(false);},_onPageResizerInsetsChanged:function(event)
{var insets=(event.data);if(!insets.isEqual(this._pageResizerInsets)){this._pageResizerInsets=insets;this._deviceMetricsChanged(false);}},_onPageResizerResizeRequested:function(event)
{if(typeof event.data.width!=="undefined"){var width=(event.data.width);if(width!==this.settings.deviceWidth.get())
this.settings.deviceWidth.set(width);}
if(typeof event.data.height!=="undefined"){var height=(event.data.height);if(height!==this.settings.deviceHeight.get())
this.settings.deviceHeight.set(height);}},_onPageResizerFixedScaleRequested:function(event)
{this._fixedDeviceScale=(event.data);this._deviceMetricsChanged(false);},_deviceMetricsChanged:function(resetScrollAndPageScale)
{if(!this._initialized)
return;this._showRulersChanged();if(this._deviceMetricsChangedListenerMuted)
return;if(!this.emulationEnabled()){this._deviceMetricsThrottler.schedule(clearDeviceMetricsOverride.bind(this));if(this._pageResizer)
this._pageResizer.update(0,0,1,0,0);return;}
var dipWidth=this.settings.emulateResolution.get()?this.settings.deviceWidth.get():0;var dipHeight=this.settings.emulateResolution.get()?this.settings.deviceHeight.get():0;var overrideWidth=dipWidth;var overrideHeight=dipHeight;var screenWidth=dipWidth;var screenHeight=dipHeight;var positionX=0;var positionY=0;var scale=1;if(this._pageResizer){var available=this._pageResizerAvailableSize;var insets=this._pageResizerInsets;if(this.settings.deviceFitWindow.get()){if(this._fixedDeviceScale){scale=this._deviceScale;}else{scale=1;while(available.width<(dipWidth+insets.left+insets.right)*scale||available.height<(dipHeight+insets.top+insets.bottom)*scale)
scale*=0.8;}}
this._pageResizer.update(Math.min(dipWidth*scale,available.width-insets.left*scale),Math.min(dipHeight*scale,available.height-insets.top*scale),scale,(dipWidth+insets.left+insets.right)*scale,(dipHeight+insets.top+insets.bottom)*scale);if(scale===1&&available.width>=dipWidth&&available.height>=dipHeight){overrideWidth=0;overrideHeight=0;}
if(dipWidth===0&&dipHeight!==0)
overrideWidth=Math.round(available.width/scale);if(dipHeight===0&&dipWidth!==0)
overrideHeight=Math.round(available.height/scale);screenWidth=dipWidth+insets.left+insets.right;screenHeight=dipHeight+insets.top+insets.bottom;positionX=insets.left;positionY=insets.top;}
this._deviceScale=scale;this._deviceMetricsThrottler.schedule(setDeviceMetricsOverride.bind(this));function setDeviceMetricsOverride()
{var setDevicePromise=this._target.emulationAgent().setDeviceMetricsOverride(overrideWidth,overrideHeight,this.settings.emulateResolution.get()?this.settings.deviceScaleFactor.get():0,this.settings.emulateMobile.get(),this._pageResizer?false:this.settings.deviceFitWindow.get(),scale,0,0,screenWidth,screenHeight,positionX,positionY,apiCallback.bind(this))
var allPromises=[setDevicePromise];if(resetScrollAndPageScale)
allPromises.push(this._target.emulationAgent().resetScrollAndPageScaleFactor());return Promise.all(allPromises);}
function clearDeviceMetricsOverride()
{return this._target.emulationAgent().clearDeviceMetricsOverride(apiCallback.bind(this))}
function apiCallback(error)
{if(error){this._updateDeviceMetricsWarningMessage(WebInspector.UIString("Screen emulation is not available on this page."));this._deviceMetricsOverrideAppliedForTest();return;}
var mobileEnabled=this.emulationEnabled()&&this.settings.emulateMobile.get();if(this._emulateMobileEnabled!==mobileEnabled)
this._updateDeviceMetricsWarningMessage(WebInspector.UIString("You might need to reload the page for proper user agent spoofing and viewport rendering."));this._emulateMobileEnabled=mobileEnabled;this._deviceMetricsOverrideAppliedForTest();}},_deviceMetricsOverrideAppliedForTest:function()
{},setGeolocationOverrideEnabled:function(enabled)
{this._overrideGeolocation=enabled;this._geolocationPositionChanged();},_geolocationPositionChanged:function()
{if(!this._overrideGeolocation){this._target.emulationAgent().clearGeolocationOverride();return;}
var geolocation=WebInspector.OverridesSupport.GeolocationPosition.parseSetting(this.settings.geolocationOverride.get());if(geolocation.error)
this._target.emulationAgent().setGeolocationOverride();else
this._target.emulationAgent().setGeolocationOverride(geolocation.latitude,geolocation.longitude,150);},setDeviceOrientationOverrideEnabled:function(enabled)
{this._overrideDeviceOrientation=enabled;this._deviceOrientationChanged();},_deviceOrientationChanged:function()
{if(!this._overrideDeviceOrientation){this._target.deviceOrientationAgent().clearDeviceOrientationOverride();return;}
var deviceOrientation=WebInspector.OverridesSupport.DeviceOrientation.parseSetting(this.settings.deviceOrientationOverride.get());this._target.deviceOrientationAgent().setDeviceOrientationOverride(deviceOrientation.alpha,deviceOrientation.beta,deviceOrientation.gamma);},_screenOrientationChanged:function()
{if(!this.emulationEnabled()||!this.settings.screenOrientationOverride.get()){this._target.screenOrientationAgent().clearScreenOrientationOverride();return;}
var screenOrientation=this.settings.screenOrientationOverride.get();this._target.screenOrientationAgent().setScreenOrientationOverride(screenOrientation==="landscapePrimary"?90:0,screenOrientation);},_emulateTouchEventsChanged:function()
{var emulationEnabled=this.emulationEnabled()&&this.settings.emulateTouch.get()&&!this._touchEmulationSuspended;var configuration=this.settings.emulateMobile.get()?"mobile":"desktop";var target=this._target;const injectedFunction=function(){const touchEvents=["ontouchstart","ontouchend","ontouchmove","ontouchcancel"];var recepients=[window.__proto__,document.__proto__];for(var i=0;i<touchEvents.length;++i){for(var j=0;j<recepients.length;++j){if(!(touchEvents[i]in recepients[j]))
Object.defineProperty(recepients[j],touchEvents[i],{value:null,writable:true,configurable:true,enumerable:true});}}};var symbol=WebInspector.OverridesSupport._touchEventsScriptIdSymbol;if(typeof target[symbol]!=="undefined"){target.pageAgent().removeScriptToEvaluateOnLoad(target[symbol]);delete target[symbol];}
if(emulationEnabled)
target.pageAgent().addScriptToEvaluateOnLoad("("+injectedFunction.toString()+")()",scriptAddedCallback);function scriptAddedCallback(error,scriptId)
{if(error)
delete target[symbol];else
target[symbol]=scriptId;}
target.emulationAgent().setTouchEmulationEnabled(emulationEnabled,configuration);},_javaScriptDisabledChanged:function()
{this._target.emulationAgent().setScriptExecutionDisabled(this.settings.javaScriptDisabled.get());},_pageResizerActive:function()
{return this._pageResizer&&this.emulationEnabled();},_showRulersChanged:function()
{var showRulersValue=WebInspector.moduleSetting("showMetricsRulers").get();for(var target of WebInspector.targetManager.targets(WebInspector.Target.Type.Page)){var domModel=WebInspector.DOMModel.fromTarget(target);if(domModel)
domModel.setHighlightSettings(showRulersValue&&!this._pageResizerActive(),showRulersValue);}},_onMainFrameNavigated:function()
{if(!Runtime.experiments.isEnabled("deviceMode"))
this._deviceMetricsChanged(false);this._updateUserAgentWarningMessage("");this._updateDeviceMetricsWarningMessage("");},_dispatchWarningChanged:function()
{this.dispatchEventToListeners(WebInspector.OverridesSupport.Events.OverridesWarningUpdated);},_updateDeviceMetricsWarningMessage:function(warningMessage)
{this._deviceMetricsWarningMessage=warningMessage;this._dispatchWarningChanged();},_updateUserAgentWarningMessage:function(warningMessage)
{this._userAgentWarningMessage=warningMessage;this._dispatchWarningChanged();},warningMessage:function()
{return this._deviceMetricsWarningMessage||this._userAgentWarningMessage||"";},clearWarningMessage:function()
{this._deviceMetricsWarningMessage="";this._userAgentWarningMessage="";this._dispatchWarningChanged();},swapDimensions:function()
{var width=WebInspector.overridesSupport.settings.deviceWidth.get();var height=WebInspector.overridesSupport.settings.deviceHeight.get();WebInspector.overridesSupport.settings.deviceWidth.set(height);WebInspector.overridesSupport.settings.deviceHeight.set(width);},__proto__:WebInspector.Object.prototype}
WebInspector.overridesSupport;;WebInspector.EmulatedDevice=function()
{this.title="";this.type=WebInspector.EmulatedDevice.Type.Unknown;this.vertical={width:0,height:0,outlineInsets:null,outlineImage:null};this.horizontal={width:0,height:0,outlineInsets:null,outlineImage:null};this.deviceScaleFactor=1;this.capabilities=[WebInspector.EmulatedDevice.Capability.Touch,WebInspector.EmulatedDevice.Capability.Mobile];this.userAgent="";this.modes=[];this._show=WebInspector.EmulatedDevice._Show.Default;this._showByDefault=true;this._extension=null;}
WebInspector.EmulatedDevice.Mode;WebInspector.EmulatedDevice.Orientation;WebInspector.EmulatedDevice.Horizontal="horizontal";WebInspector.EmulatedDevice.Vertical="vertical";WebInspector.EmulatedDevice.Type={Phone:"phone",Tablet:"tablet",Notebook:"notebook",Desktop:"desktop",Unknown:"unknown"}
WebInspector.EmulatedDevice.Capability={Touch:"touch",Mobile:"mobile"}
WebInspector.EmulatedDevice._Show={Always:"Always",Default:"Default",Never:"Never"}
WebInspector.EmulatedDevice.fromJSONV1=function(json)
{try{function parseValue(object,key,type,defaultValue)
{if(typeof object!=="object"||object===null||!object.hasOwnProperty(key)){if(typeof defaultValue!=="undefined")
return defaultValue;throw new Error("Emulated device is missing required property '"+key+"'");}
var value=object[key];if(typeof value!==type||value===null)
throw new Error("Emulated device property '"+key+"' has wrong type '"+typeof value+"'");return value;}
function parseIntValue(object,key)
{var value=(parseValue(object,key,"number"));if(value!==Math.abs(value))
throw new Error("Emulated device value '"+key+"' must be integer");return value;}
function parseInsets(json)
{return new Insets(parseIntValue(json,"left"),parseIntValue(json,"top"),parseIntValue(json,"right"),parseIntValue(json,"bottom"));}
function parseOrientation(json)
{var result={};result.width=parseIntValue(json,"width");if(result.width<0||result.width>WebInspector.OverridesSupport.MaxDeviceSize)
throw new Error("Emulated device has wrong width: "+result.width);result.height=parseIntValue(json,"height");if(result.height<0||result.height>WebInspector.OverridesSupport.MaxDeviceSize)
throw new Error("Emulated device has wrong height: "+result.height);var outlineInsets=parseValue(json["outline"],"insets","object",null);if(outlineInsets){result.outlineInsets=parseInsets(outlineInsets);if(result.outlineInsets.left<0||result.outlineInsets.top<0)
throw new Error("Emulated device has wrong outline insets");result.outlineImage=(parseValue(json["outline"],"image","string"));}
return(result);}
var result=new WebInspector.EmulatedDevice();result.title=(parseValue(json,"title","string"));result.type=(parseValue(json,"type","string"));result.userAgent=(parseValue(json,"user-agent","string"));var capabilities=parseValue(json,"capabilities","object",[]);if(!Array.isArray(capabilities))
throw new Error("Emulated device capabilities must be an array");result.capabilities=[];for(var i=0;i<capabilities.length;++i){if(typeof capabilities[i]!=="string")
throw new Error("Emulated device capability must be a string");result.capabilities.push(capabilities[i]);}
result.deviceScaleFactor=(parseValue(json["screen"],"device-pixel-ratio","number"));if(result.deviceScaleFactor<0||result.deviceScaleFactor>100)
throw new Error("Emulated device has wrong deviceScaleFactor: "+result.deviceScaleFactor);result.vertical=parseOrientation(parseValue(json["screen"],"vertical","object"));result.horizontal=parseOrientation(parseValue(json["screen"],"horizontal","object"));var modes=parseValue(json,"modes","object",[]);if(!Array.isArray(modes))
throw new Error("Emulated device modes must be an array");result.modes=[];for(var i=0;i<modes.length;++i){var mode={};mode.title=(parseValue(modes[i],"title","string"));mode.orientation=(parseValue(modes[i],"orientation","string"));if(mode.orientation!==WebInspector.EmulatedDevice.Vertical&&mode.orientation!==WebInspector.EmulatedDevice.Horizontal)
throw new Error("Emulated device mode has wrong orientation '"+mode.orientation+"'");var orientation=result.orientationByName(mode.orientation);mode.insets=parseInsets(parseValue(modes[i],"insets","object"));if(mode.insets.top<0||mode.insets.left<0||mode.insets.right<0||mode.insets.bottom<0||mode.insets.top+mode.insets.bottom>orientation.height||mode.insets.left+mode.insets.right>orientation.width){throw new Error("Emulated device mode '"+mode.title+"'has wrong mode insets");}
mode.image=(parseValue(modes[i],"image","string",null));result.modes.push(mode);}
result._showByDefault=(parseValue(json,"show-by-default","boolean",undefined));result._show=(parseValue(json,"show","string",WebInspector.EmulatedDevice._Show.Default));return result;}catch(e){WebInspector.console.error("Failed to update emulated device list. "+String(e));return null;}}
WebInspector.EmulatedDevice.fromOverridesDevice=function(device,title,type)
{var result=new WebInspector.EmulatedDevice();result.title=title;result.type=type||WebInspector.EmulatedDevice.Type.Unknown;result.vertical.width=device.width;result.vertical.height=device.height;result.horizontal.width=device.height;result.horizontal.height=device.width;result.deviceScaleFactor=device.deviceScaleFactor;result.userAgent=device.userAgent;result.capabilities=[];if(device.touch)
result.capabilities.push(WebInspector.EmulatedDevice.Capability.Touch);if(device.mobile)
result.capabilities.push(WebInspector.EmulatedDevice.Capability.Mobile);return result;}
WebInspector.EmulatedDevice.deviceComparator=function(device1,device2)
{var order1=(device1._extension&&device1._extension.descriptor()["order"])||-1;var order2=(device2._extension&&device2._extension.descriptor()["order"])||-1;if(order1>order2)
return 1;if(order2>order1)
return-1;return device1.title<device2.title?-1:(device1.title>device2.title?1:0);}
WebInspector.EmulatedDevice.prototype={extension:function()
{return this._extension;},setExtension:function(extension)
{this._extension=extension;},modesForOrientation:function(orientation)
{var result=[];for(var index=0;index<this.modes.length;index++){if(this.modes[index].orientation===orientation)
result.push(this.modes[index]);}
return result;},_toJSON:function()
{var json={};json["title"]=this.title;json["type"]=this.type;json["user-agent"]=this.userAgent;json["capabilities"]=this.capabilities;json["screen"]={};json["screen"]["device-pixel-ratio"]=this.deviceScaleFactor;json["screen"]["vertical"]=this._orientationToJSON(this.vertical);json["screen"]["horizontal"]=this._orientationToJSON(this.horizontal);json["modes"]=[];for(var i=0;i<this.modes.length;++i){var mode={};mode["title"]=this.modes[i].title;mode["orientation"]=this.modes[i].orientation;mode["insets"]={};mode["insets"]["left"]=this.modes[i].insets.left;mode["insets"]["top"]=this.modes[i].insets.top;mode["insets"]["right"]=this.modes[i].insets.right;mode["insets"]["bottom"]=this.modes[i].insets.bottom;if(this.modes[i].image)
mode["image"]=this.modes[i].image;json["modes"].push(mode);}
json["show-by-default"]=this._showByDefault;json["show"]=this._show;return json;},_orientationToJSON:function(orientation)
{var json={};json["width"]=orientation.width;json["height"]=orientation.height;if(orientation.outlineInsets){json["outline"]={};json["outline"]["insets"]={};json["outline"]["insets"]["left"]=orientation.outlineInsets.left;json["outline"]["insets"]["top"]=orientation.outlineInsets.top;json["outline"]["insets"]["right"]=orientation.outlineInsets.right;json["outline"]["insets"]["bottom"]=orientation.outlineInsets.bottom;json["outline"]["image"]=orientation.outlineImage;}
return json;},modeToOverridesDevice:function(mode)
{var result={};var orientation=this.orientationByName(mode.orientation);result.width=orientation.width-mode.insets.left-mode.insets.right;result.height=orientation.height-mode.insets.top-mode.insets.bottom;result.deviceScaleFactor=this.deviceScaleFactor;result.userAgent=this.userAgent;result.touch=this.touch();result.mobile=this.mobile();return result;},modeImage:function(mode)
{if(!mode.image)
return"";if(!this._extension)
return mode.image;return this._extension.module().substituteURL(mode.image);},orientationByName:function(name)
{return name===WebInspector.EmulatedDevice.Vertical?this.vertical:this.horizontal;},show:function()
{if(this._show===WebInspector.EmulatedDevice._Show.Default)
return this._showByDefault;return this._show===WebInspector.EmulatedDevice._Show.Always;},setShow:function(show)
{this._show=show?WebInspector.EmulatedDevice._Show.Always:WebInspector.EmulatedDevice._Show.Never;},copyShowFrom:function(other)
{this._show=other._show;},touch:function()
{return this.capabilities.indexOf(WebInspector.EmulatedDevice.Capability.Touch)!==-1;},mobile:function()
{return this.capabilities.indexOf(WebInspector.EmulatedDevice.Capability.Mobile)!==-1;}}
WebInspector.EmulatedDevicesList=function()
{WebInspector.Object.call(this);this._standardSetting=WebInspector.settings.createSetting("standardEmulatedDeviceList",[]);this._standard=this._listFromJSONV1(this._standardSetting.get());this._updateStandardDevices();this._customSetting=WebInspector.settings.createSetting("customEmulatedDeviceList",[]);this._custom=this._listFromJSONV1(this._customSetting.get());}
WebInspector.EmulatedDevicesList.Events={CustomDevicesUpdated:"CustomDevicesUpdated",StandardDevicesUpdated:"StandardDevicesUpdated"}
WebInspector.EmulatedDevicesList.prototype={_updateStandardDevices:function()
{var devices=[];var extensions=self.runtime.extensions("emulated-device");for(var i=0;i<extensions.length;++i){var device=WebInspector.EmulatedDevice.fromJSONV1(extensions[i].descriptor()["device"]);device.setExtension(extensions[i]);devices.push(device);}
this._copyShowValues(this._standard,devices);this._standard=devices;this.saveStandardDevices();},_listFromJSONV1:function(jsonArray)
{var result=[];if(!Array.isArray(jsonArray))
return result;for(var i=0;i<jsonArray.length;++i){var device=WebInspector.EmulatedDevice.fromJSONV1(jsonArray[i]);if(device){result.push(device);if(!device.modes.length){device.modes.push({title:"",orientation:WebInspector.EmulatedDevice.Horizontal,insets:new Insets(0,0,0,0),image:null});device.modes.push({title:"",orientation:WebInspector.EmulatedDevice.Vertical,insets:new Insets(0,0,0,0),image:null});}}}
return result;},standard:function()
{return this._standard;},custom:function()
{return this._custom;},revealCustomSetting:function()
{WebInspector.Revealer.reveal(this._customSetting);},addCustomDevice:function(device)
{this._custom.push(device);this.saveCustomDevices();},removeCustomDevice:function(device)
{this._custom.remove(device);this.saveCustomDevices();},saveCustomDevices:function()
{var json=this._custom.map(function(device){return device._toJSON();});this._customSetting.set(json);this.dispatchEventToListeners(WebInspector.EmulatedDevicesList.Events.CustomDevicesUpdated);},saveStandardDevices:function()
{var json=this._standard.map(function(device){return device._toJSON();});this._standardSetting.set(json);this.dispatchEventToListeners(WebInspector.EmulatedDevicesList.Events.StandardDevicesUpdated);},_copyShowValues:function(from,to)
{var deviceById=new Map();for(var i=0;i<from.length;++i)
deviceById.set(from[i].title,from[i]);for(var i=0;i<to.length;++i){var title=to[i].title;if(deviceById.has(title))
to[i].copyShowFrom((deviceById.get(title)));}},__proto__:WebInspector.Object.prototype}
WebInspector.emulatedDevicesList;;WebInspector.DevicesSettingsTab=function()
{WebInspector.VBox.call(this);this.element.classList.add("settings-tab-container");this.element.classList.add("devices-settings-tab");this.registerRequiredCSS("emulation/devicesSettingsTab.css");var header=this.element.createChild("header");header.createChild("h3").createTextChild(WebInspector.UIString("Emulated Devices"));this.containerElement=this.element.createChild("div","help-container-wrapper").createChild("div","settings-tab help-content help-container");var buttonsRow=this.containerElement.createChild("div","devices-button-row");this._addCustomButton=createTextButton(WebInspector.UIString("Add custom device..."),this._addCustomDevice.bind(this));buttonsRow.appendChild(this._addCustomButton);this._list=new WebInspector.ListWidget(this);this._list.registerRequiredCSS("emulation/devicesSettingsTab.css");this._list.element.classList.add("devices-list");this._list.show(this.containerElement);this._muteUpdate=false;WebInspector.emulatedDevicesList.addEventListener(WebInspector.EmulatedDevicesList.Events.CustomDevicesUpdated,this._devicesUpdated,this);WebInspector.emulatedDevicesList.addEventListener(WebInspector.EmulatedDevicesList.Events.StandardDevicesUpdated,this._devicesUpdated,this);this.setDefaultFocusedElement(this._addCustomButton);}
WebInspector.DevicesSettingsTab.prototype={wasShown:function()
{WebInspector.VBox.prototype.wasShown.call(this);this._devicesUpdated();},_devicesUpdated:function()
{if(this._muteUpdate)
return;this._list.clear();var devices=WebInspector.emulatedDevicesList.custom().slice();for(var i=0;i<devices.length;++i)
this._list.appendItem(devices[i],true);this._list.appendSeparator();devices=WebInspector.emulatedDevicesList.standard().slice();devices.sort(WebInspector.EmulatedDevice.deviceComparator);for(var i=0;i<devices.length;++i)
this._list.appendItem(devices[i],false);},_muteAndSaveDeviceList:function(custom)
{this._muteUpdate=true;if(custom)
WebInspector.emulatedDevicesList.saveCustomDevices();else
WebInspector.emulatedDevicesList.saveStandardDevices();this._muteUpdate=false;},_addCustomDevice:function()
{var device=new WebInspector.EmulatedDevice();device.deviceScaleFactor=0;this._list.addNewItem(WebInspector.emulatedDevicesList.custom().length,device);},_toNumericInputValue:function(value)
{return value?String(value):"";},renderItem:function(item,editable)
{var device=(item);var element=createElementWithClass("div","devices-list-item");var checkbox=element.createChild("input","devices-list-checkbox");checkbox.type="checkbox";checkbox.checked=device.show();element.createChild("div","devices-list-title").textContent=device.title;element.addEventListener("click",onItemClicked.bind(this),false);return element;function onItemClicked(event)
{var show=!checkbox.checked;device.setShow(show);this._muteAndSaveDeviceList(editable);checkbox.checked=show;event.consume();}},removeItemRequested:function(item,index)
{WebInspector.emulatedDevicesList.removeCustomDevice((item));},commitEdit:function(item,editor,isNew)
{var device=(item);device.title=editor.control("title").value.trim();device.vertical.width=editor.control("width").value?parseInt(editor.control("width").value,10):0;device.vertical.height=editor.control("height").value?parseInt(editor.control("height").value,10):0;device.horizontal.width=device.vertical.height;device.horizontal.height=device.vertical.width;device.deviceScaleFactor=editor.control("scale").value?parseFloat(editor.control("scale").value):0;device.userAgent=editor.control("user-agent").value;device.modes=[];device.modes.push({title:"",orientation:WebInspector.EmulatedDevice.Vertical,insets:new Insets(0,0,0,0),images:null});device.modes.push({title:"",orientation:WebInspector.EmulatedDevice.Horizontal,insets:new Insets(0,0,0,0),images:null});if(isNew)
WebInspector.emulatedDevicesList.addCustomDevice(device);else
WebInspector.emulatedDevicesList.saveCustomDevices();this._addCustomButton.scrollIntoViewIfNeeded();this._addCustomButton.focus();},beginEdit:function(item)
{var device=(item);var editor=this._createEditor();editor.control("title").value=device.title;editor.control("width").value=this._toNumericInputValue(device.vertical.width);editor.control("height").value=this._toNumericInputValue(device.vertical.height);editor.control("scale").value=this._toNumericInputValue(device.deviceScaleFactor);editor.control("user-agent").value=device.userAgent;return editor;},_createEditor:function()
{if(this._editor)
return this._editor;var editor=new WebInspector.ListWidget.Editor();this._editor=editor;var content=editor.contentElement();var fields=content.createChild("div","devices-edit-fields");fields.appendChild(editor.createInput("title","text",WebInspector.UIString("Device name"),titleValidator));var screen=fields.createChild("div","hbox");var width=editor.createInput("width","text",WebInspector.UIString("Width"),sizeValidator);width.classList.add("device-edit-small");screen.appendChild(width);var height=editor.createInput("height","text",WebInspector.UIString("height"),sizeValidator);height.classList.add("device-edit-small");screen.appendChild(height);screen.appendChild(editor.createInput("scale","text",WebInspector.UIString("Device pixel ratio"),scaleValidator));fields.appendChild(editor.createInput("user-agent","text",WebInspector.UIString("User agent string"),userAgentValidator));return editor;function titleValidator(item,index,input)
{var value=input.value.trim();return value.length>0&&value.length<50;}
function sizeValidator(item,index,input)
{return!WebInspector.OverridesSupport.deviceSizeValidator(input.value);}
function scaleValidator(item,index,input)
{return!WebInspector.OverridesSupport.deviceScaleFactorValidator(input.value);}
function userAgentValidator(item,index,input)
{return true;}},__proto__:WebInspector.VBox.prototype};WebInspector.DeviceModeButtonProvider=function()
{var action=WebInspector.actionRegistry.action("emulation.toggle-device-mode");var button=WebInspector.Toolbar.createActionButton(action);WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport.Events.EmulationStateChanged,emulationEnabledChanged);WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport.Events.OverridesWarningUpdated,updateWarning);emulationEnabledChanged();updateWarning();function emulationEnabledChanged()
{action.setToggled(WebInspector.overridesSupport.emulationEnabled());}
function updateWarning()
{var message=WebInspector.overridesSupport.warningMessage();action.setTitle(message||WebInspector.UIString("Toggle device mode"));button.element.classList.toggle("warning",!!message);}
this._button=button;}
WebInspector.DeviceModeButtonProvider.prototype={item:function()
{return this._button;}}
WebInspector.ToggleDeviceModeActionDelegate=function()
{}
WebInspector.ToggleDeviceModeActionDelegate.prototype={handleAction:function(context,actionId)
{WebInspector.overridesSupport.setEmulationEnabled(!WebInspector.overridesSupport.emulationEnabled());return true;}};WebInspector.OverridesUI={}
WebInspector.DeviceSelect=function(rotateButton,callback)
{this._callback=callback;this._rotateButton=rotateButton;this.element=createElement("p");this._deviceSelectElement=this.element.createChild("select","device-select");this._deviceSelectElement.addEventListener("change",this._deviceSelected.bind(this),false);var container=this.element.createChild("div","mode-container");container.appendChild(this._rotateButton);this._rotateButton.addEventListener("click",this._rotateButtonClicked.bind(this),false);this._rotateButton.title=WebInspector.UIString("Change orientation");var modeSelectContainer=container.createChild("span","mode-select");this._modeSelectElement=modeSelectContainer.createChild("select");this._modeSelectElement.addEventListener("change",this._modeSelected.bind(this),false);this._modeLabelElement=modeSelectContainer.createChild("label");this._modeLabelElement.addEventListener("click",this._rotateButtonClicked.bind(this),false);this._modeLabelElement.title=WebInspector.UIString("Change orientation");this._emulatedSettingChangedMuted=false;this._lastOrientation=null;WebInspector.overridesSupport.settings.emulateResolution.addChangeListener(this._emulatedSettingChanged,this);WebInspector.overridesSupport.settings.deviceWidth.addChangeListener(this._emulatedSettingChanged,this);WebInspector.overridesSupport.settings.deviceHeight.addChangeListener(this._emulatedSettingChanged,this);WebInspector.overridesSupport.settings.deviceScaleFactor.addChangeListener(this._emulatedSettingChanged,this);WebInspector.overridesSupport.settings.emulateMobile.addChangeListener(this._emulatedSettingChanged,this);WebInspector.overridesSupport.settings.emulateTouch.addChangeListener(this._emulatedSettingChanged,this);WebInspector.overridesSupport.settings.userAgent.addChangeListener(this._emulatedSettingChanged,this);WebInspector.emulatedDevicesList.addEventListener(WebInspector.EmulatedDevicesList.Events.CustomDevicesUpdated,this._deviceListChanged,this);WebInspector.emulatedDevicesList.addEventListener(WebInspector.EmulatedDevicesList.Events.StandardDevicesUpdated,this._deviceListChanged,this);this._deviceListChanged();}
WebInspector.DeviceSelect.prototype={_deviceListChanged:function()
{this._deviceSelectElement.removeChildren();var selectDeviceOption=new Option(WebInspector.UIString("<Select model>"),WebInspector.UIString("<Select model>"));selectDeviceOption.device=null;selectDeviceOption.lastSelectedIndex=0;selectDeviceOption.disabled=true;this._deviceSelectElement.appendChild(selectDeviceOption);this._addDeviceGroup(WebInspector.UIString("Custom"),WebInspector.emulatedDevicesList.custom());this._addDeviceGroup(WebInspector.UIString("Devices"),WebInspector.emulatedDevicesList.standard());this._emulatedSettingChanged();},_addDeviceGroup:function(name,devices)
{devices=devices.filter(function(d){return d.show();});if(!devices.length)
return;devices.sort(WebInspector.EmulatedDevice.deviceComparator);var groupElement=this._deviceSelectElement.createChild("optgroup");groupElement.label=name;for(var i=0;i<devices.length;++i){var option=new Option(devices[i].title,devices[i].title);option.device=devices[i];option.lastSelectedIndex=0;groupElement.appendChild(option);}},_emulatedSettingChanged:function()
{if(this._emulatedSettingChangedMuted)
return;for(var i=1;i<this._deviceSelectElement.options.length;++i){var option=this._deviceSelectElement.options[i];var device=(option.device);for(var j=0;j<device.modes.length;j++){if(WebInspector.overridesSupport.isEmulatingDevice(device.modeToOverridesDevice(device.modes[j]))){this._select(device,device.modes[j]);return;}}}
this._select(null,null);},_select:function(device,mode)
{for(var i=0;i<this._deviceSelectElement.options.length;i++){if(this._deviceSelectElement.options[i].device===device)
this._deviceSelectElement.selectedIndex=i;}
this._updateModeSelect();for(var i=0;i<this._modeSelectElement.options.length;i++){if(this._modeSelectElement.options[i].mode===mode)
this._modeSelectElement.selectedIndex=i;}
this._updateModeControls();this._saveLastSelectedIndex();if(this._callback){var option=this._modeSelectElement.options[this._modeSelectElement.selectedIndex];this._callback(option.device,option.mode);}},_deviceSelected:function()
{this._updateModeSelect();this._modeSelected();},_updateModeSelect:function()
{this._modeSelectElement.removeChildren();var option=this._deviceSelectElement.options[this._deviceSelectElement.selectedIndex];var device=(option.device);if(this._deviceSelectElement.selectedIndex===0){this._addMode(device,null,"");}else if(device.modes.length===1){this._addMode(device,device.modes[0],WebInspector.UIString("Default"));}else{this._addOrientation(device,WebInspector.EmulatedDevice.Vertical,WebInspector.UIString("Portrait"));this._addOrientation(device,WebInspector.EmulatedDevice.Horizontal,WebInspector.UIString("Landscape"));}
this._updateRotateModes();var index=option.lastSelectedIndex;var modeOption=this._modeSelectElement.options[index];if(modeOption.rotateIndex!=-1){var rotateOption=this._modeSelectElement.options[modeOption.rotateIndex];if(rotateOption.mode&&rotateOption.mode.orientation===this._lastOrientation)
index=modeOption.rotateIndex;}
this._modeSelectElement.selectedIndex=index;this._updateModeControls();},_addOrientation:function(device,orientation,title)
{var modes=device.modesForOrientation(orientation);if(!modes.length)
return;if(modes.length===1){this._addMode(device,modes[0],title);}else{for(var index=0;index<modes.length;index++)
this._addMode(device,modes[index],title+" \u2013 "+modes[index].title);}},_addMode:function(device,mode,title)
{var option=new Option(title,title);option.mode=mode;option.device=device;this._modeSelectElement.appendChild(option);},_updateRotateModes:function()
{for(var i=0;i<this._modeSelectElement.options.length;i++){var modeI=this._modeSelectElement.options[i].mode;this._modeSelectElement.options[i].rotateIndex=-1;for(var j=0;j<this._modeSelectElement.options.length;j++){var modeJ=this._modeSelectElement.options[j].mode;if(modeI&&modeJ&&modeI.orientation!==modeJ.orientation&&modeI.title===modeJ.title)
this._modeSelectElement.options[i].rotateIndex=j;}}},_updateModeControls:function()
{this._modeLabelElement.textContent=this._modeSelectElement.options[this._modeSelectElement.selectedIndex].label;if(this._modeSelectElement.options.length<=1){this._modeSelectElement.classList.toggle("hidden",true);this._modeLabelElement.classList.toggle("hidden",true);}else{var showLabel=this._modeSelectElement.options.length===2&&this._modeSelectElement.options[0].rotateIndex===1;this._modeSelectElement.classList.toggle("hidden",showLabel);this._modeLabelElement.classList.toggle("hidden",!showLabel);}
this._rotateButton.classList.toggle("hidden",this._modeSelectElement.options[this._modeSelectElement.selectedIndex].rotateIndex===-1);},_modeSelected:function()
{this._saveLastSelectedIndex();this._updateModeControls();var option=this._modeSelectElement.options[this._modeSelectElement.selectedIndex];if(this._callback)
this._callback(option.device,option.mode);this._emulatedSettingChangedMuted=true;WebInspector.overridesSupport.emulateDevice(option.device.modeToOverridesDevice(option.mode));this._emulatedSettingChangedMuted=false;},_saveLastSelectedIndex:function()
{this._deviceSelectElement.options[this._deviceSelectElement.selectedIndex].lastSelectedIndex=this._modeSelectElement.selectedIndex;var option=this._modeSelectElement.options[this._modeSelectElement.selectedIndex];if(option.mode&&option.rotateIndex!=-1)
this._lastOrientation=option.mode.orientation;},_rotateButtonClicked:function()
{this._modeSelectElement.selectedIndex=this._modeSelectElement.options[this._modeSelectElement.selectedIndex].rotateIndex;this._modeSelected();}};WebInspector.InspectedPagePlaceholder=function()
{WebInspector.Widget.call(this);this.element.classList.add("inspected-page-placeholder");WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged,this._scheduleUpdate,this);this._margins={top:0,right:0,bottom:0,left:0};this.restoreMinimumSizeAndMargins();};WebInspector.InspectedPagePlaceholder.Events={Update:"Update"};WebInspector.InspectedPagePlaceholder.MarginValue=3;WebInspector.InspectedPagePlaceholder.prototype={_findMargins:function()
{var margins={top:0,right:0,bottom:0,left:0};if(this._useMargins){var adjacent={top:true,right:true,bottom:true,left:true};var widget=this;while(widget.parentWidget()){var parent=widget.parentWidget();if(parent instanceof WebInspector.SplitWidget){var side=parent.sidebarSide();if(adjacent[side]&&!parent.hasCustomResizer()&&parent.isResizable())
margins[side]=WebInspector.InspectedPagePlaceholder.MarginValue;adjacent[side]=false;}
widget=parent;}}
if(this._margins.top!==margins.top||this._margins.left!==margins.left||this._margins.right!==margins.right||this._margins.bottom!==margins.bottom){this._margins=margins;this._scheduleUpdate();}},onResize:function()
{this._findMargins();this._scheduleUpdate();},_scheduleUpdate:function()
{if(this._updateId)
this.element.window().cancelAnimationFrame(this._updateId);this._updateId=this.element.window().requestAnimationFrame(this.update.bind(this));},restoreMinimumSizeAndMargins:function()
{this._useMargins=true;this.setMinimumSize(50,50);this._findMargins();},clearMinimumSizeAndMargins:function()
{this._useMargins=false;this.setMinimumSize(1,1);this._findMargins();},_dipPageRect:function()
{var zoomFactor=WebInspector.zoomManager.zoomFactor();var rect=this.element.getBoundingClientRect();var bodyRect=this.element.ownerDocument.body.getBoundingClientRect();var left=Math.max(rect.left*zoomFactor+this._margins.left,bodyRect.left*zoomFactor);var top=Math.max(rect.top*zoomFactor+this._margins.top,bodyRect.top*zoomFactor);var bottom=Math.min(rect.bottom*zoomFactor-this._margins.bottom,bodyRect.bottom*zoomFactor);var right=Math.min(rect.right*zoomFactor-this._margins.right,bodyRect.right*zoomFactor);return{x:left,y:top,width:right-left,height:bottom-top};},update:function()
{delete this._updateId;var rect=this._dipPageRect();var bounds={x:Math.round(rect.x),y:Math.round(rect.y),height:Math.max(1,Math.round(rect.height)),width:Math.max(1,Math.round(rect.width))};this.dispatchEventToListeners(WebInspector.InspectedPagePlaceholder.Events.Update,bounds);},__proto__:WebInspector.Widget.prototype};;WebInspector.MediaQueryInspector=function(widthSetting)
{WebInspector.Widget.call(this,true);this.registerRequiredCSS("emulation/mediaQueryInspector.css");this.contentElement.classList.add("media-inspector-view","media-inspector-view-empty");this.contentElement.addEventListener("click",this._onMediaQueryClicked.bind(this),false);this.contentElement.addEventListener("contextmenu",this._onContextMenu.bind(this),false);this._mediaThrottler=new WebInspector.Throttler(0);this._widthSetting=widthSetting;this._offset=0;this._scale=1;this._lastReportedCount=0;WebInspector.targetManager.observeTargets(this);WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged,this._renderMediaQueries.bind(this),this);}
WebInspector.MediaQueryInspector.Section={Max:0,MinMax:1,Min:2}
WebInspector.MediaQueryInspector.Events={CountUpdated:"CountUpdated"}
WebInspector.MediaQueryInspector.prototype={targetAdded:function(target)
{if(this._cssModel)
return;this._cssModel=WebInspector.CSSStyleModel.fromTarget(target);if(!this._cssModel)
return;this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._scheduleMediaQueriesUpdate,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._scheduleMediaQueriesUpdate,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this._scheduleMediaQueriesUpdate,this);this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this._scheduleMediaQueriesUpdate,this);},targetRemoved:function(target)
{if(WebInspector.CSSStyleModel.fromTarget(target)!==this._cssModel)
return;this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetAdded,this._scheduleMediaQueriesUpdate,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetRemoved,this._scheduleMediaQueriesUpdate,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.StyleSheetChanged,this._scheduleMediaQueriesUpdate,this);this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events.MediaQueryResultChanged,this._scheduleMediaQueriesUpdate,this);delete this._cssModel;},setAxisTransform:function(offset,scale)
{if(this._offset===offset&&Math.abs(this._scale-scale)<1e-8)
return;this._offset=offset;this._scale=scale;this._renderMediaQueries();},setEnabled:function(enabled)
{this._enabled=enabled;this._scheduleMediaQueriesUpdate();},_onMediaQueryClicked:function(event)
{var mediaQueryMarker=event.target.enclosingNodeOrSelfWithClass("media-inspector-marker");if(!mediaQueryMarker)
return;var model=mediaQueryMarker._model;if(model.section()===WebInspector.MediaQueryInspector.Section.Max){this._widthSetting.set(model.maxWidthExpression().computedLength());return;}
if(model.section()===WebInspector.MediaQueryInspector.Section.Min){this._widthSetting.set(model.minWidthExpression().computedLength());return;}
var currentWidth=this._widthSetting.get();if(currentWidth!==model.minWidthExpression().computedLength())
this._widthSetting.set(model.minWidthExpression().computedLength());else
this._widthSetting.set(model.maxWidthExpression().computedLength());},_onContextMenu:function(event)
{if(!this._cssModel||!this._cssModel.isEnabled())
return;var mediaQueryMarker=event.target.enclosingNodeOrSelfWithClass("media-inspector-marker");if(!mediaQueryMarker)
return;var locations=mediaQueryMarker._locations;var uiLocations=new Map();for(var i=0;i<locations.length;++i){var uiLocation=WebInspector.cssWorkspaceBinding.rawLocationToUILocation(locations[i]);if(!uiLocation)
continue;var descriptor=String.sprintf("%s:%d:%d",uiLocation.uiSourceCode.url(),uiLocation.lineNumber+1,uiLocation.columnNumber+1);uiLocations.set(descriptor,uiLocation);}
var contextMenuItems=uiLocations.keysArray().sort();var contextMenu=new WebInspector.ContextMenu(event);var subMenuItem=contextMenu.appendSubMenuItem(WebInspector.UIString.capitalize("Reveal in ^source ^code"));for(var i=0;i<contextMenuItems.length;++i){var title=contextMenuItems[i];subMenuItem.appendItem(title,this._revealSourceLocation.bind(this,(uiLocations.get(title))));}
contextMenu.show();},_revealSourceLocation:function(location)
{WebInspector.Revealer.reveal(location);},_scheduleMediaQueriesUpdate:function()
{if(!this._enabled)
return;this._mediaThrottler.schedule(this._refetchMediaQueries.bind(this));},_refetchMediaQueries:function()
{if(!this._enabled||!this._cssModel)
return Promise.resolve();return this._cssModel.mediaQueriesPromise().then(this._rebuildMediaQueries.bind(this))},_squashAdjacentEqual:function(models)
{var filtered=[];for(var i=0;i<models.length;++i){var last=filtered.peekLast();if(!last||!last.equals(models[i]))
filtered.push(models[i]);}
return filtered;},_rebuildMediaQueries:function(cssMedias)
{var queryModels=[];for(var i=0;i<cssMedias.length;++i){var cssMedia=cssMedias[i];if(!cssMedia.mediaList)
continue;for(var j=0;j<cssMedia.mediaList.length;++j){var mediaQuery=cssMedia.mediaList[j];var queryModel=WebInspector.MediaQueryInspector.MediaQueryUIModel.createFromMediaQuery(cssMedia,mediaQuery);if(queryModel&&queryModel.rawLocation())
queryModels.push(queryModel);}}
queryModels.sort(compareModels);queryModels=this._squashAdjacentEqual(queryModels);var allEqual=this._cachedQueryModels&&this._cachedQueryModels.length==queryModels.length;for(var i=0;allEqual&&i<queryModels.length;++i)
allEqual=allEqual&&this._cachedQueryModels[i].equals(queryModels[i]);if(allEqual)
return;this._cachedQueryModels=queryModels;this._renderMediaQueries();function compareModels(model1,model2)
{return model1.compareTo(model2);}},_renderMediaQueries:function()
{if(!this._cachedQueryModels)
return;var markers=[];var lastMarker=null;for(var i=0;i<this._cachedQueryModels.length;++i){var model=this._cachedQueryModels[i];if(lastMarker&&lastMarker.model.dimensionsEqual(model)){lastMarker.locations.push(model.rawLocation());lastMarker.active=lastMarker.active||model.active();}else{lastMarker={active:model.active(),model:model,locations:[model.rawLocation()]};markers.push(lastMarker);}}
if(markers.length!==this._lastReportedCount){this._lastReportedCount=markers.length;this.dispatchEventToListeners(WebInspector.MediaQueryInspector.Events.CountUpdated,markers.length);}
if(!this.isShowing())
return;var oldChildrenCount=this.contentElement.children.length;this.contentElement.removeChildren();var container=null;for(var i=0;i<markers.length;++i){if(!i||markers[i].model.section()!==markers[i-1].model.section())
container=this.contentElement.createChild("div","media-inspector-marker-container");var marker=markers[i];var bar=this._createElementFromMediaQueryModel(marker.model);bar._model=marker.model;bar._locations=marker.locations;bar.classList.toggle("media-inspector-marker-inactive",!marker.active);container.appendChild(bar);}},_zoomFactor:function()
{return WebInspector.zoomManager.zoomFactor()/this._scale;},wasShown:function()
{this._renderMediaQueries();},_createElementFromMediaQueryModel:function(model)
{var zoomFactor=this._zoomFactor();var minWidthValue=model.minWidthExpression()?model.minWidthExpression().computedLength():0;const styleClassPerSection=["media-inspector-marker-max-width","media-inspector-marker-min-max-width","media-inspector-marker-min-width"];var markerElement=createElementWithClass("div","media-inspector-marker");var leftPixelValue=minWidthValue?(minWidthValue-this._offset)/zoomFactor:0;markerElement.style.left=leftPixelValue+"px";markerElement.classList.add(styleClassPerSection[model.section()]);var widthPixelValue=null;if(model.maxWidthExpression()&&model.minWidthExpression())
widthPixelValue=(model.maxWidthExpression().computedLength()-minWidthValue)/zoomFactor;else if(model.maxWidthExpression())
widthPixelValue=(model.maxWidthExpression().computedLength()-this._offset)/zoomFactor;else
markerElement.style.right="0";if(typeof widthPixelValue==="number")
markerElement.style.width=widthPixelValue+"px";if(model.minWidthExpression()){var labelClass=model.section()===WebInspector.MediaQueryInspector.Section.MinMax?"media-inspector-label-right":"media-inspector-label-left";var labelContainer=markerElement.createChild("div","media-inspector-marker-label-container media-inspector-marker-label-container-left");labelContainer.createChild("span","media-inspector-marker-label "+labelClass).textContent=model.minWidthExpression().value()+model.minWidthExpression().unit();}
if(model.maxWidthExpression()){var labelClass=model.section()===WebInspector.MediaQueryInspector.Section.MinMax?"media-inspector-label-left":"media-inspector-label-right";var labelContainer=markerElement.createChild("div","media-inspector-marker-label-container media-inspector-marker-label-container-right");labelContainer.createChild("span","media-inspector-marker-label "+labelClass).textContent=model.maxWidthExpression().value()+model.maxWidthExpression().unit();}
markerElement.title=model.mediaText();return markerElement;},__proto__:WebInspector.Widget.prototype};WebInspector.MediaQueryInspector.MediaQueryUIModel=function(cssMedia,minWidthExpression,maxWidthExpression,active)
{this._cssMedia=cssMedia;this._minWidthExpression=minWidthExpression;this._maxWidthExpression=maxWidthExpression;this._active=active;if(maxWidthExpression&&!minWidthExpression)
this._section=WebInspector.MediaQueryInspector.Section.Max;else if(minWidthExpression&&maxWidthExpression)
this._section=WebInspector.MediaQueryInspector.Section.MinMax;else
this._section=WebInspector.MediaQueryInspector.Section.Min;}
WebInspector.MediaQueryInspector.MediaQueryUIModel.createFromMediaQuery=function(cssMedia,mediaQuery)
{var maxWidthExpression=null;var maxWidthPixels=Number.MAX_VALUE;var minWidthExpression=null;var minWidthPixels=Number.MIN_VALUE;var expressions=mediaQuery.expressions();for(var i=0;i<expressions.length;++i){var expression=expressions[i];var feature=expression.feature();if(feature.indexOf("width")===-1)
continue;var pixels=expression.computedLength();if(feature.startsWith("max-")&&pixels<maxWidthPixels){maxWidthExpression=expression;maxWidthPixels=pixels;}else if(feature.startsWith("min-")&&pixels>minWidthPixels){minWidthExpression=expression;minWidthPixels=pixels;}}
if(minWidthPixels>maxWidthPixels||(!maxWidthExpression&&!minWidthExpression))
return null;return new WebInspector.MediaQueryInspector.MediaQueryUIModel(cssMedia,minWidthExpression,maxWidthExpression,mediaQuery.active());}
WebInspector.MediaQueryInspector.MediaQueryUIModel.prototype={equals:function(other)
{return this.compareTo(other)===0;},dimensionsEqual:function(other)
{return this.section()===other.section()&&(!this.minWidthExpression()||(this.minWidthExpression().computedLength()===other.minWidthExpression().computedLength()))&&(!this.maxWidthExpression()||(this.maxWidthExpression().computedLength()===other.maxWidthExpression().computedLength()));},compareTo:function(other)
{if(this.section()!==other.section())
return this.section()-other.section();if(this.dimensionsEqual(other)){var myLocation=this.rawLocation();var otherLocation=other.rawLocation();if(!myLocation&&!otherLocation)
return this.mediaText().compareTo(other.mediaText());if(myLocation&&!otherLocation)
return 1;if(!myLocation&&otherLocation)
return-1;if(this.active()!==other.active())
return this.active()?-1:1;return myLocation.url.compareTo(otherLocation.url)||myLocation.lineNumber-otherLocation.lineNumber||myLocation.columnNumber-otherLocation.columnNumber;}
if(this.section()===WebInspector.MediaQueryInspector.Section.Max)
return other.maxWidthExpression().computedLength()-this.maxWidthExpression().computedLength();if(this.section()===WebInspector.MediaQueryInspector.Section.Min)
return this.minWidthExpression().computedLength()-other.minWidthExpression().computedLength();return this.minWidthExpression().computedLength()-other.minWidthExpression().computedLength()||other.maxWidthExpression().computedLength()-this.maxWidthExpression().computedLength();},section:function()
{return this._section;},mediaText:function()
{return this._cssMedia.text;},rawLocation:function()
{if(!this._rawLocation)
this._rawLocation=this._cssMedia.rawLocation();return this._rawLocation;},minWidthExpression:function()
{return this._minWidthExpression;},maxWidthExpression:function()
{return this._maxWidthExpression;},active:function()
{return this._active;}};WebInspector.ResponsiveDesignView=function(inspectedPagePlaceholder)
{WebInspector.VBox.call(this);this.setMinimumSize(150,150);this.element.classList.add("responsive-design-view");this.registerRequiredCSS("emulation/responsiveDesignView.css");this._showMediaQueryInspectorSetting=WebInspector.settings.createSetting("showMediaQueryInspector",false);this._responsiveDesignContainer=new WebInspector.VBox();this._uiInitialized=false;this._inspectedPagePlaceholder=inspectedPagePlaceholder;inspectedPagePlaceholder.show(this.element);this._enabled=false;this._viewport={scrollX:0,scrollY:0,contentsWidth:0,contentsHeight:0,pageScaleFactor:1,minimumPageScaleFactor:1,maximumPageScaleFactor:1};this._drawContentsSize=true;this._deviceInsets=new Insets(0,0,0,0);this._pageContainerSrcset="";this._viewportChangedThrottler=new WebInspector.Throttler(0);this._pageScaleFactorThrottler=new WebInspector.Throttler(50);WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged,this._onZoomChanged,this);WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport.Events.EmulationStateChanged,this._emulationEnabledChanged,this);WebInspector.targetManager.observeTargets(this,WebInspector.Target.Type.Page);this._emulationEnabledChanged();};WebInspector.ResponsiveDesignView.RulerWidth=26;WebInspector.ResponsiveDesignView.RulerHeight=22;WebInspector.ResponsiveDesignView.RulerTopHeight=11;WebInspector.ResponsiveDesignView.RulerBottomHeight=9;WebInspector.ResponsiveDesignView.prototype={_ensureUIInitialized:function()
{if(this._uiInitialized)
return;this._uiInitialized=true;this._createToolbar();this._canvasContainer=new WebInspector.Widget();this._canvasContainer.element.classList.add("responsive-design");this._canvasContainer.show(this._responsiveDesignContainer.element);this._canvas=this._canvasContainer.element.createChild("canvas","fill responsive-design-canvas");this._mediaInspectorContainer=this._canvasContainer.element.createChild("div","responsive-design-media-container");WebInspector.Tooltip.addNativeOverrideContainer(this._mediaInspectorContainer);this._mediaInspector=new WebInspector.MediaQueryInspector(WebInspector.overridesSupport.settings.deviceWidth);this._updateMediaQueryInspector();WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport.Events.OverridesWarningUpdated,this._overridesWarningUpdated,this);this._slidersContainer=this._canvasContainer.element.createChild("div","vbox responsive-design-sliders-container");var genericDeviceOutline=this._slidersContainer.createChild("div","responsive-design-generic-outline-container");genericDeviceOutline.createChild("div","responsive-design-generic-outline");var widthSlider=this._slidersContainer.createChild("div","responsive-design-slider-width");widthSlider.createChild("div","responsive-design-thumb-handle");this._createResizer(widthSlider,true,false);var heightSlider=this._slidersContainer.createChild("div","responsive-design-slider-height");heightSlider.createChild("div","responsive-design-thumb-handle");this._createResizer(heightSlider,false,true);var cornerSlider=this._slidersContainer.createChild("div","responsive-design-slider-corner");this._createResizer(cornerSlider,true,true);this._pageContainer=this._slidersContainer.createChild("div","vbox flex-auto responsive-design-page-container");this._pageContainerImage=this._pageContainer.createChild("img","responsive-design-page-container-image hidden");this._pageContainerImage.addEventListener("load",this._onPageContainerImageLoaded.bind(this,true),false);this._pageContainerImage.addEventListener("error",this._onPageContainerImageLoaded.bind(this,false),false);this._pageScaleContainer=this._canvasContainer.element.createChild("div","hbox responsive-design-page-scale-container");this._decreasePageScaleButton=this._pageScaleContainer.createChild("button","responsive-design-page-scale-button responsive-design-page-scale-decrease");this._decreasePageScaleButton.createChild("div","glyph");this._decreasePageScaleButton.tabIndex=-1;this._decreasePageScaleButton.addEventListener("click",this._pageScaleButtonClicked.bind(this,false),false);this._pageScaleLabel=this._pageScaleContainer.createChild("label","responsive-design-page-scale-label");this._pageScaleLabel.title=WebInspector.UIString("Shift + drag to change page scale");this._pageScaleLabel.addEventListener("dblclick",this._resetPageScale.bind(this),false);this._increasePageScaleButton=this._pageScaleContainer.createChild("button","responsive-design-page-scale-button responsive-design-page-scale-increase");this._increasePageScaleButton.tabIndex=-1;this._increasePageScaleButton.createChild("div","glyph");this._increasePageScaleButton.addEventListener("click",this._pageScaleButtonClicked.bind(this,true),false);this._mediaInspector.addEventListener(WebInspector.MediaQueryInspector.Events.CountUpdated,this._updateMediaQueryInspectorButton,this);this._overridesWarningUpdated();},targetAdded:function(target)
{if(this._target)
return;this._target=target;target.registerEmulationDispatcher(new WebInspector.EmulationDispatcher(this));},targetRemoved:function(target)
{},_invalidateCache:function()
{delete this._cachedScale;delete this._cachedCssCanvasWidth;delete this._cachedCssCanvasHeight;delete this._cachedCssHeight;delete this._cachedCssWidth;delete this._cachedCssPageWidth;delete this._cachedCssPageHeight;delete this._cachedDeviceInsets;delete this._cachedZoomFactor;delete this._cachedViewport;delete this._cachedDrawContentsSize;delete this._cachedMediaInspectorHeight;delete this._availableSize;},_emulationEnabledChanged:function()
{var enabled=WebInspector.overridesSupport.emulationEnabled();if(enabled&&!this._enabled){WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.DeviceModeEnabled);this._invalidateCache();this._ignoreResize=true;this._ensureUIInitialized();this._enabled=true;this._mediaInspector.setEnabled(true);this._inspectedPagePlaceholder.clearMinimumSizeAndMargins();this._inspectedPagePlaceholder.show(this._pageContainer);this._responsiveDesignContainer.show(this.element);delete this._ignoreResize;this.onResize();}else if(!enabled&&this._enabled){this._mediaInspector.setEnabled(false);this._invalidateCache();this._ignoreResize=true;this._enabled=false;this._scale=1;this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins();this._responsiveDesignContainer.detach();this._inspectedPagePlaceholder.show(this.element);delete this._ignoreResize;this.onResize();}},update:function(dipWidth,dipHeight,scale,pageWidth,pageHeight)
{this._scale=scale;this._dipWidth=dipWidth?Math.max(dipWidth,1):0;this._dipHeight=dipHeight?Math.max(dipHeight,1):0;this._pageWidth=pageWidth?Math.max(pageWidth,1):0;this._pageHeight=pageHeight?Math.max(pageHeight,1):0;this._updateUI();},updatePageResizer:function()
{var available=this._availableDipSize();WebInspector.overridesSupport.setPageResizer(this,available.size,available.insets);},_availableDipSize:function()
{if(typeof this._availableSize==="undefined"){if(!this._enabled)
return{size:new Size(1,1),insets:new Insets(0,0,0,0)};var zoomFactor=WebInspector.zoomManager.zoomFactor();var rect=this._canvasContainer.element.getBoundingClientRect();var rulerTotalHeight=this._rulerTotalHeightDIP();this._availableSize={size:new Size(Math.max(rect.width*zoomFactor-WebInspector.ResponsiveDesignView.RulerWidth,1),Math.max(rect.height*zoomFactor-rulerTotalHeight,1)),insets:this._deviceInsets};}
return this._availableSize;},_createResizer:function(element,x,y)
{var resizer=new WebInspector.ResizerWidget();resizer.addElement(element);resizer.setCursor(x&&y?"nwse-resize":(x?"ew-resize":"ns-resize"));resizer.addEventListener(WebInspector.ResizerWidget.Events.ResizeStart,this._onResizeStart,this);resizer.addEventListener(WebInspector.ResizerWidget.Events.ResizeUpdate,this._onResizeUpdate.bind(this,x,y));resizer.addEventListener(WebInspector.ResizerWidget.Events.ResizeEnd,this._onResizeEnd,this);return resizer;},_onResizeStart:function(event)
{this._drawContentsSize=false;var available=this._availableDipSize().size;this._slowPositionStart=null;this._resizeStart={x:this._dipWidth||available.width,y:this._dipHeight||available.height};this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer.Events.FixedScaleRequested,true);this._updateUI();},_onResizeUpdate:function(x,y,event)
{if(event.data.shiftKey!==!!this._slowPositionStart)
this._slowPositionStart=event.data.shiftKey?{x:event.data.currentX,y:event.data.currentY}:null;var cssOffsetX=event.data.currentX-event.data.startX;var cssOffsetY=event.data.currentY-event.data.startY;if(this._slowPositionStart){cssOffsetX=(event.data.currentX-this._slowPositionStart.x)/10+this._slowPositionStart.x-event.data.startX;cssOffsetY=(event.data.currentY-this._slowPositionStart.y)/10+this._slowPositionStart.y-event.data.startY;}
var dipOffsetX=Math.round(cssOffsetX*WebInspector.zoomManager.zoomFactor());var dipOffsetY=Math.round(cssOffsetY*WebInspector.zoomManager.zoomFactor());var newSizeX=this._resizeStart.x+dipOffsetX;newSizeX=Math.round(newSizeX/(this._scale||1));newSizeX=Math.max(Math.min(newSizeX,WebInspector.OverridesSupport.MaxDeviceSize),1);var newSizeY=this._resizeStart.y+dipOffsetY;newSizeY=Math.round(newSizeY/(this._scale||1));newSizeY=Math.max(Math.min(newSizeY,WebInspector.OverridesSupport.MaxDeviceSize),1);var requested={};if(x)
requested.width=newSizeX;if(y)
requested.height=newSizeY;this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer.Events.ResizeRequested,requested);},_onResizeEnd:function(event)
{this._drawContentsSize=true;this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer.Events.FixedScaleRequested,false);delete this._resizeStart;this._updateUI();},_drawCanvas:function(cssCanvasWidth,cssCanvasHeight,rulerHeight)
{if(!this._enabled)
return;var canvas=this._canvas;var context=canvas.getContext("2d");canvas.style.width=cssCanvasWidth+"px";canvas.style.height=cssCanvasHeight+"px";var zoomFactor=WebInspector.zoomManager.zoomFactor();var dipCanvasWidth=cssCanvasWidth*zoomFactor;var dipCanvasHeight=cssCanvasHeight*zoomFactor;var deviceScaleFactor=window.devicePixelRatio;canvas.width=deviceScaleFactor*cssCanvasWidth;canvas.height=deviceScaleFactor*cssCanvasHeight;context.scale(canvas.width/dipCanvasWidth,canvas.height/dipCanvasHeight);context.font="11px "+WebInspector.fontFamily();const backgroundColor="rgb(102, 102, 102)";const lightLineColor="rgb(132, 132, 132)";const darkLineColor="rgb(114, 114, 114)";const rulerColor="rgb(125, 125, 125)";const textColor="rgb(186, 186, 186)";const contentsSizeColor="rgba(0, 0, 0, 0.3)";var scale=(this._scale||1)*this._viewport.pageScaleFactor;var rulerScale=0.5;while(Math.abs(rulerScale*scale-1)>Math.abs((rulerScale+0.5)*scale-1))
rulerScale+=0.5;var gridStep=50*scale*rulerScale;var gridSubStep=10*scale*rulerScale;var rulerSubStep=5*scale*rulerScale;var rulerStepCount=20;var rulerWidth=WebInspector.ResponsiveDesignView.RulerWidth;var dipGridWidth=dipCanvasWidth-rulerWidth;var dipGridHeight=dipCanvasHeight-rulerHeight;var dipScrollX=this._viewport.scrollX*scale;var dipScrollY=this._viewport.scrollY*scale;context.translate(rulerWidth,rulerHeight);context.fillStyle=backgroundColor;context.fillRect(0,0,dipGridWidth,dipGridHeight);context.translate(0.5,0.5);context.strokeStyle=rulerColor;context.fillStyle=textColor;context.lineWidth=1;context.save();var minXIndex=Math.ceil(dipScrollX/rulerSubStep);var maxXIndex=Math.floor((dipScrollX+dipGridWidth)/rulerSubStep);if(minXIndex){context.beginPath();context.moveTo(0,-rulerHeight);context.lineTo(0,0);context.stroke();}
context.translate(-dipScrollX,0);for(var index=minXIndex;index<=maxXIndex;index++){var x=index*rulerSubStep;var height=WebInspector.ResponsiveDesignView.RulerHeight*0.25;if(!(index%(rulerStepCount/4)))
height=WebInspector.ResponsiveDesignView.RulerHeight*0.5;if(!(index%(rulerStepCount/2)))
height=rulerHeight;if(!(index%rulerStepCount)){context.save();context.translate(x,0);context.fillText(Math.round(x/scale),2,-rulerHeight+10);context.restore();height=rulerHeight;}
context.beginPath();context.moveTo(x,-height);context.lineTo(x,0);context.stroke();}
context.restore();context.save();context.translate(0,this._deviceInsets.top);var minYIndex=Math.ceil(dipScrollY/rulerSubStep);var maxYIndex=Math.floor((dipScrollY+dipGridHeight)/rulerSubStep);context.translate(0,-dipScrollY);for(var index=minYIndex;index<=maxYIndex;index++){var y=index*rulerSubStep;var x=-rulerWidth*0.25;if(!(index%(rulerStepCount/4)))
x=-rulerWidth*0.5;if(!(index%(rulerStepCount/2)))
x=-rulerWidth*0.75;if(!(index%rulerStepCount)){context.save();context.translate(0,y);context.rotate(-Math.PI/2);context.fillText(Math.round(y/scale),2,-rulerWidth+10);context.restore();x=-rulerWidth;}
context.beginPath();context.moveTo(x,y);context.lineTo(0,y);context.stroke();}
context.restore();drawGrid(dipScrollX,dipScrollY+this._deviceInsets.top,darkLineColor,gridSubStep);drawGrid(dipScrollX,dipScrollY+this._deviceInsets.top,lightLineColor,gridStep);function drawGrid(scrollX,scrollY,color,step)
{context.strokeStyle=color;var minX=Math.ceil(scrollX/step)*step;var maxX=Math.floor((scrollX+dipGridWidth)/step)*step-minX;var minY=Math.ceil(scrollY/step)*step;var maxY=Math.floor((scrollY+dipGridHeight)/step)*step-minY;context.save();context.translate(minX-scrollX,0);for(var x=0;x<=maxX;x+=step){context.beginPath();context.moveTo(x,0);context.lineTo(x,dipGridHeight);context.stroke();}
context.restore();context.save();context.translate(0,minY-scrollY);for(var y=0;y<=maxY;y+=step){context.beginPath();context.moveTo(0,y);context.lineTo(dipGridWidth,y);context.stroke();}
context.restore();}
context.translate(-0.5,-0.5);var pageScaleAvailable=WebInspector.overridesSupport.settings.emulateMobile.get()||WebInspector.overridesSupport.settings.emulateTouch.get();if(this._drawContentsSize&&pageScaleAvailable){context.save();context.fillStyle=contentsSizeColor;var visibleContentsWidth=Math.max(0,Math.min(dipGridWidth,this._viewport.contentsWidth*scale-dipScrollX));var visibleContentsHeight=Math.max(0,Math.min(dipGridHeight,this._viewport.contentsHeight*scale-dipScrollY+this._deviceInsets.top));context.translate(0,this._deviceInsets.top);context.fillRect(0,Math.max(-this._deviceInsets.top,-dipScrollY),visibleContentsWidth,visibleContentsHeight);context.restore();}},_rulerTotalHeightDIP:function()
{var mediaInspectorHeight=this._mediaInspector.isShowing()?this._mediaInspector.element.offsetHeight:0;if(!mediaInspectorHeight)
return WebInspector.ResponsiveDesignView.RulerHeight;return WebInspector.ResponsiveDesignView.RulerTopHeight+WebInspector.ResponsiveDesignView.RulerBottomHeight+mediaInspectorHeight*WebInspector.zoomManager.zoomFactor();},_updateUI:function()
{if(!this._enabled||!this.isShowing())
return;var zoomFactor=WebInspector.zoomManager.zoomFactor();var rect=this._canvas.parentElement.getBoundingClientRect();var availableDip=this._availableDipSize().size;var cssCanvasWidth=rect.width;var cssCanvasHeight=rect.height;var mediaInspectorHeight=this._mediaInspector.isShowing()?this._mediaInspector.element.offsetHeight:0;var rulerTotalHeight=this._rulerTotalHeightDIP();this._mediaInspector.setAxisTransform(this._viewport.scrollX,this._scale*this._viewport.pageScaleFactor);if(this._cachedZoomFactor!==zoomFactor||this._cachedMediaInspectorHeight!==mediaInspectorHeight){var cssRulerWidth=WebInspector.ResponsiveDesignView.RulerWidth/zoomFactor+"px";var cssRulerHeight=(mediaInspectorHeight?WebInspector.ResponsiveDesignView.RulerTopHeight:WebInspector.ResponsiveDesignView.RulerHeight)/zoomFactor+"px";var cssCanvasOffset=rulerTotalHeight/zoomFactor+"px";this._slidersContainer.style.left=cssRulerWidth;this._slidersContainer.style.top=cssCanvasOffset;this._warningInfobar.element.style.height=cssCanvasOffset;this._pageScaleContainer.style.top=cssCanvasOffset;this._mediaInspectorContainer.style.left=cssRulerWidth;this._mediaInspectorContainer.style.marginTop=cssRulerHeight;this._warningInfobar.element.style.left=cssRulerWidth;}
var cssWidth=(this._dipWidth?this._dipWidth:availableDip.width)/zoomFactor;var cssHeight=(this._dipHeight?this._dipHeight:availableDip.height)/zoomFactor;var cssPageWidth=(this._pageWidth?this._pageWidth:availableDip.width)/zoomFactor;var cssPageHeight=(this._pageHeight?this._pageHeight:availableDip.height)/zoomFactor;var deviceInsets=new Insets(this._deviceInsets.left*this._scale/zoomFactor,this._deviceInsets.top*this._scale/zoomFactor,this._deviceInsets.right*this._scale/zoomFactor,this._deviceInsets.bottom*this._scale/zoomFactor);cssWidth+=deviceInsets.left+deviceInsets.right;cssHeight+=deviceInsets.top+deviceInsets.bottom;var insetsChanged=!deviceInsets.isEqual(this._cachedDeviceInsets);if(this._cachedCssWidth!==cssWidth||this._cachedCssHeight!==cssHeight||insetsChanged){this._slidersContainer.style.width=cssWidth+"px";this._slidersContainer.style.height=cssHeight+"px";this._pageContainer.style.paddingLeft=deviceInsets.left+"px";this._pageContainer.style.paddingTop=deviceInsets.top+"px";this._pageContainer.style.paddingRight=deviceInsets.right+"px";this._pageContainer.style.paddingBottom=deviceInsets.bottom+"px";this._inspectedPagePlaceholder.onResize();}
if(this._cachedCssPageWidth!==cssPageWidth||this._cachedCssPageHeight!==cssPageHeight){this._pageContainerImage.style.width=cssPageWidth+"px";this._pageContainerImage.style.height=cssPageHeight+"px";}
this._loadPageContainerImage();var pageScaleVisible=cssWidth+this._pageScaleContainerWidth+WebInspector.ResponsiveDesignView.RulerWidth/zoomFactor<=rect.width;this._pageScaleContainer.classList.toggle("hidden",!pageScaleVisible);var viewportChanged=!this._cachedViewport||this._cachedViewport.scrollX!==this._viewport.scrollX||this._cachedViewport.scrollY!==this._viewport.scrollY||this._cachedViewport.contentsWidth!==this._viewport.contentsWidth||this._cachedViewport.contentsHeight!==this._viewport.contentsHeight||this._cachedViewport.pageScaleFactor!==this._viewport.pageScaleFactor||this._cachedViewport.minimumPageScaleFactor!==this._viewport.minimumPageScaleFactor||this._cachedViewport.maximumPageScaleFactor!==this._viewport.maximumPageScaleFactor;var canvasInvalidated=viewportChanged||this._drawContentsSize!==this._cachedDrawContentsSize||this._cachedScale!==this._scale||this._cachedCssCanvasWidth!==cssCanvasWidth||this._cachedCssCanvasHeight!==cssCanvasHeight||this._cachedZoomFactor!==zoomFactor||this._cachedMediaInspectorHeight!==mediaInspectorHeight||insetsChanged;if(canvasInvalidated)
this._drawCanvas(cssCanvasWidth,cssCanvasHeight,rulerTotalHeight);if(viewportChanged){this._pageScaleLabel.textContent=WebInspector.UIString("%.1f",this._viewport.pageScaleFactor);this._decreasePageScaleButton.title=WebInspector.UIString("Scale down (minimum %.1f)",this._viewport.minimumPageScaleFactor);this._decreasePageScaleButton.disabled=this._viewport.pageScaleFactor<=this._viewport.minimumPageScaleFactor;this._increasePageScaleButton.title=WebInspector.UIString("Scale up (maximum %.1f)",this._viewport.maximumPageScaleFactor);this._increasePageScaleButton.disabled=this._viewport.pageScaleFactor>=this._viewport.maximumPageScaleFactor;}
this._cachedScale=this._scale;this._cachedCssCanvasWidth=cssCanvasWidth;this._cachedCssCanvasHeight=cssCanvasHeight;this._cachedCssHeight=cssHeight;this._cachedCssWidth=cssWidth;this._cachedCssPageWidth=cssPageWidth;this._cachedCssPageHeight=cssPageHeight;this._cachedDeviceInsets=deviceInsets;this._cachedZoomFactor=zoomFactor;this._cachedViewport=this._viewport;this._cachedDrawContentsSize=this._drawContentsSize;this._cachedMediaInspectorHeight=mediaInspectorHeight;},_loadPageContainerImage:function()
{if(this._pageContainerImage.getAttribute("srcset")===this._pageContainerSrcset)
return;this._pageContainerImage.setAttribute("srcset",this._pageContainerSrcset);if(!this._pageContainerSrcset)
this._pageContainerImage.classList.toggle("hidden",true);},_onPageContainerImageLoaded:function(success)
{this._pageContainerImage.classList.toggle("hidden",!success);},onResize:function()
{if(!this._enabled||this._ignoreResize)
return;var oldSize=this._availableSize;this._pageScaleContainer.classList.remove("hidden");this._pageScaleContainerWidth=this._pageScaleContainer.offsetWidth;delete this._availableSize;var newSize=this._availableDipSize();if(!oldSize||!newSize.size.isEqual(oldSize.size)||!newSize.insets.isEqual(oldSize.insets))
this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer.Events.AvailableSizeChanged,newSize);this._updateUI();this._inspectedPagePlaceholder.onResize();},_onZoomChanged:function()
{this._updateUI();},_createToolbar:function()
{this._toolbarElement=this._responsiveDesignContainer.element.createChild("div","responsive-design-toolbar");this._createButtonsSection();this._createDeviceSection();this._toolbarElement.createChild("div","responsive-design-separator");this._createNetworkSection();this._toolbarElement.createChild("div","responsive-design-separator");var moreButtonContainer=this._toolbarElement.createChild("div","responsive-design-more-button-container");var moreButton=moreButtonContainer.createChild("button","responsive-design-more-button");moreButton.title=WebInspector.UIString("More overrides");moreButton.addEventListener("click",this._showEmulationInDrawer.bind(this),false);moreButton.textContent="\u2026";},_createButtonsSection:function()
{var buttonsToolbar=new WebInspector.Toolbar("",this._toolbarElement);buttonsToolbar.makeVertical();buttonsToolbar.setColor("white");buttonsToolbar.setToggledColor("rgb(105, 194, 236)");buttonsToolbar.element.classList.add("responsive-design-section","responsive-design-section-buttons");var resetButton=new WebInspector.ToolbarButton(WebInspector.UIString("Reset all overrides"),"clear-toolbar-item");buttonsToolbar.appendToolbarItem(resetButton);resetButton.addEventListener("click",WebInspector.overridesSupport.reset,WebInspector.overridesSupport);this._toggleMediaInspectorButton=new WebInspector.ToolbarToggle(WebInspector.UIString("Media queries not found"),"waterfall-toolbar-item");this._toggleMediaInspectorButton.setToggled(this._showMediaQueryInspectorSetting.get());this._toggleMediaInspectorButton.setEnabled(false);this._toggleMediaInspectorButton.addEventListener("click",this._onToggleMediaInspectorButtonClick,this);this._showMediaQueryInspectorSetting.addChangeListener(this._updateMediaQueryInspector,this);buttonsToolbar.appendToolbarItem(this._toggleMediaInspectorButton);},_createDeviceSection:function()
{var deviceSection=this._toolbarElement.createChild("div","responsive-design-section responsive-design-section-device");deviceSection.createChild("div","responsive-design-section-decorator");var deviceElement=deviceSection.createChild("div","responsive-design-suite responsive-design-suite-top").createChild("div");var fieldsetElement=deviceElement.createChild("fieldset");fieldsetElement.createChild("label").textContent=WebInspector.UIString("Device");var deviceSelect=new WebInspector.DeviceSelect(createElementWithClass("button","responsive-design-icon responsive-design-icon-swap"),this._deviceModeSelected.bind(this));fieldsetElement.appendChild(deviceSelect.element);deviceSelect.element.classList.add("responsive-design-device-select");var detailsElement=deviceSection.createChild("div","responsive-design-suite");var screenElement=detailsElement.createChild("div","");fieldsetElement=screenElement.createChild("fieldset");var emulateResolutionCheckbox=WebInspector.SettingsUI.createSettingCheckbox("",WebInspector.overridesSupport.settings.emulateResolution,true,WebInspector.UIString("Emulate screen resolution"));themeCheckbox(emulateResolutionCheckbox);fieldsetElement.appendChild(emulateResolutionCheckbox);fieldsetElement.createChild("label").textContent=WebInspector.UIString("Screen");var resolutionFieldset=WebInspector.SettingsUI.createSettingFieldset(WebInspector.overridesSupport.settings.emulateResolution);fieldsetElement.appendChild(resolutionFieldset);resolutionFieldset.appendChild(WebInspector.SettingsUI.createSettingInputField("",WebInspector.overridesSupport.settings.deviceWidth,true,4,"3em",WebInspector.OverridesSupport.deviceSizeValidator,true,true,WebInspector.UIString("\u2013")));resolutionFieldset.createTextChild("\u00D7");resolutionFieldset.appendChild(WebInspector.SettingsUI.createSettingInputField("",WebInspector.overridesSupport.settings.deviceHeight,true,4,"3em",WebInspector.OverridesSupport.deviceSizeValidator,true,true,WebInspector.UIString("\u2013")));detailsElement.createChild("div","responsive-design-suite-separator");var dprElement=detailsElement.createChild("div","");var resolutionFieldset2=WebInspector.SettingsUI.createSettingFieldset(WebInspector.overridesSupport.settings.emulateResolution);dprElement.appendChild(resolutionFieldset2);var dprButton=resolutionFieldset2.createChild("div","responsive-design-icon responsive-design-icon-dpr");dprButton.title=WebInspector.UIString("Device pixel ratio");resolutionFieldset2.appendChild(WebInspector.SettingsUI.createSettingInputField("",WebInspector.overridesSupport.settings.deviceScaleFactor,true,4,"1.9em",WebInspector.OverridesSupport.deviceScaleFactorValidator,true,true,WebInspector.UIString("\u2013")));detailsElement.createChild("div","responsive-design-suite-separator");var fitToWindowElement=detailsElement.createChild("div","");fieldsetElement=fitToWindowElement.createChild("fieldset");var fitCheckbox=WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Zoom to fit"),WebInspector.overridesSupport.settings.deviceFitWindow,true,WebInspector.UIString("Zoom to fit available space"))
fieldsetElement.appendChild(fitCheckbox);themeCheckbox(fitCheckbox);function themeCheckbox(checkbox)
{checkbox.checkColor="rgb(255, 156, 0)";checkbox.backgroundColor="rgb(102, 102, 102)";checkbox.borderColor="rgb(45, 45, 45)";}},_createNetworkSection:function()
{var networkSection=this._toolbarElement.createChild("div","responsive-design-section responsive-design-section-network");networkSection.createChild("div","responsive-design-section-decorator");var networkLabel=networkSection.createChild("div","responsive-design-suite responsive-design-suite-top").createChild("div").createChild("label");networkLabel.textContent=WebInspector.UIString("Network");var showDrawerButton=networkSection.createChild("div","responsive-design-suite").createChild("a");showDrawerButton.textContent=WebInspector.UIString("Configure throttling");var action=WebInspector.actionRegistry.action("network.show-config");showDrawerButton.addEventListener("click",action.execute.bind(action));},_onToggleMediaInspectorButtonClick:function()
{this._showMediaQueryInspectorSetting.set(!this._toggleMediaInspectorButton.toggled());},_updateMediaQueryInspector:function()
{this._toggleMediaInspectorButton.setToggled(this._showMediaQueryInspectorSetting.get());if(this._mediaInspector.isShowing()===this._showMediaQueryInspectorSetting.get())
return;if(this._mediaInspector.isShowing())
this._mediaInspector.detach();else
this._mediaInspector.show(this._mediaInspectorContainer);this.onResize();},_updateMediaQueryInspectorButton:function(event)
{var count=(event.data);this._toggleMediaInspectorButton.setEnabled(!!count);this._toggleMediaInspectorButton.setTitle(!count?WebInspector.UIString("Media queries not found"):WebInspector.UIString((count===1?"%d media query found":"%d media queries found"),count));},_overridesWarningUpdated:function()
{var message=WebInspector.overridesSupport.warningMessage();if(!message){if(this._warningInfobar){this._warningInfobar.dispose();delete this._warningInfobar;}}
if(!this._warningInfobar){this._warningInfobar=WebInspector.Infobar.create(WebInspector.Infobar.Type.Warning,message,WebInspector.moduleSetting("disableOverridesWarning"));if(this._warningInfobar){this._warningInfobar.element.classList.add("responsive-design-warning");this._warningInfobar.setCloseCallback(WebInspector.overridesSupport.clearWarningMessage.bind(WebInspector.overridesSupport));this._canvasContainer.element.appendChild(this._warningInfobar.element);}}else{this._warningInfobar.setText(message);}},_showEmulationInDrawer:function()
{WebInspector.Revealer.reveal(WebInspector.overridesSupport);},_deviceModeSelected:function(device,mode)
{this._pageContainerSrcset="";if(device&&mode){var orientation=device.orientationByName(mode.orientation);this._deviceInsets=mode.insets;WebInspector.overridesSupport.settings.screenOrientationOverride.set(mode.orientation==WebInspector.EmulatedDevice.Horizontal?"landscapePrimary":"portraitPrimary");this._pageContainerSrcset=device.modeImage(mode);}else{this._deviceInsets=new Insets(0,0,0,0);WebInspector.overridesSupport.settings.screenOrientationOverride.set("");}
this.dispatchEventToListeners(WebInspector.OverridesSupport.PageResizer.Events.InsetsChanged,this._deviceInsets);},_viewportChanged:function(viewport)
{if(viewport){this._viewport=viewport;this._viewport.minimumPageScaleFactor=Math.max(0.1,this._viewport.minimumPageScaleFactor);this._viewport.minimumPageScaleFactor=Math.min(this._viewport.minimumPageScaleFactor,this._viewport.pageScaleFactor);this._viewport.maximumPageScaleFactor=Math.min(10,this._viewport.maximumPageScaleFactor);this._viewport.maximumPageScaleFactor=Math.max(this._viewport.maximumPageScaleFactor,this._viewport.pageScaleFactor);this._viewportChangedThrottler.schedule(this._updateUIThrottled.bind(this));}},_updateUIThrottled:function()
{this._updateUI();return Promise.resolve();},_pageScaleButtonClicked:function(increase,event)
{this._pageScaleFactorThrottler.schedule(updatePageScaleFactor.bind(this));function updatePageScaleFactor()
{if(this._target&&this._viewport){var value=this._viewport.pageScaleFactor;value=increase?value*1.1:value/1.1;value=Math.min(this._viewport.maximumPageScaleFactor,value);value=Math.max(this._viewport.minimumPageScaleFactor,value);this._target.emulationAgent().setPageScaleFactor(value);}
return Promise.resolve();}},_resetPageScale:function()
{this._pageScaleFactorThrottler.schedule(updatePageScaleFactor.bind(this));function updatePageScaleFactor()
{if(this._target&&this._viewport&&this._viewport.minimumPageScaleFactor<=1&&this._viewport.maximumPageScaleFactor>=1)
this._target.emulationAgent().setPageScaleFactor(1);return Promise.resolve();}},__proto__:WebInspector.VBox.prototype};WebInspector.EmulationDispatcher=function(responsiveDesignView)
{this._responsiveDesignView=responsiveDesignView;}
WebInspector.EmulationDispatcher.prototype={viewportChanged:function(viewport)
{this._responsiveDesignView._viewportChanged(viewport);}};WebInspector.OverridesView=function()
{WebInspector.VBox.call(this);this.setMinimumSize(0,30);this.registerRequiredCSS("emulation/overrides.css");this.element.classList.add("overrides-view");this._deviceElement=this._createDeviceElement();this._splashScreenElement=this.element.createChild("div","overrides-splash-screen");this._splashScreenElement.appendChild(createTextButton(WebInspector.UIString("Enable emulation"),this._toggleEmulationEnabled.bind(this),"overrides-enable-button"));this._unavailableSplashScreenElement=this.element.createChild("div","overrides-splash-screen");this._unavailableSplashScreenElement.createTextChild(WebInspector.UIString("Emulation is not available."));this._warningFooter=this.element.createChild("div","overrides-footer");this._overridesWarningUpdated();WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport.Events.OverridesWarningUpdated,this._overridesWarningUpdated,this);WebInspector.overridesSupport.addEventListener(WebInspector.OverridesSupport.Events.EmulationStateChanged,this._emulationStateChanged,this);this._emulationStateChanged();}
WebInspector.OverridesView.prototype={_createDeviceElement:function()
{var container=this.element.createChild("div","overrides-device");var disableButtonElement=createTextButton(WebInspector.UIString("Disable emulation"),this._toggleEmulationEnabled.bind(this),"overrides-disable-button");disableButtonElement.id="overrides-disable-button";container.appendChild(disableButtonElement);var fieldsetElement=container.createChild("fieldset");fieldsetElement.id="metrics-override-section";var deviceModelElement=fieldsetElement.createChild("p","overrides-device-model-section");deviceModelElement.createChild("span").textContent=WebInspector.UIString("Device:");var rotateButton=createElement("button");rotateButton.textContent=" \u21C4 ";var deviceSelect=new WebInspector.DeviceSelect(rotateButton,null);deviceModelElement.appendChild(deviceSelect.element);var deviceModelFieldset=fieldsetElement.createChild("fieldset","overrides-device-model-settings");var emulateResolutionCheckbox=WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Emulate screen resolution"),WebInspector.overridesSupport.settings.emulateResolution,true);deviceModelFieldset.appendChild(emulateResolutionCheckbox);var resolutionFieldset=WebInspector.SettingsUI.createSettingFieldset(WebInspector.overridesSupport.settings.emulateResolution);deviceModelFieldset.appendChild(resolutionFieldset);var tableElement=resolutionFieldset.createChild("table");var rowElement=tableElement.createChild("tr");var cellElement=rowElement.createChild("td");cellElement.createTextChild(WebInspector.UIString("Resolution:"));cellElement=rowElement.createChild("td");var widthOverrideInput=WebInspector.SettingsUI.createSettingInputField("",WebInspector.overridesSupport.settings.deviceWidth,true,4,"80px",WebInspector.OverridesSupport.deviceSizeValidator,true,true,WebInspector.UIString("\u2013"));cellElement.appendChild(widthOverrideInput);var heightOverrideInput=WebInspector.SettingsUI.createSettingInputField("",WebInspector.overridesSupport.settings.deviceHeight,true,4,"80px",WebInspector.OverridesSupport.deviceSizeValidator,true,true,WebInspector.UIString("\u2013"));cellElement.appendChild(heightOverrideInput);rowElement=tableElement.createChild("tr");cellElement=rowElement.createChild("td");cellElement.colSpan=4;rowElement=tableElement.createChild("tr");rowElement.title=WebInspector.UIString("Ratio between a device's physical pixels and device-independent pixels");rowElement.createChild("td").createTextChild(WebInspector.UIString("Device pixel ratio:"));rowElement.createChild("td").appendChild(WebInspector.SettingsUI.createSettingInputField("",WebInspector.overridesSupport.settings.deviceScaleFactor,true,4,"80px",WebInspector.OverridesSupport.deviceScaleFactorValidator,true,true,WebInspector.UIString("\u2013")));var mobileCheckbox=WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Emulate mobile"),WebInspector.overridesSupport.settings.emulateMobile,true);mobileCheckbox.title=WebInspector.UIString("Enable meta viewport, overlay scrollbars, text autosizing and default 980px body width");deviceModelFieldset.appendChild(mobileCheckbox);deviceModelFieldset.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Emulate touch screen"),WebInspector.overridesSupport.settings.emulateTouch,true));var resetButtonElement=createTextButton(WebInspector.UIString("Reset"),WebInspector.overridesSupport.reset.bind(WebInspector.overridesSupport));resetButtonElement.id="overrides-reset-button";deviceModelFieldset.appendChild(resetButtonElement);fieldsetElement.appendChild(WebInspector.SettingsUI.createSettingCheckbox(WebInspector.UIString("Shrink to fit"),WebInspector.overridesSupport.settings.deviceFitWindow,true));var footnote=container.createChild("p","help-footnote");footnote.appendChild(WebInspector.linkifyDocumentationURLAsNode("iterate/device-mode/",WebInspector.UIString("More information about screen emulation")));return container;},_overridesWarningUpdated:function()
{var message=WebInspector.overridesSupport.warningMessage();this._warningFooter.classList.toggle("hidden",!message);this._warningFooter.textContent=message;},_toggleEmulationEnabled:function()
{WebInspector.overridesSupport.setEmulationEnabled(!WebInspector.overridesSupport.emulationEnabled());},_emulationStateChanged:function()
{this._unavailableSplashScreenElement.classList.toggle("hidden",WebInspector.overridesSupport.canEmulate());this._deviceElement.classList.toggle("hidden",!WebInspector.overridesSupport.emulationEnabled());this._splashScreenElement.classList.toggle("hidden",WebInspector.overridesSupport.emulationEnabled()||!WebInspector.overridesSupport.canEmulate());},__proto__:WebInspector.VBox.prototype}
WebInspector.OverridesView.Revealer=function()
{}
WebInspector.OverridesView.Revealer.prototype={reveal:function(overridesSupport)
{WebInspector.inspectorView.showViewInDrawer("emulation");return Promise.resolve();}};WebInspector.SensorsView=function()
{WebInspector.VBox.call(this,true);this.registerRequiredCSS("emulation/sensors.css");this.contentElement.classList.add("sensors-view");this._appendGeolocationOverrideControl();this._appendDeviceOrientationOverrideControl();}
WebInspector.SensorsView.prototype={_appendGeolocationOverrideControl:function()
{const geolocationSetting=WebInspector.overridesSupport.settings.geolocationOverride.get();var geolocation=WebInspector.OverridesSupport.GeolocationPosition.parseSetting(geolocationSetting);var checkboxLabel=createCheckboxLabel(WebInspector.UIString("Emulate geolocation coordinates"));this._geolocationOverrideCheckbox=checkboxLabel.checkboxElement;this._geolocationOverrideCheckbox.addEventListener("click",this._geolocationOverrideCheckboxClicked.bind(this));this.contentElement.appendChild(checkboxLabel);this._geolocationFieldset=this._createGeolocationOverrideElement(geolocation);this._geolocationFieldset.disabled=true;this.contentElement.appendChild(this._geolocationFieldset);},_geolocationOverrideCheckboxClicked:function()
{var enabled=this._geolocationOverrideCheckbox.checked;WebInspector.overridesSupport.setGeolocationOverrideEnabled(enabled);if(enabled&&!this._latitudeElement.value)
this._latitudeElement.focus();this._geolocationFieldset.disabled=!enabled;},_applyGeolocationUserInput:function()
{this._setGeolocationPosition(WebInspector.OverridesSupport.GeolocationPosition.parseUserInput(this._latitudeElement.value.trim(),this._longitudeElement.value.trim(),this._geolocationErrorElement.checked),true);},_setGeolocationPosition:function(geolocation,userInputModified)
{if(!geolocation)
return;if(!userInputModified){this._latitudeElement.value=geolocation.latitude;this._longitudeElement.value=geolocation.longitude;}
var value=geolocation.toSetting();WebInspector.overridesSupport.settings.geolocationOverride.set(value);},_createGeolocationOverrideElement:function(geolocation)
{var fieldsetElement=createElement("fieldset");fieldsetElement.id="geolocation-override-section";var tableElement=fieldsetElement.createChild("table");var rowElement=tableElement.createChild("tr");var cellElement=rowElement.createChild("td");cellElement=rowElement.createChild("td");cellElement.createTextChild(WebInspector.UIString("Lat = "));this._latitudeElement=WebInspector.SettingsUI.createInput(cellElement,"geolocation-override-latitude",String(geolocation.latitude),this._applyGeolocationUserInput.bind(this),true);cellElement.createTextChild(" , ");cellElement.createTextChild(WebInspector.UIString("Lon = "));this._longitudeElement=WebInspector.SettingsUI.createInput(cellElement,"geolocation-override-longitude",String(geolocation.longitude),this._applyGeolocationUserInput.bind(this),true);rowElement=tableElement.createChild("tr");cellElement=rowElement.createChild("td");cellElement.colSpan=2;var geolocationErrorLabelElement=createCheckboxLabel(WebInspector.UIString("Emulate position unavailable"),!geolocation||!!geolocation.error);var geolocationErrorCheckboxElement=geolocationErrorLabelElement.checkboxElement;geolocationErrorCheckboxElement.id="geolocation-error";geolocationErrorCheckboxElement.addEventListener("click",this._applyGeolocationUserInput.bind(this),false);this._geolocationErrorElement=geolocationErrorCheckboxElement;cellElement.appendChild(geolocationErrorLabelElement);return fieldsetElement;},_appendDeviceOrientationOverrideControl:function()
{const deviceOrientationSetting=WebInspector.overridesSupport.settings.deviceOrientationOverride.get();var deviceOrientation=WebInspector.OverridesSupport.DeviceOrientation.parseSetting(deviceOrientationSetting);var checkboxLabel=createCheckboxLabel(WebInspector.UIString("Emulate accelerometer"));this._overrideDeviceOrientationCheckbox=checkboxLabel.checkboxElement;this._overrideDeviceOrientationCheckbox.addEventListener("click",this._deviceOrientationOverrideCheckboxClicked.bind(this));this.contentElement.appendChild(checkboxLabel);this._deviceOrientationFieldset=this._createDeviceOrientationOverrideElement(deviceOrientation);this._deviceOrientationFieldset.disabled=true;this.contentElement.appendChild(this._deviceOrientationFieldset);},_deviceOrientationOverrideCheckboxClicked:function()
{var enabled=this._overrideDeviceOrientationCheckbox.checked;WebInspector.overridesSupport.setDeviceOrientationOverrideEnabled(enabled);if(enabled&&!this._alphaElement.value)
this._alphaElement.focus();this._deviceOrientationFieldset.disabled=!enabled;},_applyDeviceOrientationUserInput:function()
{this._setDeviceOrientation(WebInspector.OverridesSupport.DeviceOrientation.parseUserInput(this._alphaElement.value.trim(),this._betaElement.value.trim(),this._gammaElement.value.trim()),WebInspector.SensorsView.DeviceOrientationModificationSource.UserInput);},_resetDeviceOrientation:function()
{this._setDeviceOrientation(new WebInspector.OverridesSupport.DeviceOrientation(0,0,0),WebInspector.SensorsView.DeviceOrientationModificationSource.ResetButton);},_setDeviceOrientation:function(deviceOrientation,modificationSource)
{if(!deviceOrientation)
return;if(modificationSource!=WebInspector.SensorsView.DeviceOrientationModificationSource.UserInput){this._alphaElement.value=deviceOrientation.alpha;this._betaElement.value=deviceOrientation.beta;this._gammaElement.value=deviceOrientation.gamma;}
if(modificationSource!=WebInspector.SensorsView.DeviceOrientationModificationSource.UserDrag)
this._setBoxOrientation(deviceOrientation);var value=deviceOrientation.toSetting();WebInspector.overridesSupport.settings.deviceOrientationOverride.set(value);},_createAxisInput:function(parentElement,id,label,defaultText)
{var div=parentElement.createChild("div","accelerometer-axis-input-container");div.createTextChild(label);return WebInspector.SettingsUI.createInput(div,id,defaultText,this._applyDeviceOrientationUserInput.bind(this),true);},_createDeviceOrientationOverrideElement:function(deviceOrientation)
{var fieldsetElement=createElement("fieldset");fieldsetElement.classList.add("device-orientation-override-section");var tableElement=fieldsetElement.createChild("table");var rowElement=tableElement.createChild("tr");var cellElement=rowElement.createChild("td","accelerometer-inputs-cell");this._alphaElement=this._createAxisInput(cellElement,"device-orientation-override-alpha","\u03B1: ",String(deviceOrientation.alpha));this._betaElement=this._createAxisInput(cellElement,"device-orientation-override-beta","\u03B2: ",String(deviceOrientation.beta));this._gammaElement=this._createAxisInput(cellElement,"device-orientation-override-gamma","\u03B3: ",String(deviceOrientation.gamma));cellElement.appendChild(createTextButton(WebInspector.UIString("Reset"),this._resetDeviceOrientation.bind(this),"accelerometer-reset-button"));this._stageElement=rowElement.createChild("td","accelerometer-stage");this._boxElement=this._stageElement.createChild("section","accelerometer-box");this._boxElement.createChild("section","front");this._boxElement.createChild("section","top");this._boxElement.createChild("section","back");this._boxElement.createChild("section","left");this._boxElement.createChild("section","right");this._boxElement.createChild("section","bottom");WebInspector.installDragHandle(this._stageElement,this._onBoxDragStart.bind(this),this._onBoxDrag.bind(this),this._onBoxDragEnd.bind(this),"move");this._setBoxOrientation(deviceOrientation);return fieldsetElement;},_setBoxOrientation:function(deviceOrientation)
{var matrix=new WebKitCSSMatrix();this._boxMatrix=matrix.rotate(-deviceOrientation.beta,deviceOrientation.gamma,-deviceOrientation.alpha);this._boxElement.style.webkitTransform=this._boxMatrix.toString();},_onBoxDrag:function(event)
{var mouseMoveVector=this._calculateRadiusVector(event.x,event.y);if(!mouseMoveVector)
return true;event.consume(true);var axis=WebInspector.Geometry.crossProduct(this._mouseDownVector,mouseMoveVector);axis.normalize();var angle=WebInspector.Geometry.calculateAngle(this._mouseDownVector,mouseMoveVector);var matrix=new WebKitCSSMatrix();var rotationMatrix=matrix.rotateAxisAngle(axis.x,axis.y,axis.z,angle);this._currentMatrix=rotationMatrix.multiply(this._boxMatrix);this._boxElement.style.webkitTransform=this._currentMatrix;var eulerAngles=WebInspector.Geometry.EulerAngles.fromRotationMatrix(this._currentMatrix);var newOrientation=new WebInspector.OverridesSupport.DeviceOrientation(-eulerAngles.alpha,-eulerAngles.beta,eulerAngles.gamma);this._setDeviceOrientation(newOrientation,WebInspector.SensorsView.DeviceOrientationModificationSource.UserDrag);return false;},_onBoxDragStart:function(event)
{if(!this._overrideDeviceOrientationCheckbox.checked)
return false;this._mouseDownVector=this._calculateRadiusVector(event.x,event.y);if(!this._mouseDownVector)
return false;event.consume(true);return true;},_onBoxDragEnd:function()
{this._boxMatrix=this._currentMatrix;},_calculateRadiusVector:function(x,y)
{var rect=this._stageElement.getBoundingClientRect();var radius=Math.max(rect.width,rect.height)/2;var sphereX=(x-rect.left-rect.width/2)/radius;var sphereY=(y-rect.top-rect.height/2)/radius;var sqrSum=sphereX*sphereX+sphereY*sphereY;if(sqrSum>0.5)
return new WebInspector.Geometry.Vector(sphereX,sphereY,0.5/Math.sqrt(sqrSum));return new WebInspector.Geometry.Vector(sphereX,sphereY,Math.sqrt(1-sqrSum));},__proto__:WebInspector.VBox.prototype}
WebInspector.SensorsView.DeviceOrientationModificationSource={UserInput:"userInput",UserDrag:"userDrag",ResetButton:"resetButton"}
WebInspector.SensorsView.instance=function()
{if(!WebInspector.SensorsView._instanceObject)
WebInspector.SensorsView._instanceObject=new WebInspector.SensorsView();return WebInspector.SensorsView._instanceObject;}
WebInspector.SensorsView.ShowActionDelegate=function()
{}
WebInspector.SensorsView.ShowActionDelegate.prototype={handleAction:function(context,actionId)
{WebInspector.inspectorView.showViewInDrawer("sensors");return true;}};WebInspector.DeviceModeModel=function(updateCallback)
{this._updateCallback=updateCallback;this._screenRect=new WebInspector.Rect(0,0,1,1);this._visiblePageRect=new WebInspector.Rect(0,0,1,1);this._availableSize=new Size(1,1);this._preferredSize=new Size(1,1);this._deviceMetricsThrottler=new WebInspector.Throttler(0);this._appliedDeviceSize=new Size(1,1);this._currentDeviceScaleFactor=window.devicePixelRatio;this._appliedDeviceScaleFactor=0;this._scaleSetting=WebInspector.settings.createSetting("emulation.deviceScale",1);this._scaleSetting.addChangeListener(this._scaleSettingChanged,this);if(!this._scaleSetting.get())
this._scaleSetting.set(1);this._widthSetting=WebInspector.settings.createSetting("emulation.deviceWidth",400);this._widthSetting.addChangeListener(this._widthSettingChanged,this);this._heightSetting=WebInspector.settings.createSetting("emulation.deviceHeight",0);this._heightSetting.addChangeListener(this._heightSettingChanged,this);this._uaSetting=WebInspector.settings.createSetting("emulation.deviceUA",WebInspector.DeviceModeModel.UA.Mobile);this._uaSetting.addChangeListener(this._uaSettingChanged,this);this._deviceScaleFactorSetting=WebInspector.settings.createSetting("emulation.deviceScaleFactor",0);this._deviceScaleFactorSetting.addChangeListener(this._deviceScaleFactorSettingChanged,this);this._type=WebInspector.DeviceModeModel.Type.None;this._device=null;this._mode=null;this._touchEnabled=false;this._touchConfiguration="";this._screenOrientation="";this._fitScale=1;this._target=null;WebInspector.targetManager.observeTargets(this,WebInspector.Target.Type.Page);}
WebInspector.DeviceModeModel.Type={None:"None",Responsive:"Responsive",Device:"Device"}
WebInspector.DeviceModeModel.UA={Mobile:"Mobile",Desktop:"Desktop",DesktopTouch:"DesktopTouch"}
WebInspector.DeviceModeModel.MaxDeviceSize=10000;WebInspector.DeviceModeModel.deviceSizeValidator=function(value)
{if(/^[\d]+$/.test(value)&&value>0&&value<=WebInspector.DeviceModeModel.MaxDeviceSize)
return"";return WebInspector.UIString("Value must be positive integer");}
WebInspector.DeviceModeModel._touchEventsScriptIdSymbol=Symbol("DeviceModeModel.touchEventsScriptIdSymbol");WebInspector.DeviceModeModel._defaultMobileUserAgent="Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Mobile Safari/537.36";WebInspector.DeviceModeModel._defaultMobileScaleFactor=2;WebInspector.DeviceModeModel.prototype={setAvailableSize:function(availableSize,preferredSize)
{this._availableSize=availableSize;this._preferredSize=preferredSize;this._calculateAndEmulate(false);},emulate:function(type,device,mode)
{this._type=type;if(type===WebInspector.DeviceModeModel.Type.Device){console.assert(device&&mode,"Must pass device and mode for device emulation");this._device=device;this._mode=mode;}else{this._device=null;this._mode=null;}
if(type!==WebInspector.DeviceModeModel.Type.None)
WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.DeviceModeEnabled);this._calculateAndEmulate(true);},device:function()
{return this._device;},mode:function()
{return this._mode;},type:function()
{return this._type;},screenImage:function()
{return(this._device&&this._mode)?this._device.modeImage(this._mode):"";},screenRect:function()
{return this._screenRect;},visiblePageRect:function()
{return this._visiblePageRect;},scale:function()
{return this._scale;},fitScale:function()
{return this._fitScale;},appliedDeviceSize:function()
{return this._appliedDeviceSize;},appliedDeviceScaleFactor:function()
{return this._appliedDeviceScaleFactor;},scaleSetting:function()
{return this._scaleSetting;},widthSetting:function()
{return this._widthSetting;},heightSetting:function()
{return this._heightSetting;},uaSetting:function()
{return this._uaSetting;},deviceScaleFactorSetting:function()
{return this._deviceScaleFactorSetting;},defaultDeviceScaleFactor:function()
{if(this._type===WebInspector.DeviceModeModel.Type.Responsive)
return this._uaSetting.get()===WebInspector.DeviceModeModel.UA.Mobile?WebInspector.DeviceModeModel._defaultMobileScaleFactor:this._currentDeviceScaleFactor;else if(this._type===WebInspector.DeviceModeModel.Type.Device)
return this._device.deviceScaleFactor;else
return this._currentDeviceScaleFactor;},reset:function()
{this._deviceScaleFactorSetting.set(0);this._scaleSetting.set(1);this._widthSetting.set(400);this._heightSetting.set(0);this._uaSetting.set(WebInspector.DeviceModeModel.UA.Mobile);},targetAdded:function(target)
{if(!this._target){this._target=target;var domModel=WebInspector.DOMModel.fromTarget(this._target);domModel.addEventListener(WebInspector.DOMModel.Events.InspectModeWillBeToggled,this._inspectModeWillBeToggled,this);}},_inspectModeWillBeToggled:function(event)
{var inspectModeEnabled=(event.data);if(inspectModeEnabled){this._applyTouch(false,false);return;}
if(this._type===WebInspector.DeviceModeModel.Type.Device)
this._applyTouch(this._device.touch(),this._device.mobile());else if(this._type===WebInspector.DeviceModeModel.Type.None)
this._applyTouch(false,false);else if(this._type===WebInspector.DeviceModeModel.Type.Responsive)
this._applyTouch(this._uaSetting.get()!==WebInspector.DeviceModeModel.UA.Desktop,this._uaSetting.get()===WebInspector.DeviceModeModel.UA.Mobile);},targetRemoved:function(target)
{if(this._target===target)
this._target=null;},_scaleSettingChanged:function()
{this._calculateAndEmulate(true);},_widthSettingChanged:function()
{this._calculateAndEmulate(false);},_heightSettingChanged:function()
{this._calculateAndEmulate(false);},_uaSettingChanged:function()
{this._calculateAndEmulate(true);},_deviceScaleFactorSettingChanged:function()
{this._calculateAndEmulate(false);},_calculateAndEmulate:function(resetScrollAndPageScale)
{if(this._type===WebInspector.DeviceModeModel.Type.Device){var orientation=this._device.orientationByName(this._mode.orientation);var screenWidth=orientation.width;var screenHeight=orientation.height;this._applyDeviceMetrics(new Size(screenWidth,screenHeight),this._mode.insets,this._scaleSetting.get(),this._device.deviceScaleFactor,this._device.mobile(),resetScrollAndPageScale);this._applyUserAgent(this._device.userAgent);this._applyTouch(this._device.touch(),this._device.mobile());this._applyScreenOrientation(this._mode.orientation==WebInspector.EmulatedDevice.Horizontal?"landscapePrimary":"portraitPrimary");}else if(this._type===WebInspector.DeviceModeModel.Type.None){this._applyDeviceMetrics(this._availableSize,new Insets(0,0,0,0),1,0,false,resetScrollAndPageScale);this._applyUserAgent("");this._applyTouch(false,false);this._applyScreenOrientation("");}else if(this._type===WebInspector.DeviceModeModel.Type.Responsive){var screenWidth=this._widthSetting.get()||this._preferredSize.width/(this._scaleSetting.get()||1);var screenHeight=this._heightSetting.get()||this._preferredSize.height/(this._scaleSetting.get()||1);var mobile=this._uaSetting.get()===WebInspector.DeviceModeModel.UA.Mobile;var defaultDeviceScaleFactor=mobile?WebInspector.DeviceModeModel._defaultMobileScaleFactor:0;this._applyDeviceMetrics(new Size(screenWidth,screenHeight),new Insets(0,0,0,0),this._scaleSetting.get(),this._deviceScaleFactorSetting.get()||defaultDeviceScaleFactor,mobile,resetScrollAndPageScale);this._applyUserAgent(mobile?WebInspector.DeviceModeModel._defaultMobileUserAgent:"");this._applyTouch(this._uaSetting.get()!==WebInspector.DeviceModeModel.UA.Desktop,mobile);this._applyScreenOrientation(screenHeight>=screenWidth?"portraitPrimary":"landscapePrimary");}
this._updateCallback.call(null);},_calculateFitScale:function(screenWidth,screenHeight)
{var scale=Math.min(screenWidth?this._preferredSize.width/screenWidth:1,screenHeight?this._preferredSize.height/screenHeight:1);return Math.min(scale,1);},_applyUserAgent:function(userAgent)
{WebInspector.multitargetNetworkManager.setUserAgentOverride(userAgent);},_applyDeviceMetrics:function(screenSize,insets,scale,deviceScaleFactor,mobile,resetScrollAndPageScale)
{screenSize.width=Math.max(1,Math.floor(screenSize.width));screenSize.height=Math.max(1,Math.floor(screenSize.height));this._fitScale=this._calculateFitScale(screenSize.width,screenSize.height);var pageWidth=screenSize.width-insets.left-insets.right;var pageHeight=screenSize.height-insets.top-insets.bottom;var positionX=insets.left;var positionY=insets.top;this._appliedDeviceSize=screenSize;this._screenRect=new WebInspector.Rect(Math.max(0,(this._availableSize.width-screenSize.width*scale)/2),0,screenSize.width*scale,screenSize.height*scale);this._visiblePageRect=new WebInspector.Rect(positionX*scale,positionY*scale,Math.min(pageWidth*scale,this._availableSize.width-this._screenRect.left-positionX*scale),Math.min(pageHeight*scale,this._availableSize.height-this._screenRect.top-positionY*scale));this._scale=scale;this._appliedDeviceScaleFactor=deviceScaleFactor;if(scale===1&&this._availableSize.width>=screenSize.width&&this._availableSize.height>=screenSize.height){pageWidth=0;pageHeight=0;}
this._deviceMetricsThrottler.schedule(setDeviceMetricsOverride.bind(this));function setDeviceMetricsOverride()
{if(!this._target)
return Promise.resolve();var clear=!pageWidth&&!pageHeight&&!mobile&&!deviceScaleFactor&&scale===1;var setDevicePromise=clear?this._target.emulationAgent().clearDeviceMetricsOverride(this._deviceMetricsOverrideAppliedForTest.bind(this)):this._target.emulationAgent().setDeviceMetricsOverride(pageWidth,pageHeight,deviceScaleFactor,mobile,false,scale,0,0,screenSize.width,screenSize.height,positionX,positionY,this._deviceMetricsOverrideAppliedForTest.bind(this));var allPromises=[setDevicePromise];if(resetScrollAndPageScale)
allPromises.push(this._target.emulationAgent().resetScrollAndPageScaleFactor());return Promise.all(allPromises);}},_deviceMetricsOverrideAppliedForTest:function()
{},_applyTouch:function(touchEnabled,mobile)
{var configuration=mobile?"mobile":"desktop";if(!this._target||(this._touchEnabled===touchEnabled&&this._touchConfiguration===configuration))
return;var target=this._target;const injectedFunction=function(){const touchEvents=["ontouchstart","ontouchend","ontouchmove","ontouchcancel"];var recepients=[window.__proto__,document.__proto__];for(var i=0;i<touchEvents.length;++i){for(var j=0;j<recepients.length;++j){if(!(touchEvents[i]in recepients[j]))
Object.defineProperty(recepients[j],touchEvents[i],{value:null,writable:true,configurable:true,enumerable:true});}}};var symbol=WebInspector.DeviceModeModel._touchEventsScriptIdSymbol;if(typeof target[symbol]!=="undefined"){target.pageAgent().removeScriptToEvaluateOnLoad(target[symbol]);delete target[symbol];}
if(touchEnabled)
target.pageAgent().addScriptToEvaluateOnLoad("("+injectedFunction.toString()+")()",scriptAddedCallback);function scriptAddedCallback(error,scriptId)
{if(error)
delete target[symbol];else
target[symbol]=scriptId;}
target.emulationAgent().setTouchEmulationEnabled(touchEnabled,configuration);this._touchEnabled=touchEnabled;this._touchConfiguration=configuration;},_applyScreenOrientation:function(orientation)
{if(!this._target||orientation===this._screenOrientation)
return;this._screenOrientation=orientation;if(!this._screenOrientation)
this._target.screenOrientationAgent().clearScreenOrientationOverride();else
this._target.screenOrientationAgent().setScreenOrientationOverride(this._screenOrientation==="landscapePrimary"?90:0,(this._screenOrientation));}};WebInspector.DeviceModeView=function()
{WebInspector.VBox.call(this,true);this.setMinimumSize(150,150);this.element.classList.add("device-mode-view");this.registerRequiredCSS("emulation/deviceModeView.css");WebInspector.Tooltip.addNativeOverrideContainer(this.contentElement);this._model=new WebInspector.DeviceModeModel(this._updateUI.bind(this));this._mediaInspector=new WebInspector.MediaQueryInspector(this._model.widthSetting());this._showMediaInspectorSetting=WebInspector.settings.createSetting("showMediaQueryInspector",false);this._showMediaInspectorSetting.addChangeListener(this._updateUI,this);this._showRulersSetting=WebInspector.settings.createSetting("emulation.showRulers",false);this._showRulersSetting.addChangeListener(this._updateUI,this);this._topRuler=new WebInspector.DeviceModeView.Ruler(true,this._model.widthSetting().set.bind(this._model.widthSetting()));this._topRuler.element.classList.add("device-mode-ruler-top");this._leftRuler=new WebInspector.DeviceModeView.Ruler(false,this._model.heightSetting().set.bind(this._model.heightSetting()));this._leftRuler.element.classList.add("device-mode-ruler-left");this._createUI();WebInspector.zoomManager.addEventListener(WebInspector.ZoomManager.Events.ZoomChanged,this._updateUI,this);};WebInspector.DeviceModeView.prototype={_createUI:function()
{this._toolbar=new WebInspector.DeviceModeView.Toolbar(this._model,this._showMediaInspectorSetting,this._showRulersSetting);this.contentElement.appendChild(this._toolbar.element());this._contentClip=this.contentElement.createChild("div","device-mode-content-clip vbox");this._mediaInspectorContainer=this._contentClip.createChild("div","device-mode-media-container");this._contentArea=this._contentClip.createChild("div","device-mode-content-area");this._screenArea=this._contentArea.createChild("div","device-mode-screen-area");this._screenImage=this._screenArea.createChild("img","device-mode-screen-image hidden");this._screenImage.addEventListener("load",this._onScreenImageLoaded.bind(this,true),false);this._screenImage.addEventListener("error",this._onScreenImageLoaded.bind(this,false),false);this._cornerResizerElement=this._screenArea.createChild("div","device-mode-resizer device-mode-corner-resizer");this._cornerResizerElement.createChild("div","");this._createResizer(this._cornerResizerElement,true,true);this._widthResizerElement=this._screenArea.createChild("div","device-mode-resizer device-mode-width-resizer");this._widthResizerElement.createChild("div","");this._createResizer(this._widthResizerElement,true,false);this._heightResizerElement=this._screenArea.createChild("div","device-mode-resizer device-mode-height-resizer");this._heightResizerElement.createChild("div","");this._createResizer(this._heightResizerElement,false,true);this._heightResizerElement.addEventListener("dblclick",this._model.heightSetting().set.bind(this._model.heightSetting(),0),false);this._pageArea=this._screenArea.createChild("div","device-mode-page-area");this._pageArea.createChild("content");},toggleDeviceMode:function()
{this._toolbar.toggleDeviceMode();},_createResizer:function(element,width,height)
{var resizer=new WebInspector.ResizerWidget();resizer.addElement(element);resizer.setCursor(width&&height?"nwse-resize":(width?"ew-resize":"ns-resize"));resizer.addEventListener(WebInspector.ResizerWidget.Events.ResizeStart,this._onResizeStart,this);resizer.addEventListener(WebInspector.ResizerWidget.Events.ResizeUpdate,this._onResizeUpdate.bind(this,width,height));resizer.addEventListener(WebInspector.ResizerWidget.Events.ResizeEnd,this._onResizeEnd,this);return resizer;},_onResizeStart:function(event)
{this._slowPositionStart=null;this._resizeStart=this._model.screenRect().size();},_onResizeUpdate:function(width,height,event)
{if(event.data.shiftKey!==!!this._slowPositionStart)
this._slowPositionStart=event.data.shiftKey?{x:event.data.currentX,y:event.data.currentY}:null;var cssOffsetX=event.data.currentX-event.data.startX;var cssOffsetY=event.data.currentY-event.data.startY;if(this._slowPositionStart){cssOffsetX=(event.data.currentX-this._slowPositionStart.x)/10+this._slowPositionStart.x-event.data.startX;cssOffsetY=(event.data.currentY-this._slowPositionStart.y)/10+this._slowPositionStart.y-event.data.startY;}
if(width){var dipOffsetX=cssOffsetX*WebInspector.zoomManager.zoomFactor();var newWidth=this._resizeStart.width+dipOffsetX*2;newWidth=Math.round(newWidth/this._model.scale());newWidth=Math.max(Math.min(newWidth,WebInspector.DeviceModeModel.MaxDeviceSize),1);this._model.widthSetting().set(newWidth);}
if(height){var dipOffsetY=cssOffsetY*WebInspector.zoomManager.zoomFactor();var newHeight=this._resizeStart.height+dipOffsetY;newHeight=Math.round(newHeight/this._model.scale());newHeight=Math.max(Math.min(newHeight,WebInspector.DeviceModeModel.MaxDeviceSize),1);this._model.heightSetting().set(newHeight);}},_onResizeEnd:function(event)
{delete this._resizeStart;WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.ResizedViewInResponsiveMode);},_resizeTo:function(width,height)
{this._model.widthSetting().set(width);this._model.heightSetting().set(height);},_updateUI:function()
{if(!this.isShowing())
return;var zoomFactor=WebInspector.zoomManager.zoomFactor();var callDoResize=false;var showRulers=this._showRulersSetting.get()&&this._model.type()!==WebInspector.DeviceModeModel.Type.None;var contentAreaResized=false;var updateRulers=false;var cssScreenRect=this._model.screenRect().scale(1/zoomFactor);if(!cssScreenRect.isEqual(this._cachedCssScreenRect)){this._screenArea.style.left=cssScreenRect.left+"px";this._screenArea.style.top=cssScreenRect.top+"px";this._screenArea.style.width=cssScreenRect.width+"px";this._screenArea.style.height=cssScreenRect.height+"px";this._leftRuler.element.style.left=cssScreenRect.left+"px";updateRulers=true;callDoResize=true;this._cachedCssScreenRect=cssScreenRect;}
var cssVisiblePageRect=this._model.visiblePageRect().scale(1/zoomFactor);if(!cssVisiblePageRect.isEqual(this._cachedCssVisiblePageRect)){this._pageArea.style.left=cssVisiblePageRect.left+"px";this._pageArea.style.top=cssVisiblePageRect.top+"px";this._pageArea.style.width=cssVisiblePageRect.width+"px";this._pageArea.style.height=cssVisiblePageRect.height+"px";callDoResize=true;this._cachedCssVisiblePageRect=cssVisiblePageRect;}
var resizable=this._model.type()===WebInspector.DeviceModeModel.Type.Responsive;if(resizable!==this._cachedResizable){this._widthResizerElement.classList.toggle("hidden",!resizable);this._heightResizerElement.classList.toggle("hidden",!resizable);this._cornerResizerElement.classList.toggle("hidden",!resizable);this._cachedResizable=resizable;}
var mediaInspectorVisible=this._showMediaInspectorSetting.get()&&this._model.type()!==WebInspector.DeviceModeModel.Type.None;if(mediaInspectorVisible!==this._cachedMediaInspectorVisible){if(mediaInspectorVisible)
this._mediaInspector.show(this._mediaInspectorContainer);else
this._mediaInspector.detach();contentAreaResized=true;callDoResize=true;this._cachedMediaInspectorVisible=mediaInspectorVisible;}
if(showRulers!==this._cachedShowRulers){this._contentArea.classList.toggle("device-mode-rulers-visible",showRulers);if(showRulers){this._topRuler.show(this._contentClip,this._contentArea);this._leftRuler.show(this._contentArea);}else{this._topRuler.detach();this._leftRuler.detach();}
contentAreaResized=true;callDoResize=true;this._cachedShowRulers=showRulers;}
if(this._model.scale()!==this._cachedScale){updateRulers=true;this._cachedScale=this._model.scale();}
this._toolbar.update();this._loadScreenImage(this._model.screenImage());this._mediaInspector.setAxisTransform(-cssScreenRect.left*zoomFactor/this._model.scale(),this._model.scale());if(callDoResize)
this.doResize();if(updateRulers){this._topRuler.render(this._cachedCssScreenRect?this._cachedCssScreenRect.left:0,this._model.scale());this._leftRuler.render(0,this._model.scale());}
if(contentAreaResized)
this._contentAreaResized();},_loadScreenImage:function(srcset)
{if(this._screenImage.getAttribute("srcset")===srcset)
return;this._screenImage.setAttribute("srcset",srcset);if(!srcset)
this._screenImage.classList.toggle("hidden",true);},_onScreenImageLoaded:function(success)
{this._screenImage.classList.toggle("hidden",!success);},_contentAreaResized:function()
{var zoomFactor=WebInspector.zoomManager.zoomFactor();var rect=this._contentArea.getBoundingClientRect();var handleWidth=this._widthResizerElement.offsetWidth;var handleHeight=this._heightResizerElement.offsetHeight;var availableSize=new Size(Math.max(rect.width*zoomFactor,1),Math.max(rect.height*zoomFactor,1));var preferredSize=new Size(Math.max((rect.width-2*handleWidth)*zoomFactor,1),Math.max((rect.height-handleHeight)*zoomFactor,1));this._model.setAvailableSize(availableSize,preferredSize);},onResize:function()
{if(this.isShowing())
this._contentAreaResized();},wasShown:function()
{this._mediaInspector.setEnabled(true);this._toolbar.restore();},willHide:function()
{this._mediaInspector.setEnabled(false);},__proto__:WebInspector.VBox.prototype}
WebInspector.DeviceModeView.Toolbar=function(model,showMediaInspectorSetting,showRulersSetting)
{this._model=model;this._showMediaInspectorSetting=showMediaInspectorSetting;this._showRulersSetting=showRulersSetting;this._lastMode=new Map();this._lastDevice=null;this._appliedSizeItems=[];this._scaleItems=[];this._visibleToolbar=null;this._element=createElementWithClass("div","device-mode-toolbar");var leftContainer=this._element.createChild("div","device-mode-toolbar-left");var leftToolbar=new WebInspector.Toolbar("",leftContainer);this._noneItem=new WebInspector.ToolbarToggle(WebInspector.UIString("Full"),"enter-fullscreen-toolbar-item");leftToolbar.appendToolbarItem(this._noneItem);this._noneItem.addEventListener("click",this._noneButtonClick,this);this._responsiveItem=new WebInspector.ToolbarToggle(WebInspector.UIString("Responsive"),"responsive-toolbar-item");leftToolbar.appendToolbarItem(this._responsiveItem);this._responsiveItem.addEventListener("click",this._responsiveButtonClick,this);this._deviceItem=new WebInspector.ToolbarToggle(WebInspector.UIString("Device"),"phone-toolbar-item");leftToolbar.appendToolbarItem(this._deviceItem);this._deviceItem.addEventListener("click",this._deviceButtonClick,this);leftToolbar.appendSeparator();var middle=this._element.createChild("div","device-mode-toolbar-middle-container");this._noneToolbar=this._wrapMiddleToolbar(middle,this._createNoneToolbar());this._responsiveToolbar=this._wrapMiddleToolbar(middle,this._createResponsiveToolbar());this._deviceToolbar=this._wrapMiddleToolbar(middle,this._createDeviceToolbar());var rightContainer=this._element.createChild("div","device-mode-toolbar-right");rightContainer.createChild("div","device-mode-toolbar-spacer");var rightToolbar=new WebInspector.Toolbar("",rightContainer);rightToolbar.makeWrappable(true);rightToolbar.appendSeparator();var moreOptionsButton=new WebInspector.ToolbarMenuButton(this._appendMenuItems.bind(this));moreOptionsButton.setTitle(WebInspector.UIString("More options"));rightToolbar.appendToolbarItem(moreOptionsButton);this._persistenceSetting=WebInspector.settings.createSetting("emulation.deviceModeViewPersistence",{type:WebInspector.DeviceModeModel.Type.None,device:"",orientation:"",mode:""});this._restored=false;}
WebInspector.DeviceModeView.Toolbar.prototype={_wrapMiddleToolbar:function(parent,toolbar)
{toolbar.makeWrappable();var container=parent.createChild("div","device-mode-toolbar-middle fill");container.createChild("div","device-mode-toolbar-spacer");container.appendChild(toolbar.element);container.createChild("div","device-mode-toolbar-spacer");container.classList.add("hidden");return container;},_createNoneToolbar:function()
{var toolbar=new WebInspector.Toolbar("");this._appendAppliedSizeItems(toolbar);return toolbar;},_createResponsiveToolbar:function()
{var toolbar=new WebInspector.Toolbar("");var widthInput=createElementWithClass("input","device-mode-size-input");widthInput.maxLength=5;widthInput.title=WebInspector.UIString("Width");WebInspector.SettingsUI.bindSettingInputField(widthInput,this._model.widthSetting(),true,WebInspector.DeviceModeModel.deviceSizeValidator,true);toolbar.appendToolbarItem(this._wrapToolbarItem(widthInput));var xElement=createElementWithClass("div","device-mode-x");xElement.textContent="\u00D7";toolbar.appendToolbarItem(this._wrapToolbarItem(xElement));var heightInput=createElementWithClass("input","device-mode-size-input");heightInput.maxLength=5;heightInput.title=WebInspector.UIString("Height (leave empty to fit)");WebInspector.SettingsUI.bindSettingInputField(heightInput,this._model.heightSetting(),true,validateHeight,true,true);toolbar.appendToolbarItem(this._wrapToolbarItem(heightInput));this._heightInput=heightInput;toolbar.appendSeparator();this._appendScaleItem(toolbar);return toolbar;function validateHeight(value)
{return!value?"":WebInspector.DeviceModeModel.deviceSizeValidator(value);}},_createDeviceToolbar:function()
{var toolbar=new WebInspector.Toolbar("");this._deviceSelect=this._createDeviceSelect();toolbar.appendToolbarItem(this._wrapToolbarItem(this._deviceSelect));this._modeButton=new WebInspector.ToolbarButton("","rotate-screen-toolbar-item");this._modeButton.addEventListener("click",this._modeMenuClicked,this);toolbar.appendToolbarItem(this._modeButton);toolbar.appendSeparator();this._appendAppliedSizeItems(toolbar);toolbar.appendSeparator();this._appendScaleItem(toolbar);return toolbar;},_appendAppliedSizeItems:function(toolbar)
{var item=new WebInspector.ToolbarLabel();this._appliedSizeItems.push(item);toolbar.appendToolbarItem(item);},_appendScaleItem:function(toolbar)
{var scaleItem=new WebInspector.ToolbarMenuButton(this._appendScaleMenuItems.bind(this));scaleItem.setTitle(WebInspector.UIString("Click to change zoom"));scaleItem.setGlyph("");scaleItem.setBold(false);scaleItem.addDropDownArrow();toolbar.appendToolbarItem(scaleItem);this._scaleItems.push(scaleItem);},_appendScaleMenuItems:function(contextMenu)
{var scaleSetting=this._model.scaleSetting();appendScaleItem(WebInspector.UIString("25%"),0.25);appendScaleItem(WebInspector.UIString("50%"),0.5);appendScaleItem(WebInspector.UIString("100%"),1);appendScaleItem(WebInspector.UIString("150%"),1.5);appendScaleItem(WebInspector.UIString("200%"),2);contextMenu.appendSeparator();contextMenu.appendItem(WebInspector.UIString("Fit (%.0f%%)",this._model.fitScale()*100),scaleSetting.set.bind(scaleSetting,this._model.fitScale()),false);function appendScaleItem(title,value)
{contextMenu.appendCheckboxItem(title,scaleSetting.set.bind(scaleSetting,value),scaleSetting.get()===value,false);}},_appendMenuItems:function(contextMenu)
{var uaDisabled=this._model.type()!==WebInspector.DeviceModeModel.Type.Responsive;var uaSetting=this._model.uaSetting();var uaSubmenu=contextMenu.appendSubMenuItem(WebInspector.UIString("User agent type"),false);var uaValue=this._model.uaSetting().get();if(this._model.type()===WebInspector.DeviceModeModel.Type.None)
uaValue=WebInspector.DeviceModeModel.UA.Desktop;if(this._model.type()===WebInspector.DeviceModeModel.Type.Device)
uaValue=this._model.device().mobile()?WebInspector.DeviceModeModel.UA.Mobile:this._model.device().touch()?WebInspector.DeviceModeModel.UA.DesktopTouch:WebInspector.DeviceModeModel.UA.Desktop;appendUAItem(WebInspector.UIString("Mobile"),WebInspector.DeviceModeModel.UA.Mobile);appendUAItem(WebInspector.UIString("Desktop"),WebInspector.DeviceModeModel.UA.Desktop);appendUAItem(WebInspector.UIString("Desktop with touch"),WebInspector.DeviceModeModel.UA.DesktopTouch);function appendUAItem(title,value)
{uaSubmenu.appendCheckboxItem(title,uaSetting.set.bind(uaSetting,value),uaValue===value,uaDisabled);}
var deviceScaleFactorDisabled=this._model.type()!==WebInspector.DeviceModeModel.Type.Responsive;var deviceScaleFactorSubmenu=contextMenu.appendSubMenuItem(WebInspector.UIString("Device pixel ratio"),false);var deviceScaleFactorSetting=this._model.deviceScaleFactorSetting();var deviceScaleFactorValue=deviceScaleFactorDisabled?0:deviceScaleFactorSetting.get();appendDeviceScaleFactorItem(WebInspector.UIString("Default: %f",this._model.defaultDeviceScaleFactor()),0);deviceScaleFactorSubmenu.appendSeparator();appendDeviceScaleFactorItem(WebInspector.UIString("1"),1);appendDeviceScaleFactorItem(WebInspector.UIString("2"),2);appendDeviceScaleFactorItem(WebInspector.UIString("3"),3);function appendDeviceScaleFactorItem(title,value)
{deviceScaleFactorSubmenu.appendCheckboxItem(title,deviceScaleFactorSetting.set.bind(deviceScaleFactorSetting,value),deviceScaleFactorValue===value,deviceScaleFactorDisabled);}
contextMenu.appendItem(WebInspector.UIString("Reset to defaults"),this._model.reset.bind(this._model),this._model.type()!==WebInspector.DeviceModeModel.Type.Responsive);contextMenu.appendSeparator();contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries"),this._toggleMediaInspector.bind(this),this._showMediaInspectorSetting.get(),this._model.type()===WebInspector.DeviceModeModel.Type.None);contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"),this._toggleRulers.bind(this),this._showRulersSetting.get(),this._model.type()===WebInspector.DeviceModeModel.Type.None);contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"),this._openNetworkConfig.bind(this),false);},_toggleMediaInspector:function()
{this._showMediaInspectorSetting.set(!this._showMediaInspectorSetting.get());},_toggleRulers:function()
{this._showRulersSetting.set(!this._showRulersSetting.get());},_openNetworkConfig:function()
{InspectorFrontendHost.bringToFront();WebInspector.actionRegistry.action("network.show-config").execute();},_wrapToolbarItem:function(element)
{var container=createElement("div");var shadowRoot=WebInspector.createShadowRootWithCoreStyles(container,"emulation/deviceModeToolbar.css");shadowRoot.appendChild(element);return new WebInspector.ToolbarItem(container);},_noneButtonClick:function()
{this._model.emulate(WebInspector.DeviceModeModel.Type.None,null,null);},_responsiveButtonClick:function()
{this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive,null,null);},_deviceButtonClick:function()
{this._emulateDevice(this._lastDevice||this._deviceSelect.options[0].device||WebInspector.emulatedDevicesList.standard()[0]);},_emulateDevice:function(device)
{this._model.emulate(WebInspector.DeviceModeModel.Type.Device,device,this._lastMode.get(device)||device.modes[0]);},_createDeviceSelect:function()
{var select=createElementWithClass("select","device-mode-device-select");WebInspector.emulatedDevicesList.addEventListener(WebInspector.EmulatedDevicesList.Events.CustomDevicesUpdated,deviceListChanged,this);WebInspector.emulatedDevicesList.addEventListener(WebInspector.EmulatedDevicesList.Events.StandardDevicesUpdated,deviceListChanged,this);populateDeviceList.call(this);select.addEventListener("change",optionSelected.bind(this),false);return select;function populateDeviceList()
{select.removeChildren();var devicesGroup=select.createChild("optgroup");devicesGroup.label=WebInspector.UIString("Devices");addGroup.call(this,devicesGroup,WebInspector.emulatedDevicesList.standard());var customGroup=select.createChild("optgroup");customGroup.label=WebInspector.UIString("Custom");addGroup.call(this,customGroup,WebInspector.emulatedDevicesList.custom());var editCustomOption=new Option(WebInspector.UIString("Edit\u2026"),WebInspector.UIString("Edit\u2026"));editCustomOption.edit=true;customGroup.appendChild(editCustomOption);}
function deviceListChanged()
{populateDeviceList.call(this);if(!this._updateDeviceSelectedIndex()&&this._model.type()===WebInspector.DeviceModeModel.Type.Device){select.selectedIndex=0;if(!select.options[0].edit)
this._emulateDevice(select.options[0].device);}}
function addGroup(parent,devices)
{devices=devices.filter(function(d){return d.show();});devices.sort(WebInspector.EmulatedDevice.deviceComparator);for(var device of devices)
addOption.call(this,parent,device);}
function addOption(parent,device)
{var option=new Option(device.title,device.title);option.device=device;parent.appendChild(option);if(device===this._model.device())
select.selectedIndex=Array.prototype.slice.call(select.options).indexOf(option);}
function optionSelected()
{var option=select.options[select.selectedIndex];if(option.edit){WebInspector.emulatedDevicesList.revealCustomSetting();this._updateDeviceSelectedIndex();}else{this._emulateDevice(option.device);}}},_updateDeviceSelectedIndex:function()
{for(var i=0;i<this._deviceSelect.options.length;++i){if(this._deviceSelect.options[i].device===this._model.device()){this._deviceSelect.selectedIndex=i;return true;}}
return false;},_modeMenuClicked:function(event)
{var device=this._model.device();var model=this._model;if(device.modes.length===2&&device.modes[0].orientation!==device.modes[1].orientation){model.emulate(model.type(),model.device(),model.mode()===device.modes[0]?device.modes[1]:device.modes[0]);return;}
var contextMenu=new WebInspector.ContextMenu((event.data),false,event.target.element.totalOffsetLeft(),event.target.element.totalOffsetTop()+event.target.element.offsetHeight);addOrientation(WebInspector.EmulatedDevice.Vertical,WebInspector.UIString("Portrait"));addOrientation(WebInspector.EmulatedDevice.Horizontal,WebInspector.UIString("Landscape"));contextMenu.show();function addOrientation(orientation,title)
{var modes=device.modesForOrientation(orientation);if(!modes.length)
return;if(modes.length===1){addMode(modes[0],title);}else{for(var index=0;index<modes.length;index++)
addMode(modes[index],title+" \u2013 "+modes[index].title);}}
function addMode(mode,title)
{contextMenu.appendCheckboxItem(title,applyMode.bind(null,mode),model.mode()===mode,false);}
function applyMode(mode)
{model.emulate(model.type(),model.device(),mode);}},element:function()
{return this._element;},update:function()
{var updatePersistence=false;if(this._model.type()!==this._cachedModelType){this._noneItem.setToggled(this._model.type()===WebInspector.DeviceModeModel.Type.None);this._responsiveItem.setToggled(this._model.type()===WebInspector.DeviceModeModel.Type.Responsive);this._deviceItem.setToggled(this._model.type()===WebInspector.DeviceModeModel.Type.Device);var toolbar=null;if(this._model.type()===WebInspector.DeviceModeModel.Type.None)
toolbar=this._noneToolbar;else if(this._model.type()===WebInspector.DeviceModeModel.Type.Responsive)
toolbar=this._responsiveToolbar;else if(this._model.type()===WebInspector.DeviceModeModel.Type.Device)
toolbar=this._deviceToolbar;if(this._visibleToolbar!==toolbar){if(this._visibleToolbar)
this._visibleToolbar.classList.add("hidden");if(toolbar){toolbar.classList.remove("hidden");toolbar.animate([{opacity:"0"},{opacity:"1"}],{duration:100});}
this._visibleToolbar=toolbar;}
this._previousModelType=this._cachedModelType;this._cachedModelType=this._model.type();updatePersistence=true;}
var size=this._model.appliedDeviceSize();if(!size.isEqual(this._cachedSize)){for(var item of this._appliedSizeItems)
item.setText(WebInspector.UIString("%d \u00D7 %d",size.width,size.height));this._heightInput.placeholder=size.height;this._cachedSize=size;}
if(this._model.scale()!==this._cachedScale){for(var item of this._scaleItems)
item.setText(WebInspector.UIString("%.0f%%",this._model.scale()*100));this._cachedScale=this._model.scale();}
if(this._model.device()!==this._cachedModelDevice){var device=this._model.device();if(device){var modeCount=device?device.modes.length:0;this._modeButton.setEnabled(modeCount>=2);this._modeButton.setTitle(modeCount===2?WebInspector.UIString("Rotate"):WebInspector.UIString("Screen options"));}
this._updateDeviceSelectedIndex();this._cachedModelDevice=device;updatePersistence=true;}
if(this._model.type()===WebInspector.DeviceModeModel.Type.Device){this._lastDevice=this._model.device();this._lastMode.set((this._model.device()),(this._model.mode()));}
if(this._model.mode()!==this._cachedModelMode){this._cachedModelMode=this._model.mode();updatePersistence=true;}
if(updatePersistence){var value=this._persistenceSetting.get();value.type=this._cachedModelType;if(this._cachedModelDevice){value.device=this._cachedModelDevice.title;value.orientation=this._cachedModelMode?this._cachedModelMode.orientation:"";value.mode=this._cachedModelMode?this._cachedModelMode.title:"";}
this._persistenceSetting.set(value);}},restore:function()
{if(this._restored)
return;this._restored=true;for(var i=0;i<this._deviceSelect.options.length;++i){if(this._deviceSelect.options[i].device&&this._deviceSelect.options[i].device.title===this._persistenceSetting.get().device)
this._lastDevice=this._deviceSelect.options[i].device;}
if(this._lastDevice){for(var i=0;i<this._lastDevice.modes.length;++i){if(this._lastDevice.modes[i].orientation===this._persistenceSetting.get().orientation&&this._lastDevice.modes[i].title===this._persistenceSetting.get().mode)
this._lastMode.set(this._lastDevice,this._lastDevice.modes[i]);}}else{this._model.emulate(WebInspector.DeviceModeModel.Type.None,null,null);}
this._applyType((this._persistenceSetting.get().type));},toggleDeviceMode:function()
{this._applyType(this._model.type()===WebInspector.DeviceModeModel.Type.None?(this._previousModelType||WebInspector.DeviceModeModel.Type.Responsive):WebInspector.DeviceModeModel.Type.None);},_applyType:function(type)
{if(type===WebInspector.DeviceModeModel.Type.Responsive)
this._responsiveButtonClick();else if(type===WebInspector.DeviceModeModel.Type.Device)
this._deviceButtonClick();else
this._noneButtonClick();}}
WebInspector.DeviceModeView.Ruler=function(horizontal,applyCallback)
{WebInspector.VBox.call(this);this._contentElement=this.element.createChild("div","device-mode-ruler flex-auto");this._horizontal=horizontal;this._scale=1;this._offset=0;this._count=0;this._throttler=new WebInspector.Throttler(0);this._applyCallback=applyCallback;}
WebInspector.DeviceModeView.Ruler.prototype={render:function(offset,scale)
{this._scale=scale;this._offset=offset;if(this._horizontal)
this.element.style.paddingLeft=this._offset+"px";else
this.element.style.paddingTop=this._offset+"px";this._throttler.schedule(this._update.bind(this));},onResize:function()
{this._throttler.schedule(this._update.bind(this));},_update:function()
{var zoomFactor=WebInspector.zoomManager.zoomFactor();var size=this._horizontal?this._contentElement.offsetWidth:this._contentElement.offsetHeight;if(this._scale!==this._renderedScale||zoomFactor!==this._renderedZoomFactor){this._contentElement.removeChildren();this._count=0;this._renderedScale=this._scale;this._renderedZoomFactor=zoomFactor;}
var dipSize=size*zoomFactor/this._scale;var count=Math.ceil(dipSize/5);var step=1;if(this._scale<0.8)
step=2;if(this._scale<0.6)
step=5;if(this._scale<0.5)
step=20;for(var i=count;i<this._count;i++){if(!(i%step))
this._contentElement.lastChild.remove();}
for(var i=this._count;i<count;i++){if(i%step)
continue;var marker=this._contentElement.createChild("div","device-mode-ruler-marker");if(i){if(this._horizontal)
marker.style.left=(5*i)*this._scale/zoomFactor+"px";else
marker.style.top=(5*i)*this._scale/zoomFactor+"px";if(!(i%20)){var text=marker.createChild("div","device-mode-ruler-text");text.textContent=i*5;text.addEventListener("click",this._onMarkerClick.bind(this,i*5),false);}}
if(!(i%10))
marker.classList.add("device-mode-ruler-marker-large");else if(!(i%5))
marker.classList.add("device-mode-ruler-marker-medium");}
this._count=count;return Promise.resolve();},_onMarkerClick:function(size)
{this._applyCallback.call(null,size);},__proto__:WebInspector.VBox.prototype}
WebInspector.DeviceModeView.ActionDelegate=function()
{}
WebInspector.DeviceModeView.ActionDelegate.prototype={handleAction:function(context,actionId)
{if(actionId==="emulation.toggle-device-mode"&&WebInspector.DeviceModeView._wrapperInstance){WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode();return true;}
if(actionId==="emulation.toggle-device-toolbar"&&WebInspector.DeviceModeView._wrapperInstance){WebInspector.DeviceModeView._wrapperInstance._toggleDeviceToolbar();return true;}
return false;}}
WebInspector.DeviceModeView.Wrapper=function(inspectedPagePlaceholder)
{WebInspector.VBox.call(this);WebInspector.DeviceModeView._wrapperInstance=this;this._inspectedPagePlaceholder=inspectedPagePlaceholder;this._deviceModeView=new WebInspector.DeviceModeView();this._showDeviceToolbarSetting=WebInspector.settings.createSetting("emulation.showDeviceToolbar",true);this._showDeviceToolbarSetting.addChangeListener(this._update,this);this._update();}
WebInspector.DeviceModeView._wrapperInstance;WebInspector.DeviceModeView.Wrapper.prototype={_toggleDeviceMode:function()
{if(this._showDeviceToolbarSetting.get())
this._deviceModeView.toggleDeviceMode();},_toggleDeviceToolbar:function()
{this._showDeviceToolbarSetting.set(!this._showDeviceToolbarSetting.get());},_update:function()
{if(this._showDeviceToolbarSetting.get()){this._deviceModeView.show(this.element);this._inspectedPagePlaceholder.clearMinimumSizeAndMargins();this._inspectedPagePlaceholder.show(this._deviceModeView.element);}else{this._deviceModeView.detach();this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins();this._inspectedPagePlaceholder.show(this.element);this._deviceModeView._model.emulate(WebInspector.DeviceModeModel.Type.None,null,null);}},__proto__:WebInspector.VBox.prototype};WebInspector.AdvancedApp=function()
{WebInspector.dockController.addEventListener(WebInspector.DockController.Events.BeforeDockSideChanged,this._openToolboxWindow,this);};WebInspector.AdvancedApp.prototype={presentUI:function(document,callback)
{var rootView=new WebInspector.RootView();this._rootSplitWidget=new WebInspector.SplitWidget(false,true,"InspectorView.splitViewState",555,300,true);this._rootSplitWidget.show(rootView.element);this._rootSplitWidget.setSidebarWidget(WebInspector.inspectorView);this._inspectedPagePlaceholder=new WebInspector.InspectedPagePlaceholder();this._inspectedPagePlaceholder.addEventListener(WebInspector.InspectedPagePlaceholder.Events.Update,this._onSetInspectedPageBounds.bind(this),this);if(Runtime.experiments.isEnabled("deviceMode"))
this._responsiveDesignView=new WebInspector.DeviceModeView.Wrapper(this._inspectedPagePlaceholder);else
this._responsiveDesignView=new WebInspector.ResponsiveDesignView(this._inspectedPagePlaceholder);WebInspector.dockController.addEventListener(WebInspector.DockController.Events.BeforeDockSideChanged,this._onBeforeDockSideChange,this);WebInspector.dockController.addEventListener(WebInspector.DockController.Events.DockSideChanged,this._onDockSideChange,this);WebInspector.dockController.addEventListener(WebInspector.DockController.Events.AfterDockSideChanged,this._onAfterDockSideChange,this);this._onDockSideChange();WebInspector.inspectorView.showInitialPanel();console.timeStamp("AdvancedApp.attachToBody");rootView.attachToDocument(document);this._inspectedPagePlaceholder.update();if(this._isDocked())
callback();else
this._presentUICallback=callback;},_openToolboxWindow:function(event)
{if((event.data.to)!==WebInspector.DockController.State.Undocked)
return;if(this._toolboxWindow)
return;var url=window.location.href.replace("inspector.html","toolbox.html");this._toolboxWindow=window.open(url,undefined);},toolboxLoaded:function(toolboxDocument)
{WebInspector.initializeUIUtils(toolboxDocument,WebInspector.settings.createSetting("uiTheme","default"));WebInspector.installComponentRootStyles((toolboxDocument.body));WebInspector.ContextMenu.installHandler(toolboxDocument);WebInspector.Tooltip.installHandler(toolboxDocument);this._toolboxRootView=new WebInspector.RootView();this._toolboxRootView.attachToDocument(toolboxDocument);this._updateResponsiveDesignView();if(this._presentUICallback){var callback=this._presentUICallback;delete this._presentUICallback;callback();}},_updateResponsiveDesignView:function()
{if(this._isDocked())
this._rootSplitWidget.setMainWidget(this._responsiveDesignView);else if(this._toolboxRootView)
this._responsiveDesignView.show(this._toolboxRootView.element);if(!Runtime.experiments.isEnabled("deviceMode")&&(this._isDocked()||this._toolboxRootView))
this._responsiveDesignView.updatePageResizer();},_onBeforeDockSideChange:function(event)
{if((event.data.to)===WebInspector.DockController.State.Undocked&&this._toolboxRootView){this._rootSplitWidget.hideSidebar();this._inspectedPagePlaceholder.update();}
this._changingDockSide=true;},_onDockSideChange:function(event)
{this._updateResponsiveDesignView();var toDockSide=event?(event.data.to):WebInspector.dockController.dockSide();if(toDockSide===WebInspector.DockController.State.Undocked){this._updateForUndocked();}else if(this._toolboxRootView&&event&&(event.data.from)===WebInspector.DockController.State.Undocked){this._rootSplitWidget.hideSidebar();}else{this._updateForDocked(toDockSide);}},_onAfterDockSideChange:function(event)
{if(!this._changingDockSide)
return;if((event.data.from)===WebInspector.DockController.State.Undocked){this._updateForDocked((event.data.to));}
this._changingDockSide=false;this._inspectedPagePlaceholder.update();},_updateForDocked:function(dockSide)
{this._rootSplitWidget.setVertical(dockSide===WebInspector.DockController.State.DockedToRight);this._rootSplitWidget.setSecondIsSidebar(dockSide===WebInspector.DockController.State.DockedToRight||dockSide===WebInspector.DockController.State.DockedToBottom);this._rootSplitWidget.toggleResizer(this._rootSplitWidget.resizerElement(),true);this._rootSplitWidget.toggleResizer(WebInspector.inspectorView.topResizerElement(),dockSide===WebInspector.DockController.State.DockedToBottom);this._rootSplitWidget.showBoth();},_updateForUndocked:function()
{this._rootSplitWidget.toggleResizer(this._rootSplitWidget.resizerElement(),false);this._rootSplitWidget.toggleResizer(WebInspector.inspectorView.topResizerElement(),false);this._rootSplitWidget.hideMain();},_isDocked:function()
{return WebInspector.dockController.dockSide()!==WebInspector.DockController.State.Undocked;},_onSetInspectedPageBounds:function(event)
{if(this._changingDockSide)
return;var window=this._inspectedPagePlaceholder.element.window();if(!window.innerWidth||!window.innerHeight)
return;if(!this._inspectedPagePlaceholder.isShowing())
return;var bounds=(event.data);console.timeStamp("AdvancedApp.setInspectedPageBounds");InspectorFrontendHost.setInspectedPageBounds(bounds);}};WebInspector.AdvancedApp._appInstance;WebInspector.AdvancedApp._instance=function()
{if(!WebInspector.AdvancedApp._appInstance)
WebInspector.AdvancedApp._appInstance=new WebInspector.AdvancedApp();return WebInspector.AdvancedApp._appInstance;};WebInspector.AdvancedAppProvider=function()
{};WebInspector.AdvancedAppProvider.prototype={createApp:function()
{return WebInspector.AdvancedApp._instance();}};;WebInspector.FrontendWebSocketAPI=function()
{InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.DispatchFrontendAPIMessage,this._onFrontendAPIMessage,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.FrontendAPIAttached,this._onAttach,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.FrontendAPIDetached,this._onDetach,this);}
WebInspector.FrontendWebSocketAPI.prototype={_onAttach:function()
{WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.WorkingCopyCommittedByUser,this._workingCopyCommitted,this);WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.WorkingCopyChanged,this._workingCopyChanged,this);WebInspector.Linkifier.setLinkHandler(this);},_onDetach:function()
{WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.WorkingCopyCommittedByUser,this._workingCopyCommitted,this);WebInspector.workspace.removeEventListener(WebInspector.Workspace.Events.WorkingCopyChanged,this._workingCopyChanged,this);WebInspector.Linkifier.setLinkHandler(null);},handleLink:function(url,lineNumber)
{var uiSourceCode=WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(url);if(uiSourceCode)
url=uiSourceCode.url();if(url.startsWith("file://")){var file=url.substring(7);this._issueFrontendAPINotification("Frontend.revealLocation",{file:file,line:lineNumber});return true;}
return false;},_onFrontendAPIMessage:function(event)
{var message=JSON.parse((event.data));this._dispatchFrontendAPIMessage(message["id"],message["method"],message["params"]||null);},_dispatchFrontendAPIMessage:function(id,method,params)
{this._dispatchingFrontendMessage=true;switch(method){case"Frontend.updateBuffer":var file=params["file"];var buffer=params["buffer"];var saved=params["saved"];var uiSourceCode=WebInspector.workspace.uiSourceCodeForURL("file://"+file);if(uiSourceCode){if(buffer!==uiSourceCode.workingCopy())
uiSourceCode.setWorkingCopy(buffer);if(saved)
uiSourceCode.checkContentUpdated(true);}
break;default:WebInspector.console.log("Unhandled API message: "+method);}
this._issueResponse(id);this._dispatchingFrontendMessage=false;},_workingCopyChanged:function(event,saved)
{if(this._dispatchingFrontendMessage)
return;var uiSourceCode=(event.data["uiSourceCode"]);var url=uiSourceCode.url();if(url.startsWith("file://"))
url=url.substring(7);var params={file:url,buffer:uiSourceCode.workingCopy()};if(saved)
params.saved=true;this._issueFrontendAPINotification("Frontend.bufferUpdated",params);},_workingCopyCommitted:function(event)
{this._workingCopyChanged(event,true);},_issueResponse:function(id,params)
{var object={id:id};if(params)
object.params=params;InspectorFrontendHost.sendFrontendAPINotification(JSON.stringify(object));},_issueFrontendAPINotification:function(method,params)
{InspectorFrontendHost.sendFrontendAPINotification(JSON.stringify({method:method,params:params}));}};WebInspector.RenderingOptionsView=function()
{WebInspector.VBox.call(this,true);this.registerRequiredCSS("main/renderingOptions.css");this._settings=new Map();this._appendCheckbox(WebInspector.UIString("Enable paint flashing"),"setShowPaintRects");this._appendCheckbox(WebInspector.UIString("Show layer borders"),"setShowDebugBorders");this._appendCheckbox(WebInspector.UIString("Show FPS meter"),"setShowFPSCounter");var scrollingTitle=WebInspector.UIString("Shows areas of the page that slow down scrolling:\nTouch and mousewheel event listeners can delay scrolling.\nSome areas need to repaint their content when scrolled.");this._appendCheckbox(WebInspector.UIString("Show scrolling perf issues"),"setShowScrollBottleneckRects",scrollingTitle);var checkboxLabel=createCheckboxLabel(WebInspector.UIString("Emulate print media"),false);this._printCheckbox=checkboxLabel.checkboxElement;this._printCheckbox.addEventListener("click",this._printToggled.bind(this));this.contentElement.appendChild(checkboxLabel);WebInspector.targetManager.observeTargets(this,WebInspector.Target.Type.Page);}
WebInspector.RenderingOptionsView.prototype={_appendCheckbox:function(label,setterName,title)
{var checkboxLabel=createCheckboxLabel(label,false);this._settings.set(setterName,checkboxLabel.checkboxElement);checkboxLabel.checkboxElement.addEventListener("click",this._settingToggled.bind(this,setterName));if(title)
checkboxLabel.title=title;this.contentElement.appendChild(checkboxLabel);},_settingToggled:function(setterName)
{var enabled=this._settings.get(setterName).checked;var targets=WebInspector.targetManager.targets(WebInspector.Target.Type.Page);for(var i=0;i<targets.length;++i)
targets[i].renderingAgent()[setterName](enabled);},targetAdded:function(target)
{for(var setterName of this._settings.keysArray()){if(this._settings.get(setterName).checked)
target.renderingAgent()[setterName](true);}
if(this._printCheckbox.checked)
this._applyPrintMediaOverride(target);},_printToggled:function()
{var targets=WebInspector.targetManager.targets(WebInspector.Target.Type.Page);for(var target of targets)
this._applyPrintMediaOverride(target);},_applyPrintMediaOverride:function(target)
{var enabled=this._printCheckbox.checked;target.emulationAgent().setEmulatedMedia(enabled?"print":"");var cssModel=WebInspector.CSSStyleModel.fromTarget(target);if(cssModel)
cssModel.mediaQueryResultChanged();},targetRemoved:function(target)
{},__proto__:WebInspector.VBox.prototype}
WebInspector.RenderingOptionsView.instance=function()
{if(!WebInspector.RenderingOptionsView._instanceObject)
WebInspector.RenderingOptionsView._instanceObject=new WebInspector.RenderingOptionsView();return WebInspector.RenderingOptionsView._instanceObject;}
WebInspector.RenderingOptionsView.ShowActionDelegate=function()
{}
WebInspector.RenderingOptionsView.ShowActionDelegate.prototype={handleAction:function(context,actionId)
{WebInspector.inspectorView.showViewInDrawer("rendering");return true;}};WebInspector.SimpleApp=function()
{};WebInspector.SimpleApp.prototype={presentUI:function(document,callback)
{var rootView=new WebInspector.RootView();WebInspector.inspectorView.show(rootView.element);WebInspector.inspectorView.showInitialPanel();rootView.attachToDocument(document);callback();}};WebInspector.SimpleAppProvider=function()
{};WebInspector.SimpleAppProvider.prototype={createApp:function()
{return new WebInspector.SimpleApp();}};;function createTestSuite(domAutomationController)
{function TestSuite()
{WebInspector.TestBase.call(this,domAutomationController);};TestSuite.prototype={__proto__:WebInspector.TestBase.prototype};TestSuite.prototype.showPanel=function(panelName)
{return WebInspector.inspectorView.showPanel(panelName);};TestSuite.prototype.testShowScriptsTab=function()
{var test=this;this.showPanel("sources").then(function(){this._waitUntilScriptsAreParsed(["debugger_test_page.html"],function(){test.releaseControl();});}.bind(this));this.takeControl();};TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh=function()
{var test=this;var debuggerModel=WebInspector.DebuggerModel.fromTarget(WebInspector.targetManager.mainTarget());debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,waitUntilScriptIsParsed);this.showPanel("elements").then(function(){test.evaluateInConsole_("window.location.reload(true);",function(resultText){});});function waitUntilScriptIsParsed()
{debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,waitUntilScriptIsParsed);test.showPanel("sources").then(function(){test._waitUntilScriptsAreParsed(["debugger_test_page.html"],function(){test.releaseControl();});});}
this.takeControl();};TestSuite.prototype.testContentScriptIsPresent=function()
{var test=this;this.showPanel("sources").then(function(){test._waitUntilScriptsAreParsed(["page_with_content_script.html","simple_content_script.js"],function(){test.releaseControl();});});this.takeControl();};TestSuite.prototype.testNoScriptDuplicatesOnPanelSwitch=function()
{var test=this;var expectedScriptsCount=2;var parsedScripts=[];function switchToElementsTab(){test.showPanel("elements").then(function(){setTimeout(switchToScriptsTab,0);});}
function switchToScriptsTab(){test.showPanel("sources").then(function(){setTimeout(checkScriptsPanel,0);});}
function checkScriptsPanel(){test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]),"Some scripts are missing.");checkNoDuplicates();test.releaseControl();}
function checkNoDuplicates(){var uiSourceCodes=test.nonAnonymousUISourceCodes_();for(var i=0;i<uiSourceCodes.length;i++){var scriptName=WebInspector.networkMapping.networkURL(uiSourceCodes[i]);for(var j=i+1;j<uiSourceCodes.length;j++)
test.assertTrue(scriptName!==WebInspector.networkMapping.networkURL(uiSourceCodes[j]),"Found script duplicates: "+test.uiSourceCodesToString_(uiSourceCodes));}}
this.showPanel("sources").then(function(){test._waitUntilScriptsAreParsed(["debugger_test_page.html"],function(){checkNoDuplicates();setTimeout(switchToElementsTab,0);});});this.takeControl();};TestSuite.prototype.testPauseWhenLoadingDevTools=function()
{var debuggerModel=WebInspector.DebuggerModel.fromTarget(WebInspector.targetManager.mainTarget());if(debuggerModel.debuggerPausedDetails)
return;this.showPanel("sources").then(function(){this._waitForScriptPause(this.releaseControl.bind(this));}.bind(this));this.takeControl();};TestSuite.prototype.testPauseWhenScriptIsRunning=function()
{this.showPanel("sources").then(function(){this.evaluateInConsole_('setTimeout("handleClick()", 0)',didEvaluateInConsole.bind(this));}.bind(this));function didEvaluateInConsole(resultText){this.assertTrue(!isNaN(resultText),"Failed to get timer id: "+resultText);setTimeout(testScriptPause.bind(this),300);}
function testScriptPause(){WebInspector.panels.sources._togglePause();this._waitForScriptPause(this.releaseControl.bind(this));}
this.takeControl();};TestSuite.prototype.testNetworkSize=function()
{var test=this;function finishResource(resource,finishTime)
{test.assertEquals(25,resource.resourceSize,"Incorrect total data length");test.releaseControl();}
this.addSniffer(WebInspector.NetworkDispatcher.prototype,"_finishNetworkRequest",finishResource);test.evaluateInConsole_("window.location.reload(true);",function(resultText){});this.takeControl();};TestSuite.prototype.testNetworkSyncSize=function()
{var test=this;function finishResource(resource,finishTime)
{test.assertEquals(25,resource.resourceSize,"Incorrect total data length");test.releaseControl();}
this.addSniffer(WebInspector.NetworkDispatcher.prototype,"_finishNetworkRequest",finishResource);test.evaluateInConsole_("var xhr = new XMLHttpRequest(); xhr.open(\"GET\", \"chunked\", false); xhr.send(null);",function(){});this.takeControl();};TestSuite.prototype.testNetworkRawHeadersText=function()
{var test=this;function finishResource(resource,finishTime)
{if(!resource.responseHeadersText)
test.fail("Failure: resource does not have response headers text");var index=resource.responseHeadersText.indexOf("Date:")
test.assertEquals(112,resource.responseHeadersText.substring(index).length,"Incorrect response headers text length");test.releaseControl();}
this.addSniffer(WebInspector.NetworkDispatcher.prototype,"_finishNetworkRequest",finishResource);test.evaluateInConsole_("window.location.reload(true);",function(resultText){});this.takeControl();};TestSuite.prototype.testNetworkTiming=function()
{var test=this;function finishResource(resource,finishTime)
{test.assertTrue(resource.timing.receiveHeadersEnd-resource.timing.connectStart>=70,"Time between receiveHeadersEnd and connectStart should be >=70ms, but was "+"receiveHeadersEnd="+resource.timing.receiveHeadersEnd+", connectStart="+resource.timing.connectStart+".");test.assertTrue(resource.responseReceivedTime-resource.startTime>=0.07,"Time between responseReceivedTime and startTime should be >=0.07s, but was "+"responseReceivedTime="+resource.responseReceivedTime+", startTime="+resource.startTime+".");test.assertTrue(resource.endTime-resource.startTime>=0.14,"Time between endTime and startTime should be >=0.14s, but was "+"endtime="+resource.endTime+", startTime="+resource.startTime+".");test.releaseControl();}
this.addSniffer(WebInspector.NetworkDispatcher.prototype,"_finishNetworkRequest",finishResource);test.evaluateInConsole_("window.location.reload(true);",function(resultText){});this.takeControl();};TestSuite.prototype.testConsoleOnNavigateBack=function()
{if(WebInspector.multitargetConsoleModel.messages().length===1)
firstConsoleMessageReceived.call(this);else
WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded,firstConsoleMessageReceived,this);function firstConsoleMessageReceived(){WebInspector.multitargetConsoleModel.removeEventListener(WebInspector.ConsoleModel.Events.MessageAdded,firstConsoleMessageReceived,this);this.evaluateInConsole_("clickLink();",didClickLink.bind(this));}
function didClickLink(){this.assertEquals(3,WebInspector.multitargetConsoleModel.messages().length);this.evaluateInConsole_("history.back();",didNavigateBack.bind(this));}
function didNavigateBack()
{this.evaluateInConsole_("void 0;",didCompleteNavigation.bind(this));}
function didCompleteNavigation(){this.assertEquals(7,WebInspector.multitargetConsoleModel.messages().length);this.releaseControl();}
this.takeControl();};TestSuite.prototype.testSharedWorker=function()
{function didEvaluateInConsole(resultText){this.assertEquals("2011",resultText);this.releaseControl();}
this.evaluateInConsole_("globalVar",didEvaluateInConsole.bind(this));this.takeControl();};TestSuite.prototype.testPauseInSharedWorkerInitialization1=function()
{this.takeControl();this._waitForTargets(2,callback.bind(this));function callback()
{var target=WebInspector.targetManager.targetsWithJSContext()[0];target._connection.runAfterPendingDispatches(this.releaseControl.bind(this));}};TestSuite.prototype.testPauseInSharedWorkerInitialization2=function()
{this.takeControl();this._waitForTargets(2,callback.bind(this));function callback()
{var target=WebInspector.targetManager.targetsWithJSContext()[0];var debuggerModel=WebInspector.DebuggerModel.fromTarget(target);if(debuggerModel.isPaused()){this.releaseControl();return;}
this._waitForScriptPause(this.releaseControl.bind(this));}};TestSuite.prototype.enableTouchEmulation=function()
{WebInspector.overridesSupport._emulateTouchEventsInTarget(WebInspector.targetManager.mainTarget(),true,"mobile");};TestSuite.prototype.switchToPanel=function(panelName)
{this.showPanel(panelName).then(this.releaseControl.bind(this));this.takeControl();}
TestSuite.prototype.testDeviceMetricsOverrides=function()
{const dumpPageMetrics=function()
{return JSON.stringify({width:window.innerWidth,height:window.innerHeight,deviceScaleFactor:window.devicePixelRatio});};var test=this;function testOverrides(params,metrics,callback)
{WebInspector.targetManager.mainTarget().emulationAgent().invoke_setDeviceMetricsOverride(params,getMetrics);function getMetrics()
{test.evaluateInConsole_("("+dumpPageMetrics.toString()+")()",checkMetrics);}
function checkMetrics(consoleResult)
{test.assertEquals('"'+JSON.stringify(metrics)+'"',consoleResult,"Wrong metrics for params: "+JSON.stringify(params));callback();}}
function step1()
{testOverrides({width:1200,height:1000,deviceScaleFactor:1,mobile:false,fitWindow:true},{width:1200,height:1000,deviceScaleFactor:1},step2);}
function step2()
{testOverrides({width:1200,height:1000,deviceScaleFactor:1,mobile:false,fitWindow:false},{width:1200,height:1000,deviceScaleFactor:1},step3);}
function step3()
{testOverrides({width:1200,height:1000,deviceScaleFactor:3,mobile:false,fitWindow:true},{width:1200,height:1000,deviceScaleFactor:3},step4);}
function step4()
{testOverrides({width:1200,height:1000,deviceScaleFactor:3,mobile:false,fitWindow:false},{width:1200,height:1000,deviceScaleFactor:3},finish);}
function finish()
{test.releaseControl();}
WebInspector.overridesSupport._deviceMetricsChangedListenerMuted=true;test.takeControl();this.waitForThrottler(WebInspector.overridesSupport._deviceMetricsThrottler,step1);};TestSuite.prototype.testScreenshotRecording=function()
{var test=this;function performActionsInPage(callback)
{var count=0;var div=document.createElement("div");div.setAttribute("style","left: 0px; top: 0px; width: 100px; height: 100px; position: absolute;");document.body.appendChild(div);requestAnimationFrame(frame);function frame()
{var color=[0,0,0];color[count%3]=255;div.style.backgroundColor="rgb("+color.join(",")+")";if(++count>10)
requestAnimationFrame(callback);else
requestAnimationFrame(frame);}}
var captureFilmStripSetting=WebInspector.settings.createSetting("timelineCaptureFilmStrip",false);captureFilmStripSetting.set(true);test.evaluateInConsole_(performActionsInPage.toString(),function(){});test.invokeAsyncWithTimeline_("performActionsInPage",onTimelineDone);function onTimelineDone()
{captureFilmStripSetting.set(false);var filmStripModel=new WebInspector.FilmStripModel(WebInspector.panels.timeline._tracingModel);var frames=filmStripModel.frames();test.assertTrue(frames.length>4&&typeof frames.length==="number");loadFrameImages(frames);}
function loadFrameImages(frames)
{var readyImages=[];for(var frame of frames)
frame.imageDataPromise().then(onGotImageData)
function onGotImageData(data)
{var image=new Image();test.assertTrue(!!data,"No image data for frame");image.addEventListener("load",onLoad);image.src="data:image/jpg;base64,"+data;}
function onLoad(event)
{readyImages.push(event.target);if(readyImages.length===frames.length)
validateImagesAndCompleteTest(readyImages);}}
function validateImagesAndCompleteTest(images)
{var redCount=0;var greenCount=0;var blueCount=0;var canvas=document.createElement("canvas");var ctx=canvas.getContext("2d");for(var image of images){test.assertTrue(image.naturalWidth>10);test.assertTrue(image.naturalHeight>10);canvas.width=image.naturalWidth;canvas.height=image.naturalHeight;ctx.drawImage(image,0,0);var data=ctx.getImageData(0,0,1,1);var color=Array.prototype.join.call(data.data,",");if(data.data[0]>200)
redCount++;else if(data.data[1]>200)
greenCount++;else if(data.data[2]>200)
blueCount++;else
test.fail("Unexpected color: "+color);}
test.assertTrue(redCount&&greenCount&&blueCount,"Color sanity check failed");test.releaseControl();}
test.takeControl();}
TestSuite.prototype.testSettings=function()
{var test=this;createSettings();test.takeControl();setTimeout(reset,0);function createSettings()
{var localSetting=WebInspector.settings.createSetting("local",undefined,true);localSetting.set({s:"local",n:1});var globalSetting=WebInspector.settings.createSetting("global",undefined,false);globalSetting.set({s:"global",n:2});}
function reset()
{Runtime.experiments.clearForTest();InspectorFrontendHost.getPreferences(gotPreferences);}
function gotPreferences(prefs)
{WebInspector.Main._instanceForTest._createSettings(prefs);var localSetting=WebInspector.settings.createSetting("local",undefined,true);test.assertEquals("object",typeof localSetting.get());test.assertEquals("local",localSetting.get().s);test.assertEquals(1,localSetting.get().n);var globalSetting=WebInspector.settings.createSetting("global",undefined,false);test.assertEquals("object",typeof globalSetting.get());test.assertEquals("global",globalSetting.get().s);test.assertEquals(2,globalSetting.get().n);test.releaseControl();}}
TestSuite.prototype.waitForTestResultsInConsole=function()
{var messages=WebInspector.multitargetConsoleModel.messages();for(var i=0;i<messages.length;++i){var text=messages[i].messageText;if(text==="PASS")
return;else if(/^FAIL/.test(text))
this.fail(text);}
function onConsoleMessage(event)
{var text=event.data.messageText;if(text==="PASS")
this.releaseControl();else if(/^FAIL/.test(text))
this.fail(text);}
WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded,onConsoleMessage,this);this.takeControl();};TestSuite.prototype.invokeAsyncWithTimeline_=function(functionName,callback)
{var test=this;test.showPanel("timeline").then(function(){WebInspector.panels.timeline._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStarted,onRecordingStarted);WebInspector.panels.timeline._toggleRecording();});function onRecordingStarted()
{WebInspector.panels.timeline._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStarted,onRecordingStarted);test.evaluateInConsole_(functionName+"(function() { console.log('DONE'); });",function(){});WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded,onConsoleMessage);}
function onConsoleMessage(event)
{var text=event.data.messageText;if(text==="DONE"){WebInspector.multitargetConsoleModel.removeEventListener(WebInspector.ConsoleModel.Events.MessageAdded,onConsoleMessage);pageActionsDone();}}
function pageActionsDone()
{WebInspector.panels.timeline._model.addEventListener(WebInspector.TimelineModel.Events.RecordingStopped,onRecordingStopped);WebInspector.panels.timeline._toggleRecording();}
function onRecordingStopped()
{WebInspector.panels.timeline._model.removeEventListener(WebInspector.TimelineModel.Events.RecordingStopped,onRecordingStopped);callback();}};TestSuite.prototype.uiSourceCodesToString_=function(uiSourceCodes)
{var names=[];for(var i=0;i<uiSourceCodes.length;i++)
names.push('"'+WebInspector.networkMapping.networkURL(uiSourceCodes[i])+'"');return names.join(",");};TestSuite.prototype.nonAnonymousUISourceCodes_=function()
{function filterOutAnonymous(uiSourceCode)
{return!!WebInspector.networkMapping.networkURL(uiSourceCode);}
function filterOutService(uiSourceCode)
{return!uiSourceCode.isFromServiceProject();}
var uiSourceCodes=WebInspector.workspace.uiSourceCodes();uiSourceCodes=uiSourceCodes.filter(filterOutService);return uiSourceCodes.filter(filterOutAnonymous);};TestSuite.prototype.evaluateInConsole_=function(code,callback)
{function innerEvaluate()
{WebInspector.context.removeFlavorChangeListener(WebInspector.ExecutionContext,showConsoleAndEvaluate,this);var consoleView=WebInspector.ConsolePanel._view();consoleView._prompt.setText(code);consoleView._promptElement.dispatchEvent(TestSuite.createKeyEvent("Enter"));this.addSniffer(WebInspector.ConsoleView.prototype,"_consoleMessageAddedForTest",function(viewMessage){callback(viewMessage.toMessageElement().deepTextContent());}.bind(this));}
function showConsoleAndEvaluate()
{WebInspector.console.showPromise().then(innerEvaluate.bind(this));}
if(!WebInspector.context.flavor(WebInspector.ExecutionContext)){WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext,showConsoleAndEvaluate,this);return;}
showConsoleAndEvaluate.call(this);};TestSuite.prototype._scriptsAreParsed=function(expected)
{var uiSourceCodes=this.nonAnonymousUISourceCodes_();var missing=expected.slice(0);for(var i=0;i<uiSourceCodes.length;++i){for(var j=0;j<missing.length;++j){if(uiSourceCodes[i].name().search(missing[j])!==-1){missing.splice(j,1);break;}}}
return missing.length===0;};TestSuite.prototype._waitForScriptPause=function(callback)
{this.addSniffer(WebInspector.DebuggerModel.prototype,"_pausedScript",callback);};TestSuite.prototype._waitUntilScriptsAreParsed=function(expectedScripts,callback)
{var test=this;function waitForAllScripts(){if(test._scriptsAreParsed(expectedScripts))
callback();else
test.addSniffer(WebInspector.panels.sources.sourcesView(),"_addUISourceCode",waitForAllScripts);}
waitForAllScripts();};TestSuite.prototype._waitForTargets=function(n,callback)
{checkTargets.call(this);function checkTargets()
{if(WebInspector.targetManager.targets().length>=n)
callback.call(null);else
this.addSniffer(WebInspector.TargetManager.prototype,"addTarget",checkTargets.bind(this));}}
TestSuite.createKeyEvent=function(keyIdentifier)
{var evt=document.createEvent("KeyboardEvent");evt.initKeyboardEvent("keydown",true,true,null,keyIdentifier,"");return evt;};return new TestSuite();}
if(window.uiTests){WebInspector.notifications.addEventListener(WebInspector.NotificationService.Events.InspectorAgentEnabledForTests,window.uiTests.testSuiteReady.bind(null,createTestSuite));};WebInspector.OverlayController=function()
{WebInspector.moduleSetting("disablePausedStateOverlay").addChangeListener(this._updateOverlayMessage,this);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.DebuggerPaused,this._updateOverlayMessage,this);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.DebuggerResumed,this._updateOverlayMessage,this);WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.GlobalObjectCleared,this._updateOverlayMessage,this);}
WebInspector.OverlayController.prototype={_updateOverlayMessage:function(event)
{var debuggerModel=(event.target);var message=debuggerModel.isPaused()&&!WebInspector.moduleSetting("disablePausedStateOverlay").get()?WebInspector.UIString("Paused in debugger"):undefined;debuggerModel.target().pageAgent().setOverlayMessage(message);}};WebInspector.MainConnection=function()
{InspectorBackendClass.Connection.call(this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.DispatchMessage,this._dispatchMessage,this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.DispatchMessageChunk,this._dispatchMessageChunk,this);}
WebInspector.MainConnection.prototype={sendMessage:function(messageObject)
{var message=JSON.stringify(messageObject);InspectorFrontendHost.sendMessageToBackend(message);},_dispatchMessage:function(event)
{this.dispatch((event.data));},_dispatchMessageChunk:function(event)
{var messageChunk=(event.data["messageChunk"]);var messageSize=(event.data["messageSize"]);if(messageSize){this._messageBuffer="";this._messageSize=messageSize;}
this._messageBuffer+=messageChunk;if(this._messageBuffer.length===this._messageSize){this.dispatch(this._messageBuffer);this._messageBuffer="";this._messageSize=0;}},__proto__:InspectorBackendClass.Connection.prototype}
WebInspector.WebSocketConnection=function(url,onConnectionReady)
{InspectorBackendClass.Connection.call(this);this._socket=new WebSocket(url);this._socket.onmessage=this._onMessage.bind(this);this._socket.onerror=this._onError.bind(this);this._socket.onopen=onConnectionReady.bind(null,this);this._socket.onclose=this.connectionClosed.bind(this,"websocket_closed");}
WebInspector.WebSocketConnection.Create=function(url,onConnectionReady)
{new WebInspector.WebSocketConnection(url,onConnectionReady);}
WebInspector.WebSocketConnection.prototype={_onMessage:function(message)
{var data=(message.data);this.dispatch(data);},_onError:function(error)
{console.error(error);},sendMessage:function(messageObject)
{var message=JSON.stringify(messageObject);this._socket.send(message);},__proto__:InspectorBackendClass.Connection.prototype}
WebInspector.StubConnection=function()
{InspectorBackendClass.Connection.call(this);}
WebInspector.StubConnection.prototype={sendMessage:function(messageObject)
{setTimeout(this._respondWithError.bind(this,messageObject),0);},_respondWithError:function(messageObject)
{var error={message:"This is a stub connection, can't dispatch message.",code:InspectorBackendClass.DevToolsStubErrorCode,data:messageObject};this.dispatch({id:messageObject.id,error:error});},__proto__:InspectorBackendClass.Connection.prototype};WebInspector.Main=function()
{WebInspector.console.setUIDelegate(this);WebInspector.Main._instanceForTest=this;runOnWindowLoad(this._loaded.bind(this));}
WebInspector.Main.prototype={showConsole:function()
{return WebInspector.Revealer.revealPromise(WebInspector.console);},_loaded:function()
{console.timeStamp("Main._loaded");if(InspectorFrontendHost.isUnderTest())
self.runtime.useTestBase();InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this));new WebInspector.FrontendWebSocketAPI();},_gotPreferences:function(prefs)
{console.timeStamp("Main._gotPreferences");this._createSettings(prefs);this._createAppUI();},_createSettings:function(prefs)
{var settingsParam=Runtime.queryParam("settings");if(settingsParam){try{var settings=JSON.parse(window.decodeURI(settingsParam));for(var key in settings)
prefs[key]=settings[key];}catch(e){}}
this._initializeExperiments(prefs);WebInspector.settings=new WebInspector.Settings(new WebInspector.SettingsStorage(prefs,InspectorFrontendHost.setPreference,InspectorFrontendHost.removePreference,InspectorFrontendHost.clearPreferences));if(!InspectorFrontendHost.isUnderTest())
new WebInspector.VersionController().updateVersion();},_initializeExperiments:function(prefs)
{Runtime.experiments.register("accessibilityInspection","Accessibility Inspection");Runtime.experiments.register("applyCustomStylesheet","Allow custom UI themes");Runtime.experiments.register("blackboxJSFramesOnTimeline","Blackbox JavaScript frames on Timeline",true);Runtime.experiments.register("colorContrastRatio","Contrast ratio line in color picker",true);Runtime.experiments.register("cpuThrottling","CPU throttling",true);Runtime.experiments.register("deviceMode","Device mode",true);Runtime.experiments.register("emptySourceMapAutoStepping","Empty sourcemap auto-stepping");Runtime.experiments.register("fileSystemInspection","FileSystem inspection");Runtime.experiments.register("gpuTimeline","GPU data on timeline",true);Runtime.experiments.register("inputEventsOnTimelineOverview","Input events on Timeline overview",true);Runtime.experiments.register("layersPanel","Layers panel");Runtime.experiments.register("layoutEditor","Layout editor",true);Runtime.experiments.register("materialDesign","Material design");Runtime.experiments.register("multipleTimelineViews","Multiple main views on Timeline",true);Runtime.experiments.register("networkRequestHeadersFilterInDetailsView","Network request headers filter in details view",true);Runtime.experiments.register("networkRequestsOnTimeline","Network requests on Timeline",true);Runtime.experiments.register("privateScriptInspection","Private script inspection");Runtime.experiments.register("promiseTracker","Promise inspector");Runtime.experiments.register("requestBlocking","Request blocking",true);Runtime.experiments.register("timelineShowAllEvents","Show all events on Timeline",true);Runtime.experiments.register("timelineLatencyInfo","Show input latency events on the Timeline",true);Runtime.experiments.register("securityPanel","Security panel");Runtime.experiments.register("showPrimaryLoadWaterfallInNetworkTimeline","Show primary load waterfall in Network timeline",true);Runtime.experiments.register("stepIntoAsync","Step into async");Runtime.experiments.register("timelineFlowEvents","Timeline flow events",true);Runtime.experiments.register("timelineInvalidationTracking","Timeline invalidation tracking",true);Runtime.experiments.register("timelineRecordingPerspectives","Timeline recording perspectives UI");Runtime.experiments.register("timelineTracingJSProfile","Timeline tracing based JS profiler",true);Runtime.experiments.cleanUpStaleExperiments();if(InspectorFrontendHost.isUnderTest()){var testPath=JSON.parse(prefs["testPath"]||"\"\"");if(testPath.indexOf("debugger/promise")!==-1)
Runtime.experiments.enableForTest("promiseTracker");if(testPath.indexOf("layers/")!==-1)
Runtime.experiments.enableForTest("layersPanel");if(testPath.indexOf("timeline/")!==-1||testPath.indexOf("layers/")!==-1)
Runtime.experiments.enableForTest("layersPanel");if(testPath.indexOf("security/")!==-1)
Runtime.experiments.enableForTest("securityPanel");}
Runtime.experiments.setDefaultExperiments(["deviceMode","securityPanel"]);},_createAppUI:function()
{console.timeStamp("Main._createApp");WebInspector.isolatedFileSystemManager=new WebInspector.IsolatedFileSystemManager();WebInspector.isolatedFileSystemManager.initialize(this._didInitializeFileSystemManager.bind(this));var themeSetting=WebInspector.settings.createSetting("uiTheme","default");WebInspector.initializeUIUtils(document,themeSetting);themeSetting.addChangeListener(WebInspector.reload.bind(WebInspector));WebInspector.installComponentRootStyles((document.body));this._addMainEventListeners(document);var canDock=!!Runtime.queryParam("can_dock");WebInspector.zoomManager=new WebInspector.ZoomManager(window,InspectorFrontendHost);WebInspector.inspectorView=new WebInspector.InspectorView();WebInspector.ContextMenu.initialize();WebInspector.ContextMenu.installHandler(document);WebInspector.Tooltip.installHandler(document);WebInspector.dockController=new WebInspector.DockController(canDock);WebInspector.overridesSupport=new WebInspector.OverridesSupport();WebInspector.emulatedDevicesList=new WebInspector.EmulatedDevicesList();WebInspector.multitargetConsoleModel=new WebInspector.MultitargetConsoleModel();WebInspector.multitargetNetworkManager=new WebInspector.MultitargetNetworkManager();WebInspector.shortcutsScreen=new WebInspector.ShortcutsScreen();WebInspector.shortcutsScreen.section(WebInspector.UIString("Elements Panel"));WebInspector.shortcutsScreen.section(WebInspector.UIString("Styles Pane"));WebInspector.shortcutsScreen.section(WebInspector.UIString("Debugger"));WebInspector.shortcutsScreen.section(WebInspector.UIString("Console"));WebInspector.fileManager=new WebInspector.FileManager();WebInspector.workspace=new WebInspector.Workspace();WebInspector.fileSystemMapping=new WebInspector.FileSystemMapping();var fileSystemWorkspaceBinding=new WebInspector.FileSystemWorkspaceBinding(WebInspector.isolatedFileSystemManager,WebInspector.workspace);WebInspector.networkMapping=new WebInspector.NetworkMapping(WebInspector.targetManager,WebInspector.workspace,fileSystemWorkspaceBinding,WebInspector.fileSystemMapping);WebInspector.networkProjectManager=new WebInspector.NetworkProjectManager(WebInspector.targetManager,WebInspector.workspace,WebInspector.networkMapping);WebInspector.presentationConsoleMessageHelper=new WebInspector.PresentationConsoleMessageHelper(WebInspector.workspace);WebInspector.cssWorkspaceBinding=new WebInspector.CSSWorkspaceBinding(WebInspector.targetManager,WebInspector.workspace,WebInspector.networkMapping);WebInspector.debuggerWorkspaceBinding=new WebInspector.DebuggerWorkspaceBinding(WebInspector.targetManager,WebInspector.workspace,WebInspector.networkMapping);WebInspector.breakpointManager=new WebInspector.BreakpointManager(null,WebInspector.workspace,WebInspector.networkMapping,WebInspector.targetManager,WebInspector.debuggerWorkspaceBinding);WebInspector.extensionServer=new WebInspector.ExtensionServer();new WebInspector.OverlayController();new WebInspector.ExecutionContextSelector(WebInspector.targetManager,WebInspector.context);var autoselectPanel=WebInspector.UIString("auto");var openAnchorLocationSetting=WebInspector.settings.createSetting("openLinkHandler",autoselectPanel);WebInspector.openAnchorLocationRegistry=new WebInspector.HandlerRegistry(openAnchorLocationSetting);WebInspector.openAnchorLocationRegistry.registerHandler(autoselectPanel,function(){return false;});WebInspector.Linkifier.setLinkHandler(new WebInspector.HandlerRegistry.LinkHandler());new WebInspector.Main.PauseListener();new WebInspector.Main.InspectedNodeRevealer();new WebInspector.NetworkPanelIndicator();new WebInspector.SourcesPanelIndicator();WebInspector.domBreakpointsSidebarPane=new WebInspector.DOMBreakpointsSidebarPane();WebInspector.actionRegistry=new WebInspector.ActionRegistry();WebInspector.shortcutRegistry=new WebInspector.ShortcutRegistry(WebInspector.actionRegistry,document);WebInspector.ShortcutsScreen.registerShortcuts();this._registerForwardedShortcuts();this._registerMessageSinkListener();var appExtension=self.runtime.extensions(WebInspector.AppProvider)[0];appExtension.instancePromise().then(this._showAppUI.bind(this));},_showAppUI:function(appProvider)
{var app=(appProvider).createApp();WebInspector.dockController.initialize();console.timeStamp("Main._presentUI");app.presentUI(document,this._didPresentAppUI.bind(this));var toggleSearchNodeAction=WebInspector.actionRegistry.action("elements.toggle-element-search");InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.EnterInspectElementMode,toggleSearchNodeAction.execute.bind(toggleSearchNodeAction),this);WebInspector.inspectorView.createToolbars();InspectorFrontendHost.loadCompleted();var extensions=self.runtime.extensions(WebInspector.QueryParamHandler);for(var extension of extensions){var value=Runtime.queryParam(extension.descriptor()["name"]);if(value!==null)
extension.instancePromise().then(handleQueryParam.bind(null,value));}
function handleQueryParam(value,handler)
{handler.handleQueryParam(value);}
this._appUIShown=true;if(this._fileSystemManagerInitialized){setTimeout(this._createConnection.bind(this),0);}},_didInitializeFileSystemManager:function()
{this._fileSystemManagerInitialized=true;if(this._appUIShown)
this._createConnection();},_createConnection:function()
{console.timeStamp("Main._createConnection");if(Runtime.queryParam("ws")){var ws="ws://"+Runtime.queryParam("ws");WebInspector.WebSocketConnection.Create(ws,this._connectionEstablished.bind(this));return;}
if(!InspectorFrontendHost.isHostedMode()){this._connectionEstablished(new WebInspector.MainConnection());return;}
this._connectionEstablished(new WebInspector.StubConnection());},_connectionEstablished:function(connection)
{console.timeStamp("Main._connectionEstablished");this._mainConnection=connection;connection.addEventListener(InspectorBackendClass.Connection.Events.Disconnected,onDisconnected);function onDisconnected(event)
{if(WebInspector._disconnectedScreenWithReasonWasShown)
return;WebInspector.RemoteDebuggingTerminatedScreen.show(event.data.reason);}
var targetType=Runtime.queryParam("isSharedWorker")?WebInspector.Target.Type.ServiceWorker:WebInspector.Target.Type.Page;this._mainTarget=WebInspector.targetManager.createTarget(WebInspector.UIString("Main"),targetType,connection,null);console.timeStamp("Main._mainTargetCreated");this._registerShortcuts();var main=this;this._mainTarget.registerInspectorDispatcher(this);InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.ReloadInspectedPage,this._reloadInspectedPage,this);if(this._mainTarget.isServiceWorker())
this._mainTarget.runtimeAgent().run();if(this._appUIPresented)
this._initOverrides();},_didPresentAppUI:function()
{this._appUIPresented=true;if(this._mainTarget)
this._initOverrides();},_initOverrides:function()
{WebInspector.overridesSupport.init(this._mainTarget,this._overridesReady.bind(this));},_overridesReady:function()
{if(!WebInspector.dockController.canDock()&&WebInspector.overridesSupport.emulationEnabled())
WebInspector.inspectorView.showViewInDrawer("emulation",true);this._mainTarget.inspectorAgent().enable(inspectorAgentEnableCallback);function inspectorAgentEnableCallback()
{console.timeStamp("Main.inspectorAgentEnableCallback");WebInspector.notifications.dispatchEventToListeners(WebInspector.NotificationService.Events.InspectorAgentEnabledForTests);setTimeout(lateInitialization,0);}
function lateInitialization()
{WebInspector.extensionServer.initializeExtensions();}},_registerForwardedShortcuts:function()
{var forwardedActions=["main.toggle-dock","debugger.toggle-breakpoints-active","debugger.toggle-pause"];var actionKeys=WebInspector.shortcutRegistry.keysForActions(forwardedActions).map(WebInspector.KeyboardShortcut.keyCodeAndModifiersFromKey);InspectorFrontendHost.setWhitelistedShortcuts(JSON.stringify(actionKeys));},_registerMessageSinkListener:function()
{WebInspector.console.addEventListener(WebInspector.Console.Events.MessageAdded,messageAdded);function messageAdded(event)
{var message=(event.data);if(message.show)
WebInspector.console.show();}},_documentClick:function(event)
{var target=event.target;if(target.shadowRoot)
target=event.deepElementFromPoint();if(!target)
return;var anchor=target.enclosingNodeOrSelfWithNodeName("a");if(!anchor||!anchor.href)
return;event.consume(true);if(anchor.preventFollow)
return;function followLink()
{if(WebInspector.isBeingEdited(target))
return;if(WebInspector.openAnchorLocationRegistry.dispatch({url:anchor.href,lineNumber:anchor.lineNumber}))
return;var uiSourceCode=WebInspector.networkMapping.uiSourceCodeForURLForAnyTarget(anchor.href);if(uiSourceCode){WebInspector.Revealer.reveal(uiSourceCode.uiLocation(anchor.lineNumber||0,anchor.columnNumber||0));return;}
var resource=WebInspector.resourceForURL(anchor.href);if(resource){WebInspector.Revealer.reveal(resource);return;}
var request=WebInspector.NetworkLog.requestForURL(anchor.href);if(request){WebInspector.Revealer.reveal(request);return;}
InspectorFrontendHost.openInNewTab(anchor.href);}
if(WebInspector.followLinkTimeout)
clearTimeout(WebInspector.followLinkTimeout);if(anchor.preventFollowOnDoubleClick){if(event.detail===1)
WebInspector.followLinkTimeout=setTimeout(followLink,333);return;}
if(!anchor.classList.contains("webkit-html-external-link"))
followLink();else
InspectorFrontendHost.openInNewTab(anchor.href);},_registerShortcuts:function()
{var shortcut=WebInspector.KeyboardShortcut;var section=WebInspector.shortcutsScreen.section(WebInspector.UIString("All Panels"));var keys=[shortcut.makeDescriptor("[",shortcut.Modifiers.CtrlOrMeta),shortcut.makeDescriptor("]",shortcut.Modifiers.CtrlOrMeta)];section.addRelatedKeys(keys,WebInspector.UIString("Go to the panel to the left/right"));keys=[shortcut.makeDescriptor("[",shortcut.Modifiers.CtrlOrMeta|shortcut.Modifiers.Alt),shortcut.makeDescriptor("]",shortcut.Modifiers.CtrlOrMeta|shortcut.Modifiers.Alt)];section.addRelatedKeys(keys,WebInspector.UIString("Go back/forward in panel history"));var toggleConsoleLabel=WebInspector.UIString("Show console");section.addKey(shortcut.makeDescriptor(shortcut.Keys.Tilde,shortcut.Modifiers.Ctrl),toggleConsoleLabel);section.addKey(shortcut.makeDescriptor(shortcut.Keys.Esc),WebInspector.UIString("Toggle drawer"));if(WebInspector.dockController.canDock()){section.addKey(shortcut.makeDescriptor("M",shortcut.Modifiers.CtrlOrMeta|shortcut.Modifiers.Shift),WebInspector.UIString("Toggle device mode"));section.addKey(shortcut.makeDescriptor("D",shortcut.Modifiers.CtrlOrMeta|shortcut.Modifiers.Shift),WebInspector.UIString("Toggle dock side"));}
section.addKey(shortcut.makeDescriptor("f",shortcut.Modifiers.CtrlOrMeta),WebInspector.UIString("Search"));var advancedSearchShortcutModifier=WebInspector.isMac()?WebInspector.KeyboardShortcut.Modifiers.Meta|WebInspector.KeyboardShortcut.Modifiers.Alt:WebInspector.KeyboardShortcut.Modifiers.Ctrl|WebInspector.KeyboardShortcut.Modifiers.Shift;var advancedSearchShortcut=shortcut.makeDescriptor("f",advancedSearchShortcutModifier);section.addKey(advancedSearchShortcut,WebInspector.UIString("Search across all sources"));var inspectElementModeShortcuts=WebInspector.shortcutRegistry.shortcutDescriptorsForAction("elements.toggle-element-search");section.addKey(inspectElementModeShortcuts[0],WebInspector.UIString("Select node to inspect"));var openResourceShortcut=WebInspector.KeyboardShortcut.makeDescriptor("p",WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta);section.addKey(openResourceShortcut,WebInspector.UIString("Go to source"));if(WebInspector.isMac()){keys=[shortcut.makeDescriptor("g",shortcut.Modifiers.Meta),shortcut.makeDescriptor("g",shortcut.Modifiers.Meta|shortcut.Modifiers.Shift)];section.addRelatedKeys(keys,WebInspector.UIString("Find next/previous"));}},_postDocumentKeyDown:function(event)
{if(event.handled)
return;var target=event.deepActiveElement();if(target){var anchor=target.enclosingNodeOrSelfWithNodeName("a");if(anchor&&anchor.preventFollow)
event.preventDefault();}
if(!WebInspector.Dialog.hasInstance()&&WebInspector.inspectorView.currentPanel()){WebInspector.inspectorView.currentPanel().handleShortcut(event);if(event.handled){event.consume(true);return;}}
WebInspector.shortcutRegistry.handleShortcut(event);},_documentCanCopy:function(event)
{var panel=WebInspector.inspectorView.currentPanel();if(panel&&panel["handleCopyEvent"])
event.preventDefault();},_documentCopy:function(event)
{var panel=WebInspector.inspectorView.currentPanel();if(panel&&panel["handleCopyEvent"])
panel["handleCopyEvent"](event);},_documentCut:function(event)
{var panel=WebInspector.inspectorView.currentPanel();if(panel&&panel["handleCutEvent"])
panel["handleCutEvent"](event);},_documentPaste:function(event)
{var panel=WebInspector.inspectorView.currentPanel();if(panel&&panel["handlePasteEvent"])
panel["handlePasteEvent"](event);},_contextMenuEventFired:function(event)
{if(event.handled||event.target.classList.contains("popup-glasspane"))
event.preventDefault();},_addMainEventListeners:function(document)
{document.addEventListener("keydown",this._postDocumentKeyDown.bind(this),false);document.addEventListener("beforecopy",this._documentCanCopy.bind(this),true);document.addEventListener("copy",this._documentCopy.bind(this),false);document.addEventListener("cut",this._documentCut.bind(this),false);document.addEventListener("paste",this._documentPaste.bind(this),false);document.addEventListener("contextmenu",this._contextMenuEventFired.bind(this),true);document.addEventListener("click",this._documentClick.bind(this),false);},_reloadInspectedPage:function(event)
{var hard=(event.data);WebInspector.Main._reloadPage(hard);},inspect:function(payload,hints)
{var object=this._mainTarget.runtimeModel.createRemoteObject(payload);if(object.isNode()){WebInspector.Revealer.revealPromise(object).then(object.release.bind(object));return;}
if(object.type==="function"){WebInspector.RemoteFunction.objectAsFunction(object).targetFunctionDetails().then(didGetDetails);return;}
function didGetDetails(response)
{object.release();if(!response||!response.location)
return;WebInspector.Revealer.reveal(WebInspector.debuggerWorkspaceBinding.rawLocationToUILocation(response.location));}
if(hints.copyToClipboard)
InspectorFrontendHost.copyText(object.value);object.release();},detached:function(reason)
{WebInspector._disconnectedScreenWithReasonWasShown=true;WebInspector.RemoteDebuggingTerminatedScreen.show(reason);},targetCrashed:function()
{var debuggerModel=WebInspector.DebuggerModel.fromTarget(this._mainTarget);if(debuggerModel)
WebInspector.TargetCrashedScreen.show(debuggerModel);},evaluateForTestInFrontend:function(callId,script)
{if(!InspectorFrontendHost.isUnderTest())
return;function invokeMethod()
{try{script=script+"//# sourceURL=evaluateInWebInspector"+callId+".js";window.eval(script);}catch(e){console.error(e.stack);}}
this._mainConnection.runAfterPendingDispatches(invokeMethod);}}
WebInspector.Main.ReloadActionDelegate=function()
{}
WebInspector.Main.ReloadActionDelegate.prototype={handleAction:function(context,actionId)
{switch(actionId){case"main.reload":WebInspector.Main._reloadPage(false);return true;case"main.hard-reload":WebInspector.Main._reloadPage(true);return true;case"main.debug-reload":WebInspector.reload();return true;}
return false;}}
WebInspector.Main.ZoomActionDelegate=function()
{}
WebInspector.Main.ZoomActionDelegate.prototype={handleAction:function(context,actionId)
{if(InspectorFrontendHost.isHostedMode())
return false;switch(actionId){case"main.zoom-in":InspectorFrontendHost.zoomIn();return true;case"main.zoom-out":InspectorFrontendHost.zoomOut();return true;case"main.zoom-reset":InspectorFrontendHost.resetZoom();return true;}
return false;}}
WebInspector.Main.SearchActionDelegate=function()
{}
WebInspector.Main.SearchActionDelegate.prototype={handleAction:function(context,actionId)
{var searchableView=WebInspector.SearchableView.fromElement(WebInspector.currentFocusElement())||WebInspector.inspectorView.currentPanel().searchableView();if(!searchableView)
return false;switch(actionId){case"main.search-in-panel.find":return searchableView.handleFindShortcut();case"main.search-in-panel.cancel":return searchableView.handleCancelSearchShortcut();case"main.search-in-panel.find-next":return searchableView.handleFindNextShortcut();case"main.search-in-panel.find-previous":return searchableView.handleFindPreviousShortcut();}
return false;}}
WebInspector.Main._reloadPage=function(hard)
{if(!WebInspector.targetManager.hasTargets())
return;if(WebInspector.targetManager.mainTarget().isServiceWorker())
return;WebInspector.targetManager.reloadPage(hard);}
WebInspector.Main._addWebSocketTarget=function(ws)
{function callback(connection)
{WebInspector.targetManager.createTarget(ws,WebInspector.Target.Type.Page,connection,null);}
new WebInspector.WebSocketConnection(ws,callback);}
WebInspector.Main.WarningErrorCounter=function()
{WebInspector.Main.WarningErrorCounter._instanceForTest=this;this._counter=createElement("div");this._counter.addEventListener("click",WebInspector.console.show.bind(WebInspector.console),false);this._toolbarItem=new WebInspector.ToolbarItem(this._counter);var shadowRoot=WebInspector.createShadowRootWithCoreStyles(this._counter,"main/errorWarningCounter.css");this._errors=this._createItem(shadowRoot,"error-icon");this._revokedErrors=this._createItem(shadowRoot,"revokedError-icon");this._warnings=this._createItem(shadowRoot,"warning-icon");this._titles=[];WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared,this._update,this);WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded,this._update,this);WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageUpdated,this._update,this);this._update();}
WebInspector.Main.WarningErrorCounter.prototype={_createItem:function(shadowRoot,iconType)
{var item=createElementWithClass("span","counter-item");var icon=item.createChild("label","","dt-icon-label");icon.type=iconType;var text=icon.createChild("span");shadowRoot.appendChild(item);return{item:item,text:text};},_updateItem:function(item,count,first,title)
{item.item.classList.toggle("hidden",!count);item.item.classList.toggle("counter-item-first",first);item.text.textContent=count;if(count)
this._titles.push(title);},_update:function()
{var errors=0;var revokedErrors=0;var warnings=0;var targets=WebInspector.targetManager.targets();for(var i=0;i<targets.length;++i){errors+=targets[i].consoleModel.errors();revokedErrors+=targets[i].consoleModel.revokedErrors();warnings+=targets[i].consoleModel.warnings();}
this._titles=[];this._toolbarItem.setVisible(!!(errors||revokedErrors||warnings));this._updateItem(this._errors,errors,false,WebInspector.UIString(errors===1?"%d error":"%d errors",errors));this._updateItem(this._revokedErrors,revokedErrors,!errors,WebInspector.UIString(revokedErrors===1?"%d handled promise rejection":"%d handled promise rejections",revokedErrors));this._updateItem(this._warnings,warnings,!errors&&!revokedErrors,WebInspector.UIString(warnings===1?"%d warning":"%d warnings",warnings));this._counter.title=this._titles.join(", ");WebInspector.inspectorView.toolbarItemResized();},item:function()
{return this._toolbarItem;}}
WebInspector.Main.MainMenuItem=function()
{this._item=new WebInspector.ToolbarButton(WebInspector.UIString("Customize and control DevTools"),"menu-toolbar-item");this._item.addEventListener("mousedown",this._mouseDown,this);}
WebInspector.Main.MainMenuItem.prototype={item:function()
{return this._item;},_mouseDown:function(event)
{var contextMenu=new WebInspector.ContextMenu((event.data),true,this._item.element.totalOffsetLeft(),this._item.element.totalOffsetTop()+this._item.element.offsetHeight);if(WebInspector.dockController.canDock()){var dockItemElement=createElementWithClass("div","flex-centered flex-auto");var titleElement=dockItemElement.createChild("span","flex-auto");titleElement.textContent=WebInspector.UIString("Dock side");var toggleDockSideShorcuts=WebInspector.shortcutRegistry.shortcutDescriptorsForAction("main.toggle-dock");titleElement.title=WebInspector.UIString("Placement of DevTools relative to the page. (%s to restore last position)",toggleDockSideShorcuts[0].name);dockItemElement.appendChild(titleElement);var dockItemToolbar=new WebInspector.Toolbar("",dockItemElement);dockItemToolbar.makeBlueOnHover();var undock=new WebInspector.ToolbarToggle(WebInspector.UIString("Undock into separate window"),"dock-toolbar-item-undock");var bottom=new WebInspector.ToolbarToggle(WebInspector.UIString("Dock to bottom"),"dock-toolbar-item-bottom");var right=new WebInspector.ToolbarToggle(WebInspector.UIString("Dock to right"),"dock-toolbar-item-right");undock.addEventListener("mouseup",setDockSide.bind(null,WebInspector.DockController.State.Undocked));bottom.addEventListener("mouseup",setDockSide.bind(null,WebInspector.DockController.State.DockedToBottom));right.addEventListener("mouseup",setDockSide.bind(null,WebInspector.DockController.State.DockedToRight));undock.setToggled(WebInspector.dockController.dockSide()===WebInspector.DockController.State.Undocked);bottom.setToggled(WebInspector.dockController.dockSide()===WebInspector.DockController.State.DockedToBottom);right.setToggled(WebInspector.dockController.dockSide()===WebInspector.DockController.State.DockedToRight);dockItemToolbar.appendToolbarItem(undock);dockItemToolbar.appendToolbarItem(bottom);dockItemToolbar.appendToolbarItem(right);contextMenu.appendCustomItem(dockItemElement);contextMenu.appendSeparator();}
function setDockSide(side)
{WebInspector.dockController.setDockSide(side);contextMenu.discard();}
contextMenu.appendAction("main.toggle-drawer",WebInspector.inspectorView.drawerVisible()?WebInspector.UIString("Hide console"):WebInspector.UIString("Show console"));contextMenu.appendItemsAtLocation("mainMenu");contextMenu.show();}}
WebInspector.NetworkPanelIndicator=function()
{var manager=WebInspector.multitargetNetworkManager;manager.addEventListener(WebInspector.MultitargetNetworkManager.Events.ConditionsChanged,updateVisibility);var blockedURLsSetting=WebInspector.moduleSetting("blockedURLs");blockedURLsSetting.addChangeListener(updateVisibility);updateVisibility();function updateVisibility()
{if(manager.isThrottling()){WebInspector.inspectorView.setPanelIcon("network","warning-icon",WebInspector.UIString("Network throttling is enabled"));}else if(blockedURLsSetting.get().length){WebInspector.inspectorView.setPanelIcon("network","warning-icon",WebInspector.UIString("Requests may be blocked"));}else{WebInspector.inspectorView.setPanelIcon("network","","");}}}
WebInspector.SourcesPanelIndicator=function()
{WebInspector.moduleSetting("javaScriptDisabled").addChangeListener(javaScriptDisabledChanged);javaScriptDisabledChanged();function javaScriptDisabledChanged()
{var javaScriptDisabled=WebInspector.moduleSetting("javaScriptDisabled").get();if(javaScriptDisabled){WebInspector.inspectorView.setPanelIcon("sources","warning-icon",WebInspector.UIString("JavaScript is disabled"));}else{WebInspector.inspectorView.setPanelIcon("sources","","");}}}
WebInspector.Main.PauseListener=function()
{WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.DebuggerPaused,this._debuggerPaused,this);}
WebInspector.Main.PauseListener.prototype={_debuggerPaused:function(event)
{WebInspector.targetManager.removeModelListener(WebInspector.DebuggerModel,WebInspector.DebuggerModel.Events.DebuggerPaused,this._debuggerPaused,this);var debuggerPausedDetails=(event.data);var debuggerModel=(event.target);WebInspector.context.setFlavor(WebInspector.Target,debuggerModel.target());WebInspector.Revealer.reveal(debuggerPausedDetails);}}
WebInspector.Main.InspectedNodeRevealer=function()
{WebInspector.targetManager.addModelListener(WebInspector.DOMModel,WebInspector.DOMModel.Events.NodeInspected,this._inspectNode,this);}
WebInspector.Main.InspectedNodeRevealer.prototype={_inspectNode:function(event)
{var deferredNode=(event.data);WebInspector.Revealer.reveal(deferredNode);}}
WebInspector.RemoteDebuggingTerminatedScreen=function(reason)
{WebInspector.VBox.call(this,true);this.registerRequiredCSS("main/remoteDebuggingTerminatedScreen.css");var message=this.contentElement.createChild("div","message");message.createChild("span").textContent=WebInspector.UIString("Debugging connection was closed. Reason: ");message.createChild("span","reason").textContent=reason;this.contentElement.createChild("div","message").textContent=WebInspector.UIString("Reconnect when ready by reopening DevTools.");}
WebInspector.RemoteDebuggingTerminatedScreen.show=function(reason)
{var dialog=new WebInspector.Dialog();dialog.setWrapsContent(true);dialog.addCloseButton();dialog.setDimmed(true);new WebInspector.RemoteDebuggingTerminatedScreen(reason).show(dialog.element);dialog.show();}
WebInspector.RemoteDebuggingTerminatedScreen.prototype={__proto__:WebInspector.VBox.prototype}
WebInspector.TargetCrashedScreen=function(hideCallback)
{WebInspector.VBox.call(this,true);this.registerRequiredCSS("main/targetCrashedScreen.css");this.contentElement.createChild("div","message").textContent=WebInspector.UIString("DevTools was disconnected from the page.");this.contentElement.createChild("div","message").textContent=WebInspector.UIString("Once page is reloaded, DevTools will automatically reconnect.");this._hideCallback=hideCallback;}
WebInspector.TargetCrashedScreen.show=function(debuggerModel)
{var dialog=new WebInspector.Dialog();dialog.setWrapsContent(true);dialog.addCloseButton();dialog.setDimmed(true);var hideBound=dialog.detach.bind(dialog,false);debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,hideBound);new WebInspector.TargetCrashedScreen(onHide).show(dialog.element);dialog.show();function onHide()
{debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared,hideBound);}}
WebInspector.TargetCrashedScreen.prototype={willHide:function()
{this._hideCallback.call(null);},__proto__:WebInspector.VBox.prototype}
new WebInspector.Main();;applicationDescriptor=[{"name":"ui_lazy"},{"name":"promises"},{"name":"accessibility"},{"name":"sources"},{"name":"devices"},{"name":"diff"},{"name":"audits"},{"type":"autostart","name":"bindings"},{"name":"snippets"},{"name":"layers"},{"name":"console"},{"name":"network"},{"type":"remote","name":"cm_modes"},{"type":"autostart","name":"platform"},{"name":"animation"},{"name":"source_frame"},{"type":"autostart","name":"main"},{"name":"resources"},{"type":"worker","name":"script_formatter_worker"},{"name":"elements"},{"type":"autostart","name":"workspace"},{"name":"timeline"},{"type":"worker","name":"heap_snapshot_worker"},{"type":"autostart","name":"host"},{"type":"autostart","name":"emulation"},{"type":"autostart","name":"ui"},{"type":"autostart","name":"sdk"},{"type":"worker","name":"temp_storage_shared_worker"},{"name":"sass"},{"name":"settings"},{"name":"components_lazy"},{"name":"profiler"},{"type":"remote","name":"screencast","condition":"remoteFrontend"},{"type":"autostart","name":"extensions"},{"type":"autostart","name":"common"},{"type":"autostart","name":"components"},{"name":"security"},{"type":"remote","name":"emulated_devices"}];Runtime.cachedResources["ui/checkboxTextLabel.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n padding: 0;\n margin: 0;\n display: inline-flex;\n flex-shrink: 0;\n align-items: center !important;\n}\n\ninput {\n height: 12px;\n width: 12px;\n flex-shrink: 0;\n}\n\ninput.dt-checkbox-themed {\n -webkit-appearance: none;\n margin: 0 5px auto 2px;\n border: 1px solid rgb(45, 45, 45);\n border-radius: 3px;\n background-color: rgb(102, 102, 102);\n position: relative;\n top: 1px;\n}\n\ninput.dt-checkbox-themed:after {\n content: '';\n line-height: 10px;\n position: absolute;\n cursor: pointer;\n width: 12px;\n height: 12px;\n background: none;\n}\n\ninput.dt-checkbox-themed:checked:after {\n background-color: #333;\n}\n\ninput.dt-checkbox-themed:after {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);\n -webkit-mask-size: 352px 168px;\n -webkit-mask-position: -128px -110px;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\ninput.dt-checkbox-themed:after {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n\n} /* media */\n\n/*# sourceURL=ui/checkboxTextLabel.css */";Runtime.cachedResources["ui/closeButton.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\ndiv {\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 168px;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\ndiv {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.close-button {\n width: 14px;\n height: 14px;\n background-position: -128px -96px;\n cursor: default;\n}\n\n.close-button:hover {\n background-position: -96px -96px;\n}\n\n.close-button:active {\n background-position: -111px -96px;\n}\n\n.close-button-gray {\n width: 13px;\n height: 13px;\n background-position: -175px -96px;\n}\n\n.close-button-gray:hover {\n background-position: -143px -96px;\n}\n\n.close-button-gray:active {\n background-position: -160px -96px;\n}\n\n/*# sourceURL=ui/closeButton.css */";Runtime.cachedResources["ui/colorSwatch.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n white-space: nowrap;\n}\n\n.color-swatch {\n position: relative;\n margin-left: 1px;\n margin-right: 2px;\n width: 10px;\n height: 10px;\n top: 1px;\n display: inline-block;\n -webkit-user-select: none;\n background-image: url(Images/checker.png);\n line-height: 10px;\n}\n\n.color-swatch-inner {\n width: 100%;\n height: 100%;\n display: inline-block;\n border: 1px solid rgba(128, 128, 128, 0.6);\n}\n\n.color-swatch-inner:hover {\n border: 1px solid rgba(64, 64, 64, 0.8);\n}\n\n\n/*# sourceURL=ui/colorSwatch.css */";Runtime.cachedResources["ui/dialog.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n position: absolute;\n border: 1px solid rgb(204, 204, 204);\n box-shadow: rgb(140, 140, 140) 0 3px 14px;\n background: white;\n justify-content: flex-start;\n align-items: stretch;\n}\n\n.widget {\n display: flex;\n flex: auto;\n justify-content: flex-start;\n align-items: stretch;\n}\n\n:host-context(.wraps-content) {\n justify-content: center;\n align-items: flex-start;\n overflow: hidden;\n}\n\n:host-context(.wraps-content) .widget {\n flex: none !important;\n justify-content: center;\n align-items: center;\n}\n\n.dialog-close-button {\n position: absolute;\n right: 9px;\n top: 9px;\n}\n/*# sourceURL=ui/dialog.css */";Runtime.cachedResources["ui/dropTarget.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: flex;\n background-color: rgba(255,255,255,0.8);\n z-index: 1000;\n}\n\n.drop-target-message {\n flex: auto;\n font-size: 30px;\n color: #999;\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 20px;\n border: 4px dashed #ddd;\n pointer-events: none;\n}\n\n/*# sourceURL=ui/dropTarget.css */";Runtime.cachedResources["ui/emptyWidget.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.empty-view {\n font-size: 24px;\n color: rgb(75%, 75%, 75%);\n font-weight: bold;\n padding: 10px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/*# sourceURL=ui/emptyWidget.css */";Runtime.cachedResources["ui/filter.css"]="/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n.filter-bar {\n background-color: #f3f3f3;\n padding: 4px 0 4px 0;\n flex: none;\n flex-wrap: wrap;\n align-items: center;\n border-bottom: 1px solid #dadada;\n}\n\n.filter-text-filter {\n display: inline-flex;\n margin-left: 1px;\n margin-right: 2px;\n min-width: 40px;\n max-width: 200px;\n height: 24px;\n align-items: center;\n}\n\n.filter-text-filter label {\n margin: auto 0;\n}\n\n.filter-bitset-filter {\n padding: 2px;\n display: inline-flex;\n overflow: hidden;\n height: 24px;\n position: relative;\n}\n\n.filter-bitset-filter li {\n display: inline-block;\n flex: none;\n margin: auto 2px;\n padding: 3px 6px 3px 3px;\n background: transparent;\n text-shadow: rgba(255, 255, 255, 0.5) 0 1px 0;\n border-radius: 8px;\n overflow: hidden;\n}\n\n.filter-bitset-filter-divider {\n background-color: #ccc;\n height: 16px;\n width: 1px;\n margin: auto 2px;\n display: inline-block;\n}\n\n.filter-bitset-filter li.selected,\n.filter-bitset-filter li:hover,\n.filter-bitset-filter li:active {\n color: white;\n text-shadow: rgba(0, 0, 0, 0.4) 0 1px 0;\n}\n\n.filter-bitset-filter li:hover {\n background: rgba(0, 0, 0, 0.2);\n}\n\n.filter-bitset-filter li.selected {\n background: rgba(0, 0, 0, 0.3);\n}\n\n.filter-bitset-filter li:active {\n background: rgba(0, 0, 0, 0.5);\n}\n\n.filter-combobox-filter {\n margin-left: 5px;\n margin-right: 2px;\n flex: 0 0 auto;\n display: inline-block;\n}\n\n.filter-checkbox-filter {\n padding-left: 4px;\n padding-right: 2px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n display: inline-flex;\n vertical-align: middle;\n height: 24px;\n position: relative;\n}\n\n.filter-checkbox-filter > label {\n display: flex;\n margin: auto 0;\n}\n\n.filter-text-invalid {\n background-color: rgb(255, 200, 200);\n}\n\n.filter-checkbox-filter .checkbox-filter-checkbox {\n width: 10px;\n height: 10px;\n margin: auto 3px;\n padding: 0;\n border-radius: 2px;\n border: solid 1px;\n display: inline-block;\n overflow: visible;\n opacity: 0.8;\n flex-shrink: 0;\n}\n\n.filter-input-field {\n -webkit-appearance: none;\n border: 1px solid rgb(163, 163, 163);\n border-radius: 2px;\n padding: 1px 3px 0;\n margin: 0 0 0 1px;\n width: 253px;\n height: 20px;\n line-height: 17px;\n flex: 1;\n}\n\n/*# sourceURL=ui/filter.css */";Runtime.cachedResources["ui/infobar.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.infobar {\n color: rgb(34, 34, 34);\n display: flex;\n flex: auto;\n border-bottom: 1px solid rgb(171, 171, 171);\n flex-direction: column;\n align-items: stretch;\n}\n\n.infobar-warning {\n background-color: rgb(253, 242, 192);\n}\n\n.infobar-info {\n background-color: rgb(255, 255, 255);\n}\n\n.infobar-main-row {\n display: flex;\n flex-direction: row;\n flex: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n justify-content: space-between;\n margin-right: 20px;\n min-height: 25px;\n align-items: center;\n padding-left: 4px;\n}\n\n.infobar-main-row > * {\n flex: none;\n padding: 0 3px;\n}\n\n.infobar-main-title {\n flex: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.infobar-details-rows {\n padding-top: 5px;\n}\n\n.infobar-details-row {\n display: flex;\n flex-direction: column;\n line-height: 18px;\n padding: 5px 6px 6px 6px;\n}\n\n.close-button {\n position: absolute;\n top: 5px;\n right: 6px;\n}\n\n.infobar-toggle {\n color: hsl(214, 92%, 50%);\n cursor: pointer;\n}\n\n.infobar-toggle:hover {\n color: hsl(214, 92%, 30%);\n}\n\n.info-icon {\n -webkit-mask-image: url(Images/ic_info_black_18dp.svg);\n background-color: hsl(214, 92%, 50%);\n}\n\n.warning-icon {\n -webkit-mask-image: url(Images/ic_warning_black_18dp.svg);\n background-color: hsl(44, 92%, 50%);\n}\n\n.icon {\n -webkit-mask-size: 18px 18px;\n width: 18px;\n height: 18px;\n}\n\n/*# sourceURL=ui/infobar.css */";Runtime.cachedResources["ui/inspectorCommon.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n* {\n /* This is required for correct sizing of flex items because we rely\n * on an old version of the flexbox spec.\n * Longer-term we should remove this, see crbug.com/473625 */\n min-width: 0;\n min-height: 0;\n}\n\n:host-context(.platform-mac) .monospace,\n:host-context(.platform-mac) .source-code,\n.platform-mac .monospace,\n.platform-mac .source-code {\n font-size: 11px !important;\n font-family: Menlo, monospace;\n}\n\n:host-context(.platform-windows) .monospace,\n:host-context(.platform-windows) .source-code,\n.platform-windows .monospace,\n.platform-windows .source-code {\n font-size: 12px !important;\n font-family: Consolas, Lucida Console, monospace;\n}\n\n:host-context(.platform-linux) .monospace,\n:host-context(.platform-linux) .source-code,\n.platform-linux .monospace,\n.platform-linux .source-code {\n font-size: 11px !important;\n font-family: dejavu sans mono, monospace;\n}\n\n.source-code {\n font-family: monospace;\n font-size: 11px !important;\n white-space: pre-wrap;\n}\n\n* {\n box-sizing: border-box;\n}\n\n:focus {\n outline: none;\n}\n\nimg {\n -webkit-user-drag: none;\n}\n\niframe,\na img {\n border: none;\n}\n\n.fill {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\niframe.fill {\n width: 100%;\n height: 100%;\n}\n\n.widget {\n position: relative;\n flex: auto;\n}\n\n.hbox {\n display: flex;\n flex-direction: row !important;\n position: relative;\n}\n\n.vbox {\n display: flex;\n flex-direction: column !important;\n position: relative;\n}\n\n.flex-auto {\n flex: auto;\n}\n\n.flex-auto-important {\n flex: auto !important;\n}\n\n.flex-none {\n flex: none;\n}\n\n.flex-centered {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\niframe.widget {\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n}\n\n.hidden {\n display: none !important;\n}\n\n.monospace {\n font-size: 10px !important;\n font-family: monospace;\n}\n\n.highlighted-search-result {\n border-radius: 1px;\n padding: 1px;\n margin: -1px;\n background-color: rgba(255, 255, 0, 0.8);\n}\n\n.-theme-with-dark-background .highlighted-search-result,\n:host-context(.-theme-with-dark-background) .highlighted-search-result {\n background-color: hsl(133, 100%, 30%);\n color: #333;\n}\n\n.link {\n cursor: pointer;\n text-decoration: underline;\n color: rgb(17, 85, 204);\n}\n\nbutton,\ninput,\nselect {\n font-family: inherit;\n font-size: inherit;\n color: inherit;\n}\n\ninput {\n background-color: white;\n}\n\n:host-context(.-theme-with-dark-background) input[type=\"checkbox\"] {\n -webkit-filter: invert(80%);\n}\n\ninput[type=\"search\"]:focus,\ninput[type=\"text\"]:focus {\n outline: auto 5px -webkit-focus-ring-color;\n}\n\n\n.highlighted-search-result.current-search-result {\n border-radius: 1px;\n padding: 1px;\n margin: -1px;\n background-color: rgba(255, 127, 0, 0.8);\n}\n\n.dimmed {\n opacity: 0.6;\n}\n\n.editing {\n -webkit-user-select: text;\n box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;\n outline: 1px solid rgb(66%, 66%, 66%) !important;\n background-color: white;\n -webkit-user-modify: read-write-plaintext-only;\n text-overflow: clip !important;\n padding-left: 2px;\n margin-left: -2px;\n padding-right: 2px;\n margin-right: -2px;\n margin-bottom: -1px;\n padding-bottom: 1px;\n opacity: 1.0 !important;\n}\n\n.editing,\n.editing * {\n color: #222 !important;\n text-decoration: none !important;\n}\n\n.chrome-select {\n -webkit-appearance: none;\n -webkit-user-select: none;\n border: 1px solid rgb(160, 160, 160);\n border-radius: 2px;\n box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08),\n inset 0 1px 2px rgba(255, 255, 255, 0.75);\n color: #444;\n font: inherit;\n margin: 0 1px 0 0;\n outline: none;\n text-shadow: 0 1px 0 rgb(240, 240, 240);\n padding-right: 20px;\n padding-left: 6px;\n background-image: -webkit-image-set(url(Images/chromeSelect.png) 1x, url(Images/chromeSelect_2x.png) 2x), linear-gradient(#ededed, #ededed 38%, #dedede);\n background-position: right center;\n background-repeat: no-repeat;\n min-height: 24px;\n}\n\n.chrome-select:enabled:hover {\n background-image: -webkit-image-set(url(Images/chromeSelect.png) 1x, url(Images/chromeSelect_2x.png) 2x), linear-gradient(#f0f0f0, #f0f0f0 38%, #e0e0e0);\n border-color: rgba(0, 0, 0, 0.3);\n box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12),\n inset 0 1px 2px rgba(255, 255, 255, 0.95);\n color: black;\n}\n\n.chrome-select:enabled:active {\n background-image: -webkit-image-set(url(Images/chromeSelect.png) 1x, url(Images/chromeSelect_2x.png) 2x), linear-gradient(#e7e7e7, #e7e7e7 38%, #d7d7d7);\n box-shadow: none;\n text-shadow: none;\n}\n\n.chrome-select:enabled:focus {\n /* OVERRIDE */\n -webkit-transition: border-color 200ms;\n /* We use border color because it follows the border radius (unlike outline).\n * This is particularly noticeable on mac. */\n border-color: rgb(77, 144, 254);\n outline: none;\n}\n\nbody.inactive select.chrome-select,\n.chrome-select:disabled {\n background-image: -webkit-image-set(url(Images/chromeDisabledSelect.png) 1x, url(Images/chromeDisabledSelect_2x.png) 2x), linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);\n border-color: rgba(80, 80, 80, 0.2);\n box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08),\n inset 0 1px 2px rgba(255, 255, 255, 0.75);\n color: #aaa;\n}\n\n:not(.platform-mac).-theme-with-dark-background ::-webkit-scrollbar,\n:host-context(:not(.platform-mac).-theme-with-dark-background) ::-webkit-scrollbar {\n width: 14px;\n}\n\n:not(.platform-mac).-theme-with-dark-background ::-webkit-scrollbar-track,\n:host-context(:not(.platform-mac).-theme-with-dark-background) ::-webkit-scrollbar-track {\n -webkit-box-shadow: inset 0 0 1px rgba(255,255,255,0.3);\n}\n\n:not(.platform-mac).-theme-with-dark-background ::-webkit-scrollbar-thumb,\n:host-context(:not(.platform-mac).-theme-with-dark-background) .-theme-with-dark-background ::-webkit-scrollbar-thumb {\n border-radius: 2px;\n background-color: #333;\n -webkit-box-shadow: inset 0 0 1px rgba(255,255,255,0.5);\n}\n\n/*# sourceURL=ui/inspectorCommon.css */";Runtime.cachedResources["ui/inspectorSyntaxHighlight.css"]="/*\n * Copyright (C) 2009 Apple Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n.cm-js-keyword {color: rgb(170, 13, 145);}\n.cm-js-number {color: rgb(28, 0, 207);}\n.cm-js-comment {color: rgb(0, 116, 0);}\n.cm-js-string {color: rgb(196, 26, 22);}\n.cm-js-string-2 {color: rgb(196, 26, 22);}\n\n.cm-css-keyword { color: rgb(7, 144, 154);}\n.cm-css-number {color: rgb(50, 0, 255);}\n.cm-css-comment {color: rgb(0, 116, 0);}\n.cm-css-def {color: rgb(200, 0, 0);}\n.cm-css-meta {color: rgb(200, 0, 0);}\n.cm-css-atom {color: rgb(7, 144, 154);}\n.cm-css-string {color: rgb(7, 144, 154);}\n.cm-css-string-2 {color: rgb(7, 144, 154);}\n.cm-css-link {color: rgb(7, 144, 154);}\n.cm-css-variable {color: rgb(200, 0, 0);}\n.cm-css-variable-2 {color: rgb(0, 0, 128);}\n.cm-css-property, .webkit-css-property {color: rgb(200, 0, 0);}\n\n.cm-xml-meta {color: rgb(192, 192, 192);}\n.cm-xml-comment {color: rgb(35, 110, 37);}\n.cm-xml-string {color: rgb(26, 26, 166);}\n.cm-xml-tag {color: rgb(136, 18, 128);}\n.cm-xml-attribute {color: rgb(153, 69, 0);}\n.cm-xml-link {color: #00e;}\n\n.webkit-html-comment {\n /* Keep this in sync with view-source.css (.webkit-html-comment) */\n color: rgb(35, 110, 37);\n}\n\n.webkit-html-tag {\n color: rgb(168, 148, 166);\n}\n\n.webkit-html-tag-name, .webkit-html-close-tag-name {\n /* Keep this in sync with view-source.css (.webkit-html-tag) */\n color: rgb(136, 18, 128);\n}\n\n.webkit-html-pseudo-element {\n /* This one is non-standard. */\n color: brown;\n}\n\n.webkit-html-js-node,\n.webkit-html-css-node {\n white-space: pre-wrap;\n}\n\n.webkit-html-text-node {\n unicode-bidi: -webkit-isolate;\n}\n\n.webkit-html-entity-value {\n /* This one is non-standard. */\n background-color: rgba(0, 0, 0, 0.15);\n unicode-bidi: -webkit-isolate;\n}\n\n.webkit-html-doctype {\n /* Keep this in sync with view-source.css (.webkit-html-doctype) */\n color: rgb(192, 192, 192);\n}\n\n.webkit-html-attribute-name {\n /* Keep this in sync with view-source.css (.webkit-html-attribute-name) */\n color: rgb(153, 69, 0);\n unicode-bidi: -webkit-isolate;\n}\n\n.webkit-html-attribute-value {\n /* Keep this in sync with view-source.css (.webkit-html-attribute-value) */\n color: rgb(26, 26, 166);\n unicode-bidi: -webkit-isolate;\n}\n\n.webkit-html-external-link,\n.webkit-html-resource-link {\n /* Keep this in sync with view-source.css (.webkit-html-external-link, .webkit-html-resource-link) */\n color: #00e;\n}\n\n.-theme-with-dark-background .webkit-html-external-link,\n.-theme-with-dark-background .webkit-html-resource-link,\n:host-context(.-theme-with-dark-background) .webkit-html-external-link,\n:host-context(.-theme-with-dark-background) .webkit-html-resource-link {\n color: hsl(0, 0%, 67%);\n}\n\n.webkit-html-resource-link {\n /* Required for consistency with view-source.css, since anchors may not have href attributes */\n text-decoration: underline;\n cursor: pointer;\n}\n\n.webkit-html-external-link {\n /* Keep this in sync with view-source.css (.webkit-html-external-link) */\n text-decoration: none;\n}\n\n.webkit-html-external-link:hover {\n /* Keep this in sync with view-source.css (.webkit-html-external-link:hover) */\n text-decoration: underline;\n}\n\n.webkit-html-end-of-file {\n /* Keep this in sync with view-source.css (.webkit-html-end-of-file) */\n color: rgb(255, 0, 0);\n font-weight: bold;\n}\n\n/*# sourceURL=ui/inspectorSyntaxHighlight.css */";Runtime.cachedResources["ui/inspectorSyntaxHighlightDark.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.cm-js-atom{color:rgb(161, 247, 181);}\n.cm-js-attribute{color:rgb(97, 148, 198);}\n.cm-js-builtin{color:rgb(159, 180, 214);}\n.cm-js-comment{color:rgb(116, 116, 116);}\n.cm-js-def{color:rgb(93, 176, 215);}\n.cm-js-keyword{color:rgb(154, 127, 213);}\n.cm-js-link{color:rgb(159, 180, 214);}\n.cm-js-meta{color:rgb(221, 251, 85);}\n.cm-js-number{color:rgb(161, 247, 181);}\n.cm-js-operator{color:rgb(210, 192, 87);}\n.cm-js-property{color:rgb(210, 192, 87);}\n.cm-js-string{color:rgb(242, 139, 84);}\n.cm-js-string-2{color:rgb(242, 139, 84);}\n.cm-js-tag{color:rgb(93, 176, 215);}\n.cm-js-variable{color:rgb(217, 217, 217);}\n.cm-js-variable-2{color:rgb(217, 217, 217);}\n.cm-atom{color:rgb(161, 247, 181);}\n.cm-comment{color:rgb(116, 116, 116);}\n.cm-variable{color:rgb(217, 217, 217);}\n.cm-string{color:rgb(242, 139, 84);}\n.cm-keyword{color:rgb(154, 127, 213);}\n.cm-number{color:rgb(161, 247, 181);}\n.cm-operator{color:rgb(210, 192, 87);}\n.cm-css-atom{color:rgb(217, 217, 217);}\n.cm-css-builtin{color:rgb(255, 163, 79);}\n.cm-css-def{color:rgb(255, 163, 79);}\n.cm-css-comment{color:rgb(116, 116, 116);}\n.cm-css-meta{color:rgb(132, 240, 255);}\n.cm-css-number{color:rgb(217, 217, 217);}\n.cm-css-operator{color:rgb(217, 217, 217);}\n.cm-css-property{color:rgb(132, 240, 255);}\n.cm-css-qualifier{color:rgb(255, 163, 79);}\n.cm-css-string{color:rgb(231, 194, 111);}\n.cm-css-string-2{color:rgb(217, 217, 217);}\n.cm-css-tag{color:rgb(255, 163, 79);}\n.cm-css-variable{color:rgb(255, 163, 79);}\n.cm-css-variable-2{color:rgb(255, 163, 79);}\n.cm-xml-comment{color:rgb(137, 137, 137);}\n.cm-xml-error{color:rgb(198, 95, 95);}\n.cm-xml-string{color:rgb(242, 151, 102);}\n.cm-xml-tag{color:rgb(93, 176, 215);}\n.cm-xml-attribute{color:rgb(155, 187, 220);}\n.cm-xml-link{color:rgb(231, 194, 111);}\n\n.webkit-html-attribute-name{color:rgb(155, 187, 220);}\n.webkit-html-attribute-value{color:rgb(242, 151, 102);}\n.webkit-html-comment{color:rgb(137, 137, 137);}\n.webkit-html-resource-link{color:rgb(231, 194, 111);}\n.webkit-html-external-link{color:rgb(231, 194, 111);}\n.webkit-html-tag{color:rgb(93, 176, 215);}\n.webkit-html-tag-name{color:rgb(93, 176, 215);}\n.webkit-html-close-tag-name{color:rgb(93, 176, 215);}\n.webkit-html-text-node{color:rgb(207, 208, 208);}\n.webkit-html-css-node{color:rgb(207, 208, 208);}\n.webkit-html-js-node{color:rgb(207, 208, 208);}\n.webkit-html-pseudo-element{color:rgb(93, 175, 215);}\n.webkit-css-selector{color:rgb(255, 163, 79);}\n.webkit-css-at-rule{color:rgb(188, 164, 197);}\n.webkit-css-color{color:rgb(255, 163, 79);}\n.webkit-css-comment{color:rgb(116, 116, 116);}\n.webkit-css-important{color:rgb(255, 26, 26);}\n.webkit-css-keyword{color:rgb(255, 163, 79);}\n.webkit-css-number{color:rgb(217, 217, 217);}\n.webkit-css-property{color: rgb(53, 212, 199);}\n.webkit-css-string{color:rgb(231, 194, 111);}\n.webkit-css-url{color:rgb(231, 194, 111);}\n\n/*# sourceURL=ui/inspectorSyntaxHighlightDark.css */";Runtime.cachedResources["ui/listWidget.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.list {\n flex: auto 0 1;\n overflow-y: auto;\n border: 1px solid rgb(231, 231, 231);\n flex-direction: column;\n}\n\n.list-separator {\n background: rgb(231, 231, 231);\n height: 1px;\n}\n\n.list-item {\n flex: none;\n min-height: 30px;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.list-item:hover {\n background: hsl(0, 0%, 96%);\n}\n\n.controls-container {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: stretch;\n pointer-events: none;\n}\n\n.controls-gradient {\n flex: 0 1 50px;\n}\n\n.list-item:hover .controls-gradient {\n background-image: linear-gradient(90deg, transparent, hsl(0, 0%, 96%));\n}\n\n.controls-buttons {\n flex: none;\n display: flex;\n flex-direction: row;\n align-items: center;\n pointer-events: auto;\n}\n\n.list-item:hover .controls-buttons {\n background-color: hsl(0, 0%, 96%);\n}\n\n.remove-button,\n.edit-button {\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 168px;\n width: 32px;\n height: 24px;\n opacity: 0.5;\n cursor: pointer;\n flex: none;\n visibility: hidden;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.remove-button,\n.edit-button {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.list-item:hover .remove-button,\n.list-item:hover .edit-button {\n visibility: visible;\n}\n\n.remove-button:hover,\n.edit-button:hover {\n opacity: 0.7;\n}\n\n.remove-button {\n background-position: -128px -24px;\n}\n\n.edit-button {\n background-position: -160px 0px;\n}\n\n.editor-container {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n flex: none;\n background: hsl(0, 0%, 96%);\n overflow: hidden;\n}\n\n.editor-content {\n flex: auto;\n display: flex;\n flex-direction: column;\n align-items: stretch;\n}\n\n.editor-buttons {\n flex: none;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n padding: 5px;\n}\n\n.editor-buttons > button {\n flex: none;\n margin-right: 10px;\n}\n\n.editor-content input {\n margin-right: 10px;\n}\n\n.editor-content input.error-input {\n outline: auto 2px red;\n background-color: white;\n}\n\n/*# sourceURL=ui/listWidget.css */";Runtime.cachedResources["ui/panelEnablerView.css"]="/*\n * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.\n * Copyright (C) 2009 Anthony Ricaud <rik@webkit.org>\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n.panel-enabler-view {\n background-color: white;\n font-size: 13px;\n text-align: center;\n overflow-x: hidden;\n overflow-y: overlay;\n flex: auto;\n display: flex;\n}\n\n.panel-enabler-view h1 {\n color: rgb(110, 116, 128);\n font-size: 16px;\n line-height: 20px;\n font-weight: normal;\n margin-top: 0;\n}\n\n.panel-enabler-view img {\n height: 100%;\n min-height: 200px;\n max-width: 100%;\n top: 0;\n bottom: 0;\n padding: 20px 0 20px 20px;\n margin: auto;\n vertical-align: middle;\n}\n\n.panel-enabler-view img.hidden {\n display: initial !important;\n width: 0;\n}\n\n.panel-enabler-view .flexible-space {\n -webkit-flex: 1;\n}\n\n.panel-enabler-view form {\n display: inline-block;\n vertical-align: middle;\n width: 330px;\n margin: 0;\n padding: 15px;\n white-space: normal;\n}\n\n.panel-enabler-view label {\n position: relative;\n display: block;\n text-align: left;\n word-break: break-word;\n margin: 0 0 5px 20px;\n}\n\n/*# sourceURL=ui/panelEnablerView.css */";Runtime.cachedResources["ui/progressIndicator.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.progress-indicator-shadow-stop-button {\n background-color: rgb(216, 0, 0) !important;\n border: 0;\n width: 10px;\n height: 12px;\n border-radius: 2px;\n}\n\n.progress-indicator-shadow-container {\n display: flex;\n flex: 1 0 auto;\n align-items: center;\n}\n\n.progress-indicator-shadow-container .title {\n text-overflow: ellipsis;\n overflow: hidden;\n max-width: 150px;\n margin-right: 2px;\n color: #777;\n}\n\n.progress-indicator-shadow-container progress {\n flex: auto;\n margin: 0 2px;\n width: 100px\n}\n\n/*# sourceURL=ui/progressIndicator.css */";Runtime.cachedResources["ui/propertiesSection.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.properties-tree {\n margin: 0;\n padding: 0 6px 2px;\n list-style: none;\n min-height: 18px;\n}\n\n.properties-tree ol {\n display: none;\n margin: 0;\n -webkit-padding-start: 12px;\n list-style: none;\n}\n\n.properties-tree ol.expanded {\n display: block;\n}\n\n.properties-tree li {\n margin-left: 12px;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n -webkit-user-select: text;\n cursor: default;\n padding-top: 2px;\n line-height: 12px;\n}\n\n.properties-tree li.parent {\n margin-left: 1px;\n}\n\n.properties-tree li.parent::before {\n -webkit-user-select: none;\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 168px;\n opacity: 0.5;\n content: \"a\";\n width: 8px;\n float: left;\n margin-right: 4px;\n color: transparent;\n text-shadow: none;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.properties-tree li.parent::before {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.properties-tree li.parent::before {\n background-position: -4px -96px;\n}\n\n.properties-tree li.parent.expanded::before {\n background-position: -20px -96px;\n}\n\n.properties-tree li .info {\n padding-top: 4px;\n padding-bottom: 3px;\n}\n\n.properties-tree li.editing {\n margin-left: 10px;\n text-overflow: clip;\n}\n\n.properties-tree li.editing-sub-part {\n padding: 3px 6px 8px 18px;\n margin: -1px -6px -8px -6px;\n text-overflow: clip;\n}\n\n.properties-tree .name {\n color: rgb(136, 19, 145);\n flex-shrink: 0;\n}\n\n.properties-tree .separator {\n flex-shrink: 0;\n}\n\n.properties-tree .dimmed {\n opacity: 0.6;\n}\n\n.properties-tree .value.error {\n color: red;\n}\n\n.properties-tree .number {\n color: blue;\n}\n\n.properties-tree .keyword {\n color: rgb(136, 19, 79);\n}\n\n.properties-tree .color {\n color: rgb(118, 15, 21);\n}\n\n/*# sourceURL=ui/propertiesSection.css */";Runtime.cachedResources["ui/radioButton.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n::content .dt-radio-button {\n height: 17px;\n width: 17px;\n min-width: 17px;\n border: 1px solid rgb(165, 165, 165);\n background-image: linear-gradient(to bottom, rgb(252, 252, 252), rgb(223, 223, 223));\n border-radius: 8px;\n -webkit-appearance: none;\n vertical-align: middle;\n margin: 0 5px 5px 0;\n}\n\n::content .dt-radio-button:active:not(:disabled) {\n background-image: linear-gradient(to bottom, rgb(194, 194, 194), rgb(239, 239, 239));\n}\n\n::content .dt-radio-button:checked {\n background: url(Images/radioDot.png) center no-repeat,\n linear-gradient(to bottom, rgb(252, 252, 252), rgb(223, 223, 223));\n}\n\n::content .dt-radio-button:checked:active {\n background: url(Images/radioDot.png) center no-repeat,\n linear-gradient(to bottom, rgb(194, 194, 194), rgb(239, 239, 239));\n}\n\n/*# sourceURL=ui/radioButton.css */";Runtime.cachedResources["ui/searchableView.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.search-bar {\n flex: 0 0 23px;\n background-color: #eee;\n border-top: 1px solid #ccc;\n display: flex;\n overflow: hidden;\n}\n\n.search-bar.replaceable {\n flex: 0 0 44px;\n}\n\n.search-toolbar {\n margin-top: -2px;\n}\n\n.search-replace {\n -webkit-appearance: none;\n border: 0;\n padding: 0 3px;\n margin: 0;\n flex: 1;\n}\n\n.search-replace:focus {\n outline: none;\n}\n\n.toolbar-search {\n border-spacing: 1px;\n}\n\n.toolbar-search td {\n padding: 0 5px 0 0;\n}\n\n.toolbar-search td > span {\n display: flex;\n align-items: baseline;\n line-height: 17px;\n}\n\n.toolbar-search-navigation-controls {\n align-self: stretch;\n background-image: linear-gradient(rgb(228, 228, 228), rgb(206, 206, 206));\n}\n\n.toolbar-search-navigation {\n display: inline-block;\n width: 18px;\n height: 18px;\n background-repeat: no-repeat;\n background-position: 4px 7px;\n border-left: 1px solid rgb(170, 170, 170);\n opacity: 0.3;\n}\n\n.toolbar-search-navigation.enabled {\n opacity: 1.0;\n}\n\n.toolbar-search button.search-action-button {\n border: 1px solid rgb(163, 163, 163);\n border-radius: 8px;\n margin: 0;\n background-image: linear-gradient(rgb(241, 241, 241), rgb(220, 220, 220));\n width: 100%;\n height: 20px;\n}\n\n.toolbar-search button.search-action-button:active {\n background-image: linear-gradient(rgb(185, 185, 185), rgb(156, 156, 156));\n}\n\n.toolbar-search-control {\n display: -webkit-flex;\n position: relative;\n background-color: white;\n}\n\n.toolbar-replace-control,\n#search-input-field {\n padding-top: 1px;\n line-height: 17px;\n}\n\n.toolbar-search-control, .toolbar-replace-control {\n border: 1px solid rgb(163, 163, 163);\n height: 20px;\n border-radius: 2px;\n width: 253px;\n margin-left: 1px;\n}\n\n.toolbar-search-navigation.enabled:active {\n background-position: 4px 7px, 0 0;\n}\n\n.toolbar-search-navigation.toolbar-search-navigation-prev {\n background-image: url(Images/searchPrev.png);\n border-left: 1px solid rgb(163, 163, 163);\n}\n\n:host-context(.-theme-with-dark-background) .toolbar-search-navigation {\n -webkit-filter: invert(90%);\n}\n\n.toolbar-search-navigation.toolbar-search-navigation-prev.enabled:active {\n background-image: url(Images/searchPrev.png), linear-gradient(rgb(168, 168, 168), rgb(116, 116, 116));\n}\n\n.toolbar-search-navigation.toolbar-search-navigation-next {\n background-image: url(Images/searchNext.png);\n border-left: 1px solid rgb(230, 230, 230);\n}\n\n.toolbar-search-navigation.toolbar-search-navigation-next.enabled:active {\n background-image: url(Images/searchNext.png), linear-gradient(rgb(168, 168, 168), rgb(116, 116, 116));\n}\n\n.search-results-matches {\n display: inline-block;\n text-align: right;\n font-size: 11px;\n padding: 0 4px;\n color: rgb(165, 165, 165);\n}\n\n/*# sourceURL=ui/searchableView.css */";Runtime.cachedResources["ui/section.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.section {\n position: relative;\n margin-top: 1px;\n}\n\n.section > .header {\n padding: 0 8px 0 5px;\n min-height: 18px;\n white-space: nowrap;\n background-origin: padding-box;\n background-clip: padding-box;\n}\n\n.section > .header::before {\n -webkit-user-select: none;\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 168px;\n opacity: 0.5;\n content: \"a\";\n color: transparent;\n text-shadow: none;\n float: left;\n width: 8px;\n margin-right: 4px;\n margin-top: 2px;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.section > .header::before {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.section > .header::before {\n background-position: -4px -96px;\n}\n\n.section.expanded > .header::before {\n background-position: -20px -96px;\n}\n\n.section > .header .title {\n font-weight: normal;\n word-wrap: break-word;\n white-space: normal;\n line-height: 18px;\n}\n\n.section > .header label {\n display: none;\n}\n\n.section.expanded .header label {\n display: inline;\n}\n\n.section > .header .subtitle {\n float: right;\n margin-left: 5px;\n max-width: 55%;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.section > .header .subtitle a {\n color: inherit;\n}\n\n.section > .properties {\n display: none;\n}\n\n.section.expanded > .properties {\n display: block;\n}\n\n/*# sourceURL=ui/section.css */";Runtime.cachedResources["ui/smallIcon.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\ndiv {\n width: 10px;\n height: 10px;\n margin-right: 2px;\n display: inline-block;\n}\n\ndiv.error-icon,\ndiv.revokedError-icon,\ndiv.warning-icon,\ndiv.info-icon,\ndiv.device-icon,\ndiv.red-ball,\ndiv.green-ball,\ndiv.orange-ball {\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 168px;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\ndiv.error-icon,\ndiv.revokedError-icon,\ndiv.warning-icon,\ndiv.info-icon,\ndiv.device-icon,\ndiv.red-ball,\ndiv.green-ball,\ndiv.orange-ball {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\ndiv.error-icon {\n background-position: -213px -96px;\n}\n\ndiv.revokedError-icon {\n background-position: -245px -107px;\n}\n\ndiv.warning-icon {\n background-position: -202px -107px;\n}\n\ndiv.info-icon {\n background-position: -213px -107px;\n}\n\ndiv.device-icon {\n background-position: -224px -107px;\n}\n\ndiv.red-ball {\n background-position: -224px -96px;\n}\n\ndiv.green-ball {\n background-position: -235px -96px;\n}\n\ndiv.orange-ball {\n background-position: -246px -96px;\n}\n\n/*# sourceURL=ui/smallIcon.css */";Runtime.cachedResources["ui/softContextMenu.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n position: absolute;\n border: 1px solid rgba(196, 196, 196, 0.9);\n border-top: 1px solid rgba(196, 196, 196, 0.5);\n /* NOTE: Keep padding top in sync with topPadding in SoftContextMenu.js */\n padding: 4px 0 4px 0;\n border-radius: 4px;\n background-color: rgb(240, 240, 240);\n box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);\n overflow-y: auto;\n min-width: 160px !important;\n}\n\n.soft-context-menu-item {\n display: flex;\n width: 100%;\n line-height: 14px;\n font-size: 12px;\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n padding: 2px 7px 2px 8px;\n margin: 0 13px 0 0;\n white-space: nowrap;\n}\n\n.soft-context-menu-disabled {\n color: #999;\n pointer-events: none;\n}\n\n.soft-context-menu-separator {\n height: 10px;\n margin: 0 1px;\n}\n\n.soft-context-menu-separator > .separator-line {\n margin: 0;\n height: 5px;\n border-bottom: 1px solid rgb(222, 222, 222);\n pointer-events: none;\n}\n\n.soft-context-menu-item-mouse-over,\n.-theme-selection-color {\n border-top: 1px solid rgb(56, 121, 217);\n border-bottom: 1px solid rgb(56, 121, 217);\n background-color: rgb(56, 121, 217);\n color: white;\n}\n\n:host-context(.platform-mac) .soft-context-menu-item-mouse-over,\n.-theme-selection-color {\n border-top: 1px solid transparent;\n border-bottom: 1px solid transparent;\n background-image: linear-gradient(to right, hsl(214, 81%, 60%), hsl(214, 100%, 56%));\n}\n\n:host-context(.platform-mac) .separator-line {\n border-width: 2px;\n}\n\n.soft-context-menu-item-submenu-arrow {\n color: #222;\n pointer-events: none;\n font-size: 11px;\n flex: 1 1 auto;\n text-align: right;\n}\n\n.soft-context-menu-item-mouse-over .soft-context-menu-item-checkmark {\n color: white;\n}\n\n.soft-context-menu-custom-item {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n flex: auto;\n}\n\n.soft-context-menu-shortcut {\n color: gray;\n pointer-events: none;\n flex: 1 1 auto;\n text-align: right;\n padding-left: 10px;\n}\n\n.soft-context-menu-item-mouse-over .soft-context-menu-shortcut {\n color: inherit;\n}\n\n.checkmark {\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 168px;\n opacity: 0.7;\n width: 10px;\n height: 10px;\n background-position: -128px -109px;\n display: inline-block;\n pointer-events: none;\n margin: auto 5px auto 0px;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.checkmark {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n}\n\n/*# sourceURL=ui/softContextMenu.css */";Runtime.cachedResources["ui/splitWidget.css"]="/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC.\n * OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n:host {\n overflow: hidden;\n}\n\n.shadow-split-widget {\n display: flex;\n overflow: hidden;\n}\n\n.shadow-split-widget-contents {\n display: flex;\n position: relative;\n flex-direction: column;\n}\n\n.shadow-split-widget-sidebar {\n flex: none;\n}\n\n.shadow-split-widget-main, .shadow-split-widget-sidebar.maximized {\n flex: auto;\n}\n\n.shadow-split-widget.hbox > .shadow-split-widget-resizer {\n position: absolute;\n top: 0;\n bottom: 0;\n width: 6px;\n z-index: 500;\n}\n\n.shadow-split-widget.vbox > .shadow-split-widget-resizer {\n position: absolute;\n left: 0;\n right: 0;\n height: 6px;\n z-index: 500;\n}\n\n.shadow-split-widget.hbox.shadow-split-widget-first-is-sidebar {\n flex-direction: row-reverse !important;\n}\n\n.shadow-split-widget.vbox.shadow-split-widget-first-is-sidebar {\n flex-direction: column-reverse !important;\n}\n\n.shadow-split-widget-resizer-border {\n pointer-events: none;\n}\n\n.shadow-split-widget.vbox > .shadow-split-widget-sidebar:not(.maximized) {\n border: 0;\n border-top: 1px solid rgb(64%, 64%, 64%);\n}\n\n.shadow-split-widget.vbox.shadow-split-widget-first-is-sidebar > .shadow-split-widget-sidebar:not(.maximized) {\n border: 0;\n border-bottom: 1px solid rgb(64%, 64%, 64%);\n}\n\n.shadow-split-widget.hbox > .shadow-split-widget-sidebar:not(.maximized) {\n border: 0;\n border-left: 1px solid rgb(64%, 64%, 64%);\n}\n\n.shadow-split-widget.hbox.shadow-split-widget-first-is-sidebar > .shadow-split-widget-sidebar:not(.maximized) {\n border: 0;\n border-right: 1px solid rgb(64%, 64%, 64%);\n}\n\n.shadow-split-widget button.sidebar-show-hide-button {\n position: absolute;\n -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);\n -webkit-mask-size: 352px 168px;\n height: 16px;\n width: 16px;\n border: none;\n z-index: 20;\n background-color: #5a5a5a;\n}\n\n.shadow-split-widget button.sidebar-show-hide-button:hover {\n background-color: #333;\n}\n\n.shadow-split-widget button.sidebar-show-hide-button:active {\n background-color: #5a5a5a;\n}\n\n.shadow-split-widget button.sidebar-show-hide-button:disabled {\n background-color: rgba(0, 0, 0, 0.35);\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.shadow-split-widget button.sidebar-show-hide-button {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.shadow-split-widget button.left-sidebar-show-hide-button,\n.shadow-split-widget button.top-sidebar-show-hide-button {\n top: 5px;\n left: 5px;\n}\n\n:host-context(.material) .shadow-split-widget button.left-sidebar-show-hide-button,\n:host-context(.material) .shadow-split-widget button.top-sidebar-show-hide-button {\n top: 5px;\n}\n\n.shadow-split-widget button.right-sidebar-show-hide-button {\n top: 5px;\n right:4px;\n}\n\n:host-context(.material) .shadow-split-widget button.right-sidebar-show-hide-button {\n top: 5px;\n right: 5px;\n}\n\n.shadow-split-widget button.bottom-sidebar-show-hide-button {\n bottom: 5px;\n right: 3px;\n}\n\n.shadow-split-widget button.left-sidebar-show-hide-button.toggled-show {\n -webkit-mask-position: -168px -76px; /* |> */\n}\n\n.shadow-split-widget button.left-sidebar-show-hide-button.toggled-hide {\n -webkit-mask-position: -199px -76px; /* |< */\n}\n\n.shadow-split-widget button.right-sidebar-show-hide-button.toggled-show {\n -webkit-mask-position: -296px -76px; /* <| */\n}\n\n.shadow-split-widget button.right-sidebar-show-hide-button.toggled-hide {\n -webkit-mask-position: -264px -76px; /* >| */\n}\n\n.shadow-split-widget button.top-sidebar-show-hide-button.toggled-show {\n -webkit-mask-position: -168px -76px; /* |> */\n transform: rotate(90deg);\n}\n\n.shadow-split-widget button.top-sidebar-show-hide-button.toggled-hide {\n -webkit-mask-position: -199px -76px; /* |< */\n transform: rotate(90deg);\n}\n\n.shadow-split-widget button.bottom-sidebar-show-hide-button.toggled-show {\n -webkit-mask-position: -296px -76px; /* <| */\n transform: rotate(90deg);\n}\n\n.shadow-split-widget button.bottom-sidebar-show-hide-button.toggled-hide {\n -webkit-mask-position: -264px -76px; /* >| */\n transform: rotate(90deg);\n}\n\n/*# sourceURL=ui/splitWidget.css */";Runtime.cachedResources["ui/toolbar.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n flex: none;\n padding: 0 2px;\n}\n\n.toolbar-shadow {\n position: relative;\n white-space: nowrap;\n height: 26px;\n overflow: hidden;\n z-index: 12;\n display: flex;\n flex: none;\n align-items: center;\n}\n\n.toolbar-shadow.wrappable {\n flex-wrap: wrap;\n}\n\n.toolbar-shadow.wrappable-reverse {\n flex-direction: row-reverse;\n}\n\n.toolbar-shadow.vertical {\n flex-direction: column;\n height: auto;\n width: 26px;\n}\n\n.toolbar-item {\n position: relative;\n display: flex;\n background-color: transparent;\n flex: none;\n align-items: center;\n justify-content: center;\n padding: 0;\n height: 26px;\n border: none;\n color: #5a5a5a;\n}\n\n.toolbar-dropdown-arrow {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);\n -webkit-mask-size: 352px 168px;\n -webkit-mask-position: -18px -96px;\n background-color: #444;\n width: 12px;\n height: 12px;\n display: inline-block;\n pointer-events: none;\n margin: auto 0;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n .toolbar-dropdown-arrow {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);\n }\n} /* media */\n\n/* Text-glyph item */\n\n.toolbar-text-glyph {\n white-space: nowrap;\n overflow: hidden;\n min-width: 28px;\n background: transparent;\n}\n\n.toolbar-text {\n margin: 0 5px;\n flex: none;\n color: #5a5a5a;\n}\n\n.toolbar-has-dropdown .toolbar-text {\n margin-right: 1px;\n}\n\n.toolbar-has-glyph .toolbar-text {\n margin-left: 0;\n}\n\n.toolbar-bold .toolbar-text {\n font-weight: bold;\n}\n\n.toolbar-dimmed .toolbar-text {\n color: #999;\n}\n\n.toolbar-glyph {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);\n -webkit-mask-size: 352px 168px;\n background-color: #5a5a5a;\n width: 28px;\n height: 24px;\n flex: none;\n transform: translateX(-2px);\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.toolbar-glyph {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n/* Button */\n\n.toolbar-button:disabled .toolbar-glyph {\n opacity: 0.5;\n}\n\n.toolbar-button:enabled.hover:not(:active) .toolbar-glyph {\n background-color: #333;\n}\n\n.toolbar-button:enabled.hover:not(:active) .toolbar-text {\n color: #333;\n}\n\n.toolbar-button.toolbar-state-on .toolbar-glyph,\n.toolbar-blue-on-hover .toolbar-button:not(.toolbar-state-on):enabled.hover:not(:active),\n.-theme-selection-color {\n background-color: hsl(218, 81%, 59%);\n}\n\n.toolbar-button.toolbar-state-on .toolbar-text,\n.-theme-selection-color {\n color: hsl(218, 81%, 59%);\n}\n\n.toolbar-blue-on-hover .toolbar-button:not(.toolbar-state-on):enabled.hover .toolbar-glyph {\n background-color: white;\n}\n\n.toolbar-blue-on-hover .toolbar-button:not(.toolbar-state-on):enabled.hover .toolbar-text {\n color: white;\n}\n\n.toolbar-button.toolbar-state-on:enabled.hover:not(:active) .toolbar-glyph,\n.toolbar-blue-on-hover .toolbar-button:not(.toolbar-state-on):enabled:active.hover,\n.-theme-selection-color {\n background-color: hsl(218, 96%, 54%);\n}\n\n.toolbar-button.toolbar-state-on:enabled.hover:not(:active) .toolbar-text,\n.-theme-selection-color {\n color: hsl(218, 96%, 54%);\n}\n\n.toolbar-toggled-gray .toolbar-button.toolbar-state-on {\n background-color: #f3f3f3 !important;\n}\n\n/* Checkbox */\n\n.toolbar-item.checkbox {\n padding: 0 5px 0 2px;\n}\n\n.toolbar-item.checkbox.hover {\n color: #333;\n}\n\n/* Select */\n\n.toolbar-select-container {\n display: inline-flex;\n flex-shrink: 0;\n margin-right: 6px;\n}\n\nselect.toolbar-item {\n min-width: 48px;\n -webkit-appearance: none;\n border: 0;\n border-radius: 0;\n padding: 0 15px 0 5px;\n margin-right: -10px;\n position: relative;\n}\n\n/* Input */\n\ninput.toolbar-item {\n width: 200px;\n height: 20px;\n padding: 3px;\n margin: 1px 3px;\n background-color: white;\n border: solid 1px #d8d8d8;\n}\n\ninput.toolbar-item:focus,\ninput.toolbar-item.hover {\n border: solid 1px rgb(202, 202, 202);\n}\n\n/* Separator */\n\n.toolbar-divider {\n background-color: #ccc;\n width: 1px;\n margin: 5px 4px;\n height: 16px;\n}\n\n/* Long click */\n\n.long-click-glyph {\n position: absolute;\n background-color: #5a5a5a;\n -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);\n -webkit-mask-position: -290px -46px;\n -webkit-mask-size: 352px 168px;\n width: 28px;\n height: 24px;\n top: 0;\n left: 0;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.long-click-glyph {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.toolbar-button.emulate-active {\n background-color: rgb(163, 163, 163);\n}\n\n.toolbar-shadow.floating {\n flex-direction: column;\n height: auto;\n background-color: white;\n border: 1px solid #ccc;\n margin-top: -1px;\n width: 28px;\n left: -2px;\n}\n\n/* Predefined items */\n\n.dock-toolbar-item-undock.toolbar-glyph {\n -webkit-mask-position: 0 -48px;\n}\n\n.dock-toolbar-item-bottom.toolbar-glyph {\n -webkit-mask-position: -32px -24px;\n}\n\n.dock-toolbar-item-right.toolbar-glyph {\n -webkit-mask-position: -256px -48px;\n}\n\n.settings-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -160px -24px;\n}\n\n.menu-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -192px -24px;\n}\n\n.node-search-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -320px -120px;\n}\n\n.delete-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -128px 0;\n}\n\n.clear-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -64px 0;\n}\n\n.refresh-toolbar-item.toolbar-glyph {\n -webkit-mask-position: 0 0;\n}\n\n.visibility-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -96px 0;\n}\n\n.visibility-off-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -192px 0;\n}\n\n.large-list-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -224px 0;\n}\n\n.record-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -288px 0;\n}\n\n.toolbar-state-on .record-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -288px -24px;\n}\n\n.camera-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -96px -24px;\n}\n\n.last-step-toolbar-item.toolbar-glyph {\n -webkit-mask-position: 0 -72px;\n}\n\n.first-step-toolbar-item.toolbar-glyph {\n -webkit-mask-position: 0 -72px;\n transform: rotate(180deg);\n top: 0;\n bottom: 0;\n}\n\n.step-in-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -64px -72px;\n}\n\n.step-out-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -96px -72px;\n}\n\n.step-over-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -128px -72px;\n}\n\n.step-backwards-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -128px -72px;\n transform: scaleX(-1);\n}\n\n.play-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -64px -48px;\n}\n\n.play-backwards-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -64px -48px;\n transform: scaleX(-1);\n}\n\n.pause-on-exceptions-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -256px 0;\n}\n\n.pause-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -32px -72px;\n}\n\n.toolbar-state-on .pause-toolbar-item.toolbar-glyph {\n -webkit-mask-position: 0 -72px;\n}\n\n.toolbar-state-on .breakpoint-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -32px 0;\n}\n\n.add-breakpoint-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -64px -24px;\n}\n\n.breakpoint-toolbar-item.toolbar-glyph {\n -webkit-mask-position: 0 -24px;\n}\n\n.format-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -256px -24px;\n}\n\n.garbage-collect-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -128px -24px;\n}\n\n.histogram-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -160px -48px;\n}\n\n.flame-chart-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -192px -48px;\n}\n\n.filter-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -32px -48px;\n}\n\n.waterfall-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -128px -48px;\n}\n\n.pan-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -98px -120px;\n}\n\n.center-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -128px -120px;\n}\n\n.rotate-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -160px -120px;\n}\n\n.pin-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -256px -120px;\n}\n\n.animation-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -192px -120px;\n}\n\n.eyedropper-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -288px -120px;\n}\n\n.add-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -224px -120px;\n}\n\n.toolbar-state-pause-outline .animation-control-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -320px 0px;\n}\n\n.toolbar-state-replay-outline .animation-control-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -320px -24px;\n background-color: rgb(66, 129, 235) !important;\n}\n\n.toolbar-state-play-outline .animation-control-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -320px -48px;\n background-color: rgb(66, 129, 235) !important;\n}\n\n.timer-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -320px -72px;\n}\n\n.view-quilt-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -320px -96px;\n}\n\n.background-color-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -96px -144px;\n}\n\n.foreground-color-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -128px -144px;\n}\n\n.layout-editor-toolbar-item.toolbar-glyph {\n -webkit-mask-position: 0 -144px;\n}\n\n.block-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -32px -144px;\n}\n\n.phone-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -288px -144px;\n}\n\n.rotate-screen-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -192px -144px;\n}\n\n.enter-fullscreen-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -256px -96px;\n}\n\n.responsive-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -288px -96px;\n}\n\n.frame-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -256px -144px;\n}\n\n.domain-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -160px -144px;\n}\n\n.folder-toolbar-item.toolbar-glyph {\n -webkit-mask-position: -224px -144px;\n}\n\n.toolbar-state-on .record-toolbar-item.toolbar-glyph,\n.toolbar-state-active .filter-toolbar-item.toolbar-glyph,\n.toolbar-state-active .block-toolbar-item.toolbar-glyph {\n background-color: rgb(216, 0, 0) !important;\n}\n\n:host-context(.-theme-with-dark-background) .toolbar-state-active .filter-toolbar-item.toolbar-glyph,\n:host-context(.-theme-with-dark-background) .toolbar-state-active .block-toolbar-item.toolbar-glyph,\n:host-context(.-theme-with-dark-background) .toolbar-state-on .record-toolbar-item.toolbar-glyph {\n background-color: hsl(0, 100%, 65%) !important;\n}\n\n/*# sourceURL=ui/toolbar.css */";Runtime.cachedResources["ui/suggestBox.css"]="/*\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n:host {\n position: absolute;\n background-color: transparent;\n z-index: 1000;\n pointer-events: none;\n overflow: hidden;\n display: flex;\n flex-direction: row;\n}\n\n.suggest-box-left-spacer {\n flex: 0 1 auto;\n}\n\n.suggest-box-horizontal {\n display: flex;\n flex-direction: column;\n flex: 0 0 auto;\n max-width: 300px;\n}\n\n.suggest-box-top-spacer {\n flex: auto;\n}\n\n:host(.under-anchor) .suggest-box-top-spacer,\n:host(:not(.under-anchor)) .suggest-box-bottom-spacer {\n flex: 0 0 auto;\n}\n\n.suggest-box-container {\n display: flex;\n flex-direction: row;\n}\n\n.suggest-box {\n background-color: #FFFFFF;\n border: 1px solid rgb(66%, 66%, 66%);\n pointer-events: auto;\n margin-left: -3px;\n overflow-x: hidden;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n flex: 0 0 auto;\n border-radius: 5px 5px 5px 0;\n}\n\n:host(.under-anchor) .suggest-box {\n border-radius: 0 5px 5px 5px;\n}\n\n.suggest-box .suggest-box-content-item {\n padding: 1px;\n margin: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n border: 1px solid transparent;\n flex: 0 0 auto;\n padding-right: 0;\n white-space: nowrap;\n}\n\n.suggest-box .suggest-box-content-item .prefix {\n font-weight: bold;\n}\n\n.suggest-box .suggest-box-content-item .spacer {\n display: inline-block;\n width: 20px;\n}\n\n.suggest-box .suggest-box-content-item.selected {\n background-color: rgba(56, 121, 217, 0.1);\n}\n\n.suggest-box .suggest-box-content-item:hover:not(.selected) {\n border: 1px solid rgb(204, 204, 204);\n}\n\n.suggest-box .details-popup {\n padding: 17px;\n pointer-events: auto;\n margin-left: 3px;\n max-width: 750px;\n word-wrap: normal;\n}\n\n.suggest-box .details-popup .description {\n margin-top: 22px;\n color: #808080;\n}\n\n/*# sourceURL=ui/suggestBox.css */";Runtime.cachedResources["ui/tabbedPane.css"]="/*\n * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.\n * Copyright (C) 2009 Anthony Ricaud <rik@webkit.org>\n * Copyright (C) 2011 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC.\n * OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n.tabbed-pane {\n flex: auto;\n overflow: hidden;\n}\n\n.tabbed-pane-content {\n position: relative;\n overflow: auto;\n flex: auto;\n display: flex;\n flex-direction: column;\n}\n\n.tabbed-pane-content.has-no-tabs {\n background-color: lightgray;\n}\n\n.tabbed-pane-placeholder {\n font-size: 14px;\n text-align: center;\n margin-top: 20px;\n text-shadow: rgba(255, 255, 255, 0.75) 0 1px 0;\n}\n\n.tabbed-pane-header {\n display: flex;\n flex: 0 0 27px;\n border-bottom: 1px solid #ccc;\n overflow: visible;\n width: 100%;\n background-color: #f3f3f3;\n}\n\n.tabbed-pane-header-contents {\n flex: auto;\n pointer-events: none;\n margin-left: 5px;\n position: relative;\n}\n\n.tabbed-pane-header-contents > * {\n pointer-events: initial;\n}\n\n.tabbed-pane-header-tab-icon {\n margin-right: 2px;\n}\n\n.tabbed-pane-header-tab {\n float: left;\n margin-top: 2px;\n padding: 2px 4px 2px 4px;\n height: 24px;\n border: 1px solid transparent;\n border-bottom: none;\n line-height: 15px;\n white-space: nowrap;\n cursor: default;\n display: flex;\n align-items: center;\n color: #5a5a5a;\n}\n\n.tabbed-pane-header-tab:hover,\n.tabbed-pane-header-tab.selected:hover {\n color: #333;\n background-color: #e5e5e5;\n}\n\n.tabbed-pane-header-tab-title {\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.tabbed-pane-header-tab.measuring {\n visibility: hidden;\n}\n\n.tabbed-pane-header-tab.selected {\n border: 1px solid #ccc;\n border-bottom: none;\n color: #333;\n}\n\n.tabbed-pane-header-tab.selected {\n background-color: white;\n border-top-color: #ccc;\n}\n\n.tabbed-pane-header-tab.dragging {\n position: relative;\n box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);\n background-color: #e5e5e5;\n}\n\n.tabbed-pane-header-tab .tabbed-pane-close-button {\n display: inline-block;\n position: relative;\n top: 2px;\n left: 1px;\n margin-left: 2px;\n margin-top: -3px;\n visibility: hidden;\n}\n\n.tabbed-pane-header-tab:hover .tabbed-pane-close-button,\n.tabbed-pane-header-tab.selected .tabbed-pane-close-button {\n visibility: visible;\n}\n\n.tabbed-pane-header-tabs-drop-down-container {\n float: left;\n position: relative;\n vertical-align: bottom;\n line-height: 24px;\n opacity: 0.8;\n color: inherit;\n font-size: 133%;\n cursor: pointer;\n}\n\n.tabbed-pane-header-tabs-drop-down-container > .glyph {\n height: 26px;\n background-color: hsla(0,0%,20%,1);\n -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);\n -webkit-mask-position: -68px -143px;\n -webkit-mask-size: 352px 168px;\n width: 24px;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.tabbed-pane-header-tabs-drop-down-container > .glyph {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.tabbed-pane-header-tabs-drop-down-container:hover {\n background-color: rgb(229, 229, 229);\n}\n\n.tabbed-pane-header-tabs-drop-down-container.measuring {\n visibility: hidden;\n}\n\n.tabbed-pane-header-tabs-drop-down-container:hover {\n opacity: 1.0;\n}\n\n.tabbed-pane-header-tabs-drop-down-container:active {\n opacity: 0.8;\n}\n\n/* Web page style */\n\n.tabbed-pane-shadow.vertical-tab-layout {\n flex-direction: row !important;\n}\n\n.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-header {\n background-color: transparent;\n border: none transparent !important;\n width: auto;\n flex: 0 0 auto;\n flex-direction: column;\n padding-top: 10px;\n overflow: hidden;\n}\n\n.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-content {\n padding: 10px 10px 10px 0;\n overflow-x: hidden;\n}\n\n.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-header-contents {\n margin: 0;\n flex: none;\n}\n\n.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-header-tabs {\n display: flex;\n flex-direction: column;\n width: 120px;\n}\n\n.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-header-tab {\n background-color: transparent;\n border: none transparent;\n font-weight: normal;\n text-shadow: none;\n color: #777;\n height: 26px;\n padding-left: 10px;\n border-left: 6px solid transparent;\n margin: 0;\n display: flex;\n align-items: center;\n}\n\n.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-header-tab:not(.selected) {\n cursor: pointer !important;\n}\n\n.tabbed-pane-shadow.vertical-tab-layout .tabbed-pane-header-tab.selected {\n color: inherit;\n border: none transparent;\n border-left: 6px solid #666;\n}\n\n.tabbed-pane-tab-slider,\n.-theme-selection-color {\n height: 2px;\n position: absolute;\n bottom: -1px;\n background-color: #3E82F7;\n left: 0;\n z-index: 50;\n transform-origin: 0 100%;\n transition: transform 150ms cubic-bezier(0, 0, 0.2, 1);\n visibility: hidden;\n border-top: 1px solid hsl(218, 82%, 78%);\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n .tabbed-pane-tab-slider {\n border-top: none;\n }\n}\n\n.tabbed-pane-tab-slider.enabled {\n visibility: visible;\n}\n\n.tabbed-pane-header.tabbed-pane-no-header-background {\n background-color: transparent;\n}\n\n/*# sourceURL=ui/tabbedPane.css */";Runtime.cachedResources["ui/textButton.css"]="/*\n * Copyright (c) 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n background-image: linear-gradient(hsl(0, 0%, 93%), hsl(0, 0%, 93%) 38%, hsl(0, 0%, 87%));\n border: 1px solid hsla(0, 0%, 0%, 0.25);\n border-radius: 2px;\n box-shadow: 0 1px 0 hsla(0, 0%, 0%, 0.08), inset 0 1px 2px hsla(0, 100%, 100%, 0.75);\n color: hsl(0, 0%, 27%);\n font-size: 12px;\n margin: 0 1px 0 0;\n text-shadow: 0 1px 0 hsl(0, 0%, 94%);\n min-height: 2em !important;\n padding-left: 10px;\n padding-right: 10px;\n -webkit-user-select: none;\n flex: none;\n}\n\n:host-context(body.inactive),\n:host(:disabled) {\n background-image: linear-gradient(#f1f1f1, #f1f1f1 38%, #e6e6e6);\n border-color: rgba(80, 80, 80, 0.2);\n box-shadow: 0 1px 0 rgba(80, 80, 80, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.75);\n color: #aaa;\n}\n\n:host(:not(:disabled):hover) {\n background-image: linear-gradient(hsl(0, 0%, 94%), hsl(0, 0%, 94%) 38%, hsl(0, 0%, 88%));\n border-color: hsla(0, 0%, 0%, 0.3);\n box-shadow: 0 1px 0 hsla(0, 0%, 0%, 0.12), inset 0 1px 2px hsla(0, 100%, 100%, 0.95);\n color: hsl(0, 0%, 0%);\n}\n\n:host(:not(:disabled):active) {\n background-image: linear-gradient(hsl(0, 0%, 91%), hsl(0, 0%, 91%) 38%, hsl(0, 0%, 84%));\n box-shadow: none;\n text-shadow: none;\n}\n\n:host(:not(:disabled):focus) {\n -webkit-transition: border-color 200ms;\n border-color: rgb(77, 144, 254);\n outline: none;\n}\n\n/*# sourceURL=ui/textButton.css */";Runtime.cachedResources["ui/textPrompt.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.text-prompt-editing {\n -webkit-user-select: text;\n box-shadow: rgba(0, 0, 0, .5) 3px 3px 4px;\n outline: 1px solid rgb(66%, 66%, 66%) !important;\n background-color: white;\n -webkit-user-modify: read-write-plaintext-only;\n text-overflow: clip !important;\n padding-left: 2px;\n margin-left: -2px;\n padding-right: 2px;\n margin-right: -2px;\n margin-bottom: -1px;\n padding-bottom: 1px;\n opacity: 1.0 !important;\n}\n\n.text-prompt-editing,\n.text-prompt-editing ::content * {\n color: #222 !important;\n text-decoration: none !important;\n -webkit-user-modify: read-write-plaintext-only;\n}\n\n::content .auto-complete-text,\n.text-prompt-editing ::content .auto-complete-text {\n color: rgb(128, 128, 128) !important;\n -webkit-user-select: none;\n -webkit-user-modify: read-only;\n}\n\n.text-prompt-editing ::content br {\n display: none;\n}\n\n/*# sourceURL=ui/textPrompt.css */";Runtime.cachedResources["ui/tooltip.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.tooltip {\n background: hsl(0, 0%, 95%);\n border-radius: 2px;\n color: hsl(0, 0%, 20%);\n padding: 5px 8px;\n font-size: 11px;\n line-height: 14px;\n display: flex;\n align-items: center;\n -webkit-filter: drop-shadow(0 1px 2px hsla(0, 0%, 0%, 0.3));\n border: 1px solid hsla(0, 0%, 0%, 0.1);\n background-clip: padding-box;\n box-sizing: border-box;\n position: absolute;\n visibility: hidden;\n transition: visibility 0s 100ms, opacity 150ms cubic-bezier(0, 0, .2, 1);\n z-index: 20001;\n top: 0;\n left: 0;\n opacity: 0;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.tooltip.shown {\n visibility: visible;\n transition-delay: 600ms;\n opacity: 1;\n}\n\n.tooltip.shown.instant {\n transition-delay: 0s;\n}\n\n.tooltip-shortcut {\n color: hsl(0, 0%, 45%);\n display: inline-block;\n margin-left: 8px;\n flex: 0 0 auto;\n}\n\n/*# sourceURL=ui/tooltip.css */";Runtime.cachedResources["ui/treeoutline.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n flex: 1 1;\n padding: 2px 0 0 0;\n}\n\n.tree-outline-disclosure {\n min-width: 100%;\n display: inline-block;\n}\n\n.tree-outline {\n padding: 0 0 4px 4px;\n margin: 0;\n z-index: 0;\n position: relative;\n}\n\n.tree-outline li.hovered:not(.selected) .selection {\n display: block;\n left: 3px;\n right: 3px;\n background-color: rgba(56, 121, 217, 0.1);\n border-radius: 5px;\n}\n\n.tree-outline li .selection {\n display: none;\n z-index: -1;\n margin-left: -10000px;\n}\n\n.tree-outline li.selected .selection {\n display: block;\n background-color: #ddd;\n}\n\n.tree-outline li.in-clipboard .highlight {\n outline: 1px dotted darkgrey;\n}\n\n.tree-outline li.elements-drag-over .selection {\n display: block;\n margin-top: -2px;\n border-top: 2px solid rgb(56, 121, 217);\n}\n\nol.tree-outline:focus li.selected .selection {\n background-color: rgb(56, 121, 217);\n}\n\nol.tree-outline:focus li.parent.selected::before {\n background-color: white;\n}\n\nol.tree-outline,\n.tree-outline ol {\n list-style-type: none;\n}\n\n.tree-outline-no-padding {\n padding: 0;\n}\n\n.tree-outline ol {\n padding-left: 12px;\n}\n\n.tree-outline li {\n text-overflow: ellipsis;\n white-space: nowrap;\n position: relative;\n display: flex;\n align-items: center;\n}\n\nol.tree-outline:focus li.selected {\n color: white;\n}\n\nol.tree-outline:focus li.selected * {\n color: inherit;\n}\n\n.tree-outline li::before {\n -webkit-user-select: none;\n -webkit-mask-image: url(Images/toolbarButtonGlyphs.png);\n -webkit-mask-size: 352px 168px;\n content: \"aa\";\n color: transparent;\n text-shadow: none;\n margin-right: -2px;\n height: 12px;\n}\n\n.tree-outline li:not(.parent)::before {\n background-color: transparent;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.tree-outline li::before {\n -webkit-mask-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.tree-outline li::before {\n -webkit-mask-position: -4px -96px;\n background-color: rgb(110, 110, 110);\n}\n\n.tree-outline li.parent.expanded::before {\n -webkit-mask-position: -20px -96px;\n}\n\n.tree-outline ol.children {\n display: none;\n}\n\n.tree-outline ol.children.expanded {\n display: block;\n}\n\n/*# sourceURL=ui/treeoutline.css */";Runtime.cachedResources["components/breakpointsList.css"]="/*\n * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.\n * Copyright (C) 2009 Anthony Ricaud <rik@webkit.org>\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of Apple Computer, Inc. (\"Apple\") nor the names of\n * its contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n.sidebar-pane .breakpoint-condition {\n display: block;\n margin-top: 4px;\n margin-bottom: 4px;\n margin-left: 23px;\n margin-right: 8px;\n}\n\n.breakpoint-list .editing.being-edited {\n overflow: hidden;\n white-space: nowrap;\n}\n\n#breakpoint-condition-input {\n display: block;\n margin-left: 0;\n margin-right: 0;\n outline: none !important;\n border: 1px solid rgb(66%, 66%, 66%);\n}\n\nol.breakpoint-list {\n -webkit-padding-start: 0;\n list-style: none;\n margin: 0;\n padding-bottom: 3px;\n}\n\n.breakpoints-list-deactivated {\n background-color: #eee;\n opacity: 0.3;\n}\n\n.breakpoint-list li {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n padding: 2px 0;\n}\n\n.breakpoint-list li:hover {\n background-color: #eee;\n}\n\n.breakpoint-list .source-text {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n margin: 2px 0 0 20px;\n}\n\n.sidebar-pane .breakpoint-hit {\n background-color: rgb(255, 255, 194);\n}\n\n.-theme-with-dark-background .sidebar-pane .breakpoint-hit {\n background-color: hsl(46, 98%, 22%);\n color: #ccc;\n}\n\nli.breakpoint-hit .breakpoint-hit-marker {\n background-color: rgb(255, 255, 194);\n height: 18px;\n left: 0;\n margin-top: -16px;\n position: absolute;\n right: 0;\n z-index: -1;\n}\n\n.event-listener-breakpoints {\n margin-top: 0;\n padding: 2px 6px;\n list-style: none;\n min-height: 18px;\n}\n\n.event-listener-breakpoints ol {\n display: none;\n margin: 0;\n -webkit-padding-start: 12px;\n list-style: none;\n}\n\n.event-listener-breakpoints ol.expanded {\n display: block;\n}\n\n.event-listener-breakpoints li {\n margin-left: 12px;\n text-overflow: ellipsis;\n -webkit-user-select: text;\n cursor: default;\n}\n\n.event-listener-breakpoints li.parent {\n margin-left: 1px;\n}\n\n.event-listener-breakpoints li.parent::before {\n -webkit-user-select: none;\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 168px;\n opacity: 0.5;\n content: \"a\";\n width: 8px;\n float: left;\n margin: 2px 2px 0 -2px;\n color: transparent;\n text-shadow: none;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.event-listener-breakpoints li.parent::before {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.event-listener-breakpoints li.parent::before {\n background-position: -4px -96px;\n}\n\n.event-listener-breakpoints li.parent.expanded::before {\n background-position: -20px -96px;\n}\n\n.event-listener-breakpoints .children li {\n margin-left: 12px;\n}\n\n.async-operations li > label {\n float: left;\n}\n\n.async-operations li > div {\n float: right;\n margin: 2px 3px 0 2px;\n}\n\n.dom-breakpoints-list > li {\n display: flex;\n}\n\n.dom-breakpoints-list .dom-breakpoint > div {\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/*# sourceURL=components/breakpointsList.css */";Runtime.cachedResources["components/customPreviewSection.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.custom-expandable-section {\n display: inline-flex;\n flex-direction: column;\n}\n\n.custom-expandable-section-header::before {\n -webkit-user-select: none;\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 168px;\n opacity: 0.5;\n content: \"a\";\n width: 8px;\n margin-right: 4px;\n padding-right: 2px;\n color: transparent;\n text-shadow: none;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n .custom-expandable-section-header::before {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n }\n} /* media */\n\n\n.custom-expandable-section-header::before {\n background-position: -4px -96px;\n}\n\n.custom-expandable-section-header.expanded::before {\n background-position: -20px -96px;\n}\n\n.custom-expandable-section-standard-section {\n display: inline-flex;\n}\n/*# sourceURL=components/customPreviewSection.css */";Runtime.cachedResources["components/eventListenersView.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.event-listener-tree li {\n padding: 2px 0 0 5px;\n overflow: hidden;\n display: list-item;\n}\n\n.event-listener-tree > li {\n border-top: 1px solid #f0f0f0;\n}\n\n.event-listener-tree > li:first-of-type {\n border-top: none;\n}\n\n.event-listener-tree {\n padding-left: 0 !important;\n padding-right: 3px;\n}\n\n.event-listener-tree li.parent::before {\n top: 0 !important;\n}\n\n.event-listener-tree .name {\n color: rgb(136, 19, 145);\n}\n\n.event-listener-tree-subtitle {\n float: right;\n margin-left: 5px;\n}\n\n.event-listener-delete-button {\n padding: 0 3px;\n background-color: #f2f2f2;\n border-radius: 3px;\n border: 1px solid #c3c3c3;\n margin-left: 10px;\n display: none;\n}\n\n.event-listener-delete-button:hover {\n background-color: #e0e0e0;\n}\n\n.event-listener-tree li:hover .event-listener-delete-button {\n display: inline;\n}\n\n/*# sourceURL=components/eventListenersView.css */";Runtime.cachedResources["components/domUtils.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n display: inline;\n}\n\n.node-link {\n cursor: pointer;\n display: inline;\n pointer-events: auto;\n}\n\n.stack-preview-async-description {\n padding: 3px 0 1px;\n font-style: italic;\n}\n\n.stack-preview-container .webkit-html-blackbox-link {\n opacity: 0.6;\n}\n\n.stack-preview-container > tr {\n height: 16px;\n line-height: 16px;\n}\n\n.stack-preview-container td {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.stack-preview-container .function-name {\n max-width: 80em;\n}\n\n.node-label-name {\n color: rgb(136, 18, 128);\n}\n\n.node-label-id {\n color: rgb(26, 26, 166);\n}\n\n.node-label-class, .node-label-pseudo {\n color: rgb(153, 69, 0);\n}\n\n/*# sourceURL=components/domUtils.css */";Runtime.cachedResources["components/inspectorViewTabbedPane.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.tabbed-pane-header-tab,\n.tabbed-pane-header-tab.selected {\n height: 26px;\n margin: 0;\n background: #f3f3f3;\n border: none;\n border-left: 2px solid transparent;\n border-right: 2px solid transparent;\n padding: 0 6px;\n}\n\n.tabbed-pane-header-tab.selected {\n border-width: 0 2px 0 2px;\n}\n\n.tabbed-pane-header-contents {\n margin-left: 0;\n}\n\n/*# sourceURL=components/inspectorViewTabbedPane.css */";Runtime.cachedResources["components/networkConditionsSettingsTab.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.network-conditions-settings-tab .settings-tab.help-content {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n height: 100%;\n margin: 0;\n max-width: 500px;\n}\n\n.network-conditions-settings-tab .conditions-title {\n font-size: 120%;\n color: #222;\n flex: none;\n}\n\n.network-conditions-settings-tab .button-row {\n flex: none;\n display: flex;\n margin-bottom: 10px;\n}\n\n.network-conditions-settings-tab .button-row button {\n margin-right: 10px;\n min-width: 120px;\n flex: none;\n}\n\n.conditions-list-item {\n padding: 3px 5px 3px 5px;\n height: 30px;\n display: flex;\n align-items: center;\n position: relative;\n flex: auto 1 1;\n}\n\n.conditions-list-text {\n white-space: nowrap;\n text-overflow: ellipsis;\n flex: 0 0 70px;\n -webkit-user-select: none;\n color: #222;\n text-align: end;\n position: relative;\n}\n\n.conditions-list-title {\n text-align: start;\n flex: auto;\n display: flex;\n align-items: flex-start;\n}\n\n.conditions-list-title-text {\n overflow: hidden;\n flex: auto;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.conditions-list-separator {\n flex: 0 0 1px;\n background-color: rgb(231, 231, 231);\n height: 30px;\n margin: 0 4px;\n}\n\n.conditions-list-separator-invisible {\n visibility: hidden;\n height: 100% !important;\n}\n\n.conditions-edit-row {\n flex: none;\n display: flex;\n flex-direction: row;\n margin: 6px 5px;\n}\n\n.conditions-edit-row input {\n width: 100%;\n text-align: inherit;\n}\n\n.conditions-edit-optional {\n position: absolute;\n bottom: -20px;\n right: 0;\n color: rgb(128, 128, 128);\n}\n\n/*# sourceURL=components/networkConditionsSettingsTab.css */";Runtime.cachedResources["components/objectPropertiesSection.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.object-properties-section .name {\n color: rgb(136, 19, 145);\n flex-shrink: 0;\n}\n\n.object-properties-section-separator {\n flex-shrink: 0;\n padding-right: 5px;\n}\n\n.object-properties-section-dimmed {\n opacity: 0.6;\n}\n\n.object-properties-section {\n padding: 0 0 0px 0px;\n color: rgb(33,33,33) !important;\n display: flex;\n flex-direction: column;\n}\n\n.object-properties-section li {\n min-height: inherit;\n line-height: 15px;\n -webkit-user-select: text;\n}\n\n.object-properties-section li::before {\n top: -1px;\n}\n\n.object-properties-section li.editing-sub-part {\n padding: 3px 6px 8px;\n margin: -1px -6px -8px -6px;\n text-overflow: clip;\n}\n\n.object-properties-section li.editing {\n margin-left: 10px;\n text-overflow: clip;\n}\n\n.tree-outline ol.title-less-mode {\n padding-left: 0px;\n}\n\n.object-properties-section .synthetic-property {\n font-style: italic;\n}\n\n.object-properties-section-root-element {\n display: flex;\n flex-direction: row;\n}\n\n.object-properties-section-root-element::before {\n -webkit-mask-position: -4px -97px !important;\n}\n\n.object-properties-section-root-element.expanded::before {\n -webkit-mask-position: -20px -97px !important;\n}\n\n/*# sourceURL=components/objectPropertiesSection.css */";Runtime.cachedResources["components/objectValue.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.object-value-scientific-notation-exponent {\n flex-shrink: 0;\n}\n\n.object-value-scientific-notation-mantissa {\n overflow: hidden;\n text-overflow: ellipsis;\n flex-shrink: 1;\n min-width: 1ex;\n}\n\n.object-value-scientific-notation-number {\n display: flex !important;\n}\n\n.object-value-node:hover {\n background-color: rgba(56, 121, 217, 0.1);\n}\n\n.object-value-function::before {\n content: \"function\";\n color: rgb(170, 13, 145);\n padding-right: 5px;\n}\n\n.object-value-function {\n font-style: italic;\n}\n\n.object-value-function.linkified:hover {\n background-color: rgba(0, 0, 0, 0.1);\n cursor: pointer;\n}\n\n.object-value-object,\n.object-value-map,\n.object-value-set,\n.object-value-iterator,\n.object-value-generator,\n.object-value-node,\n.object-value-array {\n position: relative;\n vertical-align: top;\n color: inherit;\n display: inline-block;\n}\n\n.object-value-number,\n.object-value-boolean {\n color: rgb(28, 0, 207);\n}\n\n.object-value-string,\n.object-value-regexp,\n.object-value-symbol {\n color: rgb(196, 26, 22);\n white-space: pre;\n unicode-bidi: -webkit-isolate;\n}\n\n.object-value-node {\n color: rgb(136, 18, 128);\n}\n\n.object-value-null,\n.object-value-undefined {\n color: rgb(128, 128, 128);\n}\n\n.object-value {\n text-overflow: ellipsis;\n overflow: hidden;\n -webkit-user-select: text;\n}\n\n.object-value-calculate-value-button:hover {\n text-decoration: underline;\n}\n\n.object-value-object .section,\n.object-formatted-map .section,\n.object-value-set .section,\n.object-value-iterator .section,\n.object-value-generator .section,\n.object-value-node .section,\n.object-value-array .section {\n position: static;\n}\n.object-value-object .section > .header::before {\n margin-top: 0;\n}\n\n\n.object-value-object .properties-tree,\n.object-value-map .properties-tree,\n.object-value-set .properties-tree,\n.object-value-iterator .properties-tree,\n.object-value-generator .properties-tree,\n.object-value-node .properties-tree {\n padding-left: 0 !important;\n}\n\n.object-value-preview-node,\n.section .object-value-node {\n color: rgb(136, 18, 128);\n}\n\n.object-properties-section-custom-section {\n display: inline-flex;\n flex-direction: column;\n}\n\n.-theme-with-dark-background .object-value-number,\n:host-context(.-theme-with-dark-background) .object-value-number,\n.-theme-with-dark-background .object-value-boolean,\n:host-context(.-theme-with-dark-background) .object-value-boolean {\n color: hsl(252, 100%, 75%);\n}\n\n/*# sourceURL=components/objectValue.css */";Runtime.cachedResources["emulation/devicesSettingsTab.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.devices-settings-tab .settings-tab.help-content {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n height: 100%;\n margin: 0;\n}\n\n.devices-settings-tab .devices-title {\n font-size: 120%;\n color: #222;\n flex: none;\n}\n\n.devices-settings-tab .devices-button-row {\n flex: none;\n display: flex;\n}\n\n.devices-settings-tab .devices-button-row button {\n margin-right: 10px;\n min-width: 120px;\n flex: none;\n}\n\n.devices-settings-tab .devices-list {\n width: 350px;\n margin-top: 10px;\n}\n\n.devices-list-item {\n padding: 3px 5px 3px 5px;\n height: 30px;\n display: flex;\n align-items: center;\n flex: auto 1 1;\n cursor: pointer;\n}\n\n.devices-list-checkbox {\n height: 12px;\n width: 12px;\n margin: 3px 5px 2px 2px;\n flex: none;\n pointer-events: none;\n}\n\n.devices-list-title {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n flex: auto;\n -webkit-user-select: none;\n color: #222;\n}\n\n.devices-edit-fields {\n flex: auto;\n display: flex;\n flex-direction: column;\n align-items: stretch;\n margin-bottom: 5px;\n}\n\n.devices-edit-fields input {\n flex: auto;\n margin: 8px 5px 0 5px;\n height: 22px;\n border: 1px solid rgb(213, 213, 213);\n border-radius: 2px;\n color: #444444;\n padding: 3px;\n}\n\n.devices-edit-fields input.device-edit-small {\n flex: 0 0 80px;\n}\n\n/*# sourceURL=emulation/devicesSettingsTab.css */";Runtime.cachedResources["emulation/deviceModeToolbar.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.device-mode-size-input {\n background: hsl(0, 0%, 100%);\n border: none;\n padding: 2px 0;\n width: 39px !important;\n margin: 0 3px;\n text-align: center;\n}\n\n.device-mode-size-input.error-input {\n outline: auto 2px red;\n}\n\n.device-mode-size-input:disabled {\n background: transparent;\n -webkit-user-select: none;\n}\n\n.device-mode-x {\n margin: 0 1px;\n font-size: 16px;\n}\n\n.device-mode-device-select {\n background: none;\n box-shadow: none;\n border: none;\n outline: none;\n padding: 0 2px;\n -webkit-appearance: menulist;\n margin: 0;\n width: 120px;\n}\n\n.device-mode-checkbox {\n width: 120px;\n display: flex;\n flex-direction: row;\n justify-content: center;\n}\n\n/*# sourceURL=emulation/deviceModeToolbar.css */";Runtime.cachedResources["emulation/deviceModeView.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n overflow: hidden;\n align-items: stretch;\n flex: auto;\n background-color: #fcfcfc;\n}\n\n.device-mode-toolbar {\n flex: none;\n background-color: #f3f3f3;\n border-bottom: 1px solid #ccc;\n display: flex;\n flex-direction: row;\n align-items: stretch;\n padding: 0 4px;\n}\n\n.device-mode-toolbar .toolbar {\n padding: 0;\n overflow: hidden;\n flex: auto;\n}\n\n.device-mode-toolbar-left {\n flex: 0 1000 115px;\n min-width: 93px;\n}\n\n.device-mode-toolbar-right {\n flex: 0 1000 115px;\n min-width: 40px;\n display: flex;\n}\n\n.device-mode-toolbar-middle-container {\n flex: 1 1 160px;\n position: relative;\n}\n\n.device-mode-toolbar-middle {\n display: flex;\n justify-content: flex-start;\n overflow: hidden;\n}\n\n.device-mode-toolbar-middle .toolbar {\n flex: 0 1 auto;\n}\n\n.device-mode-toolbar-spacer {\n flex: auto;\n}\n\n.device-mode-content-clip {\n overflow: hidden;\n flex: auto;\n}\n\n.device-mode-media-container {\n flex: none;\n overflow: hidden;\n box-shadow: inset 0 -1px #ccc;\n}\n\n.device-mode-content-area {\n flex: auto;\n position: relative;\n margin: 0;\n}\n\n.device-mode-screen-area {\n position: absolute;\n left: 0;\n right: 0;\n width: 0;\n height: 0;\n background-color: #171717;\n box-shadow: hsl(0, 0%, 88%) 1px 1px 0 1px, hsla(0, 0%, 80%, 0.6) 0 0 16px;\n}\n\n.device-mode-screen-image {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n\n.device-mode-resizer {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background-color 0.1s ease;\n}\n\n.device-mode-resizer:hover {\n background-color: hsla(0, 0%, 0%, 0.1);\n}\n\n.device-mode-resizer > div {\n content: url(Images/toolbarResizerHorizontal.png);\n pointer-events: none;\n margin: 0 0 0 1px;\n}\n\n.device-mode-width-resizer {\n top: 0;\n bottom: 0;\n right: -14px;\n width: 14px;\n}\n\n.device-mode-height-resizer {\n left: 0;\n right: 0;\n bottom: -14px;\n height: 14px;\n}\n\n.device-mode-height-resizer > div {\n transform: rotate(90deg);\n margin: 1px 0 0 0;\n}\n\n.device-mode-corner-resizer {\n left: 0;\n top: 0;\n right: -14px;\n bottom: -14px;\n background-color: hsla(0, 0%, 0%, 0.02);\n}\n\n.device-mode-corner-resizer > div {\n position: absolute;\n right: 2px;\n bottom: 2px;\n transform: rotate(45deg);\n}\n\n.device-mode-page-area {\n position: absolute;\n left: 0;\n right: 0;\n width: 0;\n height: 0;\n display: flex;\n background-color: #fcfcfc;\n}\n\n.device-mode-ruler {\n pointer-events: none;\n position: relative;\n}\n\n.device-mode-ruler-top {\n flex: 0 0 20px;\n}\n\n.device-mode-ruler-left {\n position: absolute;\n left: 0;\n width: 20px;\n top: 0;\n bottom: 0;\n transform: translateX(-20px);\n}\n\n.device-mode-ruler-marker {\n position: absolute;\n}\n\n.device-mode-ruler-top .device-mode-ruler-marker {\n width: 0;\n height: 5px;\n bottom: 0;\n border-right: 1px solid hsl(0, 0%, 50%);\n margin-right: -1px;\n}\n\n.device-mode-ruler-top .device-mode-ruler-marker.device-mode-ruler-marker-medium {\n height: 10px;\n}\n\n.device-mode-ruler-top .device-mode-ruler-marker.device-mode-ruler-marker-large {\n height: 15px;\n}\n\n.device-mode-ruler-left .device-mode-ruler-marker {\n height: 0;\n width: 5px;\n right: 0;\n border-bottom: 1px solid hsl(0, 0%, 50%);\n margin-bottom: -1px;\n}\n\n.device-mode-ruler-left .device-mode-ruler-marker.device-mode-ruler-marker-medium {\n width: 10px;\n}\n\n.device-mode-ruler-left .device-mode-ruler-marker.device-mode-ruler-marker-large {\n width: 15px;\n}\n\n.device-mode-ruler-text {\n font-size: 11px;\n color: hsl(0, 0%, 50%);\n position: relative;\n pointer-events: auto;\n}\n\n.device-mode-ruler-text:hover {\n color: hsl(0, 0%, 10%);\n}\n\n.device-mode-ruler-top .device-mode-ruler-text {\n left: 2px;\n top: -2px;\n}\n\n.device-mode-ruler-left .device-mode-ruler-text {\n left: -4px;\n top: -15px;\n transform: rotate(270deg);\n}\n\n/*# sourceURL=emulation/deviceModeView.css */";Runtime.cachedResources["emulation/mediaQueryInspector.css"]="/*\n * Copyright 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n/* Media query bars */\n\n.media-inspector-view {\n height: 50px;\n}\n\n.media-inspector-marker-container {\n position: relative;\n height: 14px;\n margin: 2px 0;\n}\n\n.media-inspector-marker {\n position: absolute;\n top: 1px;\n bottom: 1px;\n white-space: nowrap;\n z-index: auto;\n}\n\n.media-inspector-marker:hover {\n top: -1px;\n bottom: -1px;\n opacity: 1;\n}\n\n.media-inspector-marker-max-width {\n background-color: hsl(207, 90%, 77%);\n border-right: 2px solid hsl(207, 90%, 61%);\n}\n\n.media-inspector-marker-max-width.media-inspector-marker-inactive:not(:hover) {\n background-color: hsl(199, 94%, 94%);\n}\n\n.media-inspector-marker-min-max-width {\n background-color: hsl(88, 50%, 76%);\n border-left: 2px solid #689F38;\n border-right: 2px solid hsl(92, 48%, 42%);\n}\n\n.media-inspector-marker-min-max-width.media-inspector-marker-inactive:not(:hover) {\n background-color: hsl(125, 39%, 94%);\n}\n\n.media-inspector-marker-min-max-width:hover {\n z-index: 1;\n}\n\n.media-inspector-marker-min-width {\n background-color: hsl(36, 100%, 75%);\n border-left: 2px solid hsl(30, 100%, 48%);\n}\n\n.media-inspector-marker-min-width.media-inspector-marker-inactive:not(:hover) {\n background-color: hsl(37, 100%, 94%);\n}\n\n/* Media query labels */\n\n.media-inspector-marker:not(:hover) .media-inspector-marker-label-container {\n display: none;\n}\n\n.media-inspector-marker-label-container {\n position: absolute;\n z-index: 1;\n}\n\n.media-inspector-marker-label-container-left {\n left: -2px;\n}\n\n.media-inspector-marker-label-container-right {\n right: -2px;\n}\n\n.media-inspector-marker-label {\n color: #222;\n position: absolute;\n top: 1px;\n bottom: 0;\n font-size: 12px;\n pointer-events: none;\n}\n\n.media-inspector-label-right {\n right: 4px;\n}\n\n.media-inspector-label-left {\n left: 4px;\n}\n\n/*# sourceURL=emulation/mediaQueryInspector.css */";Runtime.cachedResources["emulation/responsiveDesignView.css"]="/*\n * Copyright 2014 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.responsive-design {\n position: relative;\n background-color: rgb(0, 0, 0);\n overflow: hidden;\n}\n\n.responsive-design-view {\n overflow: hidden;\n}\n\n.responsive-design-canvas {\n pointer-events: none;\n}\n\n.responsive-design-sliders-container {\n position: absolute;\n overflow: visible;\n}\n\n.responsive-design-generic-outline-container {\n position: absolute;\n overflow: hidden;\n top: 0;\n left: 0;\n right: -19px;\n bottom: -19px;\n}\n\n.responsive-design-generic-outline {\n position: absolute;\n top: -10px;\n left: -10px;\n right: 5px;\n bottom: 5px;\n border-radius: 8px;\n background-color: rgb(51, 51, 51);\n box-shadow: rgb(20, 20, 20) 3px 3px 4px;\n}\n\n.responsive-design-slider-width {\n position: absolute;\n top: 0;\n bottom: 0;\n right: -14px;\n width: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.responsive-design-slider-height {\n position: absolute;\n left: 0;\n right: 0;\n bottom: -14px;\n height: 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.responsive-design-slider-corner {\n position: absolute;\n right: -14px;\n width: 14px;\n bottom: -14px;\n height: 14px;\n}\n\n.responsive-design-thumb-handle {\n content: url(Images/toolbarResizerHorizontal.png);\n pointer-events: none;\n}\n\n.responsive-design-slider-height .responsive-design-thumb-handle {\n transform: rotate(90deg);\n}\n\n.responsive-design-page-container {\n background-color: #171717;\n}\n\n.responsive-design-page-container-image {\n position: absolute;;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n\n.responsive-design-page-scale-container {\n position: absolute !important;\n top: 0;\n right: 0;\n padding: 10px;\n background-color: rgba(0, 0, 0, 0.3);\n align-items: center;\n}\n\n.responsive-design-page-scale-label {\n display: block;\n height: 20px;\n margin: 0 4px;\n padding-top: 3px;\n color: white;\n cursor: default !important;\n}\n\n.responsive-design-page-scale-container .responsive-design-page-scale-button > .glyph {\n display: block;\n width: 18px;\n height: 18px;\n border: 1px solid transparent;\n border-radius: 2px;\n}\n\n.responsive-design-page-scale-container .responsive-design-page-scale-button:not(:disabled):hover {\n box-shadow: rgb(255, 255, 255) 0 0 3px;\n}\n\n.responsive-design-page-scale-container .responsive-design-page-scale-button {\n border: none;\n background-color: transparent;\n padding: 2px 0 0 0;\n}\n\n.responsive-design-page-scale-container .responsive-design-page-scale-button > .glyph {\n background-color: rgb(180, 180, 180);\n -webkit-mask-image: url(Images/responsiveDesign.png);\n -webkit-mask-size: 112px 16px;\n opacity: 1;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.responsive-design-page-scale-container .responsive-design-page-scale-button > .glyph {\n -webkit-mask-image: url(Images/responsiveDesign_2x.png);\n}\n} /* media */\n\n.responsive-design-page-scale-increase > .glyph {\n -webkit-mask-position: -80px 0;\n}\n\n.responsive-design-page-scale-decrease > .glyph {\n -webkit-mask-position: -96px 0;\n}\n\n/* Toolbar */\n\n.responsive-design-toolbar {\n display: flex;\n flex: none;\n background: linear-gradient(to bottom, rgb(83, 81, 81), rgb(59, 59, 59));\n color: rgb(255, 255, 255);\n overflow: hidden;\n border-bottom: 1px solid rgb(71, 71, 71);\n}\n\n.responsive-design-separator {\n flex: none;\n width: 3px;\n background-color: rgb(46, 46, 46);\n border-right: 1px solid rgb(75, 75, 75);\n}\n\n.responsive-design-section {\n display: flex;\n flex: none;\n flex-direction: column;\n white-space: nowrap;\n align-items: stretch;\n justify-content: flex-start;\n padding-top: 1px;\n}\n\n.responsive-design-section-decorator {\n height: 2px;\n margin-left: -2px;\n margin-right: -1px;\n position: relative;\n}\n\n.responsive-design-suite {\n display: flex;\n flex-direction: row;\n padding: 2px 11px;\n color: rgb(180, 180, 180);\n}\n\n.responsive-design-suite.responsive-design-suite-top {\n color: rgb(255, 255, 255);\n}\n\n.responsive-design-suite-separator {\n flex: none;\n width: 1px;\n background-color: rgb(43, 43, 43);\n margin: 0 6px;\n}\n\n.responsive-design-suite > div:not(.responsive-design-suite-separator) {\n flex: none;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n height: 23px;\n overflow: hidden;\n}\n\n/* Toolbar controls */\n\n.responsive-design-toolbar fieldset,\n.responsive-design-toolbar p {\n margin: 0;\n border: 0;\n padding: 0;\n display: inline-block;\n}\n\n.responsive-design-toolbar .field-error-message {\n display: none;\n}\n\n.responsive-design-toolbar label {\n cursor: default !important;\n margin: 0 2px;\n}\n\n.responsive-design-toolbar input[type='text'] {\n text-align: left;\n background-color: transparent;\n border: none;\n margin: 0 1px 1px 0;\n padding: 3px 2px;\n}\n\n.responsive-design-toolbar input[type='text'].numeric {\n text-align: center;\n}\n\n.responsive-design-toolbar input:focus::-webkit-input-placeholder {\n color: transparent !important;\n}\n\n.responsive-design-toolbar fieldset:disabled input,\n.responsive-design-toolbar fieldset:disabled button {\n opacity: 0.7;\n}\n\n.responsive-design-toolbar input.error-input {\n color: red !important;\n text-decoration: line-through;\n}\n\n.responsive-design-toolbar select {\n height: 18px;\n background-color: rgb(87, 87, 87);\n border: 0;\n margin-left: 10px;\n line-height: 16px;\n}\n\n.responsive-design-toolbar input:focus {\n background-color: rgb(81, 81, 81);\n}\n\n/* Toolbar icons */\n\n.responsive-design-icon {\n background-color: rgb(180, 180, 180);\n -webkit-mask-image: url(Images/responsiveDesign.png);\n -webkit-mask-size: 112px 16px;\n}\n\n.responsive-design-icon {\n display: inline-block;\n width: 16px;\n height: 16px;\n position: relative;\n top: 3px;\n}\n\ndiv.responsive-design-icon:disabled {\n opacity: 1 !important;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.responsive-design-icon {\n -webkit-mask-image: url(Images/responsiveDesign_2x.png);\n}\n} /* media */\n\n.responsive-design-icon-resolution {\n -webkit-mask-position: 0 0;\n}\n\n.responsive-design-icon-dpr {\n -webkit-mask-position: -16px 0;\n}\n\n.responsive-design-icon-swap {\n background-color: rgb(255, 170, 0);\n -webkit-mask-position: -32px 0;\n -webkit-appearance: none;\n padding: 0;\n border: 0;\n}\n\n.responsive-design-icon-swap {\n margin-left: 1px;\n top: 4px;\n}\n\n.responsive-design-icon-swap:hover {\n background-color: rgb(255, 180, 0);\n}\n\n.responsive-design-icon-swap:active {\n opacity: 0.8;\n}\n\n/* Buttons section */\n\n.responsive-design-section-buttons {\n padding: 4px 0 0 0;\n background: rgb(17, 17, 17);\n}\n\n.responsive-design-more-button-container {\n flex: auto;\n display: flex;\n justify-content: flex-end;\n align-items: flex-end;\n overflow: hidden;\n}\n\n.responsive-design-more-button {\n -webkit-appearance: none;\n border: 0;\n background-color: transparent;\n color: white;\n opacity: 0.8;\n font-size: 16px;\n text-shadow: black 1px 1px;\n}\n\n.responsive-design-more-button:hover {\n opacity: 1;\n}\n\n.responsive-design-more-button:active {\n opacity: 0.8;\n}\n\n/* Device section */\n\n.responsive-design-section-device .responsive-design-section-decorator {\n background: linear-gradient(to bottom, rgb(255, 186, 68), rgb(255, 119, 0));\n margin-left: 0;\n}\n\n.responsive-design-section-device .device-select {\n width: 140px;\n}\n\n.responsive-design-section-device .mode-container {\n display: inline-block;\n width: 116px;\n padding: 0 10px;\n}\n\n.responsive-design-section-device .mode-select select {\n width: 82px;\n}\n\n.responsive-design-section-device .mode-select label {\n margin-left: 4px;\n color: rgb(255, 156, 0);\n position: relative;\n top: 1px;\n}\n\n.responsive-design-section-device input[type='text'],\n.responsive-design-section-device input[type='text']::-webkit-input-placeholder,\n.responsive-design-section-device select {\n color: rgb(255, 156, 0);\n}\n\n.responsive-design-section-device input[type='checkbox']:checked:after {\n background: rgb(255, 156, 0);\n}\n\n/* Network section */\n\n.responsive-design-section-network .responsive-design-section-decorator {\n background: linear-gradient(to bottom, rgb(77, 170, 243), rgb(0, 130, 255));\n}\n\n.responsive-design-section-network .responsive-design-suite a {\n height: 20px;\n background-color: transparent;\n border: 0;\n line-height: 16px;\n color: rgb(66, 175, 255);\n cursor: pointer;\n border-radius: 2px;\n text-decoration: underline;\n}\n\n/* Warning message */\n\n.responsive-design-warning {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n overflow: hidden;\n border-bottom: 1px solid rgb(187, 187, 187);\n}\n\n/* Media query inspector */\n\n.responsive-design-media-container {\n position: absolute;\n right: 0;\n top: 0;\n padding-bottom: 5px;\n overflow: hidden;\n}\n\n/*# sourceURL=emulation/responsiveDesignView.css */";Runtime.cachedResources["emulation/overrides.css"]="/*\n * Copyright (C) 2013 Google Inc. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following disclaimer\n * in the documentation and/or other materials provided with the\n * distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n.overrides-view fieldset {\n border: none;\n flex: 0 0 auto;\n padding: 0;\n margin: 0;\n}\n\n.overrides-view fieldset p {\n display: inline-block;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n.overrides-device-model-settings p label {\n display: inline-block;\n}\n\n.overrides-view .field-error-message {\n display: none;\n}\n\n.overrides-view input[type='text']:focus::-webkit-input-placeholder {\n color: transparent !important;\n}\n\n.overrides-view > .tabbed-pane {\n overflow: hidden;\n}\n\n/* Device tab */\n\n.overrides-device {\n flex: 1 1 auto;\n overflow: auto;\n padding: 12px;\n}\n\n.overrides-device input.numeric {\n text-align: right;\n}\n\n.overrides-device input[type=range] {\n width: 100%;\n}\n\n.overrides-device > label {\n display: block;\n margin-bottom: 7px;\n white-space: nowrap;\n}\n\n.overrides-device label {\n margin-bottom: 10px;\n}\n\n.overrides-device table {\n margin-bottom: 5px;\n white-space: nowrap !important;\n}\n\n.overrides-device > label {\n margin-bottom: 4px;\n}\n\n.overrides-device .help-footnote {\n border-top: 1px solid #EEEEEE;\n margin: 0;\n padding: 12px;\n}\n\n.overrides-view label {\n display: flex;\n height: auto;\n}\n\n.overrides-view fieldset[disabled] * {\n cursor: default !important;\n}\n\n.overrides-device .overrides-device-model-section {\n white-space: nowrap;\n}\n\n.overrides-device .overrides-device-model-section > span {\n padding-right: 10px;\n}\n\n.overrides-device .overrides-device-model-section select {\n height: 20px;\n}\n\n.overrides-device .overrides-device-model-section select.device-select {\n width: 180px;\n margin-right: 6px;\n}\n\n.overrides-device .overrides-device-model-section .mode-container {\n display: inline-block;\n width: 140px;\n}\n\n.overrides-device .overrides-device-model-section .mode-container label {\n margin: 0;\n display: inline-block;\n}\n\nfieldset.overrides-device-model-settings {\n padding: 16px;\n}\n\n.overrides-device-model-settings > fieldset {\n margin-left: 16px;\n}\n\n.overrides-view input[type=text]:enabled:focus,\n.overrides-view select:enabled:focus {\n -webkit-transition: border-color 200ms;\n border-color: rgb(77, 144, 254);\n outline: none;\n}\n\n.overrides-view input[type=text],\n.overrides-view select {\n border: 1px solid #bfbfbf;\n border-radius: 2px;\n box-sizing: border-box;\n color: #444;\n font: inherit;\n border-width: 1px;\n}\n\n.overrides-view input[type=text] {\n margin-left: 3px;\n min-height: 2em;\n padding: 3px;\n}\n\n.overrides-view input[readonly] {\n background-color: rgb(235, 235, 228);\n}\n\n.overrides-view .overrides-footer {\n flex: 0 0 auto;\n padding: 5px 8px;\n border-top: 1px solid rgb(203,203,203);\n background-color: #eee;\n}\n\n.overrides-view .overrides-footer::before {\n background-image: url(Images/toolbarButtonGlyphs.png);\n background-size: 352px 168px;\n width: 10px;\n height: 10px;\n content: \"\";\n position: relative;\n top: 2px;\n background-position: -202px -107px;\n float: left;\n margin-right: 4px;\n}\n\n@media (-webkit-min-device-pixel-ratio: 1.5) {\n.overrides-view .overrides-footer::before {\n background-image: url(Images/toolbarButtonGlyphs_2x.png);\n}\n} /* media */\n\n.overrides-view .overrides-footer label[is=dt-icon-label] {\n margin-right: 3px;\n}\n\n.overrides-splash-screen {\n flex: auto;\n padding: 12px;\n}\n\n.overrides-splash-screen .toolbar {\n display: inline-block;\n margin-left: -4px;\n position: relative;\n top: 8px;\n}\n\n#overrides-disable-button {\n margin-bottom: 12px;\n}\n\n/*# sourceURL=emulation/overrides.css */";Runtime.cachedResources["emulation/sensors.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.sensors-view {\n padding: 12px;\n}\n\n.sensors-view label {\n margin-bottom: 10px;\n}\n\n.sensors-view input {\n text-align: right;\n}\n\n.sensors-view input[type=text]:enabled:focus,\n.sensors-view select:enabled:focus {\n border-color: rgb(77, 144, 254);\n outline: none;\n}\n\n.sensors-view input[type=text],\n.sensors-view select {\n border: 1px solid #bfbfbf;\n border-radius: 2px;\n box-sizing: border-box;\n color: #444;\n font: inherit;\n border-width: 1px;\n}\n\n.sensors-view input[type=text] {\n margin-left: 3px;\n min-height: 2em;\n padding: 3px;\n}\n\n.sensors-view input[readonly] {\n background-color: rgb(235, 235, 228);\n}\n\n.sensors-view fieldset {\n border: none;\n padding: 0 0 5px 15px;\n flex: 0 0 auto;\n}\n\n.sensors-view fieldset[disabled] {\n opacity: 0.5;\n}\n\n.sensors-view .field-error-message {\n display: none;\n}\n\n.sensors-view input[type='text']:focus::-webkit-input-placeholder {\n color: transparent !important;\n}\n\n/* Accelerometer */\n\n.accelerometer-stage {\n -webkit-perspective: 700px;\n -webkit-perspective-origin: 50% 50%;\n width: 200px;\n height: 130px;\n}\n\nfieldset.device-orientation-override-section[disabled] .accelerometer-stage {\n cursor: default !important;\n}\n\n.accelerometer-box {\n pointer-events:none;\n margin-top: -54px;\n margin-left: -40px;\n position: absolute;\n top: 50%;\n left: 50%;\n width: 80px;\n height: 108px;\n -webkit-transform-style: preserve-3d;\n}\n\n.accelerometer-box section {\n margin-top: -54px;\n margin-left: -40px;\n position: absolute;\n display: block;\n overflow: hidden;\n top: 50%;\n left: 50%;\n -webkit-transform-style: flat;\n -webkit-box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.7);\n}\n\n.accelerometer-box .front {\n border:15px solid black;\n width: 80px;\n height: 107px;\n background-color: gray;\n transform: translate3d(0, 0, 10px);\n}\n\n.accelerometer-box .back {\n width: 80px;\n height: 107px;\n background-color: black;\n transform: rotateY(-180deg) translate3d(0, 0, 10px);\n}\n\n.accelerometer-box .top {\n overflow: hidden;\n width: 80px;\n height: 20px;\n background-color: #75CE89;\n transform: rotateX(-90deg) translate3d(0, 0, -10px);\n}\n\n.accelerometer-box .bottom {\n overflow: hidden;\n width: 80px;\n height: 20px;\n background-color: #865C6C;\n transform: rotateX(90deg) translate3d(0, 0, -97px);\n}\n\n.accelerometer-box .left {\n width: 20px;\n height: 107px;\n background-color: #7992CB;\n transform: rotateY(90deg) translate3d(0, 0, 70px);\n}\n\n.accelerometer-box .right {\n width: 20px;\n height: 107px;\n background-color: #7992CB;\n transform: rotateY(-90deg) translate3d(0, 0, 10px);\n}\n\n.accelerometer-axis-input-container {\n margin-bottom: 10px;\n}\n\nfieldset.device-orientation-override-section {\n display: flex;\n}\n/*# sourceURL=emulation/sensors.css */";Runtime.cachedResources["main/errorWarningCounter.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n:host {\n cursor: pointer;\n padding: 0 2px;\n min-width: 26px;\n}\n\n:host:hover {\n color: #333;\n}\n\n.counter-item {\n margin-left: 6px;\n}\n\n.counter-item label {\n cursor: inherit;\n}\n\n.counter-item.counter-item-first {\n margin-left: 0;\n}\n\n/*# sourceURL=main/errorWarningCounter.css */";Runtime.cachedResources["main/remoteDebuggingTerminatedScreen.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.widget {\n padding: 25px;\n}\n\n.message {\n font-size: larger;\n white-space: pre;\n margin: 5px;\n}\n\n.reason {\n color: #8b0000;\n}\n\n/*# sourceURL=main/remoteDebuggingTerminatedScreen.css */";Runtime.cachedResources["main/renderingOptions.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\nlabel {\n margin: 12px 0 0 0;\n padding: 0 4px 0 12px;\n}\n\n/*# sourceURL=main/renderingOptions.css */";Runtime.cachedResources["main/targetCrashedScreen.css"]="/*\n * Copyright (c) 2015 The Chromium Authors. All rights reserved.\n * Use of this source code is governed by a BSD-style license that can be\n * found in the LICENSE file.\n */\n\n.widget {\n padding: 25px;\n}\n\n.message {\n font-size: larger;\n white-space: pre;\n margin: 5px;\n}\n\n/*# sourceURL=main/targetCrashedScreen.css */";Runtime.startApplication("inspector");